@thefittingroom/shop-ui 1.3.7 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/locale.d.ts +2 -0
- package/dist/esm/index.js +29 -12386
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +185 -185
- package/package.json +1 -1
package/dist/esm/index.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* thefittingroom v1.3.
|
|
2
|
+
* thefittingroom v1.3.8 (2024-07-05T16:22:41.849Z)
|
|
3
3
|
* Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
|
|
4
4
|
*/
|
|
5
|
-
function e
|
|
5
|
+
function t(e,n){let r=function(){0!==n.length&&t(n.slice(-1),n.slice(0,-1))};var i=new Image;i.onload=r,i.onerror=r,i.src=e}function e(e){t(e.slice(-1),e.slice(0,-1))}const n=(t,n)=>{const r=document.getElementById(t);if(!r)throw new Error(`Slider with id ${t} not found`);return{Load(t){if(!Array.isArray(t)||!t.length)return console.debug("slider has no images to load"),new Error("slider has no images to load");e(t);const i=(null==t?void 0:t.length)-2;r.value=i.toString(),r.max=(t.length-1).toString();const s=()=>{const e=parseInt(r.value);n(r,t[e])};return n(r,t[i]),r.removeEventListener("input",s),r.addEventListener("input",s),()=>{r.removeEventListener("input",s)}}}},r=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):55296==(64512&i)&&r+1<t.length&&56320==(64512&t.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&t.charCodeAt(++r)),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},i={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let e=0;e<t.length;e+=3){const i=t[e],s=e+1<t.length,o=s?t[e+1]:0,a=e+2<t.length,c=a?t[e+2]:0,l=i>>2,u=(3&i)<<4|o>>4;let h=(15&o)<<2|c>>6,d=63&c;a||(d=64,s||(h=64)),r.push(n[l],n[u],n[h],n[d])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(r(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let n=0,r=0;for(;n<t.length;){const i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&s)}else if(i>239&&i<365){const s=((7&i)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(s>>10)),e[r++]=String.fromCharCode(56320+(1023&s))}else{const s=t[n++],o=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&o)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let e=0;e<t.length;){const i=n[t.charAt(e++)],s=e<t.length?n[t.charAt(e)]:0;++e;const o=e<t.length?n[t.charAt(e)]:64;++e;const a=e<t.length?n[t.charAt(e)]:64;if(++e,null==i||null==s||null==o||null==a)throw Error();const c=i<<2|s>>4;if(r.push(c),64!==o){const t=s<<4&240|o>>2;if(r.push(t),64!==a){const t=o<<6&192|a;r.push(t)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},s=function(t){return function(t){const e=r(t);return i.encodeByteArray(e,!0)}(t).replace(/\./g,"")},o=function(t){try{return i.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};
|
|
6
6
|
/*!
|
|
7
7
|
* thefittingroom v1.2.2 (2024-07-02T15:28:01.417Z)
|
|
8
8
|
* Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
|
|
@@ -72,7 +72,7 @@ function a(){return"undefined"!=typeof navigator&&"string"==typeof navigator.use
|
|
|
72
72
|
* See the License for the specific language governing permissions and
|
|
73
73
|
* limitations under the License.
|
|
74
74
|
*/
|
|
75
|
-
const
|
|
75
|
+
const c=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,l=()=>{try{return c()||(()=>{if("undefined"==typeof process||void 0===process.env)return;const t=process.env.__FIREBASE_DEFAULTS__;return t?JSON.parse(t):void 0})()||(()=>{if("undefined"==typeof document)return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(t){return}const e=t&&o(t[1]);return e&&JSON.parse(e)})()}catch(t){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`)}},u=t=>{var e,n;return null===(n=null===(e=l())||void 0===e?void 0:e.emulatorHosts)||void 0===n?void 0:n[t]},h=()=>{var t;return null===(t=l())||void 0===t?void 0:t.config},d=t=>{var e;return null===(e=l())||void 0===e?void 0:e[`_${t}`]};
|
|
76
76
|
/**
|
|
77
77
|
* @license
|
|
78
78
|
* Copyright 2017 Google LLC
|
|
@@ -89,7 +89,7 @@ const d=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=t
|
|
|
89
89
|
* See the License for the specific language governing permissions and
|
|
90
90
|
* limitations under the License.
|
|
91
91
|
*/
|
|
92
|
-
class f{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((e
|
|
92
|
+
class f{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}wrapCallback(t){return(e,n)=>{e?this.reject(e):this.resolve(n),"function"==typeof t&&(this.promise.catch((()=>{})),1===t.length?t(e):t(e,n))}}}
|
|
93
93
|
/**
|
|
94
94
|
* @license
|
|
95
95
|
* Copyright 2021 Google LLC
|
|
@@ -105,7 +105,7 @@ class f{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Pr
|
|
|
105
105
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
106
106
|
* See the License for the specific language governing permissions and
|
|
107
107
|
* limitations under the License.
|
|
108
|
-
*/class
|
|
108
|
+
*/class p extends Error{constructor(t,e,n){super(e),this.code=t,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,p.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,g.prototype.create)}}class g{constructor(t,e,n){this.service=t,this.serviceName=e,this.errors=n}create(t,...e){const n=e[0]||{},r=`${this.service}/${t}`,i=this.errors[t],s=i?function(t,e){return t.replace(m,((t,n)=>{const r=e[n];return null!=r?String(r):`<${n}?>`}))}(i,n):"Error",o=`${this.serviceName}: ${s} (${r}).`;return new p(r,o,n)}}const m=/\{\$([^}]+)}/g;function y(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const i of n){if(!r.includes(i))return!1;const n=t[i],s=e[i];if(v(n)&&v(s)){if(!y(n,s))return!1}else if(n!==s)return!1}for(const t of r)if(!n.includes(t))return!1;return!0}function v(t){return null!==t&&"object"==typeof t}
|
|
109
109
|
/**
|
|
110
110
|
* @license
|
|
111
111
|
* Copyright 2017 Google LLC
|
|
@@ -121,7 +121,7 @@ class f{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Pr
|
|
|
121
121
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
122
122
|
* See the License for the specific language governing permissions and
|
|
123
123
|
* limitations under the License.
|
|
124
|
-
*/function
|
|
124
|
+
*/function w(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach((t=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(t))})):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function b(t){const e={};return t.replace(/^\?/,"").split("&").forEach((t=>{if(t){const[n,r]=t.split("=");e[decodeURIComponent(n)]=decodeURIComponent(r)}})),e}function _(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}class S{constructor(t,e){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((()=>{t(this)})).catch((t=>{this.error(t)}))}next(t){this.forEachObserver((e=>{e.next(t)}))}error(t){this.forEachObserver((e=>{e.error(t)})),this.close(t)}complete(){this.forEachObserver((t=>{t.complete()})),this.close()}subscribe(t,e,n){let r;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");r=function(t,e){if("object"!=typeof t||null===t)return!1;for(const n of e)if(n in t&&"function"==typeof t[n])return!0;return!1}(t,["next","error","complete"])?t:{next:t,error:e,complete:n},void 0===r.next&&(r.next=E),void 0===r.error&&(r.error=E),void 0===r.complete&&(r.complete=E);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(t){}})),this.observers.push(r),i}unsubscribeOne(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let e=0;e<this.observers.length;e++)this.sendOne(e,t)}sendOne(t,e){this.task.then((()=>{if(void 0!==this.observers&&void 0!==this.observers[t])try{e(this.observers[t])}catch(t){"undefined"!=typeof console&&console.error&&console.error(t)}}))}close(t){this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}function E(){}
|
|
125
125
|
/**
|
|
126
126
|
* @license
|
|
127
127
|
* Copyright 2021 Google LLC
|
|
@@ -137,7 +137,7 @@ class f{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Pr
|
|
|
137
137
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
138
138
|
* See the License for the specific language governing permissions and
|
|
139
139
|
* limitations under the License.
|
|
140
|
-
*/function
|
|
140
|
+
*/function I(t){return t&&t._delegate?t._delegate:t}class T{constructor(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}
|
|
141
141
|
/**
|
|
142
142
|
* @license
|
|
143
143
|
* Copyright 2019 Google LLC
|
|
@@ -153,7 +153,7 @@ class f{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Pr
|
|
|
153
153
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
154
154
|
* See the License for the specific language governing permissions and
|
|
155
155
|
* limitations under the License.
|
|
156
|
-
*/const
|
|
156
|
+
*/const k="[DEFAULT]";
|
|
157
157
|
/**
|
|
158
158
|
* @license
|
|
159
159
|
* Copyright 2019 Google LLC
|
|
@@ -169,7 +169,7 @@ class f{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Pr
|
|
|
169
169
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
170
170
|
* See the License for the specific language governing permissions and
|
|
171
171
|
* limitations under the License.
|
|
172
|
-
*/class C{constructor(e
|
|
172
|
+
*/class C{constructor(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){const t=new f;if(this.instancesDeferred.set(e,t),this.isInitialized(e)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:e});n&&t.resolve(n)}catch(t){}}return this.instancesDeferred.get(e).promise}getImmediate(t){var e;const n=this.normalizeInstanceIdentifier(null==t?void 0:t.identifier),r=null!==(e=null==t?void 0:t.optional)&&void 0!==e&&e;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(t){if(r)return null;throw t}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,this.shouldAutoInitialize()){if(function(t){return"EAGER"===t.instantiationMode}
|
|
173
173
|
/**
|
|
174
174
|
* @license
|
|
175
175
|
* Copyright 2019 Google LLC
|
|
@@ -185,7 +185,7 @@ class f{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Pr
|
|
|
185
185
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
186
186
|
* See the License for the specific language governing permissions and
|
|
187
187
|
* limitations under the License.
|
|
188
|
-
*/(
|
|
188
|
+
*/(t))try{this.getOrInitializeService({instanceIdentifier:k})}catch(t){}for(const[t,e]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(t);try{const t=this.getOrInitializeService({instanceIdentifier:n});e.resolve(t)}catch(t){}}}}clearInstance(t=k){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter((t=>"INTERNAL"in t)).map((t=>t.INTERNAL.delete())),...t.filter((t=>"_delete"in t)).map((t=>t._delete()))])}isComponentSet(){return null!=this.component}isInitialized(t=k){return this.instances.has(t)}getOptions(t=k){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:e={}}=t,n=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:n,options:e});for(const[t,e]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(t)&&e.resolve(r)}return r}onInit(t,e){var n;const r=this.normalizeInstanceIdentifier(e),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(t),this.onInitCallbacks.set(r,i);const s=this.instances.get(r);return s&&t(s,r),()=>{i.delete(t)}}invokeOnInitCallbacks(t,e){const n=this.onInitCallbacks.get(e);if(n)for(const r of n)try{r(t,e)}catch(t){}}getOrInitializeService({instanceIdentifier:t,options:e={}}){let n=this.instances.get(t);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=t,r===k?void 0:r),options:e}),this.instances.set(t,n),this.instancesOptions.set(t,e),this.invokeOnInitCallbacks(n,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,n)}catch(t){}var r;return n||null}normalizeInstanceIdentifier(t=k){return this.component?this.component.multipleInstances?t:k:t}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class A{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const e=this.getProvider(t.name);if(e.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);e.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const e=new C(t,this);return this.providers.set(t,e),e}getProviders(){return Array.from(this.providers.values())}}
|
|
189
189
|
/**
|
|
190
190
|
* @license
|
|
191
191
|
* Copyright 2017 Google LLC
|
|
@@ -201,7 +201,7 @@ class f{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Pr
|
|
|
201
201
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
202
|
* See the License for the specific language governing permissions and
|
|
203
203
|
* limitations under the License.
|
|
204
|
-
*/var
|
|
204
|
+
*/var R;!function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"}(R||(R={}));const N={debug:R.DEBUG,verbose:R.VERBOSE,info:R.INFO,warn:R.WARN,error:R.ERROR,silent:R.SILENT},L=R.INFO,O={[R.DEBUG]:"log",[R.VERBOSE]:"log",[R.INFO]:"info",[R.WARN]:"warn",[R.ERROR]:"error"},D=(t,e,...n)=>{if(e<t.logLevel)return;const r=(new Date).toISOString(),i=O[e];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);console[i](`[${r}] ${t.name}:`,...n)};class x{constructor(t){this.name=t,this._logLevel=L,this._logHandler=D,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in R))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?N[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,R.DEBUG,...t),this._logHandler(this,R.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,R.VERBOSE,...t),this._logHandler(this,R.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,R.INFO,...t),this._logHandler(this,R.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,R.WARN,...t),this._logHandler(this,R.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,R.ERROR,...t),this._logHandler(this,R.ERROR,...t)}}const P=(t,e)=>e.some((e=>t instanceof e));let M,U;const F=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap;let j={get(t,e,n){if(t instanceof IDBTransaction){if("done"===e)return z.get(t);if("objectStoreNames"===e)return t.objectStoreNames||B.get(t);if("store"===e)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return K(t[e])},set:(t,e,n)=>(t[e]=n,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function q(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(U||(U=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(G(this),e),K(F.get(this))}:function(...e){return K(t.apply(G(this),e))}:function(e,...n){const r=t.call(G(this),e,...n);return B.set(r,e.sort?e.sort():[e]),K(r)}}function $(t){return"function"==typeof t?q(t):(t instanceof IDBTransaction&&function(t){if(z.has(t))return;const e=new Promise(((e,n)=>{const r=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",s),t.removeEventListener("abort",s)},i=()=>{e(),r()},s=()=>{n(t.error||new DOMException("AbortError","AbortError")),r()};t.addEventListener("complete",i),t.addEventListener("error",s),t.addEventListener("abort",s)}));z.set(t,e)}(t),P(t,M||(M=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(t,j):t)}function K(t){if(t instanceof IDBRequest)return function(t){const e=new Promise(((e,n)=>{const r=()=>{t.removeEventListener("success",i),t.removeEventListener("error",s)},i=()=>{e(K(t.result)),r()},s=()=>{n(t.error),r()};t.addEventListener("success",i),t.addEventListener("error",s)}));return e.then((e=>{e instanceof IDBCursor&&F.set(e,t)})).catch((()=>{})),H.set(e,t),e}(t);if(V.has(t))return V.get(t);const e=$(t);return e!==t&&(V.set(t,e),H.set(e,t)),e}const G=t=>H.get(t);const W=["get","getKey","getAll","getAllKeys","count"],Q=["put","add","delete","clear"],Y=new Map;function J(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(Y.get(e))return Y.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=Q.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!W.includes(n))return;const s=async function(t,...e){const s=this.transaction(t,i?"readwrite":"readonly");let o=s.store;return r&&(o=o.index(e.shift())),(await Promise.all([o[n](...e),i&&s.done]))[0]};return Y.set(e,s),s}j=(t=>({...t,get:(e,n,r)=>J(e,n)||t.get(e,n,r),has:(e,n)=>!!J(e,n)||t.has(e,n)}))(j);
|
|
205
205
|
/**
|
|
206
206
|
* @license
|
|
207
207
|
* Copyright 2019 Google LLC
|
|
@@ -218,7 +218,7 @@ class f{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Pr
|
|
|
218
218
|
* See the License for the specific language governing permissions and
|
|
219
219
|
* limitations under the License.
|
|
220
220
|
*/
|
|
221
|
-
class X{constructor(
|
|
221
|
+
class X{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map((t=>{if(function(t){const e=t.getComponent();return"VERSION"===(null==e?void 0:e.type)}(t)){const e=t.getImmediate();return`${e.library}/${e.version}`}return null})).filter((t=>t)).join(" ")}}const Z="@firebase/app",tt="0.9.0",et=new x("@firebase/app"),nt="@firebase/app-compat",rt="@firebase/analytics-compat",it="@firebase/analytics",st="@firebase/app-check-compat",ot="@firebase/app-check",at="@firebase/auth",ct="@firebase/auth-compat",lt="@firebase/database",ut="@firebase/database-compat",ht="@firebase/functions",dt="@firebase/functions-compat",ft="@firebase/installations",pt="@firebase/installations-compat",gt="@firebase/messaging",mt="@firebase/messaging-compat",yt="@firebase/performance",vt="@firebase/performance-compat",wt="@firebase/remote-config",bt="@firebase/remote-config-compat",_t="@firebase/storage",St="@firebase/storage-compat",Et="@firebase/firestore",It="@firebase/firestore-compat",Tt="firebase",kt="[DEFAULT]",Ct={[Z]:"fire-core",[nt]:"fire-core-compat",[it]:"fire-analytics",[rt]:"fire-analytics-compat",[ot]:"fire-app-check",[st]:"fire-app-check-compat",[at]:"fire-auth",[ct]:"fire-auth-compat",[lt]:"fire-rtdb",[ut]:"fire-rtdb-compat",[ht]:"fire-fn",[dt]:"fire-fn-compat",[ft]:"fire-iid",[pt]:"fire-iid-compat",[gt]:"fire-fcm",[mt]:"fire-fcm-compat",[yt]:"fire-perf",[vt]:"fire-perf-compat",[wt]:"fire-rc",[bt]:"fire-rc-compat",[_t]:"fire-gcs",[St]:"fire-gcs-compat",[Et]:"fire-fst",[It]:"fire-fst-compat","fire-js":"fire-js",[Tt]:"fire-js-all"},At=new Map,Rt=new Map;function Nt(t,e){try{t.container.addComponent(e)}catch(n){et.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Lt(t){const e=t.name;if(Rt.has(e))return et.debug(`There were multiple attempts to register component ${e}.`),!1;Rt.set(e,t);for(const e of At.values())Nt(e,t);return!0}function Ot(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}
|
|
222
222
|
/**
|
|
223
223
|
* @license
|
|
224
224
|
* Copyright 2019 Google LLC
|
|
@@ -234,7 +234,7 @@ class X{constructor(e){this.container=e}getPlatformInfoString(){return this.cont
|
|
|
234
234
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
235
235
|
* See the License for the specific language governing permissions and
|
|
236
236
|
* limitations under the License.
|
|
237
|
-
*/const
|
|
237
|
+
*/const Dt=new g("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."});
|
|
238
238
|
/**
|
|
239
239
|
* @license
|
|
240
240
|
* Copyright 2019 Google LLC
|
|
@@ -251,7 +251,7 @@ class X{constructor(e){this.container=e}getPlatformInfoString(){return this.cont
|
|
|
251
251
|
* See the License for the specific language governing permissions and
|
|
252
252
|
* limitations under the License.
|
|
253
253
|
*/
|
|
254
|
-
class
|
|
254
|
+
class xt{constructor(t,e,n){this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},e),this._name=e.name,this._automaticDataCollectionEnabled=e.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new T("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw Dt.create("app-deleted",{appName:this._name})}}
|
|
255
255
|
/**
|
|
256
256
|
* @license
|
|
257
257
|
* Copyright 2019 Google LLC
|
|
@@ -267,7 +267,7 @@ class Oe{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e)
|
|
|
267
267
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
268
268
|
* See the License for the specific language governing permissions and
|
|
269
269
|
* limitations under the License.
|
|
270
|
-
*/const
|
|
270
|
+
*/const Pt="9.15.0";function Mt(t,e={}){let n=t;if("object"!=typeof e){e={name:e}}const r=Object.assign({name:kt,automaticDataCollectionEnabled:!1},e),i=r.name;if("string"!=typeof i||!i)throw Dt.create("bad-app-name",{appName:String(i)});if(n||(n=h()),!n)throw Dt.create("no-options");const s=At.get(i);if(s){if(y(n,s.options)&&y(r,s.config))return s;throw Dt.create("duplicate-app",{appName:i})}const o=new A(i);for(const t of Rt.values())o.addComponent(t);const a=new xt(n,r,o);return At.set(i,a),a}function Ut(t=kt){const e=At.get(t);if(!e&&t===kt)return Mt();if(!e)throw Dt.create("no-app",{appName:t});return e}function Ft(t,e,n){var r;let i=null!==(r=Ct[t])&&void 0!==r?r:t;n&&(i+=`-${n}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const t=[`Unable to register library "${i}" with version "${e}":`];return s&&t.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&t.push("and"),o&&t.push(`version name "${e}" contains illegal characters (whitespace or "/")`),void et.warn(t.join(" "))}Lt(new T(`${i}-version`,(()=>({library:i,version:e})),"VERSION"))}
|
|
271
271
|
/**
|
|
272
272
|
* @license
|
|
273
273
|
* Copyright 2021 Google LLC
|
|
@@ -283,7 +283,7 @@ class Oe{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e)
|
|
|
283
283
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
284
284
|
* See the License for the specific language governing permissions and
|
|
285
285
|
* limitations under the License.
|
|
286
|
-
*/const
|
|
286
|
+
*/const zt="firebase-heartbeat-database",Bt=1,Vt="firebase-heartbeat-store";let Ht=null;function jt(){return Ht||(Ht=function(t,e,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=K(o);return r&&o.addEventListener("upgradeneeded",(t=>{r(K(o.result),t.oldVersion,t.newVersion,K(o.transaction))})),n&&o.addEventListener("blocked",(()=>n())),a.then((t=>{s&&t.addEventListener("close",(()=>s())),i&&t.addEventListener("versionchange",(()=>i()))})).catch((()=>{})),a}(zt,Bt,{upgrade:(t,e)=>{if(0===e)t.createObjectStore(Vt)}}).catch((t=>{throw Dt.create("idb-open",{originalErrorMessage:t.message})}))),Ht}async function qt(t,e){try{const n=(await jt()).transaction(Vt,"readwrite"),r=n.objectStore(Vt);return await r.put(e,$t(t)),n.done}catch(t){if(t instanceof p)et.warn(t.message);else{const e=Dt.create("idb-set",{originalErrorMessage:null==t?void 0:t.message});et.warn(e.message)}}}function $t(t){return`${t.name}!${t.options.appId}`}
|
|
287
287
|
/**
|
|
288
288
|
* @license
|
|
289
289
|
* Copyright 2021 Google LLC
|
|
@@ -299,7 +299,7 @@ class Oe{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e)
|
|
|
299
299
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
300
300
|
* See the License for the specific language governing permissions and
|
|
301
301
|
* limitations under the License.
|
|
302
|
-
*/class
|
|
302
|
+
*/class Kt{constructor(t){this.container=t,this._heartbeatsCache=null;const e=this.container.getProvider("app").getImmediate();this._storage=new Wt(e),this._heartbeatsCachePromise=this._storage.read().then((t=>(this._heartbeatsCache=t,t)))}async triggerHeartbeat(){const t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),e=Gt();if(null===this._heartbeatsCache&&(this._heartbeatsCache=await this._heartbeatsCachePromise),this._heartbeatsCache.lastSentHeartbeatDate!==e&&!this._heartbeatsCache.heartbeats.some((t=>t.date===e)))return this._heartbeatsCache.heartbeats.push({date:e,agent:t}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter((t=>{const e=new Date(t.date).valueOf();return Date.now()-e<=2592e6})),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null===this._heartbeatsCache||0===this._heartbeatsCache.heartbeats.length)return"";const t=Gt(),{heartbeatsToSend:e,unsentEntries:n}=function(t,e=1024){const n=[];let r=t.slice();for(const i of t){const t=n.find((t=>t.agent===i.agent));if(t){if(t.dates.push(i.date),Qt(n)>e){t.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),Qt(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),r=s(JSON.stringify({version:2,heartbeats:e}));return this._heartbeatsCache.lastSentHeartbeatDate=t,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}}function Gt(){return(new Date).toISOString().substring(0,10)}class Wt{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!function(){try{return"object"==typeof indexedDB}catch(t){return!1}}()&&new Promise(((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var t;e((null===(t=i.error)||void 0===t?void 0:t.message)||"")}}catch(t){e(t)}})).then((()=>!0)).catch((()=>!1))}async read(){if(await this._canUseIndexedDBPromise){const t=await async function(t){try{return(await jt()).transaction(Vt).objectStore(Vt).get($t(t))}catch(t){if(t instanceof p)et.warn(t.message);else{const e=Dt.create("idb-get",{originalErrorMessage:null==t?void 0:t.message});et.warn(e.message)}}}(this.app);return t||{heartbeats:[]}}return{heartbeats:[]}}async overwrite(t){var e;if(await this._canUseIndexedDBPromise){const n=await this.read();return qt(this.app,{lastSentHeartbeatDate:null!==(e=t.lastSentHeartbeatDate)&&void 0!==e?e:n.lastSentHeartbeatDate,heartbeats:t.heartbeats})}}async add(t){var e;if(await this._canUseIndexedDBPromise){const n=await this.read();return qt(this.app,{lastSentHeartbeatDate:null!==(e=t.lastSentHeartbeatDate)&&void 0!==e?e:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...t.heartbeats]})}}}function Qt(t){return s(JSON.stringify({version:2,heartbeats:t})).length}
|
|
303
303
|
/**
|
|
304
304
|
* @license
|
|
305
305
|
* Copyright 2019 Google LLC
|
|
@@ -315,7 +315,7 @@ class Oe{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e)
|
|
|
315
315
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
316
316
|
* See the License for the specific language governing permissions and
|
|
317
317
|
* limitations under the License.
|
|
318
|
-
*/var Ye;Ye="",Re(new E("platform-logger",(e=>new X(e)),"PRIVATE")),Re(new E("heartbeat",(e=>new qe(e)),"PRIVATE")),Ue(Z,ee,Ye),Ue(Z,ee,"esm2017"),Ue("fire-js","");var Je=function(e,t){return Je=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Je(e,t)};function Xe(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ze(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}var et,tt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},nt=nt||{},rt=tt||self;function it(){}function st(e){var t=typeof e;return"array"==(t="object"!=t?t:e?Array.isArray(e)?"array":t:"null")||"object"==t&&"number"==typeof e.length}function ot(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var at="closure_uid_"+(1e9*Math.random()>>>0),dt=0;function ct(e,t,n){return e.call.apply(e.bind,arguments)}function lt(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function ut(e,t,n){return(ut=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ct:lt).apply(null,arguments)}function ht(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function ft(e,t){function n(){}n.prototype=t.prototype,e.X=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Wb=function(e,n,r){for(var i=Array(arguments.length-2),s=2;s<arguments.length;s++)i[s-2]=arguments[s];return t.prototype[n].apply(e,i)}}function At(){this.s=this.s,this.o=this.o}At.prototype.s=!1,At.prototype.na=function(){var e;!this.s&&(this.s=!0,this.M(),0)&&(e=this,Object.prototype.hasOwnProperty.call(e,at)&&e[at]||(e[at]=++dt))},At.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()()};var Nt=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if("string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.indexOf(t,0);for(var n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1};function mt(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]}function pt(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(st(r)){var i=e.length||0,s=r.length||0;e.length=i+s;for(var o=0;o<s;o++)e[i+o]=r[o]}else e.push(r)}}function gt(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}gt.prototype.h=function(){this.defaultPrevented=!0};var $t=function(){if(!rt.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{rt.addEventListener("test",it,t),rt.removeEventListener("test",it,t)}catch(e){}return e}();function yt(e){return/^[\s\xa0]*$/.test(e)}var vt=String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]};function wt(e,t){return e<t?-1:e>t?1:0}function bt(){var e=rt.navigator;return e&&(e=e.userAgent)?e:""}function St(e){return-1!=bt().indexOf(e)}function Et(e){return Et[" "](e),e}Et[" "]=it;var Tt,Ct,It=St("Opera"),_t=St("Trident")||St("MSIE"),kt=St("Edge"),Rt=kt||_t,Lt=St("Gecko")&&!(-1!=bt().toLowerCase().indexOf("webkit")&&!St("Edge"))&&!(St("Trident")||St("MSIE"))&&!St("Edge"),Dt=-1!=bt().toLowerCase().indexOf("webkit")&&!St("Edge");function Ot(){var e=rt.document;return e?e.documentMode:void 0}e:{var xt="",Pt=(Ct=bt(),Lt?/rv:([^\);]+)(\)|;)/.exec(Ct):kt?/Edge\/([\d\.]+)/.exec(Ct):_t?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Ct):Dt?/WebKit\/(\S+)/.exec(Ct):It?/(?:Version)[ \/]?(\S+)/.exec(Ct):void 0);if(Pt&&(xt=Pt?Pt[1]:""),_t){var Mt=Ot();if(null!=Mt&&Mt>parseFloat(xt)){Tt=String(Mt);break e}}Tt=xt}var Ut,Ft={};function Bt(){return function(e){var t=Ft;return Object.prototype.hasOwnProperty.call(t,9)?t[9]:t[9]=e(9)}((function(){for(var e=0,t=vt(String(Tt)).split("."),n=vt("9").split("."),r=Math.max(t.length,n.length),i=0;0==e&&i<r;i++){var s=t[i]||"",o=n[i]||"";do{if(s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],o=/(\d*)(\D*)(.*)/.exec(o)||["","","",""],0==s[0].length&&0==o[0].length)break;e=wt(0==s[1].length?0:parseInt(s[1],10),0==o[1].length?0:parseInt(o[1],10))||wt(0==s[2].length,0==o[2].length)||wt(s[2],o[2]),s=s[3],o=o[3]}while(0==e)}return 0<=e}))}if(rt.document&&_t){var zt=Ot();Ut=zt||(parseInt(Tt,10)||void 0)}else Ut=void 0;var Vt=Ut;function Ht(e,t){if(gt.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(Lt){e:{try{Et(t.nodeName);var i=!0;break e}catch(e){}i=!1}i||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"==typeof e.pointerType?e.pointerType:Gt[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&Ht.X.h.call(this)}}ft(Ht,gt);var Gt={2:"touch",3:"pen",4:"mouse"};Ht.prototype.h=function(){Ht.X.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var jt="closure_listenable_"+(1e6*Math.random()|0),qt=0;function Kt(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ha=i,this.key=++qt,this.ba=this.ea=!1}function Wt(e){e.ba=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function Qt(e,t,n){for(var r in e)t.call(n,e[r],r,e)}function Yt(e){var t={};for(var n in e)t[n]=e[n];return t}var Jt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Xt(e,t){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])e[n]=r[n];for(var s=0;s<Jt.length;s++)n=Jt[s],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function Zt(e){this.src=e,this.g={},this.h=0}function en(e,t){var n=t.type;if(n in e.g){var r,i=e.g[n],s=Nt(i,t);(r=0<=s)&&Array.prototype.splice.call(i,s,1),r&&(Wt(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function tn(e,t,n,r){for(var i=0;i<e.length;++i){var s=e[i];if(!s.ba&&s.listener==t&&s.capture==!!n&&s.ha==r)return i}return-1}Zt.prototype.add=function(e,t,n,r,i){var s=e.toString();(e=this.g[s])||(e=this.g[s]=[],this.h++);var o=tn(e,t,r,i);return-1<o?(t=e[o],n||(t.ea=!1)):((t=new Kt(t,this.src,s,!!r,i)).ea=n,e.push(t)),t};var nn="closure_lm_"+(1e6*Math.random()|0),rn={};function sn(e,t,n,r,i){if(r&&r.once)return an(e,t,n,r,i);if(Array.isArray(t)){for(var s=0;s<t.length;s++)sn(e,t[s],n,r,i);return null}return n=An(n),e&&e[jt]?e.N(t,n,ot(r)?!!r.capture:!!r,i):on(e,t,n,!1,r,i)}function on(e,t,n,r,i,s){if(!t)throw Error("Invalid event type");var o=ot(i)?!!i.capture:!!i,a=hn(e);if(a||(e[nn]=a=new Zt(e)),(n=a.add(t,n,r,o,s)).proxy)return n;if(r=function(){function e(n){return t.call(e.src,e.listener,n)}var t=un;return e}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)$t||(i=o),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(ln(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function an(e,t,n,r,i){if(Array.isArray(t)){for(var s=0;s<t.length;s++)an(e,t[s],n,r,i);return null}return n=An(n),e&&e[jt]?e.O(t,n,ot(r)?!!r.capture:!!r,i):on(e,t,n,!0,r,i)}function dn(e,t,n,r,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)dn(e,t[s],n,r,i);else r=ot(r)?!!r.capture:!!r,n=An(n),e&&e[jt]?(e=e.i,(t=String(t).toString())in e.g&&(-1<(n=tn(s=e.g[t],n,r,i))&&(Wt(s[n]),Array.prototype.splice.call(s,n,1),0==s.length&&(delete e.g[t],e.h--)))):e&&(e=hn(e))&&(t=e.g[t.toString()],e=-1,t&&(e=tn(t,n,r,i)),(n=-1<e?t[e]:null)&&cn(n))}function cn(e){if("number"!=typeof e&&e&&!e.ba){var t=e.src;if(t&&t[jt])en(t.i,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(ln(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=hn(t))?(en(n,e),0==n.h&&(n.src=null,t[nn]=null)):Wt(e)}}}function ln(e){return e in rn?rn[e]:rn[e]="on"+e}function un(e,t){if(e.ba)e=!0;else{t=new Ht(t,this);var n=e.listener,r=e.ha||e.src;e.ea&&cn(e),e=n.call(r,t)}return e}function hn(e){return(e=e[nn])instanceof Zt?e:null}var fn="__closure_events_fn_"+(1e9*Math.random()>>>0);function An(e){return"function"==typeof e?e:(e[fn]||(e[fn]=function(t){return e.handleEvent(t)}),e[fn])}function Nn(){At.call(this),this.i=new Zt(this),this.P=this,this.I=null}function mn(e,t){var n,r=e.I;if(r)for(n=[];r;r=r.I)n.push(r);if(e=e.P,r=t.type||t,"string"==typeof t)t=new gt(t,e);else if(t instanceof gt)t.target=t.target||e;else{var i=t;Xt(t=new gt(r,e),i)}if(i=!0,n)for(var s=n.length-1;0<=s;s--){var o=t.g=n[s];i=pn(o,r,!0,t)&&i}if(i=pn(o=t.g=e,r,!0,t)&&i,i=pn(o,r,!1,t)&&i,n)for(s=0;s<n.length;s++)i=pn(o=t.g=n[s],r,!1,t)&&i}function pn(e,t,n,r){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();for(var i=!0,s=0;s<t.length;++s){var o=t[s];if(o&&!o.ba&&o.capture==n){var a=o.listener,d=o.ha||o.src;o.ea&&en(e.i,o),i=!1!==a.call(d,r)&&i}}return i&&!r.defaultPrevented}ft(Nn,At),Nn.prototype[jt]=!0,Nn.prototype.removeEventListener=function(e,t,n,r){dn(this,e,t,n,r)},Nn.prototype.M=function(){if(Nn.X.M.call(this),this.i){var e,t=this.i;for(e in t.g){for(var n=t.g[e],r=0;r<n.length;r++)Wt(n[r]);delete t.g[e],t.h--}}this.I=null},Nn.prototype.N=function(e,t,n,r){return this.i.add(String(e),t,!1,n,r)},Nn.prototype.O=function(e,t,n,r){return this.i.add(String(e),t,!0,n,r)};var gn=rt.JSON.stringify;function $n(){var e=Cn,t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var yn,vn=function(){function e(){this.h=this.g=null}return e.prototype.add=function(e,t){var n=wn.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n},e}(),wn=new(function(){function e(e,t){this.i=e,this.j=t,this.h=0,this.g=null}return e.prototype.get=function(){var e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e},e}())((function(){return new bn}),(function(e){return e.reset()})),bn=function(){function e(){this.next=this.g=this.h=null}return e.prototype.set=function(e,t){this.h=e,this.g=t,this.next=null},e.prototype.reset=function(){this.next=this.g=this.h=null},e}();function Sn(e){rt.setTimeout((function(){throw e}),0)}function En(e,t){yn||function(){var e=rt.Promise.resolve(void 0);yn=function(){e.then(In)}}(),Tn||(yn(),Tn=!0),Cn.add(e,t)}var Tn=!1,Cn=new vn;function In(){for(var e;e=$n();){try{e.h.call(e.g)}catch(e){Sn(e)}var t=wn;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}Tn=!1}function _n(e,t){Nn.call(this),this.h=e||1,this.g=t||rt,this.j=ut(this.lb,this),this.l=Date.now()}function kn(e){e.ca=!1,e.R&&(e.g.clearTimeout(e.R),e.R=null)}function Rn(e,t,n){if("function"==typeof e)n&&(e=ut(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=ut(e.handleEvent,e)}return 2147483647<Number(t)?-1:rt.setTimeout(e,t||0)}function Ln(e){e.g=Rn((function(){e.g=null,e.i&&(e.i=!1,Ln(e))}),e.j);var t=e.h;e.h=null,e.m.apply(null,t)}ft(_n,Nn),(et=_n.prototype).ca=!1,et.R=null,et.lb=function(){if(this.ca){var e=Date.now()-this.l;0<e&&e<.8*this.h?this.R=this.g.setTimeout(this.j,this.h-e):(this.R&&(this.g.clearTimeout(this.R),this.R=null),mn(this,"tick"),this.ca&&(kn(this),this.start()))}},et.start=function(){this.ca=!0,this.R||(this.R=this.g.setTimeout(this.j,this.h),this.l=Date.now())},et.M=function(){_n.X.M.call(this),kn(this),delete this.g};var Dn=function(e){function t(t,n){var r=e.call(this)||this;return r.m=t,r.j=n,r.h=null,r.i=!1,r.g=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Je(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.l=function(e){this.h=arguments,this.g?this.i=!0:Ln(this)},t.prototype.M=function(){e.prototype.M.call(this),this.g&&(rt.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)},t}(At);function On(e){At.call(this),this.h=e,this.g={}}ft(On,At);var xn=[];function Pn(e,t,n,r){Array.isArray(n)||(n&&(xn[0]=n.toString()),n=xn);for(var i=0;i<n.length;i++){var s=sn(t,n[i],r||e.handleEvent,!1,e.h||e);if(!s)break;e.g[s.key]=s}}function Mn(e){Qt(e.g,(function(e,t){this.g.hasOwnProperty(t)&&cn(e)}),e),e.g={}}function Un(){this.g=!0}function Fn(e,t,n,r){e.info((function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var s=i[0];if("noop"!=s&&"stop"!=s&&"close"!=s)for(var o=1;o<i.length;o++)i[o]=""}}}return gn(n)}catch(e){return t}}(e,n)+(r?" "+r:"")}))}On.prototype.M=function(){On.X.M.call(this),Mn(this)},On.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Un.prototype.Aa=function(){this.g=!1},Un.prototype.info=function(){};var Bn={},zn=null;function Vn(){return zn=zn||new Nn}function Hn(e){gt.call(this,Bn.Pa,e)}function Gn(e){var t=Vn();mn(t,new Hn(t))}function jn(e,t){gt.call(this,Bn.STAT_EVENT,e),this.stat=t}function qn(e){var t=Vn();mn(t,new jn(t,e))}function Kn(e,t){gt.call(this,Bn.Qa,e),this.size=t}function Wn(e,t){if("function"!=typeof e)throw Error("Fn must not be null and must be a function");return rt.setTimeout((function(){e()}),t)}Bn.Pa="serverreachability",ft(Hn,gt),Bn.STAT_EVENT="statevent",ft(jn,gt),Bn.Qa="timingevent",ft(Kn,gt);var Qn={NO_ERROR:0,mb:1,zb:2,yb:3,tb:4,xb:5,Ab:6,Ma:7,TIMEOUT:8,Db:9},Yn={rb:"complete",Nb:"success",Na:"error",Ma:"abort",Fb:"ready",Gb:"readystatechange",TIMEOUT:"timeout",Bb:"incrementaldata",Eb:"progress",ub:"downloadprogress",Vb:"uploadprogress"};function Jn(){}function Xn(e){return e.h||(e.h=e.i())}function Zn(){}Jn.prototype.h=null;var er,tr={OPEN:"a",qb:"b",Na:"c",Cb:"d"};function nr(){gt.call(this,"d")}function rr(){gt.call(this,"c")}function ir(){}function sr(e,t,n,r){this.l=e,this.j=t,this.m=n,this.U=r||1,this.S=new On(this),this.O=ar,e=Rt?125:void 0,this.T=new _n(e),this.H=null,this.i=!1,this.s=this.A=this.v=this.K=this.F=this.V=this.B=null,this.D=[],this.g=null,this.C=0,this.o=this.u=null,this.Y=-1,this.I=!1,this.N=0,this.L=null,this.$=this.J=this.Z=this.P=!1,this.h=new or}function or(){this.i=null,this.g="",this.h=!1}ft(nr,gt),ft(rr,gt),ft(ir,Jn),ir.prototype.g=function(){return new XMLHttpRequest},ir.prototype.i=function(){return{}},er=new ir;var ar=45e3,dr={},cr={};function lr(e,t,n){e.K=1,e.v=_r(Sr(t)),e.s=n,e.P=!0,ur(e,null)}function ur(e,t){e.F=Date.now(),Nr(e),e.A=Sr(e.v);var n=e.A,r=e.U;Array.isArray(r)||(r=[String(r)]),Vr(n.i,"t",r),e.C=0,n=e.l.H,e.h=new or,e.g=Vi(e.l,n?t:null,!e.s),0<e.N&&(e.L=new Dn(ut(e.La,e,e.g),e.N)),Pn(e.S,e.g,"readystatechange",e.ib),t=e.H?Yt(e.H):{},e.s?(e.u||(e.u="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.da(e.A,e.u,e.s,t)):(e.u="GET",e.g.da(e.A,e.u,null,t)),Gn(),function(e,t,n,r,i,s){e.info((function(){if(e.g)if(s)for(var o="",a=s.split("&"),d=0;d<a.length;d++){var c=a[d].split("=");if(1<c.length){var l=c[0];c=c[1];var u=l.split("_");o=2<=u.length&&"type"==u[1]?o+(l+"=")+c+"&":o+(l+"=redacted&")}}else o=null;else o=s;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+t+"\n"+n+"\n"+o}))}(e.j,e.u,e.A,e.m,e.U,e.s)}function hr(e){return!!e.g&&("GET"==e.u&&2!=e.K&&e.l.Da)}function fr(e,t,n){for(var r,i=!0;!e.I&&e.C<n.length;){if((r=Ar(e,n))==cr){4==t&&(e.o=4,qn(14),i=!1),Fn(e.j,e.m,null,"[Incomplete Response]");break}if(r==dr){e.o=4,qn(15),Fn(e.j,e.m,n,"[Invalid Chunk]"),i=!1;break}Fn(e.j,e.m,r,null),yr(e,r)}hr(e)&&r!=cr&&r!=dr&&(e.h.g="",e.C=0),4!=t||0!=n.length||e.h.h||(e.o=1,qn(16),i=!1),e.i=e.i&&i,i?0<n.length&&!e.$&&(e.$=!0,(t=e.l).g==e&&t.$&&!t.K&&(t.j.info("Great, no buffering proxy detected. Bytes received: "+n.length),Oi(t),t.K=!0,qn(11))):(Fn(e.j,e.m,n,"[Invalid Chunked Response]"),$r(e),gr(e))}function Ar(e,t){var n=e.C,r=t.indexOf("\n",n);return-1==r?cr:(n=Number(t.substring(n,r)),isNaN(n)?dr:(r+=1)+n>t.length?cr:(t=t.substr(r,n),e.C=r+n,t))}function Nr(e){e.V=Date.now()+e.O,mr(e,e.O)}function mr(e,t){if(null!=e.B)throw Error("WatchDog timer not null");e.B=Wn(ut(e.gb,e),t)}function pr(e){e.B&&(rt.clearTimeout(e.B),e.B=null)}function gr(e){0==e.l.G||e.I||Mi(e.l,e)}function $r(e){pr(e);var t=e.L;t&&"function"==typeof t.na&&t.na(),e.L=null,kn(e.T),Mn(e.S),e.g&&(t=e.g,e.g=null,t.abort(),t.na())}function yr(e,t){try{var n=e.l;if(0!=n.G&&(n.g==e||Qr(n.h,e)))if(!e.J&&Qr(n.h,e)&&3==n.G){try{var r=n.Fa.g.parse(t)}catch(s){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.u){if(n.g){if(!(n.g.F+3e3<e.F))break e;Pi(n),Ti(n)}Di(n),qn(18)}}else n.Ba=i[1],0<n.Ba-n.T&&37500>i[2]&&n.L&&0==n.A&&!n.v&&(n.v=Wn(ut(n.cb,n),6e3));if(1>=Wr(n.h)&&n.ja){try{n.ja()}catch(s){}n.ja=void 0}}else Fi(n,11)}else if((e.J||n.g==e)&&Pi(n),!yt(t))for(i=n.Fa.g.parse(t),t=0;t<i.length;t++){var s=i[t];if(n.T=s[0],s=s[1],2==n.G)if("c"==s[0]){n.I=s[1],n.ka=s[2];var o=s[3];null!=o&&(n.ma=o,n.j.info("VER="+n.ma));var a=s[4];null!=a&&(n.Ca=a,n.j.info("SVER="+n.Ca));var d=s[5];null!=d&&"number"==typeof d&&0<d&&(r=1.5*d,n.J=r,n.j.info("backChannelRequestTimeoutMs_="+r)),r=n;var c=e.g;if(c){var l=c.g?c.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(l){var u=r.h;u.g||-1==l.indexOf("spdy")&&-1==l.indexOf("quic")&&-1==l.indexOf("h2")||(u.j=u.l,u.g=new Set,u.h&&(Yr(u,u.h),u.h=null))}if(r.D){var h=c.g?c.g.getResponseHeader("X-HTTP-Session-Id"):null;h&&(r.za=h,Ir(r.F,r.D,h))}}n.G=3,n.l&&n.l.xa(),n.$&&(n.P=Date.now()-e.F,n.j.info("Handshake RTT: "+n.P+"ms"));var f=e;if((r=n).sa=zi(r,r.H?r.ka:null,r.V),f.J){Jr(r.h,f);var A=f,N=r.J;N&&A.setTimeout(N),A.B&&(pr(A),Nr(A)),r.g=f}else Li(r);0<n.i.length&&Ii(n)}else"stop"!=s[0]&&"close"!=s[0]||Fi(n,7);else 3==n.G&&("stop"==s[0]||"close"==s[0]?"stop"==s[0]?Fi(n,7):Ei(n):"noop"!=s[0]&&n.l&&n.l.wa(s),n.A=0)}Gn()}catch(s){}}function vr(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(st(e)||"string"==typeof e)Array.prototype.forEach.call(e,t,void 0);else for(var n=function(e){if(e.oa&&"function"==typeof e.oa)return e.oa();if(!e.W||"function"!=typeof e.W){if("undefined"!=typeof Map&&e instanceof Map)return Array.from(e.keys());if(!("undefined"!=typeof Set&&e instanceof Set)){if(st(e)||"string"==typeof e){var t=[];e=e.length;for(var n=0;n<e;n++)t.push(n);return t}for(var r in t=[],n=0,e)t[n++]=r;return t}}}(e),r=function(e){if(e.W&&"function"==typeof e.W)return e.W();if("undefined"!=typeof Map&&e instanceof Map||"undefined"!=typeof Set&&e instanceof Set)return Array.from(e.values());if("string"==typeof e)return e.split("");if(st(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e),i=r.length,s=0;s<i;s++)t.call(void 0,r[s],n&&n[s],e)}(et=sr.prototype).setTimeout=function(e){this.O=e},et.ib=function(e){e=e.target;var t=this.L;t&&3==$i(e)?t.l():this.La(e)},et.La=function(e){try{if(e==this.g)e:{var t=$i(this.g),n=this.g.Ea();this.g.aa();if(!(3>t)&&(3!=t||Rt||this.g&&(this.h.h||this.g.fa()||yi(this.g)))){this.I||4!=t||7==n||Gn(),pr(this);var r=this.g.aa();this.Y=r;t:if(hr(this)){var i=yi(this.g);e="";var s=i.length,o=4==$i(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){$r(this),gr(this);var a="";break t}this.h.i=new rt.TextDecoder}for(n=0;n<s;n++)this.h.h=!0,e+=this.h.i.decode(i[n],{stream:o&&n==s-1});i.splice(0,s),this.h.g+=e,this.C=0,a=this.h.g}else a=this.g.fa();if(this.i=200==r,function(e,t,n,r,i,s,o){e.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+s+" "+o}))}(this.j,this.u,this.A,this.m,this.U,t,r),this.i){if(this.Z&&!this.J){t:{if(this.g){var d,c=this.g;if((d=c.g?c.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!yt(d)){var l=d;break t}}l=null}if(!(r=l)){this.i=!1,this.o=3,qn(12),$r(this),gr(this);break e}Fn(this.j,this.m,r,"Initial handshake response via X-HTTP-Initial-Response"),this.J=!0,yr(this,r)}this.P?(fr(this,t,a),Rt&&this.i&&3==t&&(Pn(this.S,this.T,"tick",this.hb),this.T.start())):(Fn(this.j,this.m,a,null),yr(this,a)),4==t&&$r(this),this.i&&!this.I&&(4==t?Mi(this.l,this):(this.i=!1,Nr(this)))}else 400==r&&0<a.indexOf("Unknown SID")?(this.o=3,qn(12)):(this.o=0,qn(13)),$r(this),gr(this)}}}catch(t){}},et.hb=function(){if(this.g){var e=$i(this.g),t=this.g.fa();this.C<t.length&&(pr(this),fr(this,e,t),this.i&&4!=e&&Nr(this))}},et.cancel=function(){this.I=!0,$r(this)},et.gb=function(){this.B=null;var e=Date.now();0<=e-this.V?(function(e,t){e.info((function(){return"TIMEOUT: "+t}))}(this.j,this.A),2!=this.K&&(Gn(),qn(17)),$r(this),this.o=2,gr(this)):mr(this,this.V-e)};var wr=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function br(e,t){if(this.g=this.s=this.j="",this.m=null,this.o=this.l="",this.h=!1,e instanceof br){this.h=void 0!==t?t:e.h,Er(this,e.j),this.s=e.s,this.g=e.g,Tr(this,e.m),this.l=e.l,t=e.i;var n=new Ur;n.i=t.i,t.g&&(n.g=new Map(t.g),n.h=t.h),Cr(this,n),this.o=e.o}else e&&(n=String(e).match(wr))?(this.h=!!t,Er(this,n[1]||"",!0),this.s=kr(n[2]||""),this.g=kr(n[3]||"",!0),Tr(this,n[4]),this.l=kr(n[5]||"",!0),Cr(this,n[6]||"",!0),this.o=kr(n[7]||"")):(this.h=!!t,this.i=new Ur(null,this.h))}function Sr(e){return new br(e)}function Er(e,t,n){e.j=n?kr(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function Tr(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.m=t}else e.m=null}function Cr(e,t,n){t instanceof Ur?(e.i=t,function(e,t){t&&!e.j&&(Fr(e),e.i=null,e.g.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(Br(this,t),Vr(this,n,e))}),e)),e.j=t}(e.i,e.h)):(n||(t=Rr(t,Pr)),e.i=new Ur(t,e.h))}function Ir(e,t,n){e.i.set(t,n)}function _r(e){return Ir(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function kr(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Rr(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,Lr),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Lr(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}br.prototype.toString=function(){var e=[],t=this.j;t&&e.push(Rr(t,Dr,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.s)&&e.push(Rr(t,Dr,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&e.push(":",String(n))),(n=this.l)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(Rr(n,"/"==n.charAt(0)?xr:Or,!0))),(n=this.i.toString())&&e.push("?",n),(n=this.o)&&e.push("#",Rr(n,Mr)),e.join("")};var Dr=/[#\/\?@]/g,Or=/[#\?:]/g,xr=/[#\?]/g,Pr=/[#\?@]/g,Mr=/#/g;function Ur(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function Fr(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var s=e[n].substring(0,r);i=e[n].substring(r+1)}else s=e[n];t(s,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.i,(function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)})))}function Br(e,t){Fr(e),t=Hr(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function zr(e,t){return Fr(e),t=Hr(e,t),e.g.has(t)}function Vr(e,t,n){Br(e,t),0<n.length&&(e.i=null,e.g.set(Hr(e,t),mt(n)),e.h+=n.length)}function Hr(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}(et=Ur.prototype).add=function(e,t){Fr(this),this.i=null,e=Hr(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},et.forEach=function(e,t){Fr(this),this.g.forEach((function(n,r){n.forEach((function(n){e.call(t,n,r,this)}),this)}),this)},et.oa=function(){Fr(this);for(var e=Array.from(this.g.values()),t=Array.from(this.g.keys()),n=[],r=0;r<t.length;r++)for(var i=e[r],s=0;s<i.length;s++)n.push(t[r]);return n},et.W=function(e){Fr(this);var t=[];if("string"==typeof e)zr(this,e)&&(t=t.concat(this.g.get(Hr(this,e))));else{e=Array.from(this.g.values());for(var n=0;n<e.length;n++)t=t.concat(e[n])}return t},et.set=function(e,t){return Fr(this),this.i=null,zr(this,e=Hr(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},et.get=function(e,t){return e&&0<(e=this.W(e)).length?String(e[0]):t},et.toString=function(){if(this.i)return this.i;if(!this.g)return"";for(var e=[],t=Array.from(this.g.keys()),n=0;n<t.length;n++){var r=t[n],i=encodeURIComponent(String(r)),s=this.W(r);for(r=0;r<s.length;r++){var o=i;""!==s[r]&&(o+="="+encodeURIComponent(String(s[r]))),e.push(o)}}return this.i=e.join("&")};var Gr=function(e,t){this.h=e,this.g=t};function jr(e){this.l=e||qr,rt.PerformanceNavigationTiming?e=0<(e=rt.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(rt.g&&rt.g.Ga&&rt.g.Ga()&&rt.g.Ga().$b),this.j=e?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var qr=10;function Kr(e){return!!e.h||!!e.g&&e.g.size>=e.j}function Wr(e){return e.h?1:e.g?e.g.size:0}function Qr(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function Yr(e,t){e.g?e.g.add(t):e.h=t}function Jr(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function Xr(e){var t,n;if(null!=e.h)return e.i.concat(e.h.D);if(null!=e.g&&0!==e.g.size){var r=e.i;try{for(var i=Xe(e.g.values()),s=i.next();!s.done;s=i.next()){var o=s.value;r=r.concat(o.D)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}return mt(e.i)}function Zr(){}function ei(){this.g=new Zr}function ti(e,t,n){var r=n||"";try{vr(e,(function(e,n){var i=e;ot(e)&&(i=gn(e)),t.push(r+n+"="+encodeURIComponent(i))}))}catch(e){throw t.push(r+"type="+encodeURIComponent("_badmap")),e}}function ni(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(e){}}function ri(e){this.l=e.ac||null,this.j=e.jb||!1}function ii(e,t){Nn.call(this),this.D=e,this.u=t,this.m=void 0,this.readyState=si,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}jr.prototype.cancel=function(){var e,t;if(this.i=Xr(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){try{for(var n=Xe(this.g.values()),r=n.next();!r.done;r=n.next()){r.value.cancel()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.g.clear()}},Zr.prototype.stringify=function(e){return rt.JSON.stringify(e,void 0)},Zr.prototype.parse=function(e){return rt.JSON.parse(e,void 0)},ft(ri,Jn),ri.prototype.g=function(){return new ii(this.l,this.j)},ri.prototype.i=function(e){return function(){return e}}({}),ft(ii,Nn);var si=0;function oi(e){e.j.read().then(e.Ta.bind(e)).catch(e.ga.bind(e))}function ai(e){e.readyState=4,e.l=null,e.j=null,e.A=null,di(e)}function di(e){e.onreadystatechange&&e.onreadystatechange.call(e)}(et=ii.prototype).open=function(e,t){if(this.readyState!=si)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,di(this)},et.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;var t={headers:this.v,method:this.C,credentials:this.m,cache:void 0};e&&(t.body=e),(this.D||rt).fetch(new Request(this.B,t)).then(this.Wa.bind(this),this.ga.bind(this))},et.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch((function(){})),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,ai(this)),this.readyState=si},et.Wa=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,di(this)),this.g&&(this.readyState=3,di(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Ua.bind(this),this.ga.bind(this));else if(void 0!==rt.ReadableStream&&"body"in e){if(this.j=e.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;oi(this)}else e.text().then(this.Va.bind(this),this.ga.bind(this))},et.Ta=function(e){if(this.g){if(this.u&&e.value)this.response.push(e.value);else if(!this.u){var t=e.value?e.value:new Uint8Array(0);(t=this.A.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?ai(this):di(this),3==this.readyState&&oi(this)}},et.Va=function(e){this.g&&(this.response=this.responseText=e,ai(this))},et.Ua=function(e){this.g&&(this.response=e,ai(this))},et.ga=function(){this.g&&ai(this)},et.setRequestHeader=function(e,t){this.v.append(e,t)},et.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},et.getAllResponseHeaders=function(){if(!this.h)return"";for(var e=[],t=this.h.entries(),n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(ii.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}});var ci=rt.JSON.parse;function li(e){Nn.call(this),this.headers=new Map,this.u=e||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=ui,this.K=this.L=!1}ft(li,Nn);var ui="",hi=/^https?$/i,fi=["POST","PUT"];function Ai(e,t){e.h=!1,e.g&&(e.l=!0,e.g.abort(),e.l=!1),e.j=t,e.m=5,Ni(e),pi(e)}function Ni(e){e.D||(e.D=!0,mn(e,"complete"),mn(e,"error"))}function mi(e){if(e.h&&void 0!==nt&&(!e.C[1]||4!=$i(e)||2!=e.aa()))if(e.v&&4==$i(e))Rn(e.Ha,0,e);else if(mn(e,"readystatechange"),4==$i(e)){e.h=!1;try{var t,n=e.aa();e:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break e;default:r=!1}if(!(t=r)){var i;if(i=0===n){var s=String(e.H).match(wr)[1]||null;if(!s&&rt.self&&rt.self.location){var o=rt.self.location.protocol;s=o.substr(0,o.length-1)}i=!hi.test(s?s.toLowerCase():"")}t=i}if(t)mn(e,"complete"),mn(e,"success");else{e.m=6;try{var a=2<$i(e)?e.g.statusText:""}catch(e){a=""}e.j=a+" ["+e.aa()+"]",Ni(e)}}finally{pi(e)}}}function pi(e,t){if(e.g){gi(e);var n=e.g,r=e.C[0]?it:null;e.g=null,e.C=null,t||mn(e,"ready");try{n.onreadystatechange=r}catch(e){}}}function gi(e){e.g&&e.K&&(e.g.ontimeout=null),e.A&&(rt.clearTimeout(e.A),e.A=null)}function $i(e){return e.g?e.g.readyState:0}function yi(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.J){case ui:case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(e){return null}}function vi(e){var t="";return Qt(e,(function(e,n){t+=n,t+=":",t+=e,t+="\r\n"})),t}function wi(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=vi(n),"string"==typeof e?null!=n&&encodeURIComponent(String(n)):Ir(e,t,n))}function bi(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function Si(e){this.Ca=0,this.i=[],this.j=new Un,this.ka=this.sa=this.F=this.V=this.g=this.za=this.D=this.ia=this.o=this.S=this.s=null,this.ab=this.U=0,this.Za=bi("failFast",!1,e),this.L=this.v=this.u=this.m=this.l=null,this.Y=!0,this.pa=this.Ba=this.T=-1,this.Z=this.A=this.C=0,this.Xa=bi("baseRetryDelayMs",5e3,e),this.bb=bi("retryDelaySeedMs",1e4,e),this.$a=bi("forwardChannelMaxRetries",2,e),this.ta=bi("forwardChannelRequestTimeoutMs",2e4,e),this.ra=e&&e.xmlHttpFactory||void 0,this.Da=e&&e.Zb||!1,this.J=void 0,this.H=e&&e.supportsCrossDomainXhr||!1,this.I="",this.h=new jr(e&&e.concurrentRequestLimit),this.Fa=new ei,this.O=e&&e.fastHandshake||!1,this.N=e&&e.encodeInitMessageHeaders||!1,this.O&&this.N&&(this.N=!1),this.Ya=e&&e.Xb||!1,e&&e.Aa&&this.j.Aa(),e&&e.forceLongPolling&&(this.Y=!1),this.$=!this.O&&this.Y&&e&&e.detectBufferingProxy||!1,this.ja=void 0,this.P=0,this.K=!1,this.la=this.B=null}function Ei(e){if(Ci(e),3==e.G){var t=e.U++,n=Sr(e.F);Ir(n,"SID",e.I),Ir(n,"RID",t),Ir(n,"TYPE","terminate"),ki(e,n),(t=new sr(e,e.j,t,void 0)).K=2,t.v=_r(Sr(n)),n=!1,rt.navigator&&rt.navigator.sendBeacon&&(n=rt.navigator.sendBeacon(t.v.toString(),"")),!n&&rt.Image&&((new Image).src=t.v,n=!0),n||(t.g=Vi(t.l,null),t.g.da(t.v)),t.F=Date.now(),Nr(t)}Bi(e)}function Ti(e){e.g&&(Oi(e),e.g.cancel(),e.g=null)}function Ci(e){Ti(e),e.u&&(rt.clearTimeout(e.u),e.u=null),Pi(e),e.h.cancel(),e.m&&("number"==typeof e.m&&rt.clearTimeout(e.m),e.m=null)}function Ii(e){Kr(e.h)||e.m||(e.m=!0,En(e.Ja,e),e.C=0)}function _i(e,t){var n;n=t?t.m:e.U++;var r=Sr(e.F);Ir(r,"SID",e.I),Ir(r,"RID",n),Ir(r,"AID",e.T),ki(e,r),e.o&&e.s&&wi(r,e.o,e.s),n=new sr(e,e.j,n,e.C+1),null===e.o&&(n.H=e.s),t&&(e.i=t.D.concat(e.i)),t=Ri(e,n,1e3),n.setTimeout(Math.round(.5*e.ta)+Math.round(.5*e.ta*Math.random())),Yr(e.h,n),lr(n,r,t)}function ki(e,t){e.ia&&Qt(e.ia,(function(e,n){Ir(t,n,e)})),e.l&&vr({},(function(e,n){Ir(t,n,e)}))}function Ri(e,t,n){n=Math.min(e.i.length,n);var r=e.l?ut(e.l.Ra,e.l,e):null;e:for(var i=e.i,s=-1;;){var o=["count="+n];-1==s?0<n?(s=i[0].h,o.push("ofs="+s)):s=0:o.push("ofs="+s);for(var a=!0,d=0;d<n;d++){var c=i[d].h,l=i[d].g;if(0>(c-=s))s=Math.max(0,i[d].h-100),a=!1;else try{ti(l,o,"req"+c+"_")}catch(e){r&&r(l)}}if(a){r=o.join("&");break e}}return e=e.i.splice(0,n),t.D=e,r}function Li(e){e.g||e.u||(e.Z=1,En(e.Ia,e),e.A=0)}function Di(e){return!(e.g||e.u||3<=e.A)&&(e.Z++,e.u=Wn(ut(e.Ia,e),Ui(e,e.A)),e.A++,!0)}function Oi(e){null!=e.B&&(rt.clearTimeout(e.B),e.B=null)}function xi(e){e.g=new sr(e,e.j,"rpc",e.Z),null===e.o&&(e.g.H=e.s),e.g.N=0;var t=Sr(e.sa);Ir(t,"RID","rpc"),Ir(t,"SID",e.I),Ir(t,"CI",e.L?"0":"1"),Ir(t,"AID",e.T),Ir(t,"TYPE","xmlhttp"),ki(e,t),e.o&&e.s&&wi(t,e.o,e.s),e.J&&e.g.setTimeout(e.J);var n=e.g;e=e.ka,n.K=1,n.v=_r(Sr(t)),n.s=null,n.P=!0,ur(n,e)}function Pi(e){null!=e.v&&(rt.clearTimeout(e.v),e.v=null)}function Mi(e,t){var n=null;if(e.g==t){Pi(e),Oi(e),e.g=null;var r=2}else{if(!Qr(e.h,t))return;n=t.D,Jr(e.h,t),r=1}if(0!=e.G)if(e.pa=t.Y,t.i)if(1==r){n=t.s?t.s.length:0,t=Date.now()-t.F;var i=e.C;mn(r=Vn(),new Kn(r,n)),Ii(e)}else Li(e);else if(3==(i=t.o)||0==i&&0<e.pa||!(1==r&&function(e,t){return!(Wr(e.h)>=e.h.j-(e.m?1:0)||(e.m?(e.i=t.D.concat(e.i),0):1==e.G||2==e.G||e.C>=(e.Za?0:e.$a)||(e.m=Wn(ut(e.Ja,e,t),Ui(e,e.C)),e.C++,0)))}(e,t)||2==r&&Di(e)))switch(n&&0<n.length&&(t=e.h,t.i=t.i.concat(n)),i){case 1:Fi(e,5);break;case 4:Fi(e,10);break;case 3:Fi(e,6);break;default:Fi(e,2)}}function Ui(e,t){var n=e.Xa+Math.floor(Math.random()*e.bb);return e.l||(n*=2),n*t}function Fi(e,t){if(e.j.info("Error code "+t),2==t){var n=null;e.l&&(n=null);var r=ut(e.kb,e);n||(n=new br("//www.google.com/images/cleardot.gif"),rt.location&&"http"==rt.location.protocol||Er(n,"https"),_r(n)),function(e,t){var n=new Un;if(rt.Image){var r=new Image;r.onload=ht(ni,n,r,"TestLoadImage: loaded",!0,t),r.onerror=ht(ni,n,r,"TestLoadImage: error",!1,t),r.onabort=ht(ni,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=ht(ni,n,r,"TestLoadImage: timeout",!1,t),rt.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=e}else t(!1)}(n.toString(),r)}else qn(2);e.G=0,e.l&&e.l.va(t),Bi(e),Ci(e)}function Bi(e){if(e.G=0,e.la=[],e.l){var t=Xr(e.h);0==t.length&&0==e.i.length||(pt(e.la,t),pt(e.la,e.i),e.h.i.length=0,mt(e.i),e.i.length=0),e.l.ua()}}function zi(e,t,n){var r=n instanceof br?Sr(n):new br(n,void 0);if(""!=r.g)t&&(r.g=t+"."+r.g),Tr(r,r.m);else{var i=rt.location;r=i.protocol,t=t?t+"."+i.hostname:i.hostname,i=+i.port;var s=new br(null,void 0);r&&Er(s,r),t&&(s.g=t),i&&Tr(s,i),n&&(s.l=n),r=s}return n=e.D,t=e.za,n&&t&&Ir(r,n,t),Ir(r,"VER",e.ma),ki(e,r),r}function Vi(e,t,n){if(t&&!e.H)throw Error("Can't create secondary domain capable XhrIo object.");return(t=n&&e.Da&&!e.ra?new li(new ri({jb:!0})):new li(e.ra)).Ka(e.H),t}function Hi(){}function Gi(){if(_t&&!(10<=Number(Vt)))throw Error("Environmental error: no available transport.")}function ji(e,t){Nn.call(this),this.g=new Si(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.s=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.ya&&(e?e["X-WebChannel-Client-Profile"]=t.ya:e={"X-WebChannel-Client-Profile":t.ya}),this.g.S=e,(e=t&&t.Yb)&&!yt(e)&&(this.g.o=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!yt(t)&&(this.g.D=t,null!==(e=this.h)&&t in e&&(t in(e=this.h)&&delete e[t])),this.j=new Wi(this)}function qi(e){nr.call(this);var t=e.__sm__;if(t){e:{for(var n in t){e=n;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function Ki(){rr.call(this),this.status=1}function Wi(e){this.g=e}(et=li.prototype).Ka=function(e){this.L=e},et.da=function(e,t,n,r){var i,s,o,a;if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+e);t=t?t.toUpperCase():"GET",this.H=e,this.j="",this.m=0,this.D=!1,this.h=!0,this.g=this.u?this.u.g():er.g(),this.C=this.u?Xn(this.u):Xn(er),this.g.onreadystatechange=ut(this.Ha,this);try{this.F=!0,this.g.open(t,String(e),!0),this.F=!1}catch(u){return void Ai(this,u)}if(e=n||"",n=new Map(this.headers),r)if(Object.getPrototypeOf(r)===Object.prototype)for(var d in r)n.set(d,r[d]);else{if("function"!=typeof r.keys||"function"!=typeof r.get)throw Error("Unknown input type for opt_headers: "+String(r));try{for(var c=Xe(r.keys()),l=c.next();!l.done;l=c.next()){var u=l.value;n.set(u,r.get(u))}}catch(e){i={error:e}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}}r=Array.from(n.keys()).find((function(e){return"content-type"==e.toLowerCase()})),d=rt.FormData&&e instanceof rt.FormData,!(0<=Nt(fi,t))||r||d||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");try{for(var h=Xe(n),f=h.next();!f.done;f=h.next()){var A=Ze(f.value,2),N=(u=A[0],A[1]);this.g.setRequestHeader(u,N)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{gi(this),0<this.B&&((this.K=function(e){return _t&&Bt()&&"number"==typeof e.timeout&&void 0!==e.ontimeout}(this.g))?(this.g.timeout=this.B,this.g.ontimeout=ut(this.qa,this)):this.A=Rn(this.qa,this.B,this)),this.v=!0,this.g.send(e),this.v=!1}catch(u){Ai(this,u)}},et.qa=function(){void 0!==nt&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,mn(this,"timeout"),this.abort(8))},et.abort=function(e){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=e||7,mn(this,"complete"),mn(this,"abort"),pi(this))},et.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),pi(this,!0)),li.X.M.call(this)},et.Ha=function(){this.s||(this.F||this.v||this.l?mi(this):this.fb())},et.fb=function(){mi(this)},et.aa=function(){try{return 2<$i(this)?this.g.status:-1}catch(e){return-1}},et.fa=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},et.Sa=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),ci(t)}},et.Ea=function(){return this.m},et.Oa=function(){return"string"==typeof this.j?this.j:String(this.j)},(et=Si.prototype).ma=8,et.G=1,et.Ja=function(e){if(this.m)if(this.m=null,1==this.G){if(!e){this.U=Math.floor(1e5*Math.random()),e=this.U++;var t=new sr(this,this.j,e,void 0),n=this.s;if(this.S&&(n?Xt(n=Yt(n),this.S):n=this.S),null!==this.o||this.N||(t.H=n,n=null),this.O)e:{for(var r=0,i=0;i<this.i.length;i++){var s=this.i[i];if(void 0===(s="__data__"in s.g&&"string"==typeof(s=s.g.__data__)?s.length:void 0))break;if(4096<(r+=s)){r=i;break e}if(4096===r||i===this.i.length-1){r=i+1;break e}}r=1e3}else r=1e3;r=Ri(this,t,r),Ir(i=Sr(this.F),"RID",e),Ir(i,"CVER",22),this.D&&Ir(i,"X-HTTP-Session-Id",this.D),ki(this,i),n&&(this.N?r="headers="+encodeURIComponent(String(vi(n)))+"&"+r:this.o&&wi(i,this.o,n)),Yr(this.h,t),this.Ya&&Ir(i,"TYPE","init"),this.O?(Ir(i,"$req",r),Ir(i,"SID","null"),t.Z=!0,lr(t,i,null)):lr(t,i,r),this.G=2}}else 3==this.G&&(e?_i(this,e):0==this.i.length||Kr(this.h)||_i(this))},et.Ia=function(){if(this.u=null,xi(this),this.$&&!(this.K||null==this.g||0>=this.P)){var e=2*this.P;this.j.info("BP detection timer enabled: "+e),this.B=Wn(ut(this.eb,this),e)}},et.eb=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.L=!1,this.K=!0,qn(10),Ti(this),xi(this))},et.cb=function(){null!=this.v&&(this.v=null,Ti(this),Di(this),qn(19))},et.kb=function(e){e?(this.j.info("Successfully pinged google.com"),qn(2)):(this.j.info("Failed to ping google.com"),qn(1))},(et=Hi.prototype).xa=function(){},et.wa=function(){},et.va=function(){},et.ua=function(){},et.Ra=function(){},Gi.prototype.g=function(e,t){return new ji(e,t)},ft(ji,Nn),ji.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.H=!0);var e=this.g,t=this.l,n=this.h||void 0;qn(0),e.V=t,e.ia=n||{},e.L=e.Y,e.F=zi(e,null,e.V),Ii(e)},ji.prototype.close=function(){Ei(this.g)},ji.prototype.u=function(e){var t=this.g;if("string"==typeof e){var n={};n.__data__=e,e=n}else this.v&&((n={}).__data__=gn(e),e=n);t.i.push(new Gr(t.ab++,e)),3==t.G&&Ii(t)},ji.prototype.M=function(){this.g.l=null,delete this.j,Ei(this.g),delete this.g,ji.X.M.call(this)},ft(qi,nr),ft(Ki,rr),ft(Wi,Hi),Wi.prototype.xa=function(){mn(this.g,"a")},Wi.prototype.wa=function(e){mn(this.g,new qi(e))},Wi.prototype.va=function(e){mn(this.g,new Ki)},Wi.prototype.ua=function(){mn(this.g,"b")},Gi.prototype.createWebChannel=Gi.prototype.g,ji.prototype.send=ji.prototype.u,ji.prototype.open=ji.prototype.m,ji.prototype.close=ji.prototype.close,Qn.NO_ERROR=0,Qn.TIMEOUT=8,Qn.HTTP_ERROR=6,Yn.COMPLETE="complete",Zn.EventType=tr,tr.OPEN="a",tr.CLOSE="b",tr.ERROR="c",tr.MESSAGE="d",Nn.prototype.listen=Nn.prototype.N,li.prototype.listenOnce=li.prototype.O,li.prototype.getLastError=li.prototype.Oa,li.prototype.getLastErrorCode=li.prototype.Ea,li.prototype.getStatus=li.prototype.aa,li.prototype.getResponseJson=li.prototype.Sa,li.prototype.getResponseText=li.prototype.fa,li.prototype.send=li.prototype.da,li.prototype.setWithCredentials=li.prototype.Ka;var Qi=Qn,Yi=Yn,Ji=Bn,Xi=10,Zi=11,es=ri,ts=Zn,ns=li;const rs="@firebase/firestore";
|
|
318
|
+
*/var Yt;Yt="",Lt(new T("platform-logger",(t=>new X(t)),"PRIVATE")),Lt(new T("heartbeat",(t=>new Kt(t)),"PRIVATE")),Ft(Z,tt,Yt),Ft(Z,tt,"esm2017"),Ft("fire-js","");var Jt=function(t,e){return Jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Jt(t,e)};function Xt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Zt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,s=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}var te,ee="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ne=ne||{},re=ee||self;function ie(){}function se(t){var e=typeof t;return"array"==(e="object"!=e?e:t?Array.isArray(t)?"array":e:"null")||"object"==e&&"number"==typeof t.length}function oe(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var ae="closure_uid_"+(1e9*Math.random()>>>0),ce=0;function le(t,e,n){return t.call.apply(t.bind,arguments)}function ue(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function he(t,e,n){return(he=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?le:ue).apply(null,arguments)}function de(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}function fe(t,e){function n(){}n.prototype=e.prototype,t.X=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.Wb=function(t,n,r){for(var i=Array(arguments.length-2),s=2;s<arguments.length;s++)i[s-2]=arguments[s];return e.prototype[n].apply(t,i)}}function pe(){this.s=this.s,this.o=this.o}pe.prototype.s=!1,pe.prototype.na=function(){var t;!this.s&&(this.s=!0,this.M(),0)&&(t=this,Object.prototype.hasOwnProperty.call(t,ae)&&t[ae]||(t[ae]=++ce))},pe.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()()};var ge=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if("string"==typeof t)return"string"!=typeof e||1!=e.length?-1:t.indexOf(e,0);for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1};function me(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}function ye(t,e){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(se(r)){var i=t.length||0,s=r.length||0;t.length=i+s;for(var o=0;o<s;o++)t[i+o]=r[o]}else t.push(r)}}function ve(t,e){this.type=t,this.g=this.target=e,this.defaultPrevented=!1}ve.prototype.h=function(){this.defaultPrevented=!0};var we=function(){if(!re.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{re.addEventListener("test",ie,e),re.removeEventListener("test",ie,e)}catch(t){}return t}();function be(t){return/^[\s\xa0]*$/.test(t)}var _e=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function Se(t,e){return t<e?-1:t>e?1:0}function Ee(){var t=re.navigator;return t&&(t=t.userAgent)?t:""}function Ie(t){return-1!=Ee().indexOf(t)}function Te(t){return Te[" "](t),t}Te[" "]=ie;var ke,Ce,Ae=Ie("Opera"),Re=Ie("Trident")||Ie("MSIE"),Ne=Ie("Edge"),Le=Ne||Re,Oe=Ie("Gecko")&&!(-1!=Ee().toLowerCase().indexOf("webkit")&&!Ie("Edge"))&&!(Ie("Trident")||Ie("MSIE"))&&!Ie("Edge"),De=-1!=Ee().toLowerCase().indexOf("webkit")&&!Ie("Edge");function xe(){var t=re.document;return t?t.documentMode:void 0}t:{var Pe="",Me=(Ce=Ee(),Oe?/rv:([^\);]+)(\)|;)/.exec(Ce):Ne?/Edge\/([\d\.]+)/.exec(Ce):Re?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Ce):De?/WebKit\/(\S+)/.exec(Ce):Ae?/(?:Version)[ \/]?(\S+)/.exec(Ce):void 0);if(Me&&(Pe=Me?Me[1]:""),Re){var Ue=xe();if(null!=Ue&&Ue>parseFloat(Pe)){ke=String(Ue);break t}}ke=Pe}var Fe,ze={};function Be(){return function(t){var e=ze;return Object.prototype.hasOwnProperty.call(e,9)?e[9]:e[9]=t(9)}((function(){for(var t=0,e=_e(String(ke)).split("."),n=_e("9").split("."),r=Math.max(e.length,n.length),i=0;0==t&&i<r;i++){var s=e[i]||"",o=n[i]||"";do{if(s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],o=/(\d*)(\D*)(.*)/.exec(o)||["","","",""],0==s[0].length&&0==o[0].length)break;t=Se(0==s[1].length?0:parseInt(s[1],10),0==o[1].length?0:parseInt(o[1],10))||Se(0==s[2].length,0==o[2].length)||Se(s[2],o[2]),s=s[3],o=o[3]}while(0==t)}return 0<=t}))}if(re.document&&Re){var Ve=xe();Fe=Ve||(parseInt(ke,10)||void 0)}else Fe=void 0;var He=Fe;function je(t,e){if(ve.call(this,t?t.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,t){var n=this.type=t.type,r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.g=e,e=t.relatedTarget){if(Oe){t:{try{Te(e.nodeName);var i=!0;break t}catch(t){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType="string"==typeof t.pointerType?t.pointerType:qe[t.pointerType]||"",this.state=t.state,this.i=t,t.defaultPrevented&&je.X.h.call(this)}}fe(je,ve);var qe={2:"touch",3:"pen",4:"mouse"};je.prototype.h=function(){je.X.h.call(this);var t=this.i;t.preventDefault?t.preventDefault():t.returnValue=!1};var $e="closure_listenable_"+(1e6*Math.random()|0),Ke=0;function Ge(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.ha=i,this.key=++Ke,this.ba=this.ea=!1}function We(t){t.ba=!0,t.listener=null,t.proxy=null,t.src=null,t.ha=null}function Qe(t,e,n){for(var r in t)e.call(n,t[r],r,t)}function Ye(t){var e={};for(var n in t)e[n]=t[n];return e}var Je="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Xe(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var s=0;s<Je.length;s++)n=Je[s],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function Ze(t){this.src=t,this.g={},this.h=0}function tn(t,e){var n=e.type;if(n in t.g){var r,i=t.g[n],s=ge(i,e);(r=0<=s)&&Array.prototype.splice.call(i,s,1),r&&(We(e),0==t.g[n].length&&(delete t.g[n],t.h--))}}function en(t,e,n,r){for(var i=0;i<t.length;++i){var s=t[i];if(!s.ba&&s.listener==e&&s.capture==!!n&&s.ha==r)return i}return-1}Ze.prototype.add=function(t,e,n,r,i){var s=t.toString();(t=this.g[s])||(t=this.g[s]=[],this.h++);var o=en(t,e,r,i);return-1<o?(e=t[o],n||(e.ea=!1)):((e=new Ge(e,this.src,s,!!r,i)).ea=n,t.push(e)),e};var nn="closure_lm_"+(1e6*Math.random()|0),rn={};function sn(t,e,n,r,i){if(r&&r.once)return an(t,e,n,r,i);if(Array.isArray(e)){for(var s=0;s<e.length;s++)sn(t,e[s],n,r,i);return null}return n=pn(n),t&&t[$e]?t.N(e,n,oe(r)?!!r.capture:!!r,i):on(t,e,n,!1,r,i)}function on(t,e,n,r,i,s){if(!e)throw Error("Invalid event type");var o=oe(i)?!!i.capture:!!i,a=dn(t);if(a||(t[nn]=a=new Ze(t)),(n=a.add(e,n,r,o,s)).proxy)return n;if(r=function(){function t(n){return e.call(t.src,t.listener,n)}var e=hn;return t}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)we||(i=o),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(un(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return n}function an(t,e,n,r,i){if(Array.isArray(e)){for(var s=0;s<e.length;s++)an(t,e[s],n,r,i);return null}return n=pn(n),t&&t[$e]?t.O(e,n,oe(r)?!!r.capture:!!r,i):on(t,e,n,!0,r,i)}function cn(t,e,n,r,i){if(Array.isArray(e))for(var s=0;s<e.length;s++)cn(t,e[s],n,r,i);else r=oe(r)?!!r.capture:!!r,n=pn(n),t&&t[$e]?(t=t.i,(e=String(e).toString())in t.g&&(-1<(n=en(s=t.g[e],n,r,i))&&(We(s[n]),Array.prototype.splice.call(s,n,1),0==s.length&&(delete t.g[e],t.h--)))):t&&(t=dn(t))&&(e=t.g[e.toString()],t=-1,e&&(t=en(e,n,r,i)),(n=-1<t?e[t]:null)&&ln(n))}function ln(t){if("number"!=typeof t&&t&&!t.ba){var e=t.src;if(e&&e[$e])tn(e.i,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(un(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=dn(e))?(tn(n,t),0==n.h&&(n.src=null,e[nn]=null)):We(t)}}}function un(t){return t in rn?rn[t]:rn[t]="on"+t}function hn(t,e){if(t.ba)t=!0;else{e=new je(e,this);var n=t.listener,r=t.ha||t.src;t.ea&&ln(t),t=n.call(r,e)}return t}function dn(t){return(t=t[nn])instanceof Ze?t:null}var fn="__closure_events_fn_"+(1e9*Math.random()>>>0);function pn(t){return"function"==typeof t?t:(t[fn]||(t[fn]=function(e){return t.handleEvent(e)}),t[fn])}function gn(){pe.call(this),this.i=new Ze(this),this.P=this,this.I=null}function mn(t,e){var n,r=t.I;if(r)for(n=[];r;r=r.I)n.push(r);if(t=t.P,r=e.type||e,"string"==typeof e)e=new ve(e,t);else if(e instanceof ve)e.target=e.target||t;else{var i=e;Xe(e=new ve(r,t),i)}if(i=!0,n)for(var s=n.length-1;0<=s;s--){var o=e.g=n[s];i=yn(o,r,!0,e)&&i}if(i=yn(o=e.g=t,r,!0,e)&&i,i=yn(o,r,!1,e)&&i,n)for(s=0;s<n.length;s++)i=yn(o=e.g=n[s],r,!1,e)&&i}function yn(t,e,n,r){if(!(e=t.i.g[String(e)]))return!0;e=e.concat();for(var i=!0,s=0;s<e.length;++s){var o=e[s];if(o&&!o.ba&&o.capture==n){var a=o.listener,c=o.ha||o.src;o.ea&&tn(t.i,o),i=!1!==a.call(c,r)&&i}}return i&&!r.defaultPrevented}fe(gn,pe),gn.prototype[$e]=!0,gn.prototype.removeEventListener=function(t,e,n,r){cn(this,t,e,n,r)},gn.prototype.M=function(){if(gn.X.M.call(this),this.i){var t,e=this.i;for(t in e.g){for(var n=e.g[t],r=0;r<n.length;r++)We(n[r]);delete e.g[t],e.h--}}this.I=null},gn.prototype.N=function(t,e,n,r){return this.i.add(String(t),e,!1,n,r)},gn.prototype.O=function(t,e,n,r){return this.i.add(String(t),e,!0,n,r)};var vn=re.JSON.stringify;function wn(){var t=Cn,e=null;return t.g&&(e=t.g,t.g=t.g.next,t.g||(t.h=null),e.next=null),e}var bn,_n=function(){function t(){this.h=this.g=null}return t.prototype.add=function(t,e){var n=Sn.get();n.set(t,e),this.h?this.h.next=n:this.g=n,this.h=n},t}(),Sn=new(function(){function t(t,e){this.i=t,this.j=e,this.h=0,this.g=null}return t.prototype.get=function(){var t;return 0<this.h?(this.h--,t=this.g,this.g=t.next,t.next=null):t=this.i(),t},t}())((function(){return new En}),(function(t){return t.reset()})),En=function(){function t(){this.next=this.g=this.h=null}return t.prototype.set=function(t,e){this.h=t,this.g=e,this.next=null},t.prototype.reset=function(){this.next=this.g=this.h=null},t}();function In(t){re.setTimeout((function(){throw t}),0)}function Tn(t,e){bn||function(){var t=re.Promise.resolve(void 0);bn=function(){t.then(An)}}(),kn||(bn(),kn=!0),Cn.add(t,e)}var kn=!1,Cn=new _n;function An(){for(var t;t=wn();){try{t.h.call(t.g)}catch(t){In(t)}var e=Sn;e.j(t),100>e.h&&(e.h++,t.next=e.g,e.g=t)}kn=!1}function Rn(t,e){gn.call(this),this.h=t||1,this.g=e||re,this.j=he(this.lb,this),this.l=Date.now()}function Nn(t){t.ca=!1,t.R&&(t.g.clearTimeout(t.R),t.R=null)}function Ln(t,e,n){if("function"==typeof t)n&&(t=he(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=he(t.handleEvent,t)}return 2147483647<Number(e)?-1:re.setTimeout(t,e||0)}function On(t){t.g=Ln((function(){t.g=null,t.i&&(t.i=!1,On(t))}),t.j);var e=t.h;t.h=null,t.m.apply(null,e)}fe(Rn,gn),(te=Rn.prototype).ca=!1,te.R=null,te.lb=function(){if(this.ca){var t=Date.now()-this.l;0<t&&t<.8*this.h?this.R=this.g.setTimeout(this.j,this.h-t):(this.R&&(this.g.clearTimeout(this.R),this.R=null),mn(this,"tick"),this.ca&&(Nn(this),this.start()))}},te.start=function(){this.ca=!0,this.R||(this.R=this.g.setTimeout(this.j,this.h),this.l=Date.now())},te.M=function(){Rn.X.M.call(this),Nn(this),delete this.g};var Dn=function(t){function e(e,n){var r=t.call(this)||this;return r.m=e,r.j=n,r.h=null,r.i=!1,r.g=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Jt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.l=function(t){this.h=arguments,this.g?this.i=!0:On(this)},e.prototype.M=function(){t.prototype.M.call(this),this.g&&(re.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)},e}(pe);function xn(t){pe.call(this),this.h=t,this.g={}}fe(xn,pe);var Pn=[];function Mn(t,e,n,r){Array.isArray(n)||(n&&(Pn[0]=n.toString()),n=Pn);for(var i=0;i<n.length;i++){var s=sn(e,n[i],r||t.handleEvent,!1,t.h||t);if(!s)break;t.g[s.key]=s}}function Un(t){Qe(t.g,(function(t,e){this.g.hasOwnProperty(e)&&ln(t)}),t),t.g={}}function Fn(){this.g=!0}function zn(t,e,n,r){t.info((function(){return"XMLHTTP TEXT ("+e+"): "+function(t,e){if(!t.g)return e;if(!e)return null;try{var n=JSON.parse(e);if(n)for(t=0;t<n.length;t++)if(Array.isArray(n[t])){var r=n[t];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var s=i[0];if("noop"!=s&&"stop"!=s&&"close"!=s)for(var o=1;o<i.length;o++)i[o]=""}}}return vn(n)}catch(t){return e}}(t,n)+(r?" "+r:"")}))}xn.prototype.M=function(){xn.X.M.call(this),Un(this)},xn.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Fn.prototype.Aa=function(){this.g=!1},Fn.prototype.info=function(){};var Bn={},Vn=null;function Hn(){return Vn=Vn||new gn}function jn(t){ve.call(this,Bn.Pa,t)}function qn(t){var e=Hn();mn(e,new jn(e))}function $n(t,e){ve.call(this,Bn.STAT_EVENT,t),this.stat=e}function Kn(t){var e=Hn();mn(e,new $n(e,t))}function Gn(t,e){ve.call(this,Bn.Qa,t),this.size=e}function Wn(t,e){if("function"!=typeof t)throw Error("Fn must not be null and must be a function");return re.setTimeout((function(){t()}),e)}Bn.Pa="serverreachability",fe(jn,ve),Bn.STAT_EVENT="statevent",fe($n,ve),Bn.Qa="timingevent",fe(Gn,ve);var Qn={NO_ERROR:0,mb:1,zb:2,yb:3,tb:4,xb:5,Ab:6,Ma:7,TIMEOUT:8,Db:9},Yn={rb:"complete",Nb:"success",Na:"error",Ma:"abort",Fb:"ready",Gb:"readystatechange",TIMEOUT:"timeout",Bb:"incrementaldata",Eb:"progress",ub:"downloadprogress",Vb:"uploadprogress"};function Jn(){}function Xn(t){return t.h||(t.h=t.i())}function Zn(){}Jn.prototype.h=null;var tr,er={OPEN:"a",qb:"b",Na:"c",Cb:"d"};function nr(){ve.call(this,"d")}function rr(){ve.call(this,"c")}function ir(){}function sr(t,e,n,r){this.l=t,this.j=e,this.m=n,this.U=r||1,this.S=new xn(this),this.O=ar,t=Le?125:void 0,this.T=new Rn(t),this.H=null,this.i=!1,this.s=this.A=this.v=this.K=this.F=this.V=this.B=null,this.D=[],this.g=null,this.C=0,this.o=this.u=null,this.Y=-1,this.I=!1,this.N=0,this.L=null,this.$=this.J=this.Z=this.P=!1,this.h=new or}function or(){this.i=null,this.g="",this.h=!1}fe(nr,ve),fe(rr,ve),fe(ir,Jn),ir.prototype.g=function(){return new XMLHttpRequest},ir.prototype.i=function(){return{}},tr=new ir;var ar=45e3,cr={},lr={};function ur(t,e,n){t.K=1,t.v=Rr(Ir(e)),t.s=n,t.P=!0,hr(t,null)}function hr(t,e){t.F=Date.now(),gr(t),t.A=Ir(t.v);var n=t.A,r=t.U;Array.isArray(r)||(r=[String(r)]),Hr(n.i,"t",r),t.C=0,n=t.l.H,t.h=new or,t.g=Hi(t.l,n?e:null,!t.s),0<t.N&&(t.L=new Dn(he(t.La,t,t.g),t.N)),Mn(t.S,t.g,"readystatechange",t.ib),e=t.H?Ye(t.H):{},t.s?(t.u||(t.u="POST"),e["Content-Type"]="application/x-www-form-urlencoded",t.g.da(t.A,t.u,t.s,e)):(t.u="GET",t.g.da(t.A,t.u,null,e)),qn(),function(t,e,n,r,i,s){t.info((function(){if(t.g)if(s)for(var o="",a=s.split("&"),c=0;c<a.length;c++){var l=a[c].split("=");if(1<l.length){var u=l[0];l=l[1];var h=u.split("_");o=2<=h.length&&"type"==h[1]?o+(u+"=")+l+"&":o+(u+"=redacted&")}}else o=null;else o=s;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+e+"\n"+n+"\n"+o}))}(t.j,t.u,t.A,t.m,t.U,t.s)}function dr(t){return!!t.g&&("GET"==t.u&&2!=t.K&&t.l.Da)}function fr(t,e,n){for(var r,i=!0;!t.I&&t.C<n.length;){if((r=pr(t,n))==lr){4==e&&(t.o=4,Kn(14),i=!1),zn(t.j,t.m,null,"[Incomplete Response]");break}if(r==cr){t.o=4,Kn(15),zn(t.j,t.m,n,"[Invalid Chunk]"),i=!1;break}zn(t.j,t.m,r,null),br(t,r)}dr(t)&&r!=lr&&r!=cr&&(t.h.g="",t.C=0),4!=e||0!=n.length||t.h.h||(t.o=1,Kn(16),i=!1),t.i=t.i&&i,i?0<n.length&&!t.$&&(t.$=!0,(e=t.l).g==t&&e.$&&!e.K&&(e.j.info("Great, no buffering proxy detected. Bytes received: "+n.length),xi(e),e.K=!0,Kn(11))):(zn(t.j,t.m,n,"[Invalid Chunked Response]"),wr(t),vr(t))}function pr(t,e){var n=t.C,r=e.indexOf("\n",n);return-1==r?lr:(n=Number(e.substring(n,r)),isNaN(n)?cr:(r+=1)+n>e.length?lr:(e=e.substr(r,n),t.C=r+n,e))}function gr(t){t.V=Date.now()+t.O,mr(t,t.O)}function mr(t,e){if(null!=t.B)throw Error("WatchDog timer not null");t.B=Wn(he(t.gb,t),e)}function yr(t){t.B&&(re.clearTimeout(t.B),t.B=null)}function vr(t){0==t.l.G||t.I||Ui(t.l,t)}function wr(t){yr(t);var e=t.L;e&&"function"==typeof e.na&&e.na(),t.L=null,Nn(t.T),Un(t.S),t.g&&(e=t.g,t.g=null,e.abort(),e.na())}function br(t,e){try{var n=t.l;if(0!=n.G&&(n.g==t||Qr(n.h,t)))if(!t.J&&Qr(n.h,t)&&3==n.G){try{var r=n.Fa.g.parse(e)}catch(s){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){t:if(!n.u){if(n.g){if(!(n.g.F+3e3<t.F))break t;Mi(n),ki(n)}Di(n),Kn(18)}}else n.Ba=i[1],0<n.Ba-n.T&&37500>i[2]&&n.L&&0==n.A&&!n.v&&(n.v=Wn(he(n.cb,n),6e3));if(1>=Wr(n.h)&&n.ja){try{n.ja()}catch(s){}n.ja=void 0}}else zi(n,11)}else if((t.J||n.g==t)&&Mi(n),!be(e))for(i=n.Fa.g.parse(e),e=0;e<i.length;e++){var s=i[e];if(n.T=s[0],s=s[1],2==n.G)if("c"==s[0]){n.I=s[1],n.ka=s[2];var o=s[3];null!=o&&(n.ma=o,n.j.info("VER="+n.ma));var a=s[4];null!=a&&(n.Ca=a,n.j.info("SVER="+n.Ca));var c=s[5];null!=c&&"number"==typeof c&&0<c&&(r=1.5*c,n.J=r,n.j.info("backChannelRequestTimeoutMs_="+r)),r=n;var l=t.g;if(l){var u=l.g?l.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(u){var h=r.h;h.g||-1==u.indexOf("spdy")&&-1==u.indexOf("quic")&&-1==u.indexOf("h2")||(h.j=h.l,h.g=new Set,h.h&&(Yr(h,h.h),h.h=null))}if(r.D){var d=l.g?l.g.getResponseHeader("X-HTTP-Session-Id"):null;d&&(r.za=d,Ar(r.F,r.D,d))}}n.G=3,n.l&&n.l.xa(),n.$&&(n.P=Date.now()-t.F,n.j.info("Handshake RTT: "+n.P+"ms"));var f=t;if((r=n).sa=Vi(r,r.H?r.ka:null,r.V),f.J){Jr(r.h,f);var p=f,g=r.J;g&&p.setTimeout(g),p.B&&(yr(p),gr(p)),r.g=f}else Oi(r);0<n.i.length&&Ai(n)}else"stop"!=s[0]&&"close"!=s[0]||zi(n,7);else 3==n.G&&("stop"==s[0]||"close"==s[0]?"stop"==s[0]?zi(n,7):Ti(n):"noop"!=s[0]&&n.l&&n.l.wa(s),n.A=0)}qn()}catch(s){}}function _r(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(se(t)||"string"==typeof t)Array.prototype.forEach.call(t,e,void 0);else for(var n=function(t){if(t.oa&&"function"==typeof t.oa)return t.oa();if(!t.W||"function"!=typeof t.W){if("undefined"!=typeof Map&&t instanceof Map)return Array.from(t.keys());if(!("undefined"!=typeof Set&&t instanceof Set)){if(se(t)||"string"==typeof t){var e=[];t=t.length;for(var n=0;n<t;n++)e.push(n);return e}for(var r in e=[],n=0,t)e[n++]=r;return e}}}(t),r=function(t){if(t.W&&"function"==typeof t.W)return t.W();if("undefined"!=typeof Map&&t instanceof Map||"undefined"!=typeof Set&&t instanceof Set)return Array.from(t.values());if("string"==typeof t)return t.split("");if(se(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}for(r in e=[],n=0,t)e[n++]=t[r];return e}(t),i=r.length,s=0;s<i;s++)e.call(void 0,r[s],n&&n[s],t)}(te=sr.prototype).setTimeout=function(t){this.O=t},te.ib=function(t){t=t.target;var e=this.L;e&&3==wi(t)?e.l():this.La(t)},te.La=function(t){try{if(t==this.g)t:{var e=wi(this.g),n=this.g.Ea();this.g.aa();if(!(3>e)&&(3!=e||Le||this.g&&(this.h.h||this.g.fa()||bi(this.g)))){this.I||4!=e||7==n||qn(),yr(this);var r=this.g.aa();this.Y=r;e:if(dr(this)){var i=bi(this.g);t="";var s=i.length,o=4==wi(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){wr(this),vr(this);var a="";break e}this.h.i=new re.TextDecoder}for(n=0;n<s;n++)this.h.h=!0,t+=this.h.i.decode(i[n],{stream:o&&n==s-1});i.splice(0,s),this.h.g+=t,this.C=0,a=this.h.g}else a=this.g.fa();if(this.i=200==r,function(t,e,n,r,i,s,o){t.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+e+"\n"+n+"\n"+s+" "+o}))}(this.j,this.u,this.A,this.m,this.U,e,r),this.i){if(this.Z&&!this.J){e:{if(this.g){var c,l=this.g;if((c=l.g?l.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!be(c)){var u=c;break e}}u=null}if(!(r=u)){this.i=!1,this.o=3,Kn(12),wr(this),vr(this);break t}zn(this.j,this.m,r,"Initial handshake response via X-HTTP-Initial-Response"),this.J=!0,br(this,r)}this.P?(fr(this,e,a),Le&&this.i&&3==e&&(Mn(this.S,this.T,"tick",this.hb),this.T.start())):(zn(this.j,this.m,a,null),br(this,a)),4==e&&wr(this),this.i&&!this.I&&(4==e?Ui(this.l,this):(this.i=!1,gr(this)))}else 400==r&&0<a.indexOf("Unknown SID")?(this.o=3,Kn(12)):(this.o=0,Kn(13)),wr(this),vr(this)}}}catch(e){}},te.hb=function(){if(this.g){var t=wi(this.g),e=this.g.fa();this.C<e.length&&(yr(this),fr(this,t,e),this.i&&4!=t&&gr(this))}},te.cancel=function(){this.I=!0,wr(this)},te.gb=function(){this.B=null;var t=Date.now();0<=t-this.V?(function(t,e){t.info((function(){return"TIMEOUT: "+e}))}(this.j,this.A),2!=this.K&&(qn(),Kn(17)),wr(this),this.o=2,vr(this)):mr(this,this.V-t)};var Sr=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Er(t,e){if(this.g=this.s=this.j="",this.m=null,this.o=this.l="",this.h=!1,t instanceof Er){this.h=void 0!==e?e:t.h,Tr(this,t.j),this.s=t.s,this.g=t.g,kr(this,t.m),this.l=t.l,e=t.i;var n=new Fr;n.i=e.i,e.g&&(n.g=new Map(e.g),n.h=e.h),Cr(this,n),this.o=t.o}else t&&(n=String(t).match(Sr))?(this.h=!!e,Tr(this,n[1]||"",!0),this.s=Nr(n[2]||""),this.g=Nr(n[3]||"",!0),kr(this,n[4]),this.l=Nr(n[5]||"",!0),Cr(this,n[6]||"",!0),this.o=Nr(n[7]||"")):(this.h=!!e,this.i=new Fr(null,this.h))}function Ir(t){return new Er(t)}function Tr(t,e,n){t.j=n?Nr(e,!0):e,t.j&&(t.j=t.j.replace(/:$/,""))}function kr(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.m=e}else t.m=null}function Cr(t,e,n){e instanceof Fr?(t.i=e,function(t,e){e&&!t.j&&(zr(t),t.i=null,t.g.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(Br(this,e),Hr(this,n,t))}),t)),t.j=e}(t.i,t.h)):(n||(e=Lr(e,Mr)),t.i=new Fr(e,t.h))}function Ar(t,e,n){t.i.set(e,n)}function Rr(t){return Ar(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function Nr(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function Lr(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,Or),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Or(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Er.prototype.toString=function(){var t=[],e=this.j;e&&t.push(Lr(e,Dr,!0),":");var n=this.g;return(n||"file"==e)&&(t.push("//"),(e=this.s)&&t.push(Lr(e,Dr,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&t.push(":",String(n))),(n=this.l)&&(this.g&&"/"!=n.charAt(0)&&t.push("/"),t.push(Lr(n,"/"==n.charAt(0)?Pr:xr,!0))),(n=this.i.toString())&&t.push("?",n),(n=this.o)&&t.push("#",Lr(n,Ur)),t.join("")};var Dr=/[#\/\?@]/g,xr=/[#\?:]/g,Pr=/[#\?]/g,Mr=/[#\?@]/g,Ur=/#/g;function Fr(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function zr(t){t.g||(t.g=new Map,t.h=0,t.i&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var s=t[n].substring(0,r);i=t[n].substring(r+1)}else s=t[n];e(s,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.i,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function Br(t,e){zr(t),e=jr(t,e),t.g.has(e)&&(t.i=null,t.h-=t.g.get(e).length,t.g.delete(e))}function Vr(t,e){return zr(t),e=jr(t,e),t.g.has(e)}function Hr(t,e,n){Br(t,e),0<n.length&&(t.i=null,t.g.set(jr(t,e),me(n)),t.h+=n.length)}function jr(t,e){return e=String(e),t.j&&(e=e.toLowerCase()),e}(te=Fr.prototype).add=function(t,e){zr(this),this.i=null,t=jr(this,t);var n=this.g.get(t);return n||this.g.set(t,n=[]),n.push(e),this.h+=1,this},te.forEach=function(t,e){zr(this),this.g.forEach((function(n,r){n.forEach((function(n){t.call(e,n,r,this)}),this)}),this)},te.oa=function(){zr(this);for(var t=Array.from(this.g.values()),e=Array.from(this.g.keys()),n=[],r=0;r<e.length;r++)for(var i=t[r],s=0;s<i.length;s++)n.push(e[r]);return n},te.W=function(t){zr(this);var e=[];if("string"==typeof t)Vr(this,t)&&(e=e.concat(this.g.get(jr(this,t))));else{t=Array.from(this.g.values());for(var n=0;n<t.length;n++)e=e.concat(t[n])}return e},te.set=function(t,e){return zr(this),this.i=null,Vr(this,t=jr(this,t))&&(this.h-=this.g.get(t).length),this.g.set(t,[e]),this.h+=1,this},te.get=function(t,e){return t&&0<(t=this.W(t)).length?String(t[0]):e},te.toString=function(){if(this.i)return this.i;if(!this.g)return"";for(var t=[],e=Array.from(this.g.keys()),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r)),s=this.W(r);for(r=0;r<s.length;r++){var o=i;""!==s[r]&&(o+="="+encodeURIComponent(String(s[r]))),t.push(o)}}return this.i=t.join("&")};var qr=function(t,e){this.h=t,this.g=e};function $r(t){this.l=t||Kr,re.PerformanceNavigationTiming?t=0<(t=re.performance.getEntriesByType("navigation")).length&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol):t=!!(re.g&&re.g.Ga&&re.g.Ga()&&re.g.Ga().$b),this.j=t?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var Kr=10;function Gr(t){return!!t.h||!!t.g&&t.g.size>=t.j}function Wr(t){return t.h?1:t.g?t.g.size:0}function Qr(t,e){return t.h?t.h==e:!!t.g&&t.g.has(e)}function Yr(t,e){t.g?t.g.add(e):t.h=e}function Jr(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}function Xr(t){var e,n;if(null!=t.h)return t.i.concat(t.h.D);if(null!=t.g&&0!==t.g.size){var r=t.i;try{for(var i=Xt(t.g.values()),s=i.next();!s.done;s=i.next()){var o=s.value;r=r.concat(o.D)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}return me(t.i)}function Zr(){}function ti(){this.g=new Zr}function ei(t,e,n){var r=n||"";try{_r(t,(function(t,n){var i=t;oe(t)&&(i=vn(t)),e.push(r+n+"="+encodeURIComponent(i))}))}catch(t){throw e.push(r+"type="+encodeURIComponent("_badmap")),t}}function ni(t,e,n,r,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(t){}}function ri(t){this.l=t.ac||null,this.j=t.jb||!1}function ii(t,e){gn.call(this),this.D=t,this.u=e,this.m=void 0,this.readyState=si,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}$r.prototype.cancel=function(){var t,e;if(this.i=Xr(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){try{for(var n=Xt(this.g.values()),r=n.next();!r.done;r=n.next()){r.value.cancel()}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.g.clear()}},Zr.prototype.stringify=function(t){return re.JSON.stringify(t,void 0)},Zr.prototype.parse=function(t){return re.JSON.parse(t,void 0)},fe(ri,Jn),ri.prototype.g=function(){return new ii(this.l,this.j)},ri.prototype.i=function(t){return function(){return t}}({}),fe(ii,gn);var si=0;function oi(t){t.j.read().then(t.Ta.bind(t)).catch(t.ga.bind(t))}function ai(t){t.readyState=4,t.l=null,t.j=null,t.A=null,ci(t)}function ci(t){t.onreadystatechange&&t.onreadystatechange.call(t)}(te=ii.prototype).open=function(t,e){if(this.readyState!=si)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,ci(this)},te.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;var e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.D||re).fetch(new Request(this.B,e)).then(this.Wa.bind(this),this.ga.bind(this))},te.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch((function(){})),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,ai(this)),this.readyState=si},te.Wa=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,ci(this)),this.g&&(this.readyState=3,ci(this),this.g)))if("arraybuffer"===this.responseType)t.arrayBuffer().then(this.Ua.bind(this),this.ga.bind(this));else if(void 0!==re.ReadableStream&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;oi(this)}else t.text().then(this.Va.bind(this),this.ga.bind(this))},te.Ta=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var e=t.value?t.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?ai(this):ci(this),3==this.readyState&&oi(this)}},te.Va=function(t){this.g&&(this.response=this.responseText=t,ai(this))},te.Ua=function(t){this.g&&(this.response=t,ai(this))},te.ga=function(){this.g&&ai(this)},te.setRequestHeader=function(t,e){this.v.append(t,e)},te.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""},te.getAllResponseHeaders=function(){if(!this.h)return"";for(var t=[],e=this.h.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(ii.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(t){this.m=t?"include":"same-origin"}});var li=re.JSON.parse;function ui(t){gn.call(this),this.headers=new Map,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=hi,this.K=this.L=!1}fe(ui,gn);var hi="",di=/^https?$/i,fi=["POST","PUT"];function pi(t,e){t.h=!1,t.g&&(t.l=!0,t.g.abort(),t.l=!1),t.j=e,t.m=5,gi(t),yi(t)}function gi(t){t.D||(t.D=!0,mn(t,"complete"),mn(t,"error"))}function mi(t){if(t.h&&void 0!==ne&&(!t.C[1]||4!=wi(t)||2!=t.aa()))if(t.v&&4==wi(t))Ln(t.Ha,0,t);else if(mn(t,"readystatechange"),4==wi(t)){t.h=!1;try{var e,n=t.aa();t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var s=String(t.H).match(Sr)[1]||null;if(!s&&re.self&&re.self.location){var o=re.self.location.protocol;s=o.substr(0,o.length-1)}i=!di.test(s?s.toLowerCase():"")}e=i}if(e)mn(t,"complete"),mn(t,"success");else{t.m=6;try{var a=2<wi(t)?t.g.statusText:""}catch(t){a=""}t.j=a+" ["+t.aa()+"]",gi(t)}}finally{yi(t)}}}function yi(t,e){if(t.g){vi(t);var n=t.g,r=t.C[0]?ie:null;t.g=null,t.C=null,e||mn(t,"ready");try{n.onreadystatechange=r}catch(t){}}}function vi(t){t.g&&t.K&&(t.g.ontimeout=null),t.A&&(re.clearTimeout(t.A),t.A=null)}function wi(t){return t.g?t.g.readyState:0}function bi(t){try{if(!t.g)return null;if("response"in t.g)return t.g.response;switch(t.J){case hi:case"text":return t.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in t.g)return t.g.mozResponseArrayBuffer}return null}catch(t){return null}}function _i(t){var e="";return Qe(t,(function(t,n){e+=n,e+=":",e+=t,e+="\r\n"})),e}function Si(t,e,n){t:{for(r in n){var r=!1;break t}r=!0}r||(n=_i(n),"string"==typeof t?null!=n&&encodeURIComponent(String(n)):Ar(t,e,n))}function Ei(t,e,n){return n&&n.internalChannelParams&&n.internalChannelParams[t]||e}function Ii(t){this.Ca=0,this.i=[],this.j=new Fn,this.ka=this.sa=this.F=this.V=this.g=this.za=this.D=this.ia=this.o=this.S=this.s=null,this.ab=this.U=0,this.Za=Ei("failFast",!1,t),this.L=this.v=this.u=this.m=this.l=null,this.Y=!0,this.pa=this.Ba=this.T=-1,this.Z=this.A=this.C=0,this.Xa=Ei("baseRetryDelayMs",5e3,t),this.bb=Ei("retryDelaySeedMs",1e4,t),this.$a=Ei("forwardChannelMaxRetries",2,t),this.ta=Ei("forwardChannelRequestTimeoutMs",2e4,t),this.ra=t&&t.xmlHttpFactory||void 0,this.Da=t&&t.Zb||!1,this.J=void 0,this.H=t&&t.supportsCrossDomainXhr||!1,this.I="",this.h=new $r(t&&t.concurrentRequestLimit),this.Fa=new ti,this.O=t&&t.fastHandshake||!1,this.N=t&&t.encodeInitMessageHeaders||!1,this.O&&this.N&&(this.N=!1),this.Ya=t&&t.Xb||!1,t&&t.Aa&&this.j.Aa(),t&&t.forceLongPolling&&(this.Y=!1),this.$=!this.O&&this.Y&&t&&t.detectBufferingProxy||!1,this.ja=void 0,this.P=0,this.K=!1,this.la=this.B=null}function Ti(t){if(Ci(t),3==t.G){var e=t.U++,n=Ir(t.F);Ar(n,"SID",t.I),Ar(n,"RID",e),Ar(n,"TYPE","terminate"),Ni(t,n),(e=new sr(t,t.j,e,void 0)).K=2,e.v=Rr(Ir(n)),n=!1,re.navigator&&re.navigator.sendBeacon&&(n=re.navigator.sendBeacon(e.v.toString(),"")),!n&&re.Image&&((new Image).src=e.v,n=!0),n||(e.g=Hi(e.l,null),e.g.da(e.v)),e.F=Date.now(),gr(e)}Bi(t)}function ki(t){t.g&&(xi(t),t.g.cancel(),t.g=null)}function Ci(t){ki(t),t.u&&(re.clearTimeout(t.u),t.u=null),Mi(t),t.h.cancel(),t.m&&("number"==typeof t.m&&re.clearTimeout(t.m),t.m=null)}function Ai(t){Gr(t.h)||t.m||(t.m=!0,Tn(t.Ja,t),t.C=0)}function Ri(t,e){var n;n=e?e.m:t.U++;var r=Ir(t.F);Ar(r,"SID",t.I),Ar(r,"RID",n),Ar(r,"AID",t.T),Ni(t,r),t.o&&t.s&&Si(r,t.o,t.s),n=new sr(t,t.j,n,t.C+1),null===t.o&&(n.H=t.s),e&&(t.i=e.D.concat(t.i)),e=Li(t,n,1e3),n.setTimeout(Math.round(.5*t.ta)+Math.round(.5*t.ta*Math.random())),Yr(t.h,n),ur(n,r,e)}function Ni(t,e){t.ia&&Qe(t.ia,(function(t,n){Ar(e,n,t)})),t.l&&_r({},(function(t,n){Ar(e,n,t)}))}function Li(t,e,n){n=Math.min(t.i.length,n);var r=t.l?he(t.l.Ra,t.l,t):null;t:for(var i=t.i,s=-1;;){var o=["count="+n];-1==s?0<n?(s=i[0].h,o.push("ofs="+s)):s=0:o.push("ofs="+s);for(var a=!0,c=0;c<n;c++){var l=i[c].h,u=i[c].g;if(0>(l-=s))s=Math.max(0,i[c].h-100),a=!1;else try{ei(u,o,"req"+l+"_")}catch(t){r&&r(u)}}if(a){r=o.join("&");break t}}return t=t.i.splice(0,n),e.D=t,r}function Oi(t){t.g||t.u||(t.Z=1,Tn(t.Ia,t),t.A=0)}function Di(t){return!(t.g||t.u||3<=t.A)&&(t.Z++,t.u=Wn(he(t.Ia,t),Fi(t,t.A)),t.A++,!0)}function xi(t){null!=t.B&&(re.clearTimeout(t.B),t.B=null)}function Pi(t){t.g=new sr(t,t.j,"rpc",t.Z),null===t.o&&(t.g.H=t.s),t.g.N=0;var e=Ir(t.sa);Ar(e,"RID","rpc"),Ar(e,"SID",t.I),Ar(e,"CI",t.L?"0":"1"),Ar(e,"AID",t.T),Ar(e,"TYPE","xmlhttp"),Ni(t,e),t.o&&t.s&&Si(e,t.o,t.s),t.J&&t.g.setTimeout(t.J);var n=t.g;t=t.ka,n.K=1,n.v=Rr(Ir(e)),n.s=null,n.P=!0,hr(n,t)}function Mi(t){null!=t.v&&(re.clearTimeout(t.v),t.v=null)}function Ui(t,e){var n=null;if(t.g==e){Mi(t),xi(t),t.g=null;var r=2}else{if(!Qr(t.h,e))return;n=e.D,Jr(t.h,e),r=1}if(0!=t.G)if(t.pa=e.Y,e.i)if(1==r){n=e.s?e.s.length:0,e=Date.now()-e.F;var i=t.C;mn(r=Hn(),new Gn(r,n)),Ai(t)}else Oi(t);else if(3==(i=e.o)||0==i&&0<t.pa||!(1==r&&function(t,e){return!(Wr(t.h)>=t.h.j-(t.m?1:0)||(t.m?(t.i=e.D.concat(t.i),0):1==t.G||2==t.G||t.C>=(t.Za?0:t.$a)||(t.m=Wn(he(t.Ja,t,e),Fi(t,t.C)),t.C++,0)))}(t,e)||2==r&&Di(t)))switch(n&&0<n.length&&(e=t.h,e.i=e.i.concat(n)),i){case 1:zi(t,5);break;case 4:zi(t,10);break;case 3:zi(t,6);break;default:zi(t,2)}}function Fi(t,e){var n=t.Xa+Math.floor(Math.random()*t.bb);return t.l||(n*=2),n*e}function zi(t,e){if(t.j.info("Error code "+e),2==e){var n=null;t.l&&(n=null);var r=he(t.kb,t);n||(n=new Er("//www.google.com/images/cleardot.gif"),re.location&&"http"==re.location.protocol||Tr(n,"https"),Rr(n)),function(t,e){var n=new Fn;if(re.Image){var r=new Image;r.onload=de(ni,n,r,"TestLoadImage: loaded",!0,e),r.onerror=de(ni,n,r,"TestLoadImage: error",!1,e),r.onabort=de(ni,n,r,"TestLoadImage: abort",!1,e),r.ontimeout=de(ni,n,r,"TestLoadImage: timeout",!1,e),re.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=t}else e(!1)}(n.toString(),r)}else Kn(2);t.G=0,t.l&&t.l.va(e),Bi(t),Ci(t)}function Bi(t){if(t.G=0,t.la=[],t.l){var e=Xr(t.h);0==e.length&&0==t.i.length||(ye(t.la,e),ye(t.la,t.i),t.h.i.length=0,me(t.i),t.i.length=0),t.l.ua()}}function Vi(t,e,n){var r=n instanceof Er?Ir(n):new Er(n,void 0);if(""!=r.g)e&&(r.g=e+"."+r.g),kr(r,r.m);else{var i=re.location;r=i.protocol,e=e?e+"."+i.hostname:i.hostname,i=+i.port;var s=new Er(null,void 0);r&&Tr(s,r),e&&(s.g=e),i&&kr(s,i),n&&(s.l=n),r=s}return n=t.D,e=t.za,n&&e&&Ar(r,n,e),Ar(r,"VER",t.ma),Ni(t,r),r}function Hi(t,e,n){if(e&&!t.H)throw Error("Can't create secondary domain capable XhrIo object.");return(e=n&&t.Da&&!t.ra?new ui(new ri({jb:!0})):new ui(t.ra)).Ka(t.H),e}function ji(){}function qi(){if(Re&&!(10<=Number(He)))throw Error("Environmental error: no available transport.")}function $i(t,e){gn.call(this),this.g=new Ii(e),this.l=t,this.h=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.g.s=t,t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.ya&&(t?t["X-WebChannel-Client-Profile"]=e.ya:t={"X-WebChannel-Client-Profile":e.ya}),this.g.S=t,(t=e&&e.Yb)&&!be(t)&&(this.g.o=t),this.A=e&&e.supportsCrossDomainXhr||!1,this.v=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!be(e)&&(this.g.D=e,null!==(t=this.h)&&e in t&&(e in(t=this.h)&&delete t[e])),this.j=new Wi(this)}function Ki(t){nr.call(this);var e=t.__sm__;if(e){t:{for(var n in e){t=n;break t}t=void 0}(this.i=t)&&(t=this.i,e=null!==e&&t in e?e[t]:void 0),this.data=e}else this.data=t}function Gi(){rr.call(this),this.status=1}function Wi(t){this.g=t}(te=ui.prototype).Ka=function(t){this.L=t},te.da=function(t,e,n,r){var i,s,o,a;if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+t);e=e?e.toUpperCase():"GET",this.H=t,this.j="",this.m=0,this.D=!1,this.h=!0,this.g=this.u?this.u.g():tr.g(),this.C=this.u?Xn(this.u):Xn(tr),this.g.onreadystatechange=he(this.Ha,this);try{this.F=!0,this.g.open(e,String(t),!0),this.F=!1}catch(h){return void pi(this,h)}if(t=n||"",n=new Map(this.headers),r)if(Object.getPrototypeOf(r)===Object.prototype)for(var c in r)n.set(c,r[c]);else{if("function"!=typeof r.keys||"function"!=typeof r.get)throw Error("Unknown input type for opt_headers: "+String(r));try{for(var l=Xt(r.keys()),u=l.next();!u.done;u=l.next()){var h=u.value;n.set(h,r.get(h))}}catch(t){i={error:t}}finally{try{u&&!u.done&&(s=l.return)&&s.call(l)}finally{if(i)throw i.error}}}r=Array.from(n.keys()).find((function(t){return"content-type"==t.toLowerCase()})),c=re.FormData&&t instanceof re.FormData,!(0<=ge(fi,e))||r||c||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");try{for(var d=Xt(n),f=d.next();!f.done;f=d.next()){var p=Zt(f.value,2),g=(h=p[0],p[1]);this.g.setRequestHeader(h,g)}}catch(t){o={error:t}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{vi(this),0<this.B&&((this.K=function(t){return Re&&Be()&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(this.g))?(this.g.timeout=this.B,this.g.ontimeout=he(this.qa,this)):this.A=Ln(this.qa,this.B,this)),this.v=!0,this.g.send(t),this.v=!1}catch(h){pi(this,h)}},te.qa=function(){void 0!==ne&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,mn(this,"timeout"),this.abort(8))},te.abort=function(t){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=t||7,mn(this,"complete"),mn(this,"abort"),yi(this))},te.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),yi(this,!0)),ui.X.M.call(this)},te.Ha=function(){this.s||(this.F||this.v||this.l?mi(this):this.fb())},te.fb=function(){mi(this)},te.aa=function(){try{return 2<wi(this)?this.g.status:-1}catch(t){return-1}},te.fa=function(){try{return this.g?this.g.responseText:""}catch(t){return""}},te.Sa=function(t){if(this.g){var e=this.g.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),li(e)}},te.Ea=function(){return this.m},te.Oa=function(){return"string"==typeof this.j?this.j:String(this.j)},(te=Ii.prototype).ma=8,te.G=1,te.Ja=function(t){if(this.m)if(this.m=null,1==this.G){if(!t){this.U=Math.floor(1e5*Math.random()),t=this.U++;var e=new sr(this,this.j,t,void 0),n=this.s;if(this.S&&(n?Xe(n=Ye(n),this.S):n=this.S),null!==this.o||this.N||(e.H=n,n=null),this.O)t:{for(var r=0,i=0;i<this.i.length;i++){var s=this.i[i];if(void 0===(s="__data__"in s.g&&"string"==typeof(s=s.g.__data__)?s.length:void 0))break;if(4096<(r+=s)){r=i;break t}if(4096===r||i===this.i.length-1){r=i+1;break t}}r=1e3}else r=1e3;r=Li(this,e,r),Ar(i=Ir(this.F),"RID",t),Ar(i,"CVER",22),this.D&&Ar(i,"X-HTTP-Session-Id",this.D),Ni(this,i),n&&(this.N?r="headers="+encodeURIComponent(String(_i(n)))+"&"+r:this.o&&Si(i,this.o,n)),Yr(this.h,e),this.Ya&&Ar(i,"TYPE","init"),this.O?(Ar(i,"$req",r),Ar(i,"SID","null"),e.Z=!0,ur(e,i,null)):ur(e,i,r),this.G=2}}else 3==this.G&&(t?Ri(this,t):0==this.i.length||Gr(this.h)||Ri(this))},te.Ia=function(){if(this.u=null,Pi(this),this.$&&!(this.K||null==this.g||0>=this.P)){var t=2*this.P;this.j.info("BP detection timer enabled: "+t),this.B=Wn(he(this.eb,this),t)}},te.eb=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.L=!1,this.K=!0,Kn(10),ki(this),Pi(this))},te.cb=function(){null!=this.v&&(this.v=null,ki(this),Di(this),Kn(19))},te.kb=function(t){t?(this.j.info("Successfully pinged google.com"),Kn(2)):(this.j.info("Failed to ping google.com"),Kn(1))},(te=ji.prototype).xa=function(){},te.wa=function(){},te.va=function(){},te.ua=function(){},te.Ra=function(){},qi.prototype.g=function(t,e){return new $i(t,e)},fe($i,gn),$i.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.H=!0);var t=this.g,e=this.l,n=this.h||void 0;Kn(0),t.V=e,t.ia=n||{},t.L=t.Y,t.F=Vi(t,null,t.V),Ai(t)},$i.prototype.close=function(){Ti(this.g)},$i.prototype.u=function(t){var e=this.g;if("string"==typeof t){var n={};n.__data__=t,t=n}else this.v&&((n={}).__data__=vn(t),t=n);e.i.push(new qr(e.ab++,t)),3==e.G&&Ai(e)},$i.prototype.M=function(){this.g.l=null,delete this.j,Ti(this.g),delete this.g,$i.X.M.call(this)},fe(Ki,nr),fe(Gi,rr),fe(Wi,ji),Wi.prototype.xa=function(){mn(this.g,"a")},Wi.prototype.wa=function(t){mn(this.g,new Ki(t))},Wi.prototype.va=function(t){mn(this.g,new Gi)},Wi.prototype.ua=function(){mn(this.g,"b")},qi.prototype.createWebChannel=qi.prototype.g,$i.prototype.send=$i.prototype.u,$i.prototype.open=$i.prototype.m,$i.prototype.close=$i.prototype.close,Qn.NO_ERROR=0,Qn.TIMEOUT=8,Qn.HTTP_ERROR=6,Yn.COMPLETE="complete",Zn.EventType=er,er.OPEN="a",er.CLOSE="b",er.ERROR="c",er.MESSAGE="d",gn.prototype.listen=gn.prototype.N,ui.prototype.listenOnce=ui.prototype.O,ui.prototype.getLastError=ui.prototype.Oa,ui.prototype.getLastErrorCode=ui.prototype.Ea,ui.prototype.getStatus=ui.prototype.aa,ui.prototype.getResponseJson=ui.prototype.Sa,ui.prototype.getResponseText=ui.prototype.fa,ui.prototype.send=ui.prototype.da,ui.prototype.setWithCredentials=ui.prototype.Ka;var Qi=Qn,Yi=Yn,Ji=Bn,Xi=10,Zi=11,ts=ri,es=Zn,ns=ui;const rs="@firebase/firestore";
|
|
319
319
|
/**
|
|
320
320
|
* @license
|
|
321
321
|
* Copyright 2017 Google LLC
|
|
@@ -331,7 +331,7 @@ class Oe{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e)
|
|
|
331
331
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
332
332
|
* See the License for the specific language governing permissions and
|
|
333
333
|
* limitations under the License.
|
|
334
|
-
*/class is{constructor(
|
|
334
|
+
*/class is{constructor(t){this.uid=t}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(t){return t.uid===this.uid}}is.UNAUTHENTICATED=new is(null),is.GOOGLE_CREDENTIALS=new is("google-credentials-uid"),is.FIRST_PARTY=new is("first-party-uid"),is.MOCK_USER=new is("mock-user");
|
|
335
335
|
/**
|
|
336
336
|
* @license
|
|
337
337
|
* Copyright 2017 Google LLC
|
|
@@ -364,7 +364,7 @@ let ss="9.15.0";
|
|
|
364
364
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
365
365
|
* See the License for the specific language governing permissions and
|
|
366
366
|
* limitations under the License.
|
|
367
|
-
*/const os=new
|
|
367
|
+
*/const os=new x("@firebase/firestore");function as(){return os.logLevel}function cs(t,...e){if(os.logLevel<=R.DEBUG){const n=e.map(hs);os.debug(`Firestore (${ss}): ${t}`,...n)}}function ls(t,...e){if(os.logLevel<=R.ERROR){const n=e.map(hs);os.error(`Firestore (${ss}): ${t}`,...n)}}function us(t,...e){if(os.logLevel<=R.WARN){const n=e.map(hs);os.warn(`Firestore (${ss}): ${t}`,...n)}}function hs(t){if("string"==typeof t)return t;try{return e=t,JSON.stringify(e)}catch(e){return t}
|
|
368
368
|
/**
|
|
369
369
|
* @license
|
|
370
370
|
* Copyright 2020 Google LLC
|
|
@@ -380,7 +380,7 @@ let ss="9.15.0";
|
|
|
380
380
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
381
381
|
* See the License for the specific language governing permissions and
|
|
382
382
|
* limitations under the License.
|
|
383
|
-
*/var
|
|
383
|
+
*/var e}
|
|
384
384
|
/**
|
|
385
385
|
* @license
|
|
386
386
|
* Copyright 2017 Google LLC
|
|
@@ -396,7 +396,7 @@ let ss="9.15.0";
|
|
|
396
396
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
397
397
|
* See the License for the specific language governing permissions and
|
|
398
398
|
* limitations under the License.
|
|
399
|
-
*/function
|
|
399
|
+
*/function ds(t="Unexpected state"){const e=`FIRESTORE (${ss}) INTERNAL ASSERTION FAILED: `+t;throw ls(e),new Error(e)}function fs(t,e){t||ds()}function ps(t,e){return t}
|
|
400
400
|
/**
|
|
401
401
|
* @license
|
|
402
402
|
* Copyright 2017 Google LLC
|
|
@@ -412,7 +412,7 @@ let ss="9.15.0";
|
|
|
412
412
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
413
413
|
* See the License for the specific language governing permissions and
|
|
414
414
|
* limitations under the License.
|
|
415
|
-
*/const
|
|
415
|
+
*/const gs={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class ms extends p{constructor(t,e){super(t,e),this.code=t,this.message=e,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}
|
|
416
416
|
/**
|
|
417
417
|
* @license
|
|
418
418
|
* Copyright 2017 Google LLC
|
|
@@ -428,7 +428,7 @@ let ss="9.15.0";
|
|
|
428
428
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
429
429
|
* See the License for the specific language governing permissions and
|
|
430
430
|
* limitations under the License.
|
|
431
|
-
*/class
|
|
431
|
+
*/class ys{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}
|
|
432
432
|
/**
|
|
433
433
|
* @license
|
|
434
434
|
* Copyright 2017 Google LLC
|
|
@@ -444,7 +444,7 @@ let ss="9.15.0";
|
|
|
444
444
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
445
445
|
* See the License for the specific language governing permissions and
|
|
446
446
|
* limitations under the License.
|
|
447
|
-
*/class
|
|
447
|
+
*/class vs{constructor(t,e){this.user=e,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${t}`)}}class ws{getToken(){return Promise.resolve(null)}invalidateToken(){}start(t,e){t.enqueueRetryable((()=>e(is.UNAUTHENTICATED)))}shutdown(){}}class bs{constructor(t){this.token=t,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(t,e){this.changeListener=e,t.enqueueRetryable((()=>e(this.token.user)))}shutdown(){this.changeListener=null}}class _s{constructor(t){this.t=t,this.currentUser=is.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(t,e){let n=this.i;const r=t=>this.i!==n?(n=this.i,e(t)):Promise.resolve();let i=new ys;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new ys,t.enqueueRetryable((()=>r(this.currentUser)))};const s=()=>{const e=i;t.enqueueRetryable((async()=>{await e.promise,await r(this.currentUser)}))},o=t=>{cs("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=t,this.auth.addAuthTokenListener(this.o),s()};this.t.onInit((t=>o(t))),setTimeout((()=>{if(!this.auth){const t=this.t.getImmediate({optional:!0});t?o(t):(cs("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new ys)}}),0),s()}getToken(){const t=this.i,e=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(e).then((e=>this.i!==t?(cs("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):e?(fs("string"==typeof e.accessToken),new vs(e.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const t=this.auth&&this.auth.getUid();return fs(null===t||"string"==typeof t),new is(t)}}class Ss{constructor(t,e,n,r){this.h=t,this.l=e,this.m=n,this.g=r,this.type="FirstParty",this.user=is.FIRST_PARTY,this.p=new Map}I(){return this.g?this.g():(fs(!("object"!=typeof this.h||null===this.h||!this.h.auth||!this.h.auth.getAuthHeaderValueForFirstParty)),this.h.auth.getAuthHeaderValueForFirstParty([]))}get headers(){this.p.set("X-Goog-AuthUser",this.l);const t=this.I();return t&&this.p.set("Authorization",t),this.m&&this.p.set("X-Goog-Iam-Authorization-Token",this.m),this.p}}class Es{constructor(t,e,n,r){this.h=t,this.l=e,this.m=n,this.g=r}getToken(){return Promise.resolve(new Ss(this.h,this.l,this.m,this.g))}start(t,e){t.enqueueRetryable((()=>e(is.FIRST_PARTY)))}shutdown(){}invalidateToken(){}}class Is{constructor(t){this.value=t,this.type="AppCheck",this.headers=new Map,t&&t.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class Ts{constructor(t){this.T=t,this.forceRefresh=!1,this.appCheck=null,this.A=null}start(t,e){const n=t=>{null!=t.error&&cs("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);const n=t.token!==this.A;return this.A=t.token,cs("FirebaseAppCheckTokenProvider",`Received ${n?"new":"existing"} token.`),n?e(t.token):Promise.resolve()};this.o=e=>{t.enqueueRetryable((()=>n(e)))};const r=t=>{cs("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=t,this.appCheck.addTokenListener(this.o)};this.T.onInit((t=>r(t))),setTimeout((()=>{if(!this.appCheck){const t=this.T.getImmediate({optional:!0});t?r(t):cs("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}}),0)}getToken(){const t=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(t).then((t=>t?(fs("string"==typeof t.token),this.A=t.token,new Is(t.token)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}
|
|
448
448
|
/**
|
|
449
449
|
* @license
|
|
450
450
|
* Copyright 2020 Google LLC
|
|
@@ -460,7 +460,7 @@ let ss="9.15.0";
|
|
|
460
460
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
461
461
|
* See the License for the specific language governing permissions and
|
|
462
462
|
* limitations under the License.
|
|
463
|
-
*/function
|
|
463
|
+
*/function ks(t){const e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(let e=0;e<t;e++)n[e]=Math.floor(256*Math.random());return n}
|
|
464
464
|
/**
|
|
465
465
|
* @license
|
|
466
466
|
* Copyright 2017 Google LLC
|
|
@@ -476,7 +476,7 @@ let ss="9.15.0";
|
|
|
476
476
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
477
477
|
* See the License for the specific language governing permissions and
|
|
478
478
|
* limitations under the License.
|
|
479
|
-
*/class Cs{static R(){const
|
|
479
|
+
*/class Cs{static R(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=62*Math.floor(256/62);let n="";for(;n.length<20;){const r=ks(40);for(let i=0;i<r.length;++i)n.length<20&&r[i]<e&&(n+=t.charAt(r[i]%62))}return n}}function As(t,e){return t<e?-1:t>e?1:0}function Rs(t,e,n){return t.length===e.length&&t.every(((t,r)=>n(t,e[r])))}
|
|
480
480
|
/**
|
|
481
481
|
* @license
|
|
482
482
|
* Copyright 2017 Google LLC
|
|
@@ -492,7 +492,7 @@ let ss="9.15.0";
|
|
|
492
492
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
493
493
|
* See the License for the specific language governing permissions and
|
|
494
494
|
* limitations under the License.
|
|
495
|
-
*/class
|
|
495
|
+
*/class Ns{constructor(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new ms(gs.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new ms(gs.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new ms(gs.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new ms(gs.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}static now(){return Ns.fromMillis(Date.now())}static fromDate(t){return Ns.fromMillis(t.getTime())}static fromMillis(t){const e=Math.floor(t/1e3),n=Math.floor(1e6*(t-1e3*e));return new Ns(e,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(t){return this.seconds===t.seconds?As(this.nanoseconds,t.nanoseconds):As(this.seconds,t.seconds)}isEqual(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}
|
|
496
496
|
/**
|
|
497
497
|
* @license
|
|
498
498
|
* Copyright 2017 Google LLC
|
|
@@ -508,7 +508,7 @@ let ss="9.15.0";
|
|
|
508
508
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
509
509
|
* See the License for the specific language governing permissions and
|
|
510
510
|
* limitations under the License.
|
|
511
|
-
*/class
|
|
511
|
+
*/class Ls{constructor(t){this.timestamp=t}static fromTimestamp(t){return new Ls(t)}static min(){return new Ls(new Ns(0,0))}static max(){return new Ls(new Ns(253402300799,999999999))}compareTo(t){return this.timestamp._compareTo(t.timestamp)}isEqual(t){return this.timestamp.isEqual(t.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}
|
|
512
512
|
/**
|
|
513
513
|
* @license
|
|
514
514
|
* Copyright 2017 Google LLC
|
|
@@ -524,7 +524,7 @@ let ss="9.15.0";
|
|
|
524
524
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
525
525
|
* See the License for the specific language governing permissions and
|
|
526
526
|
* limitations under the License.
|
|
527
|
-
*/class
|
|
527
|
+
*/class Os{constructor(t,e,n){void 0===e?e=0:e>t.length&&ds(),void 0===n?n=t.length-e:n>t.length-e&&ds(),this.segments=t,this.offset=e,this.len=n}get length(){return this.len}isEqual(t){return 0===Os.comparator(this,t)}child(t){const e=this.segments.slice(this.offset,this.limit());return t instanceof Os?t.forEach((t=>{e.push(t)})):e.push(t),this.construct(e)}limit(){return this.offset+this.length}popFirst(t){return t=void 0===t?1:t,this.construct(this.segments,this.offset+t,this.length-t)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(t){return this.segments[this.offset+t]}isEmpty(){return 0===this.length}isPrefixOf(t){if(t.length<this.length)return!1;for(let e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0}isImmediateParentOf(t){if(this.length+1!==t.length)return!1;for(let e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0}forEach(t){for(let e=this.offset,n=this.limit();e<n;e++)t(this.segments[e])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(t,e){const n=Math.min(t.length,e.length);for(let r=0;r<n;r++){const n=t.get(r),i=e.get(r);if(n<i)return-1;if(n>i)return 1}return t.length<e.length?-1:t.length>e.length?1:0}}class Ds extends Os{construct(t,e,n){return new Ds(t,e,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...t){const e=[];for(const n of t){if(n.indexOf("//")>=0)throw new ms(gs.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);e.push(...n.split("/").filter((t=>t.length>0)))}return new Ds(e)}static emptyPath(){return new Ds([])}}const xs=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Ps extends Os{construct(t,e,n){return new Ps(t,e,n)}static isValidIdentifier(t){return xs.test(t)}canonicalString(){return this.toArray().map((t=>(t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Ps.isValidIdentifier(t)||(t="`"+t+"`"),t))).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new Ps(["__name__"])}static fromServerFormat(t){const e=[];let n="",r=0;const i=()=>{if(0===n.length)throw new ms(gs.INVALID_ARGUMENT,`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);e.push(n),n=""};let s=!1;for(;r<t.length;){const e=t[r];if("\\"===e){if(r+1===t.length)throw new ms(gs.INVALID_ARGUMENT,"Path has trailing escape character: "+t);const e=t[r+1];if("\\"!==e&&"."!==e&&"`"!==e)throw new ms(gs.INVALID_ARGUMENT,"Path has invalid escape sequence: "+t);n+=e,r+=2}else"`"===e?(s=!s,r++):"."!==e||s?(n+=e,r++):(i(),r++)}if(i(),s)throw new ms(gs.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new Ps(e)}static emptyPath(){return new Ps([])}}
|
|
528
528
|
/**
|
|
529
529
|
* @license
|
|
530
530
|
* Copyright 2017 Google LLC
|
|
@@ -540,7 +540,7 @@ let ss="9.15.0";
|
|
|
540
540
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
541
541
|
* See the License for the specific language governing permissions and
|
|
542
542
|
* limitations under the License.
|
|
543
|
-
*/class
|
|
543
|
+
*/class Ms{constructor(t){this.path=t}static fromPath(t){return new Ms(Ds.fromString(t))}static fromName(t){return new Ms(Ds.fromString(t).popFirst(5))}static empty(){return new Ms(Ds.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(t){return null!==t&&0===Ds.comparator(this.path,t.path)}toString(){return this.path.toString()}static comparator(t,e){return Ds.comparator(t.path,e.path)}static isDocumentKey(t){return t.length%2==0}static fromSegments(t){return new Ms(new Ds(t.slice()))}}function Us(t){return new Fs(t.readTime,t.key,-1)}class Fs{constructor(t,e,n){this.readTime=t,this.documentKey=e,this.largestBatchId=n}static min(){return new Fs(Ls.min(),Ms.empty(),-1)}static max(){return new Fs(Ls.max(),Ms.empty(),-1)}}function zs(t,e){let n=t.readTime.compareTo(e.readTime);return 0!==n?n:(n=Ms.comparator(t.documentKey,e.documentKey),0!==n?n:As(t.largestBatchId,e.largestBatchId)
|
|
544
544
|
/**
|
|
545
545
|
* @license
|
|
546
546
|
* Copyright 2020 Google LLC
|
|
@@ -556,7 +556,7 @@ let ss="9.15.0";
|
|
|
556
556
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
557
557
|
* See the License for the specific language governing permissions and
|
|
558
558
|
* limitations under the License.
|
|
559
|
-
*/)}const Bs="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class
|
|
559
|
+
*/)}const Bs="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class Vs{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(t){this.onCommittedListeners.push(t)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((t=>t()))}}
|
|
560
560
|
/**
|
|
561
561
|
* @license
|
|
562
562
|
* Copyright 2017 Google LLC
|
|
@@ -572,7 +572,7 @@ let ss="9.15.0";
|
|
|
572
572
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
573
573
|
* See the License for the specific language governing permissions and
|
|
574
574
|
* limitations under the License.
|
|
575
|
-
*/async function
|
|
575
|
+
*/async function Hs(t){if(t.code!==gs.FAILED_PRECONDITION||t.message!==Bs)throw t;cs("LocalStore","Unexpectedly lost primary lease")}
|
|
576
576
|
/**
|
|
577
577
|
* @license
|
|
578
578
|
* Copyright 2017 Google LLC
|
|
@@ -588,7 +588,7 @@ let ss="9.15.0";
|
|
|
588
588
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
589
589
|
* See the License for the specific language governing permissions and
|
|
590
590
|
* limitations under the License.
|
|
591
|
-
*/class
|
|
591
|
+
*/class js{constructor(t){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t((t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)}),(t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)}))}catch(t){return this.next(void 0,t)}next(t,e){return this.callbackAttached&&ds(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(e,this.error):this.wrapSuccess(t,this.result):new js(((n,r)=>{this.nextCallback=e=>{this.wrapSuccess(t,e).next(n,r)},this.catchCallback=t=>{this.wrapFailure(e,t).next(n,r)}}))}toPromise(){return new Promise(((t,e)=>{this.next(t,e)}))}wrapUserFunction(t){try{const e=t();return e instanceof js?e:js.resolve(e)}catch(t){return js.reject(t)}}wrapSuccess(t,e){return t?this.wrapUserFunction((()=>t(e))):js.resolve(e)}wrapFailure(t,e){return t?this.wrapUserFunction((()=>t(e))):js.reject(e)}static resolve(t){return new js(((e,n)=>{e(t)}))}static reject(t){return new js(((e,n)=>{n(t)}))}static waitFor(t){return new js(((e,n)=>{let r=0,i=0,s=!1;t.forEach((t=>{++r,t.next((()=>{++i,s&&i===r&&e()}),(t=>n(t)))})),s=!0,i===r&&e()}))}static or(t){let e=js.resolve(!1);for(const n of t)e=e.next((t=>t?js.resolve(t):n()));return e}static forEach(t,e){const n=[];return t.forEach(((t,r)=>{n.push(e.call(this,t,r))})),this.waitFor(n)}static mapArray(t,e){return new js(((n,r)=>{const i=t.length,s=new Array(i);let o=0;for(let a=0;a<i;a++){const c=a;e(t[c]).next((t=>{s[c]=t,++o,o===i&&n(s)}),(t=>r(t)))}}))}static doWhile(t,e){return new js(((n,r)=>{const i=()=>{!0===t()?e().next((()=>{i()}),r):n()};i()}))}}function qs(t){return"IndexedDbTransactionError"===t.name}
|
|
592
592
|
/**
|
|
593
593
|
* @license
|
|
594
594
|
* Copyright 2018 Google LLC
|
|
@@ -604,7 +604,7 @@ let ss="9.15.0";
|
|
|
604
604
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
605
605
|
* See the License for the specific language governing permissions and
|
|
606
606
|
* limitations under the License.
|
|
607
|
-
*/class
|
|
607
|
+
*/class $s{constructor(t,e){this.previousValue=t,e&&(e.sequenceNumberHandler=t=>this.ut(t),this.ct=t=>e.writeSequenceNumber(t))}ut(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){const t=++this.previousValue;return this.ct&&this.ct(t),t}}$s.at=-1;
|
|
608
608
|
/**
|
|
609
609
|
* @license
|
|
610
610
|
* Copyright 2017 Google LLC
|
|
@@ -621,7 +621,7 @@ let ss="9.15.0";
|
|
|
621
621
|
* See the License for the specific language governing permissions and
|
|
622
622
|
* limitations under the License.
|
|
623
623
|
*/
|
|
624
|
-
class
|
|
624
|
+
class Ks{constructor(t,e,n,r,i,s,o,a){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=s,this.autoDetectLongPolling=o,this.useFetchStreams=a}}class Gs{constructor(t,e){this.projectId=t,this.database=e||"(default)"}static empty(){return new Gs("","")}get isDefaultDatabase(){return"(default)"===this.database}isEqual(t){return t instanceof Gs&&t.projectId===this.projectId&&t.database===this.database}}
|
|
625
625
|
/**
|
|
626
626
|
* @license
|
|
627
627
|
* Copyright 2017 Google LLC
|
|
@@ -637,7 +637,7 @@ class qs{constructor(e,t,n,r,i,s,o,a){this.databaseId=e,this.appId=t,this.persis
|
|
|
637
637
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
638
638
|
* See the License for the specific language governing permissions and
|
|
639
639
|
* limitations under the License.
|
|
640
|
-
*/function Ws(
|
|
640
|
+
*/function Ws(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Qs(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function Ys(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}
|
|
641
641
|
/**
|
|
642
642
|
* @license
|
|
643
643
|
* Copyright 2017 Google LLC
|
|
@@ -653,7 +653,7 @@ class qs{constructor(e,t,n,r,i,s,o,a){this.databaseId=e,this.appId=t,this.persis
|
|
|
653
653
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
654
654
|
* See the License for the specific language governing permissions and
|
|
655
655
|
* limitations under the License.
|
|
656
|
-
*/function Js(
|
|
656
|
+
*/function Js(t){return null==t}function Xs(t){return 0===t&&1/t==-1/0}
|
|
657
657
|
/**
|
|
658
658
|
* @license
|
|
659
659
|
* Copyright 2020 Google LLC
|
|
@@ -670,7 +670,7 @@ class qs{constructor(e,t,n,r,i,s,o,a){this.databaseId=e,this.appId=t,this.persis
|
|
|
670
670
|
* See the License for the specific language governing permissions and
|
|
671
671
|
* limitations under the License.
|
|
672
672
|
*/
|
|
673
|
-
class Zs{constructor(
|
|
673
|
+
class Zs{constructor(t){this.binaryString=t}static fromBase64String(t){const e=atob(t);return new Zs(e)}static fromUint8Array(t){const e=function(t){let e="";for(let n=0;n<t.length;++n)e+=String.fromCharCode(t[n]);return e}(t);return new Zs(e)}[Symbol.iterator](){let t=0;return{next:()=>t<this.binaryString.length?{value:this.binaryString.charCodeAt(t++),done:!1}:{value:void 0,done:!0}}}toBase64(){return t=this.binaryString,btoa(t);var t}toUint8Array(){return function(t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}
|
|
674
674
|
/**
|
|
675
675
|
* @license
|
|
676
676
|
* Copyright 2020 Google LLC
|
|
@@ -686,7 +686,7 @@ class Zs{constructor(e){this.binaryString=e}static fromBase64String(e){const t=a
|
|
|
686
686
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
687
687
|
* See the License for the specific language governing permissions and
|
|
688
688
|
* limitations under the License.
|
|
689
|
-
*/(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(
|
|
689
|
+
*/(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(t){return As(this.binaryString,t.binaryString)}isEqual(t){return this.binaryString===t.binaryString}}Zs.EMPTY_BYTE_STRING=new Zs("");const to=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function eo(t){if(fs(!!t),"string"==typeof t){let e=0;const n=to.exec(t);if(fs(!!n),n[1]){let t=n[1];t=(t+"000000000").substr(0,9),e=Number(t)}const r=new Date(t);return{seconds:Math.floor(r.getTime()/1e3),nanos:e}}return{seconds:no(t.seconds),nanos:no(t.nanos)}}function no(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function ro(t){return"string"==typeof t?Zs.fromBase64String(t):Zs.fromUint8Array(t)}
|
|
690
690
|
/**
|
|
691
691
|
* @license
|
|
692
692
|
* Copyright 2020 Google LLC
|
|
@@ -702,7 +702,7 @@ class Zs{constructor(e){this.binaryString=e}static fromBase64String(e){const t=a
|
|
|
702
702
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
703
703
|
* See the License for the specific language governing permissions and
|
|
704
704
|
* limitations under the License.
|
|
705
|
-
*/function io(
|
|
705
|
+
*/function io(t){var e,n;return"server_timestamp"===(null===(n=((null===(e=null==t?void 0:t.mapValue)||void 0===e?void 0:e.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function so(t){const e=t.mapValue.fields.__previous_value__;return io(e)?so(e):e}function oo(t){const e=eo(t.mapValue.fields.__local_write_time__.timestampValue);return new Ns(e.seconds,e.nanos)}
|
|
706
706
|
/**
|
|
707
707
|
* @license
|
|
708
708
|
* Copyright 2020 Google LLC
|
|
@@ -718,7 +718,7 @@ class Zs{constructor(e){this.binaryString=e}static fromBase64String(e){const t=a
|
|
|
718
718
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
719
719
|
* See the License for the specific language governing permissions and
|
|
720
720
|
* limitations under the License.
|
|
721
|
-
*/const ao={mapValue:{fields:{__type__:{stringValue:"__max__"}}}};function co(
|
|
721
|
+
*/const ao={mapValue:{fields:{__type__:{stringValue:"__max__"}}}};function co(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?io(t)?4:function(t){return"__max__"===(((t.mapValue||{}).fields||{}).__type__||{}).stringValue}
|
|
722
722
|
/**
|
|
723
723
|
* @license
|
|
724
724
|
* Copyright 2022 Google LLC
|
|
@@ -734,7 +734,7 @@ class Zs{constructor(e){this.binaryString=e}static fromBase64String(e){const t=a
|
|
|
734
734
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
735
735
|
* See the License for the specific language governing permissions and
|
|
736
736
|
* limitations under the License.
|
|
737
|
-
*/(
|
|
737
|
+
*/(t)?9007199254740991:10:ds()}function lo(t,e){if(t===e)return!0;const n=co(t);if(n!==co(e))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return oo(t).isEqual(oo(e));case 3:return function(t,e){if("string"==typeof t.timestampValue&&"string"==typeof e.timestampValue&&t.timestampValue.length===e.timestampValue.length)return t.timestampValue===e.timestampValue;const n=eo(t.timestampValue),r=eo(e.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return ro(t.bytesValue).isEqual(ro(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return no(t.geoPointValue.latitude)===no(e.geoPointValue.latitude)&&no(t.geoPointValue.longitude)===no(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return no(t.integerValue)===no(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){const n=no(t.doubleValue),r=no(e.doubleValue);return n===r?Xs(n)===Xs(r):isNaN(n)&&isNaN(r)}return!1}(t,e);case 9:return Rs(t.arrayValue.values||[],e.arrayValue.values||[],lo);case 10:return function(t,e){const n=t.mapValue.fields||{},r=e.mapValue.fields||{};if(Ws(n)!==Ws(r))return!1;for(const t in n)if(n.hasOwnProperty(t)&&(void 0===r[t]||!lo(n[t],r[t])))return!1;return!0}(t,e);default:return ds()}}function uo(t,e){return void 0!==(t.values||[]).find((t=>lo(t,e)))}function ho(t,e){if(t===e)return 0;const n=co(t),r=co(e);if(n!==r)return As(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return As(t.booleanValue,e.booleanValue);case 2:return function(t,e){const n=no(t.integerValue||t.doubleValue),r=no(e.integerValue||e.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(t,e);case 3:return fo(t.timestampValue,e.timestampValue);case 4:return fo(oo(t),oo(e));case 5:return As(t.stringValue,e.stringValue);case 6:return function(t,e){const n=ro(t),r=ro(e);return n.compareTo(r)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){const n=t.split("/"),r=e.split("/");for(let t=0;t<n.length&&t<r.length;t++){const e=As(n[t],r[t]);if(0!==e)return e}return As(n.length,r.length)}(t.referenceValue,e.referenceValue);case 8:return function(t,e){const n=As(no(t.latitude),no(e.latitude));return 0!==n?n:As(no(t.longitude),no(e.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return function(t,e){const n=t.values||[],r=e.values||[];for(let t=0;t<n.length&&t<r.length;++t){const e=ho(n[t],r[t]);if(e)return e}return As(n.length,r.length)}(t.arrayValue,e.arrayValue);case 10:return function(t,e){if(t===ao.mapValue&&e===ao.mapValue)return 0;if(t===ao.mapValue)return 1;if(e===ao.mapValue)return-1;const n=t.fields||{},r=Object.keys(n),i=e.fields||{},s=Object.keys(i);r.sort(),s.sort();for(let t=0;t<r.length&&t<s.length;++t){const e=As(r[t],s[t]);if(0!==e)return e;const o=ho(n[r[t]],i[s[t]]);if(0!==o)return o}return As(r.length,s.length)}(t.mapValue,e.mapValue);default:throw ds()}}function fo(t,e){if("string"==typeof t&&"string"==typeof e&&t.length===e.length)return As(t,e);const n=eo(t),r=eo(e),i=As(n.seconds,r.seconds);return 0!==i?i:As(n.nanos,r.nanos)}function po(t){return go(t)}function go(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(t){const e=eo(t);return`time(${e.seconds},${e.nanos})`}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?ro(t.bytesValue).toBase64():"referenceValue"in t?(n=t.referenceValue,Ms.fromName(n).toString()):"geoPointValue"in t?`geo(${(e=t.geoPointValue).latitude},${e.longitude})`:"arrayValue"in t?function(t){let e="[",n=!0;for(const r of t.values||[])n?n=!1:e+=",",e+=go(r);return e+"]"}(t.arrayValue):"mapValue"in t?function(t){const e=Object.keys(t.fields||{}).sort();let n="{",r=!0;for(const i of e)r?r=!1:n+=",",n+=`${i}:${go(t.fields[i])}`;return n+"}"}(t.mapValue):ds();var e,n}function mo(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function yo(t){return!!t&&"integerValue"in t}function vo(t){return!!t&&"arrayValue"in t}function wo(t){return!!t&&"nullValue"in t}function bo(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function _o(t){return!!t&&"mapValue"in t}function So(t){if(t.geoPointValue)return{geoPointValue:Object.assign({},t.geoPointValue)};if(t.timestampValue&&"object"==typeof t.timestampValue)return{timestampValue:Object.assign({},t.timestampValue)};if(t.mapValue){const e={mapValue:{fields:{}}};return Qs(t.mapValue.fields,((t,n)=>e.mapValue.fields[t]=So(n))),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=So(t.arrayValue.values[n]);return e}return Object.assign({},t)}class Eo{constructor(t,e){this.position=t,this.inclusive=e}}function Io(t,e,n){let r=0;for(let i=0;i<t.position.length;i++){const s=e[i],o=t.position[i];if(r=s.field.isKeyField()?Ms.comparator(Ms.fromName(o.referenceValue),n.key):ho(o,n.data.field(s.field)),"desc"===s.dir&&(r*=-1),0!==r)break}return r}function To(t,e){if(null===t)return null===e;if(null===e)return!1;if(t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let n=0;n<t.position.length;n++)if(!lo(t.position[n],e.position[n]))return!1;return!0}
|
|
738
738
|
/**
|
|
739
739
|
* @license
|
|
740
740
|
* Copyright 2022 Google LLC
|
|
@@ -750,7 +750,7 @@ class Zs{constructor(e){this.binaryString=e}static fromBase64String(e){const t=a
|
|
|
750
750
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
751
751
|
* See the License for the specific language governing permissions and
|
|
752
752
|
* limitations under the License.
|
|
753
|
-
*/class
|
|
753
|
+
*/class ko{}class Co extends ko{constructor(t,e,n){super(),this.field=t,this.op=e,this.value=n}static create(t,e,n){return t.isKeyField()?"in"===e||"not-in"===e?this.createKeyFieldInFilter(t,e,n):new xo(t,e,n):"array-contains"===e?new Fo(t,n):"in"===e?new zo(t,n):"not-in"===e?new Bo(t,n):"array-contains-any"===e?new Vo(t,n):new Co(t,e,n)}static createKeyFieldInFilter(t,e,n){return"in"===e?new Po(t,n):new Mo(t,n)}matches(t){const e=t.data.field(this.field);return"!="===this.op?null!==e&&this.matchesComparison(ho(e,this.value)):null!==e&&co(this.value)===co(e)&&this.matchesComparison(ho(e,this.value))}matchesComparison(t){switch(this.op){case"<":return t<0;case"<=":return t<=0;case"==":return 0===t;case"!=":return 0!==t;case">":return t>0;case">=":return t>=0;default:return ds()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}getFirstInequalityField(){return this.isInequality()?this.field:null}}class Ao extends ko{constructor(t,e){super(),this.filters=t,this.op=e,this.ht=null}static create(t,e){return new Ao(t,e)}matches(t){return Ro(this)?void 0===this.filters.find((e=>!e.matches(t))):void 0!==this.filters.find((e=>e.matches(t)))}getFlattenedFilters(){return null!==this.ht||(this.ht=this.filters.reduce(((t,e)=>t.concat(e.getFlattenedFilters())),[])),this.ht}getFilters(){return Object.assign([],this.filters)}getFirstInequalityField(){const t=this.lt((t=>t.isInequality()));return null!==t?t.field:null}lt(t){for(const e of this.getFlattenedFilters())if(t(e))return e;return null}}function Ro(t){return"and"===t.op}function No(t){return function(t){for(const e of t.filters)if(e instanceof Ao)return!1;return!0}(t)&&Ro(t)}function Lo(t){if(t instanceof Co)return t.field.canonicalString()+t.op.toString()+po(t.value);{const e=t.filters.map((t=>Lo(t))).join(",");return`${t.op}(${e})`}}function Oo(t,e){return t instanceof Co?function(t,e){return e instanceof Co&&t.op===e.op&&t.field.isEqual(e.field)&&lo(t.value,e.value)}(t,e):t instanceof Ao?function(t,e){return e instanceof Ao&&t.op===e.op&&t.filters.length===e.filters.length&&t.filters.reduce(((t,n,r)=>t&&Oo(n,e.filters[r])),!0)}(t,e):void ds()}function Do(t){return t instanceof Co?function(t){return`${t.field.canonicalString()} ${t.op} ${po(t.value)}`}(t):t instanceof Ao?function(t){return t.op.toString()+" {"+t.getFilters().map(Do).join(" ,")+"}"}(t):"Filter"}class xo extends Co{constructor(t,e,n){super(t,e,n),this.key=Ms.fromName(n.referenceValue)}matches(t){const e=Ms.comparator(t.key,this.key);return this.matchesComparison(e)}}class Po extends Co{constructor(t,e){super(t,"in",e),this.keys=Uo("in",e)}matches(t){return this.keys.some((e=>e.isEqual(t.key)))}}class Mo extends Co{constructor(t,e){super(t,"not-in",e),this.keys=Uo("not-in",e)}matches(t){return!this.keys.some((e=>e.isEqual(t.key)))}}function Uo(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map((t=>Ms.fromName(t.referenceValue)))}class Fo extends Co{constructor(t,e){super(t,"array-contains",e)}matches(t){const e=t.data.field(this.field);return vo(e)&&uo(e.arrayValue,this.value)}}class zo extends Co{constructor(t,e){super(t,"in",e)}matches(t){const e=t.data.field(this.field);return null!==e&&uo(this.value.arrayValue,e)}}class Bo extends Co{constructor(t,e){super(t,"not-in",e)}matches(t){if(uo(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const e=t.data.field(this.field);return null!==e&&!uo(this.value.arrayValue,e)}}class Vo extends Co{constructor(t,e){super(t,"array-contains-any",e)}matches(t){const e=t.data.field(this.field);return!(!vo(e)||!e.arrayValue.values)&&e.arrayValue.values.some((t=>uo(this.value.arrayValue,t)))}}
|
|
754
754
|
/**
|
|
755
755
|
* @license
|
|
756
756
|
* Copyright 2022 Google LLC
|
|
@@ -766,7 +766,7 @@ class Zs{constructor(e){this.binaryString=e}static fromBase64String(e){const t=a
|
|
|
766
766
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
767
767
|
* See the License for the specific language governing permissions and
|
|
768
768
|
* limitations under the License.
|
|
769
|
-
*/class
|
|
769
|
+
*/class Ho{constructor(t,e="asc"){this.field=t,this.dir=e}}function jo(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}
|
|
770
770
|
/**
|
|
771
771
|
* @license
|
|
772
772
|
* Copyright 2017 Google LLC
|
|
@@ -782,7 +782,7 @@ class Zs{constructor(e){this.binaryString=e}static fromBase64String(e){const t=a
|
|
|
782
782
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
783
783
|
* See the License for the specific language governing permissions and
|
|
784
784
|
* limitations under the License.
|
|
785
|
-
*/class
|
|
785
|
+
*/class qo{constructor(t,e){this.comparator=t,this.root=e||Ko.EMPTY}insert(t,e){return new qo(this.comparator,this.root.insert(t,e,this.comparator).copy(null,null,Ko.BLACK,null,null))}remove(t){return new qo(this.comparator,this.root.remove(t,this.comparator).copy(null,null,Ko.BLACK,null,null))}get(t){let e=this.root;for(;!e.isEmpty();){const n=this.comparator(t,e.key);if(0===n)return e.value;n<0?e=e.left:n>0&&(e=e.right)}return null}indexOf(t){let e=0,n=this.root;for(;!n.isEmpty();){const r=this.comparator(t,n.key);if(0===r)return e+n.left.size;r<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(t){return this.root.inorderTraversal(t)}forEach(t){this.inorderTraversal(((e,n)=>(t(e,n),!1)))}toString(){const t=[];return this.inorderTraversal(((e,n)=>(t.push(`${e}:${n}`),!1))),`{${t.join(", ")}}`}reverseTraversal(t){return this.root.reverseTraversal(t)}getIterator(){return new $o(this.root,null,this.comparator,!1)}getIteratorFrom(t){return new $o(this.root,t,this.comparator,!1)}getReverseIterator(){return new $o(this.root,null,this.comparator,!0)}getReverseIteratorFrom(t){return new $o(this.root,t,this.comparator,!0)}}class $o{constructor(t,e,n,r){this.isReverse=r,this.nodeStack=[];let i=1;for(;!t.isEmpty();)if(i=e?n(t.key,e):1,e&&r&&(i*=-1),i<0)t=this.isReverse?t.left:t.right;else{if(0===i){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}getNext(){let t=this.nodeStack.pop();const e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}}}class Ko{constructor(t,e,n,r,i){this.key=t,this.value=e,this.color=null!=n?n:Ko.RED,this.left=null!=r?r:Ko.EMPTY,this.right=null!=i?i:Ko.EMPTY,this.size=this.left.size+1+this.right.size}copy(t,e,n,r,i){return new Ko(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=r?r:this.left,null!=i?i:this.right)}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(t,e,n){let r=this;const i=n(t,r.key);return r=i<0?r.copy(null,null,null,r.left.insert(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(t,e,n)),r.fixUp()}removeMin(){if(this.left.isEmpty())return Ko.EMPTY;let t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()}remove(t,e){let n,r=this;if(e(t,r.key)<0)r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(t,e),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),0===e(t,r.key)){if(r.right.isEmpty())return Ko.EMPTY;n=r.right.min(),r=r.copy(n.key,n.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(t,e))}return r.fixUp()}isRed(){return this.color}fixUp(){let t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t}moveRedLeft(){let t=this.colorFlip();return t.right.left.isRed()&&(t=t.copy(null,null,null,null,t.right.rotateRight()),t=t.rotateLeft(),t=t.colorFlip()),t}moveRedRight(){let t=this.colorFlip();return t.left.left.isRed()&&(t=t.rotateRight(),t=t.colorFlip()),t}rotateLeft(){const t=this.copy(null,null,Ko.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight(){const t=this.copy(null,null,Ko.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip(){const t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)}checkMaxDepth(){const t=this.check();return Math.pow(2,t)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw ds();if(this.right.isRed())throw ds();const t=this.left.check();if(t!==this.right.check())throw ds();return t+(this.isRed()?0:1)}}Ko.EMPTY=null,Ko.RED=!0,Ko.BLACK=!1,Ko.EMPTY=new class{constructor(){this.size=0}get key(){throw ds()}get value(){throw ds()}get color(){throw ds()}get left(){throw ds()}get right(){throw ds()}copy(t,e,n,r,i){return this}insert(t,e,n){return new Ko(t,e)}remove(t,e){return this}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};
|
|
786
786
|
/**
|
|
787
787
|
* @license
|
|
788
788
|
* Copyright 2017 Google LLC
|
|
@@ -799,7 +799,7 @@ class Zs{constructor(e){this.binaryString=e}static fromBase64String(e){const t=a
|
|
|
799
799
|
* See the License for the specific language governing permissions and
|
|
800
800
|
* limitations under the License.
|
|
801
801
|
*/
|
|
802
|
-
class
|
|
802
|
+
class Go{constructor(t){this.comparator=t,this.data=new qo(this.comparator)}has(t){return null!==this.data.get(t)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(t){return this.data.indexOf(t)}forEach(t){this.data.inorderTraversal(((e,n)=>(t(e),!1)))}forEachInRange(t,e){const n=this.data.getIteratorFrom(t[0]);for(;n.hasNext();){const r=n.getNext();if(this.comparator(r.key,t[1])>=0)return;e(r.key)}}forEachWhile(t,e){let n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return}firstAfterOrEqual(t){const e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null}getIterator(){return new Wo(this.data.getIterator())}getIteratorFrom(t){return new Wo(this.data.getIteratorFrom(t))}add(t){return this.copy(this.data.remove(t).insert(t,!0))}delete(t){return this.has(t)?this.copy(this.data.remove(t)):this}isEmpty(){return this.data.isEmpty()}unionWith(t){let e=this;return e.size<t.size&&(e=t,t=this),t.forEach((t=>{e=e.add(t)})),e}isEqual(t){if(!(t instanceof Go))return!1;if(this.size!==t.size)return!1;const e=this.data.getIterator(),n=t.data.getIterator();for(;e.hasNext();){const t=e.getNext().key,r=n.getNext().key;if(0!==this.comparator(t,r))return!1}return!0}toArray(){const t=[];return this.forEach((e=>{t.push(e)})),t}toString(){const t=[];return this.forEach((e=>t.push(e))),"SortedSet("+t.toString()+")"}copy(t){const e=new Go(this.comparator);return e.data=t,e}}class Wo{constructor(t){this.iter=t}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}
|
|
803
803
|
/**
|
|
804
804
|
* @license
|
|
805
805
|
* Copyright 2020 Google LLC
|
|
@@ -815,7 +815,7 @@ class Ko{constructor(e){this.comparator=e,this.data=new Go(this.comparator)}has(
|
|
|
815
815
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
816
816
|
* See the License for the specific language governing permissions and
|
|
817
817
|
* limitations under the License.
|
|
818
|
-
*/class Qo{constructor(
|
|
818
|
+
*/class Qo{constructor(t){this.fields=t,t.sort(Ps.comparator)}static empty(){return new Qo([])}unionWith(t){let e=new Go(Ps.comparator);for(const t of this.fields)e=e.add(t);for(const n of t)e=e.add(n);return new Qo(e.toArray())}covers(t){for(const e of this.fields)if(e.isPrefixOf(t))return!0;return!1}isEqual(t){return Rs(this.fields,t.fields,((t,e)=>t.isEqual(e)))}}
|
|
819
819
|
/**
|
|
820
820
|
* @license
|
|
821
821
|
* Copyright 2017 Google LLC
|
|
@@ -831,7 +831,7 @@ class Ko{constructor(e){this.comparator=e,this.data=new Go(this.comparator)}has(
|
|
|
831
831
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
832
832
|
* See the License for the specific language governing permissions and
|
|
833
833
|
* limitations under the License.
|
|
834
|
-
*/class Yo{constructor(
|
|
834
|
+
*/class Yo{constructor(t){this.value=t}static empty(){return new Yo({mapValue:{}})}field(t){if(t.isEmpty())return this.value;{let e=this.value;for(let n=0;n<t.length-1;++n)if(e=(e.mapValue.fields||{})[t.get(n)],!_o(e))return null;return e=(e.mapValue.fields||{})[t.lastSegment()],e||null}}set(t,e){this.getFieldsMap(t.popLast())[t.lastSegment()]=So(e)}setAll(t){let e=Ps.emptyPath(),n={},r=[];t.forEach(((t,i)=>{if(!e.isImmediateParentOf(i)){const t=this.getFieldsMap(e);this.applyChanges(t,n,r),n={},r=[],e=i.popLast()}t?n[i.lastSegment()]=So(t):r.push(i.lastSegment())}));const i=this.getFieldsMap(e);this.applyChanges(i,n,r)}delete(t){const e=this.field(t.popLast());_o(e)&&e.mapValue.fields&&delete e.mapValue.fields[t.lastSegment()]}isEqual(t){return lo(this.value,t.value)}getFieldsMap(t){let e=this.value;e.mapValue.fields||(e.mapValue={fields:{}});for(let n=0;n<t.length;++n){let r=e.mapValue.fields[t.get(n)];_o(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},e.mapValue.fields[t.get(n)]=r),e=r}return e.mapValue.fields}applyChanges(t,e,n){Qs(e,((e,n)=>t[e]=n));for(const e of n)delete t[e]}clone(){return new Yo(So(this.value))}}
|
|
835
835
|
/**
|
|
836
836
|
* @license
|
|
837
837
|
* Copyright 2017 Google LLC
|
|
@@ -847,7 +847,7 @@ class Ko{constructor(e){this.comparator=e,this.data=new Go(this.comparator)}has(
|
|
|
847
847
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
848
848
|
* See the License for the specific language governing permissions and
|
|
849
849
|
* limitations under the License.
|
|
850
|
-
*/class Jo{constructor(e,
|
|
850
|
+
*/class Jo{constructor(t,e,n,r,i,s,o){this.key=t,this.documentType=e,this.version=n,this.readTime=r,this.createTime=i,this.data=s,this.documentState=o}static newInvalidDocument(t){return new Jo(t,0,Ls.min(),Ls.min(),Ls.min(),Yo.empty(),0)}static newFoundDocument(t,e,n,r){return new Jo(t,1,e,Ls.min(),n,r,0)}static newNoDocument(t,e){return new Jo(t,2,e,Ls.min(),Ls.min(),Yo.empty(),0)}static newUnknownDocument(t,e){return new Jo(t,3,e,Ls.min(),Ls.min(),Yo.empty(),2)}convertToFoundDocument(t,e){return!this.createTime.isEqual(Ls.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=t),this.version=t,this.documentType=1,this.data=e,this.documentState=0,this}convertToNoDocument(t){return this.version=t,this.documentType=2,this.data=Yo.empty(),this.documentState=0,this}convertToUnknownDocument(t){return this.version=t,this.documentType=3,this.data=Yo.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Ls.min(),this}setReadTime(t){return this.readTime=t,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(t){return t instanceof Jo&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.documentType===t.documentType&&this.documentState===t.documentState&&this.data.isEqual(t.data)}mutableCopy(){return new Jo(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}
|
|
851
851
|
/**
|
|
852
852
|
* @license
|
|
853
853
|
* Copyright 2019 Google LLC
|
|
@@ -863,7 +863,7 @@ class Ko{constructor(e){this.comparator=e,this.data=new Go(this.comparator)}has(
|
|
|
863
863
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
864
864
|
* See the License for the specific language governing permissions and
|
|
865
865
|
* limitations under the License.
|
|
866
|
-
*/class Xo{constructor(e
|
|
866
|
+
*/class Xo{constructor(t,e=null,n=[],r=[],i=null,s=null,o=null){this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=s,this.endAt=o,this.ft=null}}function Zo(t,e=null,n=[],r=[],i=null,s=null,o=null){return new Xo(t,e,n,r,i,s,o)}function ta(t){const e=ps(t);if(null===e.ft){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map((t=>Lo(t))).join(","),t+="|ob:",t+=e.orderBy.map((t=>function(t){return t.field.canonicalString()+t.dir}(t))).join(","),Js(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map((t=>po(t))).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map((t=>po(t))).join(",")),e.ft=t}return e.ft}function ea(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n<t.orderBy.length;n++)if(!jo(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let n=0;n<t.filters.length;n++)if(!Oo(t.filters[n],e.filters[n]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!To(t.startAt,e.startAt)&&To(t.endAt,e.endAt)}function na(t){return Ms.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}
|
|
867
867
|
/**
|
|
868
868
|
* @license
|
|
869
869
|
* Copyright 2017 Google LLC
|
|
@@ -879,7 +879,7 @@ class Ko{constructor(e){this.comparator=e,this.data=new Go(this.comparator)}has(
|
|
|
879
879
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
880
880
|
* See the License for the specific language governing permissions and
|
|
881
881
|
* limitations under the License.
|
|
882
|
-
*/class ra{constructor(e
|
|
882
|
+
*/class ra{constructor(t,e=null,n=[],r=[],i=null,s="F",o=null,a=null){this.path=t,this.collectionGroup=e,this.explicitOrderBy=n,this.filters=r,this.limit=i,this.limitType=s,this.startAt=o,this.endAt=a,this.dt=null,this._t=null,this.startAt,this.endAt}}function ia(t){return new ra(t)}function sa(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())}function oa(t){return t.explicitOrderBy.length>0?t.explicitOrderBy[0].field:null}function aa(t){for(const e of t.filters){const t=e.getFirstInequalityField();if(null!==t)return t}return null}function ca(t){return null!==t.collectionGroup}function la(t){const e=ps(t);if(null===e.dt){e.dt=[];const t=aa(e),n=oa(e);if(null!==t&&null===n)t.isKeyField()||e.dt.push(new Ho(t)),e.dt.push(new Ho(Ps.keyField(),"asc"));else{let t=!1;for(const n of e.explicitOrderBy)e.dt.push(n),n.field.isKeyField()&&(t=!0);if(!t){const t=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.dt.push(new Ho(Ps.keyField(),t))}}}return e.dt}function ua(t){const e=ps(t);if(!e._t)if("F"===e.limitType)e._t=Zo(e.path,e.collectionGroup,la(e),e.filters,e.limit,e.startAt,e.endAt);else{const t=[];for(const n of la(e)){const e="desc"===n.dir?"asc":"desc";t.push(new Ho(n.field,e))}const n=e.endAt?new Eo(e.endAt.position,e.endAt.inclusive):null,r=e.startAt?new Eo(e.startAt.position,e.startAt.inclusive):null;e._t=Zo(e.path,e.collectionGroup,t,e.filters,e.limit,n,r)}return e._t}function ha(t,e){e.getFirstInequalityField(),aa(t);const n=t.filters.concat([e]);return new ra(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}function da(t,e,n){return new ra(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function fa(t,e){return ea(ua(t),ua(e))&&t.limitType===e.limitType}function pa(t){return`${ta(ua(t))}|lt:${t.limitType}`}function ga(t){return`Query(target=${function(t){let e=t.path.canonicalString();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=`, filters: [${t.filters.map((t=>Do(t))).join(", ")}]`),Js(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=`, orderBy: [${t.orderBy.map((t=>function(t){return`${t.field.canonicalString()} (${t.dir})`}(t))).join(", ")}]`),t.startAt&&(e+=", startAt: ",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map((t=>po(t))).join(",")),t.endAt&&(e+=", endAt: ",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map((t=>po(t))).join(",")),`Target(${e})`}(ua(t))}; limitType=${t.limitType})`}function ma(t,e){return e.isFoundDocument()&&function(t,e){const n=e.key.path;return null!==t.collectionGroup?e.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(n):Ms.isDocumentKey(t.path)?t.path.isEqual(n):t.path.isImmediateParentOf(n)}(t,e)&&function(t,e){for(const n of la(t))if(!n.field.isKeyField()&&null===e.data.field(n.field))return!1;return!0}(t,e)&&function(t,e){for(const n of t.filters)if(!n.matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!function(t,e,n){const r=Io(t,e,n);return t.inclusive?r<=0:r<0}(t.startAt,la(t),e))&&!(t.endAt&&!function(t,e,n){const r=Io(t,e,n);return t.inclusive?r>=0:r>0}(t.endAt,la(t),e))}(t,e)}function ya(t){return(e,n)=>{let r=!1;for(const i of la(t)){const t=va(i,e,n);if(0!==t)return t;r=r||i.field.isKeyField()}return 0}}function va(t,e,n){const r=t.field.isKeyField()?Ms.comparator(e.key,n.key):function(t,e,n){const r=e.data.field(t),i=n.data.field(t);return null!==r&&null!==i?ho(r,i):ds()}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return ds()}}
|
|
883
883
|
/**
|
|
884
884
|
* @license
|
|
885
885
|
* Copyright 2020 Google LLC
|
|
@@ -895,7 +895,7 @@ class Ko{constructor(e){this.comparator=e,this.data=new Go(this.comparator)}has(
|
|
|
895
895
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
896
896
|
* See the License for the specific language governing permissions and
|
|
897
897
|
* limitations under the License.
|
|
898
|
-
*/function
|
|
898
|
+
*/function wa(t,e){if(t.wt){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Xs(e)?"-0":e}}function ba(t){return{integerValue:""+t}}function _a(t,e){return function(t){return"number"==typeof t&&Number.isInteger(t)&&!Xs(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}(e)?ba(e):wa(t,e)}
|
|
899
899
|
/**
|
|
900
900
|
* @license
|
|
901
901
|
* Copyright 2018 Google LLC
|
|
@@ -911,7 +911,7 @@ class Ko{constructor(e){this.comparator=e,this.data=new Go(this.comparator)}has(
|
|
|
911
911
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
912
912
|
* See the License for the specific language governing permissions and
|
|
913
913
|
* limitations under the License.
|
|
914
|
-
*/class
|
|
914
|
+
*/class Sa{constructor(){this._=void 0}}function Ea(t,e,n){return t instanceof Ta?function(t,e){const n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&(n.fields.__previous_value__=e),{mapValue:n}}(n,e):t instanceof ka?Ca(t,e):t instanceof Aa?Ra(t,e):function(t,e){const n=function(t,e){return t instanceof Na?yo(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null;var n}(t,e),r=La(n)+La(t.gt);return yo(n)&&yo(t.gt)?ba(r):wa(t.yt,r)}(t,e)}function Ia(t,e,n){return t instanceof ka?Ca(t,e):t instanceof Aa?Ra(t,e):n}class Ta extends Sa{}class ka extends Sa{constructor(t){super(),this.elements=t}}function Ca(t,e){const n=Oa(e);for(const e of t.elements)n.some((t=>lo(t,e)))||n.push(e);return{arrayValue:{values:n}}}class Aa extends Sa{constructor(t){super(),this.elements=t}}function Ra(t,e){let n=Oa(e);for(const e of t.elements)n=n.filter((t=>!lo(t,e)));return{arrayValue:{values:n}}}class Na extends Sa{constructor(t,e){super(),this.yt=t,this.gt=e}}function La(t){return no(t.integerValue||t.doubleValue)}function Oa(t){return vo(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}class Da{constructor(t,e){this.updateTime=t,this.exists=e}static none(){return new Da}static exists(t){return new Da(void 0,t)}static updateTime(t){return new Da(t)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)}}function xa(t,e){return void 0!==t.updateTime?e.isFoundDocument()&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e.isFoundDocument()}class Pa{}function Ma(t,e){if(!t.hasLocalMutations||e&&0===e.fields.length)return null;if(null===e)return t.isNoDocument()?new $a(t.key,Da.none()):new Ba(t.key,t.data,Da.none());{const n=t.data,r=Yo.empty();let i=new Go(Ps.comparator);for(let t of e.fields)if(!i.has(t)){let e=n.field(t);null===e&&t.length>1&&(t=t.popLast(),e=n.field(t)),null===e?r.delete(t):r.set(t,e),i=i.add(t)}return new Va(t.key,r,new Qo(i.toArray()),Da.none())}}function Ua(t,e,n){t instanceof Ba?function(t,e,n){const r=t.value.clone(),i=ja(t.fieldTransforms,e,n.transformResults);r.setAll(i),e.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(t,e,n):t instanceof Va?function(t,e,n){if(!xa(t.precondition,e))return void e.convertToUnknownDocument(n.version);const r=ja(t.fieldTransforms,e,n.transformResults),i=e.data;i.setAll(Ha(t)),i.setAll(r),e.convertToFoundDocument(n.version,i).setHasCommittedMutations()}(t,e,n):function(t,e,n){e.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,n)}function Fa(t,e,n,r){return t instanceof Ba?function(t,e,n,r){if(!xa(t.precondition,e))return n;const i=t.value.clone(),s=qa(t.fieldTransforms,r,e);return i.setAll(s),e.convertToFoundDocument(e.version,i).setHasLocalMutations(),null}(t,e,n,r):t instanceof Va?function(t,e,n,r){if(!xa(t.precondition,e))return n;const i=qa(t.fieldTransforms,r,e),s=e.data;return s.setAll(Ha(t)),s.setAll(i),e.convertToFoundDocument(e.version,s).setHasLocalMutations(),null===n?null:n.unionWith(t.fieldMask.fields).unionWith(t.fieldTransforms.map((t=>t.field)))}(t,e,n,r):function(t,e,n){return xa(t.precondition,e)?(e.convertToNoDocument(e.version).setHasLocalMutations(),null):n}(t,e,n)}function za(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&Rs(t,e,((t,e)=>function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof ka&&e instanceof ka||t instanceof Aa&&e instanceof Aa?Rs(t.elements,e.elements,lo):t instanceof Na&&e instanceof Na?lo(t.gt,e.gt):t instanceof Ta&&e instanceof Ta}(t.transform,e.transform)}(t,e)))}(t.fieldTransforms,e.fieldTransforms)&&(0===t.type?t.value.isEqual(e.value):1!==t.type||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class Ba extends Pa{constructor(t,e,n,r=[]){super(),this.key=t,this.value=e,this.precondition=n,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class Va extends Pa{constructor(t,e,n,r,i=[]){super(),this.key=t,this.data=e,this.fieldMask=n,this.precondition=r,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function Ha(t){const e=new Map;return t.fieldMask.fields.forEach((n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}})),e}function ja(t,e,n){const r=new Map;fs(t.length===n.length);for(let i=0;i<n.length;i++){const s=t[i],o=s.transform,a=e.data.field(s.field);r.set(s.field,Ia(o,a,n[i]))}return r}function qa(t,e,n){const r=new Map;for(const i of t){const t=i.transform,s=n.data.field(i.field);r.set(i.field,Ea(t,s,e))}return r}class $a extends Pa{constructor(t,e){super(),this.key=t,this.precondition=e,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}
|
|
915
915
|
/**
|
|
916
916
|
* @license
|
|
917
917
|
* Copyright 2017 Google LLC
|
|
@@ -927,7 +927,7 @@ class Ko{constructor(e){this.comparator=e,this.data=new Go(this.comparator)}has(
|
|
|
927
927
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
928
928
|
* See the License for the specific language governing permissions and
|
|
929
929
|
* limitations under the License.
|
|
930
|
-
*/class
|
|
930
|
+
*/class Ka{constructor(t){this.count=t}}
|
|
931
931
|
/**
|
|
932
932
|
* @license
|
|
933
933
|
* Copyright 2017 Google LLC
|
|
@@ -943,7 +943,7 @@ class Ko{constructor(e){this.comparator=e,this.data=new Go(this.comparator)}has(
|
|
|
943
943
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
944
944
|
* See the License for the specific language governing permissions and
|
|
945
945
|
* limitations under the License.
|
|
946
|
-
*/var
|
|
946
|
+
*/var Ga,Wa;function Qa(t){if(void 0===t)return ls("GRPC error has no .code"),gs.UNKNOWN;switch(t){case Ga.OK:return gs.OK;case Ga.CANCELLED:return gs.CANCELLED;case Ga.UNKNOWN:return gs.UNKNOWN;case Ga.DEADLINE_EXCEEDED:return gs.DEADLINE_EXCEEDED;case Ga.RESOURCE_EXHAUSTED:return gs.RESOURCE_EXHAUSTED;case Ga.INTERNAL:return gs.INTERNAL;case Ga.UNAVAILABLE:return gs.UNAVAILABLE;case Ga.UNAUTHENTICATED:return gs.UNAUTHENTICATED;case Ga.INVALID_ARGUMENT:return gs.INVALID_ARGUMENT;case Ga.NOT_FOUND:return gs.NOT_FOUND;case Ga.ALREADY_EXISTS:return gs.ALREADY_EXISTS;case Ga.PERMISSION_DENIED:return gs.PERMISSION_DENIED;case Ga.FAILED_PRECONDITION:return gs.FAILED_PRECONDITION;case Ga.ABORTED:return gs.ABORTED;case Ga.OUT_OF_RANGE:return gs.OUT_OF_RANGE;case Ga.UNIMPLEMENTED:return gs.UNIMPLEMENTED;case Ga.DATA_LOSS:return gs.DATA_LOSS;default:return ds()}}(Wa=Ga||(Ga={}))[Wa.OK=0]="OK",Wa[Wa.CANCELLED=1]="CANCELLED",Wa[Wa.UNKNOWN=2]="UNKNOWN",Wa[Wa.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Wa[Wa.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Wa[Wa.NOT_FOUND=5]="NOT_FOUND",Wa[Wa.ALREADY_EXISTS=6]="ALREADY_EXISTS",Wa[Wa.PERMISSION_DENIED=7]="PERMISSION_DENIED",Wa[Wa.UNAUTHENTICATED=16]="UNAUTHENTICATED",Wa[Wa.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Wa[Wa.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Wa[Wa.ABORTED=10]="ABORTED",Wa[Wa.OUT_OF_RANGE=11]="OUT_OF_RANGE",Wa[Wa.UNIMPLEMENTED=12]="UNIMPLEMENTED",Wa[Wa.INTERNAL=13]="INTERNAL",Wa[Wa.UNAVAILABLE=14]="UNAVAILABLE",Wa[Wa.DATA_LOSS=15]="DATA_LOSS";
|
|
947
947
|
/**
|
|
948
948
|
* @license
|
|
949
949
|
* Copyright 2017 Google LLC
|
|
@@ -960,7 +960,7 @@ class Ko{constructor(e){this.comparator=e,this.data=new Go(this.comparator)}has(
|
|
|
960
960
|
* See the License for the specific language governing permissions and
|
|
961
961
|
* limitations under the License.
|
|
962
962
|
*/
|
|
963
|
-
class Ya{constructor(e
|
|
963
|
+
class Ya{constructor(t,e){this.mapKeyFn=t,this.equalsFn=e,this.inner={},this.innerSize=0}get(t){const e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(const[e,r]of n)if(this.equalsFn(e,t))return r}has(t){return void 0!==this.get(t)}set(t,e){const n=this.mapKeyFn(t),r=this.inner[n];if(void 0===r)return this.inner[n]=[[t,e]],void this.innerSize++;for(let n=0;n<r.length;n++)if(this.equalsFn(r[n][0],t))return void(r[n]=[t,e]);r.push([t,e]),this.innerSize++}delete(t){const e=this.mapKeyFn(t),n=this.inner[e];if(void 0===n)return!1;for(let r=0;r<n.length;r++)if(this.equalsFn(n[r][0],t))return 1===n.length?delete this.inner[e]:n.splice(r,1),this.innerSize--,!0;return!1}forEach(t){Qs(this.inner,((e,n)=>{for(const[e,r]of n)t(e,r)}))}isEmpty(){return Ys(this.inner)}size(){return this.innerSize}}
|
|
964
964
|
/**
|
|
965
965
|
* @license
|
|
966
966
|
* Copyright 2017 Google LLC
|
|
@@ -976,7 +976,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
976
976
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
977
977
|
* See the License for the specific language governing permissions and
|
|
978
978
|
* limitations under the License.
|
|
979
|
-
*/const Ja=new
|
|
979
|
+
*/const Ja=new qo(Ms.comparator);function Xa(){return Ja}const Za=new qo(Ms.comparator);function tc(...t){let e=Za;for(const n of t)e=e.insert(n.key,n);return e}function ec(t){let e=Za;return t.forEach(((t,n)=>e=e.insert(t,n.overlayedDocument))),e}function nc(){return ic()}function rc(){return ic()}function ic(){return new Ya((t=>t.toString()),((t,e)=>t.isEqual(e)))}new qo(Ms.comparator);const sc=new Go(Ms.comparator);function oc(...t){let e=sc;for(const n of t)e=e.add(n);return e}const ac=new Go(As);function cc(){return ac}
|
|
980
980
|
/**
|
|
981
981
|
* @license
|
|
982
982
|
* Copyright 2017 Google LLC
|
|
@@ -992,7 +992,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
992
992
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
993
993
|
* See the License for the specific language governing permissions and
|
|
994
994
|
* limitations under the License.
|
|
995
|
-
*/class
|
|
995
|
+
*/class lc{constructor(t,e,n,r,i){this.snapshotVersion=t,this.targetChanges=e,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}static createSynthesizedRemoteEventForCurrentChange(t,e,n){const r=new Map;return r.set(t,uc.createSynthesizedTargetChangeForCurrentChange(t,e,n)),new lc(Ls.min(),r,cc(),Xa(),oc())}}class uc{constructor(t,e,n,r,i){this.resumeToken=t,this.current=e,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}static createSynthesizedTargetChangeForCurrentChange(t,e,n){return new uc(n,e,oc(),oc(),oc())}}
|
|
996
996
|
/**
|
|
997
997
|
* @license
|
|
998
998
|
* Copyright 2017 Google LLC
|
|
@@ -1008,7 +1008,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1008
1008
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1009
1009
|
* See the License for the specific language governing permissions and
|
|
1010
1010
|
* limitations under the License.
|
|
1011
|
-
*/class
|
|
1011
|
+
*/class hc{constructor(t,e,n,r){this.It=t,this.removedTargetIds=e,this.key=n,this.Tt=r}}class dc{constructor(t,e){this.targetId=t,this.Et=e}}class fc{constructor(t,e,n=Zs.EMPTY_BYTE_STRING,r=null){this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r}}class pc{constructor(){this.At=0,this.Rt=yc(),this.bt=Zs.EMPTY_BYTE_STRING,this.Pt=!1,this.vt=!0}get current(){return this.Pt}get resumeToken(){return this.bt}get Vt(){return 0!==this.At}get St(){return this.vt}Dt(t){t.approximateByteSize()>0&&(this.vt=!0,this.bt=t)}Ct(){let t=oc(),e=oc(),n=oc();return this.Rt.forEach(((r,i)=>{switch(i){case 0:t=t.add(r);break;case 2:e=e.add(r);break;case 1:n=n.add(r);break;default:ds()}})),new uc(this.bt,this.Pt,t,e,n)}xt(){this.vt=!1,this.Rt=yc()}Nt(t,e){this.vt=!0,this.Rt=this.Rt.insert(t,e)}kt(t){this.vt=!0,this.Rt=this.Rt.remove(t)}Ot(){this.At+=1}Mt(){this.At-=1}Ft(){this.vt=!0,this.Pt=!0}}class gc{constructor(t){this.$t=t,this.Bt=new Map,this.Lt=Xa(),this.qt=mc(),this.Ut=new Go(As)}Kt(t){for(const e of t.It)t.Tt&&t.Tt.isFoundDocument()?this.Gt(e,t.Tt):this.Qt(e,t.key,t.Tt);for(const e of t.removedTargetIds)this.Qt(e,t.key,t.Tt)}jt(t){this.forEachTarget(t,(e=>{const n=this.Wt(e);switch(t.state){case 0:this.zt(e)&&n.Dt(t.resumeToken);break;case 1:n.Mt(),n.Vt||n.xt(),n.Dt(t.resumeToken);break;case 2:n.Mt(),n.Vt||this.removeTarget(e);break;case 3:this.zt(e)&&(n.Ft(),n.Dt(t.resumeToken));break;case 4:this.zt(e)&&(this.Ht(e),n.Dt(t.resumeToken));break;default:ds()}}))}forEachTarget(t,e){t.targetIds.length>0?t.targetIds.forEach(e):this.Bt.forEach(((t,n)=>{this.zt(n)&&e(n)}))}Jt(t){const e=t.targetId,n=t.Et.count,r=this.Yt(e);if(r){const t=r.target;if(na(t))if(0===n){const n=new Ms(t.path);this.Qt(e,n,Jo.newNoDocument(n,Ls.min()))}else fs(1===n);else this.Xt(e)!==n&&(this.Ht(e),this.Ut=this.Ut.add(e))}}Zt(t){const e=new Map;this.Bt.forEach(((n,r)=>{const i=this.Yt(r);if(i){if(n.current&&na(i.target)){const e=new Ms(i.target.path);null!==this.Lt.get(e)||this.te(r,e)||this.Qt(r,e,Jo.newNoDocument(e,t))}n.St&&(e.set(r,n.Ct()),n.xt())}}));let n=oc();this.qt.forEach(((t,e)=>{let r=!0;e.forEachWhile((t=>{const e=this.Yt(t);return!e||2===e.purpose||(r=!1,!1)})),r&&(n=n.add(t))})),this.Lt.forEach(((e,n)=>n.setReadTime(t)));const r=new lc(t,e,this.Ut,this.Lt,n);return this.Lt=Xa(),this.qt=mc(),this.Ut=new Go(As),r}Gt(t,e){if(!this.zt(t))return;const n=this.te(t,e.key)?2:0;this.Wt(t).Nt(e.key,n),this.Lt=this.Lt.insert(e.key,e),this.qt=this.qt.insert(e.key,this.ee(e.key).add(t))}Qt(t,e,n){if(!this.zt(t))return;const r=this.Wt(t);this.te(t,e)?r.Nt(e,1):r.kt(e),this.qt=this.qt.insert(e,this.ee(e).delete(t)),n&&(this.Lt=this.Lt.insert(e,n))}removeTarget(t){this.Bt.delete(t)}Xt(t){const e=this.Wt(t).Ct();return this.$t.getRemoteKeysForTarget(t).size+e.addedDocuments.size-e.removedDocuments.size}Ot(t){this.Wt(t).Ot()}Wt(t){let e=this.Bt.get(t);return e||(e=new pc,this.Bt.set(t,e)),e}ee(t){let e=this.qt.get(t);return e||(e=new Go(As),this.qt=this.qt.insert(t,e)),e}zt(t){const e=null!==this.Yt(t);return e||cs("WatchChangeAggregator","Detected inactive target",t),e}Yt(t){const e=this.Bt.get(t);return e&&e.Vt?null:this.$t.ne(t)}Ht(t){this.Bt.set(t,new pc),this.$t.getRemoteKeysForTarget(t).forEach((e=>{this.Qt(t,e,null)}))}te(t,e){return this.$t.getRemoteKeysForTarget(t).has(e)}}function mc(){return new qo(Ms.comparator)}function yc(){return new qo(Ms.comparator)}
|
|
1012
1012
|
/**
|
|
1013
1013
|
* @license
|
|
1014
1014
|
* Copyright 2017 Google LLC
|
|
@@ -1024,7 +1024,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1024
1024
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1025
1025
|
* See the License for the specific language governing permissions and
|
|
1026
1026
|
* limitations under the License.
|
|
1027
|
-
*/const
|
|
1027
|
+
*/const vc={asc:"ASCENDING",desc:"DESCENDING"},wc={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},bc={and:"AND",or:"OR"};class _c{constructor(t,e){this.databaseId=t,this.wt=e}}function Sc(t,e){return t.wt?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Ec(t,e){return t.wt?e.toBase64():e.toUint8Array()}function Ic(t){return fs(!!t),Ls.fromTimestamp(function(t){const e=eo(t);return new Ns(e.seconds,e.nanos)}(t))}function Tc(t,e){return function(t){return new Ds(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).canonicalString()}function kc(t){const e=Ds.fromString(t);return fs(Vc(e)),e}function Cc(t,e){const n=kc(e);if(n.get(1)!==t.databaseId.projectId)throw new ms(gs.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new ms(gs.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new Ms(Nc(n))}function Ac(t,e){return Tc(t.databaseId,e)}function Rc(t){return new Ds(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function Nc(t){return fs(t.length>4&&"documents"===t.get(4)),t.popFirst(5)}function Lc(t,e){return{documents:[Ac(t,e.path)]}}function Oc(t,e){const n={structuredQuery:{}},r=e.path;null!==e.collectionGroup?(n.parent=Ac(t,r),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=Ac(t,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);const i=function(t){if(0!==t.length)return Bc(Ao.create(t,"and"))}(e.filters);i&&(n.structuredQuery.where=i);const s=function(t){if(0!==t.length)return t.map((t=>function(t){return{field:Fc(t.field),direction:Pc(t.dir)}}(t)))}(e.orderBy);s&&(n.structuredQuery.orderBy=s);const o=function(t,e){return t.wt||Js(e)?e:{value:e}}(t,e.limit);var a;return null!==o&&(n.structuredQuery.limit=o),e.startAt&&(n.structuredQuery.startAt={before:(a=e.startAt).inclusive,values:a.position}),e.endAt&&(n.structuredQuery.endAt=function(t){return{before:!t.inclusive,values:t.position}}(e.endAt)),n}function Dc(t){let e=function(t){const e=kc(t);return 4===e.length?Ds.emptyPath():Nc(e)}(t.parent);const n=t.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){fs(1===r);const t=n.from[0];t.allDescendants?i=t.collectionId:e=e.child(t.collectionId)}let s=[];n.where&&(s=function(t){const e=xc(t);return e instanceof Ao&&No(e)?e.getFilters():[e]}(n.where));let o=[];n.orderBy&&(o=n.orderBy.map((t=>function(t){return new Ho(zc(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t))));let a=null;n.limit&&(a=function(t){let e;return e="object"==typeof t?t.value:t,Js(e)?null:e}(n.limit));let c=null;n.startAt&&(c=function(t){const e=!!t.before,n=t.values||[];return new Eo(n,e)}(n.startAt));let l=null;return n.endAt&&(l=function(t){const e=!t.before,n=t.values||[];return new Eo(n,e)}(n.endAt)),function(t,e,n,r,i,s,o,a){return new ra(t,e,n,r,i,s,o,a)}(e,i,o,s,a,"F",c,l)}function xc(t){return void 0!==t.unaryFilter?function(t){switch(t.unaryFilter.op){case"IS_NAN":const e=zc(t.unaryFilter.field);return Co.create(e,"==",{doubleValue:NaN});case"IS_NULL":const n=zc(t.unaryFilter.field);return Co.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const r=zc(t.unaryFilter.field);return Co.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const i=zc(t.unaryFilter.field);return Co.create(i,"!=",{nullValue:"NULL_VALUE"});default:return ds()}}(t):void 0!==t.fieldFilter?function(t){return Co.create(zc(t.fieldFilter.field),function(t){switch(t){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return ds()}}(t.fieldFilter.op),t.fieldFilter.value)}(t):void 0!==t.compositeFilter?function(t){return Ao.create(t.compositeFilter.filters.map((t=>xc(t))),function(t){switch(t){case"AND":return"and";case"OR":return"or";default:return ds()}}(t.compositeFilter.op))}(t):ds()}function Pc(t){return vc[t]}function Mc(t){return wc[t]}function Uc(t){return bc[t]}function Fc(t){return{fieldPath:t.canonicalString()}}function zc(t){return Ps.fromServerFormat(t.fieldPath)}function Bc(t){return t instanceof Co?function(t){if("=="===t.op){if(bo(t.value))return{unaryFilter:{field:Fc(t.field),op:"IS_NAN"}};if(wo(t.value))return{unaryFilter:{field:Fc(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(bo(t.value))return{unaryFilter:{field:Fc(t.field),op:"IS_NOT_NAN"}};if(wo(t.value))return{unaryFilter:{field:Fc(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Fc(t.field),op:Mc(t.op),value:t.value}}}(t):t instanceof Ao?function(t){const e=t.getFilters().map((t=>Bc(t)));return 1===e.length?e[0]:{compositeFilter:{op:Uc(t.op),filters:e}}}(t):ds()}function Vc(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)}
|
|
1028
1028
|
/**
|
|
1029
1029
|
* @license
|
|
1030
1030
|
* Copyright 2017 Google LLC
|
|
@@ -1040,7 +1040,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1040
1040
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1041
1041
|
* See the License for the specific language governing permissions and
|
|
1042
1042
|
* limitations under the License.
|
|
1043
|
-
*/class
|
|
1043
|
+
*/class Hc{constructor(t,e,n,r){this.batchId=t,this.localWriteTime=e,this.baseMutations=n,this.mutations=r}applyToRemoteDocument(t,e){const n=e.mutationResults;for(let e=0;e<this.mutations.length;e++){const r=this.mutations[e];r.key.isEqual(t.key)&&Ua(r,t,n[e])}}applyToLocalView(t,e){for(const n of this.baseMutations)n.key.isEqual(t.key)&&(e=Fa(n,t,e,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(t.key)&&(e=Fa(n,t,e,this.localWriteTime));return e}applyToLocalDocumentSet(t,e){const n=rc();return this.mutations.forEach((r=>{const i=t.get(r.key),s=i.overlayedDocument;let o=this.applyToLocalView(s,i.mutatedFields);o=e.has(r.key)?null:o;const a=Ma(s,o);null!==a&&n.set(r.key,a),s.isValidDocument()||s.convertToNoDocument(Ls.min())})),n}keys(){return this.mutations.reduce(((t,e)=>t.add(e.key)),oc())}isEqual(t){return this.batchId===t.batchId&&Rs(this.mutations,t.mutations,((t,e)=>za(t,e)))&&Rs(this.baseMutations,t.baseMutations,((t,e)=>za(t,e)))}}
|
|
1044
1044
|
/**
|
|
1045
1045
|
* @license
|
|
1046
1046
|
* Copyright 2022 Google LLC
|
|
@@ -1056,7 +1056,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1056
1056
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1057
1057
|
* See the License for the specific language governing permissions and
|
|
1058
1058
|
* limitations under the License.
|
|
1059
|
-
*/class
|
|
1059
|
+
*/class jc{constructor(t,e){this.largestBatchId=t,this.mutation=e}getKey(){return this.mutation.key}isEqual(t){return null!==t&&this.mutation===t.mutation}toString(){return`Overlay{\n largestBatchId: ${this.largestBatchId},\n mutation: ${this.mutation.toString()}\n }`}}
|
|
1060
1060
|
/**
|
|
1061
1061
|
* @license
|
|
1062
1062
|
* Copyright 2017 Google LLC
|
|
@@ -1072,7 +1072,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1072
1072
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1073
1073
|
* See the License for the specific language governing permissions and
|
|
1074
1074
|
* limitations under the License.
|
|
1075
|
-
*/class
|
|
1075
|
+
*/class qc{constructor(t,e,n,r,i=Ls.min(),s=Ls.min(),o=Zs.EMPTY_BYTE_STRING){this.target=t,this.targetId=e,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=o}withSequenceNumber(t){return new qc(this.target,this.targetId,this.purpose,t,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken)}withResumeToken(t,e){return new qc(this.target,this.targetId,this.purpose,this.sequenceNumber,e,this.lastLimboFreeSnapshotVersion,t)}withLastLimboFreeSnapshotVersion(t){return new qc(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,t,this.resumeToken)}}
|
|
1076
1076
|
/**
|
|
1077
1077
|
* @license
|
|
1078
1078
|
* Copyright 2017 Google LLC
|
|
@@ -1088,7 +1088,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1088
1088
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1089
1089
|
* See the License for the specific language governing permissions and
|
|
1090
1090
|
* limitations under the License.
|
|
1091
|
-
*/class
|
|
1091
|
+
*/class $c{constructor(t){this.ie=t}}function Kc(t){const e=Dc({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?da(e,e.limit,"L"):e}
|
|
1092
1092
|
/**
|
|
1093
1093
|
* @license
|
|
1094
1094
|
* Copyright 2019 Google LLC
|
|
@@ -1104,7 +1104,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1104
1104
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1105
1105
|
* See the License for the specific language governing permissions and
|
|
1106
1106
|
* limitations under the License.
|
|
1107
|
-
*/class
|
|
1107
|
+
*/class Gc{constructor(){this.Je=new Wc}addToCollectionParentIndex(t,e){return this.Je.add(e),js.resolve()}getCollectionParents(t,e){return js.resolve(this.Je.getEntries(e))}addFieldIndex(t,e){return js.resolve()}deleteFieldIndex(t,e){return js.resolve()}getDocumentsMatchingTarget(t,e){return js.resolve(null)}getIndexType(t,e){return js.resolve(0)}getFieldIndexes(t,e){return js.resolve([])}getNextCollectionGroupToUpdate(t){return js.resolve(null)}getMinOffset(t,e){return js.resolve(Fs.min())}getMinOffsetFromCollectionGroup(t,e){return js.resolve(Fs.min())}updateCollectionGroup(t,e,n){return js.resolve()}updateIndexEntries(t,e){return js.resolve()}}class Wc{constructor(){this.index={}}add(t){const e=t.lastSegment(),n=t.popLast(),r=this.index[e]||new Go(Ds.comparator),i=!r.has(n);return this.index[e]=r.add(n),i}has(t){const e=t.lastSegment(),n=t.popLast(),r=this.index[e];return r&&r.has(n)}getEntries(t){return(this.index[t]||new Go(Ds.comparator)).toArray()}}
|
|
1108
1108
|
/**
|
|
1109
1109
|
* @license
|
|
1110
1110
|
* Copyright 2017 Google LLC
|
|
@@ -1120,7 +1120,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1120
1120
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1121
1121
|
* See the License for the specific language governing permissions and
|
|
1122
1122
|
* limitations under the License.
|
|
1123
|
-
*/class
|
|
1123
|
+
*/class Qc{constructor(t){this.bn=t}next(){return this.bn+=2,this.bn}static Pn(){return new Qc(0)}static vn(){return new Qc(-1)}}
|
|
1124
1124
|
/**
|
|
1125
1125
|
* @license
|
|
1126
1126
|
* Copyright 2017 Google LLC
|
|
@@ -1136,7 +1136,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1136
1136
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1137
1137
|
* See the License for the specific language governing permissions and
|
|
1138
1138
|
* limitations under the License.
|
|
1139
|
-
*/class
|
|
1139
|
+
*/class Yc{constructor(){this.changes=new Ya((t=>t.toString()),((t,e)=>t.isEqual(e))),this.changesApplied=!1}addEntry(t){this.assertNotApplied(),this.changes.set(t.key,t)}removeEntry(t,e){this.assertNotApplied(),this.changes.set(t,Jo.newInvalidDocument(t).setReadTime(e))}getEntry(t,e){this.assertNotApplied();const n=this.changes.get(e);return void 0!==n?js.resolve(n):this.getFromCache(t,e)}getEntries(t,e){return this.getAllFromCache(t,e)}apply(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)}assertNotApplied(){}}
|
|
1140
1140
|
/**
|
|
1141
1141
|
* @license
|
|
1142
1142
|
* Copyright 2017 Google LLC
|
|
@@ -1168,7 +1168,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1168
1168
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1169
1169
|
* See the License for the specific language governing permissions and
|
|
1170
1170
|
* limitations under the License.
|
|
1171
|
-
*/class
|
|
1171
|
+
*/class Jc{constructor(t,e){this.overlayedDocument=t,this.mutatedFields=e}}
|
|
1172
1172
|
/**
|
|
1173
1173
|
* @license
|
|
1174
1174
|
* Copyright 2017 Google LLC
|
|
@@ -1184,7 +1184,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1184
1184
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1185
1185
|
* See the License for the specific language governing permissions and
|
|
1186
1186
|
* limitations under the License.
|
|
1187
|
-
*/class
|
|
1187
|
+
*/class Xc{constructor(t,e,n,r){this.remoteDocumentCache=t,this.mutationQueue=e,this.documentOverlayCache=n,this.indexManager=r}getDocument(t,e){let n=null;return this.documentOverlayCache.getOverlay(t,e).next((r=>(n=r,this.remoteDocumentCache.getEntry(t,e)))).next((t=>(null!==n&&Fa(n.mutation,t,Qo.empty(),Ns.now()),t)))}getDocuments(t,e){return this.remoteDocumentCache.getEntries(t,e).next((e=>this.getLocalViewOfDocuments(t,e,oc()).next((()=>e))))}getLocalViewOfDocuments(t,e,n=oc()){const r=nc();return this.populateOverlays(t,r,e).next((()=>this.computeViews(t,e,r,n).next((t=>{let e=tc();return t.forEach(((t,n)=>{e=e.insert(t,n.overlayedDocument)})),e}))))}getOverlayedDocuments(t,e){const n=nc();return this.populateOverlays(t,n,e).next((()=>this.computeViews(t,e,n,oc())))}populateOverlays(t,e,n){const r=[];return n.forEach((t=>{e.has(t)||r.push(t)})),this.documentOverlayCache.getOverlays(t,r).next((t=>{t.forEach(((t,n)=>{e.set(t,n)}))}))}computeViews(t,e,n,r){let i=Xa();const s=ic(),o=ic();return e.forEach(((t,e)=>{const o=n.get(e.key);r.has(e.key)&&(void 0===o||o.mutation instanceof Va)?i=i.insert(e.key,e):void 0!==o&&(s.set(e.key,o.mutation.getFieldMask()),Fa(o.mutation,e,o.mutation.getFieldMask(),Ns.now()))})),this.recalculateAndSaveOverlays(t,i).next((t=>(t.forEach(((t,e)=>s.set(t,e))),e.forEach(((t,e)=>{var n;return o.set(t,new Jc(e,null!==(n=s.get(t))&&void 0!==n?n:null))})),o)))}recalculateAndSaveOverlays(t,e){const n=ic();let r=new qo(((t,e)=>t-e)),i=oc();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(t,e).next((t=>{for(const i of t)i.keys().forEach((t=>{const s=e.get(t);if(null===s)return;let o=n.get(t)||Qo.empty();o=i.applyToLocalView(s,o),n.set(t,o);const a=(r.get(i.batchId)||oc()).add(t);r=r.insert(i.batchId,a)}))})).next((()=>{const s=[],o=r.getReverseIterator();for(;o.hasNext();){const r=o.getNext(),a=r.key,c=r.value,l=rc();c.forEach((t=>{if(!i.has(t)){const r=Ma(e.get(t),n.get(t));null!==r&&l.set(t,r),i=i.add(t)}})),s.push(this.documentOverlayCache.saveOverlays(t,a,l))}return js.waitFor(s)})).next((()=>n))}recalculateAndSaveOverlaysForDocumentKeys(t,e){return this.remoteDocumentCache.getEntries(t,e).next((e=>this.recalculateAndSaveOverlays(t,e)))}getDocumentsMatchingQuery(t,e,n){return function(t){return Ms.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.getDocumentsMatchingDocumentQuery(t,e.path):ca(e)?this.getDocumentsMatchingCollectionGroupQuery(t,e,n):this.getDocumentsMatchingCollectionQuery(t,e,n)}getNextDocuments(t,e,n,r){return this.remoteDocumentCache.getAllFromCollectionGroup(t,e,n,r).next((i=>{const s=r-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(t,e,n.largestBatchId,r-i.size):js.resolve(nc());let o=-1,a=i;return s.next((e=>js.forEach(e,((e,n)=>(o<n.largestBatchId&&(o=n.largestBatchId),i.get(e)?js.resolve():this.remoteDocumentCache.getEntry(t,e).next((t=>{a=a.insert(e,t)}))))).next((()=>this.populateOverlays(t,e,i))).next((()=>this.computeViews(t,a,e,oc()))).next((t=>({batchId:o,changes:ec(t)})))))}))}getDocumentsMatchingDocumentQuery(t,e){return this.getDocument(t,new Ms(e)).next((t=>{let e=tc();return t.isFoundDocument()&&(e=e.insert(t.key,t)),e}))}getDocumentsMatchingCollectionGroupQuery(t,e,n){const r=e.collectionGroup;let i=tc();return this.indexManager.getCollectionParents(t,r).next((s=>js.forEach(s,(s=>{const o=function(t,e){return new ra(e,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,s.child(r));return this.getDocumentsMatchingCollectionQuery(t,o,n).next((t=>{t.forEach(((t,e)=>{i=i.insert(t,e)}))}))})).next((()=>i))))}getDocumentsMatchingCollectionQuery(t,e,n){let r;return this.remoteDocumentCache.getAllFromCollection(t,e.path,n).next((i=>(r=i,this.documentOverlayCache.getOverlaysForCollection(t,e.path,n.largestBatchId)))).next((t=>{t.forEach(((t,e)=>{const n=e.getKey();null===r.get(n)&&(r=r.insert(n,Jo.newInvalidDocument(n)))}));let n=tc();return r.forEach(((r,i)=>{const s=t.get(r);void 0!==s&&Fa(s.mutation,i,Qo.empty(),Ns.now()),ma(e,i)&&(n=n.insert(r,i))})),n}))}}
|
|
1188
1188
|
/**
|
|
1189
1189
|
* @license
|
|
1190
1190
|
* Copyright 2020 Google LLC
|
|
@@ -1200,7 +1200,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1200
1200
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1201
1201
|
* See the License for the specific language governing permissions and
|
|
1202
1202
|
* limitations under the License.
|
|
1203
|
-
*/class
|
|
1203
|
+
*/class Zc{constructor(t){this.yt=t,this.Zn=new Map,this.ts=new Map}getBundleMetadata(t,e){return js.resolve(this.Zn.get(e))}saveBundleMetadata(t,e){var n;return this.Zn.set(e.id,{id:(n=e).id,version:n.version,createTime:Ic(n.createTime)}),js.resolve()}getNamedQuery(t,e){return js.resolve(this.ts.get(e))}saveNamedQuery(t,e){return this.ts.set(e.name,function(t){return{name:t.name,query:Kc(t.bundledQuery),readTime:Ic(t.readTime)}}(e)),js.resolve()}}
|
|
1204
1204
|
/**
|
|
1205
1205
|
* @license
|
|
1206
1206
|
* Copyright 2022 Google LLC
|
|
@@ -1216,7 +1216,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1216
1216
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1217
1217
|
* See the License for the specific language governing permissions and
|
|
1218
1218
|
* limitations under the License.
|
|
1219
|
-
*/class
|
|
1219
|
+
*/class tl{constructor(){this.overlays=new qo(Ms.comparator),this.es=new Map}getOverlay(t,e){return js.resolve(this.overlays.get(e))}getOverlays(t,e){const n=nc();return js.forEach(e,(e=>this.getOverlay(t,e).next((t=>{null!==t&&n.set(e,t)})))).next((()=>n))}saveOverlays(t,e,n){return n.forEach(((n,r)=>{this.oe(t,e,r)})),js.resolve()}removeOverlaysForBatchId(t,e,n){const r=this.es.get(n);return void 0!==r&&(r.forEach((t=>this.overlays=this.overlays.remove(t))),this.es.delete(n)),js.resolve()}getOverlaysForCollection(t,e,n){const r=nc(),i=e.length+1,s=new Ms(e.child("")),o=this.overlays.getIteratorFrom(s);for(;o.hasNext();){const t=o.getNext().value,s=t.getKey();if(!e.isPrefixOf(s.path))break;s.path.length===i&&t.largestBatchId>n&&r.set(t.getKey(),t)}return js.resolve(r)}getOverlaysForCollectionGroup(t,e,n,r){let i=new qo(((t,e)=>t-e));const s=this.overlays.getIterator();for(;s.hasNext();){const t=s.getNext().value;if(t.getKey().getCollectionGroup()===e&&t.largestBatchId>n){let e=i.get(t.largestBatchId);null===e&&(e=nc(),i=i.insert(t.largestBatchId,e)),e.set(t.getKey(),t)}}const o=nc(),a=i.getIterator();for(;a.hasNext()&&(a.getNext().value.forEach(((t,e)=>o.set(t,e))),!(o.size()>=r)););return js.resolve(o)}oe(t,e,n){const r=this.overlays.get(n.key);if(null!==r){const t=this.es.get(r.largestBatchId).delete(n.key);this.es.set(r.largestBatchId,t)}this.overlays=this.overlays.insert(n.key,new jc(e,n));let i=this.es.get(e);void 0===i&&(i=oc(),this.es.set(e,i)),this.es.set(e,i.add(n.key))}}
|
|
1220
1220
|
/**
|
|
1221
1221
|
* @license
|
|
1222
1222
|
* Copyright 2017 Google LLC
|
|
@@ -1232,7 +1232,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1232
1232
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1233
1233
|
* See the License for the specific language governing permissions and
|
|
1234
1234
|
* limitations under the License.
|
|
1235
|
-
*/class
|
|
1235
|
+
*/class el{constructor(){this.ns=new Go(nl.ss),this.rs=new Go(nl.os)}isEmpty(){return this.ns.isEmpty()}addReference(t,e){const n=new nl(t,e);this.ns=this.ns.add(n),this.rs=this.rs.add(n)}us(t,e){t.forEach((t=>this.addReference(t,e)))}removeReference(t,e){this.cs(new nl(t,e))}hs(t,e){t.forEach((t=>this.removeReference(t,e)))}ls(t){const e=new Ms(new Ds([])),n=new nl(e,t),r=new nl(e,t+1),i=[];return this.rs.forEachInRange([n,r],(t=>{this.cs(t),i.push(t.key)})),i}fs(){this.ns.forEach((t=>this.cs(t)))}cs(t){this.ns=this.ns.delete(t),this.rs=this.rs.delete(t)}ds(t){const e=new Ms(new Ds([])),n=new nl(e,t),r=new nl(e,t+1);let i=oc();return this.rs.forEachInRange([n,r],(t=>{i=i.add(t.key)})),i}containsKey(t){const e=new nl(t,0),n=this.ns.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)}}class nl{constructor(t,e){this.key=t,this._s=e}static ss(t,e){return Ms.comparator(t.key,e.key)||As(t._s,e._s)}static os(t,e){return As(t._s,e._s)||Ms.comparator(t.key,e.key)}}
|
|
1236
1236
|
/**
|
|
1237
1237
|
* @license
|
|
1238
1238
|
* Copyright 2017 Google LLC
|
|
@@ -1248,7 +1248,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1248
1248
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1249
1249
|
* See the License for the specific language governing permissions and
|
|
1250
1250
|
* limitations under the License.
|
|
1251
|
-
*/class
|
|
1251
|
+
*/class rl{constructor(t,e){this.indexManager=t,this.referenceDelegate=e,this.mutationQueue=[],this.ws=1,this.gs=new Go(nl.ss)}checkEmpty(t){return js.resolve(0===this.mutationQueue.length)}addMutationBatch(t,e,n,r){const i=this.ws;this.ws++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const s=new Hc(i,e,n,r);this.mutationQueue.push(s);for(const e of r)this.gs=this.gs.add(new nl(e.key,i)),this.indexManager.addToCollectionParentIndex(t,e.key.path.popLast());return js.resolve(s)}lookupMutationBatch(t,e){return js.resolve(this.ys(e))}getNextMutationBatchAfterBatchId(t,e){const n=e+1,r=this.ps(n),i=r<0?0:r;return js.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return js.resolve(0===this.mutationQueue.length?-1:this.ws-1)}getAllMutationBatches(t){return js.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(t,e){const n=new nl(e,0),r=new nl(e,Number.POSITIVE_INFINITY),i=[];return this.gs.forEachInRange([n,r],(t=>{const e=this.ys(t._s);i.push(e)})),js.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(t,e){let n=new Go(As);return e.forEach((t=>{const e=new nl(t,0),r=new nl(t,Number.POSITIVE_INFINITY);this.gs.forEachInRange([e,r],(t=>{n=n.add(t._s)}))})),js.resolve(this.Is(n))}getAllMutationBatchesAffectingQuery(t,e){const n=e.path,r=n.length+1;let i=n;Ms.isDocumentKey(i)||(i=i.child(""));const s=new nl(new Ms(i),0);let o=new Go(As);return this.gs.forEachWhile((t=>{const e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===r&&(o=o.add(t._s)),!0)}),s),js.resolve(this.Is(o))}Is(t){const e=[];return t.forEach((t=>{const n=this.ys(t);null!==n&&e.push(n)})),e}removeMutationBatch(t,e){fs(0===this.Ts(e.batchId,"removed")),this.mutationQueue.shift();let n=this.gs;return js.forEach(e.mutations,(r=>{const i=new nl(r.key,e.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(t,r.key)})).next((()=>{this.gs=n}))}An(t){}containsKey(t,e){const n=new nl(e,0),r=this.gs.firstAfterOrEqual(n);return js.resolve(e.isEqual(r&&r.key))}performConsistencyCheck(t){return this.mutationQueue.length,js.resolve()}Ts(t,e){return this.ps(t)}ps(t){return 0===this.mutationQueue.length?0:t-this.mutationQueue[0].batchId}ys(t){const e=this.ps(t);return e<0||e>=this.mutationQueue.length?null:this.mutationQueue[e]}}
|
|
1252
1252
|
/**
|
|
1253
1253
|
* @license
|
|
1254
1254
|
* Copyright 2017 Google LLC
|
|
@@ -1264,7 +1264,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1264
1264
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1265
1265
|
* See the License for the specific language governing permissions and
|
|
1266
1266
|
* limitations under the License.
|
|
1267
|
-
*/class
|
|
1267
|
+
*/class il{constructor(t){this.Es=t,this.docs=new qo(Ms.comparator),this.size=0}setIndexManager(t){this.indexManager=t}addEntry(t,e){const n=e.key,r=this.docs.get(n),i=r?r.size:0,s=this.Es(e);return this.docs=this.docs.insert(n,{document:e.mutableCopy(),size:s}),this.size+=s-i,this.indexManager.addToCollectionParentIndex(t,n.path.popLast())}removeEntry(t){const e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)}getEntry(t,e){const n=this.docs.get(e);return js.resolve(n?n.document.mutableCopy():Jo.newInvalidDocument(e))}getEntries(t,e){let n=Xa();return e.forEach((t=>{const e=this.docs.get(t);n=n.insert(t,e?e.document.mutableCopy():Jo.newInvalidDocument(t))})),js.resolve(n)}getAllFromCollection(t,e,n){let r=Xa();const i=new Ms(e.child("")),s=this.docs.getIteratorFrom(i);for(;s.hasNext();){const{key:t,value:{document:i}}=s.getNext();if(!e.isPrefixOf(t.path))break;t.path.length>e.length+1||zs(Us(i),n)<=0||(r=r.insert(i.key,i.mutableCopy()))}return js.resolve(r)}getAllFromCollectionGroup(t,e,n,r){ds()}As(t,e){return js.forEach(this.docs,(t=>e(t)))}newChangeBuffer(t){return new sl(this)}getSize(t){return js.resolve(this.size)}}class sl extends Yc{constructor(t){super(),this.Yn=t}applyChanges(t){const e=[];return this.changes.forEach(((n,r)=>{r.isValidDocument()?e.push(this.Yn.addEntry(t,r)):this.Yn.removeEntry(n)})),js.waitFor(e)}getFromCache(t,e){return this.Yn.getEntry(t,e)}getAllFromCache(t,e){return this.Yn.getEntries(t,e)}}
|
|
1268
1268
|
/**
|
|
1269
1269
|
* @license
|
|
1270
1270
|
* Copyright 2017 Google LLC
|
|
@@ -1280,7 +1280,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1280
1280
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1281
1281
|
* See the License for the specific language governing permissions and
|
|
1282
1282
|
* limitations under the License.
|
|
1283
|
-
*/class
|
|
1283
|
+
*/class ol{constructor(t){this.persistence=t,this.Rs=new Ya((t=>ta(t)),ea),this.lastRemoteSnapshotVersion=Ls.min(),this.highestTargetId=0,this.bs=0,this.Ps=new el,this.targetCount=0,this.vs=Qc.Pn()}forEachTarget(t,e){return this.Rs.forEach(((t,n)=>e(n))),js.resolve()}getLastRemoteSnapshotVersion(t){return js.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(t){return js.resolve(this.bs)}allocateTargetId(t){return this.highestTargetId=this.vs.next(),js.resolve(this.highestTargetId)}setTargetsMetadata(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.bs&&(this.bs=e),js.resolve()}Dn(t){this.Rs.set(t.target,t);const e=t.targetId;e>this.highestTargetId&&(this.vs=new Qc(e),this.highestTargetId=e),t.sequenceNumber>this.bs&&(this.bs=t.sequenceNumber)}addTargetData(t,e){return this.Dn(e),this.targetCount+=1,js.resolve()}updateTargetData(t,e){return this.Dn(e),js.resolve()}removeTargetData(t,e){return this.Rs.delete(e.target),this.Ps.ls(e.targetId),this.targetCount-=1,js.resolve()}removeTargets(t,e,n){let r=0;const i=[];return this.Rs.forEach(((s,o)=>{o.sequenceNumber<=e&&null===n.get(o.targetId)&&(this.Rs.delete(s),i.push(this.removeMatchingKeysForTargetId(t,o.targetId)),r++)})),js.waitFor(i).next((()=>r))}getTargetCount(t){return js.resolve(this.targetCount)}getTargetData(t,e){const n=this.Rs.get(e)||null;return js.resolve(n)}addMatchingKeys(t,e,n){return this.Ps.us(e,n),js.resolve()}removeMatchingKeys(t,e,n){this.Ps.hs(e,n);const r=this.persistence.referenceDelegate,i=[];return r&&e.forEach((e=>{i.push(r.markPotentiallyOrphaned(t,e))})),js.waitFor(i)}removeMatchingKeysForTargetId(t,e){return this.Ps.ls(e),js.resolve()}getMatchingKeysForTargetId(t,e){const n=this.Ps.ds(e);return js.resolve(n)}containsKey(t,e){return js.resolve(this.Ps.containsKey(e))}}
|
|
1284
1284
|
/**
|
|
1285
1285
|
* @license
|
|
1286
1286
|
* Copyright 2017 Google LLC
|
|
@@ -1296,7 +1296,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1296
1296
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1297
1297
|
* See the License for the specific language governing permissions and
|
|
1298
1298
|
* limitations under the License.
|
|
1299
|
-
*/class
|
|
1299
|
+
*/class al{constructor(t,e){this.Vs={},this.overlays={},this.Ss=new $s(0),this.Ds=!1,this.Ds=!0,this.referenceDelegate=t(this),this.Cs=new ol(this),this.indexManager=new Gc,this.remoteDocumentCache=function(t){return new il(t)}((t=>this.referenceDelegate.xs(t))),this.yt=new $c(e),this.Ns=new Zc(this.yt)}start(){return Promise.resolve()}shutdown(){return this.Ds=!1,Promise.resolve()}get started(){return this.Ds}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(t){return this.indexManager}getDocumentOverlayCache(t){let e=this.overlays[t.toKey()];return e||(e=new tl,this.overlays[t.toKey()]=e),e}getMutationQueue(t,e){let n=this.Vs[t.toKey()];return n||(n=new rl(e,this.referenceDelegate),this.Vs[t.toKey()]=n),n}getTargetCache(){return this.Cs}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ns}runTransaction(t,e,n){cs("MemoryPersistence","Starting transaction:",t);const r=new cl(this.Ss.next());return this.referenceDelegate.ks(),n(r).next((t=>this.referenceDelegate.Os(r).next((()=>t)))).toPromise().then((t=>(r.raiseOnCommittedEvent(),t)))}Ms(t,e){return js.or(Object.values(this.Vs).map((n=>()=>n.containsKey(t,e))))}}class cl extends Vs{constructor(t){super(),this.currentSequenceNumber=t}}class ll{constructor(t){this.persistence=t,this.Fs=new el,this.$s=null}static Bs(t){return new ll(t)}get Ls(){if(this.$s)return this.$s;throw ds()}addReference(t,e,n){return this.Fs.addReference(n,e),this.Ls.delete(n.toString()),js.resolve()}removeReference(t,e,n){return this.Fs.removeReference(n,e),this.Ls.add(n.toString()),js.resolve()}markPotentiallyOrphaned(t,e){return this.Ls.add(e.toString()),js.resolve()}removeTarget(t,e){this.Fs.ls(e.targetId).forEach((t=>this.Ls.add(t.toString())));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(t,e.targetId).next((t=>{t.forEach((t=>this.Ls.add(t.toString())))})).next((()=>n.removeTargetData(t,e)))}ks(){this.$s=new Set}Os(t){const e=this.persistence.getRemoteDocumentCache().newChangeBuffer();return js.forEach(this.Ls,(n=>{const r=Ms.fromPath(n);return this.qs(t,r).next((t=>{t||e.removeEntry(r,Ls.min())}))})).next((()=>(this.$s=null,e.apply(t))))}updateLimboDocument(t,e){return this.qs(t,e).next((t=>{t?this.Ls.delete(e.toString()):this.Ls.add(e.toString())}))}xs(t){return 0}qs(t,e){return js.or([()=>js.resolve(this.Fs.containsKey(e)),()=>this.persistence.getTargetCache().containsKey(t,e),()=>this.persistence.Ms(t,e)])}}
|
|
1300
1300
|
/**
|
|
1301
1301
|
* @license
|
|
1302
1302
|
* Copyright 2017 Google LLC
|
|
@@ -1312,7 +1312,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1312
1312
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1313
1313
|
* See the License for the specific language governing permissions and
|
|
1314
1314
|
* limitations under the License.
|
|
1315
|
-
*/class
|
|
1315
|
+
*/class ul{constructor(t,e,n,r){this.targetId=t,this.fromCache=e,this.Si=n,this.Di=r}static Ci(t,e){let n=oc(),r=oc();for(const t of e.docChanges)switch(t.type){case 0:n=n.add(t.doc.key);break;case 1:r=r.add(t.doc.key)}return new ul(t,e.fromCache,n,r)}}
|
|
1316
1316
|
/**
|
|
1317
1317
|
* @license
|
|
1318
1318
|
* Copyright 2019 Google LLC
|
|
@@ -1328,7 +1328,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1328
1328
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1329
1329
|
* See the License for the specific language governing permissions and
|
|
1330
1330
|
* limitations under the License.
|
|
1331
|
-
*/class
|
|
1331
|
+
*/class hl{constructor(){this.xi=!1}initialize(t,e){this.Ni=t,this.indexManager=e,this.xi=!0}getDocumentsMatchingQuery(t,e,n,r){return this.ki(t,e).next((i=>i||this.Oi(t,e,r,n))).next((n=>n||this.Mi(t,e)))}ki(t,e){if(sa(e))return js.resolve(null);let n=ua(e);return this.indexManager.getIndexType(t,n).next((r=>0===r?null:(null!==e.limit&&1===r&&(e=da(e,null,"F"),n=ua(e)),this.indexManager.getDocumentsMatchingTarget(t,n).next((r=>{const i=oc(...r);return this.Ni.getDocuments(t,i).next((r=>this.indexManager.getMinOffset(t,n).next((n=>{const s=this.Fi(e,r);return this.$i(e,s,i,n.readTime)?this.ki(t,da(e,null,"F")):this.Bi(t,s,e,n)}))))})))))}Oi(t,e,n,r){return sa(e)||r.isEqual(Ls.min())?this.Mi(t,e):this.Ni.getDocuments(t,n).next((i=>{const s=this.Fi(e,i);return this.$i(e,s,n,r)?this.Mi(t,e):(as()<=R.DEBUG&&cs("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),ga(e)),this.Bi(t,s,e,function(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,i=Ls.fromTimestamp(1e9===r?new Ns(n+1,0):new Ns(n,r));return new Fs(i,Ms.empty(),e)}(r,-1)))}))}Fi(t,e){let n=new Go(ya(t));return e.forEach(((e,r)=>{ma(t,r)&&(n=n.add(r))})),n}$i(t,e,n,r){if(null===t.limit)return!1;if(n.size!==e.size)return!0;const i="F"===t.limitType?e.last():e.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(r)>0)}Mi(t,e){return as()<=R.DEBUG&&cs("QueryEngine","Using full collection scan to execute query:",ga(e)),this.Ni.getDocumentsMatchingQuery(t,e,Fs.min())}Bi(t,e,n,r){return this.Ni.getDocumentsMatchingQuery(t,n,r).next((t=>(e.forEach((e=>{t=t.insert(e.key,e)})),t)))}}
|
|
1332
1332
|
/**
|
|
1333
1333
|
* @license
|
|
1334
1334
|
* Copyright 2020 Google LLC
|
|
@@ -1344,7 +1344,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1344
1344
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1345
1345
|
* See the License for the specific language governing permissions and
|
|
1346
1346
|
* limitations under the License.
|
|
1347
|
-
*/class
|
|
1347
|
+
*/class dl{constructor(t,e,n,r){this.persistence=t,this.Li=e,this.yt=r,this.qi=new qo(As),this.Ui=new Ya((t=>ta(t)),ea),this.Ki=new Map,this.Gi=t.getRemoteDocumentCache(),this.Cs=t.getTargetCache(),this.Ns=t.getBundleCache(),this.Qi(n)}Qi(t){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(t),this.indexManager=this.persistence.getIndexManager(t),this.mutationQueue=this.persistence.getMutationQueue(t,this.indexManager),this.localDocuments=new Xc(this.Gi,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Gi.setIndexManager(this.indexManager),this.Li.initialize(this.localDocuments,this.indexManager)}collectGarbage(t){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(e=>t.collect(e,this.qi)))}}async function fl(t,e){const n=ps(t);return await n.persistence.runTransaction("Handle user change","readonly",(t=>{let r;return n.mutationQueue.getAllMutationBatches(t).next((i=>(r=i,n.Qi(e),n.mutationQueue.getAllMutationBatches(t)))).next((e=>{const i=[],s=[];let o=oc();for(const t of r){i.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}for(const t of e){s.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}return n.localDocuments.getDocuments(t,o).next((t=>({ji:t,removedBatchIds:i,addedBatchIds:s})))}))}))}function pl(t){const e=ps(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(t=>e.Cs.getLastRemoteSnapshotVersion(t)))}function gl(t,e){const n=ps(t),r=e.snapshotVersion;let i=n.qi;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(t=>{const s=n.Gi.newChangeBuffer({trackRemovals:!0});i=n.qi;const o=[];e.targetChanges.forEach(((s,a)=>{const c=i.get(a);if(!c)return;o.push(n.Cs.removeMatchingKeys(t,s.removedDocuments,a).next((()=>n.Cs.addMatchingKeys(t,s.addedDocuments,a))));let l=c.withSequenceNumber(t.currentSequenceNumber);e.targetMismatches.has(a)?l=l.withResumeToken(Zs.EMPTY_BYTE_STRING,Ls.min()).withLastLimboFreeSnapshotVersion(Ls.min()):s.resumeToken.approximateByteSize()>0&&(l=l.withResumeToken(s.resumeToken,r)),i=i.insert(a,l),function(t,e,n){return 0===t.resumeToken.approximateByteSize()||(e.snapshotVersion.toMicroseconds()-t.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0)}(c,l,s)&&o.push(n.Cs.updateTargetData(t,l))}));let a=Xa(),c=oc();if(e.documentUpdates.forEach((r=>{e.resolvedLimboDocuments.has(r)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(t,r))})),o.push(function(t,e,n){let r=oc(),i=oc();return n.forEach((t=>r=r.add(t))),e.getEntries(t,r).next((t=>{let r=Xa();return n.forEach(((n,s)=>{const o=t.get(n);s.isFoundDocument()!==o.isFoundDocument()&&(i=i.add(n)),s.isNoDocument()&&s.version.isEqual(Ls.min())?(e.removeEntry(n,s.readTime),r=r.insert(n,s)):!o.isValidDocument()||s.version.compareTo(o.version)>0||0===s.version.compareTo(o.version)&&o.hasPendingWrites?(e.addEntry(s),r=r.insert(n,s)):cs("LocalStore","Ignoring outdated watch update for ",n,". Current version:",o.version," Watch version:",s.version)})),{Wi:r,zi:i}}))}(t,s,e.documentUpdates).next((t=>{a=t.Wi,c=t.zi}))),!r.isEqual(Ls.min())){const e=n.Cs.getLastRemoteSnapshotVersion(t).next((e=>n.Cs.setTargetsMetadata(t,t.currentSequenceNumber,r)));o.push(e)}return js.waitFor(o).next((()=>s.apply(t))).next((()=>n.localDocuments.getLocalViewOfDocuments(t,a,c))).next((()=>a))})).then((t=>(n.qi=i,t)))}async function ml(t,e,n){const r=ps(t),i=r.qi.get(e),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,(t=>r.persistence.referenceDelegate.removeTarget(t,i)))}catch(t){if(!qs(t))throw t;cs("LocalStore",`Failed to update sequence numbers for target ${e}: ${t}`)}r.qi=r.qi.remove(e),r.Ui.delete(i.target)}function yl(t,e,n){const r=ps(t);let i=Ls.min(),s=oc();return r.persistence.runTransaction("Execute query","readonly",(t=>function(t,e,n){const r=ps(t),i=r.Ui.get(n);return void 0!==i?js.resolve(r.qi.get(i)):r.Cs.getTargetData(e,n)}(r,t,ua(e)).next((e=>{if(e)return i=e.lastLimboFreeSnapshotVersion,r.Cs.getMatchingKeysForTargetId(t,e.targetId).next((t=>{s=t}))})).next((()=>r.Li.getDocumentsMatchingQuery(t,e,n?i:Ls.min(),n?s:oc()))).next((t=>(function(t,e,n){let r=t.Ki.get(e)||Ls.min();n.forEach(((t,e)=>{e.readTime.compareTo(r)>0&&(r=e.readTime)})),t.Ki.set(e,r)}(r,function(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}(e),t),{documents:t,Hi:s})))))}class vl{constructor(){this.activeTargetIds=cc()}er(t){this.activeTargetIds=this.activeTargetIds.add(t)}nr(t){this.activeTargetIds=this.activeTargetIds.delete(t)}tr(){const t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)}}class wl{constructor(){this.Lr=new vl,this.qr={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(t){}updateMutationState(t,e,n){}addLocalQueryTarget(t){return this.Lr.er(t),this.qr[t]||"not-current"}updateQueryState(t,e,n){this.qr[t]=e}removeLocalQueryTarget(t){this.Lr.nr(t)}isLocalQueryTarget(t){return this.Lr.activeTargetIds.has(t)}clearQueryState(t){delete this.qr[t]}getAllActiveQueryTargets(){return this.Lr.activeTargetIds}isActiveQueryTarget(t){return this.Lr.activeTargetIds.has(t)}start(){return this.Lr=new vl,Promise.resolve()}handleUserChange(t,e,n){}setOnlineState(t){}shutdown(){}writeSequenceNumber(t){}notifyBundleLoaded(t){}}
|
|
1348
1348
|
/**
|
|
1349
1349
|
* @license
|
|
1350
1350
|
* Copyright 2019 Google LLC
|
|
@@ -1360,7 +1360,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1360
1360
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1361
1361
|
* See the License for the specific language governing permissions and
|
|
1362
1362
|
* limitations under the License.
|
|
1363
|
-
*/class
|
|
1363
|
+
*/class bl{Ur(t){}shutdown(){}}
|
|
1364
1364
|
/**
|
|
1365
1365
|
* @license
|
|
1366
1366
|
* Copyright 2019 Google LLC
|
|
@@ -1376,7 +1376,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1376
1376
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1377
1377
|
* See the License for the specific language governing permissions and
|
|
1378
1378
|
* limitations under the License.
|
|
1379
|
-
*/class
|
|
1379
|
+
*/class _l{constructor(){this.Kr=()=>this.Gr(),this.Qr=()=>this.jr(),this.Wr=[],this.zr()}Ur(t){this.Wr.push(t)}shutdown(){window.removeEventListener("online",this.Kr),window.removeEventListener("offline",this.Qr)}zr(){window.addEventListener("online",this.Kr),window.addEventListener("offline",this.Qr)}Gr(){cs("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const t of this.Wr)t(0)}jr(){cs("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const t of this.Wr)t(1)}static C(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}
|
|
1380
1380
|
/**
|
|
1381
1381
|
* @license
|
|
1382
1382
|
* Copyright 2020 Google LLC
|
|
@@ -1392,7 +1392,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1392
1392
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1393
1393
|
* See the License for the specific language governing permissions and
|
|
1394
1394
|
* limitations under the License.
|
|
1395
|
-
*/const
|
|
1395
|
+
*/const Sl={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};
|
|
1396
1396
|
/**
|
|
1397
1397
|
* @license
|
|
1398
1398
|
* Copyright 2017 Google LLC
|
|
@@ -1408,7 +1408,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1408
1408
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1409
1409
|
* See the License for the specific language governing permissions and
|
|
1410
1410
|
* limitations under the License.
|
|
1411
|
-
*/class
|
|
1411
|
+
*/class El{constructor(t){this.Hr=t.Hr,this.Jr=t.Jr}Yr(t){this.Xr=t}Zr(t){this.eo=t}onMessage(t){this.no=t}close(){this.Jr()}send(t){this.Hr(t)}so(){this.Xr()}io(t){this.eo(t)}ro(t){this.no(t)}}
|
|
1412
1412
|
/**
|
|
1413
1413
|
* @license
|
|
1414
1414
|
* Copyright 2017 Google LLC
|
|
@@ -1424,7 +1424,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1424
1424
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1425
1425
|
* See the License for the specific language governing permissions and
|
|
1426
1426
|
* limitations under the License.
|
|
1427
|
-
*/class
|
|
1427
|
+
*/class Il extends class{constructor(t){this.databaseInfo=t,this.databaseId=t.databaseId;const e=t.ssl?"https":"http";this.oo=e+"://"+t.host,this.uo="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}get co(){return!1}ao(t,e,n,r,i){const s=this.ho(t,e);cs("RestConnection","Sending: ",s,n);const o={};return this.lo(o,r,i),this.fo(t,s,o,n).then((t=>(cs("RestConnection","Received: ",t),t)),(e=>{throw us("RestConnection",`${t} failed with error: `,e,"url: ",s,"request:",n),e}))}_o(t,e,n,r,i,s){return this.ao(t,e,n,r,i)}lo(t,e,n){t["X-Goog-Api-Client"]="gl-js/ fire/"+ss,t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),e&&e.headers.forEach(((e,n)=>t[n]=e)),n&&n.headers.forEach(((e,n)=>t[n]=e))}ho(t,e){const n=Sl[t];return`${this.oo}/v1/${e}:${n}`}}{constructor(t){super(t),this.forceLongPolling=t.forceLongPolling,this.autoDetectLongPolling=t.autoDetectLongPolling,this.useFetchStreams=t.useFetchStreams}fo(t,e,n,r){return new Promise(((i,s)=>{const o=new ns;o.setWithCredentials(!0),o.listenOnce(Yi.COMPLETE,(()=>{try{switch(o.getLastErrorCode()){case Qi.NO_ERROR:const e=o.getResponseJson();cs("Connection","XHR received:",JSON.stringify(e)),i(e);break;case Qi.TIMEOUT:cs("Connection",'RPC "'+t+'" timed out'),s(new ms(gs.DEADLINE_EXCEEDED,"Request time out"));break;case Qi.HTTP_ERROR:const n=o.getStatus();if(cs("Connection",'RPC "'+t+'" failed with status:',n,"response text:",o.getResponseText()),n>0){let t=o.getResponseJson();Array.isArray(t)&&(t=t[0]);const e=null==t?void 0:t.error;if(e&&e.status&&e.message){const t=function(t){const e=t.toLowerCase().replace(/_/g,"-");return Object.values(gs).indexOf(e)>=0?e:gs.UNKNOWN}(e.status);s(new ms(t,e.message))}else s(new ms(gs.UNKNOWN,"Server responded with status "+o.getStatus()))}else s(new ms(gs.UNAVAILABLE,"Connection failed."));break;default:ds()}}finally{cs("Connection",'RPC "'+t+'" completed.')}}));const a=JSON.stringify(r);o.send(e,"POST",a,n,15)}))}wo(t,e,n){const r=[this.oo,"/","google.firestore.v1.Firestore","/",t,"/channel"],i=new qi,s=Hn(),o={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(o.xmlHttpFactory=new ts({})),this.lo(o.initMessageHeaders,e,n),o.encodeInitMessageHeaders=!0;const a=r.join("");cs("Connection","Creating WebChannel: "+a,o);const c=i.createWebChannel(a,o);let l=!1,u=!1;const h=new El({Hr:t=>{u?cs("Connection","Not sending because WebChannel is closed:",t):(l||(cs("Connection","Opening WebChannel transport."),c.open(),l=!0),cs("Connection","WebChannel sending:",t),c.send(t))},Jr:()=>c.close()}),d=(t,e,n)=>{t.listen(e,(t=>{try{n(t)}catch(t){setTimeout((()=>{throw t}),0)}}))};return d(c,es.EventType.OPEN,(()=>{u||cs("Connection","WebChannel transport opened.")})),d(c,es.EventType.CLOSE,(()=>{u||(u=!0,cs("Connection","WebChannel transport closed"),h.io())})),d(c,es.EventType.ERROR,(t=>{u||(u=!0,us("Connection","WebChannel transport errored:",t),h.io(new ms(gs.UNAVAILABLE,"The operation could not be completed")))})),d(c,es.EventType.MESSAGE,(t=>{var e;if(!u){const n=t.data[0];fs(!!n);const r=n,i=r.error||(null===(e=r[0])||void 0===e?void 0:e.error);if(i){cs("Connection","WebChannel received error:",i);const t=i.status;let e=function(t){const e=Ga[t];if(void 0!==e)return Qa(e)}(t),n=i.message;void 0===e&&(e=gs.INTERNAL,n="Unknown error status: "+t+" with message "+i.message),u=!0,h.io(new ms(e,n)),c.close()}else cs("Connection","WebChannel received:",n),h.ro(n)}})),d(s,Ji.STAT_EVENT,(t=>{t.stat===Xi?cs("Connection","Detected buffering proxy"):t.stat===Zi&&cs("Connection","Detected no buffering proxy")})),setTimeout((()=>{h.so()}),0),h}}function Tl(){return"undefined"!=typeof document?document:null}
|
|
1428
1428
|
/**
|
|
1429
1429
|
* @license
|
|
1430
1430
|
* Copyright 2020 Google LLC
|
|
@@ -1440,7 +1440,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1440
1440
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1441
1441
|
* See the License for the specific language governing permissions and
|
|
1442
1442
|
* limitations under the License.
|
|
1443
|
-
*/function
|
|
1443
|
+
*/function kl(t){return new _c(t,!0)}class Cl{constructor(t,e,n=1e3,r=1.5,i=6e4){this.Hs=t,this.timerId=e,this.mo=n,this.yo=r,this.po=i,this.Io=0,this.To=null,this.Eo=Date.now(),this.reset()}reset(){this.Io=0}Ao(){this.Io=this.po}Ro(t){this.cancel();const e=Math.floor(this.Io+this.bo()),n=Math.max(0,Date.now()-this.Eo),r=Math.max(0,e-n);r>0&&cs("ExponentialBackoff",`Backing off for ${r} ms (base delay: ${this.Io} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),this.To=this.Hs.enqueueAfterDelay(this.timerId,r,(()=>(this.Eo=Date.now(),t()))),this.Io*=this.yo,this.Io<this.mo&&(this.Io=this.mo),this.Io>this.po&&(this.Io=this.po)}Po(){null!==this.To&&(this.To.skipDelay(),this.To=null)}cancel(){null!==this.To&&(this.To.cancel(),this.To=null)}bo(){return(Math.random()-.5)*this.Io}}
|
|
1444
1444
|
/**
|
|
1445
1445
|
* @license
|
|
1446
1446
|
* Copyright 2017 Google LLC
|
|
@@ -1456,7 +1456,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1456
1456
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1457
1457
|
* See the License for the specific language governing permissions and
|
|
1458
1458
|
* limitations under the License.
|
|
1459
|
-
*/class
|
|
1459
|
+
*/class Al{constructor(t,e,n,r,i,s,o,a){this.Hs=t,this.vo=n,this.Vo=r,this.connection=i,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=o,this.listener=a,this.state=0,this.So=0,this.Do=null,this.Co=null,this.stream=null,this.xo=new Cl(t,e)}No(){return 1===this.state||5===this.state||this.ko()}ko(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.Oo()}async stop(){this.No()&&await this.close(0)}Mo(){this.state=0,this.xo.reset()}Fo(){this.ko()&&null===this.Do&&(this.Do=this.Hs.enqueueAfterDelay(this.vo,6e4,(()=>this.$o())))}Bo(t){this.Lo(),this.stream.send(t)}async $o(){if(this.ko())return this.close(0)}Lo(){this.Do&&(this.Do.cancel(),this.Do=null)}qo(){this.Co&&(this.Co.cancel(),this.Co=null)}async close(t,e){this.Lo(),this.qo(),this.xo.cancel(),this.So++,4!==t?this.xo.reset():e&&e.code===gs.RESOURCE_EXHAUSTED?(ls(e.toString()),ls("Using maximum backoff delay to prevent overloading the backend."),this.xo.Ao()):e&&e.code===gs.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.Uo(),this.stream.close(),this.stream=null),this.state=t,await this.listener.Zr(e)}Uo(){}auth(){this.state=1;const t=this.Ko(this.So),e=this.So;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((([t,n])=>{this.So===e&&this.Go(t,n)}),(e=>{t((()=>{const t=new ms(gs.UNKNOWN,"Fetching auth token failed: "+e.message);return this.Qo(t)}))}))}Go(t,e){const n=this.Ko(this.So);this.stream=this.jo(t,e),this.stream.Yr((()=>{n((()=>(this.state=2,this.Co=this.Hs.enqueueAfterDelay(this.Vo,1e4,(()=>(this.ko()&&(this.state=3),Promise.resolve()))),this.listener.Yr())))})),this.stream.Zr((t=>{n((()=>this.Qo(t)))})),this.stream.onMessage((t=>{n((()=>this.onMessage(t)))}))}Oo(){this.state=5,this.xo.Ro((async()=>{this.state=0,this.start()}))}Qo(t){return cs("PersistentStream",`close with error: ${t}`),this.stream=null,this.close(4,t)}Ko(t){return e=>{this.Hs.enqueueAndForget((()=>this.So===t?e():(cs("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class Rl extends Al{constructor(t,e,n,r,i,s){super(t,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",e,n,r,s),this.yt=i}jo(t,e){return this.connection.wo("Listen",t,e)}onMessage(t){this.xo.reset();const e=function(t,e){let n;if("targetChange"in e){e.targetChange;const r=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:ds()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],s=function(t,e){return t.wt?(fs(void 0===e||"string"==typeof e),Zs.fromBase64String(e||"")):(fs(void 0===e||e instanceof Uint8Array),Zs.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(t){const e=void 0===t.code?gs.UNKNOWN:Qa(t.code);return new ms(e,t.message||"")}(o);n=new fc(r,i,s,a||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const i=Cc(t,r.document.name),s=Ic(r.document.updateTime),o=r.document.createTime?Ic(r.document.createTime):Ls.min(),a=new Yo({mapValue:{fields:r.document.fields}}),c=Jo.newFoundDocument(i,s,o,a),l=r.targetIds||[],u=r.removedTargetIds||[];n=new hc(l,u,c.key,c)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const i=Cc(t,r.document),s=r.readTime?Ic(r.readTime):Ls.min(),o=Jo.newNoDocument(i,s),a=r.removedTargetIds||[];n=new hc([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const i=Cc(t,r.document),s=r.removedTargetIds||[];n=new hc([],s,i,null)}else{if(!("filter"in e))return ds();{e.filter;const t=e.filter;t.targetId;const r=t.count||0,i=new Ka(r),s=t.targetId;n=new dc(s,i)}}return n}(this.yt,t),n=function(t){if(!("targetChange"in t))return Ls.min();const e=t.targetChange;return e.targetIds&&e.targetIds.length?Ls.min():e.readTime?Ic(e.readTime):Ls.min()}(t);return this.listener.Wo(e,n)}zo(t){const e={};e.database=Rc(this.yt),e.addTarget=function(t,e){let n;const r=e.target;return n=na(r)?{documents:Lc(t,r)}:{query:Oc(t,r)},n.targetId=e.targetId,e.resumeToken.approximateByteSize()>0?n.resumeToken=Ec(t,e.resumeToken):e.snapshotVersion.compareTo(Ls.min())>0&&(n.readTime=Sc(t,e.snapshotVersion.toTimestamp())),n}(this.yt,t);const n=function(t,e){const n=function(t,e){switch(e){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return ds()}}(0,e.purpose);return null==n?null:{"goog-listen-tags":n}}(this.yt,t);n&&(e.labels=n),this.Bo(e)}Ho(t){const e={};e.database=Rc(this.yt),e.removeTarget=t,this.Bo(e)}}
|
|
1460
1460
|
/**
|
|
1461
1461
|
* @license
|
|
1462
1462
|
* Copyright 2017 Google LLC
|
|
@@ -1472,7 +1472,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1472
1472
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1473
1473
|
* See the License for the specific language governing permissions and
|
|
1474
1474
|
* limitations under the License.
|
|
1475
|
-
*/class
|
|
1475
|
+
*/class Nl extends class{}{constructor(t,e,n,r){super(),this.authCredentials=t,this.appCheckCredentials=e,this.connection=n,this.yt=r,this.nu=!1}su(){if(this.nu)throw new ms(gs.FAILED_PRECONDITION,"The client has already been terminated.")}ao(t,e,n){return this.su(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([r,i])=>this.connection.ao(t,e,n,r,i))).catch((t=>{throw"FirebaseError"===t.name?(t.code===gs.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),t):new ms(gs.UNKNOWN,t.toString())}))}_o(t,e,n,r){return this.su(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([i,s])=>this.connection._o(t,e,n,i,s,r))).catch((t=>{throw"FirebaseError"===t.name?(t.code===gs.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),t):new ms(gs.UNKNOWN,t.toString())}))}terminate(){this.nu=!0}}class Ll{constructor(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state="Unknown",this.iu=0,this.ru=null,this.ou=!0}uu(){0===this.iu&&(this.cu("Unknown"),this.ru=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this.ru=null,this.au("Backend didn't respond within 10 seconds."),this.cu("Offline"),Promise.resolve()))))}hu(t){"Online"===this.state?this.cu("Unknown"):(this.iu++,this.iu>=1&&(this.lu(),this.au(`Connection failed 1 times. Most recent error: ${t.toString()}`),this.cu("Offline")))}set(t){this.lu(),this.iu=0,"Online"===t&&(this.ou=!1),this.cu(t)}cu(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))}au(t){const e=`Could not reach Cloud Firestore backend. ${t}\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.ou?(ls(e),this.ou=!1):cs("OnlineStateTracker",e)}lu(){null!==this.ru&&(this.ru.cancel(),this.ru=null)}}
|
|
1476
1476
|
/**
|
|
1477
1477
|
* @license
|
|
1478
1478
|
* Copyright 2017 Google LLC
|
|
@@ -1488,7 +1488,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1488
1488
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1489
1489
|
* See the License for the specific language governing permissions and
|
|
1490
1490
|
* limitations under the License.
|
|
1491
|
-
*/class
|
|
1491
|
+
*/class Ol{constructor(t,e,n,r,i){this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.fu=[],this.du=new Map,this._u=new Set,this.wu=[],this.mu=i,this.mu.Ur((t=>{n.enqueueAndForget((async()=>{Vl(this)&&(cs("RemoteStore","Restarting streams for network reachability change."),await async function(t){const e=ps(t);e._u.add(4),await xl(e),e.gu.set("Unknown"),e._u.delete(4),await Dl(e)}(this))}))})),this.gu=new Ll(n,r)}}async function Dl(t){if(Vl(t))for(const e of t.wu)await e(!0)}async function xl(t){for(const e of t.wu)await e(!1)}function Pl(t,e){const n=ps(t);n.du.has(e.targetId)||(n.du.set(e.targetId,e),Bl(n)?zl(n):Wl(n).ko()&&Ul(n,e))}function Ml(t,e){const n=ps(t),r=Wl(n);n.du.delete(e),r.ko()&&Fl(n,e),0===n.du.size&&(r.ko()?r.Fo():Vl(n)&&n.gu.set("Unknown"))}function Ul(t,e){t.yu.Ot(e.targetId),Wl(t).zo(e)}function Fl(t,e){t.yu.Ot(e),Wl(t).Ho(e)}function zl(t){t.yu=new gc({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),ne:e=>t.du.get(e)||null}),Wl(t).start(),t.gu.uu()}function Bl(t){return Vl(t)&&!Wl(t).No()&&t.du.size>0}function Vl(t){return 0===ps(t)._u.size}function Hl(t){t.yu=void 0}async function jl(t){t.du.forEach(((e,n)=>{Ul(t,e)}))}async function ql(t,e){Hl(t),Bl(t)?(t.gu.hu(e),zl(t)):t.gu.set("Unknown")}async function $l(t,e,n){if(t.gu.set("Online"),e instanceof fc&&2===e.state&&e.cause)try{await async function(t,e){const n=e.cause;for(const r of e.targetIds)t.du.has(r)&&(await t.remoteSyncer.rejectListen(r,n),t.du.delete(r),t.yu.removeTarget(r))}(t,e)}catch(n){cs("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),n),await Kl(t,n)}else if(e instanceof hc?t.yu.Kt(e):e instanceof dc?t.yu.Jt(e):t.yu.jt(e),!n.isEqual(Ls.min()))try{const e=await pl(t.localStore);n.compareTo(e)>=0&&await function(t,e){const n=t.yu.Zt(e);return n.targetChanges.forEach(((n,r)=>{if(n.resumeToken.approximateByteSize()>0){const i=t.du.get(r);i&&t.du.set(r,i.withResumeToken(n.resumeToken,e))}})),n.targetMismatches.forEach((e=>{const n=t.du.get(e);if(!n)return;t.du.set(e,n.withResumeToken(Zs.EMPTY_BYTE_STRING,n.snapshotVersion)),Fl(t,e);const r=new qc(n.target,e,1,n.sequenceNumber);Ul(t,r)})),t.remoteSyncer.applyRemoteEvent(n)}(t,n)}catch(e){cs("RemoteStore","Failed to raise snapshot:",e),await Kl(t,e)}}async function Kl(t,e,n){if(!qs(e))throw e;t._u.add(1),await xl(t),t.gu.set("Offline"),n||(n=()=>pl(t.localStore)),t.asyncQueue.enqueueRetryable((async()=>{cs("RemoteStore","Retrying IndexedDB access"),await n(),t._u.delete(1),await Dl(t)}))}async function Gl(t,e){const n=ps(t);n.asyncQueue.verifyOperationInProgress(),cs("RemoteStore","RemoteStore received new credentials");const r=Vl(n);n._u.add(3),await xl(n),r&&n.gu.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n._u.delete(3),await Dl(n)}function Wl(t){return t.pu||(t.pu=function(t,e,n){const r=ps(t);return r.su(),new Rl(e,r.connection,r.authCredentials,r.appCheckCredentials,r.yt,n)
|
|
1492
1492
|
/**
|
|
1493
1493
|
* @license
|
|
1494
1494
|
* Copyright 2018 Google LLC
|
|
@@ -1504,7 +1504,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1504
1504
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1505
1505
|
* See the License for the specific language governing permissions and
|
|
1506
1506
|
* limitations under the License.
|
|
1507
|
-
*/}(
|
|
1507
|
+
*/}(t.datastore,t.asyncQueue,{Yr:jl.bind(null,t),Zr:ql.bind(null,t),Wo:$l.bind(null,t)}),t.wu.push((async e=>{e?(t.pu.Mo(),Bl(t)?zl(t):t.gu.set("Unknown")):(await t.pu.stop(),Hl(t))}))),t.pu
|
|
1508
1508
|
/**
|
|
1509
1509
|
* @license
|
|
1510
1510
|
* Copyright 2017 Google LLC
|
|
@@ -1520,7 +1520,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1520
1520
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1521
1521
|
* See the License for the specific language governing permissions and
|
|
1522
1522
|
* limitations under the License.
|
|
1523
|
-
*/}class
|
|
1523
|
+
*/}class Ql{constructor(t,e,n,r,i){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new ys,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((t=>{}))}static createAndSchedule(t,e,n,r,i){const s=Date.now()+n,o=new Ql(t,e,s,r,i);return o.start(n),o}start(t){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),t)}skipDelay(){return this.handleDelayElapsed()}cancel(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new ms(gs.CANCELLED,"Operation cancelled"+(t?": "+t:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then((t=>this.deferred.resolve(t)))):Promise.resolve()))}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function Yl(t,e){if(ls("AsyncQueue",`${e}: ${t}`),qs(t))return new ms(gs.UNAVAILABLE,`${e}: ${t}`);throw t}
|
|
1524
1524
|
/**
|
|
1525
1525
|
* @license
|
|
1526
1526
|
* Copyright 2017 Google LLC
|
|
@@ -1536,7 +1536,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1536
1536
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1537
1537
|
* See the License for the specific language governing permissions and
|
|
1538
1538
|
* limitations under the License.
|
|
1539
|
-
*/class
|
|
1539
|
+
*/class Jl{constructor(t){this.comparator=t?(e,n)=>t(e,n)||Ms.comparator(e.key,n.key):(t,e)=>Ms.comparator(t.key,e.key),this.keyedMap=tc(),this.sortedSet=new qo(this.comparator)}static emptySet(t){return new Jl(t.comparator)}has(t){return null!=this.keyedMap.get(t)}get(t){return this.keyedMap.get(t)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(t){const e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1}get size(){return this.sortedSet.size}forEach(t){this.sortedSet.inorderTraversal(((e,n)=>(t(e),!1)))}add(t){const e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))}delete(t){const e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(e)):this}isEqual(t){if(!(t instanceof Jl))return!1;if(this.size!==t.size)return!1;const e=this.sortedSet.getIterator(),n=t.sortedSet.getIterator();for(;e.hasNext();){const t=e.getNext().key,r=n.getNext().key;if(!t.isEqual(r))return!1}return!0}toString(){const t=[];return this.forEach((e=>{t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n "+t.join(" \n")+"\n)"}copy(t,e){const n=new Jl;return n.comparator=this.comparator,n.keyedMap=t,n.sortedSet=e,n}}
|
|
1540
1540
|
/**
|
|
1541
1541
|
* @license
|
|
1542
1542
|
* Copyright 2017 Google LLC
|
|
@@ -1552,7 +1552,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1552
1552
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1553
1553
|
* See the License for the specific language governing permissions and
|
|
1554
1554
|
* limitations under the License.
|
|
1555
|
-
*/class
|
|
1555
|
+
*/class Xl{constructor(){this.Tu=new qo(Ms.comparator)}track(t){const e=t.doc.key,n=this.Tu.get(e);n?0!==t.type&&3===n.type?this.Tu=this.Tu.insert(e,t):3===t.type&&1!==n.type?this.Tu=this.Tu.insert(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.Tu=this.Tu.insert(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.Tu=this.Tu.insert(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.Tu=this.Tu.remove(e):1===t.type&&2===n.type?this.Tu=this.Tu.insert(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.Tu=this.Tu.insert(e,{type:2,doc:t.doc}):ds():this.Tu=this.Tu.insert(e,t)}Eu(){const t=[];return this.Tu.inorderTraversal(((e,n)=>{t.push(n)})),t}}class Zl{constructor(t,e,n,r,i,s,o,a,c){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=s,this.syncStateChanged=o,this.excludesMetadataChanges=a,this.hasCachedResults=c}static fromInitialDocuments(t,e,n,r,i){const s=[];return e.forEach((t=>{s.push({type:0,doc:t})})),new Zl(t,e,Jl.emptySet(e),s,n,r,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(t){if(!(this.fromCache===t.fromCache&&this.hasCachedResults===t.hasCachedResults&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&fa(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;const e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].type!==n[t].type||!e[t].doc.isEqual(n[t].doc))return!1;return!0}}
|
|
1556
1556
|
/**
|
|
1557
1557
|
* @license
|
|
1558
1558
|
* Copyright 2017 Google LLC
|
|
@@ -1568,7 +1568,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1568
1568
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1569
1569
|
* See the License for the specific language governing permissions and
|
|
1570
1570
|
* limitations under the License.
|
|
1571
|
-
*/class
|
|
1571
|
+
*/class tu{constructor(){this.Au=void 0,this.listeners=[]}}class eu{constructor(){this.queries=new Ya((t=>pa(t)),fa),this.onlineState="Unknown",this.Ru=new Set}}async function nu(t,e){const n=ps(t),r=e.query;let i=!1,s=n.queries.get(r);if(s||(i=!0,s=new tu),i)try{s.Au=await n.onListen(r)}catch(t){const n=Yl(t,`Initialization of query '${ga(e.query)}' failed`);return void e.onError(n)}n.queries.set(r,s),s.listeners.push(e),e.bu(n.onlineState),s.Au&&e.Pu(s.Au)&&ou(n)}async function ru(t,e){const n=ps(t),r=e.query;let i=!1;const s=n.queries.get(r);if(s){const t=s.listeners.indexOf(e);t>=0&&(s.listeners.splice(t,1),i=0===s.listeners.length)}if(i)return n.queries.delete(r),n.onUnlisten(r)}function iu(t,e){const n=ps(t);let r=!1;for(const t of e){const e=t.query,i=n.queries.get(e);if(i){for(const e of i.listeners)e.Pu(t)&&(r=!0);i.Au=t}}r&&ou(n)}function su(t,e,n){const r=ps(t),i=r.queries.get(e);if(i)for(const t of i.listeners)t.onError(n);r.queries.delete(e)}function ou(t){t.Ru.forEach((t=>{t.next()}))}class au{constructor(t,e,n){this.query=t,this.vu=e,this.Vu=!1,this.Su=null,this.onlineState="Unknown",this.options=n||{}}Pu(t){if(!this.options.includeMetadataChanges){const e=[];for(const n of t.docChanges)3!==n.type&&e.push(n);t=new Zl(t.query,t.docs,t.oldDocs,e,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0,t.hasCachedResults)}let e=!1;return this.Vu?this.Du(t)&&(this.vu.next(t),e=!0):this.Cu(t,this.onlineState)&&(this.xu(t),e=!0),this.Su=t,e}onError(t){this.vu.error(t)}bu(t){this.onlineState=t;let e=!1;return this.Su&&!this.Vu&&this.Cu(this.Su,t)&&(this.xu(this.Su),e=!0),e}Cu(t,e){if(!t.fromCache)return!0;const n="Offline"!==e;return(!this.options.Nu||!n)&&(!t.docs.isEmpty()||t.hasCachedResults||"Offline"===e)}Du(t){if(t.docChanges.length>0)return!0;const e=this.Su&&this.Su.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!e)&&!0===this.options.includeMetadataChanges}xu(t){t=Zl.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache,t.hasCachedResults),this.Vu=!0,this.vu.next(t)}}
|
|
1572
1572
|
/**
|
|
1573
1573
|
* @license
|
|
1574
1574
|
* Copyright 2017 Google LLC
|
|
@@ -1584,7 +1584,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1584
1584
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1585
1585
|
* See the License for the specific language governing permissions and
|
|
1586
1586
|
* limitations under the License.
|
|
1587
|
-
*/class
|
|
1587
|
+
*/class cu{constructor(t){this.key=t}}class lu{constructor(t){this.key=t}}class uu{constructor(t,e){this.query=t,this.qu=e,this.Uu=null,this.hasCachedResults=!1,this.current=!1,this.Ku=oc(),this.mutatedKeys=oc(),this.Gu=ya(t),this.Qu=new Jl(this.Gu)}get ju(){return this.qu}Wu(t,e){const n=e?e.zu:new Xl,r=e?e.Qu:this.Qu;let i=e?e.mutatedKeys:this.mutatedKeys,s=r,o=!1;const a="F"===this.query.limitType&&r.size===this.query.limit?r.last():null,c="L"===this.query.limitType&&r.size===this.query.limit?r.first():null;if(t.inorderTraversal(((t,e)=>{const l=r.get(t),u=ma(this.query,e)?e:null,h=!!l&&this.mutatedKeys.has(l.key),d=!!u&&(u.hasLocalMutations||this.mutatedKeys.has(u.key)&&u.hasCommittedMutations);let f=!1;l&&u?l.data.isEqual(u.data)?h!==d&&(n.track({type:3,doc:u}),f=!0):this.Hu(l,u)||(n.track({type:2,doc:u}),f=!0,(a&&this.Gu(u,a)>0||c&&this.Gu(u,c)<0)&&(o=!0)):!l&&u?(n.track({type:0,doc:u}),f=!0):l&&!u&&(n.track({type:1,doc:l}),f=!0,(a||c)&&(o=!0)),f&&(u?(s=s.add(u),i=d?i.add(t):i.delete(t)):(s=s.delete(t),i=i.delete(t)))})),null!==this.query.limit)for(;s.size>this.query.limit;){const t="F"===this.query.limitType?s.last():s.first();s=s.delete(t.key),i=i.delete(t.key),n.track({type:1,doc:t})}return{Qu:s,zu:n,$i:o,mutatedKeys:i}}Hu(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations}applyChanges(t,e,n){const r=this.Qu;this.Qu=t.Qu,this.mutatedKeys=t.mutatedKeys;const i=t.zu.Eu();i.sort(((t,e)=>function(t,e){const n=t=>{switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ds()}};return n(t)-n(e)}
|
|
1588
1588
|
/**
|
|
1589
1589
|
* @license
|
|
1590
1590
|
* Copyright 2020 Google LLC
|
|
@@ -1600,7 +1600,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1600
1600
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1601
1601
|
* See the License for the specific language governing permissions and
|
|
1602
1602
|
* limitations under the License.
|
|
1603
|
-
*/(
|
|
1603
|
+
*/(t.type,e.type)||this.Gu(t.doc,e.doc))),this.Ju(n);const s=e?this.Yu():[],o=0===this.Ku.size&&this.current?1:0,a=o!==this.Uu;return this.Uu=o,0!==i.length||a?{snapshot:new Zl(this.query,t.Qu,r,i,t.mutatedKeys,0===o,a,!1,!!n&&n.resumeToken.approximateByteSize()>0),Xu:s}:{Xu:s}}bu(t){return this.current&&"Offline"===t?(this.current=!1,this.applyChanges({Qu:this.Qu,zu:new Xl,mutatedKeys:this.mutatedKeys,$i:!1},!1)):{Xu:[]}}Zu(t){return!this.qu.has(t)&&!!this.Qu.has(t)&&!this.Qu.get(t).hasLocalMutations}Ju(t){t&&(t.addedDocuments.forEach((t=>this.qu=this.qu.add(t))),t.modifiedDocuments.forEach((t=>{})),t.removedDocuments.forEach((t=>this.qu=this.qu.delete(t))),this.current=t.current)}Yu(){if(!this.current)return[];const t=this.Ku;this.Ku=oc(),this.Qu.forEach((t=>{this.Zu(t.key)&&(this.Ku=this.Ku.add(t.key))}));const e=[];return t.forEach((t=>{this.Ku.has(t)||e.push(new lu(t))})),this.Ku.forEach((n=>{t.has(n)||e.push(new cu(n))})),e}tc(t){this.qu=t.Hi,this.Ku=oc();const e=this.Wu(t.documents);return this.applyChanges(e,!0)}ec(){return Zl.fromInitialDocuments(this.query,this.Qu,this.mutatedKeys,0===this.Uu,this.hasCachedResults)}}class hu{constructor(t,e,n){this.query=t,this.targetId=e,this.view=n}}class du{constructor(t){this.key=t,this.nc=!1}}class fu{constructor(t,e,n,r,i,s){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=s,this.sc={},this.ic=new Ya((t=>pa(t)),fa),this.rc=new Map,this.oc=new Set,this.uc=new qo(Ms.comparator),this.cc=new Map,this.ac=new el,this.hc={},this.lc=new Map,this.fc=Qc.vn(),this.onlineState="Unknown",this.dc=void 0}get isPrimaryClient(){return!0===this.dc}}async function pu(t,e){const n=function(t){const e=ps(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=mu.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=ku.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=vu.bind(null,e),e.sc.Wo=iu.bind(null,e.eventManager),e.sc.wc=su.bind(null,e.eventManager),e}(t);let r,i;const s=n.ic.get(e);if(s)r=s.targetId,n.sharedClientState.addLocalQueryTarget(r),i=s.view.ec();else{const t=await function(t,e){const n=ps(t);return n.persistence.runTransaction("Allocate target","readwrite",(t=>{let r;return n.Cs.getTargetData(t,e).next((i=>i?(r=i,js.resolve(r)):n.Cs.allocateTargetId(t).next((i=>(r=new qc(e,i,0,t.currentSequenceNumber),n.Cs.addTargetData(t,r).next((()=>r)))))))})).then((t=>{const r=n.qi.get(t.targetId);return(null===r||t.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.qi=n.qi.insert(t.targetId,t),n.Ui.set(e,t.targetId)),t}))}(n.localStore,ua(e));n.isPrimaryClient&&Pl(n.remoteStore,t);const s=n.sharedClientState.addLocalQueryTarget(t.targetId);r=t.targetId,i=await async function(t,e,n,r,i){t._c=(e,n,r)=>async function(t,e,n,r){let i=e.view.Wu(n);i.$i&&(i=await yl(t.localStore,e.query,!1).then((({documents:t})=>e.view.Wu(t,i))));const s=r&&r.targetChanges.get(e.targetId),o=e.view.applyChanges(i,t.isPrimaryClient,s);return _u(t,e.targetId,o.Xu),o.snapshot}(t,e,n,r);const s=await yl(t.localStore,e,!0),o=new uu(e,s.Hi),a=o.Wu(s.documents),c=uc.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==t.onlineState,i),l=o.applyChanges(a,t.isPrimaryClient,c);_u(t,n,l.Xu);const u=new hu(e,n,o);return t.ic.set(e,u),t.rc.has(n)?t.rc.get(n).push(e):t.rc.set(n,[e]),l.snapshot}(n,e,r,"current"===s,t.resumeToken)}return i}async function gu(t,e){const n=ps(t),r=n.ic.get(e),i=n.rc.get(r.targetId);if(i.length>1)return n.rc.set(r.targetId,i.filter((t=>!fa(t,e)))),void n.ic.delete(e);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(r.targetId),n.sharedClientState.isActiveQueryTarget(r.targetId)||await ml(n.localStore,r.targetId,!1).then((()=>{n.sharedClientState.clearQueryState(r.targetId),Ml(n.remoteStore,r.targetId),wu(n,r.targetId)})).catch(Hs)):(wu(n,r.targetId),await ml(n.localStore,r.targetId,!0))}async function mu(t,e){const n=ps(t);try{const t=await gl(n.localStore,e);e.targetChanges.forEach(((t,e)=>{const r=n.cc.get(e);r&&(fs(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1),t.addedDocuments.size>0?r.nc=!0:t.modifiedDocuments.size>0?fs(r.nc):t.removedDocuments.size>0&&(fs(r.nc),r.nc=!1))})),await Iu(n,t,e)}catch(t){await Hs(t)}}function yu(t,e,n){const r=ps(t);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){const t=[];r.ic.forEach(((n,r)=>{const i=r.view.bu(e);i.snapshot&&t.push(i.snapshot)})),function(t,e){const n=ps(t);n.onlineState=e;let r=!1;n.queries.forEach(((t,n)=>{for(const t of n.listeners)t.bu(e)&&(r=!0)})),r&&ou(n)}(r.eventManager,e),t.length&&r.sc.Wo(t),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function vu(t,e,n){const r=ps(t);r.sharedClientState.updateQueryState(e,"rejected",n);const i=r.cc.get(e),s=i&&i.key;if(s){let t=new qo(Ms.comparator);t=t.insert(s,Jo.newNoDocument(s,Ls.min()));const n=oc().add(s),i=new lc(Ls.min(),new Map,new Go(As),t,n);await mu(r,i),r.uc=r.uc.remove(s),r.cc.delete(e),Eu(r)}else await ml(r.localStore,e,!1).then((()=>wu(r,e,n))).catch(Hs)}function wu(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.rc.get(e))t.ic.delete(r),n&&t.sc.wc(r,n);t.rc.delete(e),t.isPrimaryClient&&t.ac.ls(e).forEach((e=>{t.ac.containsKey(e)||bu(t,e)}))}function bu(t,e){t.oc.delete(e.path.canonicalString());const n=t.uc.get(e);null!==n&&(Ml(t.remoteStore,n),t.uc=t.uc.remove(e),t.cc.delete(n),Eu(t))}function _u(t,e,n){for(const r of n)r instanceof cu?(t.ac.addReference(r.key,e),Su(t,r)):r instanceof lu?(cs("SyncEngine","Document no longer in limbo: "+r.key),t.ac.removeReference(r.key,e),t.ac.containsKey(r.key)||bu(t,r.key)):ds()}function Su(t,e){const n=e.key,r=n.path.canonicalString();t.uc.get(n)||t.oc.has(r)||(cs("SyncEngine","New document in limbo: "+n),t.oc.add(r),Eu(t))}function Eu(t){for(;t.oc.size>0&&t.uc.size<t.maxConcurrentLimboResolutions;){const e=t.oc.values().next().value;t.oc.delete(e);const n=new Ms(Ds.fromString(e)),r=t.fc.next();t.cc.set(r,new du(n)),t.uc=t.uc.insert(n,r),Pl(t.remoteStore,new qc(ua(ia(n.path)),r,2,$s.at))}}async function Iu(t,e,n){const r=ps(t),i=[],s=[],o=[];r.ic.isEmpty()||(r.ic.forEach(((t,a)=>{o.push(r._c(a,e,n).then((t=>{if((t||n)&&r.isPrimaryClient&&r.sharedClientState.updateQueryState(a.targetId,(null==t?void 0:t.fromCache)?"not-current":"current"),t){i.push(t);const e=ul.Ci(a.targetId,t);s.push(e)}})))})),await Promise.all(o),r.sc.Wo(i),await async function(t,e){const n=ps(t);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(t=>js.forEach(e,(e=>js.forEach(e.Si,(r=>n.persistence.referenceDelegate.addReference(t,e.targetId,r))).next((()=>js.forEach(e.Di,(r=>n.persistence.referenceDelegate.removeReference(t,e.targetId,r)))))))))}catch(t){if(!qs(t))throw t;cs("LocalStore","Failed to update sequence numbers: "+t)}for(const t of e){const e=t.targetId;if(!t.fromCache){const t=n.qi.get(e),r=t.snapshotVersion,i=t.withLastLimboFreeSnapshotVersion(r);n.qi=n.qi.insert(e,i)}}}(r.localStore,s))}async function Tu(t,e){const n=ps(t);if(!n.currentUser.isEqual(e)){cs("SyncEngine","User change. New user:",e.toKey());const t=await fl(n.localStore,e);n.currentUser=e,function(t,e){t.lc.forEach((t=>{t.forEach((t=>{t.reject(new ms(gs.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.lc.clear()}(n),n.sharedClientState.handleUserChange(e,t.removedBatchIds,t.addedBatchIds),await Iu(n,t.ji)}}function ku(t,e){const n=ps(t),r=n.cc.get(e);if(r&&r.nc)return oc().add(r.key);{let t=oc();const r=n.rc.get(e);if(!r)return t;for(const e of r){const r=n.ic.get(e);t=t.unionWith(r.view.ju)}return t}}class Cu{constructor(){this.synchronizeTabs=!1}async initialize(t){this.yt=kl(t.databaseInfo.databaseId),this.sharedClientState=this.gc(t),this.persistence=this.yc(t),await this.persistence.start(),this.localStore=this.Ic(t),this.gcScheduler=this.Tc(t,this.localStore),this.indexBackfillerScheduler=this.Ec(t,this.localStore)}Tc(t,e){return null}Ec(t,e){return null}Ic(t){return function(t,e,n,r){return new dl(t,e,n,r)}(this.persistence,new hl,t.initialUser,this.yt)}yc(t){return new al(ll.Bs,this.yt)}gc(t){return new wl}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class Au{async initialize(t,e){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(e),this.remoteStore=this.createRemoteStore(e),this.eventManager=this.createEventManager(e),this.syncEngine=this.createSyncEngine(e,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=t=>yu(this.syncEngine,t,1),this.remoteStore.remoteSyncer.handleCredentialChange=Tu.bind(null,this.syncEngine),await async function(t,e){const n=ps(t);e?(n._u.delete(2),await Dl(n)):e||(n._u.add(2),await xl(n),n.gu.set("Unknown"))}(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(t){return new eu}createDatastore(t){const e=kl(t.databaseInfo.databaseId),n=(r=t.databaseInfo,new Il(r));var r;return function(t,e,n,r){return new Nl(t,e,n,r)}(t.authCredentials,t.appCheckCredentials,n,e)}createRemoteStore(t){return e=this.localStore,n=this.datastore,r=t.asyncQueue,i=t=>yu(this.syncEngine,t,0),s=_l.C()?new _l:new bl,new Ol(e,n,r,i,s);var e,n,r,i,s}createSyncEngine(t,e){return function(t,e,n,r,i,s,o){const a=new fu(t,e,n,r,i,s);return o&&(a.dc=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,e)}terminate(){return async function(t){const e=ps(t);cs("RemoteStore","RemoteStore shutting down."),e._u.add(5),await xl(e),e.mu.shutdown(),e.gu.set("Unknown")}(this.remoteStore)}}
|
|
1604
1604
|
/**
|
|
1605
1605
|
* @license
|
|
1606
1606
|
* Copyright 2017 Google LLC
|
|
@@ -1616,7 +1616,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1616
1616
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1617
1617
|
* See the License for the specific language governing permissions and
|
|
1618
1618
|
* limitations under the License.
|
|
1619
|
-
*/function
|
|
1619
|
+
*/function Ru(t,e,n){if(!n)throw new ms(gs.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function Nu(t){if(!Ms.isDocumentKey(t))throw new ms(gs.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function Lu(t){if(Ms.isDocumentKey(t))throw new ms(gs.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function Ou(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";{const e=function(t){return t.constructor?t.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return"function"==typeof t?"a function":ds()}function Du(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new ms(gs.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Ou(t);throw new ms(gs.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}
|
|
1620
1620
|
/**
|
|
1621
1621
|
* @license
|
|
1622
1622
|
* Copyright 2020 Google LLC
|
|
@@ -1632,7 +1632,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1632
1632
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1633
1633
|
* See the License for the specific language governing permissions and
|
|
1634
1634
|
* limitations under the License.
|
|
1635
|
-
*/const
|
|
1635
|
+
*/const xu=new Map;class Pu{constructor(t){var e;if(void 0===t.host){if(void 0!==t.ssl)throw new ms(gs.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=null===(e=t.ssl)||void 0===e||e;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,void 0===t.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new ms(gs.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.useFetchStreams=!!t.useFetchStreams,function(t,e,n,r){if(!0===e&&!0===r)throw new ms(gs.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}isEqual(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams}}
|
|
1636
1636
|
/**
|
|
1637
1637
|
* @license
|
|
1638
1638
|
* Copyright 2020 Google LLC
|
|
@@ -1648,7 +1648,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1648
1648
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1649
1649
|
* See the License for the specific language governing permissions and
|
|
1650
1650
|
* limitations under the License.
|
|
1651
|
-
*/class
|
|
1651
|
+
*/class Mu{constructor(t,e,n,r){this._authCredentials=t,this._appCheckCredentials=e,this._databaseId=n,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Pu({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new ms(gs.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return void 0!==this._terminateTask}_setSettings(t){if(this._settingsFrozen)throw new ms(gs.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Pu(t),void 0!==t.credentials&&(this._authCredentials=function(t){if(!t)return new ws;switch(t.type){case"gapi":const e=t.client;return new Es(e,t.sessionIndex||"0",t.iamToken||null,t.authTokenFactory||null);case"provider":return t.client;default:throw new ms(gs.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(t.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const e=xu.get(t);e&&(cs("ComponentProvider","Removing Datastore"),xu.delete(t),e.terminate())}(this),Promise.resolve()}}function Uu(t,e,n,r={}){var i;const o=(t=Du(t,Mu))._getSettings();if("firestore.googleapis.com"!==o.host&&o.host!==e&&us("Host has been set in both settings() and useEmulator(), emulator host will be used"),t._setSettings(Object.assign(Object.assign({},o),{host:`${e}:${n}`,ssl:!1})),r.mockUserToken){let e,n;if("string"==typeof r.mockUserToken)e=r.mockUserToken,n=is.MOCK_USER;else{e=function(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=e||"demo-project",r=t.iat||0,i=t.sub||t.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:r,exp:r+3600,auth_time:r,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},t);return[s(JSON.stringify({alg:"none",type:"JWT"})),s(JSON.stringify(o)),""].join(".")}
|
|
1652
1652
|
/**
|
|
1653
1653
|
* @license
|
|
1654
1654
|
* Copyright 2017 Google LLC
|
|
@@ -1664,7 +1664,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1664
1664
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1665
1665
|
* See the License for the specific language governing permissions and
|
|
1666
1666
|
* limitations under the License.
|
|
1667
|
-
*/(r.mockUserToken,null===(i=
|
|
1667
|
+
*/(r.mockUserToken,null===(i=t._app)||void 0===i?void 0:i.options.projectId);const o=r.mockUserToken.sub||r.mockUserToken.user_id;if(!o)throw new ms(gs.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new is(o)}t._authCredentials=new bs(new vs(e,n))}}
|
|
1668
1668
|
/**
|
|
1669
1669
|
* @license
|
|
1670
1670
|
* Copyright 2020 Google LLC
|
|
@@ -1680,7 +1680,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1680
1680
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1681
1681
|
* See the License for the specific language governing permissions and
|
|
1682
1682
|
* limitations under the License.
|
|
1683
|
-
*/class
|
|
1683
|
+
*/class Fu{constructor(t,e,n){this.converter=e,this._key=n,this.type="document",this.firestore=t}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Bu(this.firestore,this.converter,this._key.path.popLast())}withConverter(t){return new Fu(this.firestore,t,this._key)}}class zu{constructor(t,e,n){this.converter=e,this._query=n,this.type="query",this.firestore=t}withConverter(t){return new zu(this.firestore,t,this._query)}}class Bu extends zu{constructor(t,e,n){super(t,e,ia(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const t=this._path.popLast();return t.isEmpty()?null:new Fu(this.firestore,null,new Ms(t))}withConverter(t){return new Bu(this.firestore,t,this._path)}}function Vu(t,e,...n){if(t=I(t),Ru("collection","path",e),t instanceof Mu){const r=Ds.fromString(e,...n);return Lu(r),new Bu(t,null,r)}{if(!(t instanceof Fu||t instanceof Bu))throw new ms(gs.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(Ds.fromString(e,...n));return Lu(r),new Bu(t.firestore,null,r)}}function Hu(t,e,...n){if(t=I(t),1===arguments.length&&(e=Cs.R()),Ru("doc","path",e),t instanceof Mu){const r=Ds.fromString(e,...n);return Nu(r),new Fu(t,null,new Ms(r))}{if(!(t instanceof Fu||t instanceof Bu))throw new ms(gs.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(Ds.fromString(e,...n));return Nu(r),new Fu(t.firestore,t instanceof Bu?t.converter:null,new Ms(r))}}
|
|
1684
1684
|
/**
|
|
1685
1685
|
* @license
|
|
1686
1686
|
* Copyright 2020 Google LLC
|
|
@@ -1712,7 +1712,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1712
1712
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1713
1713
|
* See the License for the specific language governing permissions and
|
|
1714
1714
|
* limitations under the License.
|
|
1715
|
-
*/class
|
|
1715
|
+
*/class ju{constructor(t){this.observer=t,this.muted=!1}next(t){this.observer.next&&this.Rc(this.observer.next,t)}error(t){this.observer.error?this.Rc(this.observer.error,t):ls("Uncaught Error in snapshot listener:",t.toString())}bc(){this.muted=!0}Rc(t,e){this.muted||setTimeout((()=>{this.muted||t(e)}),0)}}
|
|
1716
1716
|
/**
|
|
1717
1717
|
* @license
|
|
1718
1718
|
* Copyright 2017 Google LLC
|
|
@@ -1728,7 +1728,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1728
1728
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1729
1729
|
* See the License for the specific language governing permissions and
|
|
1730
1730
|
* limitations under the License.
|
|
1731
|
-
*/class
|
|
1731
|
+
*/class qu{constructor(t,e,n,r){this.authCredentials=t,this.appCheckCredentials=e,this.asyncQueue=n,this.databaseInfo=r,this.user=is.UNAUTHENTICATED,this.clientId=Cs.R(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(n,(async t=>{cs("FirestoreClient","Received user=",t.uid),await this.authCredentialListener(t),this.user=t})),this.appCheckCredentials.start(n,(t=>(cs("FirestoreClient","Received new app check token=",t),this.appCheckCredentialListener(t,this.user))))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(t){this.authCredentialListener=t}setAppCheckTokenChangeListener(t){this.appCheckCredentialListener=t}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new ms(gs.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const t=new ys;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this.onlineComponents&&await this.onlineComponents.terminate(),this.offlineComponents&&await this.offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),t.resolve()}catch(e){const n=Yl(e,"Failed to shutdown persistence");t.reject(n)}})),t.promise}}async function $u(t,e){t.asyncQueue.verifyOperationInProgress();const n=await async function(t){return t.offlineComponents||(cs("FirestoreClient","Using default OfflineComponentProvider"),await async function(t,e){t.asyncQueue.verifyOperationInProgress(),cs("FirestoreClient","Initializing OfflineComponentProvider");const n=await t.getConfiguration();await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener((async t=>{r.isEqual(t)||(await fl(e.localStore,t),r=t)})),e.persistence.setDatabaseDeletedListener((()=>t.terminate())),t.offlineComponents=e}(t,new Cu)),t.offlineComponents}(t);cs("FirestoreClient","Initializing OnlineComponentProvider");const r=await t.getConfiguration();await e.initialize(n,r),t.setCredentialChangeListener((t=>Gl(e.remoteStore,t))),t.setAppCheckTokenChangeListener(((t,n)=>Gl(e.remoteStore,n))),t.onlineComponents=e}async function Ku(t){const e=await async function(t){return t.onlineComponents||(cs("FirestoreClient","Using default OnlineComponentProvider"),await $u(t,new Au)),t.onlineComponents}(t),n=e.eventManager;return n.onListen=pu.bind(null,e.syncEngine),n.onUnlisten=gu.bind(null,e.syncEngine),n}class Gu{constructor(){this.Bc=Promise.resolve(),this.Lc=[],this.qc=!1,this.Uc=[],this.Kc=null,this.Gc=!1,this.Qc=!1,this.jc=[],this.xo=new Cl(this,"async_queue_retry"),this.Wc=()=>{const t=Tl();t&&cs("AsyncQueue","Visibility state changed to "+t.visibilityState),this.xo.Po()};const t=Tl();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.Wc)}get isShuttingDown(){return this.qc}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.zc(),this.Hc(t)}enterRestrictedMode(t){if(!this.qc){this.qc=!0,this.Qc=t||!1;const e=Tl();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.Wc)}}enqueue(t){if(this.zc(),this.qc)return new Promise((()=>{}));const e=new ys;return this.Hc((()=>this.qc&&this.Qc?Promise.resolve():(t().then(e.resolve,e.reject),e.promise))).then((()=>e.promise))}enqueueRetryable(t){this.enqueueAndForget((()=>(this.Lc.push(t),this.Jc())))}async Jc(){if(0!==this.Lc.length){try{await this.Lc[0](),this.Lc.shift(),this.xo.reset()}catch(t){if(!qs(t))throw t;cs("AsyncQueue","Operation failed with retryable error: "+t)}this.Lc.length>0&&this.xo.Ro((()=>this.Jc()))}}Hc(t){const e=this.Bc.then((()=>(this.Gc=!0,t().catch((t=>{this.Kc=t,this.Gc=!1;const e=function(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}
|
|
1732
1732
|
/**
|
|
1733
1733
|
* @license
|
|
1734
1734
|
* Copyright 2017 Google LLC
|
|
@@ -1744,7 +1744,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1744
1744
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1745
1745
|
* See the License for the specific language governing permissions and
|
|
1746
1746
|
* limitations under the License.
|
|
1747
|
-
*/(
|
|
1747
|
+
*/(t);throw ls("INTERNAL UNHANDLED ERROR: ",e),t})).then((t=>(this.Gc=!1,t))))));return this.Bc=e,e}enqueueAfterDelay(t,e,n){this.zc(),this.jc.indexOf(t)>-1&&(e=0);const r=Ql.createAndSchedule(this,t,e,n,(t=>this.Yc(t)));return this.Uc.push(r),r}zc(){this.Kc&&ds()}verifyOperationInProgress(){}async Xc(){let t;do{t=this.Bc,await t}while(t!==this.Bc)}Zc(t){for(const e of this.Uc)if(e.timerId===t)return!0;return!1}ta(t){return this.Xc().then((()=>{this.Uc.sort(((t,e)=>t.targetTimeMs-e.targetTimeMs));for(const e of this.Uc)if(e.skipDelay(),"all"!==t&&e.timerId===t)break;return this.Xc()}))}ea(t){this.jc.push(t)}Yc(t){const e=this.Uc.indexOf(t);this.Uc.splice(e,1)}}function Wu(t){return function(t,e){if("object"!=typeof t||null===t)return!1;const n=t;for(const t of["next","error","complete"])if(t in n&&"function"==typeof n[t])return!0;return!1}
|
|
1748
1748
|
/**
|
|
1749
1749
|
* @license
|
|
1750
1750
|
* Copyright 2020 Google LLC
|
|
@@ -1760,7 +1760,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1760
1760
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1761
1761
|
* See the License for the specific language governing permissions and
|
|
1762
1762
|
* limitations under the License.
|
|
1763
|
-
*/(
|
|
1763
|
+
*/(t)}class Qu extends Mu{constructor(t,e,n,r){super(t,e,n,r),this.type="firestore",this._queue=new Gu,this._persistenceKey=(null==r?void 0:r.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||Xu(this),this._firestoreClient.terminate()}}function Yu(t,e){const n="string"==typeof t?t:e||"(default)",r=Ot("object"==typeof t?t:Ut(),"firestore").getImmediate({identifier:n});if(!r._initialized){const t=(t=>{const e=u(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return"["===e[0]?[e.substring(1,n-1),r]:[e.substring(0,n),r]})("firestore");t&&Uu(r,...t)}return r}function Ju(t){return t._firestoreClient||Xu(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function Xu(t){var e;const n=t._freezeSettings(),r=function(t,e,n,r){return new Ks(t,e,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,r.useFetchStreams)}
|
|
1764
1764
|
/**
|
|
1765
1765
|
* @license
|
|
1766
1766
|
* Copyright 2020 Google LLC
|
|
@@ -1776,7 +1776,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1776
1776
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1777
1777
|
* See the License for the specific language governing permissions and
|
|
1778
1778
|
* limitations under the License.
|
|
1779
|
-
*/(
|
|
1779
|
+
*/(t._databaseId,(null===(e=t._app)||void 0===e?void 0:e.options.appId)||"",t._persistenceKey,n);t._firestoreClient=new qu(t._authCredentials,t._appCheckCredentials,t._queue,r)}
|
|
1780
1780
|
/**
|
|
1781
1781
|
* @license
|
|
1782
1782
|
* Copyright 2020 Google LLC
|
|
@@ -1808,7 +1808,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1808
1808
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1809
1809
|
* See the License for the specific language governing permissions and
|
|
1810
1810
|
* limitations under the License.
|
|
1811
|
-
*/class
|
|
1811
|
+
*/class Zu{constructor(t){this._byteString=t}static fromBase64String(t){try{return new Zu(Zs.fromBase64String(t))}catch(t){throw new ms(gs.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(t){return new Zu(Zs.fromUint8Array(t))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(t){return this._byteString.isEqual(t._byteString)}}
|
|
1812
1812
|
/**
|
|
1813
1813
|
* @license
|
|
1814
1814
|
* Copyright 2020 Google LLC
|
|
@@ -1824,7 +1824,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1824
1824
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1825
1825
|
* See the License for the specific language governing permissions and
|
|
1826
1826
|
* limitations under the License.
|
|
1827
|
-
*/class
|
|
1827
|
+
*/class th{constructor(...t){for(let e=0;e<t.length;++e)if(0===t[e].length)throw new ms(gs.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Ps(t)}isEqual(t){return this._internalPath.isEqual(t._internalPath)}}
|
|
1828
1828
|
/**
|
|
1829
1829
|
* @license
|
|
1830
1830
|
* Copyright 2020 Google LLC
|
|
@@ -1841,7 +1841,7 @@ class Ya{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.inn
|
|
|
1841
1841
|
* See the License for the specific language governing permissions and
|
|
1842
1842
|
* limitations under the License.
|
|
1843
1843
|
*/
|
|
1844
|
-
class
|
|
1844
|
+
class eh{constructor(t){this._methodName=t}}
|
|
1845
1845
|
/**
|
|
1846
1846
|
* @license
|
|
1847
1847
|
* Copyright 2017 Google LLC
|
|
@@ -1857,7 +1857,7 @@ class tu{constructor(e){this._methodName=e}}
|
|
|
1857
1857
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1858
1858
|
* See the License for the specific language governing permissions and
|
|
1859
1859
|
* limitations under the License.
|
|
1860
|
-
*/class
|
|
1860
|
+
*/class nh{constructor(t,e){if(!isFinite(t)||t<-90||t>90)throw new ms(gs.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new ms(gs.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}get latitude(){return this._lat}get longitude(){return this._long}isEqual(t){return this._lat===t._lat&&this._long===t._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(t){return As(this._lat,t._lat)||As(this._long,t._long)}}
|
|
1861
1861
|
/**
|
|
1862
1862
|
* @license
|
|
1863
1863
|
* Copyright 2017 Google LLC
|
|
@@ -1873,7 +1873,7 @@ class tu{constructor(e){this._methodName=e}}
|
|
|
1873
1873
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1874
1874
|
* See the License for the specific language governing permissions and
|
|
1875
1875
|
* limitations under the License.
|
|
1876
|
-
*/const
|
|
1876
|
+
*/const rh=/^__.*__$/;function ih(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw ds()}}class sh{constructor(t,e,n,r,i,s){this.settings=t,this.databaseId=e,this.yt=n,this.ignoreUndefinedProperties=r,void 0===i&&this.na(),this.fieldTransforms=i||[],this.fieldMask=s||[]}get path(){return this.settings.path}get sa(){return this.settings.sa}ia(t){return new sh(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.yt,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}ra(t){var e;const n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.ia({path:n,oa:!1});return r.ua(t),r}ca(t){var e;const n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.ia({path:n,oa:!1});return r.na(),r}aa(t){return this.ia({path:void 0,oa:!0})}ha(t){return uh(t,this.settings.methodName,this.settings.la||!1,this.path,this.settings.fa)}contains(t){return void 0!==this.fieldMask.find((e=>t.isPrefixOf(e)))||void 0!==this.fieldTransforms.find((e=>t.isPrefixOf(e.field)))}na(){if(this.path)for(let t=0;t<this.path.length;t++)this.ua(this.path.get(t))}ua(t){if(0===t.length)throw this.ha("Document fields must not be empty");if(ih(this.sa)&&rh.test(t))throw this.ha('Document fields cannot begin and end with "__"')}}class oh{constructor(t,e,n){this.databaseId=t,this.ignoreUndefinedProperties=e,this.yt=n||kl(t)}da(t,e,n,r=!1){return new sh({sa:t,methodName:e,fa:n,path:Ps.emptyPath(),oa:!1,la:r},this.databaseId,this.yt,this.ignoreUndefinedProperties)}}function ah(t,e){if(ch(t=I(t)))return function(t,e,n){if(!ch(n)||!function(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}(n)){const r=Ou(n);throw"an object"===r?e.ha(t+" a custom object"):e.ha(t+" "+r)}}("Unsupported field value:",e,t),function(t,e){const n={};return Ys(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Qs(t,((t,r)=>{const i=ah(r,e.ra(t));null!=i&&(n[t]=i)})),{mapValue:{fields:n}}}(t,e);if(t instanceof eh)return function(t,e){if(!ih(e.sa))throw e.ha(`${t._methodName}() can only be used with update() and set()`);if(!e.path)throw e.ha(`${t._methodName}() is not currently supported inside arrays`);const n=t._toFieldTransform(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.oa&&4!==e.sa)throw e.ha("Nested arrays are not supported");return function(t,e){const n=[];let r=0;for(const i of t){let t=ah(i,e.aa(r));null==t&&(t={nullValue:"NULL_VALUE"}),n.push(t),r++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===(t=I(t)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return _a(e.yt,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){const n=Ns.fromDate(t);return{timestampValue:Sc(e.yt,n)}}if(t instanceof Ns){const n=new Ns(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:Sc(e.yt,n)}}if(t instanceof nh)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof Zu)return{bytesValue:Ec(e.yt,t._byteString)};if(t instanceof Fu){const n=e.databaseId,r=t.firestore._databaseId;if(!r.isEqual(n))throw e.ha(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:Tc(t.firestore._databaseId||e.databaseId,t._key.path)}}throw e.ha(`Unsupported field value: ${Ou(t)}`)}(t,e)}function ch(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof Ns||t instanceof nh||t instanceof Zu||t instanceof Fu||t instanceof eh)}const lh=new RegExp("[~\\*/\\[\\]]");function uh(t,e,n,r,i){const s=r&&!r.isEmpty(),o=void 0!==i;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(s||o)&&(c+=" (found",s&&(c+=` in field ${r}`),o&&(c+=` in document ${i}`),c+=")"),new ms(gs.INVALID_ARGUMENT,a+t+c)
|
|
1877
1877
|
/**
|
|
1878
1878
|
* @license
|
|
1879
1879
|
* Copyright 2020 Google LLC
|
|
@@ -1889,7 +1889,7 @@ class tu{constructor(e){this._methodName=e}}
|
|
|
1889
1889
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1890
1890
|
* See the License for the specific language governing permissions and
|
|
1891
1891
|
* limitations under the License.
|
|
1892
|
-
*/}class
|
|
1892
|
+
*/}class hh{constructor(t,e,n,r,i){this._firestore=t,this._userDataWriter=e,this._key=n,this._document=r,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new Fu(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const t=new dh(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}}get(t){if(this._document){const e=this._document.data.field(fh("DocumentSnapshot.get",t));if(null!==e)return this._userDataWriter.convertValue(e)}}}class dh extends hh{data(){return super.data()}}function fh(t,e){return"string"==typeof e?function(t,e,n){if(e.search(lh)>=0)throw uh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new th(...e.split("."))._internalPath}catch(r){throw uh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}(t,e):e instanceof th?e._internalPath:e._delegate._internalPath}
|
|
1893
1893
|
/**
|
|
1894
1894
|
* @license
|
|
1895
1895
|
* Copyright 2020 Google LLC
|
|
@@ -1905,7 +1905,7 @@ class tu{constructor(e){this._methodName=e}}
|
|
|
1905
1905
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1906
1906
|
* See the License for the specific language governing permissions and
|
|
1907
1907
|
* limitations under the License.
|
|
1908
|
-
*/function
|
|
1908
|
+
*/function ph(t){if("L"===t.limitType&&0===t.explicitOrderBy.length)throw new ms(gs.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class gh{}class mh extends gh{}function yh(t,e,...n){let r=[];e instanceof gh&&r.push(e),r=r.concat(n),function(t){const e=t.filter((t=>t instanceof bh)).length,n=t.filter((t=>t instanceof vh)).length;if(e>1||e>0&&n>0)throw new ms(gs.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}
|
|
1909
1909
|
/**
|
|
1910
1910
|
* @license
|
|
1911
1911
|
* Copyright 2020 Google LLC
|
|
@@ -1921,7 +1921,7 @@ class tu{constructor(e){this._methodName=e}}
|
|
|
1921
1921
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1922
1922
|
* See the License for the specific language governing permissions and
|
|
1923
1923
|
* limitations under the License.
|
|
1924
|
-
*/(r);for(const
|
|
1924
|
+
*/(r);for(const e of r)t=e._apply(t);return t}class vh extends mh{constructor(t,e,n){super(),this._field=t,this._op=e,this._value=n,this.type="where"}static _create(t,e,n){return new vh(t,e,n)}_apply(t){const e=this._parse(t);return Eh(t._query,e),new zu(t.firestore,t.converter,ha(t._query,e))}_parse(t){const e=function(t){const e=t._freezeSettings(),n=kl(t._databaseId);return new oh(t._databaseId,!!e.ignoreUndefinedProperties,n)}(t.firestore),n=function(t,e,n,r,i,s,o){let a;if(i.isKeyField()){if("array-contains"===s||"array-contains-any"===s)throw new ms(gs.INVALID_ARGUMENT,`Invalid Query. You can't perform '${s}' queries on documentId().`);if("in"===s||"not-in"===s){Sh(o,s);const e=[];for(const n of o)e.push(_h(r,t,n));a={arrayValue:{values:e}}}else a=_h(r,t,o)}else"in"!==s&&"not-in"!==s&&"array-contains-any"!==s||Sh(o,s),a=function(t,e,n,r=!1){return ah(n,t.da(r?4:3,e))}(n,"where",o,"in"===s||"not-in"===s);return Co.create(i,s,a)}(t._query,0,e,t.firestore._databaseId,this._field,this._op,this._value);return n}}function wh(t,e,n){const r=e,i=fh("where",t);return vh._create(i,r,n)}class bh extends gh{constructor(t,e){super(),this.type=t,this._queryConstraints=e}static _create(t,e){return new bh(t,e)}_parse(t){const e=this._queryConstraints.map((e=>e._parse(t))).filter((t=>t.getFilters().length>0));return 1===e.length?e[0]:Ao.create(e,this._getOperator())}_apply(t){const e=this._parse(t);return 0===e.getFilters().length?t:(function(t,e){let n=t;const r=e.getFlattenedFilters();for(const t of r)Eh(n,t),n=ha(n,t)}(t._query,e),new zu(t.firestore,t.converter,ha(t._query,e)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}function _h(t,e,n){if("string"==typeof(n=I(n))){if(""===n)throw new ms(gs.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!ca(e)&&-1!==n.indexOf("/"))throw new ms(gs.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=e.path.child(Ds.fromString(n));if(!Ms.isDocumentKey(r))throw new ms(gs.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return mo(t,new Ms(r))}if(n instanceof Fu)return mo(t,n._key);throw new ms(gs.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Ou(n)}.`)}function Sh(t,e){if(!Array.isArray(t)||0===t.length)throw new ms(gs.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);if(t.length>10)throw new ms(gs.INVALID_ARGUMENT,`Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`)}function Eh(t,e){if(e.isInequality()){const n=aa(t),r=e.field;if(null!==n&&!n.isEqual(r))throw new ms(gs.INVALID_ARGUMENT,`Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${r.toString()}'`);const i=oa(t);null!==i&&function(t,e,n){if(!n.isEqual(e))throw new ms(gs.INVALID_ARGUMENT,`Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`)}(0,r,i)}const n=function(t,e){for(const n of t)for(const t of n.getFlattenedFilters())if(e.indexOf(t.op)>=0)return t.op;return null}(t.filters,function(t){switch(t){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(null!==n)throw n===e.op?new ms(gs.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new ms(gs.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}class Ih{convertValue(t,e="none"){switch(co(t)){case 0:return null;case 1:return t.booleanValue;case 2:return no(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,e);case 5:return t.stringValue;case 6:return this.convertBytes(ro(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,e);case 10:return this.convertObject(t.mapValue,e);default:throw ds()}}convertObject(t,e){const n={};return Qs(t.fields,((t,r)=>{n[t]=this.convertValue(r,e)})),n}convertGeoPoint(t){return new nh(no(t.latitude),no(t.longitude))}convertArray(t,e){return(t.values||[]).map((t=>this.convertValue(t,e)))}convertServerTimestamp(t,e){switch(e){case"previous":const n=so(t);return null==n?null:this.convertValue(n,e);case"estimate":return this.convertTimestamp(oo(t));default:return null}}convertTimestamp(t){const e=eo(t);return new Ns(e.seconds,e.nanos)}convertDocumentKey(t,e){const n=Ds.fromString(t);fs(Vc(n));const r=new Gs(n.get(1),n.get(3)),i=new Ms(n.popFirst(5));return r.isEqual(e)||ls(`Document ${i} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`),i}}
|
|
1925
1925
|
/**
|
|
1926
1926
|
* @license
|
|
1927
1927
|
* Copyright 2020 Google LLC
|
|
@@ -1937,7 +1937,7 @@ class tu{constructor(e){this._methodName=e}}
|
|
|
1937
1937
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1938
1938
|
* See the License for the specific language governing permissions and
|
|
1939
1939
|
* limitations under the License.
|
|
1940
|
-
*/class
|
|
1940
|
+
*/class Th{constructor(t,e){this.hasPendingWrites=t,this.fromCache=e}isEqual(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache}}class kh extends hh{constructor(t,e,n,r,i,s){super(t,e,n,r,s),this._firestore=t,this._firestoreImpl=t,this.metadata=i}exists(){return super.exists()}data(t={}){if(this._document){if(this._converter){const e=new Ch(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(e,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}}get(t,e={}){if(this._document){const n=this._document.data.field(fh("DocumentSnapshot.get",t));if(null!==n)return this._userDataWriter.convertValue(n,e.serverTimestamps)}}}class Ch extends kh{data(t={}){return super.data(t)}}class Ah{constructor(t,e,n,r){this._firestore=t,this._userDataWriter=e,this._snapshot=r,this.metadata=new Th(r.hasPendingWrites,r.fromCache),this.query=n}get docs(){const t=[];return this.forEach((e=>t.push(e))),t}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(t,e){this._snapshot.docs.forEach((n=>{t.call(e,new Ch(this._firestore,this._userDataWriter,n.key,n,new Th(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(t={}){const e=!!t.includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new ms(gs.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e){if(t._snapshot.oldDocs.isEmpty()){let e=0;return t._snapshot.docChanges.map((n=>{const r=new Ch(t._firestore,t._userDataWriter,n.doc.key,n.doc,new Th(t._snapshot.mutatedKeys.has(n.doc.key),t._snapshot.fromCache),t.query.converter);return n.doc,{type:"added",doc:r,oldIndex:-1,newIndex:e++}}))}{let n=t._snapshot.oldDocs;return t._snapshot.docChanges.filter((t=>e||3!==t.type)).map((e=>{const r=new Ch(t._firestore,t._userDataWriter,e.doc.key,e.doc,new Th(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter);let i=-1,s=-1;return 0!==e.type&&(i=n.indexOf(e.doc.key),n=n.delete(e.doc.key)),1!==e.type&&(n=n.add(e.doc),s=n.indexOf(e.doc.key)),{type:Rh(e.type),doc:r,oldIndex:i,newIndex:s}}))}}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges}}function Rh(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return ds()}}
|
|
1941
1941
|
/**
|
|
1942
1942
|
* @license
|
|
1943
1943
|
* Copyright 2020 Google LLC
|
|
@@ -1953,7 +1953,7 @@ class tu{constructor(e){this._methodName=e}}
|
|
|
1953
1953
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1954
1954
|
* See the License for the specific language governing permissions and
|
|
1955
1955
|
* limitations under the License.
|
|
1956
|
-
*/function
|
|
1956
|
+
*/function Nh(t){t=Du(t,Fu);const e=Du(t.firestore,Qu);return function(t,e,n={}){const r=new ys;return t.asyncQueue.enqueueAndForget((async()=>function(t,e,n,r,i){const s=new ju({next:s=>{e.enqueueAndForget((()=>ru(t,o)));const a=s.docs.has(n);!a&&s.fromCache?i.reject(new ms(gs.UNAVAILABLE,"Failed to get document because the client is offline.")):a&&s.fromCache&&r&&"server"===r.source?i.reject(new ms(gs.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):i.resolve(s)},error:t=>i.reject(t)}),o=new au(ia(n.path),s,{includeMetadataChanges:!0,Nu:!0});return nu(t,o)}(await Ku(t),t.asyncQueue,e,n,r))),r.promise}(Ju(e),t._key).then((n=>xh(e,t,n)))}class Lh extends Ih{constructor(t){super(),this.firestore=t}convertBytes(t){return new Zu(t)}convertReference(t){const e=this.convertDocumentKey(t,this.firestore._databaseId);return new Fu(this.firestore,null,e)}}function Oh(t){t=Du(t,zu);const e=Du(t.firestore,Qu),n=Ju(e),r=new Lh(e);return ph(t._query),function(t,e,n={}){const r=new ys;return t.asyncQueue.enqueueAndForget((async()=>function(t,e,n,r,i){const s=new ju({next:n=>{e.enqueueAndForget((()=>ru(t,o))),n.fromCache&&"server"===r.source?i.reject(new ms(gs.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):i.resolve(n)},error:t=>i.reject(t)}),o=new au(n,s,{includeMetadataChanges:!0,Nu:!0});return nu(t,o)}(await Ku(t),t.asyncQueue,e,n,r))),r.promise}(n,t._query).then((n=>new Ah(e,r,t,n)))}function Dh(t,...e){var n,r,i;t=I(t);let s={includeMetadataChanges:!1},o=0;"object"!=typeof e[o]||Wu(e[o])||(s=e[o],o++);const a={includeMetadataChanges:s.includeMetadataChanges};if(Wu(e[o])){const t=e[o];e[o]=null===(n=t.next)||void 0===n?void 0:n.bind(t),e[o+1]=null===(r=t.error)||void 0===r?void 0:r.bind(t),e[o+2]=null===(i=t.complete)||void 0===i?void 0:i.bind(t)}let c,l,u;if(t instanceof Fu)l=Du(t.firestore,Qu),u=ia(t._key.path),c={next:n=>{e[o]&&e[o](xh(l,t,n))},error:e[o+1],complete:e[o+2]};else{const n=Du(t,zu);l=Du(n.firestore,Qu),u=n._query;const r=new Lh(l);c={next:t=>{e[o]&&e[o](new Ah(l,r,n,t))},error:e[o+1],complete:e[o+2]},ph(t._query)}return function(t,e,n,r){const i=new ju(r),s=new au(e,i,n);return t.asyncQueue.enqueueAndForget((async()=>nu(await Ku(t),s))),()=>{i.bc(),t.asyncQueue.enqueueAndForget((async()=>ru(await Ku(t),s)))}}(Ju(l),u,a,c)}function xh(t,e,n){const r=n.docs.get(e._key),i=new Lh(t);return new kh(t,i,e._key,r,new Th(n.hasPendingWrites,n.fromCache),e.converter)}!function(t,e=!0){ss=Pt,Lt(new T("firestore",((t,{instanceIdentifier:n,options:r})=>{const i=t.getProvider("app").getImmediate(),s=new Qu(new _s(t.getProvider("auth-internal")),new Ts(t.getProvider("app-check-internal")),function(t,e){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new ms(gs.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Gs(t.options.projectId,e)}(i,n),i);return r=Object.assign({useFetchStreams:e},r),s._setSettings(r),s}),"PUBLIC").setMultipleInstances(!0)),Ft(rs,"3.8.0",t),Ft(rs,"3.8.0","esm2017")}();
|
|
1957
1957
|
/**
|
|
1958
1958
|
* @license
|
|
1959
1959
|
* Copyright 2020 Google LLC
|
|
@@ -1970,7 +1970,7 @@ class tu{constructor(e){this._methodName=e}}
|
|
|
1970
1970
|
* See the License for the specific language governing permissions and
|
|
1971
1971
|
* limitations under the License.
|
|
1972
1972
|
*/
|
|
1973
|
-
|
|
1973
|
+
Ft("firebase","9.15.0","app");class Ph{constructor(){}static getInstance(){return Ph.instance||(Ph.instance=new Ph),Ph.instance}setEnv(t){switch(t){case"production":case"prod":this.env="prod";break;default:this.env="dev"}}get firebase(){return"prod"===this.env?Uh.firebase:Mh.firebase}get api(){return"prod"===this.env?Uh.api:Mh.api}get config(){return"prod"===this.env?Uh.config:Mh.config}}const Mh={firebase:{apiKey:"AIzaSyDfjBWzpmzb-mhGN8VSURxzLg6nkzmKUD8",authDomain:"fittingroom-dev-5d248.firebaseapp.com",projectId:"fittingroom-dev-5d248",storageBucket:"fittingroom-dev-5d248.appspot.com",messagingSenderId:"2298664147",appId:"1:2298664147:web:340bda75cd5d25f3997026"},api:{url:"https://tfr.dev.thefittingroom.xyz"},config:{avatarTimeout:Number("120000"),vtoTimeout:Number("120000")}},Uh={firebase:{apiKey:"AIzaSyA3kQ6w1vkA9l9lgY0nNACVPXe-QmP5T1Y",authDomain:"fittingroom-prod.firebaseapp.com",projectId:"fittingroom-prod",storageBucket:"fittingroom-prod.appspot.com",messagingSenderId:"965656825574",appId:"1:965656825574:web:933493cddc73213bd43527"},api:{url:"https://tfr.p.thefittingroom.xyz"},config:{avatarTimeout:Number("120000"),vtoTimeout:Number("120000")}};function Fh(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function zh(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Bh=zh,Vh=new g("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),Hh="auth/user-disabled",jh=new x("@firebase/auth");function qh(t,...e){jh.logLevel<=R.ERROR&&jh.error(`Auth (${Pt}): ${t}`,...e)}
|
|
1974
1974
|
/**
|
|
1975
1975
|
* @license
|
|
1976
1976
|
* Copyright 2020 Google LLC
|
|
@@ -1986,7 +1986,7 @@ Ue("firebase","9.15.0","app");class xu{constructor(){}static getInstance(){retur
|
|
|
1986
1986
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1987
1987
|
* See the License for the specific language governing permissions and
|
|
1988
1988
|
* limitations under the License.
|
|
1989
|
-
*/function
|
|
1989
|
+
*/function $h(t,...e){throw Gh(t,...e)}function Kh(t,...e){return Gh(t,...e)}function Gh(t,...e){if("string"!=typeof t){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return Vh.create(t,...e)}function Wh(t,e,...n){if(!t)throw Gh(e,...n)}function Qh(t){const e="INTERNAL ASSERTION FAILED: "+t;throw qh(e),new Error(e)}function Yh(t,e){t||Qh(e)}
|
|
1990
1990
|
/**
|
|
1991
1991
|
* @license
|
|
1992
1992
|
* Copyright 2020 Google LLC
|
|
@@ -2002,7 +2002,7 @@ Ue("firebase","9.15.0","app");class xu{constructor(){}static getInstance(){retur
|
|
|
2002
2002
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2003
2003
|
* See the License for the specific language governing permissions and
|
|
2004
2004
|
* limitations under the License.
|
|
2005
|
-
*/const
|
|
2005
|
+
*/const Jh=new Map;function Xh(t){Yh(t instanceof Function,"Expected a class definition");let e=Jh.get(t);return e?(Yh(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,Jh.set(t,e),e)}
|
|
2006
2006
|
/**
|
|
2007
2007
|
* @license
|
|
2008
2008
|
* Copyright 2020 Google LLC
|
|
@@ -2035,7 +2035,7 @@ Ue("firebase","9.15.0","app");class xu{constructor(){}static getInstance(){retur
|
|
|
2035
2035
|
* See the License for the specific language governing permissions and
|
|
2036
2036
|
* limitations under the License.
|
|
2037
2037
|
*/
|
|
2038
|
-
function
|
|
2038
|
+
function Zh(){var t;return"undefined"!=typeof self&&(null===(t=self.location)||void 0===t?void 0:t.href)||""}function td(){var t;return"undefined"!=typeof self&&(null===(t=self.location)||void 0===t?void 0:t.protocol)||null}
|
|
2039
2039
|
/**
|
|
2040
2040
|
* @license
|
|
2041
2041
|
* Copyright 2020 Google LLC
|
|
@@ -2051,7 +2051,7 @@ function Zu(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||v
|
|
|
2051
2051
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2052
2052
|
* See the License for the specific language governing permissions and
|
|
2053
2053
|
* limitations under the License.
|
|
2054
|
-
*/function
|
|
2054
|
+
*/function ed(){return"undefined"==typeof navigator||!navigator||!("onLine"in navigator)||"boolean"!=typeof navigator.onLine||"http:"!==td()&&"https:"!==td()&&!function(){const t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}()&&!("connection"in navigator)||navigator.onLine}
|
|
2055
2055
|
/**
|
|
2056
2056
|
* @license
|
|
2057
2057
|
* Copyright 2020 Google LLC
|
|
@@ -2068,7 +2068,7 @@ function Zu(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||v
|
|
|
2068
2068
|
* See the License for the specific language governing permissions and
|
|
2069
2069
|
* limitations under the License.
|
|
2070
2070
|
*/
|
|
2071
|
-
class
|
|
2071
|
+
class nd{constructor(t,e){this.shortDelay=t,this.longDelay=e,Yh(e>t,"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(a())||"object"==typeof navigator&&"ReactNative"===navigator.product}get(){return ed()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}
|
|
2072
2072
|
/**
|
|
2073
2073
|
* @license
|
|
2074
2074
|
* Copyright 2020 Google LLC
|
|
@@ -2084,7 +2084,7 @@ class nh{constructor(e,t){this.shortDelay=e,this.longDelay=t,Yu(t>e,"Short delay
|
|
|
2084
2084
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2085
2085
|
* See the License for the specific language governing permissions and
|
|
2086
2086
|
* limitations under the License.
|
|
2087
|
-
*/function
|
|
2087
|
+
*/function rd(t,e){Yh(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}
|
|
2088
2088
|
/**
|
|
2089
2089
|
* @license
|
|
2090
2090
|
* Copyright 2020 Google LLC
|
|
@@ -2100,7 +2100,7 @@ class nh{constructor(e,t){this.shortDelay=e,this.longDelay=t,Yu(t>e,"Short delay
|
|
|
2100
2100
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2101
2101
|
* See the License for the specific language governing permissions and
|
|
2102
2102
|
* limitations under the License.
|
|
2103
|
-
*/class
|
|
2103
|
+
*/class id{static initialize(t,e,n){this.fetchImpl=t,e&&(this.headersImpl=e),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:void Qh("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:void Qh("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:void Qh("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}
|
|
2104
2104
|
/**
|
|
2105
2105
|
* @license
|
|
2106
2106
|
* Copyright 2020 Google LLC
|
|
@@ -2116,7 +2116,7 @@ class nh{constructor(e,t){this.shortDelay=e,this.longDelay=t,Yu(t>e,"Short delay
|
|
|
2116
2116
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2117
2117
|
* See the License for the specific language governing permissions and
|
|
2118
2118
|
* limitations under the License.
|
|
2119
|
-
*/const
|
|
2119
|
+
*/const sd={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error"},od=new nd(3e4,6e4);
|
|
2120
2120
|
/**
|
|
2121
2121
|
* @license
|
|
2122
2122
|
* Copyright 2020 Google LLC
|
|
@@ -2132,7 +2132,7 @@ class nh{constructor(e,t){this.shortDelay=e,this.longDelay=t,Yu(t>e,"Short delay
|
|
|
2132
2132
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2133
2133
|
* See the License for the specific language governing permissions and
|
|
2134
2134
|
* limitations under the License.
|
|
2135
|
-
*/function
|
|
2135
|
+
*/function ad(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function cd(t,e,n,r,i={}){return ld(t,i,(async()=>{let i={},s={};r&&("GET"===e?s=r:i={body:JSON.stringify(r)});const o=w(Object.assign({key:t.config.apiKey},s)).slice(1),a=await t._getAdditionalHeaders();return a["Content-Type"]="application/json",t.languageCode&&(a["X-Firebase-Locale"]=t.languageCode),id.fetch()(hd(t,t.config.apiHost,n,o),Object.assign({method:e,headers:a,referrerPolicy:"no-referrer"},i))}))}async function ld(t,e,n){t._canInitEmulator=!1;const r=Object.assign(Object.assign({},sd),e);try{const e=new dd(t),i=await Promise.race([n(),e.promise]);e.clearNetworkTimeout();const s=await i.json();if("needConfirmation"in s)throw fd(t,"account-exists-with-different-credential",s);if(i.ok&&!("errorMessage"in s))return s;{const e=i.ok?s.errorMessage:s.error.message,[n,o]=e.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw fd(t,"credential-already-in-use",s);if("EMAIL_EXISTS"===n)throw fd(t,"email-already-in-use",s);if("USER_DISABLED"===n)throw fd(t,"user-disabled",s);const a=r[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw function(t,e,n){const r=Object.assign(Object.assign({},Bh()),{[e]:n});return new g("auth","Firebase",r).create(e,{appName:t.name})}(t,a,o);$h(t,a)}}catch(e){if(e instanceof p)throw e;$h(t,"network-request-failed")}}async function ud(t,e,n,r,i={}){const s=await cd(t,e,n,r,i);return"mfaPendingCredential"in s&&$h(t,"multi-factor-auth-required",{_serverResponse:s}),s}function hd(t,e,n,r){const i=`${e}${n}?${r}`;return t.config.emulator?rd(t.config,i):`${t.config.apiScheme}://${i}`}class dd{constructor(t){this.auth=t,this.timer=null,this.promise=new Promise(((t,e)=>{this.timer=setTimeout((()=>e(Kh(this.auth,"network-request-failed"))),od.get())}))}clearNetworkTimeout(){clearTimeout(this.timer)}}function fd(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=Kh(t,e,r);return i.customData._tokenResponse=n,i}
|
|
2136
2136
|
/**
|
|
2137
2137
|
* @license
|
|
2138
2138
|
* Copyright 2020 Google LLC
|
|
@@ -2165,7 +2165,7 @@ class nh{constructor(e,t){this.shortDelay=e,this.longDelay=t,Yu(t>e,"Short delay
|
|
|
2165
2165
|
* See the License for the specific language governing permissions and
|
|
2166
2166
|
* limitations under the License.
|
|
2167
2167
|
*/
|
|
2168
|
-
function
|
|
2168
|
+
function pd(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch(t){}}function gd(t){return 1e3*Number(t)}function md(t){const[e,n,r]=t.split(".");if(void 0===e||void 0===n||void 0===r)return qh("JWT malformed, contained fewer than 3 sections"),null;try{const t=o(n);return t?JSON.parse(t):(qh("Failed to decode base64 JWT payload"),null)}catch(t){return qh("Caught error parsing JWT payload as JSON",null==t?void 0:t.toString()),null}}
|
|
2169
2169
|
/**
|
|
2170
2170
|
* @license
|
|
2171
2171
|
* Copyright 2020 Google LLC
|
|
@@ -2182,7 +2182,7 @@ function Ah(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))retur
|
|
|
2182
2182
|
* See the License for the specific language governing permissions and
|
|
2183
2183
|
* limitations under the License.
|
|
2184
2184
|
*/
|
|
2185
|
-
async function
|
|
2185
|
+
async function yd(t,e,n=!1){if(n)return e;try{return await e}catch(e){throw e instanceof p&&function({code:t}){return"auth/user-disabled"===t||"auth/user-token-expired"===t}
|
|
2186
2186
|
/**
|
|
2187
2187
|
* @license
|
|
2188
2188
|
* Copyright 2020 Google LLC
|
|
@@ -2198,7 +2198,7 @@ async function ph(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t in
|
|
|
2198
2198
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2199
2199
|
* See the License for the specific language governing permissions and
|
|
2200
2200
|
* limitations under the License.
|
|
2201
|
-
*/(
|
|
2201
|
+
*/(e)&&t.auth.currentUser===t&&await t.auth.signOut(),e}}class vd{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(t){var e;if(t){const t=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),t}{this.errorBackoff=3e4;const t=(null!==(e=this.user.stsTokenManager.expirationTime)&&void 0!==e?e:0)-Date.now()-3e5;return Math.max(0,t)}}schedule(t=!1){if(!this.isRunning)return;const e=this.getInterval(t);this.timerId=setTimeout((async()=>{await this.iteration()}),e)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){return void("auth/network-request-failed"===(null==t?void 0:t.code)&&this.schedule(!0))}this.schedule()}}
|
|
2202
2202
|
/**
|
|
2203
2203
|
* @license
|
|
2204
2204
|
* Copyright 2020 Google LLC
|
|
@@ -2214,7 +2214,7 @@ async function ph(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t in
|
|
|
2214
2214
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2215
2215
|
* See the License for the specific language governing permissions and
|
|
2216
2216
|
* limitations under the License.
|
|
2217
|
-
*/class
|
|
2217
|
+
*/class wd{constructor(t,e){this.createdAt=t,this.lastLoginAt=e,this._initializeTime()}_initializeTime(){this.lastSignInTime=pd(this.lastLoginAt),this.creationTime=pd(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}
|
|
2218
2218
|
/**
|
|
2219
2219
|
* @license
|
|
2220
2220
|
* Copyright 2019 Google LLC
|
|
@@ -2230,7 +2230,7 @@ async function ph(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t in
|
|
|
2230
2230
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2231
2231
|
* See the License for the specific language governing permissions and
|
|
2232
2232
|
* limitations under the License.
|
|
2233
|
-
*/async function
|
|
2233
|
+
*/async function bd(t){var e;const n=t.auth,r=await t.getIdToken(),i=await yd(t,async function(t,e){return cd(t,"POST","/v1/accounts:lookup",e)}(n,{idToken:r}));Wh(null==i?void 0:i.users.length,n,"internal-error");const s=i.users[0];t._notifyReloadListener(s);const o=(null===(e=s.providerUserInfo)||void 0===e?void 0:e.length)?s.providerUserInfo.map((t=>{var{providerId:e}=t,n=Fh(t,["providerId"]);return{providerId:e,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})):[];const a=function(t,e){const n=t.filter((t=>!e.some((e=>e.providerId===t.providerId))));return[...n,...e]}(t.providerData,o),c=t.isAnonymous,l=!(t.email&&s.passwordHash||(null==a?void 0:a.length)),u=!!c&&l,h={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new wd(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(t,h)}
|
|
2234
2234
|
/**
|
|
2235
2235
|
* @license
|
|
2236
2236
|
* Copyright 2020 Google LLC
|
|
@@ -2247,7 +2247,7 @@ async function ph(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t in
|
|
|
2247
2247
|
* See the License for the specific language governing permissions and
|
|
2248
2248
|
* limitations under the License.
|
|
2249
2249
|
*/
|
|
2250
|
-
class
|
|
2250
|
+
class _d{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Wh(t.idToken,"internal-error"),Wh(void 0!==t.idToken,"internal-error"),Wh(void 0!==t.refreshToken,"internal-error");const e="expiresIn"in t&&void 0!==t.expiresIn?Number(t.expiresIn):function(t){const e=md(t);return Wh(e,"internal-error"),Wh(void 0!==e.exp,"internal-error"),Wh(void 0!==e.iat,"internal-error"),Number(e.exp)-Number(e.iat)}(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,e)}async getToken(t,e=!1){return Wh(!this.accessToken||this.refreshToken,t,"user-token-expired"),e||!this.accessToken||this.isExpired?this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(t,e){const{accessToken:n,refreshToken:r,expiresIn:i}=
|
|
2251
2251
|
/**
|
|
2252
2252
|
* @license
|
|
2253
2253
|
* Copyright 2020 Google LLC
|
|
@@ -2263,7 +2263,7 @@ class vh{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
2263
2263
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2264
2264
|
* See the License for the specific language governing permissions and
|
|
2265
2265
|
* limitations under the License.
|
|
2266
|
-
*/await async function(e
|
|
2266
|
+
*/await async function(t,e){const n=await ld(t,{},(async()=>{const n=w({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:r,apiKey:i}=t.config,s=hd(t,r,"/v1/token",`key=${i}`),o=await t._getAdditionalHeaders();return o["Content-Type"]="application/x-www-form-urlencoded",id.fetch()(s,{method:"POST",headers:o,body:n})}));return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(t,e);this.updateTokensAndExpiration(n,r,Number(i))}updateTokensAndExpiration(t,e,n){this.refreshToken=e||null,this.accessToken=t||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(t,e){const{refreshToken:n,accessToken:r,expirationTime:i}=e,s=new _d;return n&&(Wh("string"==typeof n,"internal-error",{appName:t}),s.refreshToken=n),r&&(Wh("string"==typeof r,"internal-error",{appName:t}),s.accessToken=r),i&&(Wh("number"==typeof i,"internal-error",{appName:t}),s.expirationTime=i),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new _d,this.toJSON())}_performRefresh(){return Qh("not implemented")}}
|
|
2267
2267
|
/**
|
|
2268
2268
|
* @license
|
|
2269
2269
|
* Copyright 2020 Google LLC
|
|
@@ -2279,7 +2279,7 @@ class vh{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
2279
2279
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2280
2280
|
* See the License for the specific language governing permissions and
|
|
2281
2281
|
* limitations under the License.
|
|
2282
|
-
*/function
|
|
2282
|
+
*/function Sd(t,e){Wh("string"==typeof t||void 0===t,"internal-error",{appName:e})}class Ed{constructor(t){var{uid:e,auth:n,stsTokenManager:r}=t,i=Fh(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new vd(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new wd(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(t){const e=await yd(this,this.stsTokenManager.getToken(this.auth,t));return Wh(e,this.auth,"internal-error"),this.accessToken!==e&&(this.accessToken=e,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),e}getIdTokenResult(t){return async function(t,e=!1){const n=I(t),r=await n.getIdToken(e),i=md(r);Wh(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const s="object"==typeof i.firebase?i.firebase:void 0,o=null==s?void 0:s.sign_in_provider;return{claims:i,token:r,authTime:pd(gd(i.auth_time)),issuedAtTime:pd(gd(i.iat)),expirationTime:pd(gd(i.exp)),signInProvider:o||null,signInSecondFactor:(null==s?void 0:s.sign_in_second_factor)||null}}(this,t)}reload(){return async function(t){const e=I(t);await bd(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}(this)}_assign(t){this!==t&&(Wh(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map((t=>Object.assign({},t))),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){return new Ed(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}))}_onReload(t){Wh(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,e=!1){let n=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),n=!0),e&&await bd(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){const t=await this.getIdToken();return await yd(this,async function(t,e){return cd(t,"POST","/v1/accounts:delete",e)}(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map((t=>Object.assign({},t))),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,e){var n,r,i,s,o,a,c,l;const u=null!==(n=e.displayName)&&void 0!==n?n:void 0,h=null!==(r=e.email)&&void 0!==r?r:void 0,d=null!==(i=e.phoneNumber)&&void 0!==i?i:void 0,f=null!==(s=e.photoURL)&&void 0!==s?s:void 0,p=null!==(o=e.tenantId)&&void 0!==o?o:void 0,g=null!==(a=e._redirectEventId)&&void 0!==a?a:void 0,m=null!==(c=e.createdAt)&&void 0!==c?c:void 0,y=null!==(l=e.lastLoginAt)&&void 0!==l?l:void 0,{uid:v,emailVerified:w,isAnonymous:b,providerData:_,stsTokenManager:S}=e;Wh(v&&S,t,"internal-error");const E=_d.fromJSON(this.name,S);Wh("string"==typeof v,t,"internal-error"),Sd(u,t.name),Sd(h,t.name),Wh("boolean"==typeof w,t,"internal-error"),Wh("boolean"==typeof b,t,"internal-error"),Sd(d,t.name),Sd(f,t.name),Sd(p,t.name),Sd(g,t.name),Sd(m,t.name),Sd(y,t.name);const I=new Ed({uid:v,auth:t,email:h,emailVerified:w,displayName:u,isAnonymous:b,photoURL:f,phoneNumber:d,tenantId:p,stsTokenManager:E,createdAt:m,lastLoginAt:y});return _&&Array.isArray(_)&&(I.providerData=_.map((t=>Object.assign({},t)))),g&&(I._redirectEventId=g),I}static async _fromIdTokenResponse(t,e,n=!1){const r=new _d;r.updateFromServerResponse(e);const i=new Ed({uid:e.localId,auth:t,stsTokenManager:r,isAnonymous:n});return await bd(i),i}}
|
|
2283
2283
|
/**
|
|
2284
2284
|
* @license
|
|
2285
2285
|
* Copyright 2019 Google LLC
|
|
@@ -2295,7 +2295,7 @@ class vh{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
2295
2295
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2296
2296
|
* See the License for the specific language governing permissions and
|
|
2297
2297
|
* limitations under the License.
|
|
2298
|
-
*/class
|
|
2298
|
+
*/class Id{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,e){this.storage[t]=e}async _get(t){const e=this.storage[t];return void 0===e?null:e}async _remove(t){delete this.storage[t]}_addListener(t,e){}_removeListener(t,e){}}Id.type="NONE";const Td=Id;
|
|
2299
2299
|
/**
|
|
2300
2300
|
* @license
|
|
2301
2301
|
* Copyright 2019 Google LLC
|
|
@@ -2311,7 +2311,7 @@ class vh{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
2311
2311
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2312
2312
|
* See the License for the specific language governing permissions and
|
|
2313
2313
|
* limitations under the License.
|
|
2314
|
-
*/function
|
|
2314
|
+
*/function kd(t,e,n){return`firebase:${t}:${e}:${n}`}class Cd{constructor(t,e,n){this.persistence=t,this.auth=e,this.userKey=n;const{config:r,name:i}=this.auth;this.fullUserKey=kd(this.userKey,r.apiKey,i),this.fullPersistenceKey=kd("persistence",r.apiKey,i),this.boundEventHandler=e._onStorageEvent.bind(e),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);return t?Ed._fromJSON(this.auth,t):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const e=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=t,e?this.setCurrentUser(e):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,e,n="authUser"){if(!e.length)return new Cd(Xh(Td),t,n);const r=(await Promise.all(e.map((async t=>{if(await t._isAvailable())return t})))).filter((t=>t));let i=r[0]||Xh(Td);const s=kd(n,t.config.apiKey,t.name);let o=null;for(const n of e)try{const e=await n._get(s);if(e){const r=Ed._fromJSON(t,e);n!==i&&(o=r),i=n;break}}catch(t){}const a=r.filter((t=>t._shouldAllowMigration));return i._shouldAllowMigration&&a.length?(i=a[0],o&&await i._set(s,o.toJSON()),await Promise.all(e.map((async t=>{if(t!==i)try{await t._remove(s)}catch(t){}}))),new Cd(i,t,n)):new Cd(i,t,n)}}
|
|
2315
2315
|
/**
|
|
2316
2316
|
* @license
|
|
2317
2317
|
* Copyright 2020 Google LLC
|
|
@@ -2327,7 +2327,7 @@ class vh{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
2327
2327
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2328
2328
|
* See the License for the specific language governing permissions and
|
|
2329
2329
|
* limitations under the License.
|
|
2330
|
-
*/function
|
|
2330
|
+
*/function Ad(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Od(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Rd(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(xd(e))return"Blackberry";if(Pd(e))return"Webos";if(Nd(e))return"Safari";if((e.includes("chrome/")||Ld(e))&&!e.includes("edge/"))return"Chrome";if(Dd(e))return"Android";{const e=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=t.match(e);if(2===(null==n?void 0:n.length))return n[1]}return"Other"}function Rd(t=a()){return/firefox\//i.test(t)}function Nd(t=a()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Ld(t=a()){return/crios\//i.test(t)}function Od(t=a()){return/iemobile/i.test(t)}function Dd(t=a()){return/android/i.test(t)}function xd(t=a()){return/blackberry/i.test(t)}function Pd(t=a()){return/webos/i.test(t)}function Md(t=a()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function Ud(){return function(){const t=a();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}()&&10===document.documentMode}function Fd(t=a()){return Md(t)||Dd(t)||Pd(t)||xd(t)||/windows phone/i.test(t)||Od(t)}
|
|
2331
2331
|
/**
|
|
2332
2332
|
* @license
|
|
2333
2333
|
* Copyright 2020 Google LLC
|
|
@@ -2344,7 +2344,7 @@ class vh{constructor(){this.refreshToken=null,this.accessToken=null,this.expirat
|
|
|
2344
2344
|
* See the License for the specific language governing permissions and
|
|
2345
2345
|
* limitations under the License.
|
|
2346
2346
|
*/
|
|
2347
|
-
function
|
|
2347
|
+
function zd(t,e=[]){let n;switch(t){case"Browser":n=Ad(a());break;case"Worker":n=`${Ad(a())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${Pt}/${r}`}
|
|
2348
2348
|
/**
|
|
2349
2349
|
* @license
|
|
2350
2350
|
* Copyright 2022 Google LLC
|
|
@@ -2360,7 +2360,7 @@ function Fh(e,t=[]){let n;switch(e){case"Browser":n=Ih(a());break;case"Worker":n
|
|
|
2360
2360
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2361
2361
|
* See the License for the specific language governing permissions and
|
|
2362
2362
|
* limitations under the License.
|
|
2363
|
-
*/class
|
|
2363
|
+
*/class Bd{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,e){const n=e=>new Promise(((n,r)=>{try{n(t(e))}catch(t){r(t)}}));n.onAbort=e,this.queue.push(n);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const e=[];try{for(const n of this.queue)await n(t),n.onAbort&&e.push(n.onAbort)}catch(t){e.reverse();for(const t of e)try{t()}catch(t){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==t?void 0:t.message})}}}
|
|
2364
2364
|
/**
|
|
2365
2365
|
* @license
|
|
2366
2366
|
* Copyright 2020 Google LLC
|
|
@@ -2376,7 +2376,7 @@ function Fh(e,t=[]){let n;switch(e){case"Browser":n=Ih(a());break;case"Worker":n
|
|
|
2376
2376
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2377
2377
|
* See the License for the specific language governing permissions and
|
|
2378
2378
|
* limitations under the License.
|
|
2379
|
-
*/class
|
|
2379
|
+
*/class Vd{constructor(t,e,n){this.app=t,this.heartbeatServiceProvider=e,this.config=n,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new jd(this),this.idTokenSubscription=new jd(this),this.beforeStateQueue=new Bd(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Vh,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=n.sdkClientVersion}_initializeWithPersistence(t,e){return e&&(this._popupRedirectResolver=Xh(e)),this._initializationPromise=this.queue((async()=>{var n,r;if(!this._deleted&&(this.persistenceManager=await Cd.create(this,t),!this._deleted)){if(null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(t){}await this.initializeCurrentUser(e),this.lastNotifiedUid=(null===(r=this.currentUser)||void 0===r?void 0:r.uid)||null,this._deleted||(this._isInitialized=!0)}})),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();return this.currentUser||t?this.currentUser&&t&&this.currentUser.uid===t.uid?(this._currentUser._assign(t),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(t,!0):void 0}async initializeCurrentUser(t){var e;const n=await this.assertedPersistence.getCurrentUser();let r=n,i=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(e=this.redirectUser)||void 0===e?void 0:e._redirectEventId,s=null==r?void 0:r._redirectEventId,o=await this.tryRedirectSignIn(t);n&&n!==s||!(null==o?void 0:o.user)||(r=o.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(t){r=n,this._popupRedirectResolver._overrideRedirectResult(this,(()=>Promise.reject(t)))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Wh(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(t){let e=null;try{e=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch(t){await this._setRedirectUser(null)}return e}async reloadAndSetCurrentUserOrClear(t){try{await bd(t)}catch(t){if("auth/network-request-failed"!==(null==t?void 0:t.code))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(t){const e=t?I(t):null;return e&&Wh(e.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(e&&e._clone(this))}async _updateCurrentUser(t,e=!1){if(!this._deleted)return t&&Wh(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),e||await this.beforeStateQueue.runMiddleware(t),this.queue((async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()}))}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(t){return this.queue((async()=>{await this.assertedPersistence.setPersistence(Xh(t))}))}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(t){this._errorFactory=new g("auth","Firebase",t())}onAuthStateChanged(t,e,n){return this.registerStateListener(this.authStateSubscription,t,e,n)}beforeAuthStateChanged(t,e){return this.beforeStateQueue.pushCallback(t,e)}onIdTokenChanged(t,e,n){return this.registerStateListener(this.idTokenSubscription,t,e,n)}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(t=this._currentUser)||void 0===t?void 0:t.toJSON()}}async _setRedirectUser(t,e){const n=await this.getOrInitRedirectPersistenceManager(e);return null===t?n.removeCurrentUser():n.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const e=t&&Xh(t)||this._popupRedirectResolver;Wh(e,this,"argument-error"),this.redirectPersistenceManager=await Cd.create(this,[Xh(e._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var e,n;return this._isInitialized&&await this.queue((async()=>{})),(null===(e=this._currentUser)||void 0===e?void 0:e._redirectEventId)===t?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue((async()=>this.directlySetCurrentUser(t)))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var t,e;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(e=null===(t=this.currentUser)||void 0===t?void 0:t.uid)&&void 0!==e?e:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,e,n,r){if(this._deleted)return()=>{};const i="function"==typeof e?e:e.next.bind(e),s=this._isInitialized?Promise.resolve():this._initializationPromise;return Wh(s,this,"internal-error"),s.then((()=>i(this.currentUser))),"function"==typeof e?t.addObserver(e,n,r):t.addObserver(e)}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Wh(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){t&&!this.frameworks.includes(t)&&(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=zd(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var t;const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const n=await(null===(t=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getHeartbeatsHeader());return n&&(e["X-Firebase-Client"]=n),e}}function Hd(t){return I(t)}class jd{constructor(t){this.auth=t,this.observer=null,this.addObserver=function(t,e){const n=new S(t,e);return n.subscribe.bind(n)}((t=>this.observer=t))}get next(){return Wh(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function qd(t,e,n){const r=Hd(t);Wh(r._canInitEmulator,r,"emulator-config-failed"),Wh(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!(null==n?void 0:n.disableWarnings),s=$d(e),{host:o,port:a}=function(t){const e=$d(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const t=i[1];return{host:t,port:Kd(r.substr(t.length+1))}}{const[t,e]=r.split(":");return{host:t,port:Kd(e)}}}(e),c=null===a?"":`:${a}`;r.config.emulator={url:`${s}//${o}${c}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function(){function t(){const t=document.createElement("p"),e=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",e.position="fixed",e.width="100%",e.backgroundColor="#ffffff",e.border=".1em solid #000000",e.color="#b50000",e.bottom="0px",e.left="0px",e.margin="0px",e.zIndex="10000",e.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials.");"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",t):t())}
|
|
2380
2380
|
/**
|
|
2381
2381
|
* @license
|
|
2382
2382
|
* Copyright 2020 Google LLC
|
|
@@ -2392,7 +2392,7 @@ function Fh(e,t=[]){let n;switch(e){case"Browser":n=Ih(a());break;case"Worker":n
|
|
|
2392
2392
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2393
2393
|
* See the License for the specific language governing permissions and
|
|
2394
2394
|
* limitations under the License.
|
|
2395
|
-
*/()}function
|
|
2395
|
+
*/()}function $d(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function Kd(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}class Gd{constructor(t,e){this.providerId=t,this.signInMethod=e}toJSON(){return Qh("not implemented")}_getIdTokenResponse(t){return Qh("not implemented")}_linkToIdToken(t,e){return Qh("not implemented")}_getReauthenticationResolver(t){return Qh("not implemented")}}
|
|
2396
2396
|
/**
|
|
2397
2397
|
* @license
|
|
2398
2398
|
* Copyright 2020 Google LLC
|
|
@@ -2408,7 +2408,7 @@ function Fh(e,t=[]){let n;switch(e){case"Browser":n=Ih(a());break;case"Worker":n
|
|
|
2408
2408
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2409
2409
|
* See the License for the specific language governing permissions and
|
|
2410
2410
|
* limitations under the License.
|
|
2411
|
-
*/async function
|
|
2411
|
+
*/async function Wd(t,e){return async function(t,e){return cd(t,"POST","/v1/accounts:sendOobCode",ad(t,e))}(t,e)}
|
|
2412
2412
|
/**
|
|
2413
2413
|
* @license
|
|
2414
2414
|
* Copyright 2020 Google LLC
|
|
@@ -2441,7 +2441,7 @@ function Fh(e,t=[]){let n;switch(e){case"Browser":n=Ih(a());break;case"Worker":n
|
|
|
2441
2441
|
* See the License for the specific language governing permissions and
|
|
2442
2442
|
* limitations under the License.
|
|
2443
2443
|
*/
|
|
2444
|
-
class
|
|
2444
|
+
class Qd extends Gd{constructor(t,e,n,r=null){super("password",n),this._email=t,this._password=e,this._tenantId=r}static _fromEmailAndPassword(t,e){return new Qd(t,e,"password")}static _fromEmailAndCode(t,e,n=null){return new Qd(t,e,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t;if((null==e?void 0:e.email)&&(null==e?void 0:e.password)){if("password"===e.signInMethod)return this._fromEmailAndPassword(e.email,e.password);if("emailLink"===e.signInMethod)return this._fromEmailAndCode(e.email,e.password,e.tenantId)}return null}async _getIdTokenResponse(t){switch(this.signInMethod){case"password":
|
|
2445
2445
|
/**
|
|
2446
2446
|
* @license
|
|
2447
2447
|
* Copyright 2020 Google LLC
|
|
@@ -2458,7 +2458,7 @@ class Qh extends Kh{constructor(e,t,n,r=null){super("password",n),this._email=e,
|
|
|
2458
2458
|
* See the License for the specific language governing permissions and
|
|
2459
2459
|
* limitations under the License.
|
|
2460
2460
|
*/
|
|
2461
|
-
return async function(e
|
|
2461
|
+
return async function(t,e){return ud(t,"POST","/v1/accounts:signInWithPassword",ad(t,e))}(t,{returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return async function(t,e){return ud(t,"POST","/v1/accounts:signInWithEmailLink",ad(t,e))}(t,{email:this._email,oobCode:this._password});default:$h(t,"internal-error")}}async _linkToIdToken(t,e){switch(this.signInMethod){case"password":return async function(t,e){return cd(t,"POST","/v1/accounts:update",e)}(t,{idToken:e,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return async function(t,e){return ud(t,"POST","/v1/accounts:signInWithEmailLink",ad(t,e))}(t,{idToken:e,email:this._email,oobCode:this._password});default:$h(t,"internal-error")}}_getReauthenticationResolver(t){return this._getIdTokenResponse(t)}}
|
|
2462
2462
|
/**
|
|
2463
2463
|
* @license
|
|
2464
2464
|
* Copyright 2020 Google LLC
|
|
@@ -2474,7 +2474,7 @@ return async function(e,t){return lh(e,"POST","/v1/accounts:signInWithPassword",
|
|
|
2474
2474
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2475
2475
|
* See the License for the specific language governing permissions and
|
|
2476
2476
|
* limitations under the License.
|
|
2477
|
-
*/async function
|
|
2477
|
+
*/async function Yd(t,e){return ud(t,"POST","/v1/accounts:signInWithIdp",ad(t,e))}
|
|
2478
2478
|
/**
|
|
2479
2479
|
* @license
|
|
2480
2480
|
* Copyright 2020 Google LLC
|
|
@@ -2490,7 +2490,7 @@ return async function(e,t){return lh(e,"POST","/v1/accounts:signInWithPassword",
|
|
|
2490
2490
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2491
2491
|
* See the License for the specific language governing permissions and
|
|
2492
2492
|
* limitations under the License.
|
|
2493
|
-
*/class
|
|
2493
|
+
*/class Jd extends Gd{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const e=new Jd(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(e.idToken=t.idToken),t.accessToken&&(e.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(e.nonce=t.nonce),t.pendingToken&&(e.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(e.accessToken=t.oauthToken,e.secret=t.oauthTokenSecret):$h("argument-error"),e}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t,{providerId:n,signInMethod:r}=e,i=Fh(e,["providerId","signInMethod"]);if(!n||!r)return null;const s=new Jd(n,r);return s.idToken=i.idToken||void 0,s.accessToken=i.accessToken||void 0,s.secret=i.secret,s.nonce=i.nonce,s.pendingToken=i.pendingToken||null,s}_getIdTokenResponse(t){return Yd(t,this.buildRequest())}_linkToIdToken(t,e){const n=this.buildRequest();return n.idToken=e,Yd(t,n)}_getReauthenticationResolver(t){const e=this.buildRequest();return e.autoCreate=!1,Yd(t,e)}buildRequest(){const t={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const e={};this.idToken&&(e.id_token=this.idToken),this.accessToken&&(e.access_token=this.accessToken),this.secret&&(e.oauth_token_secret=this.secret),e.providerId=this.providerId,this.nonce&&!this.pendingToken&&(e.nonce=this.nonce),t.postBody=w(e)}return t}}
|
|
2494
2494
|
/**
|
|
2495
2495
|
* @license
|
|
2496
2496
|
* Copyright 2020 Google LLC
|
|
@@ -2506,7 +2506,7 @@ return async function(e,t){return lh(e,"POST","/v1/accounts:signInWithPassword",
|
|
|
2506
2506
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2507
2507
|
* See the License for the specific language governing permissions and
|
|
2508
2508
|
* limitations under the License.
|
|
2509
|
-
*/class
|
|
2509
|
+
*/class Xd{constructor(t){var e,n,r,i,s,o;const a=b(_(t)),c=null!==(e=a.apiKey)&&void 0!==e?e:null,l=null!==(n=a.oobCode)&&void 0!==n?n:null,u=function(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(r=a.mode)&&void 0!==r?r:null);Wh(c&&l&&u,"argument-error"),this.apiKey=c,this.operation=u,this.code=l,this.continueUrl=null!==(i=a.continueUrl)&&void 0!==i?i:null,this.languageCode=null!==(s=a.languageCode)&&void 0!==s?s:null,this.tenantId=null!==(o=a.tenantId)&&void 0!==o?o:null}static parseLink(t){const e=function(t){const e=b(_(t)).link,n=e?b(_(e)).deep_link_id:null,r=b(_(t)).deep_link_id;return(r?b(_(r)).link:null)||r||n||e||t}(t);try{return new Xd(e)}catch(t){return null}}}
|
|
2510
2510
|
/**
|
|
2511
2511
|
* @license
|
|
2512
2512
|
* Copyright 2020 Google LLC
|
|
@@ -2522,7 +2522,7 @@ return async function(e,t){return lh(e,"POST","/v1/accounts:signInWithPassword",
|
|
|
2522
2522
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2523
2523
|
* See the License for the specific language governing permissions and
|
|
2524
2524
|
* limitations under the License.
|
|
2525
|
-
*/class
|
|
2525
|
+
*/class Zd{constructor(){this.providerId=Zd.PROVIDER_ID}static credential(t,e){return Qd._fromEmailAndPassword(t,e)}static credentialWithLink(t,e){const n=Xd.parseLink(e);return Wh(n,"argument-error"),Qd._fromEmailAndCode(t,n.code,n.tenantId)}}Zd.PROVIDER_ID="password",Zd.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Zd.EMAIL_LINK_SIGN_IN_METHOD="emailLink";
|
|
2526
2526
|
/**
|
|
2527
2527
|
* @license
|
|
2528
2528
|
* Copyright 2020 Google LLC
|
|
@@ -2539,7 +2539,7 @@ return async function(e,t){return lh(e,"POST","/v1/accounts:signInWithPassword",
|
|
|
2539
2539
|
* See the License for the specific language governing permissions and
|
|
2540
2540
|
* limitations under the License.
|
|
2541
2541
|
*/
|
|
2542
|
-
class
|
|
2542
|
+
class tf{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}
|
|
2543
2543
|
/**
|
|
2544
2544
|
* @license
|
|
2545
2545
|
* Copyright 2019 Google LLC
|
|
@@ -2555,7 +2555,7 @@ class ef{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.cus
|
|
|
2555
2555
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2556
2556
|
* See the License for the specific language governing permissions and
|
|
2557
2557
|
* limitations under the License.
|
|
2558
|
-
*/class
|
|
2558
|
+
*/class ef extends tf{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}
|
|
2559
2559
|
/**
|
|
2560
2560
|
* @license
|
|
2561
2561
|
* Copyright 2020 Google LLC
|
|
@@ -2571,7 +2571,7 @@ class ef{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.cus
|
|
|
2571
2571
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2572
2572
|
* See the License for the specific language governing permissions and
|
|
2573
2573
|
* limitations under the License.
|
|
2574
|
-
*/class nf extends
|
|
2574
|
+
*/class nf extends ef{constructor(){super("facebook.com")}static credential(t){return Jd._fromParams({providerId:nf.PROVIDER_ID,signInMethod:nf.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return nf.credentialFromTaggedObject(t)}static credentialFromError(t){return nf.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return nf.credential(t.oauthAccessToken)}catch(t){return null}}}nf.FACEBOOK_SIGN_IN_METHOD="facebook.com",nf.PROVIDER_ID="facebook.com";
|
|
2575
2575
|
/**
|
|
2576
2576
|
* @license
|
|
2577
2577
|
* Copyright 2020 Google LLC
|
|
@@ -2588,7 +2588,7 @@ class ef{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.cus
|
|
|
2588
2588
|
* See the License for the specific language governing permissions and
|
|
2589
2589
|
* limitations under the License.
|
|
2590
2590
|
*/
|
|
2591
|
-
class rf extends
|
|
2591
|
+
class rf extends ef{constructor(){super("google.com"),this.addScope("profile")}static credential(t,e){return Jd._fromParams({providerId:rf.PROVIDER_ID,signInMethod:rf.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:e})}static credentialFromResult(t){return rf.credentialFromTaggedObject(t)}static credentialFromError(t){return rf.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:e,oauthAccessToken:n}=t;if(!e&&!n)return null;try{return rf.credential(e,n)}catch(t){return null}}}rf.GOOGLE_SIGN_IN_METHOD="google.com",rf.PROVIDER_ID="google.com";
|
|
2592
2592
|
/**
|
|
2593
2593
|
* @license
|
|
2594
2594
|
* Copyright 2020 Google LLC
|
|
@@ -2605,7 +2605,7 @@ class rf extends tf{constructor(){super("google.com"),this.addScope("profile")}s
|
|
|
2605
2605
|
* See the License for the specific language governing permissions and
|
|
2606
2606
|
* limitations under the License.
|
|
2607
2607
|
*/
|
|
2608
|
-
class sf extends
|
|
2608
|
+
class sf extends ef{constructor(){super("github.com")}static credential(t){return Jd._fromParams({providerId:sf.PROVIDER_ID,signInMethod:sf.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return sf.credentialFromTaggedObject(t)}static credentialFromError(t){return sf.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return sf.credential(t.oauthAccessToken)}catch(t){return null}}}sf.GITHUB_SIGN_IN_METHOD="github.com",sf.PROVIDER_ID="github.com";
|
|
2609
2609
|
/**
|
|
2610
2610
|
* @license
|
|
2611
2611
|
* Copyright 2020 Google LLC
|
|
@@ -2622,7 +2622,7 @@ class sf extends tf{constructor(){super("github.com")}static credential(e){retur
|
|
|
2622
2622
|
* See the License for the specific language governing permissions and
|
|
2623
2623
|
* limitations under the License.
|
|
2624
2624
|
*/
|
|
2625
|
-
class of extends
|
|
2625
|
+
class of extends ef{constructor(){super("twitter.com")}static credential(t,e){return Jd._fromParams({providerId:of.PROVIDER_ID,signInMethod:of.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:e})}static credentialFromResult(t){return of.credentialFromTaggedObject(t)}static credentialFromError(t){return of.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:e,oauthTokenSecret:n}=t;if(!e||!n)return null;try{return of.credential(e,n)}catch(t){return null}}}of.TWITTER_SIGN_IN_METHOD="twitter.com",of.PROVIDER_ID="twitter.com";
|
|
2626
2626
|
/**
|
|
2627
2627
|
* @license
|
|
2628
2628
|
* Copyright 2020 Google LLC
|
|
@@ -2639,7 +2639,7 @@ class of extends tf{constructor(){super("twitter.com")}static credential(e,t){re
|
|
|
2639
2639
|
* See the License for the specific language governing permissions and
|
|
2640
2640
|
* limitations under the License.
|
|
2641
2641
|
*/
|
|
2642
|
-
class af{constructor(
|
|
2642
|
+
class af{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,e,n,r=!1){const i=await Ed._fromIdTokenResponse(t,n,r),s=cf(n);return new af({user:i,providerId:s,_tokenResponse:n,operationType:e})}static async _forOperation(t,e,n){await t._updateTokensIfNecessary(n,!0);const r=cf(n);return new af({user:t,providerId:r,_tokenResponse:n,operationType:e})}}function cf(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}
|
|
2643
2643
|
/**
|
|
2644
2644
|
* @license
|
|
2645
2645
|
* Copyright 2020 Google LLC
|
|
@@ -2655,7 +2655,7 @@ class af{constructor(e){this.user=e.user,this.providerId=e.providerId,this._toke
|
|
|
2655
2655
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2656
2656
|
* See the License for the specific language governing permissions and
|
|
2657
2657
|
* limitations under the License.
|
|
2658
|
-
*/class
|
|
2658
|
+
*/class lf extends p{constructor(t,e,n,r){var i;super(e.code,e.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,lf.prototype),this.customData={appName:t.name,tenantId:null!==(i=t.tenantId)&&void 0!==i?i:void 0,_serverResponse:e.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(t,e,n,r){return new lf(t,e,n,r)}}function uf(t,e,n,r){return("reauthenticate"===e?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch((n=>{if("auth/multi-factor-auth-required"===n.code)throw lf._fromErrorAndOperation(t,n,e,r);throw n}))}
|
|
2659
2659
|
/**
|
|
2660
2660
|
* @license
|
|
2661
2661
|
* Copyright 2020 Google LLC
|
|
@@ -2672,7 +2672,7 @@ class af{constructor(e){this.user=e.user,this.providerId=e.providerId,this._toke
|
|
|
2672
2672
|
* See the License for the specific language governing permissions and
|
|
2673
2673
|
* limitations under the License.
|
|
2674
2674
|
*/
|
|
2675
|
-
async function
|
|
2675
|
+
async function hf(t,e,n=!1){const r="signIn",i=await uf(t,r,e),s=await af._fromIdTokenResponse(t,r,i);return n||await t._updateCurrentUser(s.user),s}
|
|
2676
2676
|
/**
|
|
2677
2677
|
* @license
|
|
2678
2678
|
* Copyright 2020 Google LLC
|
|
@@ -2689,7 +2689,7 @@ async function uf(e,t,n=!1){const r="signIn",i=await lf(e,r,t),s=await af._fromI
|
|
|
2689
2689
|
* See the License for the specific language governing permissions and
|
|
2690
2690
|
* limitations under the License.
|
|
2691
2691
|
*/
|
|
2692
|
-
async function
|
|
2692
|
+
async function df(t,e,n){const r=I(t),i={requestType:"PASSWORD_RESET",email:e};n&&
|
|
2693
2693
|
/**
|
|
2694
2694
|
* @license
|
|
2695
2695
|
* Copyright 2020 Google LLC
|
|
@@ -2706,7 +2706,7 @@ async function hf(e,t,n){const r=S(e),i={requestType:"PASSWORD_RESET",email:t};n
|
|
|
2706
2706
|
* See the License for the specific language governing permissions and
|
|
2707
2707
|
* limitations under the License.
|
|
2708
2708
|
*/
|
|
2709
|
-
function(e,
|
|
2709
|
+
function(t,e,n){var r;Wh((null===(r=n.url)||void 0===r?void 0:r.length)>0,t,"invalid-continue-uri"),Wh(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,t,"invalid-dynamic-link-domain"),e.continueUrl=n.url,e.dynamicLinkDomain=n.dynamicLinkDomain,e.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(Wh(n.iOS.bundleId.length>0,t,"missing-ios-bundle-id"),e.iOSBundleId=n.iOS.bundleId),n.android&&(Wh(n.android.packageName.length>0,t,"missing-android-pkg-name"),e.androidInstallApp=n.android.installApp,e.androidMinimumVersionCode=n.android.minimumVersion,e.androidPackageName=n.android.packageName)}(r,i,n),await Wd(r,i)}async function ff(t,e,n){await async function(t,e){return cd(t,"POST","/v1/accounts:resetPassword",ad(t,e))}(I(t),{oobCode:e,newPassword:n})}function pf(t,e,n){return async function(t,e){return hf(Hd(t),e)}(I(t),Zd.credential(e,n))}const gf="__sak";
|
|
2710
2710
|
/**
|
|
2711
2711
|
* @license
|
|
2712
2712
|
* Copyright 2019 Google LLC
|
|
@@ -2722,7 +2722,7 @@ function(e,t,n){var r;Wu((null===(r=n.url)||void 0===r?void 0:r.length)>0,e,"inv
|
|
|
2722
2722
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2723
2723
|
* See the License for the specific language governing permissions and
|
|
2724
2724
|
* limitations under the License.
|
|
2725
|
-
*/class mf{constructor(e
|
|
2725
|
+
*/class mf{constructor(t,e){this.storageRetriever=t,this.type=e}_isAvailable(){try{return this.storage?(this.storage.setItem(gf,"1"),this.storage.removeItem(gf),Promise.resolve(!0)):Promise.resolve(!1)}catch(t){return Promise.resolve(!1)}}_set(t,e){return this.storage.setItem(t,JSON.stringify(e)),Promise.resolve()}_get(t){const e=this.storage.getItem(t);return Promise.resolve(e?JSON.parse(e):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}
|
|
2726
2726
|
/**
|
|
2727
2727
|
* @license
|
|
2728
2728
|
* Copyright 2020 Google LLC
|
|
@@ -2738,7 +2738,7 @@ function(e,t,n){var r;Wu((null===(r=n.url)||void 0===r?void 0:r.length)>0,e,"inv
|
|
|
2738
2738
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2739
2739
|
* See the License for the specific language governing permissions and
|
|
2740
2740
|
* limitations under the License.
|
|
2741
|
-
*/class
|
|
2741
|
+
*/class yf extends mf{constructor(){super((()=>window.localStorage),"LOCAL"),this.boundEventHandler=(t,e)=>this.onStorageEvent(t,e),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=function(){const t=a();return Nd(t)||Md(t)}()&&function(){try{return!(!window||window===window.top)}catch(t){return!1}}(),this.fallbackToPolling=Fd(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const e of Object.keys(this.listeners)){const n=this.storage.getItem(e),r=this.localCache[e];n!==r&&t(e,r,n)}}onStorageEvent(t,e=!1){if(!t.key)return void this.forAllChangedKeys(((t,e,n)=>{this.notifyListeners(t,n)}));const n=t.key;if(e?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const r=this.storage.getItem(n);if(t.newValue!==r)null!==t.newValue?this.storage.setItem(n,t.newValue):this.storage.removeItem(n);else if(this.localCache[n]===t.newValue&&!e)return}const r=()=>{const t=this.storage.getItem(n);(e||this.localCache[n]!==t)&&this.notifyListeners(n,t)},i=this.storage.getItem(n);Ud()&&i!==t.newValue&&t.newValue!==t.oldValue?setTimeout(r,10):r()}notifyListeners(t,e){this.localCache[t]=e;const n=this.listeners[t];if(n)for(const t of Array.from(n))t(e?JSON.parse(e):e)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((()=>{this.forAllChangedKeys(((t,e,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:e,newValue:n}),!0)}))}),1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,e){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(e)}_removeListener(t,e){this.listeners[t]&&(this.listeners[t].delete(e),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(t,e){await super._set(t,e),this.localCache[t]=JSON.stringify(e)}async _get(t){const e=await super._get(t);return this.localCache[t]=JSON.stringify(e),e}async _remove(t){await super._remove(t),delete this.localCache[t]}}yf.type="LOCAL";const vf=yf;
|
|
2742
2742
|
/**
|
|
2743
2743
|
* @license
|
|
2744
2744
|
* Copyright 2020 Google LLC
|
|
@@ -2754,7 +2754,7 @@ function(e,t,n){var r;Wu((null===(r=n.url)||void 0===r?void 0:r.length)>0,e,"inv
|
|
|
2754
2754
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2755
2755
|
* See the License for the specific language governing permissions and
|
|
2756
2756
|
* limitations under the License.
|
|
2757
|
-
*/class
|
|
2757
|
+
*/class wf extends mf{constructor(){super((()=>window.sessionStorage),"SESSION")}_addListener(t,e){}_removeListener(t,e){}}wf.type="SESSION";const bf=wf;
|
|
2758
2758
|
/**
|
|
2759
2759
|
* @license
|
|
2760
2760
|
* Copyright 2019 Google LLC
|
|
@@ -2787,7 +2787,7 @@ function(e,t,n){var r;Wu((null===(r=n.url)||void 0===r?void 0:r.length)>0,e,"inv
|
|
|
2787
2787
|
* See the License for the specific language governing permissions and
|
|
2788
2788
|
* limitations under the License.
|
|
2789
2789
|
*/
|
|
2790
|
-
class
|
|
2790
|
+
class _f{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const e=this.receivers.find((e=>e.isListeningto(t)));if(e)return e;const n=new _f(t);return this.receivers.push(n),n}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const e=t,{eventId:n,eventType:r,data:i}=e.data,s=this.handlersMap[r];if(!(null==s?void 0:s.size))return;e.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const o=Array.from(s).map((async t=>t(e.origin,i))),a=await function(t){return Promise.all(t.map((async t=>{try{return{fulfilled:!0,value:await t}}catch(t){return{fulfilled:!1,reason:t}}})))}(o);e.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:a})}_subscribe(t,e){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(e)}_unsubscribe(t,e){this.handlersMap[t]&&e&&this.handlersMap[t].delete(e),e&&0!==this.handlersMap[t].size||delete this.handlersMap[t],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}
|
|
2791
2791
|
/**
|
|
2792
2792
|
* @license
|
|
2793
2793
|
* Copyright 2020 Google LLC
|
|
@@ -2804,7 +2804,7 @@ class vf{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHa
|
|
|
2804
2804
|
* See the License for the specific language governing permissions and
|
|
2805
2805
|
* limitations under the License.
|
|
2806
2806
|
*/
|
|
2807
|
-
function
|
|
2807
|
+
function Sf(t="",e=10){let n="";for(let t=0;t<e;t++)n+=Math.floor(10*Math.random());return t+n}
|
|
2808
2808
|
/**
|
|
2809
2809
|
* @license
|
|
2810
2810
|
* Copyright 2019 Google LLC
|
|
@@ -2820,7 +2820,7 @@ function wf(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random
|
|
|
2820
2820
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2821
2821
|
* See the License for the specific language governing permissions and
|
|
2822
2822
|
* limitations under the License.
|
|
2823
|
-
*/
|
|
2823
|
+
*/_f.receivers=[];class Ef{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,e,n=50){const r="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let i,s;return new Promise(((o,a)=>{const c=Sf("",20);r.port1.start();const l=setTimeout((()=>{a(new Error("unsupported_event"))}),n);s={messageChannel:r,onMessage(t){const e=t;if(e.data.eventId===c)switch(e.data.status){case"ack":clearTimeout(l),i=setTimeout((()=>{a(new Error("timeout"))}),3e3);break;case"done":clearTimeout(i),o(e.data.response);break;default:clearTimeout(l),clearTimeout(i),a(new Error("invalid_response"))}}},this.handlers.add(s),r.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:t,eventId:c,data:e},[r.port2])})).finally((()=>{s&&this.removeMessageHandler(s)}))}}
|
|
2824
2824
|
/**
|
|
2825
2825
|
* @license
|
|
2826
2826
|
* Copyright 2020 Google LLC
|
|
@@ -2836,7 +2836,7 @@ function wf(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random
|
|
|
2836
2836
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2837
2837
|
* See the License for the specific language governing permissions and
|
|
2838
2838
|
* limitations under the License.
|
|
2839
|
-
*/function
|
|
2839
|
+
*/function If(){return window}
|
|
2840
2840
|
/**
|
|
2841
2841
|
* @license
|
|
2842
2842
|
* Copyright 2020 Google LLC.
|
|
@@ -2853,7 +2853,7 @@ function wf(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random
|
|
|
2853
2853
|
* See the License for the specific language governing permissions and
|
|
2854
2854
|
* limitations under the License.
|
|
2855
2855
|
*/
|
|
2856
|
-
function
|
|
2856
|
+
function Tf(){return void 0!==If().WorkerGlobalScope&&"function"==typeof If().importScripts}
|
|
2857
2857
|
/**
|
|
2858
2858
|
* @license
|
|
2859
2859
|
* Copyright 2019 Google LLC
|
|
@@ -2870,7 +2870,7 @@ function Ef(){return void 0!==Sf().WorkerGlobalScope&&"function"==typeof Sf().im
|
|
|
2870
2870
|
* See the License for the specific language governing permissions and
|
|
2871
2871
|
* limitations under the License.
|
|
2872
2872
|
*/
|
|
2873
|
-
const
|
|
2873
|
+
const kf="firebaseLocalStorageDb",Cf="firebaseLocalStorage",Af="fbase_key";class Rf{constructor(t){this.request=t}toPromise(){return new Promise(((t,e)=>{this.request.addEventListener("success",(()=>{t(this.request.result)})),this.request.addEventListener("error",(()=>{e(this.request.error)}))}))}}function Nf(t,e){return t.transaction([Cf],e?"readwrite":"readonly").objectStore(Cf)}function Lf(){const t=indexedDB.open(kf,1);return new Promise(((e,n)=>{t.addEventListener("error",(()=>{n(t.error)})),t.addEventListener("upgradeneeded",(()=>{const e=t.result;try{e.createObjectStore(Cf,{keyPath:Af})}catch(t){n(t)}})),t.addEventListener("success",(async()=>{const n=t.result;n.objectStoreNames.contains(Cf)?e(n):(n.close(),await function(){const t=indexedDB.deleteDatabase(kf);return new Rf(t).toPromise()}(),e(await Lf()))}))}))}async function Of(t,e,n){const r=Nf(t,!0).put({[Af]:e,value:n});return new Rf(r).toPromise()}function Df(t,e){const n=Nf(t,!0).delete(e);return new Rf(n).toPromise()}class xf{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then((()=>{}),(()=>{}))}async _openDb(){return this.db||(this.db=await Lf()),this.db}async _withRetries(t){let e=0;for(;;)try{const e=await this._openDb();return await t(e)}catch(t){if(e++>3)throw t;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Tf()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=_f._getInstance(Tf()?self:null),this.receiver._subscribe("keyChanged",(async(t,e)=>({keyProcessed:(await this._poll()).includes(e.key)}))),this.receiver._subscribe("ping",(async(t,e)=>["keyChanged"]))}async initializeSender(){var t,e;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(t){return null}}(),!this.activeServiceWorker)return;this.sender=new Ef(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(t=n[0])||void 0===t?void 0:t.fulfilled)&&(null===(e=n[0])||void 0===e?void 0:e.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(this.sender&&this.activeServiceWorker&&function(){var t;return(null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||null}()===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await Lf();return await Of(t,gf,"1"),await Df(t,gf),!0}catch(t){}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,e){return this._withPendingWrite((async()=>(await this._withRetries((n=>Of(n,t,e))),this.localCache[t]=e,this.notifyServiceWorker(t))))}async _get(t){const e=await this._withRetries((e=>async function(t,e){const n=Nf(t,!1).get(e),r=await new Rf(n).toPromise();return void 0===r?null:r.value}(e,t)));return this.localCache[t]=e,e}async _remove(t){return this._withPendingWrite((async()=>(await this._withRetries((e=>Df(e,t))),delete this.localCache[t],this.notifyServiceWorker(t))))}async _poll(){const t=await this._withRetries((t=>{const e=Nf(t,!1).getAll();return new Rf(e).toPromise()}));if(!t)return[];if(0!==this.pendingWrites)return[];const e=[],n=new Set;for(const{fbase_key:r,value:i}of t)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(i)&&(this.notifyListeners(r,i),e.push(r));for(const t of Object.keys(this.localCache))this.localCache[t]&&!n.has(t)&&(this.notifyListeners(t,null),e.push(t));return e}notifyListeners(t,e){this.localCache[t]=e;const n=this.listeners[t];if(n)for(const t of Array.from(n))t(e)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((async()=>this._poll()),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,e){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(e)}_removeListener(t,e){this.listeners[t]&&(this.listeners[t].delete(e),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&this.stopPolling()}}xf.type="LOCAL";const Pf=xf;
|
|
2874
2874
|
/**
|
|
2875
2875
|
* @license
|
|
2876
2876
|
* Copyright 2020 Google LLC
|
|
@@ -2886,7 +2886,7 @@ const Tf="firebaseLocalStorageDb",Cf="firebaseLocalStorage",If="fbase_key";class
|
|
|
2886
2886
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2887
2887
|
* See the License for the specific language governing permissions and
|
|
2888
2888
|
* limitations under the License.
|
|
2889
|
-
*/function
|
|
2889
|
+
*/function Mf(t){return new Promise(((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=t=>{const e=Kh("internal-error");e.customData=t,n(e)},r.type="text/javascript",r.charset="UTF-8",function(){var t,e;return null!==(e=null===(t=document.getElementsByTagName("head"))||void 0===t?void 0:t[0])&&void 0!==e?e:document}().appendChild(r)}))}new nd(3e4,6e4);
|
|
2890
2890
|
/**
|
|
2891
2891
|
* @license
|
|
2892
2892
|
* Copyright 2019 Google LLC
|
|
@@ -2903,7 +2903,7 @@ const Tf="firebaseLocalStorageDb",Cf="firebaseLocalStorage",If="fbase_key";class
|
|
|
2903
2903
|
* See the License for the specific language governing permissions and
|
|
2904
2904
|
* limitations under the License.
|
|
2905
2905
|
*/
|
|
2906
|
-
class
|
|
2906
|
+
class Uf extends Gd{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return Yd(t,this._buildIdpRequest())}_linkToIdToken(t,e){return Yd(t,this._buildIdpRequest(e))}_getReauthenticationResolver(t){return Yd(t,this._buildIdpRequest())}_buildIdpRequest(t){const e={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(e.idToken=t),e}}function Ff(t){return hf(t.auth,new Uf(t),t.bypassAuthState)}function zf(t){const{auth:e,user:n}=t;return Wh(n,e,"internal-error"),
|
|
2907
2907
|
/**
|
|
2908
2908
|
* @license
|
|
2909
2909
|
* Copyright 2019 Google LLC
|
|
@@ -2920,7 +2920,7 @@ class Mf extends Kh{constructor(e){super("custom","custom"),this.params=e}_getId
|
|
|
2920
2920
|
* See the License for the specific language governing permissions and
|
|
2921
2921
|
* limitations under the License.
|
|
2922
2922
|
*/
|
|
2923
|
-
async function(e,
|
|
2923
|
+
async function(t,e,n=!1){const{auth:r}=t,i="reauthenticate";try{const s=await yd(t,uf(r,i,e,t),n);Wh(s.idToken,r,"internal-error");const o=md(s.idToken);Wh(o,r,"internal-error");const{sub:a}=o;return Wh(t.uid===a,r,"user-mismatch"),af._forOperation(t,i,s)}catch(t){throw"auth/user-not-found"===(null==t?void 0:t.code)&&$h(r,"user-mismatch"),t}}(n,new Uf(t),t.bypassAuthState)}async function Bf(t){const{auth:e,user:n}=t;return Wh(n,e,"internal-error"),async function(t,e,n=!1){const r=await yd(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return af._forOperation(t,"link",r)}(n,new Uf(t),t.bypassAuthState)}
|
|
2924
2924
|
/**
|
|
2925
2925
|
* @license
|
|
2926
2926
|
* Copyright 2020 Google LLC
|
|
@@ -2936,7 +2936,7 @@ async function(e,t,n=!1){const{auth:r}=e,i="reauthenticate";try{const s=await ph
|
|
|
2936
2936
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2937
2937
|
* See the License for the specific language governing permissions and
|
|
2938
2938
|
* limitations under the License.
|
|
2939
|
-
*/class
|
|
2939
|
+
*/class Vf{constructor(t,e,n,r,i=!1){this.auth=t,this.resolver=n,this.user=r,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(e)?e:[e]}execute(){return new Promise((async(t,e)=>{this.pendingPromise={resolve:t,reject:e};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(t){this.reject(t)}}))}async onAuthEvent(t){const{urlResponse:e,sessionId:n,postBody:r,tenantId:i,error:s,type:o}=t;if(s)return void this.reject(s);const a={auth:this.auth,requestUri:e,sessionId:n,tenantId:i||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(a))}catch(t){this.reject(t)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return Ff;case"linkViaPopup":case"linkViaRedirect":return Bf;case"reauthViaPopup":case"reauthViaRedirect":return zf;default:$h(this.auth,"internal-error")}}resolve(t){Yh(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){Yh(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}
|
|
2940
2940
|
/**
|
|
2941
2941
|
* @license
|
|
2942
2942
|
* Copyright 2020 Google LLC
|
|
@@ -2952,7 +2952,7 @@ async function(e,t,n=!1){const{auth:r}=e,i="reauthenticate";try{const s=await ph
|
|
|
2952
2952
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2953
2953
|
* See the License for the specific language governing permissions and
|
|
2954
2954
|
* limitations under the License.
|
|
2955
|
-
*/const
|
|
2955
|
+
*/const Hf=new nd(2e3,1e4);class jf extends Vf{constructor(t,e,n,r,i){super(t,e,r,i),this.provider=n,this.authWindow=null,this.pollId=null,jf.currentPopupAction&&jf.currentPopupAction.cancel(),jf.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Wh(t,this.auth,"internal-error"),t}async onExecution(){Yh(1===this.filter.length,"Popup operations only handle one event");const t=Sf();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch((t=>{this.reject(t)})),this.resolver._isIframeWebStorageSupported(this.auth,(t=>{t||this.reject(Kh(this.auth,"web-storage-unsupported"))})),this.pollUserCancellation()}get eventId(){var t;return(null===(t=this.authWindow)||void 0===t?void 0:t.associatedEvent)||null}cancel(){this.reject(Kh(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,jf.currentPopupAction=null}pollUserCancellation(){const t=()=>{var e,n;(null===(n=null===(e=this.authWindow)||void 0===e?void 0:e.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout((()=>{this.pollId=null,this.reject(Kh(this.auth,"popup-closed-by-user"))}),2e3):this.pollId=window.setTimeout(t,Hf.get())};t()}}jf.currentPopupAction=null;
|
|
2956
2956
|
/**
|
|
2957
2957
|
* @license
|
|
2958
2958
|
* Copyright 2020 Google LLC
|
|
@@ -2969,7 +2969,7 @@ async function(e,t,n=!1){const{auth:r}=e,i="reauthenticate";try{const s=await ph
|
|
|
2969
2969
|
* See the License for the specific language governing permissions and
|
|
2970
2970
|
* limitations under the License.
|
|
2971
2971
|
*/
|
|
2972
|
-
const
|
|
2972
|
+
const qf="pendingRedirect",$f=new Map;class Kf extends Vf{constructor(t,e,n=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],e,void 0,n),this.eventId=null}async execute(){let t=$f.get(this.auth._key());if(!t){try{const e=await async function(t,e){const n=function(t){return kd(qf,t.config.apiKey,t.name)}(e),r=function(t){return Xh(t._redirectPersistence)}(t);if(!await r._isAvailable())return!1;const i="true"===await r._get(n);return await r._remove(n),i}(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(e)}catch(e){t=()=>Promise.reject(e)}$f.set(this.auth._key(),t)}return this.bypassAuthState||$f.set(this.auth._key(),(()=>Promise.resolve(null))),t()}async onAuthEvent(t){if("signInViaRedirect"===t.type)return super.onAuthEvent(t);if("unknown"!==t.type){if(t.eventId){const e=await this.auth._redirectUserForId(t.eventId);if(e)return this.user=e,super.onAuthEvent(t);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function Gf(t,e){$f.set(t._key(),e)}async function Wf(t,e,n=!1){const r=Hd(t),i=
|
|
2973
2973
|
/**
|
|
2974
2974
|
* @license
|
|
2975
2975
|
* Copyright 2021 Google LLC
|
|
@@ -2986,7 +2986,7 @@ const Gf="pendingRedirect",jf=new Map;class qf extends zf{constructor(e,t,n=!1){
|
|
|
2986
2986
|
* See the License for the specific language governing permissions and
|
|
2987
2987
|
* limitations under the License.
|
|
2988
2988
|
*/
|
|
2989
|
-
function(e
|
|
2989
|
+
function(t,e){return e?Xh(e):(Wh(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}(r,e),s=new Kf(r,i,n),o=await s.execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}
|
|
2990
2990
|
/**
|
|
2991
2991
|
* @license
|
|
2992
2992
|
* Copyright 2020 Google LLC
|
|
@@ -3002,7 +3002,7 @@ function(e,t){return t?Xu(t):(Wu(e._popupRedirectResolver,e,"argument-error"),e.
|
|
|
3002
3002
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3003
3003
|
* See the License for the specific language governing permissions and
|
|
3004
3004
|
* limitations under the License.
|
|
3005
|
-
*/class Qf{constructor(
|
|
3005
|
+
*/class Qf{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let e=!1;return this.consumers.forEach((n=>{this.isEventForConsumer(t,n)&&(e=!0,this.sendToConsumer(t,n),this.saveEventToCache(t))})),this.hasHandledPotentialRedirect||!function(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Jf(t);default:return!1}}
|
|
3006
3006
|
/**
|
|
3007
3007
|
* @license
|
|
3008
3008
|
* Copyright 2020 Google LLC
|
|
@@ -3018,7 +3018,7 @@ function(e,t){return t?Xu(t):(Wu(e._popupRedirectResolver,e,"argument-error"),e.
|
|
|
3018
3018
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3019
3019
|
* See the License for the specific language governing permissions and
|
|
3020
3020
|
* limitations under the License.
|
|
3021
|
-
*/(
|
|
3021
|
+
*/(t)||(this.hasHandledPotentialRedirect=!0,e||(this.queuedRedirectEvent=t,e=!0)),e}sendToConsumer(t,e){var n;if(t.error&&!Jf(t)){const r=(null===(n=t.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";e.onError(Kh(this.auth,r))}else e.onAuthEvent(t)}isEventForConsumer(t,e){const n=null===e.eventId||!!t.eventId&&t.eventId===e.eventId;return e.filter.includes(t.type)&&n}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Yf(t))}saveEventToCache(t){this.cachedEventUids.add(Yf(t)),this.lastProcessedEventTime=Date.now()}}function Yf(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter((t=>t)).join("-")}function Jf({type:t,error:e}){return"unknown"===t&&"auth/no-auth-event"===(null==e?void 0:e.code)}
|
|
3022
3022
|
/**
|
|
3023
3023
|
* @license
|
|
3024
3024
|
* Copyright 2020 Google LLC
|
|
@@ -3035,7 +3035,7 @@ function(e,t){return t?Xu(t):(Wu(e._popupRedirectResolver,e,"argument-error"),e.
|
|
|
3035
3035
|
* See the License for the specific language governing permissions and
|
|
3036
3036
|
* limitations under the License.
|
|
3037
3037
|
*/
|
|
3038
|
-
const Xf=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Zf=/^https?/;async function
|
|
3038
|
+
const Xf=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Zf=/^https?/;async function tp(t){if(t.config.emulator)return;const{authorizedDomains:e}=await async function(t,e={}){return cd(t,"GET","/v1/projects",e)}(t);for(const t of e)try{if(ep(t))return}catch(t){}$h(t,"unauthorized-domain")}function ep(t){const e=Zh(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const i=new URL(t);return""===i.hostname&&""===r?"chrome-extension:"===n&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):"chrome-extension:"===n&&i.hostname===r}if(!Zf.test(n))return!1;if(Xf.test(t))return r===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}
|
|
3039
3039
|
/**
|
|
3040
3040
|
* @license
|
|
3041
3041
|
* Copyright 2020 Google LLC.
|
|
@@ -3051,7 +3051,7 @@ const Xf=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Zf=/^https?/;async function eA(e
|
|
|
3051
3051
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3052
3052
|
* See the License for the specific language governing permissions and
|
|
3053
3053
|
* limitations under the License.
|
|
3054
|
-
*/const
|
|
3054
|
+
*/const np=new nd(3e4,6e4);function rp(){const t=If().___jsl;if(null==t?void 0:t.H)for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let e=0;e<t.CP.length;e++)t.CP[e]=null}function ip(t){return new Promise(((e,n)=>{var r,i,s;function o(){rp(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{rp(),n(Kh(t,"network-request-failed"))},timeout:np.get()})}if(null===(i=null===(r=If().gapi)||void 0===r?void 0:r.iframes)||void 0===i?void 0:i.Iframe)e(gapi.iframes.getContext());else{if(!(null===(s=If().gapi)||void 0===s?void 0:s.load)){const e=`__${"iframefcb"}${Math.floor(1e6*Math.random())}`;return If()[e]=()=>{gapi.load?o():n(Kh(t,"network-request-failed"))},Mf(`https://apis.google.com/js/api.js?onload=${e}`).catch((t=>n(t)))}o()}})).catch((t=>{throw sp=null,t}))}let sp=null;
|
|
3055
3055
|
/**
|
|
3056
3056
|
* @license
|
|
3057
3057
|
* Copyright 2020 Google LLC.
|
|
@@ -3068,7 +3068,7 @@ const Xf=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Zf=/^https?/;async function eA(e
|
|
|
3068
3068
|
* See the License for the specific language governing permissions and
|
|
3069
3069
|
* limitations under the License.
|
|
3070
3070
|
*/
|
|
3071
|
-
const
|
|
3071
|
+
const op=new nd(5e3,15e3),ap="__/auth/iframe",cp="emulator/auth/iframe",lp={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},up=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function hp(t){const e=t.config;Wh(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?rd(e,cp):`https://${t.config.authDomain}/${ap}`,r={apiKey:e.apiKey,appName:t.name,v:Pt},i=up.get(t.config.apiHost);i&&(r.eid=i);const s=t._getFrameworks();return s.length&&(r.fw=s.join(",")),`${n}?${w(r).slice(1)}`}async function dp(t){const e=await function(t){return sp=sp||ip(t),sp}(t),n=If().gapi;return Wh(n,t,"internal-error"),e.open({where:document.body,url:hp(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:lp,dontclear:!0},(e=>new Promise((async(n,r)=>{await e.restyle({setHideOnLeave:!1});const i=Kh(t,"network-request-failed"),s=If().setTimeout((()=>{r(i)}),op.get());function o(){If().clearTimeout(s),n(e)}e.ping(o).then(o,(()=>{r(i)}))}))))}
|
|
3072
3072
|
/**
|
|
3073
3073
|
* @license
|
|
3074
3074
|
* Copyright 2020 Google LLC.
|
|
@@ -3084,7 +3084,7 @@ const oA=new nh(5e3,15e3),aA="__/auth/iframe",dA="emulator/auth/iframe",cA={styl
|
|
|
3084
3084
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3085
3085
|
* See the License for the specific language governing permissions and
|
|
3086
3086
|
* limitations under the License.
|
|
3087
|
-
*/const
|
|
3087
|
+
*/const fp={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class pp{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(t){}}}function gp(t,e,n,r=500,i=600){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let c="";const l=Object.assign(Object.assign({},fp),{width:r.toString(),height:i.toString(),top:s,left:o}),u=a().toLowerCase();n&&(c=Ld(u)?"_blank":n),Rd(u)&&(e=e||"http://localhost",l.scrollbars="yes");const h=Object.entries(l).reduce(((t,[e,n])=>`${t}${e}=${n},`),"");if(function(t=a()){var e;return Md(t)&&!!(null===(e=window.navigator)||void 0===e?void 0:e.standalone)}(u)&&"_self"!==c)return function(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}
|
|
3088
3088
|
/**
|
|
3089
3089
|
* @license
|
|
3090
3090
|
* Copyright 2021 Google LLC
|
|
@@ -3100,7 +3100,7 @@ const oA=new nh(5e3,15e3),aA="__/auth/iframe",dA="emulator/auth/iframe",cA={styl
|
|
|
3100
3100
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3101
3101
|
* See the License for the specific language governing permissions and
|
|
3102
3102
|
* limitations under the License.
|
|
3103
|
-
*/(
|
|
3103
|
+
*/(e||"",c),new pp(null);const d=window.open(e||"",c,h);Wh(d,t,"popup-blocked");try{d.focus()}catch(t){}return new pp(d)}const mp="__/auth/handler",yp="emulator/auth/handler";function vp(t,e,n,r,i,s){Wh(t.config.authDomain,t,"auth-domain-config-required"),Wh(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:Pt,eventId:i};if(e instanceof tf){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[t,e]of Object.entries(s||{}))o[t]=e}if(e instanceof ef){const t=e.getScopes().filter((t=>""!==t));t.length>0&&(o.scopes=t.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const t of Object.keys(a))void 0===a[t]&&delete a[t];return`${function({config:t}){if(!t.emulator)return`https://${t.authDomain}/${mp}`;return rd(t,yp)}
|
|
3104
3104
|
/**
|
|
3105
3105
|
* @license
|
|
3106
3106
|
* Copyright 2020 Google LLC
|
|
@@ -3116,7 +3116,7 @@ const oA=new nh(5e3,15e3),aA="__/auth/iframe",dA="emulator/auth/iframe",cA={styl
|
|
|
3116
3116
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3117
3117
|
* See the License for the specific language governing permissions and
|
|
3118
3118
|
* limitations under the License.
|
|
3119
|
-
*/(
|
|
3119
|
+
*/(t)}?${w(a).slice(1)}`}const wp="webStorageSupport";const bp=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=bf,this._completeRedirectFn=Wf,this._overrideRedirectResult=Gf}async _openPopup(t,e,n,r){var i;Yh(null===(i=this.eventManagers[t._key()])||void 0===i?void 0:i.manager,"_initialize() not called before _openPopup()");return gp(t,vp(t,e,n,Zh(),r),Sf())}async _openRedirect(t,e,n,r){var i;return await this._originValidation(t),i=vp(t,e,n,Zh(),r),If().location.href=i,new Promise((()=>{}))}_initialize(t){const e=t._key();if(this.eventManagers[e]){const{manager:t,promise:n}=this.eventManagers[e];return t?Promise.resolve(t):(Yh(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(t);return this.eventManagers[e]={promise:n},n.catch((()=>{delete this.eventManagers[e]})),n}async initAndGetManager(t){const e=await dp(t),n=new Qf(t);return e.register("authEvent",(e=>{Wh(null==e?void 0:e.authEvent,t,"invalid-auth-event");return{status:n.onEvent(e.authEvent)?"ACK":"ERROR"}}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:n},this.iframes[t._key()]=e,n}_isIframeWebStorageSupported(t,e){this.iframes[t._key()].send(wp,{type:wp},(n=>{var r;const i=null===(r=null==n?void 0:n[0])||void 0===r?void 0:r[wp];void 0!==i&&e(!!i),$h(t,"internal-error")}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const e=t._key();return this.originValidationPromises[e]||(this.originValidationPromises[e]=tp(t)),this.originValidationPromises[e]}get _shouldInitProactively(){return Fd()||Nd()||Md()}};var _p="@firebase/auth",Sp="0.21.0";
|
|
3120
3120
|
/**
|
|
3121
3121
|
* @license
|
|
3122
3122
|
* Copyright 2020 Google LLC
|
|
@@ -3133,7 +3133,7 @@ const oA=new nh(5e3,15e3),aA="__/auth/iframe",dA="emulator/auth/iframe",cA={styl
|
|
|
3133
3133
|
* See the License for the specific language governing permissions and
|
|
3134
3134
|
* limitations under the License.
|
|
3135
3135
|
*/
|
|
3136
|
-
class
|
|
3136
|
+
class Ep{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),(null===(t=this.auth.currentUser)||void 0===t?void 0:t.uid)||null}async getToken(t){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(t)}}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const e=this.auth.onIdTokenChanged((e=>{t((null==e?void 0:e.stsTokenManager.accessToken)||null)}));this.internalListeners.set(t,e),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const e=this.internalListeners.get(t);e&&(this.internalListeners.delete(t),e(),this.updateProactiveRefresh())}assertAuthConfigured(){Wh(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}
|
|
3137
3137
|
/**
|
|
3138
3138
|
* @license
|
|
3139
3139
|
* Copyright 2020 Google LLC
|
|
@@ -3166,4 +3166,4 @@ class bA{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var
|
|
|
3166
3166
|
* See the License for the specific language governing permissions and
|
|
3167
3167
|
* limitations under the License.
|
|
3168
3168
|
*/
|
|
3169
|
-
const SA=h("authIdTokenMaxAge")||300;let EA=null;function TA(e=Me()){const t=Le(e,"auth");if(t.isInitialized())return t.getImmediate();const n=function(e,t){const n=Le(e,"auth");if(n.isInitialized()){const e=n.getImmediate();if(p(n.getOptions(),null!=t?t:{}))return e;ju(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:yA,persistence:[xf,gf,yf]}),r=h("authTokenSyncURL");if(r){const e=(i=r,async e=>{const t=e&&await e.getIdTokenResult(),n=t&&((new Date).getTime()-Date.parse(t.issuedAtTime))/1e3;if(n&&n>SA)return;const r=null==t?void 0:t.token;EA!==r&&(EA=r,await fetch(i,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))});!function(e,t,n){S(e).beforeAuthStateChanged(t,n)}(n,e,(()=>e(n.currentUser))),function(e,t,n,r){S(e).onIdTokenChanged(t,n,r)}(n,(t=>e(t)))}var i;const s=l("auth");return s&&Gh(n,`http://${s}`),n}var CA;CA="Browser",Re(new E("auth",((e,{options:t})=>{const n=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),{apiKey:i,authDomain:s}=n.options;return((e,n)=>{Wu(i&&!i.includes(":"),"invalid-api-key",{appName:e.name}),Wu(!(null==s?void 0:s.includes(":")),"argument-error",{appName:e.name});const r={apiKey:i,authDomain:s,clientPlatform:CA,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Fh(CA)},o=new zh(e,n,r);return function(e,t){const n=(null==t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Xu);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null==t?void 0:t.popupRedirectResolver)}(o,t),o})(n,r)}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((e,t,n)=>{e.getProvider("auth-internal").initialize()}))),Re(new E("auth-internal",(e=>(e=>new bA(e))(Vh(e.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),Ue(vA,wA,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(CA)),Ue(vA,wA,"esm2017");class IA extends Error{constructor(){super("Avatar not created"),this.name="AvatarNotCreatedError"}}class _A extends Error{constructor(){super("user not logged in"),this.name="UserNotLoggedInError"}}class kA extends Error{constructor(){super("no colorway size assets found"),this.name="NoColorwaySizeAssetsFoundError"}}class RA{constructor(e,t){this.firestore=e,this.brandUserId=null,this.auth=TA(t),this.auth.setPersistence(gf)}get id(){var e;return null===(e=this.user)||void 0===e?void 0:e.uid}onInit(){return new Promise((e=>{const t=this.auth.onAuthStateChanged((n=>{this.setUser(n),e(Boolean(n)),t()}))}))}setUser(e){this.user=e}setBrandUserId(e){this.brandUserId=e}async getToken(){var e;if(!(null===(e=this.user)||void 0===e?void 0:e.uid))throw new _A;return await this.user.getIdToken()}async getUserProfile(){var e;if(!(null===(e=this.user)||void 0===e?void 0:e.uid))throw new _A;return(await ku(Vl(this.firestore,"users",this.id))).data()}watchUserProfileForChanges(e){let t;const n=pu(zl(this.firestore,"users"),$u(new eu("__name__"),"==",this.id));return t=Du(n,(t=>e(t.docs[0].data()))),()=>t()}async login(e,t){this.auth.currentUser&&await this.auth.signOut();const n=await Af(this.auth,e,t);this.setUser(n.user)}async logout(){await this.auth.signOut(),this.setUser(null)}async sendPasswordResetEmail(e){await hf(this.auth,e)}async confirmPasswordReset(e,t){await ff(this.auth,e,t)}}class LA{constructor(){this.promisefyOnSnapshot=(e,t)=>{let n;return{promise:new Promise((r=>{n=Du(e,(e=>{r(e),t&&n()}))})),unsubscribe:()=>n()}};const e=Pe(xu.getInstance().firebase);this.firestore=Yl(e),this.user=new RA(this.firestore,e)}onInit(){return this.user.onInit()}query(e,t,n=!0){const r=pu(zl(this.firestore,e),t);return this.promisefyOnSnapshot(r,n)}getDocs(e,t){return Lu(pu(zl(this.firestore,e),...t))}async getDoc(e,t){const n=Vl(this.firestore,e,t),r=await ku(n);return r.exists()?r.data():null}}const DA=e=>{if(e.code===Vu)throw new Error("account has been disabled");throw new Error(e.message)};class OA{static get endpoint(){return xu.getInstance().api.url}static async Fetch({user:e,endpointPath:t,method:n,body:r,useToken:i=!0}){const s=this.getUrl(t,i),o={method:n,headers:await this.getHeaders(e,i),credentials:"include"};r&&(o.body=JSON.stringify(r));const a=await fetch(s,o);if(a.ok)return a;if(500===a.status)throw new Error(a.statusText);const d=await a.json();return Promise.reject(d)}static getUrl(e,t){return t?`${this.endpoint}/v1${e}`:this.endpoint+e}static async getHeaders(e,t){if(!t)return{"Content-Type":"application/json"};return{"Content-Type":"application/json",Authorization:`Bearer ${await e.getToken()}`}}static Get(e,t,n){return this.Fetch({user:e,endpointPath:t,method:"GET",body:null,useToken:n})}static Post(e,t,n=null,r){return this.Fetch({user:e,endpointPath:t,method:"POST",body:n,useToken:r})}static Put(e,t,n,r){return this.Fetch({user:e,endpointPath:t,method:"PUT",body:n,useToken:r})}static Patch(e,t,n,r){return this.Fetch({user:e,endpointPath:t,method:"PATCH",body:n,useToken:r})}static Delete(e,t,n,r){return this.Fetch({user:e,endpointPath:t,method:"DELETE",body:n,useToken:r})}}class xA{constructor(e,t){this.brandId=e,this.firebase=t,this.measurementLocations=new Map}get user(){return this.firebase.user}get isLoggedIn(){return!this.firebase||Boolean(this.user.id)}async onInit(){return await this.getMeasurementLocations(),this.firebase.onInit()}async getRecommendedSizes(e){var t,n;if(!this.isLoggedIn)throw new _A;try{const r=await OA.Get(this.user,`/styles/${e}/recommendation`),i=await r.json();return(null===(t=null==i?void 0:i.fits)||void 0===t?void 0:t.length)&&(null===(n=null==i?void 0:i.recommended_size)||void 0===n?void 0:n.id)?i:null}catch(e){if("avatar not created"===(null==e?void 0:e.error))throw new IA;throw e}}async submitTelephoneNumber(e){const t=e.replace(/[^\+0-9]/g,""),n=await OA.Post(this.user,"/ios-app-link",{phone_number:t},!1);console.log(n)}async getColorwaySizeAssetFromSku(e){const t=await this.getColorwaySizeAssets(null,[e]);if(!(null==t?void 0:t.size))throw new kA;return Array.from(t.values())[0]}async getColorwaySizeAssetFromBrandStyleId(e){const t=await this.getColorwaySizeAssets(e);if(!(null==t?void 0:t.size))throw new kA;return Array.from(t.values())[0]}async getMeasurementLocationsFromSku(e,t=[]){const n=await this.getColorwaySizeAssetFromSku(e);if(!n)throw new Error("No colorway size asset found for sku");const r=await this.getStyle(n.style_id);if(!r)throw new Error("Style category not found for style id");const i=await this.getGetTaxonomy(r.style_garment_category_id);if(!i)throw new Error("Taxonomy not found for style garment category id");return(t.length?i.garment_measurement_locations.female.filter((e=>t.includes(e))):i.garment_measurement_locations.female).map((e=>this.measurementLocations.has(e)?this.measurementLocations.get(e):e))}async getMeasurementLocationsFromBrandStyleId(e,t=[]){const n=await this.getColorwaySizeAssetFromBrandStyleId(e);if(!n)throw new Error("No colorway size asset found for brand style id");const r=await this.getStyle(n.style_id);if(!r)throw new Error("Style category not found for style id");const i=await this.getGetTaxonomy(r.style_garment_category_id);if(!i)throw new Error("Taxonomy not found for style garment category id");return(t.length?i.garment_measurement_locations.female.filter((e=>t.includes(e))):i.garment_measurement_locations.female).map((e=>this.measurementLocations.has(e)?this.measurementLocations.get(e):e))}async getStyleByBrandStyleId(e){var t,n;try{const r=[$u("brand_id","==",this.brandId)];r.push($u("brand_style_id","==",e));return null===(n=null===(t=(await this.firebase.getDocs("styles",r)).docs)||void 0===t?void 0:t[0])||void 0===n?void 0:n.data()}catch(e){return DA(e)}}async getColorwaySizeAssets(e,t){const n=[$u("brand_id","==",this.brandId)];e&&n.push($u("style_id","==",e)),(null==t?void 0:t.length)>0&&n.push($u("sku","in",t));try{const e=await this.firebase.getDocs("colorway_size_assets",n),t=new Map;return e.forEach((e=>{const n=e.data();t.set(n.id,n)})),t}catch(e){return DA(e)}}async getStyle(e){try{return await this.firebase.getDoc("styles",String(e))}catch(e){return DA(e)}}async getGetTaxonomy(e){try{return await this.firebase.getDoc("style_garment_categories",String(e))}catch(e){return DA(e)}}async getMeasurementLocations(){(await this.fetchMeasurementLocations()).forEach((e=>{this.measurementLocations.set(e.name,e.label)}))}async fetchMeasurementLocations(){try{return(await this.firebase.getDocs("garment_measurement_locations",[])).docs.map((e=>e.data()))}catch(e){return DA(e)}}}var PA;!function(e){e.ACROSS_BACK="across_back",e.ACROSS_FRONT="across_front",e.ACROSS_SHOULDER="across_shoulder",e.ANKLE="ankle",e.ARMEYE="arm_eye",e.ARM_LENGTH_FROM_SHOULDER="arm_length_from_shoulder",e.BACK_CROTCH_LENGTH="back_crotch_length",e.BACK_NECK_TO_EBLOW="back_neck_to_elbow",e.BELOW_KNEE="below_knee",e.BICEP="bicep",e.BUST="bust",e.BUST_POINT_TO_BUST_POINT="bust_point_to_bust_point",e.CALF="calf",e.CB_NECK_TO_WAIST="cb_neck_to_waist",e.CB_NECK_TO_WRIST="cb_neck_to_wrist",e.CF_NECK_TO_WAIST="cf_neck_to_waist",e.ELBOW="elbow",e.FOREARM="forearm",e.FRONT_CROTCH_LENGTH="front_crotch_length",e.HIGH_HIP_PLACEMENT_FROM_WAIST="high_hip_placement",e.HIGH_HIP="high_hip",e.HSP_TO_ACROSS_BACK="hsp_to_across_back",e.HSP_TO_ACROSS_FRONT="hsp_to_across_front",e.HSP_TO_BUST_POINT="hsp_to_bust_point",e.HSP_TO_LOW_HIP_POSITION="hsp_to_low_hip_position",e.HSP_TO_WAIST_POSITION="hsp_to_waist_position",e.INSEAM="inseam",e.KNEE="knee",e.LOW_HIP="low_hip",e.LOW_HIP_PLACEMENT_FROM_WAIST="low_hip_placement",e.MID_NECK="mid_neck",e.NECK_AT_BASE="neck_base",e.SHOULDER_DROP="shoulder_drop",e.SHOULDER_TO_SHOULDER="shoulder_to_shoulder",e.SIDE_WAIST_TO_FLOOR="side_waist_to_floor",e.SIDE_WAIST_TO_KNEE="side_waist_to_knee",e.THIGH="thigh",e.TOTAL_RISE_LENGTH="total_rise_length",e.UNDER_BUST="under_bust",e.VERTICAL_TRUNK="vertical_trunk",e.WAIST="waist",e.WRIST="wrist"}(PA||(PA={}));const MA={[PA.ACROSS_BACK]:"Across back",[PA.ACROSS_FRONT]:"Across front",[PA.ACROSS_SHOULDER]:"Across shoulder",[PA.ANKLE]:"Ankle",[PA.ARMEYE]:"Armeye",[PA.ARM_LENGTH_FROM_SHOULDER]:"Arm length from shoulder",[PA.BACK_CROTCH_LENGTH]:"Back crotch length",[PA.BACK_NECK_TO_EBLOW]:"Back neck to eblow",[PA.BELOW_KNEE]:"Below knee",[PA.BICEP]:"Bicep",[PA.BUST]:"Chest/Bust",[PA.BUST_POINT_TO_BUST_POINT]:"Bust point to bust point",[PA.CALF]:"Calf",[PA.CB_NECK_TO_WAIST]:"Cb neck to waist",[PA.CB_NECK_TO_WRIST]:"Cb neck to wrist",[PA.CF_NECK_TO_WAIST]:"Cf neck to waist",[PA.ELBOW]:"Elbow",[PA.FOREARM]:"Forearm",[PA.FRONT_CROTCH_LENGTH]:"Front crotch length",[PA.HIGH_HIP_PLACEMENT_FROM_WAIST]:"High hip placement from waist",[PA.HIGH_HIP]:"High hip",[PA.HSP_TO_ACROSS_BACK]:"Hsp to across back",[PA.HSP_TO_ACROSS_FRONT]:"Hsp to across front",[PA.HSP_TO_BUST_POINT]:"Hsp to bust point",[PA.HSP_TO_LOW_HIP_POSITION]:"Hsp to low hip position",[PA.HSP_TO_WAIST_POSITION]:"Hsp to waist position",[PA.INSEAM]:"Inseam",[PA.KNEE]:"Knee",[PA.LOW_HIP]:"Low hip",[PA.LOW_HIP_PLACEMENT_FROM_WAIST]:"Low hip placement from waist",[PA.MID_NECK]:"Mid neck",[PA.NECK_AT_BASE]:"Neck at base",[PA.SHOULDER_DROP]:"Shoulder drop",[PA.SHOULDER_TO_SHOULDER]:"Shoulder to shoulder",[PA.SIDE_WAIST_TO_FLOOR]:"Side waist to floor",[PA.SIDE_WAIST_TO_KNEE]:"Side waist to knee",[PA.THIGH]:"Thigh",[PA.TOTAL_RISE_LENGTH]:"Total rise length",[PA.UNDER_BUST]:"Under bust",[PA.VERTICAL_TRUNK]:"Vertical trunk",[PA.WAIST]:"Waist",[PA.WRIST]:"Wrist"};var UA;!function(e){e.BLOUSES="blouses",e.COATS="coats",e.DRESSES="dresses",e.JACKETS="jackets",e.PANTS="pants",e.PUFFERS_AND_PARKAS="puffer_and_parkas",e.SHORTS="shorts",e.SKIRTS="skirts",e.SWEATERS="sweaters",e.T_SHIRTS_AND_TANKS="t_shirts_and_tanks"}(UA||(UA={}));const FA={[UA.BLOUSES]:[PA.BUST,PA.ACROSS_SHOULDER,PA.WAIST,PA.LOW_HIP,PA.HIGH_HIP],[UA.COATS]:[PA.BUST,PA.ACROSS_SHOULDER,PA.WAIST,PA.LOW_HIP,PA.HIGH_HIP],[UA.DRESSES]:[PA.LOW_HIP,PA.BUST,PA.ACROSS_SHOULDER,PA.WAIST],[UA.JACKETS]:[PA.BUST,PA.ACROSS_SHOULDER,PA.WAIST,PA.LOW_HIP,PA.HIGH_HIP],[UA.PANTS]:[PA.LOW_HIP,PA.WAIST,PA.THIGH,PA.INSEAM],[UA.PUFFERS_AND_PARKAS]:[PA.BUST,PA.ACROSS_SHOULDER,PA.WAIST,PA.LOW_HIP,PA.HIGH_HIP],[UA.SHORTS]:[PA.LOW_HIP,PA.WAIST,PA.THIGH,PA.INSEAM],[UA.SKIRTS]:[PA.LOW_HIP,PA.WAIST],[UA.SWEATERS]:[PA.BUST,PA.ACROSS_SHOULDER,PA.WAIST,PA.LOW_HIP,PA.HIGH_HIP],[UA.T_SHIRTS_AND_TANKS]:[PA.BUST,PA.ACROSS_SHOULDER,PA.WAIST,PA.LOW_HIP,PA.HIGH_HIP]},BA={activewear:"Active Wear",dresses:"Dresses",jackets_and_coats:"Jackets and Coats",jeans:"Jeans",jumpsuits_and_rompers:"Jumpsuits and Rompers",pants_and_shorts:"Pants and Shorts",skirts:"Skirts",suits_and_tailoring:"Suits and Tailoring",sweaters:"Sweaters",tops:"Tops"},zA={a_line:"A Line",a_line_flared:"A Line Flared",blazers:"Blazers",bodycon:"Bodycon",bodysuits:"Bodysuits",boiler_suits:"Boiler Suits",bootcut:"Bootcut",cardigans:"Cardigans",cigarette:"Cigarette",corsets_and_bustiers:"Corsets and Bustiers",crewnecks:"Crewnecks",culottes:"Culottes",denim:"Denim",denim_jackets:"Denim Jackets",denim_shorts:"Denim Shorts",fit_and_flare:"Fit and Flare",flared:"Flared",hoodies_and_zipups:"Hoodies and Zipups",joggers:"Joggers",jumpsuits:"Jumpsuits",knit:"Knit",leggings:"Leggings",mom:"Mom",overalls:"Overalls",parkas:"Parkas",peacoats:"Peacoats",pencil:"Pencil",pleated:"Pleated",polos:"Polos",puffer_jackets:"Puffer Jackets",raincoats:"Raincoats",relaxed:"Relaxed",rompers:"Rompers",shackets:"Shackets",shirt:"Shirt",shirts_and_blouses:"Shirts and Blouses",skater:"Skater",skinny:"Skinny",slim:"Slim",slip:"Slip",sports_bras:"Sports Bras",straight:"Straight",suit_jackets:"Suit Jackets",suit_skirts:"Suit Skirts",suit_trousers:"Suit Trousers",suit_vests:"Suit Vests",sweatshirts:"Sweatshirts",t_shirts:"T-Shirts",tank_tops_and_camisoles:"Tank Tops and Camisoles",tapered:"Tapered",trench_coats:"Trench Coats",trousers:"Trousers",turtlenecks:"Turtleneck",unitards:"Unitards",v_necks:"V-Necks",wide_leg:"Wide Leg",wrap:"Wrap"},VA={activewear:{leggings:UA.PANTS,joggers:UA.PANTS,sweatshirts:UA.SWEATERS},dresses:{a_line:UA.DRESSES,bodycon:UA.DRESSES,fit_and_flare:UA.DRESSES,knit:UA.DRESSES,shirt:UA.DRESSES,slip:UA.DRESSES,straight:UA.DRESSES,wrap:UA.DRESSES},jackets_and_coats:{denim_jackets:UA.JACKETS,parkas:UA.PUFFERS_AND_PARKAS,peacoats:UA.COATS,puffer_jackets:UA.PUFFERS_AND_PARKAS,raincoats:UA.COATS,rompers:UA.COATS,shackets:UA.JACKETS,trench_coats:UA.COATS},jeans:{bootcut:UA.PANTS,flared:UA.PANTS,mom:UA.PANTS,relaxed:UA.PANTS,skinny:UA.PANTS,slim:UA.PANTS,straight:UA.PANTS,tapered:UA.PANTS,wide_leg:UA.PANTS},jumpsuits_and_rompers:{boiler_suits:UA.DRESSES,denim:UA.DRESSES,jumpsuits:UA.DRESSES,overalls:UA.DRESSES,rompers:UA.DRESSES,unitards:UA.DRESSES},pants_and_shorts:{cigarette:UA.PANTS,culottes:UA.SHORTS,denim_shorts:UA.SHORTS,flared:UA.PANTS,joggers:UA.PANTS,leggings:UA.PANTS,skinny:UA.PANTS,wide_leg:UA.PANTS},skirts:{a_line_flared:UA.SKIRTS,denim:UA.SKIRTS,knit:UA.SKIRTS,pencil:UA.SKIRTS,pleated:UA.SKIRTS,skater:UA.SKIRTS,slip:UA.SKIRTS,wrap:UA.SKIRTS},suits_and_tailoring:{blazers:UA.JACKETS,suit_jackets:UA.JACKETS,suit_skirts:UA.SKIRTS,suit_trousers:UA.PANTS,suit_vests:UA.SWEATERS,trousers:UA.PANTS},sweaters:{cardigans:UA.SWEATERS,crewnecks:UA.SWEATERS,hoodies_and_zipups:UA.SWEATERS,sweatshirts:UA.SWEATERS,turtlenecks:UA.SWEATERS,v_necks:UA.SWEATERS},tops:{bodysuits:UA.BLOUSES,corsets_and_bustiers:UA.BLOUSES,polos:UA.T_SHIRTS_AND_TANKS,shirts_and_blouses:UA.BLOUSES,t_shirts:UA.T_SHIRTS_AND_TANKS,tank_tops_and_camisoles:UA.T_SHIRTS_AND_TANKS}};var HA;!function(e){e.TOO_TIGHT="too_tight",e.TIGHT="tight",e.SLIGHTLY_TIGHT="slightly_tight",e.PERFECT_FIT="perfect_fit",e.SLIGHTLY_LOOSE="slightly_loose",e.LOOSE="loose",e.OVERSIZED="oversized",e.TOO_SHORT="too_short",e.SHORT="short",e.SLIGHTLY_SHORT="slightly_short",e.SLIGHTLY_LONG="slightly_long",e.LONG="long",e.TOO_LONG="too_long"}(HA||(HA={}));const GA={[HA.TOO_TIGHT]:"Too Tight",[HA.TIGHT]:"Tight",[HA.SLIGHTLY_TIGHT]:"Slightly Tight",[HA.PERFECT_FIT]:"Perfect Fit",[HA.SLIGHTLY_LOOSE]:"Slightly Loose",[HA.LOOSE]:"Loose",[HA.OVERSIZED]:"Oversized",[HA.TOO_SHORT]:"Too Short",[HA.SHORT]:"Short",[HA.SLIGHTLY_SHORT]:"Slightly Short",[HA.SLIGHTLY_LONG]:"Slightly Long",[HA.LONG]:"Long",[HA.TOO_LONG]:"Too Long"};var jA;!function(e){e.NOT_CREATED="NOT_CREATED",e.CREATED="CREATED",e.PENDING="PENDING"}(jA||(jA={}));var qA=Object.freeze({__proto__:null,get AvatarState(){return jA},get MeasurementLocation(){return PA},MeasurementLocationName:MA,get Classification(){return UA},ClassificationLocations:FA,CategoryNames:BA,Categories:["activewear","dresses","jackets_and_coats","jeans","jumpsuits_and_rompers","pants_and_shorts","skirts","suits_and_tailoring","sweaters","tops"],SubcategoryNames:zA,Taxonomy:VA,get Fit(){return HA},FitNames:GA}),KA="Back to sign in",WA="Don't have an account?",QA="Whoops! Looks like you don't have an avatar yet.",YA="Email address",JA="Please enter a valid email address.",XA="Enter your email address, we will send you a link to reset your password.",ZA="Enter your number for download link",eN="Forgot password?",tN="Have an account? Sign in",nN="Your avatar is loading...",rN="Unfortunately, that size is not available for try on.",iN="or",sN="Password",oN="Please enter a valid password (at least 7 characters).",aN="Phone number",dN="Return to Catalog Page",cN="Return to Product Page",lN="Return to site",uN="Please return to The Fitting Room app to create your avatar.",hN="Send",fN="Sign back in",AN="Sign in",NN="Something went wrong. Try again!",mN="You have successfully logged out!",pN="The Fitting Room",gN="Username or password is empty.",$N="Username or password is incorrect.",yN="End size uncertainty with",vN="Our technology captures your precise measurements, and considers things like fabric stretch and your individual physique for the perfect fit every time.";var wN=[],bN=[];function SN(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",i=!0===t.singleTag,s="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var o=wN.indexOf(s);-1===o&&(o=wN.push(s)-1,bN[o]={}),n=bN[o]&&bN[o][r]?bN[o][r]:bN[o][r]=a()}else n=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),i=0;i<n.length;i++)e.setAttribute(n[i],t.attributes[n[i]]);var o="prepend"===r?"afterbegin":"beforeend";return s.insertAdjacentElement(o,e),e}}SN(".tfr-c-white{color:var(--tfr-white)}.tfr-c-brand{color:var(--tfr-brand-color)}.tfr-c-brand-bg{background-color:var(--tfr-brand-color)}.tfr-c-black{color:var(--tfr-black)}.tfr-c-black-o5{color:rgba(0,0,0,.5)}.tfr-c-red{color:var(--tfr-red)}",{});SN(".tfr-home-button-container{display:flex;flex-wrap:wrap;margin:20px}.tfr-home-button-container>button{border:0;cursor:pointer;height:60px;margin:20px;width:200px}.tfr-home-button-container>button:hover{background-color:#e6e6e6}[data-tfr=hidden]{display:none}.tfr-modal{background-color:rgba(0,0,0,.53);display:flex;height:100%;left:0;position:fixed;top:0;width:100%;z-index:10000}.tfr-modal-content{margin:auto;text-align:center;width:90%}.tfr-modal-content-flex{align-items:center;display:flex}.tfr-modal-content-container{background-color:#fff;border:1px solid #434343;border-radius:0;box-shadow:0 6px 6px #00000029;line-height:normal;margin:auto;max-height:100vh;max-width:709px;overflow:auto;width:100%}.tfr-close-container{text-align:end}.tfr-close{color:#aaa;font-size:28px;font-weight:700;height:50px;width:50px}.tfr-close:focus,.tfr-close:hover{color:#000;text-decoration:none}.tfr-cursor:hover{cursor:pointer}.tfr-underline{text-decoration:underline}.tfr-standard-button{border:0;border-radius:3px;color:#fff;height:43px;width:138px}.tfr-logo-container{align-items:center;display:flex}.tfr-modal-title-logo-container{align-items:center;display:flex;justify-content:center}.tfr-girl-clothes{display:inline-block;height:316px;width:253px}.tfr-t-a-center{text-align:center}.tfr-w-70-p{width:70%}.tfr-w-80-p{width:80%}.tfr-w-85-p{width:85%}.tfr-w-150{width:150px}.tfr-h-150{height:150px}.tfr-d-none{display:none}.tfr-d-block{display:block}.tfr-d-flex{display:flex}.tfr-how-it-works-item{align-items:center;display:flex;justify-items:center}.tfr-try-on-content{margin-left:60px}#tfr-tryon-image{max-width:30vw}.progress-bar{background-color:#fff;border:1px solid #bdbdbd;height:10px;margin:15px auto 0;width:55%}.progress-bar-fill{animation-duration:120s;animation-name:progress;background-color:#209da7;color:#fff;display:block;font-size:16px;height:100%;text-align:center;transition:width .6s linear}#tfr-video{height:100%;max-height:390px;max-width:390px}.tfr-logo-box{aspect-ratio:1;margin:auto;max-height:430px;max-width:430px;padding:20px}.tfr-flex,.tfr-logo-box{align-items:center;display:flex;justify-content:center}",{});SN("input{border:none;box-shadow:none!important;width:100%}input:focus,select:focus,textarea:focus{border:none;outline:none}.tfr-fieldset{margin-left:auto;margin-right:auto;width:65%}.tfr-fieldset,.tfr-fieldset-inline{border-color:rgba(0,0,0,.5);border-radius:10px;border-width:1px;padding:5px 10px 10px;text-align:left}.tfr-fieldset-inline{margin-right:10px;width:250px}.tfr-fieldset-err{border-color:red}",{});SN(".lds-ellipsis{display:inline-block;height:80px;position:relative;width:80px}.lds-ellipsis div{animation-timing-function:cubic-bezier(0,1,1,0);background:var(--tfr-brand-color);border-radius:50%;display:block;height:13px;position:absolute;top:33px;width:13px}.lds-ellipsis div:first-child{animation:lds-ellipsis1 .6s infinite;left:8px}.lds-ellipsis div:nth-child(2){animation:lds-ellipsis2 .6s infinite;left:8px}.lds-ellipsis div:nth-child(3){animation:lds-ellipsis2 .6s infinite;left:32px}.lds-ellipsis div:nth-child(4){animation:lds-ellipsis3 .6s infinite;left:56px}@keyframes lds-ellipsis1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0)}to{transform:translate(24px)}}",{});SN("@media screen and (max-width:702px){.tfr-modal-title-logo-container{display:flex;flex-direction:column}}@media screen and (min-width:600px){.tfr-modal-content-container{border-radius:10px;height:auto}}@media screen and (max-width:599px){.tfr-mobile-hidden{display:none}.tfr-modal-content-container{min-height:100vh}.trf-logo-title{margin-bottom:10px}.tfr-modal-content-flex{height:calc(100vh - 76px)}}@media screen and (max-width:500px){.tfr-fieldset{width:90%}.tfr-how-it-works-item{flex-direction:column}.tfr-try-on-content{margin-left:0;margin-top:20px}}",{});SN("#tfr-size-recommendations{background-color:var(--tfr-main-bg-color);border:var(--tfr-main-border-width) solid var(--tfr-main-border-color);border-radius:var(--tfr-main-border-radius);color:var(--tfr-dark);display:flex;font-family:var(--tfr-main-font);padding:var(--tfr-main-v-padding) var(--tfr-main-h-padding);width:var(--tfr-main-width)}#tfr-size-recommendations,#tfr-size-recommendations-container{align-items:center;flex-direction:column;justify-content:center}#tfr-size-recommendations-container{display:none;width:100%}#tfr-size-rec-login-svg{display:none}#tfr-size-rec-title{align-items:center;display:flex;font-family:var(--tfr-title-font);margin-bottom:8px}#tfr-size-rec-subtitle{font-family:var(--tfr-subtitle-font);margin-bottom:6px}#tfr-size-rec-subtitle,#tfr-size-rec-title{font-size:16px;font-weight:700}#tfr-size-rec-table{display:flex;flex-direction:column;font-size:12px;width:100%}.tfr-size-rec-table-row:first-of-type{border-top-width:2px}.tfr-size-rec-table-row{align-items:center;border-top:var(--tfr-main-border-width) solid var(--tfr-main-border-color);display:flex;font-family:var(--tfr-row-font);height:40px;justify-content:center}.tfr-size-rec-table-cell-left,.tfr-size-rec-table-cell-right{flex:1 1 0px}.tfr-size-rec-table-cell-left{font-weight:700;margin-right:70px;text-align:right}.tfr-size-rec-table-cell-right{margin-left:16px}.tfr-size-rec-table-cell-right.perfect{color:var(--tfr-brand-color)}#tfr-size-rec-size{display:inline-block}#tfr-size-rec-size>.tfr-size-rec-login-cta{font-weight:500;margin-left:10px}.tfr-size-rec-login-cta,.tfr-size-rec-table-cell-right{font-size:12px}.tfr-size-rec-login-cta{color:var(--tfr-muted);display:flex}#tfr-size-rec-action-login,#tfr-size-rec-action-logout{display:none;font-family:var(--tfr-cta-font)}#tfr-size-rec-action{cursor:pointer;font-size:16px;margin-top:14px;text-decoration:underline}#tfr-size-rec-select{background-color:var(--tfr-size-selector-bg-color);border-radius:8px;box-shadow:0 4px 4px 0 rgba(0,0,0,.3);color:var(--tfr-size-selector-text-color);display:none;font-size:14px;margin-bottom:20px;margin-top:10px}#tfr-size-rec-select,.tfr-size-rec-select-button{align-items:center;height:35px;justify-content:center}.tfr-size-rec-select-button{cursor:pointer;display:flex;transition:all .15s ease-in;width:80px}.tfr-size-rec-select-button:hover:not(.active){background-color:var(--tfr-size-selector-bg-color-hover);opacity:.7}.tfr-size-rec-select-button.active{background-color:var(--tfr-size-selector-bg-color-active);height:45px}.tfr-size-rec-select-button.active,.tfr-size-rec-select-button:first-of-type{border-bottom-left-radius:8px;border-top-left-radius:8px}.tfr-size-rec-select-button.active,.tfr-size-rec-select-button:last-of-type{border-bottom-right-radius:8px;border-top-right-radius:8px}.tfr-powered-by{align-items:center;display:flex;font-size:10px;margin-top:10px}.tfr-powered-by-logo{margin:0 4px}.tfr-powered-by-logo,.tfr-powered-by-logo img{height:24px}.tfr-powered-by-text-bold{font-weight:700}#tfr-size-recommendation-error{color:#8d0000;display:none}",{});SN(".tfr-mt-10{margin-top:10px}.tfr-mt-20{margin-top:20px}.tfr-mt-15{margin-top:15px}.tfr-mt-30{margin-top:30px}.mt-40{margin-top:40px}.tfr-mb-40{margin-bottom:40px}.tfr-mb-20{margin-bottom:20px}.tfr-mr-10{margin-right:10px}.tfr-mr-15{margin-right:15px}.tfr-mt-50{margin-top:50px}.tfr-mt-60{margin-top:60px}.tfr-mb-60{margin-bottom:60px}.tfr-mr-20{margin-right:20px}.tfr-mt-15-p{margin-top:15%}.tfr-mb-13-p{margin-bottom:13%}.tfr-m-h-auto{margin-left:auto;margin-right:auto}.tfr-pt-20{padding-top:20px}.tfr-pb-50{padding-bottom:50px}.tfr-p-20{padding:20px}.tfr-pr-20{padding-right:20px}.tfr-pl-20{padding-left:20px}.tfr-pb-7-p{padding-bottom:7%}",{});SN(".flag-container{bottom:0;left:0;padding:1px;right:0;right:auto;top:0}.flag-container:hover{cursor:pointer}.selected-flag{align-items:center;display:flex;height:100%;padding:0 6px 0 8px;position:relative;z-index:1}.flag.bd{background-position:-418px 0;height:12px}.arrow{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #555;height:0;margin-left:6px;width:0}.arrow-up{border-bottom:6px solid #555;border-top:none}.country-list{-webkit-overflow-scrolling:touch;background-color:#fff;border-radius:5px;box-shadow:0 8px 10px 1px rgba(57,64,78,.7),0 3px 14px 2px rgba(57,64,78,.7),0 5px 5px -3px rgba(57,64,78,.7);cursor:pointer;display:none;font-size:16px;line-height:18px;list-style:none;margin:0 0 0 -1px;max-height:500px;overflow:auto;padding:0;position:absolute;text-align:left;top:50%;transform:translateY(-50%);white-space:nowrap;width:100%;width:auto;z-index:2}.country-list.active{display:inline-block}.country{outline:0;padding:5px 26px 5px 15px}.country-list .divider{border-bottom:1px solid rgba(0,0,0,.12);margin-bottom:5px;padding-bottom:5px}.country.highlight{background-color:#c7cace}.flag-box{display:inline-block;width:20px}.country-name,.flag-box{margin-right:6px}.country-name,.dial-code,.flag-box{vertical-align:middle}",{});SN(".tfr-title-font{font-family:Poppins,sans-serif}.tfr-body-font{font-family:Roboto,sans-serif}.tfr-light-24-300{font-size:24px;font-weight:300}.tfr-light-24-500{font-size:24px;font-weight:500}.tfr-light-22-300{font-size:22px;font-weight:300}.tfr-light-16-300{font-size:16px;font-weight:300}.tfr-medium-16-default{font-size:16px}.tfr-12-default{font-size:12px}.tfr-14-default{font-size:14px}.tfr-16-default{font-size:16px}",{});SN(":root{--tfr-brand-color:#209da7;--tfr-black:#000;--tfr-red:red;--tfr-white:#fff;--tfr-muted:#a7a7a7;--tfr-dark:#121212;--tfr-grey:#878787;--tfr-light-grey:#f5f5f5;--tfr-main-border-color:hsla(0,0%,7%,.55);--tfr-main-border-radius:0;--tfr-main-border-width:1px;--tfr-main-bg-color:inherit;--tfr-main-width:440px;--tfr-main-v-padding:14px;--tfr-main-h-padding:20px;--tfr-main-font:inherit;--tfr-title-font:var(--tfr-main-font);--tfr-subtitle-font:var(--tfr-main-font);--tfr-row-font:var(--tfr-main-font);--tfr-cta-font:var(--tfr-main-font);--tfr-size-selector-text-color:var(--tfr-white);--tfr-size-selector-bg-color:var(--tfr-grey);--tfr-size-selector-bg-color-hover:var(--tfr-light-grey);--tfr-size-selector-bg-color-active:var(--tfr-dark)}",{});const EN=e=>({Hook:()=>{const t=document.querySelector(".progress-bar-fill");!function(e,t){let n=0;const r=e/200;t.style.width=n+"%";const i=setInterval((()=>{n>=100?clearInterval(i):(n+=.5,t.style.width=n+"%")}),r)}(e.timeoutMS,t)},Unhook:()=>{},Body:()=>`\n <div tfr-element="true" class="tfr-title-font tfr-light-22-300 tfr-c-black tfr-mt-60" > ${nN} </div>\n <div class="progress-bar">\n <span class="progress-bar-fill"></span>\n </div>\n `}),TN=e=>{const t=document.getElementById(e);if(!t)throw new Error(`element with id ${e} not found`);let n;const r=()=>{n&&(n.Unhook(),a()),t.style.display="none"},i=e=>{"Escape"===e.key&&r()},s=e=>{const n=t.querySelector("#tfr-modal-background");e.target===n&&(console.debug("container close"),r())},o=()=>{t.querySelector("#tfr-close-container").addEventListener("click",r),document.addEventListener("keydown",i),document.addEventListener("click",s)},a=()=>{var n;const o=t.querySelector("#tfr-close-container");o?o.removeEventListener("click",r):(console.error("#tfr-close-container not found on unhook"),console.debug(null===(n=document.getElementById(e))||void 0===n?void 0:n.innerHTML)),document.removeEventListener("keydown",i),document.removeEventListener("click",s)};return{open:e=>{var r;n&&n.Unhook(),t.innerHTML=(r=e.Body(),`\n <div class="tfr-modal" id="tfr-modal-background">\n <div class="tfr-modal-content-container tfr-p-20">\n <div class="tfr-close-container">\n <span id="tfr-close-container" class="tfr-close tfr-cursor">×</span>\n </div>\n\n <div class="tfr-modal-content-flex">\n <div class="tfr-modal-content tfr-pt-20 tfr-pb-50">\n <div class="tfr-modal-title-logo-container">\n <div tfr-element="true" class="trf-logo-title tfr-title-font tfr-light-24-300 tfr-c-black tfr-mr-10">${yN}</div>\n <div tfr-element="true" class="tfr-logo-container">\n <div class="tfr-mr-15">\n <svg width="26" height="47" viewBox="0 0 68 124" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M0.911938 0L67.4819 17.09V106.49L0.911938 123.51V0Z" fill="#209DA7">\n </path>\n <path d="M52.8019 64.44C54.7791 64.44 56.3819 62.4387 56.3819 59.97C56.3819 57.5013 54.7791 55.5 52.8019 55.5C50.8248 55.5 49.2219 57.5013 49.2219 59.97C49.2219 62.4387 50.8248 64.44 52.8019 64.44Z" fill="white">\n </path>\n </svg>\n </div>\n <div tfr-element="true" class="tfr-title-font tfr-light-24-500 tfr-c-black tfr-mr-10">${pN}</div>\n </div>\n </div>\n ${r}\n </div>\n </div>\n </div>\n </div>\n `),o(),e.Hook(),t.style.display="block",n=e},close:r,Content:()=>n}},CN=e=>{!function(e){var t=[];void 0===IN.preferredCountries&&null!==IN.preferredCountries||IN.preferredCountries.length&&IN.preferredCountries.forEach((function(e){var n=h(e.toUpperCase());n[1]&&t.push(n[1])}));var n=IN.preferredCountries.length?t.concat(IN.countries):IN.countries,r=` <div class="flag-container">\n <div class="selected-flag">\n <div class="flag ${n[0].cca2}"></div>\n <div class="arrow"></div>\n </div>\n </div>`;e.insertAdjacentHTML("beforebegin",r);r='<ul class="country-list"></ul>';e.insertAdjacentHTML("beforebegin",r);var i=e.previousElementSibling;if(t.length){m(i,t,"preferred");r='<li class="divider"></li>';i.insertAdjacentHTML("beforeend",r)}IN.countries.length&&m(i,IN.countries,"standard");e.value="+"+n[0].dialCode;var s,o=i.querySelector("li.country");o&&o.classList.add("active");function a(e,n){for(var r=h(n),i=t.length+r[0],s=0;s<t.length;s++)t[s].cca2==n&&(i=s);A(e,i),e.previousElementSibling.querySelector(".selected-flag .flag").setAttribute("class",`flag ${n.toLowerCase()}`)}function d(e,t){var r=e.parentElement;A(r,t),r.previousElementSibling.querySelector(".selected-flag .flag").setAttribute("class",`flag ${n[t].cca2.toLowerCase()}`);var i=r.nextElementSibling,s=f(i.value,n[t].dialCode);i.value=s,l()}function c(e,t=!0){if("undefined"!==e&&void 0!==e){var n=e.parentElement,r=n.querySelectorAll("li.country"),i=Array.from(r).indexOf(e),s=n.offsetHeight,o=e.offsetHeight,a=n.scrollTop,d=o*i;t?((d+o<a||d+o>a+s)&&n.scrollTo({top:d+o-s/2}),u(n)):n.scrollTo({top:d+o-s/2}),e.classList.add("highlight")}}function l(){u(e.previousElementSibling),e.previousElementSibling.classList.remove("active"),e.previousElementSibling.previousElementSibling.querySelector(".arrow").classList.remove("arrow-up")}function u(e){var t=e.querySelectorAll("li.country.highlight");t&&t.forEach((function(e){e.classList.remove("highlight")}))}function h(e){for(var t=0;t<IN.countries.length;t++)if(IN.countries[t].cca2.toUpperCase()==e)return[t,IN.countries[t]];return null}function f(e,t){var n,r="+"+LN(e).dialCode,i="+"+t;return r.length>1?(n=e.replace(r,i),e==r&&(n+=" ")):n=e.length&&"+"!=e.substr(0,1)?i+" "+e.trim():i+" ",n}function A(e,n){if(e.innerHTML="",t.length){m(e,t,"preferred");var r='<li class="divider"></li>';e.insertAdjacentHTML("beforeend",r)}IN.countries.length&&m(e,IN.countries,"standard"),e.querySelectorAll("li.country")[n].classList.add("active"),N(e)}function N(e){var t=!1,n=e.querySelectorAll("li.country"),r=e.previousElementSibling.querySelector(".selected-flag");r.addEventListener("click",(function(n){n.stopPropagation(),n.preventDefault(),t=!1,e.classList.add("active"),r.querySelector(".arrow").classList.toggle("arrow-up");var i=e.querySelector("li.active");if(i){function d(e){e.stopPropagation(),e.preventDefault()}function l(e){return e.stopPropagation(),e.preventDefault(),!{38:1,40:1}[e.keyCode]}c(i,!1);var s=!1;try{var o=Object.defineProperty({},"passive",{get:function(){s=!0}});window.addEventListener("testPassive",null,o),window.removeEventListener("testPassive",null,o)}catch(n){}function u(e){e.addEventListener("scroll",d,!1),e.addEventListener(a,d,!!s&&{passive:!1}),e.addEventListener("touchmove",d,!!s&&{passive:!1}),e.addEventListener("keydown",l,!1)}function h(e){e.removeEventListener("scroll",d,!1),e.removeEventListener(a,d,!!s&&{passive:!0}),e.removeEventListener("touchmove",d,!!s&&{passive:!0}),e.removeEventListener("keydown",l,!1)}var a="onwheel"in document.createElement("div")?"wheel":"DOMMouseScroll";e.addEventListener(a,(function(t){Math.sign(t.deltaY)<0?e.scrollTop<=0?u(e):h(e):Math.sign(t.deltaY)>0&&(e.scrollHeight-e.offsetHeight<=e.scrollTop?u(e):h(e))}),!!s&&{passive:!0})}})),n.forEach((function(e,n){e.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault(),d(e,n),l()})),e.addEventListener("mouseenter",(function(n){n.stopPropagation(),n.preventDefault(),t&&(t=!0,u(e.parentElement),e.classList.add("highlight"))})),e.addEventListener("mousemove",(function(n){n.stopPropagation(),n.preventDefault(),t||(t=!0,u(e.parentElement),e.classList.add("highlight"))}))}))}function m(e,t,n){var r="";t.forEach((function(e){r+=`<li class="country ${n}">\n <div class="flag-box">\n <div class="flag ${e.cca2}"></div>\n </div>\n <span class="country-name">${e.name}</span>\n <span class="dial-code">+${e.dialCode}</span>\n </li>`})),e.insertAdjacentHTML("beforeend",r)}N(i),e.addEventListener("keyup",(function(){var t=e.previousElementSibling,n=LN(e.value);if(n.prefixesDialCode){var r=t.previousElementSibling.querySelector(".selected-flag .flag"),i=function(e,t){var n,r=function(e,t){var n=e.replace(/\D/g,""),r={dialCode:n.substr(0,t.length),prefixes:n.substr(t.length,n.length),phoneNumber:e};return r}(e,t),i=_N[r.dialCode];if(null==i)n=null;else if(1==i.length)n=i[0];else for(var s=0;s<i.length;s++){if(null!=IN.phoneNumberValidator[i[s]][23]){if(0==r.prefixes.search(IN.phoneNumberValidator[i[s]][23])){n=i[s];break}}else if(-1!=DN(r.prefixes,IN.phoneNumberValidator[i[s]])){n=i[s];break}n=i[0]}return n}(e.value,n.prefixesDialCode);r.classList.contains(i)||a(t,i)}})),document.addEventListener("click",(function(){l()})),document.addEventListener("keydown",(function(e){var t=document.querySelector("ul.country-list.active");if(t){e.stopPropagation(),e.preventDefault();var n=t.querySelectorAll("li.country"),r=t.querySelector("li.active"),i=t.querySelector("li.highlight");s=i?Array.from(n).indexOf(i):Array.from(n).indexOf(r);n=t.querySelectorAll("li.country");"ArrowUp"===e.key&&c(n[s-1]),"ArrowDown"===e.key&&c(n[s+1]),"Enter"===e.key&&d(n[s],s),"Escape"!==e.key&&"Tab"!==e.key||l()}}))}(document.querySelector(e)),document.querySelector(e).addEventListener("keyup",(function(){var e=function(e){for(var t=e.getElementsByTagName("input"),n=[],r=0;r<t.length;r++)n.push({name:t[r].name,value:t[r].value});return n}(document.querySelector("form"));e.forEach((function(e){var t=e.name,n=e.value;switch(t){case"name":n=n.replace(/\s\s+|\t/g," ")||!1;break;case"email":n=n.replace(/\s+|\t/g,"").toLowerCase()||!1;break;case"phone":n=n.replace(/\s+|\t/g,"")||!1;break;default:n=n||!1}}))}))};for(var IN={preferredCountries:["us","gb","ca"],countries:[{name:"Afghanistan",cca2:"af",dialCode:"93"},{name:"Aland Islands",cca2:"ax",dialCode:"358"},{name:"Albania",cca2:"al",dialCode:"355"},{name:"Algeria",cca2:"dz",dialCode:"213"},{name:"American Samoa",cca2:"as",dialCode:"1",prefixes:["684"]},{name:"Andorra",cca2:"ad",dialCode:"376"},{name:"Angola",cca2:"ao",dialCode:"244"},{name:"Anguilla",cca2:"ai",dialCode:"1",prefixes:["264"]},{name:"Antigua and Barbuda",cca2:"ag",dialCode:"1",prefixes:["268"]},{name:"Argentina",cca2:"ar",dialCode:"54"},{name:"Armenia",cca2:"am",dialCode:"374"},{name:"Aruba",cca2:"aw",dialCode:"297"},{name:"Ascension Island",cca2:"ac",dialCode:"247"},{name:"Australia",cca2:"au",dialCode:"61"},{name:"Austria",cca2:"at",dialCode:"43"},{name:"Azerbaijan",cca2:"az",dialCode:"994"},{name:"Bahamas",cca2:"bs",dialCode:"1",prefixes:["242"]},{name:"Bahrain",cca2:"bh",dialCode:"973"},{name:"Bangladesh",cca2:"bd",dialCode:"880"},{name:"Barbados",cca2:"bb",dialCode:"1",prefixes:["246"]},{name:"Belarus",cca2:"by",dialCode:"375"},{name:"Belgium",cca2:"be",dialCode:"32"},{name:"Belize",cca2:"bz",dialCode:"501"},{name:"Benin",cca2:"bj",dialCode:"229"},{name:"Bermuda",cca2:"bm",dialCode:"1",prefixes:["441"]},{name:"Bhutan",cca2:"bt",dialCode:"975"},{name:"Bolivia",cca2:"bo",dialCode:"591"},{name:"Bosnia and Herzegovina",cca2:"ba",dialCode:"387"},{name:"Botswana",cca2:"bw",dialCode:"267"},{name:"Brazil",cca2:"br",dialCode:"55"},{name:"British Indian Ocean Territory",cca2:"io",dialCode:"246"},{name:"Brunei Darussalam",cca2:"bn",dialCode:"673"},{name:"Bulgaria",cca2:"bg",dialCode:"359"},{name:"Burkina Faso",cca2:"bf",dialCode:"226"},{name:"Burundi",cca2:"bi",dialCode:"257"},{name:"Cambodia",cca2:"kh",dialCode:"855"},{name:"Cameroon",cca2:"cm",dialCode:"237"},{name:"Canada",cca2:"ca",dialCode:"1",prefixes:["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]},{name:"Cape Verde",cca2:"cv",dialCode:"238"},{name:"Caribbean Netherlands",cca2:"bq",dialCode:"599"},{name:"Cayman Islands",cca2:"ky",dialCode:"1",prefixes:["345"]},{name:"Central African Republic",cca2:"cf",dialCode:"236"},{name:"Chad",cca2:"td",dialCode:"235"},{name:"Chile",cca2:"cl",dialCode:"56"},{name:"China",cca2:"cn",dialCode:"86"},{name:"Christmas Island",cca2:"cx",dialCode:"61"},{name:"Cocos (Keeling) Islands",cca2:"cc",dialCode:"61"},{name:"Colombia",cca2:"co",dialCode:"57"},{name:"Comoros",cca2:"km",dialCode:"269"},{name:"Congo (DRC)",cca2:"cd",dialCode:"243"},{name:"Congo (Republic)",cca2:"cg",dialCode:"242"},{name:"Cook Islands",cca2:"ck",dialCode:"682"},{name:"Costa Rica",cca2:"cr",dialCode:"506"},{name:"Côte d'Ivoire",cca2:"ci",dialCode:"225"},{name:"Croatia",cca2:"hr",dialCode:"385"},{name:"Cuba",cca2:"cu",dialCode:"53"},{name:"Curaçao",cca2:"cw",dialCode:"599"},{name:"Cyprus",cca2:"cy",dialCode:"357"},{name:"Czech Republic",cca2:"cz",dialCode:"420"},{name:"Denmark",cca2:"dk",dialCode:"45"},{name:"Djibouti",cca2:"dj",dialCode:"253"},{name:"Dominica",cca2:"dm",dialCode:"1",prefixes:["767"]},{name:"Dominican Republic",cca2:"do",dialCode:"1",prefixes:["809","829","849"]},{name:"Ecuador",cca2:"ec",dialCode:"593"},{name:"Egypt",cca2:"eg",dialCode:"20"},{name:"El Salvador",cca2:"sv",dialCode:"503"},{name:"Equatorial Guinea",cca2:"gq",dialCode:"240"},{name:"Eritrea",cca2:"er",dialCode:"291"},{name:"Estonia",cca2:"ee",dialCode:"372"},{name:"Ethiopia",cca2:"et",dialCode:"251"},{name:"Falkland Islands (Islas Malvinas)",cca2:"fk",dialCode:"500"},{name:"Faroe Islands",cca2:"fo",dialCode:"298"},{name:"Fiji",cca2:"fj",dialCode:"679"},{name:"Finland",cca2:"fi",dialCode:"358"},{name:"France",cca2:"fr",dialCode:"33"},{name:"French Guiana",cca2:"gf",dialCode:"594"},{name:"French Polynesia",cca2:"pf",dialCode:"689"},{name:"Gabon",cca2:"ga",dialCode:"241"},{name:"Gambia",cca2:"gm",dialCode:"220"},{name:"Georgia",cca2:"ge",dialCode:"995"},{name:"Germany",cca2:"de",dialCode:"49"},{name:"Ghana",cca2:"gh",dialCode:"233"},{name:"Gibraltar",cca2:"gi",dialCode:"350"},{name:"Greece",cca2:"gr",dialCode:"30"},{name:"Greenland",cca2:"gl",dialCode:"299"},{name:"Grenada",cca2:"gd",dialCode:"1",prefixes:["473"]},{name:"Guadeloupe",cca2:"gp",dialCode:"590"},{name:"Saint Pierre and Miquelon",cca2:"pm",dialCode:"508"},{name:"Saint Helena, Ascension and Tristan Da Cunha",cca2:"sh",dialCode:"290"},{name:"Guam",cca2:"gu",dialCode:"1",prefixes:["671"]},{name:"Guatemala",cca2:"gt",dialCode:"502"},{name:"Guernsey",cca2:"gg",dialCode:"44"},{name:"Guinea",cca2:"gn",dialCode:"224"},{name:"Guinea-Bissau",cca2:"gw",dialCode:"245"},{name:"Guyana",cca2:"gy",dialCode:"592"},{name:"Haiti",cca2:"ht",dialCode:"509"},{name:"Honduras",cca2:"hn",dialCode:"504"},{name:"Hong Kong",cca2:"hk",dialCode:"852"},{name:"Hungary",cca2:"hu",dialCode:"36"},{name:"Iceland",cca2:"is",dialCode:"354"},{name:"India",cca2:"in",dialCode:"91"},{name:"Indonesia",cca2:"id",dialCode:"62"},{name:"Iran",cca2:"ir",dialCode:"98"},{name:"Iraq",cca2:"iq",dialCode:"964"},{name:"Ireland",cca2:"ie",dialCode:"353"},{name:"Isle of Man",cca2:"im",dialCode:"44"},{name:"Israel",cca2:"il",dialCode:"972"},{name:"Italy",cca2:"it",dialCode:"39"},{name:"Jamaica",cca2:"jm",dialCode:"1",prefixes:["876"]},{name:"Japan",cca2:"jp",dialCode:"81"},{name:"Jersey",cca2:"je",dialCode:"44"},{name:"Jordan",cca2:"jo",dialCode:"962"},{name:"Kazakhstan",cca2:"kz",dialCode:"7"},{name:"Kenya",cca2:"ke",dialCode:"254"},{name:"Kiribati",cca2:"ki",dialCode:"686"},{name:"Kuwait",cca2:"kw",dialCode:"965"},{name:"Kyrgyzstan",cca2:"kg",dialCode:"996"},{name:"Laos",cca2:"la",dialCode:"856"},{name:"Latvia",cca2:"lv",dialCode:"371"},{name:"Lebanon",cca2:"lb",dialCode:"961"},{name:"Lesotho",cca2:"ls",dialCode:"266"},{name:"Liberia",cca2:"lr",dialCode:"231"},{name:"Libya",cca2:"ly",dialCode:"218"},{name:"Liechtenstein",cca2:"li",dialCode:"423"},{name:"Lithuania",cca2:"lt",dialCode:"370"},{name:"Luxembourg",cca2:"lu",dialCode:"352"},{name:"Macao",cca2:"mo",dialCode:"853"},{name:"Macedonia",cca2:"mk",dialCode:"389"},{name:"Madagascar",cca2:"mg",dialCode:"261"},{name:"Malawi",cca2:"mw",dialCode:"265"},{name:"Malaysia",cca2:"my",dialCode:"60"},{name:"Maldives",cca2:"mv",dialCode:"960"},{name:"Mali",cca2:"ml",dialCode:"223"},{name:"Malta",cca2:"mt",dialCode:"356"},{name:"Marshall Islands",cca2:"mh",dialCode:"692"},{name:"Martinique",cca2:"mq",dialCode:"596"},{name:"Mauritania",cca2:"mr",dialCode:"222"},{name:"Mauritius",cca2:"mu",dialCode:"230"},{name:"Mayotte",cca2:"yt",dialCode:"262"},{name:"Mexico",cca2:"mx",dialCode:"52"},{name:"Micronesia",cca2:"fm",dialCode:"691"},{name:"Moldova",cca2:"md",dialCode:"373"},{name:"Monaco",cca2:"mc",dialCode:"377"},{name:"Mongolia",cca2:"mn",dialCode:"976"},{name:"Montenegro",cca2:"me",dialCode:"382"},{name:"Montserrat",cca2:"ms",dialCode:"1",prefixes:["664"]},{name:"Morocco",cca2:"ma",dialCode:"212"},{name:"Mozambique",cca2:"mz",dialCode:"258"},{name:"Myanmar (Burma)",cca2:"mm",dialCode:"95"},{name:"Namibia",cca2:"na",dialCode:"264"},{name:"Nauru",cca2:"nr",dialCode:"674"},{name:"Nepal",cca2:"np",dialCode:"977"},{name:"Netherlands",cca2:"nl",dialCode:"31"},{name:"New Caledonia",cca2:"nc",dialCode:"687"},{name:"New Zealand",cca2:"nz",dialCode:"64"},{name:"Nicaragua",cca2:"ni",dialCode:"505"},{name:"Niger",cca2:"ne",dialCode:"227"},{name:"Nigeria",cca2:"ng",dialCode:"234"},{name:"Niue",cca2:"NU",dialCode:"683"},{name:"Norfolk Island",cca2:"NF",dialCode:"672"},{name:"North Korea",cca2:"kp",dialCode:"850"},{name:"Norway",cca2:"no",dialCode:"47"},{name:"Oman",cca2:"om",dialCode:"968"},{name:"Pakistan",cca2:"pk",dialCode:"92"},{name:"Palau",cca2:"pw",dialCode:"680"},{name:"Palestinian Territory",cca2:"ps",dialCode:"970"},{name:"Panama",cca2:"pa",dialCode:"507"},{name:"Papua New Guinea",cca2:"pg",dialCode:"675"},{name:"Paraguay",cca2:"py",dialCode:"595"},{name:"Peru",cca2:"pe",dialCode:"51"},{name:"Philippines",cca2:"ph",dialCode:"63"},{name:"Poland",cca2:"pl",dialCode:"48"},{name:"Portugal",cca2:"pt",dialCode:"351"},{name:"Puerto Rico",cca2:"pr",dialCode:"1",prefixes:["787","939"]},{name:"Qatar",cca2:"qa",dialCode:"974"},{name:"Réunion",cca2:"re",dialCode:"262"},{name:"Saint Barthelemy",cca2:"bl",dialCode:"590"},{name:"Romania",cca2:"ro",dialCode:"40"},{name:"Russian Federation",cca2:"ru",dialCode:"7"},{name:"Rwanda",cca2:"rw",dialCode:"250"},{name:"Saint Kitts and Nevis",cca2:"kn",dialCode:"1",prefixes:["869"]},{name:"Saint Lucia",cca2:"lc",dialCode:"1",prefixes:["758"]},{name:"Saint Martin (Saint-Martin",cca2:"mf",dialCode:"590"},{name:"Saint Vincent and the Grenadines",cca2:"vc",dialCode:"1",prefixes:["784"]},{name:"Samoa",cca2:"ws",dialCode:"685"},{name:"San Marino",cca2:"sm",dialCode:"378"},{name:"São Tomé and Príncipe",cca2:"st",dialCode:"239"},{name:"Saudi Arabia",cca2:"sa",dialCode:"966"},{name:"Senegal",cca2:"sn",dialCode:"221"},{name:"Serbia",cca2:"rs",dialCode:"381"},{name:"Seychelles",cca2:"sc",dialCode:"248"},{name:"Sierra Leone",cca2:"sl",dialCode:"232"},{name:"Singapore",cca2:"sg",dialCode:"65"},{name:"Slovakia",cca2:"sk",dialCode:"421"},{name:"Slovenia",cca2:"si",dialCode:"386"},{name:"Solomon Islands",cca2:"sb",dialCode:"677"},{name:"Somalia",cca2:"so",dialCode:"252"},{name:"South Africa",cca2:"za",dialCode:"27"},{name:"South Korea",cca2:"kr",dialCode:"82"},{name:"South Sudan",cca2:"ss",dialCode:"211"},{name:"Spain",cca2:"es",dialCode:"34"},{name:"Sri Lanka",cca2:"lk",dialCode:"94"},{name:"Sudan",cca2:"sd",dialCode:"249"},{name:"Suriname",cca2:"sr",dialCode:"597"},{name:"Swaziland",cca2:"sz",dialCode:"268"},{name:"Sweden",cca2:"se",dialCode:"46"},{name:"Switzerland",cca2:"ch",dialCode:"41"},{name:"Syrian Arab Republic",cca2:"sy",dialCode:"963"},{name:"Taiwan, Province of China",cca2:"tw",dialCode:"886"},{name:"Tajikistan",cca2:"tj",dialCode:"992"},{name:"Tanzania",cca2:"tz",dialCode:"255"},{name:"Thailand",cca2:"th",dialCode:"66"},{name:"Timor-Leste",cca2:"tl",dialCode:"670"},{name:"Togo",cca2:"tg",dialCode:"228"},{name:"Tokelau",cca2:"tk",dialCode:"690"},{name:"Tonga",cca2:"to",dialCode:"676"},{name:"Trinidad and Tobago",cca2:"tt",dialCode:"1",prefixes:["868"]},{name:"Tristan da Cunha",cca2:"ta",dialCode:"290"},{name:"Tunisia",cca2:"tn",dialCode:"216"},{name:"Turkey",cca2:"tr",dialCode:"90"},{name:"Turkmenistan",cca2:"tm",dialCode:"993"},{name:"Turks and Caicos Islands",cca2:"tc",dialCode:"1",prefixes:["649"]},{name:"Tuvalu",cca2:"tv",dialCode:"688"},{name:"Uganda",cca2:"ug",dialCode:"256"},{name:"Ukraine",cca2:"ua",dialCode:"380"},{name:"United Arab Emirates",cca2:"ae",dialCode:"971"},{name:"United Kingdom",cca2:"gb",dialCode:"44"},{name:"United States",cca2:"us",dialCode:"1"},{name:"Uruguay",cca2:"uy",dialCode:"598"},{name:"Uzbekistan",cca2:"uz",dialCode:"998"},{name:"Vanuatu",cca2:"vu",dialCode:"678"},{name:"Vatican City",cca2:"va",dialCode:"379"},{name:"Venezuela",cca2:"ve",dialCode:"58"},{name:"Viet Nam",cca2:"vn",dialCode:"84"},{name:"Virgin Islands (British)",cca2:"vg",dialCode:"1",prefixes:["284"]},{name:"Virgin Islands (U.S.)",cca2:"vi",dialCode:"1",prefixes:["340"]},{name:"Wallis and Futuna",cca2:"wf",dialCode:"681"},{name:"Western Sahara",cca2:"eh",dialCode:"212"},{name:"Yemen",cca2:"ye",dialCode:"967"},{name:"Zambia",cca2:"zm",dialCode:"260"},{name:"Zimbabwe",cca2:"zw",dialCode:"263"}],countryCodes:{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"],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"],379:["VA"],380:["UA"],381:["RS"],382:["ME"],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"]},phoneNumberValidator:{AC:[,[,,"[46]\\d{4}|[01589]\\d{5}","\\d{5,6}"],[,,"6[2-467]\\d{3}","\\d{5}",,,"62889"],[,,"4\\d{4}","\\d{5}",,,"40123"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"AC",247,"00",,,,,,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"[01589]\\d{5}","\\d{6}",,,"542011"],,,[,,"NA","NA"]],AD:[,[,,"(?:[346-9]|180)\\d{5}","\\d{6,8}"],[,,"[78]\\d{5}","\\d{6}",,,"712345"],[,,"[346]\\d{5}","\\d{6}",,,"312345"],[,,"180[02]\\d{4}","\\d{8}",,,"18001234"],[,,"9\\d{5}","\\d{6}",,,"912345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"AD",376,"00",,,,,,,,[[,"(\\d{3})(\\d{3})","$1 $2",["[346-9]"],"","",0],[,"(180[02])(\\d{4})","$1 $2",["1"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],AE:[,[,,"[2-79]\\d{7,8}|800\\d{2,9}","\\d{5,12}"],[,,"[2-4679][2-8]\\d{6}","\\d{7,8}",,,"22345678"],[,,"5[0256]\\d{7}","\\d{9}",,,"501234567"],[,,"400\\d{6}|800\\d{2,9}","\\d{5,12}",,,"800123456"],[,,"900[02]\\d{5}","\\d{9}",,,"900234567"],[,,"700[05]\\d{5}","\\d{9}",,,"700012345"],[,,"NA","NA"],[,,"NA","NA"],"AE",971,"00","0",,,"0",,,,[[,"([2-4679])(\\d{3})(\\d{4})","$1 $2 $3",["[2-4679][2-8]"],"0$1","",0],[,"(5[0256])(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1","",0],[,"([479]00)(\\d)(\\d{5})","$1 $2 $3",["[479]0"],"$1","",0],[,"([68]00)(\\d{2,9})","$1 $2",["60|8"],"$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"600[25]\\d{5}","\\d{9}",,,"600212345"],,,[,,"NA","NA"]],AF:[,[,,"[2-7]\\d{8}","\\d{7,9}"],[,,"(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}","\\d{7,9}",,,"234567890"],[,,"7(?:[014-9]\\d{7}|2[89]\\d{6})","\\d{9}",,,"701234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"AF",93,"00","0",,,"0",,,,[[,"([2-7]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],AG:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}","\\d{7}(?:\\d{3})?",,,"2684601234"],[,,"268(?:464|7(?:2[0-9]|64|7[0-689]|8[02-68]))\\d{4}","\\d{10}",,,"2684641234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"26848[01]\\d{4}","\\d{10}",,,"2684801234"],"AG",1,"011","1",,,"1",,,,,,[,,"26840[69]\\d{4}","\\d{10}",,,"2684061234"],,"268",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],AI:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"2644(?:6[12]|9[78])\\d{4}","\\d{7}(?:\\d{3})?",,,"2644612345"],[,,"264(?:235|476|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}","\\d{10}",,,"2642351234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"AI",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"264",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],AL:[,[,,"[2-57]\\d{7}|6\\d{8}|8\\d{5,7}|9\\d{5}","\\d{5,9}"],[,,"(?:2(?:[168][1-9]|[247]\\d|9[1-7])|3(?:1[1-3]|[2-6]\\d|[79][1-8]|8[1-9])|4\\d{2}|5(?:1[1-4]|[2-578]\\d|6[1-5]|9[1-7])|8(?:[19][1-5]|[2-6]\\d|[78][1-7]))\\d{5}","\\d{5,8}",,,"22345678"],[,,"6[6-9]\\d{7}","\\d{9}",,,"661234567"],[,,"800\\d{4}","\\d{7}",,,"8001234"],[,,"900\\d{3}","\\d{6}",,,"900123"],[,,"808\\d{3}","\\d{6}",,,"808123"],[,,"700\\d{5}","\\d{8}",,,"70012345"],[,,"NA","NA"],"AL",355,"00","0",,,"0",,,,[[,"(4)(\\d{3})(\\d{4})","$1 $2 $3",["4[0-6]"],"0$1","",0],[,"(6[6-9])(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4[7-9]"],"0$1","",0],[,"(\\d{3})(\\d{3,5})","$1 $2",["[235][16-9]|8[016-9]|[79]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],AM:[,[,,"[1-9]\\d{7}","\\d{5,8}"],[,,"(?:1[01]\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2|47\\d)\\d{5}","\\d{5,8}",,,"10123456"],[,,"(?:4[139]|55|77|9[1-9])\\d{6}","\\d{8}",,,"77123456"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"90[016]\\d{5}","\\d{8}",,,"90012345"],[,,"80[1-4]\\d{5}","\\d{8}",,,"80112345"],[,,"NA","NA"],[,,"60[2-6]\\d{5}","\\d{8}",,,"60271234"],"AM",374,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)","",0],[,"(\\d{2})(\\d{6})","$1 $2",["4[139]|[5-7]|9[1-9]"],"0$1","",0],[,"(\\d{3})(\\d{5})","$1 $2",["[23]"],"(0$1)","",0],[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8|90"],"0 $1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],AO:[,[,,"[29]\\d{8}","\\d{9}"],[,,"2\\d(?:[26-9]\\d|\\d[26-9])\\d{5}","\\d{9}",,,"222123456"],[,,"9[1-49]\\d{7}","\\d{9}",,,"923123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"AO",244,"00",,,,,,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],AR:[,[,,"11\\d{8}|[2368]\\d{9}|9\\d{10}","\\d{6,11}"],[,,"11\\d{8}|(?:2(?:2(?:[013]\\d|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[067]\\d)|4(?:7[3-8]|9\\d)|6(?:[01346]\\d|2[24-6]|5[15-8])|80\\d|9(?:[0124789]\\d|3[1-6]|5[234]|6[2-46]))|3(?:3(?:2[79]|6\\d|8[2578])|4(?:[78]\\d|0[0124-9]|[1-35]\\d|4[24-7]|6[02-9]|9[123678])|5(?:[138]\\d|2[1245]|4[1-9]|6[2-4]|7[1-6])|6[24]\\d|7(?:[0469]\\d|1[1568]|2[013-9]|3[145]|5[14-8]|7[2-57]|8[0-24-9])|8(?:[013578]\\d|2[15-7]|4[13-6]|6[1-357-9]|9[124]))|670\\d)\\d{6}","\\d{6,10}",,,"1123456789"],[,,"675\\d{7}|9(?:11[2-9]\\d{7}|(?:2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[12358]|5[138]|6[24]|7[069]|8[013578]))[2-9]\\d{6}|\\d{4}[2-9]\\d{5})","\\d{6,11}",,,"91123456789"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"60[04579]\\d{7}","\\d{10}",,,"6001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"AR",54,"00","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",,,[[,"([68]\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1","",0],[,"(\\d{2})(\\d{4})","$1-$2",["[2-9]"],"$1","",0],[,"(\\d{3})(\\d{4})","$1-$2",["[2-9]"],"$1","",0],[,"(\\d{4})(\\d{4})","$1-$2",["[2-9]"],"$1","",0],[,"(9)(11)(\\d{4})(\\d{4})","$2 15-$3-$4",["911"],"0$1","",0],[,"(9)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9(?:2[234689]|3[3-8])","9(?:2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[1-358]|5[138]|6[24]|7[069]|8[013578]))","9(?:2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|[358]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45])))"],"0$1","",0],[,"(9)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9[23]"],"0$1","",0],[,"(11)(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1","",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[1-358]|5[138]|6[24]|7[069]|8[013578])","2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|[358]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45]))"],"0$1","",1],[,"(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["[23]"],"0$1","",1],[,"(\\d{3})","$1",["1[012]|911"],"$1","",0]],[[,"([68]\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1","",0],[,"(9)(11)(\\d{4})(\\d{4})","$1 $2 $3-$4",["911"]],[,"(9)(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3-$4",["9(?:2[234689]|3[3-8])","9(?:2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[1-358]|5[138]|6[24]|7[069]|8[013578]))","9(?:2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|[358]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45])))"]],[,"(9)(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3-$4",["9[23]"]],[,"(11)(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1","",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[1-358]|5[138]|6[24]|7[069]|8[013578])","2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|[358]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45]))"],"0$1","",1],[,"(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["[23]"],"0$1","",1]],[,,"NA","NA"],,,[,,"810\\d{7}","\\d{10}",,,"8101234567"],[,,"810\\d{7}","\\d{10}",,,"8101234567"],,,[,,"NA","NA"]],AS:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"6846(?:22|33|44|55|77|88|9[19])\\d{4}","\\d{7}(?:\\d{3})?",,,"6846221234"],[,,"684(?:2(?:5[2468]|72)|7(?:3[13]|70))\\d{4}","\\d{10}",,,"6847331234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"AS",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"684",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],AT:[,[,,"[1-9]\\d{3,12}","\\d{3,13}"],[,,"1\\d{3,12}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-8]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|63|7[1368]|8[2457])|5(?:12|2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[1-35-8]|5[468]|62)|7(?:2[1-8]|3[25]|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{3,10}","\\d{3,13}",,,"1234567890"],[,,"6(?:44|5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}","\\d{7,13}",,,"644123456"],[,,"80[02]\\d{6,10}","\\d{9,13}",,,"800123456"],[,,"(?:711|9(?:0[01]|3[019]))\\d{6,10}","\\d{9,13}",,,"900123456"],[,,"8(?:10|2[018])\\d{6,10}","\\d{9,13}",,,"810123456"],[,,"NA","NA"],[,,"780\\d{6,10}","\\d{9,13}",,,"780123456"],"AT",43,"00","0",,,"0",,,,[[,"(1)(\\d{3,12})","$1 $2",["1"],"0$1","",0],[,"(5\\d)(\\d{3,5})","$1 $2",["5[079]"],"0$1","",0],[,"(5\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["5[079]"],"0$1","",0],[,"(5\\d)(\\d{4})(\\d{4,7})","$1 $2 $3",["5[079]"],"0$1","",0],[,"(\\d{3})(\\d{3,10})","$1 $2",["316|46|51|732|6(?:44|5[0-3579]|[6-9])|7(?:1|[28]0)|[89]"],"0$1","",0],[,"(\\d{4})(\\d{3,9})","$1 $2",["2|3(?:1[1-578]|[3-8])|4[2378]|5[2-6]|6(?:[12]|4[1-35-9]|5[468])|7(?:2[1-8]|35|4[1-8]|[5-79])"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"5(?:(?:0[1-9]|17)\\d{2,10}|[79]\\d{3,11})|720\\d{6,10}","\\d{5,13}",,,"50123"],,,[,,"NA","NA"]],AU:[,[,,"[1-578]\\d{5,9}","\\d{6,10}"],[,,"[237]\\d{8}|8(?:[68]\\d{3}|7[0-69]\\d{2}|9(?:[02-9]\\d{2}|1(?:[0-57-9]\\d|6[0135-9])))\\d{4}","\\d{8,9}",,,"212345678"],[,,"14(?:5\\d|71)\\d{5}|4(?:[0-2]\\d|3[0-57-9]|4[47-9]|5[0-25-9]|6[6-9]|7[03-9]|8[17-9]|9[017-9])\\d{6}","\\d{9}",,,"412345678"],[,,"180(?:0\\d{3}|2)\\d{3}","\\d{7,10}",,,"1800123456"],[,,"190[0126]\\d{6}","\\d{10}",,,"1900123456"],[,,"13(?:00\\d{2})?\\d{4}","\\d{6,10}",,,"1300123456"],[,,"500\\d{6}","\\d{9}",,,"500123456"],[,,"550\\d{6}","\\d{9}",,,"550123456"],"AU",61,"(?:14(?:1[14]|34|4[17]|[56]6|7[47]|88))?001[14-689]","0",,,"0",,"0011",,[[,"([2378])(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)","",0],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[45]|14"],"0$1","",0],[,"(16)(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1","",0],[,"(1[389]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[38]0|90)","1(?:[38]00|90)"],"$1","",0],[,"(180)(2\\d{3})","$1 $2",["180","1802"],"$1","",0],[,"(19\\d)(\\d{3})","$1 $2",["19[13]"],"$1","",0],[,"(19\\d{2})(\\d{4})","$1 $2",["19[67]"],"$1","",0],[,"(13)(\\d{2})(\\d{2})","$1 $2 $3",["13[1-9]"],"$1","",0]],,[,,"16\\d{3,7}","\\d{5,9}",,,"1612345"],1,,[,,"1(?:3(?:\\d{4}|00\\d{6})|80(?:0\\d{6}|2\\d{3}))","\\d{6,10}",,,"1300123456"],[,,"NA","NA"],,,[,,"NA","NA"]],AW:[,[,,"[25-9]\\d{6}","\\d{7}"],[,,"5(?:2\\d|8[1-9])\\d{4}","\\d{7}",,,"5212345"],[,,"(?:5(?:6\\d|9[2-478])|6(?:[039]0|22|4[01]|6[0-2])|7[34]\\d|9(?:6[45]|9[4-8]))\\d{4}","\\d{7}",,,"5601234"],[,,"800\\d{4}","\\d{7}",,,"8001234"],[,,"900\\d{4}","\\d{7}",,,"9001234"],[,,"NA","NA"],[,,"NA","NA"],[,,"28\\d{5}|501\\d{4}","\\d{7}",,,"5011234"],"AW",297,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],AX:[,[,,"[135]\\d{5,9}|[27]\\d{4,9}|4\\d{5,10}|6\\d{7,8}|8\\d{6,9}","\\d{5,12}"],[,,"18[1-8]\\d{3,9}","\\d{6,12}",,,"1812345678"],[,,"4\\d{5,10}|50\\d{4,8}","\\d{6,11}",,,"412345678"],[,,"800\\d{4,7}","\\d{7,10}",,,"8001234567"],[,,"[67]00\\d{5,6}","\\d{8,9}",,,"600123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"AX",358,"00|99[049]","0",,,"0",,,,,,[,,"NA","NA"],,,[,,"[13]00\\d{3,7}|2(?:0(?:0\\d{3,7}|2[023]\\d{1,6}|9[89]\\d{1,6}))|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"100123"],[,,"[13]0\\d{4,8}|2(?:0(?:[016-8]\\d{3,7}|[2-59]\\d{2,7})|9\\d{4,8})|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"10112345"],,,[,,"NA","NA"]],AZ:[,[,,"[1-9]\\d{8}","\\d{7,9}"],[,,"(?:1[28]\\d|2(?:02|1[24]|2[2-4]|33|[45]2|6[23])|365)\\d{6}","\\d{7,9}",,,"123123456"],[,,"(?:4[04]|5[015]|60|7[07])\\d{7}","\\d{9}",,,"401234567"],[,,"88\\d{7}","\\d{9}",,,"881234567"],[,,"900200\\d{3}","\\d{9}",,,"900200123"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"AZ",994,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["(?:1[28]|2(?:[45]2|[0-36])|365)"],"(0$1)","",0],[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-8]"],"0$1","",0],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BA:[,[,,"[3-9]\\d{7,8}","\\d{6,9}"],[,,"(?:[35]\\d|49)\\d{6}","\\d{6,8}",,,"30123456"],[,,"6(?:03|44|71|[1-356])\\d{6}","\\d{8,9}",,,"61123456"],[,,"8[08]\\d{6}","\\d{8}",,,"80123456"],[,,"9[0246]\\d{6}","\\d{8}",,,"90123456"],[,,"8[12]\\d{6}","\\d{8}",,,"82123456"],[,,"NA","NA"],[,,"NA","NA"],"BA",387,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-356]|[7-9]"],"0$1","",0],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6[047]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"70[23]\\d{5}","\\d{8}",,,"70223456"],,,[,,"NA","NA"]],BB:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"246[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"2462345678"],[,,"246(?:(?:2[346]|45|82)\\d|25[0-46])\\d{4}","\\d{10}",,,"2462501234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"BB",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"246",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BD:[,[,,"[2-79]\\d{5,9}|1\\d{9}|8[0-7]\\d{4,8}","\\d{6,10}"],[,,"2(?:7(?:1[0-267]|2[0-289]|3[0-29]|[46][01]|5[1-3]|7[017]|91)|8(?:0[125]|[139][1-6]|2[0157-9]|6[1-35]|7[1-5]|8[1-8])|9(?:0[0-2]|1[0-4]|2[568]|3[3-6]|5[5-7]|6[0167]|7[15]|8[0146-8]))\\d{4}|3(?:12?[5-7]\\d{2}|0(?:2(?:[025-79]\\d|[348]\\d{1,2})|3(?:[2-4]\\d|[56]\\d?))|2(?:1\\d{2}|2(?:[12]\\d|[35]\\d{1,2}|4\\d?))|3(?:1\\d{2}|2(?:[2356]\\d|4\\d{1,2}))|4(?:1\\d{2}|2(?:2\\d{1,2}|[47]|5\\d{2}))|5(?:1\\d{2}|29)|[67]1\\d{2}|8(?:1\\d{2}|2(?:2\\d{2}|3|4\\d)))\\d{3}|4(?:0(?:2(?:[09]\\d|7)|33\\d{2})|1\\d{3}|2(?:1\\d{2}|2(?:[25]\\d?|[348]\\d|[67]\\d{1,2}))|3(?:1\\d{2}(?:\\d{2})?|2(?:[045]\\d|[236-9]\\d{1,2})|32\\d{2})|4(?:[18]\\d{2}|2(?:[2-46]\\d{2}|3)|5[25]\\d{2})|5(?:1\\d{2}|2(?:3\\d|5))|6(?:[18]\\d{2}|2(?:3(?:\\d{2})?|[46]\\d{1,2}|5\\d{2}|7\\d)|5(?:3\\d?|4\\d|[57]\\d{1,2}|6\\d{2}|8))|71\\d{2}|8(?:[18]\\d{2}|23\\d{2}|54\\d{2})|9(?:[18]\\d{2}|2[2-5]\\d{2}|53\\d{1,2}))\\d{3}|5(?:02[03489]\\d{2}|1\\d{2}|2(?:1\\d{2}|2(?:2(?:\\d{2})?|[457]\\d{2}))|3(?:1\\d{2}|2(?:[37](?:\\d{2})?|[569]\\d{2}))|4(?:1\\d{2}|2[46]\\d{2})|5(?:1\\d{2}|26\\d{1,2})|6(?:[18]\\d{2}|2|53\\d{2})|7(?:1|24)\\d{2}|8(?:1|26)\\d{2}|91\\d{2})\\d{3}|6(?:0(?:1\\d{2}|2(?:3\\d{2}|4\\d{1,2}))|2(?:2[2-5]\\d{2}|5(?:[3-5]\\d{2}|7)|8\\d{2})|3(?:1|2[3478])\\d{2}|4(?:1|2[34])\\d{2}|5(?:1|2[47])\\d{2}|6(?:[18]\\d{2}|6(?:2(?:2\\d|[34]\\d{2})|5(?:[24]\\d{2}|3\\d|5\\d{1,2})))|72[2-5]\\d{2}|8(?:1\\d{2}|2[2-5]\\d{2})|9(?:1\\d{2}|2[2-6]\\d{2}))\\d{3}|7(?:(?:02|[3-589]1|6[12]|72[24])\\d{2}|21\\d{3}|32)\\d{3}|8(?:(?:4[12]|[5-7]2|1\\d?)|(?:0|3[12]|[5-7]1|217)\\d)\\d{4}|9(?:[35]1|(?:[024]2|81)\\d|(?:1|[24]1)\\d{2})\\d{3}","\\d{6,9}",,,"27111234"],[,,"(?:1[13-9]\\d|(?:3[78]|44)[02-9]|6(?:44|6[02-9]))\\d{7}","\\d{10}",,,"1812345678"],[,,"80[03]\\d{7}","\\d{10}",,,"8001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"96(?:0[49]|1[0-4]|6[69])\\d{6}","\\d{10}",,,"9604123456"],"BD",880,"00[12]?","0",,,"0",,"00",,[[,"(2)(\\d{7})","$1-$2",["2"],"0$1","",0],[,"(\\d{2})(\\d{4,6})","$1-$2",["[3-79]1"],"0$1","",0],[,"(\\d{4})(\\d{3,6})","$1-$2",["1|3(?:0|[2-58]2)|4(?:0|[25]2|3[23]|[4689][25])|5(?:[02-578]2|6[25])|6(?:[0347-9]2|[26][25])|7[02-9]2|8(?:[023][23]|[4-7]2)|9(?:[02][23]|[458]2|6[016])"],"0$1","",0],[,"(\\d{3})(\\d{3,7})","$1-$2",["[3-79][2-9]|8"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BE:[,[,,"[1-9]\\d{7,8}","\\d{8,9}"],[,,"(?:1[0-69]|[23][2-8]|4[23]|5\\d|6[013-57-9]|71|8[1-79]|9[2-4])\\d{6}|80[2-8]\\d{5}","\\d{8}",,,"12345678"],[,,"4(?:6[0135-8]|[79]\\d|8[3-9])\\d{6}","\\d{9}",,,"470123456"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"(?:70[2-467]|90[0-79])\\d{5}","\\d{8}",,,"90123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"BE",32,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4[6-9]"],"0$1","",0],[,"(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[23]|4[23]|9[2-4]"],"0$1","",0],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[156]|7[018]|8(?:0[1-9]|[1-79])"],"0$1","",0],[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"78\\d{6}","\\d{8}",,,"78123456"],,,[,,"NA","NA"]],BF:[,[,,"[267]\\d{7}","\\d{8}"],[,,"2(?:0(?:49|5[23]|9[016-9])|4(?:4[569]|5[4-6]|7[0179])|5(?:[34]\\d|50))\\d{4}","\\d{8}",,,"20491234"],[,,"6(?:[0-689]\\d|7[0-5])\\d{5}|7\\d{7}","\\d{8}",,,"70123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"BF",226,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BG:[,[,,"[23567]\\d{5,7}|[489]\\d{6,8}","\\d{5,9}"],[,,"2(?:[0-8]\\d{5,6}|9\\d{4,6})|(?:[36]\\d|5[1-9]|8[1-6]|9[1-7])\\d{5,6}|(?:4(?:[124-7]\\d|3[1-6])|7(?:0[1-9]|[1-9]\\d))\\d{4,5}","\\d{5,8}",,,"2123456"],[,,"(?:8[7-9]\\d|9(?:8\\d|99))\\d{6}|4(?:3[0789]|8\\d)\\d{5}","\\d{8,9}",,,"48123456"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"90\\d{6}","\\d{8}",,,"90123456"],[,,"NA","NA"],[,,"700\\d{5}","\\d{5,9}",,,"70012345"],[,,"NA","NA"],"BG",359,"00","0",,,"0",,,,[[,"(2)(\\d{5})","$1 $2",["29"],"0$1","",0],[,"(2)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1","",0],[,"(\\d{3})(\\d{4})","$1 $2",["43[124-7]|70[1-9]"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[124-7]|70[1-9]"],"0$1","",0],[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[78]00"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["999"],"0$1","",0],[,"(\\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","",0],[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["48|8[7-9]|9[08]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BH:[,[,,"[136-9]\\d{7}","\\d{8}"],[,,"(?:1(?:3[1356]|6[0156]|7\\d)\\d|6(?:1[16]\\d|500|6(?:0\\d|3[12]|44|7[7-9])|9[69][69])|7(?:1(?:11|78)|7\\d{2}))\\d{4}","\\d{8}",,,"17001234"],[,,"(?:3(?:[1-4679]\\d|5[013569]|8[0-47-9])\\d|6(?:3(?:00|33|6[16])|6(?:[69]\\d|3[03-9]|7[0-6])))\\d{4}","\\d{8}",,,"36001234"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"(?:87|9[014578])\\d{6}","\\d{8}",,,"90123456"],[,,"84\\d{6}","\\d{8}",,,"84123456"],[,,"NA","NA"],[,,"NA","NA"],"BH",973,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BI:[,[,,"[267]\\d{7}","\\d{8}"],[,,"22(?:2[0-7]|[3-5]0)\\d{4}","\\d{8}",,,"22201234"],[,,"(?:[26]9|7[14-9])\\d{6}","\\d{8}",,,"79561234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"BI",257,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BJ:[,[,,"[2689]\\d{7}|7\\d{3}","\\d{4,8}"],[,,"2(?:02|1[037]|2[45]|3[68])\\d{5}","\\d{8}",,,"20211234"],[,,"(?:6[146-8]|9[03-9])\\d{6}","\\d{8}",,,"90011234"],[,,"7[3-5]\\d{2}","\\d{4}",,,"7312"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"857[58]\\d{4}","\\d{8}",,,"85751234"],"BJ",229,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"81\\d{6}","\\d{8}",,,"81123456"],,,[,,"NA","NA"]],BL:[,[,,"[56]\\d{8}","\\d{9}"],[,,"590(?:2[7-9]|5[12]|87)\\d{4}","\\d{9}",,,"590271234"],[,,"690(?:0[0-7]|[1-9]\\d)\\d{4}","\\d{9}",,,"690301234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"BL",590,"00","0",,,"0",,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BM:[,[,,"[4589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"441(?:2(?:02|23|61|[3479]\\d)|[46]\\d{2}|5(?:4\\d|60|89)|824)\\d{4}","\\d{7}(?:\\d{3})?",,,"4412345678"],[,,"441(?:[37]\\d|5[0-39])\\d{5}","\\d{10}",,,"4413701234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"BM",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"441",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BN:[,[,,"[2-578]\\d{6}","\\d{7}"],[,,"2(?:[013-9]\\d|2[0-7])\\d{4}|[3-5]\\d{6}","\\d{7}",,,"2345678"],[,,"22[89]\\d{4}|[78]\\d{6}","\\d{7}",,,"7123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"BN",673,"00",,,,,,,,[[,"([2-578]\\d{2})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BO:[,[,,"[23467]\\d{7}","\\d{7,8}"],[,,"(?:2(?:2\\d{2}|5(?:11|[258]\\d|9[67])|6(?:12|2\\d|9[34])|8(?:2[34]|39|62))|3(?:3\\d{2}|4(?:6\\d|8[24])|8(?:25|42|5[257]|86|9[25])|9(?:2\\d|3[234]|4[248]|5[24]|6[2-6]|7\\d))|4(?:4\\d{2}|6(?:11|[24689]\\d|72)))\\d{4}","\\d{7,8}",,,"22123456"],[,,"[67]\\d{7}","\\d{8}",,,"71234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"BO",591,"00(1\\d)?","0",,,"0(1\\d)?",,,,[[,"([234])(\\d{7})","$1 $2",["[234]"],"","0$CC $1",0],[,"([67]\\d{7})","$1",["[67]"],"","0$CC $1",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BQ:[,[,,"[347]\\d{6}","\\d{7}"],[,,"(?:318[023]|416[023]|7(?:1[578]|50)\\d)\\d{3}","\\d{7}",,,"7151234"],[,,"(?:318[14-68]|416[15-9]|7(?:0[01]|7[07]|[89]\\d)\\d)\\d{3}","\\d{7}",,,"3181234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"BQ",599,"00",,,,,,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BR:[,[,,"[1-46-9]\\d{7,10}|5\\d{8,9}","\\d{8,11}"],[,,"1[1-9][2-5]\\d{7}|(?:[4689][1-9]|2[12478]|3[1-578]|5[1-5]|7[13-579])[2-5]\\d{7}","\\d{8,11}",,,"1123456789"],[,,"1[1-9](?:7|9\\d)\\d{7}|(?:2[12478]|[89][1-9])9?[6-9]\\d{7}|(?:3[1-578]|[46][1-9]|5[1-5]|7[13-579])[6-9]\\d{7}","\\d{10,11}",,,"11961234567"],[,,"800\\d{6,7}","\\d{8,11}",,,"800123456"],[,,"[359]00\\d{6,7}","\\d{8,11}",,,"300123456"],[,,"[34]00\\d{5}","\\d{8}",,,"40041234"],[,,"NA","NA"],[,,"NA","NA"],"BR",55,"00(?:1[45]|2[135]|31|4[13])","0",,,"0(?:(1[245]|2[135]|31|4[13])(\\d{10,11}))?","$2",,,[[,"(\\d{4})(\\d{4})","$1-$2",["[2-9](?:[1-9]|0[1-9])"],"$1","",0],[,"(\\d{5})(\\d{4})","$1-$2",["9(?:[1-9]|0[1-9])"],"$1","",0],[,"(\\d{3,5})","$1",["1[125689]"],"$1","",0],[,"(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["(?:[189][1-9]|2[12478])9"],"($1)","0 $CC ($1)",0],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["[1-9][1-9]"],"($1)","0 $CC ($1)",0],[,"([34]00\\d)(\\d{4})","$1-$2",["[34]00"],"","",0],[,"([3589]00)(\\d{2,3})(\\d{4})","$1 $2 $3",["[3589]00"],"0$1","",0]],[[,"(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["(?:[189][1-9]|2[12478])9"],"($1)","0 $CC ($1)",0],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["[1-9][1-9]"],"($1)","0 $CC ($1)",0],[,"([34]00\\d)(\\d{4})","$1-$2",["[34]00"],"","",0],[,"([3589]00)(\\d{2,3})(\\d{4})","$1 $2 $3",["[3589]00"],"0$1","",0]],[,,"NA","NA"],,,[,,"[34]00\\d{5}","\\d{8}",,,"40041234"],[,,"NA","NA"],,,[,,"NA","NA"]],BS:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[3467]|8[0-4]|9[2-467])|461|502|6(?:0[12]|12|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}","\\d{7}(?:\\d{3})?",,,"2423456789"],[,,"242(?:3(?:5[79]|[79]5)|4(?:[2-4][1-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-9]|65|77)|6[34]6|727)\\d{4}","\\d{10}",,,"2423591234"],[,,"242300\\d{4}|8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"BS",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"242",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BT:[,[,,"[1-8]\\d{6,7}","\\d{6,8}"],[,,"(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}","\\d{6,7}",,,"2345678"],[,,"[17]7\\d{6}","\\d{8}",,,"17123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"BT",975,"00",,,,,,,,[[,"([17]7)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1|77"],"","",0],[,"([2-8])(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BW:[,[,,"[2-79]\\d{6,7}","\\d{7,8}"],[,,"(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0235-9]|55|6\\d|7[01]|9[0-57])|4(?:6[03]|7[1267]|9[0-5])|5(?:3[0389]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[067]))\\d{4}","\\d{7}",,,"2401234"],[,,"7(?:[1-6]\\d|7[014-8])\\d{5}","\\d{8}",,,"71123456"],[,,"NA","NA"],[,,"90\\d{5}","\\d{7}",,,"9012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"79[12][01]\\d{4}","\\d{8}",,,"79101234"],"BW",267,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[2-6]"],"","",0],[,"(7\\d)(\\d{3})(\\d{3})","$1 $2 $3",["7"],"","",0],[,"(90)(\\d{5})","$1 $2",["9"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],BY:[,[,,"[1-4]\\d{8}|[89]\\d{9,10}","\\d{7,11}"],[,,"(?:1(?:5(?:1[1-5]|[24]\\d|6[2-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d{2})|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:[26]\\d|3[02-79]|4[024-7]|5[03-7])))\\d{5}","\\d{7,9}",,,"152450911"],[,,"(?:2(?:5[5679]|9[1-9])|33\\d|44\\d)\\d{6}","\\d{9}",,,"294911911"],[,,"8(?:0[13]|20\\d)\\d{7}","\\d{10,11}",,,"8011234567"],[,,"(?:810|902)\\d{7}","\\d{10}",,,"9021234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"249\\d{6}","\\d{9}",,,"249123456"],"BY",375,"810","8",,,"8?0?",,"8~10",,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["17[0-3589]|2[4-9]|[34]","17(?:[02358]|1[0-2]|9[0189])|2[4-9]|[34]"],"8 0$1","",0],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:5[24]|6[235]|7[467])|2(?:1[246]|2[25]|3[26])","1(?:5[24]|6(?:2|3[04-9]|5[0346-9])|7(?:[46]|7[37-9]))|2(?:1[246]|2[25]|3[26])"],"8 0$1","",0],[,"(\\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","",0],[,"([89]\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8[01]|9"],"8 $1","",0],[,"(8\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["82"],"8 $1","",0]],,[,,"NA","NA"],,,[,,"8(?:[013]|[12]0)\\d{8}|902\\d{7}","\\d{10,11}",,,"82012345678"],[,,"NA","NA"],,,[,,"NA","NA"]],BZ:[,[,,"[2-8]\\d{6}|0\\d{10}","\\d{7}(?:\\d{4})?"],[,,"[234578][02]\\d{5}","\\d{7}",,,"2221234"],[,,"6[0-367]\\d{5}","\\d{7}",,,"6221234"],[,,"0800\\d{7}","\\d{11}",,,"08001234123"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"BZ",501,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1-$2",["[2-8]"],"","",0],[,"(0)(800)(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]],CA:[,[,,"[2-9]\\d{9}|3\\d{6}","\\d{7}(?:\\d{3})?"],[,,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:0[04]|13|22|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|73)|90[25])[2-9]\\d{6}|310\\d{4}","\\d{7}(?:\\d{3})?",,,"2042345678"],[,,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:0[04]|13|22|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|73)|90[25])[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"2042345678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}|310\\d{4}","\\d{7}(?:\\d{3})?",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"CA",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],CC:[,[,,"[1458]\\d{5,9}","\\d{6,10}"],[,,"89162\\d{4}","\\d{8,9}",,,"891621234"],[,,"14(?:5\\d|71)\\d{5}|4(?:[0-2]\\d|3[0-57-9]|4[47-9]|5[0-25-9]|6[6-9]|7[03-9]|8[17-9]|9[017-9])\\d{6}","\\d{9}",,,"412345678"],[,,"1(?:80(?:0\\d{2})?|3(?:00\\d{2})?)\\d{4}","\\d{6,10}",,,"1800123456"],[,,"190[0126]\\d{6}","\\d{10}",,,"1900123456"],[,,"NA","NA"],[,,"500\\d{6}","\\d{9}",,,"500123456"],[,,"550\\d{6}","\\d{9}",,,"550123456"],"CC",61,"(?:14(?:1[14]|34|4[17]|[56]6|7[47]|88))?001[14-689]","0",,,"0",,"0011",,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],CD:[,[,,"[2-6]\\d{6}|[18]\\d{6,8}|9\\d{8}","\\d{7,9}"],[,,"1(?:2\\d{7}|\\d{6})|[2-6]\\d{6}","\\d{7,9}",,,"1234567"],[,,"8(?:[0-2459]\\d{2}|8)\\d{5}|9[7-9]\\d{7}","\\d{7,9}",,,"991234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"CD",243,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["12"],"0$1","",0],[,"([89]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8[0-2459]|9"],"0$1","",0],[,"(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1","",0],[,"(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],CF:[,[,,"[278]\\d{7}","\\d{8}"],[,,"2[12]\\d{6}","\\d{8}",,,"21612345"],[,,"7[0257]\\d{6}","\\d{8}",,,"70012345"],[,,"NA","NA"],[,,"8776\\d{4}","\\d{8}",,,"87761234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"CF",236,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],CG:[,[,,"[028]\\d{8}","\\d{9}"],[,,"222[1-589]\\d{5}","\\d{9}",,,"222123456"],[,,"0[14-6]\\d{7}","\\d{9}",,,"061234567"],[,,"NA","NA"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"CG",242,"00",,,,,,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"],"","",0],[,"(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]],CH:[,[,,"[2-9]\\d{8}|860\\d{9}","\\d{9}(?:\\d{3})?"],[,,"(?:2[12467]|3[1-4]|4[134]|5[256]|6[12]|[7-9]1)\\d{7}","\\d{9}",,,"212345678"],[,,"7[5-9]\\d{7}","\\d{9}",,,"781234567"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"90[016]\\d{6}","\\d{9}",,,"900123456"],[,,"84[0248]\\d{6}","\\d{9}",,,"840123456"],[,,"878\\d{6}","\\d{9}",,,"878123456"],[,,"NA","NA"],"CH",41,"00","0",,,"0",,,,[[,"([2-9]\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]|[89]1"],"0$1","",0],[,"([89]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1","",0],[,"(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["860"],"0$1","",0]],,[,,"74[0248]\\d{6}","\\d{9}",,,"740123456"],,,[,,"NA","NA"],[,,"5[18]\\d{7}","\\d{9}",,,"581234567"],,,[,,"860\\d{9}","\\d{12}",,,"860123456789"]],CI:[,[,,"[02-7]\\d{7}","\\d{8}"],[,,"(?:2(?:0[023]|1[02357]|[23][045]|4[03-5])|3(?:0[06]|1[069]|[2-4][07]|5[09]|6[08]))\\d{5}","\\d{8}",,,"21234567"],[,,"(?:0[1-9]|4\\d|5[4-9]|6[015-79]|7[578])\\d{6}","\\d{8}",,,"01234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"CI",225,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]],CK:[,[,,"[2-57]\\d{4}","\\d{5}"],[,,"(?:2\\d|3[13-7]|4[1-5])\\d{3}","\\d{5}",,,"21234"],[,,"(?:5[0-68]|7\\d)\\d{3}","\\d{5}",,,"71234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"CK",682,"00",,,,,,,,[[,"(\\d{2})(\\d{3})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],CL:[,[,,"(?:[2-9]|600|123)\\d{7,8}","\\d{7,11}"],[,,"2(?:2\\d{7}|3(?:20|22)\\d{5}|1962\\d{4})|(?:3[2-5]|[47][1-35]|5[1-3578]|6[13-57])\\d{7}","\\d{7,9}",,,"221234567"],[,,"9[4-9]\\d{7}","\\d{8,9}",,,"961234567"],[,,"800\\d{6}|1230\\d{7}","\\d{9,11}",,,"800123456"],[,,"NA","NA"],[,,"600\\d{7,8}","\\d{10,11}",,,"6001234567"],[,,"NA","NA"],[,,"44\\d{7}","\\d{9}",,,"441234567"],"CL",56,"(?:0|1(?:1[0-69]|2[0-57]|5[13-58]|69|7[0167]|8[018]))0","0",,,"0|(1(?:1[0-69]|2[0-57]|5[13-58]|69|7[0167]|8[018]))",,,,[[,"(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[23]"],"($1)","$CC ($1)",0],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[357]|4[1-35]|6[13-57]"],"($1)","$CC ($1)",0],[,"(9)(\\d{4})(\\d{4})","$1 $2 $3",["9"],"0$1","",0],[,"(44)(\\d{3})(\\d{4})","$1 $2 $3",["44"],"0$1","",0],[,"([68]00)(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"],"$1","",0],[,"(600)(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"],"$1","",0],[,"(1230)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"$1","",0],[,"(\\d{5})(\\d{4})","$1 $2",["219"],"($1)","$CC ($1)",0],[,"(\\d{4,5})","$1",["[1-9]"],"$1","",0]],[[,"(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[23]"],"($1)","$CC ($1)",0],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[357]|4[1-35]|6[13-57]"],"($1)","$CC ($1)",0],[,"(9)(\\d{4})(\\d{4})","$1 $2 $3",["9"],"0$1","",0],[,"(44)(\\d{3})(\\d{4})","$1 $2 $3",["44"],"0$1","",0],[,"([68]00)(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"],"$1","",0],[,"(600)(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"],"$1","",0],[,"(1230)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"$1","",0],[,"(\\d{5})(\\d{4})","$1 $2",["219"],"($1)","$CC ($1)",0]],[,,"NA","NA"],,,[,,"600\\d{7,8}","\\d{10,11}",,,"6001234567"],[,,"NA","NA"],,,[,,"NA","NA"]],CM:[,[,,"[2368]\\d{7,8}","\\d{8,9}"],[,,"2(?:22|33|4[23])\\d{6}","\\d{9}",,,"222123456"],[,,"6[5-9]\\d{7}","\\d{9}",,,"671234567"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"88\\d{6}","\\d{8}",,,"88012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"CM",237,"00",,,,,,,,[[,"([26])(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]"],"","",0],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[23]|88"],"","",0],[,"(800)(\\d{2})(\\d{3})","$1 $2 $3",["80"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],CN:[,[,,"[1-7]\\d{6,11}|8[0-357-9]\\d{6,9}|9\\d{7,10}","\\d{4,12}"],[,,"21(?:100\\d{2}|95\\d{3,4}|\\d{8,10})|(?:10|2[02-57-9]|3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|8(?:[57]1|98))(?:100\\d{2}|95\\d{3,4}|\\d{8})|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|3[3-9]|5[2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|3\\d|5[4-9]|7[02-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100\\d{2}|95\\d{3,4}|\\d{7})|80(?:29|6[03578]|7[018]|81)\\d{4}","\\d{4,12}",,,"1012345678"],[,,"1(?:[38]\\d|4[57]|5[0-35-9]|7[06-8])\\d{8}","\\d{11}",,,"13123456789"],[,,"(?:10)?800\\d{7}","\\d{10,12}",,,"8001234567"],[,,"16[08]\\d{5}","\\d{8}",,,"16812345"],[,,"400\\d{7}|950\\d{7,8}|(?:10|2[0-57-9]|3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[4789]|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[3678]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))96\\d{3,4}","\\d{7,11}",,,"4001234567"],[,,"NA","NA"],[,,"NA","NA"],"CN",86,"(1(?:[129]\\d{3}|79\\d{2}))?00","0",,,"(1(?:[129]\\d{3}|79\\d{2}))|0",,"00",,[[,"(80\\d{2})(\\d{4})","$1 $2",["80[2678]"],"0$1","$CC $1",1],[,"([48]00)(\\d{3})(\\d{4})","$1 $2 $3",["[48]00"],"","",0],[,"(\\d{5,6})","$1",["100|95"],"","",0],[,"(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2\\d)[19]","(?:10|2\\d)(?:10|9[56])","(?:10|2\\d)(?:100|9[56])"],"0$1","$CC $1",0],[,"(\\d{3})(\\d{5,6})","$1 $2",["[3-9]","[3-9]\\d{2}[19]","[3-9]\\d{2}(?:10|9[56])"],"0$1","$CC $1",0],[,"(\\d{3,4})(\\d{4})","$1 $2",["[2-9]"],"","",0],[,"(21)(\\d{4})(\\d{4,6})","$1 $2 $3",["21"],"0$1","$CC $1",1],[,"([12]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["10[1-9]|2[02-9]","10[1-9]|2[02-9]","10(?:[1-79]|8(?:[1-9]|0[1-9]))|2[02-9]"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|8(?:[57]1|98)"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|3|5[4-9]|7[02-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-578]"],"","$CC $1",0],[,"(10800)(\\d{3})(\\d{4})","$1 $2 $3",["108","1080","10800"],"","",0],[,"(\\d{3})(\\d{7,8})","$1 $2",["950"],"","",0]],[[,"(80\\d{2})(\\d{4})","$1 $2",["80[2678]"],"0$1","$CC $1",1],[,"([48]00)(\\d{3})(\\d{4})","$1 $2 $3",["[48]00"],"","",0],[,"(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2\\d)[19]","(?:10|2\\d)(?:10|9[56])","(?:10|2\\d)(?:100|9[56])"],"0$1","$CC $1",0],[,"(\\d{3})(\\d{5,6})","$1 $2",["[3-9]","[3-9]\\d{2}[19]","[3-9]\\d{2}(?:10|9[56])"],"0$1","$CC $1",0],[,"(21)(\\d{4})(\\d{4,6})","$1 $2 $3",["21"],"0$1","$CC $1",1],[,"([12]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["10[1-9]|2[02-9]","10[1-9]|2[02-9]","10(?:[1-79]|8(?:[1-9]|0[1-9]))|2[02-9]"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|8(?:[57]1|98)"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|3|5[4-9]|7[02-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-578]"],"","$CC $1",0],[,"(10800)(\\d{3})(\\d{4})","$1 $2 $3",["108","1080","10800"],"","",0],[,"(\\d{3})(\\d{7,8})","$1 $2",["950"],"","",0]],[,,"NA","NA"],,,[,,"(?:4|(?:10)?8)00\\d{7}|950\\d{7,8}","\\d{10,12}",,,"4001234567"],[,,"NA","NA"],,,[,,"NA","NA"]],CO:[,[,,"(?:[13]\\d{0,3}|[24-8])\\d{7}","\\d{7,11}"],[,,"[124-8][2-9]\\d{6}","\\d{8}",,,"12345678"],[,,"3(?:0[0-5]|1\\d|2[0-2]|5[01])\\d{7}","\\d{10}",,,"3211234567"],[,,"1800\\d{7}","\\d{11}",,,"18001234567"],[,,"19(?:0[01]|4[78])\\d{7}","\\d{11}",,,"19001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"CO",57,"00(?:4(?:[14]4|56)|[579])","0",,,"0([3579]|4(?:44|56))?",,,,[[,"(\\d)(\\d{7})","$1 $2",["1(?:8[2-9]|9[0-3]|[2-7])|[24-8]","1(?:8[2-9]|9(?:09|[1-3])|[2-7])|[24-8]"],"($1)","0$CC $1",0],[,"(\\d{3})(\\d{7})","$1 $2",["3"],"","0$CC $1",0],[,"(1)(\\d{3})(\\d{7})","$1-$2-$3",["1(?:80|9[04])","1(?:800|9(?:0[01]|4[78]))"],"0$1","",0]],[[,"(\\d)(\\d{7})","$1 $2",["1(?:8[2-9]|9[0-3]|[2-7])|[24-8]","1(?:8[2-9]|9(?:09|[1-3])|[2-7])|[24-8]"],"($1)","0$CC $1",0],[,"(\\d{3})(\\d{7})","$1 $2",["3"],"","0$CC $1",0],[,"(1)(\\d{3})(\\d{7})","$1 $2 $3",["1(?:80|9[04])","1(?:800|9(?:0[01]|4[78]))"]]],[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],CR:[,[,,"[24-9]\\d{7,9}","\\d{8,10}"],[,,"2[24-7]\\d{6}","\\d{8}",,,"22123456"],[,,"5(?:0[01]|7[0-3])\\d{5}|6(?:[0-2]\\d|30)\\d{5}|7[0-3]\\d{6}|8[3-9]\\d{6}","\\d{8}",,,"83123456"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"90[059]\\d{7}","\\d{10}",,,"9001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"210[0-6]\\d{4}|4\\d{7}|5100\\d{4}","\\d{8}",,,"40001234"],"CR",506,"00",,,,"(19(?:0[012468]|1[09]|20|66|77|99))",,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[24-7]|8[3-9]"],"","$CC $1",0],[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]0"],"","$CC $1",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],CU:[,[,,"[2-57]\\d{5,7}","\\d{4,8}"],[,,"2[1-4]\\d{5,6}|3(?:1\\d{6}|[23]\\d{4,6})|4(?:[125]\\d{5,6}|[36]\\d{6}|[78]\\d{4,6})|7\\d{6,7}","\\d{4,8}",,,"71234567"],[,,"5\\d{7}","\\d{8}",,,"51234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"CU",53,"119","0",,,"0",,,,[[,"(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)","",0],[,"(\\d{2})(\\d{4,6})","$1 $2",["[2-4]"],"(0$1)","",0],[,"(\\d)(\\d{7})","$1 $2",["5"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],CV:[,[,,"[259]\\d{6}","\\d{7}"],[,,"2(?:2[1-7]|3[0-8]|4[12]|5[1256]|6\\d|7[1-3]|8[1-5])\\d{4}","\\d{7}",,,"2211234"],[,,"(?:9\\d|59)\\d{5}","\\d{7}",,,"9911234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"CV",238,"0",,,,,,,,[[,"(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],CW:[,[,,"[169]\\d{6,7}","\\d{7,8}"],[,,"9(?:[48]\\d{2}|50\\d|7(?:2[0-24]|[34]\\d|6[35-7]|77|8[7-9]))\\d{4}","\\d{7,8}",,,"94151234"],[,,"9(?:5(?:[1246]\\d|3[01])|6(?:[16-9]\\d|3[01]))\\d{4}","\\d{7,8}",,,"95181234"],[,,"NA","NA"],[,,"NA","NA"],[,,"(?:10|69)\\d{5}","\\d{7}",,,"1011234"],[,,"NA","NA"],[,,"NA","NA"],"CW",599,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[13-7]"],"","",0],[,"(9)(\\d{3})(\\d{4})","$1 $2 $3",["9"],"","",0]],,[,,"955\\d{5}","\\d{7,8}",,,"95581234"],1,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],CX:[,[,,"[1458]\\d{5,9}","\\d{6,10}"],[,,"89164\\d{4}","\\d{8,9}",,,"891641234"],[,,"14(?:5\\d|71)\\d{5}|4(?:[0-2]\\d|3[0-57-9]|4[47-9]|5[0-25-9]|6[6-9]|7[03-9]|8[17-9]|9[017-9])\\d{6}","\\d{9}",,,"412345678"],[,,"1(?:80(?:0\\d{2})?|3(?:00\\d{2})?)\\d{4}","\\d{6,10}",,,"1800123456"],[,,"190[0126]\\d{6}","\\d{10}",,,"1900123456"],[,,"NA","NA"],[,,"500\\d{6}","\\d{9}",,,"500123456"],[,,"550\\d{6}","\\d{9}",,,"550123456"],"CX",61,"(?:14(?:1[14]|34|4[17]|[56]6|7[47]|88))?001[14-689]","0",,,"0",,"0011",,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],CY:[,[,,"[257-9]\\d{7}","\\d{8}"],[,,"2[2-6]\\d{6}","\\d{8}",,,"22345678"],[,,"9[5-79]\\d{6}","\\d{8}",,,"96123456"],[,,"800\\d{5}","\\d{8}",,,"80001234"],[,,"90[09]\\d{5}","\\d{8}",,,"90012345"],[,,"80[1-9]\\d{5}","\\d{8}",,,"80112345"],[,,"700\\d{5}","\\d{8}",,,"70012345"],[,,"NA","NA"],"CY",357,"00",,,,,,,,[[,"(\\d{2})(\\d{6})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"(?:50|77)\\d{6}","\\d{8}",,,"77123456"],,,[,,"NA","NA"]],CZ:[,[,,"[2-8]\\d{8}|9\\d{8,11}","\\d{9,12}"],[,,"2\\d{8}|(?:3[1257-9]|4[16-9]|5[13-9])\\d{7}","\\d{9,12}",,,"212345678"],[,,"(?:60[1-8]|7(?:0[2-5]|[2379]\\d))\\d{6}","\\d{9,12}",,,"601123456"],[,,"800\\d{6}","\\d{9,12}",,,"800123456"],[,,"9(?:0[05689]|76)\\d{6}","\\d{9,12}",,,"900123456"],[,,"8[134]\\d{7}","\\d{9,12}",,,"811234567"],[,,"70[01]\\d{6}","\\d{9,12}",,,"700123456"],[,,"9[17]0\\d{6}","\\d{9,12}",,,"910123456"],"CZ",420,"00",,,,,,,,[[,"([2-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"],"","",0],[,"(96\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["96"],"","",0],[,"(9\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9[36]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"9(?:5\\d|7[234])\\d{6}","\\d{9,12}",,,"972123456"],,,[,,"9(?:3\\d{9}|6\\d{7,10})","\\d{9,12}",,,"93123456789"]],DE:[,[,,"[1-35-9]\\d{3,14}|4(?:[0-8]\\d{4,12}|9(?:[0-37]\\d|4(?:[1-35-8]|4\\d?)|5\\d{1,2}|6[1-8]\\d?)\\d{2,8})","\\d{2,15}"],[,,"[246]\\d{5,13}|3(?:0\\d{3,13}|2\\d{9}|[3-9]\\d{4,13})|5(?:0[2-8]|[1256]\\d|[38][0-8]|4\\d{0,2}|[79][0-7])\\d{3,11}|7(?:0[2-8]|[1-9]\\d)\\d{3,10}|8(?:0[2-9]|[1-9]\\d)\\d{3,10}|9(?:0[6-9]\\d{3,10}|1\\d{4,12}|[2-9]\\d{4,11})","\\d{2,15}",,,"30123456"],[,,"1(?:5[0-25-9]\\d{8}|6[023]\\d{7,8}|7(?:[0-57-9]\\d?|6\\d)\\d{7})","\\d{10,11}",,,"15123456789"],[,,"800\\d{7,12}","\\d{10,15}",,,"8001234567890"],[,,"137[7-9]\\d{6}|900(?:[135]\\d{6}|9\\d{7})","\\d{10,11}",,,"9001234567"],[,,"1(?:3(?:7[1-6]\\d{6}|8\\d{4})|80\\d{5,11})","\\d{7,14}",,,"18012345"],[,,"700\\d{8}","\\d{11}",,,"70012345678"],[,,"NA","NA"],"DE",49,"00","0",,,"0",,,,[[,"(1\\d{2})(\\d{7,8})","$1 $2",["1[67]"],"0$1","",0],[,"(15\\d{3})(\\d{6})","$1 $2",["15[0568]"],"0$1","",0],[,"(1\\d{3})(\\d{7})","$1 $2",["15"],"0$1","",0],[,"(\\d{2})(\\d{3,11})","$1 $2",["3[02]|40|[68]9"],"0$1","",0],[,"(\\d{3})(\\d{3,11})","$1 $2",["2(?:\\d1|0[2389]|1[24]|28|34)|3(?:[3-9][15]|40)|[4-8][1-9]1|9(?:06|[1-9]1)"],"0$1","",0],[,"(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|[7-9](?:\\d[1-9]|[1-9]\\d)|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])","[24-6]|[7-9](?:\\d[1-9]|[1-9]\\d)|3(?:3(?:0[1-467]|2[127-9]|3[124578]|[46][1246]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|3[1357]|4[13578]|6[1246]|7[1356]|9[1346])|5(?:0[14]|2[1-3589]|3[1357]|4[1246]|6[1-4]|7[1346]|8[13568]|9[1246])|6(?:0[356]|2[1-489]|3[124-6]|4[1347]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|3[1357]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|4[1347]|6[0135-9]|7[1467]|8[136])|9(?:0[12479]|2[1358]|3[1357]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))"],"0$1","",0],[,"(3\\d{4})(\\d{1,10})","$1 $2",["3"],"0$1","",0],[,"(800)(\\d{7,12})","$1 $2",["800"],"0$1","",0],[,"(177)(99)(\\d{7,8})","$1 $2 $3",["177","1779","17799"],"0$1","",0],[,"(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["(?:18|90)0|137","1(?:37|80)|900[1359]"],"0$1","",0],[,"(1\\d{2})(\\d{5,11})","$1 $2",["181"],"0$1","",0],[,"(18\\d{3})(\\d{6})","$1 $2",["185","1850","18500"],"0$1","",0],[,"(18\\d{2})(\\d{7})","$1 $2",["18[68]"],"0$1","",0],[,"(18\\d)(\\d{8})","$1 $2",["18[2-579]"],"0$1","",0],[,"(700)(\\d{4})(\\d{4})","$1 $2 $3",["700"],"0$1","",0],[,"(138)(\\d{4})","$1 $2",["138"],"0$1","",0]],,[,,"16(?:4\\d{1,10}|[89]\\d{1,11})","\\d{4,14}",,,"16412345"],,,[,,"NA","NA"],[,,"18(?:1\\d{5,11}|[2-9]\\d{8})","\\d{8,14}",,,"18500123456"],,,[,,"17799\\d{7,8}","\\d{12,13}",,,"177991234567"]],DJ:[,[,,"[27]\\d{7}","\\d{8}"],[,,"2(?:1[2-5]|7[45])\\d{5}","\\d{8}",,,"21360003"],[,,"77[6-8]\\d{5}","\\d{8}",,,"77831001"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"DJ",253,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],DK:[,[,,"[2-9]\\d{7}","\\d{8}"],[,,"(?:[2-7]\\d|8[126-9]|9[1-36-9])\\d{6}","\\d{8}",,,"32123456"],[,,"(?:[2-7]\\d|8[126-9]|9[1-36-9])\\d{6}","\\d{8}",,,"20123456"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"90\\d{6}","\\d{8}",,,"90123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"DK",45,"00",,,,,,,1,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],DM:[,[,,"[57-9]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4]|70[1-3])\\d{4}","\\d{7}(?:\\d{3})?",,,"7674201234"],[,,"767(?:2(?:[234689]5|7[5-7])|31[5-7]|61[2-7])\\d{4}","\\d{10}",,,"7672251234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"DM",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"767",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],DO:[,[,,"[589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"8(?:[04]9[2-9]\\d{6}|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d{2}|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9]))\\d{4})","\\d{7}(?:\\d{3})?",,,"8092345678"],[,,"8[024]9[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"8092345678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"DO",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"8[024]9",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],DZ:[,[,,"(?:[1-4]|[5-9]\\d)\\d{7}","\\d{8,9}"],[,,"(?:1\\d|2[014-79]|3[0-8]|4[0135689])\\d{6}|9619\\d{5}","\\d{8,9}",,,"12345678"],[,,"(?:5[4-6]|7[7-9])\\d{7}|6(?:[569]\\d|7[0-6])\\d{6}","\\d{9}",,,"551234567"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"80[3-689]1\\d{5}","\\d{9}",,,"808123456"],[,,"80[12]1\\d{5}","\\d{9}",,,"801123456"],[,,"NA","NA"],[,,"98[23]\\d{6}","\\d{9}",,,"983123456"],"DZ",213,"00","0",,,"0",,,,[[,"([1-4]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1","",0],[,"([5-8]\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1","",0],[,"(9\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],EC:[,[,,"1\\d{9,10}|[2-8]\\d{7}|9\\d{8}","\\d{7,11}"],[,,"[2-7][2-7]\\d{6}","\\d{7,8}",,,"22123456"],[,,"9(?:39|[45][89]|[67][7-9]|[89]\\d)\\d{6}","\\d{9}",,,"991234567"],[,,"1800\\d{6,7}","\\d{10,11}",,,"18001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"[2-7]890\\d{4}","\\d{8}",,,"28901234"],"EC",593,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[247]|[356][2-8]"],"(0$1)","",0],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1","",0],[,"(1800)(\\d{3})(\\d{3,4})","$1 $2 $3",["1"],"$1","",0]],[[,"(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[247]|[356][2-8]"]],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1","",0],[,"(1800)(\\d{3})(\\d{3,4})","$1 $2 $3",["1"],"$1","",0]],[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],EE:[,[,,"1\\d{3,4}|[3-9]\\d{6,7}|800\\d{6,7}","\\d{4,10}"],[,,"(?:3[23589]|4[3-8]|6\\d|7[1-9]|88)\\d{5}","\\d{7}",,,"3212345"],[,,"(?:5\\d|8[1-5])\\d{6}|5(?:[02]\\d{2}|1(?:[0-8]\\d|95)|5[0-478]\\d|64[0-4]|65[1-589])\\d{3}","\\d{7,8}",,,"51234567"],[,,"800(?:0\\d{3}|1\\d|[2-9])\\d{3}","\\d{7,10}",,,"80012345"],[,,"(?:40\\d{2}|900)\\d{4}","\\d{7,8}",,,"9001234"],[,,"NA","NA"],[,,"70[0-2]\\d{5}","\\d{8}",,,"70012345"],[,,"NA","NA"],"EE",372,"00",,,,,,,,[[,"([3-79]\\d{2})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]"],"","",0],[,"(70)(\\d{2})(\\d{4})","$1 $2 $3",["70"],"","",0],[,"(8000)(\\d{3})(\\d{3})","$1 $2 $3",["800","8000"],"","",0],[,"([458]\\d{3})(\\d{3,4})","$1 $2",["40|5|8(?:00|[1-5])","40|5|8(?:00[1-9]|[1-5])"],"","",0]],,[,,"NA","NA"],,,[,,"1\\d{3,4}|800[2-9]\\d{3}","\\d{4,7}",,,"8002123"],[,,"1(?:2[01245]|3[0-6]|4[1-489]|5[0-59]|6[1-46-9]|7[0-27-9]|8[189]|9[012])\\d{1,2}","\\d{4,5}",,,"12123"],,,[,,"NA","NA"]],EG:[,[,,"1\\d{4,9}|[2456]\\d{8}|3\\d{7}|[89]\\d{8,9}","\\d{5,10}"],[,,"(?:1(?:3[23]\\d|5(?:[23]|9\\d))|2[2-4]\\d{2}|3\\d{2}|4(?:0[2-5]|[578][23]|64)\\d|5(?:0[2-7]|[57][23])\\d|6[24-689]3\\d|8(?:2[2-57]|4[26]|6[237]|8[2-4])\\d|9(?:2[27]|3[24]|52|6[2356]|7[2-4])\\d)\\d{5}|1[69]\\d{3}","\\d{5,9}",,,"234567890"],[,,"1(?:0[0-269]|1[0-245]|2[0-278])\\d{7}","\\d{10}",,,"1001234567"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"900\\d{7}","\\d{10}",,,"9001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"EG",20,"00","0",,,"0",,,,[[,"(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1[012]|[89]00"],"0$1","",0],[,"(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|[89][2-9]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],EH:[,[,,"[5689]\\d{8}","\\d{9}"],[,,"528[89]\\d{5}","\\d{9}",,,"528812345"],[,,"6(?:0[0-8]|[12-79]\\d|8[01])\\d{6}","\\d{9}",,,"650123456"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"89\\d{7}","\\d{9}",,,"891234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"EH",212,"00","0",,,"0",,,,,,[,,"NA","NA"],,"528[89]",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],ER:[,[,,"[178]\\d{6}","\\d{6,7}"],[,,"1(?:1[12568]|20|40|55|6[146])\\d{4}|8\\d{6}","\\d{6,7}",,,"8370362"],[,,"17[1-3]\\d{4}|7\\d{6}","\\d{7}",,,"7123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"ER",291,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",,"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],ES:[,[,,"[5-9]\\d{8}","\\d{9}"],[,,"8(?:[13]0|[28][0-8]|[47][1-9]|5[01346-9]|6[0457-9])\\d{6}|9(?:[1238][0-8]\\d{6}|4[1-9]\\d{6}|5\\d{7}|6(?:[0-8]\\d{6}|9(?:0(?:[0-57-9]\\d{4}|6(?:0[0-8]|1[1-9]|[2-9]\\d)\\d{2})|[1-9]\\d{5}))|7(?:[124-9]\\d{2}|3(?:[0-8]\\d|9[1-9]))\\d{4})","\\d{9}",,,"810123456"],[,,"(?:6\\d{6}|7[1-4]\\d{5}|9(?:6906(?:09|10)|7390\\d{2}))\\d{2}","\\d{9}",,,"612345678"],[,,"[89]00\\d{6}","\\d{9}",,,"800123456"],[,,"80[367]\\d{6}","\\d{9}",,,"803123456"],[,,"90[12]\\d{6}","\\d{9}",,,"901123456"],[,,"70\\d{7}","\\d{9}",,,"701234567"],[,,"NA","NA"],"ES",34,"00",,,,,,,,[[,"([5-9]\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[568]|[79][0-8]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"51\\d{7}","\\d{9}",,,"511234567"],,,[,,"NA","NA"]],ET:[,[,,"[1-59]\\d{8}","\\d{7,9}"],[,,"(?:11(?:1(?:1[124]|2[2-57]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-3]|6[5-8])|5(?:1[57]|44|5[0-4])|6(?:18|2[69]|4[5-7]|5[1-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|22[0-6]|33[0134689]|44[04]|55[0-6]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:11[1-9]|22[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}","\\d{7,9}",,,"111112345"],[,,"9(?:[1-3]\\d|5[89])\\d{6}","\\d{9}",,,"911234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"ET",251,"00","0",,,"0",,,,[[,"([1-59]\\d)(\\d{3})(\\d{4})","$1 $2 $3",,"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],FI:[,[,,"1\\d{4,11}|[2-9]\\d{4,10}","\\d{5,12}"],[,,"1(?:[3569][1-8]\\d{3,9}|[47]\\d{5,10})|2[1-8]\\d{3,9}|3(?:[1-8]\\d{3,9}|9\\d{4,8})|[5689][1-8]\\d{3,9}","\\d{5,12}",,,"1312345678"],[,,"4\\d{5,10}|50\\d{4,8}","\\d{6,11}",,,"412345678"],[,,"800\\d{4,7}","\\d{7,10}",,,"8001234567"],[,,"[67]00\\d{5,6}","\\d{8,9}",,,"600123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"FI",358,"00|99[049]","0",,,"0",,,,[[,"(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]00|[6-8]0)"],"0$1","",0],[,"(\\d{2})(\\d{4,10})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1","",0],[,"(\\d)(\\d{4,11})","$1 $2",["[25689][1-8]|3"],"0$1","",0]],,[,,"NA","NA"],1,,[,,"[13]00\\d{3,7}|2(?:0(?:0\\d{3,7}|2[023]\\d{1,6}|9[89]\\d{1,6}))|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"100123"],[,,"[13]0\\d{4,8}|2(?:0(?:[016-8]\\d{3,7}|[2-59]\\d{2,7})|9\\d{4,8})|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"10112345"],,,[,,"NA","NA"]],FJ:[,[,,"[36-9]\\d{6}|0\\d{10}","\\d{7}(?:\\d{4})?"],[,,"(?:3[0-5]|6[25-7]|8[58])\\d{5}","\\d{7}",,,"3212345"],[,,"(?:7[0-8]|8[034679]|9\\d)\\d{5}","\\d{7}",,,"7012345"],[,,"0800\\d{7}","\\d{11}",,,"08001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"FJ",679,"0(?:0|52)",,,,,,"00",,[[,"(\\d{3})(\\d{4})","$1 $2",["[36-9]"],"","",0],[,"(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]],FK:[,[,,"[2-7]\\d{4}","\\d{5}"],[,,"[2-47]\\d{4}","\\d{5}",,,"31234"],[,,"[56]\\d{4}","\\d{5}",,,"51234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"FK",500,"00",,,,,,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],FM:[,[,,"[39]\\d{6}","\\d{7}"],[,,"3[2357]0[1-9]\\d{3}|9[2-6]\\d{5}","\\d{7}",,,"3201234"],[,,"3[2357]0[1-9]\\d{3}|9[2-7]\\d{5}","\\d{7}",,,"3501234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"FM",691,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],FO:[,[,,"[2-9]\\d{5}","\\d{6}"],[,,"(?:20|[3-4]\\d|8[19])\\d{4}","\\d{6}",,,"201234"],[,,"(?:2[1-9]|5\\d|7[1-79])\\d{4}","\\d{6}",,,"211234"],[,,"80[257-9]\\d{3}","\\d{6}",,,"802123"],[,,"90(?:[1345][15-7]|2[125-7]|99)\\d{2}","\\d{6}",,,"901123"],[,,"NA","NA"],[,,"NA","NA"],[,,"(?:6[0-36]|88)\\d{4}","\\d{6}",,,"601234"],"FO",298,"00",,,,"(10(?:01|[12]0|88))",,,,[[,"(\\d{6})","$1",,"","$CC $1",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],FR:[,[,,"[1-9]\\d{8}","\\d{9}"],[,,"[1-5]\\d{8}","\\d{9}",,,"123456789"],[,,"6\\d{8}|7(?:00\\d{6}|[3-9]\\d{7})","\\d{9}",,,"612345678"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"89[1-37-9]\\d{6}","\\d{9}",,,"891123456"],[,,"8(?:1[019]|2[0156]|84|90)\\d{6}","\\d{9}",,,"810123456"],[,,"NA","NA"],[,,"9\\d{8}","\\d{9}",,,"912345678"],"FR",33,"00","0",,,"0",,,,[[,"([1-79])(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1","",0],[,"(1\\d{2})(\\d{3})","$1 $2",["11"],"$1","",0],[,"(8\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1","",0]],[[,"([1-79])(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1","",0],[,"(8\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1","",0]],[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GA:[,[,,"0?\\d{7}","\\d{7,8}"],[,,"01\\d{6}","\\d{8}",,,"01441234"],[,,"0?[2-7]\\d{6}","\\d{7,8}",,,"06031234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"GA",241,"00",,,,,,,,[[,"(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1","",0],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]],GB:[,[,,"\\d{7,10}","\\d{4,10}"],[,,"2(?:0[01378]|3[0189]|4[017]|8[0-46-9]|9[012])\\d{7}|1(?:(?:1(?:3[0-48]|[46][0-4]|5[012789]|7[0-49]|8[01349])|21[0-7]|31[0-8]|[459]1\\d|61[0-46-9]))\\d{6}|1(?:2(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-4789]|7[013-9]|9\\d)|3(?:0\\d|[25][02-9]|3[02-579]|[468][0-46-9]|7[1235679]|9[24578])|4(?:0[03-9]|[28][02-5789]|[37]\\d|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1235-9]|2[024-9]|3[015689]|4[02-9]|5[03-9]|6\\d|7[0-35-9]|8[0-468]|9[0-5789])|6(?:0[034689]|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0124578])|7(?:0[0246-9]|2\\d|3[023678]|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-5789]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|2[02-689]|3[1-5789]|4[2-9]|5[0-579]|6[234789]|7[0124578]|8\\d|9[2-57]))\\d{6}|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-4789]|8[345])))|3(?:638[2-5]|647[23]|8(?:47[04-9]|64[015789]))|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[123]))|5(?:24(?:3[2-79]|6\\d)|276\\d|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[567]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|955[0-4])|7(?:26(?:6[13-9]|7[0-7])|442\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|84(?:3[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}|176888[234678]\\d{2}|16977[23]\\d{3}","\\d{4,10}",,,"1212345678"],[,,"7(?:[1-4]\\d\\d|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(?:[04-9]\\d|1[02-9]|2[0-35-9]|3[0-689]))\\d{6}","\\d{10}",,,"7400123456"],[,,"80(?:0(?:1111|\\d{6,7})|8\\d{7})|500\\d{6}","\\d{7}(?:\\d{2,3})?",,,"8001234567"],[,,"(?:87[123]|9(?:[01]\\d|8[2349]))\\d{7}","\\d{10}",,,"9012345678"],[,,"8(?:4(?:5464\\d|[2-5]\\d{7})|70\\d{7})","\\d{7}(?:\\d{3})?",,,"8431234567"],[,,"70\\d{8}","\\d{10}",,,"7012345678"],[,,"56\\d{8}","\\d{10}",,,"5612345678"],"GB",44,"00","0"," x",,"0",,,,[[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2|5[56]|7(?:0|6[013-9])","2|5[56]|7(?:0|6(?:[013-9]|2[0-35-9]))"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:1|\\d1)|3|9[018]"],"0$1","",0],[,"(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:387|5(?:24|39)|697|768|946)","1(?:3873|5(?:242|39[456])|697[347]|768[347]|9467)"],"0$1","",0],[,"(1\\d{3})(\\d{5,6})","$1 $2",["1"],"0$1","",0],[,"(7\\d{3})(\\d{6})","$1 $2",["7(?:[1-5789]|62)","7(?:[1-5789]|624)"],"0$1","",0],[,"(800)(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1","",0],[,"(845)(46)(4\\d)","$1 $2 $3",["845","8454","84546","845464"],"0$1","",0],[,"(8\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8(?:4[2-5]|7[0-3])"],"0$1","",0],[,"(80\\d)(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1","",0],[,"([58]00)(\\d{6})","$1 $2",["[58]00"],"0$1","",0]],,[,,"76(?:0[012]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}","\\d{10}",,,"7640123456"],1,,[,,"NA","NA"],[,,"(?:3[0347]|55)\\d{8}","\\d{10}",,,"5512345678"],,,[,,"NA","NA"]],GD:[,[,,"[4589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-49]|5[5-79]|68|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}","\\d{7}(?:\\d{3})?",,,"4732691234"],[,,"473(?:4(?:0[2-79]|1[04-9]|20|58)|5(?:2[01]|3[3-8])|901)\\d{4}","\\d{10}",,,"4734031234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"GD",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"473",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GE:[,[,,"[34578]\\d{8}","\\d{6,9}"],[,,"(?:3(?:[256]\\d|4[124-9]|7[0-4])|4(?:1\\d|2[2-7]|3[1-79]|4[2-8]|7[239]|9[1-7]))\\d{6}","\\d{6,9}",,,"322123456"],[,,"5(?:14|5[01578]|68|7[0147-9]|9[0-35-9])\\d{6}","\\d{9}",,,"555123456"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"706\\d{6}","\\d{9}",,,"706123456"],"GE",995,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1","",0],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5"],"$1","",0]],,[,,"NA","NA"],,,[,,"706\\d{6}","\\d{9}",,,"706123456"],[,,"NA","NA"],,,[,,"NA","NA"]],GF:[,[,,"[56]\\d{8}","\\d{9}"],[,,"594(?:10|2[012457-9]|3[0-57-9]|4[3-9]|5[7-9]|6[0-3]|9[014])\\d{4}","\\d{9}",,,"594101234"],[,,"694(?:[04][0-7]|1[0-5]|3[018]|[29]\\d)\\d{4}","\\d{9}",,,"694201234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"GF",594,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GG:[,[,,"[135789]\\d{6,9}","\\d{6,10}"],[,,"1481\\d{6}","\\d{6,10}",,,"1481456789"],[,,"7(?:781|839|911)\\d{6}","\\d{10}",,,"7781123456"],[,,"80(?:0(?:1111|\\d{6,7})|8\\d{7})|500\\d{6}","\\d{7}(?:\\d{2,3})?",,,"8001234567"],[,,"(?:87[123]|9(?:[01]\\d|8[0-3]))\\d{7}","\\d{10}",,,"9012345678"],[,,"8(?:4(?:5464\\d|[2-5]\\d{7})|70\\d{7})","\\d{7}(?:\\d{3})?",,,"8431234567"],[,,"70\\d{8}","\\d{10}",,,"7012345678"],[,,"56\\d{8}","\\d{10}",,,"5612345678"],"GG",44,"00","0"," x",,"0",,,,,,[,,"76(?:0[012]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}","\\d{10}",,,"7640123456"],,,[,,"NA","NA"],[,,"(?:3[0347]|55)\\d{8}","\\d{10}",,,"5512345678"],,,[,,"NA","NA"]],GH:[,[,,"[235]\\d{8}|8\\d{7}","\\d{7,9}"],[,,"3(?:0[237]\\d|[167](?:2[0-6]|7\\d)|2(?:2[0-5]|7\\d)|3(?:2[0-3]|7\\d)|4(?:2[013-9]|3[01]|7\\d)|5(?:2[0-7]|7\\d)|8(?:2[0-2]|7\\d)|9(?:20|7\\d))\\d{5}","\\d{7,9}",,,"302345678"],[,,"(?:2[034678]\\d|5(?:[047]\\d|5[3-6]|6[01]))\\d{6}","\\d{9}",,,"231234567"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"GH",233,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1","",0],[,"(\\d{3})(\\d{5})","$1 $2",["8"],"0$1","",0]],,[,,"NA","NA"],,,[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"NA","NA"],,,[,,"NA","NA"]],GI:[,[,,"[2568]\\d{7}","\\d{8}"],[,,"2(?:00\\d|1(?:6[24-7]|9\\d)|2(?:00|2[2457]))\\d{4}","\\d{8}",,,"20012345"],[,,"(?:5[46-8]|62)\\d{6}","\\d{8}",,,"57123456"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"8[1-689]\\d{6}","\\d{8}",,,"88123456"],[,,"87\\d{6}","\\d{8}",,,"87123456"],[,,"NA","NA"],[,,"NA","NA"],"GI",350,"00",,,,,,,,[[,"(\\d{3})(\\d{5})","$1 $2",["2"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GL:[,[,,"[1-689]\\d{5}","\\d{6}"],[,,"(?:19|3[1-6]|6[14689]|8[14-79]|9\\d)\\d{4}","\\d{6}",,,"321000"],[,,"[245][2-9]\\d{4}","\\d{6}",,,"221234"],[,,"80\\d{4}","\\d{6}",,,"801234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"3[89]\\d{4}","\\d{6}",,,"381234"],"GL",299,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GM:[,[,,"[2-9]\\d{6}","\\d{7}"],[,,"(?:4(?:[23]\\d{2}|4(?:1[024679]|[6-9]\\d))|5(?:54[0-7]|6(?:[67]\\d)|7(?:1[04]|2[035]|3[58]|48))|8\\d{3})\\d{3}","\\d{7}",,,"5661234"],[,,"(?:2[0-6]|[3679]\\d)\\d{5}","\\d{7}",,,"3012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"GM",220,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GN:[,[,,"[367]\\d{7,8}","\\d{8,9}"],[,,"30(?:24|3[12]|4[1-35-7]|5[13]|6[189]|[78]1|9[1478])\\d{4}","\\d{8}",,,"30241234"],[,,"6[02356]\\d{7}","\\d{9}",,,"601123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"722\\d{6}","\\d{9}",,,"722123456"],"GN",224,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"],"","",0],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GP:[,[,,"[56]\\d{8}","\\d{9}"],[,,"590(?:0[13468]|1[012]|2[0-68]|3[28]|4[0-8]|5[579]|6[0189]|70|8[0-689]|9\\d)\\d{4}","\\d{9}",,,"590201234"],[,,"690(?:0[0-7]|[1-9]\\d)\\d{4}","\\d{9}",,,"690301234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"GP",590,"00","0",,,"0",,,,[[,"([56]90)(\\d{2})(\\d{4})","$1 $2-$3",,"0$1","",0]],,[,,"NA","NA"],1,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GQ:[,[,,"[23589]\\d{8}","\\d{9}"],[,,"3(?:3(?:3\\d[7-9]|[0-24-9]\\d[46])|5\\d{2}[7-9])\\d{4}","\\d{9}",,,"333091234"],[,,"(?:222|551)\\d{6}","\\d{9}",,,"222123456"],[,,"80\\d[1-9]\\d{5}","\\d{9}",,,"800123456"],[,,"90\\d[1-9]\\d{5}","\\d{9}",,,"900123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"GQ",240,"00",,,,,,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"],"","",0],[,"(\\d{3})(\\d{6})","$1 $2",["[89]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GR:[,[,,"[26-9]\\d{9}","\\d{10}"],[,,"2(?:1\\d{2}|2(?:2[1-46-9]|3[1-8]|4[1-7]|5[1-4]|6[1-8]|7[1-5]|[89][1-9])|3(?:1\\d|2[1-57]|[35][1-3]|4[13]|7[1-7]|8[124-6]|9[1-79])|4(?:1\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\d|[29][1-4]|3[1-5]|4[124]|5[1-6])|6(?:1\\d|3[1245]|4[1-7]|5[13-9]|[269][1-6]|7[14]|8[1-5])|7(?:1\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[135]|9[125-7])|8(?:1\\d|2[1-5]|[34][1-4]|9[1-57]))\\d{6}","\\d{10}",,,"2123456789"],[,,"69\\d{8}","\\d{10}",,,"6912345678"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"90[19]\\d{7}","\\d{10}",,,"9091234567"],[,,"8(?:0[16]|12|25)\\d{7}","\\d{10}",,,"8011234567"],[,,"70\\d{8}","\\d{10}",,,"7012345678"],[,,"NA","NA"],"GR",30,"00",,,,,,,,[[,"([27]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["21|7"],"","",0],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["2[2-9]1|[689]"],"","",0],[,"(2\\d{3})(\\d{6})","$1 $2",["2[2-9][02-9]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GT:[,[,,"[2-7]\\d{7}|1[89]\\d{9}","\\d{8}(?:\\d{3})?"],[,,"[267][2-9]\\d{6}","\\d{8}",,,"22456789"],[,,"[345]\\d{7}","\\d{8}",,,"51234567"],[,,"18[01]\\d{8}","\\d{11}",,,"18001112222"],[,,"19\\d{9}","\\d{11}",,,"19001112222"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"GT",502,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[2-7]"],"","",0],[,"(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GU:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:56|7[1-9]|8[236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[5-9])|7(?:[079]7|2[0167]|3[45]|8[789])|8(?:[2-5789]8|6[48])|9(?:2[29]|6[79]|7[179]|8[789]|9[78]))\\d{4}","\\d{7}(?:\\d{3})?",,,"6713001234"],[,,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:56|7[1-9]|8[236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[5-9])|7(?:[079]7|2[0167]|3[45]|8[789])|8(?:[2-5789]8|6[48])|9(?:2[29]|6[79]|7[179]|8[789]|9[78]))\\d{4}","\\d{7}(?:\\d{3})?",,,"6713001234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"GU",1,"011","1",,,"1",,,1,,,[,,"NA","NA"],,"671",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GW:[,[,,"[3-79]\\d{6}","\\d{7}"],[,,"3(?:2[0125]|3[1245]|4[12]|5[1-4]|70|9[1-467])\\d{4}","\\d{7}",,,"3201234"],[,,"(?:[5-7]\\d|9[012])\\d{5}","\\d{7}",,,"5012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"40\\d{5}","\\d{7}",,,"4012345"],"GW",245,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],GY:[,[,,"[2-4679]\\d{6}","\\d{7}"],[,,"(?:2(?:1[6-9]|2[0-35-9]|3[1-4]|5[3-9]|6\\d|7[0-24-79])|3(?:2[25-9]|3\\d)|4(?:4[0-24]|5[56])|77[1-57])\\d{4}","\\d{7}",,,"2201234"],[,,"6\\d{6}","\\d{7}",,,"6091234"],[,,"(?:289|862)\\d{4}","\\d{7}",,,"2891234"],[,,"9008\\d{3}","\\d{7}",,,"9008123"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"GY",592,"001",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],HK:[,[,,"[235-7]\\d{7}|8\\d{7,8}|9\\d{4,10}","\\d{5,11}"],[,,"(?:[23]\\d|5[78])\\d{6}","\\d{8}",,,"21234567"],[,,"(?:5[1-69]\\d|6\\d{2}|9(?:0[1-9]|[1-8]\\d))\\d{5}","\\d{8}",,,"51234567"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"900(?:[0-24-9]\\d{7}|3\\d{1,4})","\\d{5,11}",,,"90012345678"],[,,"NA","NA"],[,,"8[1-3]\\d{6}","\\d{8}",,,"81123456"],[,,"NA","NA"],"HK",852,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[235-7]|[89](?:0[1-9]|[1-9])"],"","",0],[,"(800)(\\d{3})(\\d{3})","$1 $2 $3",["800"],"","",0],[,"(900)(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["900"],"","",0],[,"(900)(\\d{2,5})","$1 $2",["900"],"","",0]],,[,,"7\\d{7}","\\d{8}",,,"71234567"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],HN:[,[,,"[237-9]\\d{7}","\\d{8}"],[,,"2(?:2(?:0[019]|1[1-36]|[23]\\d|4[056]|5[57]|7[01389]|8[0146-9]|9[012])|4(?:2[3-59]|3[13-689]|4[0-68]|5[1-35])|5(?:4[3-5]|5\\d|6[56]|74)|6(?:[056]\\d|34|4[0-378]|[78][0-8]|9[01])|7(?:6[46-9]|7[02-9]|8[34])|8(?:79|8[0-35789]|9[1-57-9]))\\d{4}","\\d{8}",,,"22123456"],[,,"[37-9]\\d{7}","\\d{8}",,,"91234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"HN",504,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1-$2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],HR:[,[,,"[1-7]\\d{5,8}|[89]\\d{6,11}","\\d{6,12}"],[,,"1\\d{7}|(?:2[0-3]|3[1-5]|4[02-47-9]|5[1-3])\\d{6,7}","\\d{6,9}",,,"12345678"],[,,"9(?:[1-9]\\d{6,10}|01\\d{6,9})","\\d{8,12}",,,"912345678"],[,,"80[01]\\d{4,7}","\\d{7,10}",,,"8001234567"],[,,"6(?:[01459]\\d{4,7})","\\d{6,9}",,,"611234"],[,,"NA","NA"],[,,"7[45]\\d{4,7}","\\d{6,9}",,,"741234567"],[,,"NA","NA"],"HR",385,"00","0",,,"0",,,,[[,"(1)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1","",0],[,"(6[09])(\\d{4})(\\d{3})","$1 $2 $3",["6[09]"],"0$1","",0],[,"([67]2)(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]2"],"0$1","",0],[,"([2-5]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1","",0],[,"(9\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1","",0],[,"(9\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9"],"0$1","",0],[,"(9\\d)(\\d{3,4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"],"0$1","",0],[,"(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[0145]|7"],"0$1","",0],[,"(\\d{2})(\\d{3,4})(\\d{3})","$1 $2 $3",["6[0145]|7"],"0$1","",0],[,"(80[01])(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1","",0],[,"(80[01])(\\d{3,4})(\\d{3})","$1 $2 $3",["8"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"[76]2\\d{6,7}","\\d{8,9}",,,"62123456"],,,[,,"NA","NA"]],HT:[,[,,"[2-489]\\d{7}","\\d{8}"],[,,"2(?:[24]\\d|5[1-5]|94)\\d{5}","\\d{8}",,,"22453300"],[,,"(?:3[1-9]|4\\d)\\d{6}","\\d{8}",,,"34101234"],[,,"8\\d{7}","\\d{8}",,,"80012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"98[89]\\d{5}","\\d{8}",,,"98901234"],"HT",509,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],HU:[,[,,"[1-9]\\d{7,8}","\\d{6,9}"],[,,"(?:1\\d|2(?:1\\d|[2-9])|3(?:[2-7]|8\\d)|4[24-9]|5[2-79]|6[23689]|7(?:1\\d|[2-9])|8[2-57-9]|9[2-69])\\d{6}","\\d{6,9}",,,"12345678"],[,,"(?:[257]0|3[01])\\d{7}","\\d{9}",,,"201234567"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"9[01]\\d{6}","\\d{8}",,,"90123456"],[,,"40\\d{6}","\\d{8}",,,"40123456"],[,,"NA","NA"],[,,"NA","NA"],"HU",36,"00","06",,,"06",,,,[[,"(1)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"($1)","",0],[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"($1)","",0]],,[,,"NA","NA"],,,[,,"[48]0\\d{6}","\\d{8}",,,"80123456"],[,,"NA","NA"],,,[,,"NA","NA"]],ID:[,[,,"[1-9]\\d{6,10}","\\d{5,11}"],[,,"2(?:1(?:14\\d{3}|[0-8]\\d{6,7}|500\\d{3}|9\\d{6})|2\\d{6,8}|4\\d{7,8})|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|[25][1-8]|3[1-68]|4[1-3]|6[1-3568]|7[0-469]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|43|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[124-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:19?|[25]\\d|3[1-69]|4[1-6])|7(?:02|[125][1-9]|[36]\\d|4[1-8]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}","\\d{5,11}",,,"612345678"],[,,"(?:2(?:1(?:3[145]|4[01]|5[1-469]|60|8[0359]|9\\d)|2(?:88|9[1256])|3[1-4]9|4(?:36|91)|5(?:1[349]|[2-4]9)|6[0-7]9|7(?:[1-36]9|4[39])|8[1-5]9|9[1-48]9)|3(?:19[1-3]|2[12]9|3[13]9|4(?:1[69]|39)|5[14]9|6(?:1[69]|2[89])|709)|4[13]19|5(?:1(?:19|8[39])|4[129]9|6[12]9)|6(?:19[12]|2(?:[23]9|77))|7(?:1[13]9|2[15]9|419|5(?:1[89]|29)|6[15]9|7[178]9))\\d{5,6}|8[1-35-9]\\d{7,9}","\\d{9,11}",,,"812345678"],[,,"177\\d{6,8}|800\\d{5,7}","\\d{8,11}",,,"8001234567"],[,,"809\\d{7}","\\d{10}",,,"8091234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"ID",62,"0(?:0[1789]|10(?:00|1[67]))","0",,,"0",,,,[[,"(\\d{2})(\\d{5,8})","$1 $2",["2[124]|[36]1"],"(0$1)","",0],[,"(\\d{3})(\\d{5,8})","$1 $2",["[4579]|2[035-9]|[36][02-9]"],"(0$1)","",0],[,"(8\\d{2})(\\d{3,4})(\\d{3,4})","$1-$2-$3",["8[1-35-9]"],"0$1","",0],[,"(177)(\\d{6,8})","$1 $2",["1"],"0$1","",0],[,"(800)(\\d{5,7})","$1 $2",["800"],"0$1","",0],[,"(80\\d)(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80[79]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"8071\\d{6}","\\d{10}",,,"8071123456"],[,,"8071\\d{6}","\\d{10}",,,"8071123456"],,,[,,"NA","NA"]],IE:[,[,,"[124-9]\\d{6,9}","\\d{5,10}"],[,,"1\\d{7,8}|2(?:1\\d{6,7}|3\\d{7}|[24-9]\\d{5})|4(?:0[24]\\d{5}|[1-469]\\d{7}|5\\d{6}|7\\d{5}|8[0-46-9]\\d{7})|5(?:0[45]\\d{5}|1\\d{6}|[23679]\\d{7}|8\\d{5})|6(?:1\\d{6}|[237-9]\\d{5}|[4-6]\\d{7})|7[14]\\d{7}|9(?:1\\d{6}|[04]\\d{7}|[35-9]\\d{5})","\\d{5,10}",,,"2212345"],[,,"8(?:22\\d{6}|[35-9]\\d{7})","\\d{9}",,,"850123456"],[,,"1800\\d{6}","\\d{10}",,,"1800123456"],[,,"15(?:1[2-8]|[2-8]0|9[089])\\d{6}","\\d{10}",,,"1520123456"],[,,"18[59]0\\d{6}","\\d{10}",,,"1850123456"],[,,"700\\d{6}","\\d{9}",,,"700123456"],[,,"76\\d{7}","\\d{9}",,,"761234567"],"IE",353,"00","0",,,"0",,,,[[,"(1)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)","",0],[,"(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)","",0],[,"(\\d{3})(\\d{5})","$1 $2",["40[24]|50[45]"],"(0$1)","",0],[,"(48)(\\d{4})(\\d{4})","$1 $2 $3",["48"],"(0$1)","",0],[,"(818)(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)","",0],[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[24-69]|7[14]"],"(0$1)","",0],[,"([78]\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["76|8[35-9]"],"0$1","",0],[,"(700)(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1","",0],[,"(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:8[059]|5)","1(?:8[059]0|5)"],"$1","",0]],,[,,"NA","NA"],,,[,,"18[59]0\\d{6}","\\d{10}",,,"1850123456"],[,,"818\\d{6}","\\d{9}",,,"818123456"],,,[,,"8[35-9]\\d{8}","\\d{10}",,,"8501234567"]],IL:[,[,,"[17]\\d{6,9}|[2-589]\\d{3}(?:\\d{3,6})?|6\\d{3}","\\d{4,10}"],[,,"[2-489]\\d{7}","\\d{7,8}",,,"21234567"],[,,"5(?:[02-47-9]\\d{2}|5(?:01|2[23]|3[34]|4[45]|5[5689]|6[67]|7[0178]|[89][6-9])|6[2-9]\\d)\\d{5}","\\d{9}",,,"501234567"],[,,"1(?:80[019]\\d{3}|255)\\d{3}","\\d{7,10}",,,"1800123456"],[,,"1(?:212|(?:9(?:0[01]|19)|200)\\d{2})\\d{4}","\\d{8,10}",,,"1919123456"],[,,"1700\\d{6}","\\d{10}",,,"1700123456"],[,,"NA","NA"],[,,"7(?:18\\d|2[23]\\d|3[237]\\d|47\\d|6(?:5\\d|8[0168])|7\\d{2}|8(?:2\\d|33|55|77|81)|99\\d)\\d{5}","\\d{9}",,,"771234567"],"IL",972,"0(?:0|1[2-9])","0",,,"0",,,,[[,"([2-489])(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1","",0],[,"([57]\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1","",0],[,"(1)([7-9]\\d{2})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"],"$1","",0],[,"(1255)(\\d{3})","$1-$2",["125"],"$1","",0],[,"(1200)(\\d{3})(\\d{3})","$1-$2-$3",["120"],"$1","",0],[,"(1212)(\\d{2})(\\d{2})","$1-$2-$3",["121"],"$1","",0],[,"(1599)(\\d{6})","$1-$2",["15"],"$1","",0],[,"(\\d{4})","*$1",["[2-689]"],"$1","",0]],,[,,"NA","NA"],,,[,,"1700\\d{6}|[2-689]\\d{3}","\\d{4,10}",,,"1700123456"],[,,"[2-689]\\d{3}|1599\\d{6}","\\d{4}(?:\\d{6})?",,,"1599123456"],,,[,,"NA","NA"]],IM:[,[,,"[135789]\\d{6,9}","\\d{6,10}"],[,,"1624\\d{6}","\\d{6,10}",,,"1624456789"],[,,"7[569]24\\d{6}","\\d{10}",,,"7924123456"],[,,"808162\\d{4}","\\d{10}",,,"8081624567"],[,,"(?:872299|90[0167]624)\\d{4}","\\d{10}",,,"9016247890"],[,,"8(?:4(?:40[49]06|5624\\d)|70624\\d)\\d{3}","\\d{10}",,,"8456247890"],[,,"70\\d{8}","\\d{10}",,,"7012345678"],[,,"56\\d{8}","\\d{10}",,,"5612345678"],"IM",44,"00","0"," x",,"0",,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"3(?:08162\\d|3\\d{5}|4(?:40[49]06|5624\\d)|7(?:0624\\d|2299\\d))\\d{3}|55\\d{8}","\\d{10}",,,"5512345678"],,,[,,"NA","NA"]],IN:[,[,,"1\\d{7,12}|[2-9]\\d{9,10}","\\d{6,13}"],[,,"(?:11|2[02]|33|4[04]|79)[2-7]\\d{7}|80[2-467]\\d{7}|(?:1(?:2[0-249]|3[0-25]|4[145]|[59][14]|6[014]|7[1257]|8[01346])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|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]|[36][25]|22|4[28]|5[12]|[78]1|9[15])|6(?:12|[2345]1|57|6[13]|7[14]|80)|7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91))[2-7]\\d{6}|(?:(?:1(?:2[35-8]|3[346-9]|4[236-9]|[59][0235-9]|6[235-9]|7[34689]|8[257-9])|2(?:1[134689]|3[24-8]|4[2-8]|5[25689]|6[2-4679]|7[13-79]|8[2-479]|9[235-9])|3(?:01|1[79]|2[1-5]|4[25-8]|5[125689]|6[235-7]|7[157-9]|8[2-467])|4(?:1[14578]|2[5689]|3[2-467]|5[4-7]|6[35]|73|8[2689]|9[2389])|5(?:[16][146-9]|2[14-8]|3[1346]|4[14-69]|5[46]|7[2-4]|8[2-8]|9[246])|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|[57][2-689]|6[24-578]|8[1-6])|8(?:1[1357-9]|2[235-8]|3[03-57-9]|4[0-24-9]|5\\d|6[2457-9]|7[1-6]|8[1256]|9[2-4]))\\d|7(?:(?:1[013-9]|2[0235-9]|3[2679]|4[1-35689]|5[2-46-9]|[67][02-9]|9\\d)\\d|8(?:2[0-6]|[013-8]\\d)))[2-7]\\d{5}","\\d{6,10}",,,"1123456789"],[,,"(?:7(?:0(?:2[2-9]|[3-8]\\d|9[0-8])|2(?:0[024-9]|19|2[012]|5[09]|7[5-8]|9[389])|3(?:0[1-9]|[58]\\d|7[3679]|9[689])|4(?:0[1-9]|1[15-9]|[29][89]|39|8[389])|5(?:[034678]\\d|2[03-9]|5[017-9]|9[7-9])|6(?:0[0127]|1[0-257-9]|2[0-4]|3[19]|5[4589]|[6-9]\\d)|7(?:0[2-9]|[1-79]\\d|8[1-9])|8(?:[0-7]\\d|9[013-9]))|8(?:0(?:[01589]\\d|6[67])|1(?:[02-589]\\d|1[0135-9]|7[0-79])|2(?:[236-9]\\d|5[1-9])|3(?:[0357-9]\\d|4[1-9])|[45]\\d{2}|6[02457-9]\\d|7[1-69]\\d|8(?:[0-26-9]\\d|44|5[2-9])|9(?:[035-9]\\d|2[2-9]|4[0-8]))|9\\d{3})\\d{6}","\\d{10}",,,"9123456789"],[,,"1(?:600\\d{6}|80(?:0\\d{4,9}|3\\d{9}))","\\d{8,13}",,,"1800123456"],[,,"186[12]\\d{9}","\\d{13}",,,"1861123456789"],[,,"1860\\d{7}","\\d{11}",,,"18603451234"],[,,"NA","NA"],[,,"NA","NA"],"IN",91,"00","0",,,"0",,,,[[,"(\\d{5})(\\d{5})","$1 $2",["7(?:0[2-9]|2[012579]|3[057-9]|4[0-389]|6[0-35-9]|[57]|8[0-79])|8(?:0[015689]|1[0-57-9]|2[2356-9]|3[0-57-9]|[45]|6[02457-9]|7[1-69]|8[0124-9]|9[02-9])|9","7(?:0(?:2[2-9]|[3-8]|9[0-8])|2(?:0[024-9]|19|2[012]|5[09]|7[5-8]|9[389])|3(?:0[1-9]|[58]|7[3679]|9[689])|4(?:0[1-9]|1[15-9]|[29][89]|39|8[389])|5(?:[034678]|2[03-9]|5[017-9]|9[7-9])|6(?:0[0-27]|1[0-257-9]|2[0-4]|3[19]|5[4589]|[6-9])|7(?:0[2-9]|[1-79]|8[1-9])|8(?:[0-7]|9[013-9]))|8(?:0(?:[01589]|6[67])|1(?:[02-589]|1[0135-9]|7[0-79])|2(?:[236-9]|5[1-9])|3(?:[0357-9]|4[1-9])|[45]|6[02457-9]|7[1-69]|8(?:[0-26-9]|44|5[2-9])|9(?:[035-9]|2[2-9]|4[0-8]))|9"],"0$1","",1],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79|80[2-46]"],"0$1","",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[569][14]|7[1257]|8[1346]|[68][1-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|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]|[36][25]|22|4[28]|5[12]|[78]1|9[15])|6(?:12|[2345]1|57|6[13]|7[14]|80)"],"0$1","",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1|88)","7(?:12|2[14]|3[134]|4[47]|5(?:1|5[2-6])|[67]1|88)"],"0$1","",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)"],"0$1","",1],[,"(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[23579]|[468][1-9])|[2-8]"],"0$1","",1],[,"(1600)(\\d{2})(\\d{4})","$1 $2 $3",["160","1600"],"$1","",1],[,"(1800)(\\d{4,5})","$1 $2",["180","1800"],"$1","",1],[,"(18[06]0)(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],"$1","",1],[,"(140)(\\d{3})(\\d{4})","$1 $2 $3",["140"],"$1","",1],[,"(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18[06]","18(?:0[03]|6[12])"],"$1","",1]],,[,,"NA","NA"],,,[,,"1(?:600\\d{6}|8(?:0(?:0\\d{4,9}|3\\d{9})|6(?:0\\d{7}|[12]\\d{9})))","\\d{8,13}",,,"1800123456"],[,,"140\\d{7}","\\d{10}",,,"1409305260"],,,[,,"NA","NA"]],IO:[,[,,"3\\d{6}","\\d{7}"],[,,"37\\d{5}","\\d{7}",,,"3709100"],[,,"38\\d{5}","\\d{7}",,,"3801234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"IO",246,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],IQ:[,[,,"[1-7]\\d{7,9}","\\d{6,10}"],[,,"1\\d{7}|(?:2[13-5]|3[02367]|4[023]|5[03]|6[026])\\d{6,7}","\\d{6,9}",,,"12345678"],[,,"7[3-9]\\d{8}","\\d{10}",,,"7912345678"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"IQ",964,"00","0",,,"0",,,,[[,"(1)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1","",0],[,"([2-6]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1","",0],[,"(7\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],IR:[,[,,"[1-8]\\d{9}|9(?:[0-4]\\d{8}|9\\d{2,8})","\\d{4,10}"],[,,"(?:1[137]|2[13-68]|3[1458]|4[145]|5[146-8]|6[146]|7[1467]|8[13467])\\d{8}","\\d{10}",,,"2123456789"],[,,"9(?:0[12]|[1-3]\\d)\\d{7}","\\d{10}",,,"9123456789"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"(?:[2-6]0\\d|993)\\d{7}","\\d{10}",,,"9932123456"],"IR",98,"00","0",,,"0",,,,[[,"(21)(\\d{3,5})","$1 $2",["21"],"0$1","",0],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1","",0],[,"(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["9"],"0$1","",0],[,"(\\d{3})(\\d{3})","$1 $2",["9"],"0$1","",0]],,[,,"943\\d{7}","\\d{10}",,,"9432123456"],,,[,,"NA","NA"],[,,"9990\\d{0,6}","\\d{4,10}",,,"9990123456"],,,[,,"NA","NA"]],IS:[,[,,"[4-9]\\d{6}|38\\d{7}","\\d{7,9}"],[,,"(?:4(?:1[0-24-6]|2[0-7]|[37][0-8]|4[0-245]|5[0-3568]|6\\d|8[0-36-8])|5(?:05|[156]\\d|2[02578]|3[013-7]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|87[23])\\d{4}","\\d{7}",,,"4101234"],[,,"38[589]\\d{6}|(?:6(?:1[1-8]|3[089]|4[0167]|5[019]|[67][0-69]|9\\d)|7(?:5[057]|7\\d|8[0-36-8])|8(?:2[0-5]|3[0-4]|[469]\\d|5[1-9]))\\d{4}","\\d{7,9}",,,"6111234"],[,,"800\\d{4}","\\d{7}",,,"8001234"],[,,"90\\d{5}","\\d{7}",,,"9011234"],[,,"NA","NA"],[,,"NA","NA"],[,,"49\\d{5}","\\d{7}",,,"4921234"],"IS",354,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[4-9]"],"","",0],[,"(3\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["3"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"(?:6(?:2[0-8]|49|8\\d)|87[0189]|95[48])\\d{4}","\\d{7}",,,"6201234"]],IT:[,[,,"[01589]\\d{5,10}|3(?:[12457-9]\\d{8}|[36]\\d{7,9})","\\d{6,11}"],[,,"0(?:[26]\\d{4,9}|(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|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])|7(?:[0159]\\d|2[12]|3[1-7]|4[2346]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[34578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7})","\\d{6,11}",,,"0212345678"],[,,"3(?:[12457-9]\\d{8}|6\\d{7,8}|3\\d{7,9})","\\d{9,11}",,,"3123456789"],[,,"80(?:0\\d{6}|3\\d{3})","\\d{6,9}",,,"800123456"],[,,"0878\\d{5}|1(?:44|6[346])\\d{6}|89(?:2\\d{3}|4(?:[0-4]\\d{2}|[5-9]\\d{4})|5(?:[0-4]\\d{2}|[5-9]\\d{6})|9\\d{6})","\\d{6,10}",,,"899123456"],[,,"84(?:[08]\\d{6}|[17]\\d{3})","\\d{6,9}",,,"848123456"],[,,"1(?:78\\d|99)\\d{6}","\\d{9,10}",,,"1781234567"],[,,"55\\d{8}","\\d{10}",,,"5512345678"],"IT",39,"00",,,,,,,,[[,"(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|55"],"","",0],[,"(0[26])(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"],"","",0],[,"(0[26])(\\d{4,6})","$1 $2",["0[26]"],"","",0],[,"(0\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]"],"","",0],[,"(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[245])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|[45][0-4]))"],"","",0],[,"(0\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["0[13-57-9][2-46-8]"],"","",0],[,"(0\\d{3})(\\d{2,6})","$1 $2",["0[13-57-9][2-46-8]"],"","",0],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13]|8(?:00|4[08]|9[59])","[13]|8(?:00|4[08]|9(?:5[5-9]|9))"],"","",0],[,"(\\d{4})(\\d{4})","$1 $2",["894","894[5-9]"],"","",0],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3"],"","",0]],,[,,"NA","NA"],1,,[,,"848\\d{6}","\\d{9}",,,"848123456"],[,,"NA","NA"],1,,[,,"NA","NA"]],JE:[,[,,"[135789]\\d{6,9}","\\d{6,10}"],[,,"1534\\d{6}","\\d{6,10}",,,"1534456789"],[,,"7(?:509|7(?:00|97)|829|937)\\d{6}","\\d{10}",,,"7797123456"],[,,"80(?:07(?:35|81)|8901)\\d{4}","\\d{10}",,,"8007354567"],[,,"(?:871206|90(?:066[59]|1810|71(?:07|55)))\\d{4}","\\d{10}",,,"9018105678"],[,,"8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|70002)\\d{4}","\\d{10}",,,"8447034567"],[,,"701511\\d{4}","\\d{10}",,,"7015115678"],[,,"56\\d{8}","\\d{10}",,,"5612345678"],"JE",44,"00","0"," x",,"0",,,,,,[,,"76(?:0[012]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}","\\d{10}",,,"7640123456"],,,[,,"NA","NA"],[,,"3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))\\d{4}|55\\d{8}","\\d{10}",,,"5512345678"],,,[,,"NA","NA"]],JM:[,[,,"[589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"876(?:5(?:0[12]|1[0-468]|2[35]|63)|6(?:0[1-3579]|1[027-9]|[23]\\d|40|5[06]|6[2-589]|7[05]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468]))\\d{4}","\\d{7}(?:\\d{3})?",,,"8765123456"],[,,"876(?:2[16-9]\\d|[348]\\d{2}|5(?:0[3-9]|27|6[0-24-9]|[3-578]\\d)|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579]))\\d{4}","\\d{10}",,,"8762101234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"JM",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"876",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],JO:[,[,,"[235-9]\\d{7,8}","\\d{8,9}"],[,,"(?:2(?:6(?:2[0-35-9]|3[0-57-8]|4[24-7]|5[0-24-8]|[6-8][023]|9[0-3])|7(?:0[1-79]|10|2[014-7]|3[0-689]|4[019]|5[0-3578]))|32(?:0[1-69]|1[1-35-7]|2[024-7]|3\\d|4[0-3]|[57][023]|6[03])|53(?:0[0-3]|[13][023]|2[0-59]|49|5[0-35-9]|6[15]|7[45]|8[1-6]|9[0-36-9])|6(?:2[50]0|3(?:00|33)|4(?:0[0125]|1[2-7]|2[0569]|[38][07-9]|4[025689]|6[0-589]|7\\d|9[0-2])|5(?:[01][056]|2[034]|3[0-57-9]|4[17-8]|5[0-69]|6[0-35-9]|7[1-379]|8[0-68]|9[02-39]))|87(?:[02]0|7[08]|90))\\d{4}","\\d{8}",,,"62001234"],[,,"7(?:55|7[025-9]|8[05-9]|9[0-25-9])\\d{6}","\\d{9}",,,"790123456"],[,,"80\\d{6}","\\d{8}",,,"80012345"],[,,"900\\d{5}","\\d{8}",,,"90012345"],[,,"85\\d{6}","\\d{8}",,,"85012345"],[,,"70\\d{7}","\\d{9}",,,"700123456"],[,,"NA","NA"],"JO",962,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)","",0],[,"(7)(\\d{4})(\\d{4})","$1 $2 $3",["7[457-9]"],"0$1","",0],[,"(\\d{3})(\\d{5,6})","$1 $2",["70|8[0158]|9"],"0$1","",0]],,[,,"74(?:66|77)\\d{5}","\\d{9}",,,"746612345"],,,[,,"NA","NA"],[,,"8(?:10|8\\d)\\d{5}","\\d{8}",,,"88101234"],,,[,,"NA","NA"]],JP:[,[,,"[1-9]\\d{8,9}|00(?:[36]\\d{7,14}|7\\d{5,7}|8\\d{7})","\\d{8,17}"],[,,"(?:1(?:1[235-8]|2[3-6]|3[3-9]|4[2-6]|[58][2-8]|6[2-7]|7[2-9]|9[1-9])|2[2-9]\\d|[36][1-9]\\d|4(?:6[02-8]|[2-578]\\d|9[2-59])|5(?:6[1-9]|7[2-8]|[2-589]\\d)|7(?:3[4-9]|4[02-9]|[25-9]\\d)|8(?:3[2-9]|4[5-9]|5[1-9]|8[03-9]|[2679]\\d)|9(?:[679][1-9]|[2-58]\\d))\\d{6}","\\d{9}",,,"312345678"],[,,"[7-9]0[1-9]\\d{7}","\\d{10}",,,"9012345678"],[,,"120\\d{6}|800\\d{7}|00(?:37\\d{6,13}|66\\d{6,13}|777(?:[01]\\d{2}|5\\d{3}|8\\d{4})|882[1245]\\d{4})","\\d{8,17}",,,"120123456"],[,,"990\\d{6}","\\d{9}",,,"990123456"],[,,"NA","NA"],[,,"60\\d{7}","\\d{9}",,,"601234567"],[,,"50[1-9]\\d{7}","\\d{10}",,,"5012345678"],"JP",81,"010","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1","",0],[,"(\\d{4})(\\d{4})","$1-$2",["0077"],"$1","",0],[,"(\\d{4})(\\d{2})(\\d{3,4})","$1-$2-$3",["0077"],"$1","",0],[,"(\\d{4})(\\d{2})(\\d{4})","$1-$2-$3",["0088"],"$1","",0],[,"(\\d{4})(\\d{3})(\\d{3,4})","$1-$2-$3",["00(?:37|66)"],"$1","",0],[,"(\\d{4})(\\d{4})(\\d{4,5})","$1-$2-$3",["00(?:37|66)"],"$1","",0],[,"(\\d{4})(\\d{5})(\\d{5,6})","$1-$2-$3",["00(?:37|66)"],"$1","",0],[,"(\\d{4})(\\d{6})(\\d{6,7})","$1-$2-$3",["00(?:37|66)"],"$1","",0],[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[2579]0|80[1-9]"],"0$1","",0],[,"(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|5(?:76|97)|499|746|8(?:3[89]|63|47|51)|9(?:49|80|9[16])","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:76|97)9|499[2468]|7468|8(?:3(?:8[78]|96)|636|477|51[24])|9(?:496|802|9(?:1[23]|69))","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:769|979[2-69])|499[2468]|7468|8(?:3(?:8[78]|96[2457-9])|636[2-57-9]|477|51[24])|9(?:496|802|9(?:1[23]|69))"],"0$1","",0],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["1(?:2[3-6]|3[3-9]|4[2-6]|5[2-8]|[68][2-7]|7[2-689]|9[1-578])|2(?:2[03-689]|3[3-58]|4[0-468]|5[04-8]|6[013-8]|7[06-9]|8[02-57-9]|9[13])|4(?:2[28]|3[689]|6[035-7]|7[05689]|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9[4-9])|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9[014-9])|8(?:2[49]|3[3-8]|4[5-8]|5[2-9]|6[35-9]|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9[3-7])","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9[2-8])|3(?:7[2-6]|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5[4-7]|6[2-9]|8[2-8]|9[236-9])|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3[34]|[4-7]))","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6[56]))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6(?:5[25]|60)))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1|2(?:2[37]|5[5-9]|64|78|8[39]|91)|4(?:2[2689]|64|7[347])|5(?:[2-589]|39)|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93)","1|2(?:2[37]|5(?:[57]|[68]0|9[19])|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93[34])","1|2(?:2[37]|5(?:[57]|[68]0|9(?:17|99))|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93(?:31|4))"],"0$1","",0],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["2(?:9[14-79]|74|[34]7|[56]9)|82|993"],"0$1","",0],[,"(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[2479][1-9]"],"0$1","",0]],[[,"(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1","",0],[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[2579]0|80[1-9]"],"0$1","",0],[,"(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|5(?:76|97)|499|746|8(?:3[89]|63|47|51)|9(?:49|80|9[16])","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:76|97)9|499[2468]|7468|8(?:3(?:8[78]|96)|636|477|51[24])|9(?:496|802|9(?:1[23]|69))","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:769|979[2-69])|499[2468]|7468|8(?:3(?:8[78]|96[2457-9])|636[2-57-9]|477|51[24])|9(?:496|802|9(?:1[23]|69))"],"0$1","",0],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["1(?:2[3-6]|3[3-9]|4[2-6]|5[2-8]|[68][2-7]|7[2-689]|9[1-578])|2(?:2[03-689]|3[3-58]|4[0-468]|5[04-8]|6[013-8]|7[06-9]|8[02-57-9]|9[13])|4(?:2[28]|3[689]|6[035-7]|7[05689]|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9[4-9])|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9[014-9])|8(?:2[49]|3[3-8]|4[5-8]|5[2-9]|6[35-9]|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9[3-7])","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9[2-8])|3(?:7[2-6]|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5[4-7]|6[2-9]|8[2-8]|9[236-9])|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3[34]|[4-7]))","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6[56]))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6(?:5[25]|60)))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1|2(?:2[37]|5[5-9]|64|78|8[39]|91)|4(?:2[2689]|64|7[347])|5(?:[2-589]|39)|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93)","1|2(?:2[37]|5(?:[57]|[68]0|9[19])|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93[34])","1|2(?:2[37]|5(?:[57]|[68]0|9(?:17|99))|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93(?:31|4))"],"0$1","",0],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["2(?:9[14-79]|74|[34]7|[56]9)|82|993"],"0$1","",0],[,"(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[2479][1-9]"],"0$1","",0]],[,,"20\\d{8}","\\d{10}",,,"2012345678"],,,[,,"00(?:37\\d{6,13}|66\\d{6,13}|777(?:[01]\\d{2}|5\\d{3}|8\\d{4})|882[1245]\\d{4})","\\d{8,17}",,,"00777012"],[,,"570\\d{6}","\\d{9}",,,"570123456"],1,,[,,"NA","NA"]],KE:[,[,,"20\\d{6,7}|[4-9]\\d{6,9}","\\d{7,10}"],[,,"20\\d{6,7}|4(?:[0136]\\d{7}|[245]\\d{5,7})|5(?:[08]\\d{7}|[1-79]\\d{5,7})|6(?:[01457-9]\\d{5,7}|[26]\\d{7})","\\d{7,9}",,,"202012345"],[,,"7(?:[0-36]\\d|5[0-6]|7[0-5]|8[0-25-9])\\d{6}","\\d{9}",,,"712123456"],[,,"800[24-8]\\d{5,6}","\\d{9,10}",,,"800223456"],[,,"900[02-9]\\d{5}","\\d{9}",,,"900223456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"KE",254,"000","0",,,"0",,,,[[,"(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1","",0],[,"(\\d{3})(\\d{6,7})","$1 $2",["7"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],KG:[,[,,"[235-8]\\d{8,9}","\\d{5,10}"],[,,"(?:3(?:1(?:[256]\\d|3[1-9]|47)|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6\\d)|5(?:22|3[4-7]|59|6\\d)|6(?:22|5[35-7]|6\\d)|7(?:22|3[468]|4[1-9]|59|[67]\\d)|9(?:22|4[1-8]|6\\d))|6(?:09|12|2[2-4])\\d)\\d{5}","\\d{5,10}",,,"312123456"],[,,"(?:20[0-35]|5[124-7]\\d|7[07]\\d)\\d{6}","\\d{9}",,,"700123456"],[,,"800\\d{6,7}","\\d{9,10}",,,"800123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"KG",996,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[25-7]|31[25]"],"0$1","",0],[,"(\\d{4})(\\d{5})","$1 $2",["3(?:1[36]|[2-9])"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d)(\\d{3})","$1 $2 $3 $4",["8"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],KH:[,[,,"[1-9]\\d{7,9}","\\d{6,10}"],[,,"(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])(?:[237-9]|4[56]|5\\d|6\\d?)\\d{5}|23(?:4[234]|8\\d{2})\\d{4}","\\d{6,9}",,,"23756789"],[,,"(?:1(?:[013-9]|2\\d?)|3[18]\\d|6[016-9]|7(?:[07-9]|[16]\\d)|8(?:[013-79]|8\\d)|9(?:6\\d|7\\d?|[0-589]))\\d{6}","\\d{8,9}",,,"91234567"],[,,"1800(?:1\\d|2[019])\\d{4}","\\d{10}",,,"1800123456"],[,,"1900(?:1\\d|2[09])\\d{4}","\\d{10}",,,"1900123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"KH",855,"00[14-9]","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["1\\d[1-9]|[2-9]"],"0$1","",0],[,"(1[89]00)(\\d{3})(\\d{3})","$1 $2 $3",["1[89]0"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],KI:[,[,,"[2458]\\d{4}|3\\d{4,7}|7\\d{7}","\\d{5,8}"],[,,"(?:[24]\\d|3[1-9]|50|8[0-5])\\d{3}","\\d{5}",,,"31234"],[,,"7(?:[24]\\d|3[1-9]|8[0-5])\\d{5}","\\d{8}",,,"72012345"],[,,"NA","NA"],[,,"3001\\d{4}","\\d{5,8}",,,"30010000"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"KI",686,"00",,,,"0",,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],KM:[,[,,"[379]\\d{6}","\\d{7}"],[,,"7(?:6[0-37-9]|7[0-57-9])\\d{4}","\\d{7}",,,"7712345"],[,,"3[234]\\d{5}","\\d{7}",,,"3212345"],[,,"NA","NA"],[,,"(?:39[01]|9[01]0)\\d{4}","\\d{7}",,,"9001234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"KM",269,"00",,,,,,,,[[,"(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],KN:[,[,,"[589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"869(?:2(?:29|36)|302|4(?:6[015-9]|70))\\d{4}","\\d{7}(?:\\d{3})?",,,"8692361234"],[,,"869(?:5(?:5[6-8]|6[5-7])|66\\d|76[02-6])\\d{4}","\\d{10}",,,"8697652917"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"KN",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"869",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],KP:[,[,,"1\\d{9}|[28]\\d{7}","\\d{6,8}|\\d{10}"],[,,"2\\d{7}|85\\d{6}","\\d{6,8}",,,"21234567"],[,,"19[123]\\d{7}","\\d{10}",,,"1921234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"KP",850,"00|99","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1","",0],[,"(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1","",0]],,[,,"NA","NA"],,,[,,"2(?:[0-24-9]\\d{2}|3(?:[0-79]\\d|8[02-9]))\\d{4}","\\d{8}",,,"23821234"],[,,"NA","NA"],,,[,,"NA","NA"]],KR:[,[,,"[1-7]\\d{3,9}|8\\d{8}","\\d{4,10}"],[,,"(?:2|3[1-3]|[46][1-4]|5[1-5])(?:1\\d{2,3}|[1-9]\\d{6,7})","\\d{4,10}",,,"22123456"],[,,"1[0-26-9]\\d{7,8}","\\d{9,10}",,,"1000000000"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"60[2-9]\\d{6}","\\d{9}",,,"602345678"],[,,"NA","NA"],[,,"50\\d{8}","\\d{10}",,,"5012345678"],[,,"70\\d{8}","\\d{10}",,,"7012345678"],"KR",82,"00(?:[124-68]|[37]\\d{2})","0",,,"0(8[1-46-8]|85\\d{2})?",,,,[[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["1(?:0|1[19]|[69]9|5[458])|[57]0","1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0"],"0$1","0$CC-$1",0],[,"(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["1(?:[169][2-8]|[78]|5[1-4])|[68]0|[3-6][1-9][1-9]","1(?:[169][2-8]|[78]|5(?:[1-3]|4[56]))|[68]0|[3-6][1-9][1-9]"],"0$1","0$CC-$1",0],[,"(\\d{3})(\\d)(\\d{4})","$1-$2-$3",["131","1312"],"0$1","0$CC-$1",0],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["131","131[13-9]"],"0$1","0$CC-$1",0],[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["13[2-9]"],"0$1","0$CC-$1",0],[,"(\\d{2})(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3-$4",["30"],"0$1","0$CC-$1",0],[,"(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2[1-9]"],"0$1","0$CC-$1",0],[,"(\\d)(\\d{3,4})","$1-$2",["21[0-46-9]"],"0$1","0$CC-$1",0],[,"(\\d{2})(\\d{3,4})","$1-$2",["[3-6][1-9]1","[3-6][1-9]1(?:[0-46-9])"],"0$1","0$CC-$1",0],[,"(\\d{4})(\\d{4})","$1-$2",["1(?:5[46-9]|6[04678]|8[0579])","1(?:5(?:44|66|77|88|99)|6(?:00|44|6[16]|70|88)|8(?:00|55|77|99))"],"$1","0$CC-$1",0]],,[,,"15\\d{7,8}","\\d{9,10}",,,"1523456789"],,,[,,"NA","NA"],[,,"1(?:5(?:44|66|77|88|99)|6(?:00|44|6[16]|70|88)|8(?:00|55|77|99))\\d{4}","\\d{8}",,,"15441234"],,,[,,"NA","NA"]],KW:[,[,,"[12569]\\d{6,7}","\\d{7,8}"],[,,"(?:18\\d|2(?:[23]\\d{2}|4(?:[1-35-9]\\d|44)|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7])))\\d{4}","\\d{7,8}",,,"22345678"],[,,"(?:5(?:[05]\\d|1[0-7])|6(?:0[034679]|5[015-9]|6\\d|7[067]|9[0369])|9(?:0[09]|22|4[01479]|55|6[0679]|[79]\\d|8[057-9]))\\d{5}","\\d{8}",,,"50012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"KW",965,"00",,,,,,,,[[,"(\\d{4})(\\d{3,4})","$1 $2",["[126]|9[04-9]"],"","",0],[,"(\\d{3})(\\d{5})","$1 $2",["5[015]|92"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],KY:[,[,,"[3589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\d{4}","\\d{7}(?:\\d{3})?",,,"3452221234"],[,,"345(?:32[1-9]|5(?:1[67]|2[5-7]|4[6-8]|76)|9(?:1[67]|2[2-9]|3[689]))\\d{4}","\\d{10}",,,"3453231234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}|345976\\d{4}","\\d{10}",,,"9002345678"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"KY",1,"011","1",,,"1",,,,,,[,,"345849\\d{4}","\\d{10}",,,"3458491234"],,"345",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],KZ:[,[,,"(?:33\\d|7\\d{2}|80[09])\\d{7}","\\d{10}"],[,,"33622\\d{5}|7(?:1(?:0(?:[23]\\d|4[023]|59|63)|1(?:[23]\\d|4[0-79]|59)|2(?:[23]\\d|59)|3(?:2\\d|3[1-79]|4[0-35-9]|59)|4(?:2\\d|3[013-79]|4[0-8]|5[1-79])|5(?:2\\d|3[1-8]|4[1-7]|59)|6(?:[234]\\d|5[19]|61)|72\\d|8(?:[27]\\d|3[1-46-9]|4[0-5]))|2(?:1(?:[23]\\d|4[46-9]|5[3469])|2(?:2\\d|3[0679]|46|5[12679])|3(?:[234]\\d|5[139])|4(?:2\\d|3[1235-9]|59)|5(?:[23]\\d|4[01246-8]|59|61)|6(?:2\\d|3[1-9]|4[0-4]|59)|7(?:[237]\\d|40|5[279])|8(?:[23]\\d|4[0-3]|59)|9(?:2\\d|3[124578]|59)))\\d{5}","\\d{10}",,,"7123456789"],[,,"7(?:0[012578]|47|6[02-4]|7[15-8]|85)\\d{7}","\\d{10}",,,"7710009998"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"809\\d{7}","\\d{10}",,,"8091234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"751\\d{7}","\\d{10}",,,"7511234567"],"KZ",7,"810","8",,,"8",,"8~10",,,,[,,"NA","NA"],,,[,,"751\\d{7}","\\d{10}",,,"7511234567"],[,,"NA","NA"],,,[,,"NA","NA"]],LA:[,[,,"[2-8]\\d{7,9}","\\d{6,10}"],[,,"(?:2[13]|3(?:0\\d|[14])|[5-7][14]|41|8[1468])\\d{6}","\\d{6,9}",,,"21212862"],[,,"20(?:2[2389]|5[4-689]|7[6-8]|9[15-9])\\d{6}","\\d{10}",,,"2023123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"LA",856,"00","0",,,"0",,,,[[,"(20)(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["20"],"0$1","",0],[,"([2-8]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1","",0],[,"(30)(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],LB:[,[,,"[13-9]\\d{6,7}","\\d{7,8}"],[,,"(?:[14-6]\\d{2}|7(?:[2-57]\\d|62|8[0-7]|9[04-9])|8[02-9]\\d|9\\d{2})\\d{4}","\\d{7}",,,"1123456"],[,,"(?:3\\d|7(?:[01]\\d|6[013-9]|8[89]|9[1-3])|81\\d)\\d{5}","\\d{7,8}",,,"71123456"],[,,"NA","NA"],[,,"9[01]\\d{6}","\\d{8}",,,"90123456"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"NA","NA"],[,,"NA","NA"],"LB",961,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-6]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]|9"],"0$1","",0],[,"([7-9]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[89][01]|7(?:[01]|6[013-9]|8[89]|9[1-3])"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],LC:[,[,,"[5789]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"758(?:4(?:30|5[0-9]|6[2-9]|8[0-2])|57[0-2]|638)\\d{4}","\\d{7}(?:\\d{3})?",,,"7584305678"],[,,"758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2[0-8]))\\d{4}","\\d{10}",,,"7582845678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"LC",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"758",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],LI:[,[,,"6\\d{8}|[23789]\\d{6}","\\d{7,9}"],[,,"(?:2(?:01|1[27]|3\\d|6[02-578]|96)|3(?:7[0135-7]|8[048]|9[0269]))\\d{4}","\\d{7}",,,"2345678"],[,,"6(?:51[01]|6(?:0[0-6]|2[016-9]|39))\\d{5}|7(?:[37-9]\\d|42|56)\\d{4}","\\d{7,9}",,,"660234567"],[,,"80(?:02[28]|9\\d{2})\\d{2}","\\d{7}",,,"8002222"],[,,"90(?:02[258]|1(?:23|3[14])|66[136])\\d{2}","\\d{7}",,,"9002222"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"LI",423,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[23789]"],"","",0],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[56]"],"","",0],[,"(69)(7\\d{2})(\\d{4})","$1 $2 $3",["697"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"870(?:28|87)\\d{2}","\\d{7}",,,"8702812"],,,[,,"697(?:42|56|[7-9]\\d)\\d{4}","\\d{9}",,,"697861234"]],LK:[,[,,"[1-9]\\d{8}","\\d{7,9}"],[,,"(?:[189]1|2[13-7]|3[1-8]|4[157]|5[12457]|6[35-7])[2-57]\\d{6}","\\d{7,9}",,,"112345678"],[,,"7[0125-8]\\d{7}","\\d{9}",,,"712345678"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"LK",94,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{1})(\\d{6})","$1 $2 $3",["[1-689]"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],LR:[,[,,"2\\d{7}|[37-9]\\d{8}|[45]\\d{6}","\\d{7,9}"],[,,"2\\d{7}","\\d{8}",,,"21234567"],[,,"(?:330\\d|4[67]|5\\d|77\\d{2}|88\\d{2}|994\\d)\\d{5}","\\d{7,9}",,,"770123456"],[,,"NA","NA"],[,,"90[03]\\d{6}","\\d{9}",,,"900123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"332(?:0[02]|5\\d)\\d{4}","\\d{9}",,,"332001234"],"LR",231,"00","0",,,"0",,,,[[,"(2\\d)(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1","",0],[,"([79]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[79]"],"0$1","",0],[,"([4-6])(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[38]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],LS:[,[,,"[2568]\\d{7}","\\d{8}"],[,,"2\\d{7}","\\d{8}",,,"22123456"],[,,"[56]\\d{7}","\\d{8}",,,"50123456"],[,,"800[256]\\d{4}","\\d{8}",,,"80021234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"LS",266,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],LT:[,[,,"[3-9]\\d{7}","\\d{8}"],[,,"(?:3[1478]|4[124-6]|52)\\d{6}","\\d{8}",,,"31234567"],[,,"6\\d{7}","\\d{8}",,,"61234567"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"9(?:0[0239]|10)\\d{5}","\\d{8}",,,"90012345"],[,,"808\\d{5}","\\d{8}",,,"80812345"],[,,"700\\d{5}","\\d{8}",,,"70012345"],[,,"NA","NA"],"LT",370,"00","8",,,"[08]",,,,[[,"([34]\\d)(\\d{6})","$1 $2",["37|4(?:1|5[45]|6[2-4])"],"(8-$1)","",1],[,"([3-6]\\d{2})(\\d{5})","$1 $2",["3[148]|4(?:[24]|6[09])|528|6"],"(8-$1)","",1],[,"([7-9]\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1","",1],[,"(5)(2\\d{2})(\\d{4})","$1 $2 $3",["52[0-79]"],"(8-$1)","",1]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"70[67]\\d{5}","\\d{8}",,,"70712345"],,,[,,"NA","NA"]],LU:[,[,,"[24-9]\\d{3,10}|3(?:[0-46-9]\\d{2,9}|5[013-9]\\d{1,8})","\\d{4,11}"],[,,"(?:2[2-9]\\d{2,9}|(?:[3457]\\d{2}|8(?:0[2-9]|[13-9]\\d)|9(?:0[89]|[2-579]\\d))\\d{1,8})","\\d{4,11}",,,"27123456"],[,,"6[2679][18]\\d{6}","\\d{9}",,,"628123456"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"90[015]\\d{5}","\\d{8}",,,"90012345"],[,,"801\\d{5}","\\d{8}",,,"80112345"],[,,"70\\d{6}","\\d{8}",,,"70123456"],[,,"20(?:1\\d{5}|[2-689]\\d{1,7})","\\d{4,10}",,,"20201234"],"LU",352,"00",,,,"(15(?:0[06]|1[12]|35|4[04]|55|6[26]|77|88|99)\\d)",,,,[[,"(\\d{2})(\\d{3})","$1 $2",["[2-5]|7[1-9]|[89](?:[1-9]|0[2-9])"],"","$CC $1",0],[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-5]|7[1-9]|[89](?:[1-9]|0[2-9])"],"","$CC $1",0],[,"(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20"],"","$CC $1",0],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"],"","$CC $1",0],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"],"","$CC $1",0],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"],"","$CC $1",0],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{1,4})","$1 $2 $3 $4",["2(?:[12589]|4[12])|[3-5]|7[1-9]|8(?:[1-9]|0[2-9])|9(?:[1-9]|0[2-46-9])"],"","$CC $1",0],[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["70|80[01]|90[015]"],"","$CC $1",0],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"],"","$CC $1",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],LV:[,[,,"[2689]\\d{7}","\\d{8}"],[,,"6[3-8]\\d{6}","\\d{8}",,,"63123456"],[,,"2\\d{7}","\\d{8}",,,"21234567"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"90\\d{6}","\\d{8}",,,"90123456"],[,,"81\\d{6}","\\d{8}",,,"81123456"],[,,"NA","NA"],[,,"NA","NA"],"LV",371,"00",,,,,,,,[[,"([2689]\\d)(\\d{3})(\\d{3})","$1 $2 $3",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],LY:[,[,,"[25679]\\d{8}","\\d{7,9}"],[,,"(?:2[1345]|5[1347]|6[123479]|71)\\d{7}","\\d{7,9}",,,"212345678"],[,,"9[1-6]\\d{7}","\\d{9}",,,"912345678"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"LY",218,"00","0",,,"0",,,,[[,"([25679]\\d)(\\d{7})","$1-$2",,"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MA:[,[,,"[5689]\\d{8}","\\d{9}"],[,,"5(?:2(?:(?:[015-7]\\d|2[2-9]|3[2-57]|4[2-8]|8[235-7])\\d|9(?:0\\d|[89]0))|3(?:(?:[0-4]\\d|[57][2-9]|6[235-8]|9[3-9])\\d|8(?:0\\d|[89]0)))\\d{4}","\\d{9}",,,"520123456"],[,,"6(?:0[0-8]|[12-79]\\d|8[017])\\d{6}","\\d{9}",,,"650123456"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"89\\d{7}","\\d{9}",,,"891234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"MA",212,"00","0",,,"0",,,,[[,"([56]\\d{2})(\\d{6})","$1-$2",["5(?:2[015-7]|3[0-4])|6"],"0$1","",0],[,"([58]\\d{3})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9])|892","5(?:2(?:[2-48]|90)|3(?:[5-79]|80))|892"],"0$1","",0],[,"(5\\d{4})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29|38)[89]"],"0$1","",0],[,"(8[09])(\\d{7})","$1-$2",["8(?:0|9[013-9])"],"0$1","",0]],,[,,"NA","NA"],1,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MC:[,[,,"[4689]\\d{7,8}","\\d{8,9}"],[,,"870\\d{5}|9[2-47-9]\\d{6}","\\d{8}",,,"99123456"],[,,"6\\d{8}|4(?:4\\d|5[2-9])\\d{5}","\\d{8,9}",,,"612345678"],[,,"90\\d{6}","\\d{8}",,,"90123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"MC",377,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"$1","",0],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1","",0],[,"(6)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["8"],"$1","",0]],,[,,"NA","NA"],,,[,,"8\\d{7}","\\d{8}"],[,,"NA","NA"],,,[,,"NA","NA"]],MD:[,[,,"[235-9]\\d{7}","\\d{8}"],[,,"(?:2(?:1[0569]|2\\d|3[015-7]|4[1-46-9]|5[0-24689]|6[2-589]|7[1-37]|9[1347-9])|5(?:33|5[257]))\\d{5}","\\d{8}",,,"22212345"],[,,"(?:562\\d|6(?:[089]\\d{2}|1[01]\\d|21\\d|7(?:[1-6]\\d|7[0-4]))|7(?:6[07]|7[457-9]|[89]\\d)\\d)\\d{4}","\\d{8}",,,"62112345"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"90[056]\\d{5}","\\d{8}",,,"90012345"],[,,"808\\d{5}","\\d{8}",,,"80812345"],[,,"NA","NA"],[,,"3[08]\\d{6}","\\d{8}",,,"30123456"],"MD",373,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1","",0],[,"([25-7]\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["2[13-79]|[5-7]"],"0$1","",0],[,"([89]\\d{2})(\\d{5})","$1 $2",["[89]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"8(?:03|14)\\d{5}","\\d{8}",,,"80312345"],,,[,,"NA","NA"]],ME:[,[,,"[2-9]\\d{7,8}","\\d{6,9}"],[,,"(?:20[2-8]|3(?:0[2-7]|[12][35-7]|3[4-7])|4(?:0[2367]|1[267])|5(?:0[467]|1[267]|2[367]))\\d{5}","\\d{6,8}",,,"30234567"],[,,"6(?:00\\d|32\\d|[89]\\d{2}|61\\d|7(?:[0-8]\\d|9(?:[3-9]|[0-2]\\d)))\\d{4}","\\d{8,9}",,,"67622901"],[,,"80\\d{6}","\\d{8}",,,"80080002"],[,,"(?:9(?:4[1568]|5[178]))\\d{5}","\\d{8}",,,"94515151"],[,,"NA","NA"],[,,"NA","NA"],[,,"78[1-9]\\d{5}","\\d{8}",,,"78108780"],"ME",382,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]|6[036-9]","[2-57-9]|6(?:[03689]|7(?:[0-8]|9[3-9]))"],"0$1","",0],[,"(67)(9)(\\d{3})(\\d{3})","$1 $2 $3 $4",["679","679[0-2]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"77\\d{6}","\\d{8}",,,"77273012"],,,[,,"NA","NA"]],MF:[,[,,"[56]\\d{8}","\\d{9}"],[,,"590(?:[02][79]|13|5[0-268]|[78]7)\\d{4}","\\d{9}",,,"590271234"],[,,"690(?:0[0-7]|[1-9]\\d)\\d{4}","\\d{9}",,,"690301234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"MF",590,"00","0",,,"0",,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MG:[,[,,"[23]\\d{8}","\\d{7,9}"],[,,"20(?:2\\d{2}|4[47]\\d|5[3467]\\d|6[279]\\d|7(?:2[29]|[35]\\d)|8[268]\\d|9[245]\\d)\\d{4}","\\d{7,9}",,,"202123456"],[,,"3[2-49]\\d{7}","\\d{9}",,,"321234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"22\\d{7}","\\d{9}",,,"221234567"],"MG",261,"00","0",,,"0",,,,[[,"([23]\\d)(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",,"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MH:[,[,,"[2-6]\\d{6}","\\d{7}"],[,,"(?:247|528|625)\\d{4}","\\d{7}",,,"2471234"],[,,"(?:235|329|45[56]|545)\\d{4}","\\d{7}",,,"2351234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"635\\d{4}","\\d{7}",,,"6351234"],"MH",692,"011","1",,,"1",,,,[[,"(\\d{3})(\\d{4})","$1-$2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MK:[,[,,"[2-578]\\d{7}","\\d{8}"],[,,"(?:2(?:[23]\\d|5[124578]|6[01])|3(?:1[3-6]|[23][2-6]|4[2356])|4(?:[23][2-6]|4[3-6]|5[256]|6[25-8]|7[24-6]|8[4-6]))\\d{5}","\\d{6,8}",,,"22212345"],[,,"7(?:[0-25-8]\\d{2}|32\\d|421)\\d{4}","\\d{8}",,,"72345678"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"5[02-9]\\d{6}","\\d{8}",,,"50012345"],[,,"8(?:0[1-9]|[1-9]\\d)\\d{5}","\\d{8}",,,"80123456"],[,,"NA","NA"],[,,"NA","NA"],"MK",389,"00","0",,,"0",,,,[[,"(2)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1","",0],[,"([347]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1","",0],[,"([58]\\d{2})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],ML:[,[,,"[246-9]\\d{7}","\\d{8}"],[,,"(?:2(?:0(?:2[0-589]|7\\d)|1(?:2[5-7]|[3-689]\\d|7[2-4689]))|44[239]\\d)\\d{4}","\\d{8}",,,"20212345"],[,,"[67]\\d{7}|9[0-25-9]\\d{6}","\\d{8}",,,"65012345"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"ML",223,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[246-9]"],"","",0],[,"(\\d{4})","$1",["67|74"],"","",0]],[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[246-9]"],"","",0]],[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MM:[,[,,"[14578]\\d{5,7}|[26]\\d{5,8}|9(?:2\\d{0,2}|[58]|3\\d|4\\d{1,2}|6\\d?|[79]\\d{0,2})\\d{6}","\\d{5,10}"],[,,"1(?:2\\d{1,2}|[3-5]\\d|6\\d?|[89][0-6]\\d)\\d{4}|2(?:[236-9]\\d{4}|4(?:0\\d{5}|\\d{4})|5(?:1\\d{3,6}|[02-9]\\d{3,5}))|4(?:2[245-8]|[346][2-6]|5[3-5])\\d{4}|5(?:2(?:20?|[3-8])|3[2-68]|4(?:21?|[4-8])|5[23]|6[2-4]|7[2-8]|8[24-7]|9[2-7])\\d{4}|6(?:0[23]|1[2356]|[24][2-6]|3[24-6]|5[2-4]|6[2-8]|7(?:[2367]|4\\d|5\\d?|8[145]\\d)|8[245]|9[24])\\d{4}|7(?:[04][24-8]|[15][2-7]|22|3[2-4])\\d{4}|8(?:1(?:2\\d?|[3-689])|2[2-8]|3[24]|4[24-7]|5[245]|6[23])\\d{4}","\\d{5,9}",,,"1234567"],[,,"17[01]\\d{4}|9(?:2(?:[0-4]|5\\d{2})|3[136]\\d|4(?:0[0-4]\\d|[1379]\\d|[24][0-589]\\d|5\\d{2}|88)|5[0-6]|61?\\d|7(?:3\\d|[89]\\d{2})|8\\d|9(?:1\\d|7\\d{2}|[089]))\\d{5}","\\d{7,10}",,,"92123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"1333\\d{4}","\\d{8}",,,"13331234"],"MM",95,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["1|2[45]"],"0$1","",0],[,"(2)(\\d{4})(\\d{4})","$1 $2 $3",["251"],"0$1","",0],[,"(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["67|81"],"0$1","",0],[,"(\\d{2})(\\d{2})(\\d{3,4})","$1 $2 $3",["[4-8]"],"0$1","",0],[,"(9)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[13789])"],"0$1","",0],[,"(9)(4\\d{4})(\\d{4})","$1 $2 $3",["94[0245]"],"0$1","",0],[,"(9)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["925"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MN:[,[,,"[12]\\d{7,9}|[57-9]\\d{7}","\\d{6,10}"],[,,"[12](?:1\\d|2(?:[1-3]\\d?|7\\d)|3[2-8]\\d{1,2}|4[2-68]\\d{1,2}|5[1-4689]\\d{1,2})\\d{5}|5[0568]\\d{6}","\\d{6,10}",,,"50123456"],[,,"(?:8[689]|9[013-9])\\d{6}","\\d{8}",,,"88123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"7[05-8]\\d{6}","\\d{8}",,,"75123456"],"MN",976,"001","0",,,"0",,,,[[,"([12]\\d)(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1","",0],[,"([12]2\\d)(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1","",0],[,"([12]\\d{3})(\\d{5})","$1 $2",["[12](?:27|[3-5])","[12](?:27|[3-5]\\d)2"],"0$1","",0],[,"(\\d{4})(\\d{4})","$1 $2",["[57-9]"],"$1","",0],[,"([12]\\d{4})(\\d{4,5})","$1 $2",["[12](?:27|[3-5])","[12](?:27|[3-5]\\d)[4-9]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MO:[,[,,"[268]\\d{7}","\\d{8}"],[,,"(?:28[2-57-9]|8[2-57-9]\\d)\\d{5}","\\d{8}",,,"28212345"],[,,"6[236]\\d{6}","\\d{8}",,,"66123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"MO",853,"00",,,,,,,,[[,"([268]\\d{3})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MP:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"670(?:2(?:3[3-7]|56|8[5-8])|32[1238]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[589]|8[3-9]8|989)\\d{4}","\\d{7}(?:\\d{3})?",,,"6702345678"],[,,"670(?:2(?:3[3-7]|56|8[5-8])|32[1238]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[589]|8[3-9]8|989)\\d{4}","\\d{7}(?:\\d{3})?",,,"6702345678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"MP",1,"011","1",,,"1",,,1,,,[,,"NA","NA"],,"670",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MQ:[,[,,"[56]\\d{8}","\\d{9}"],[,,"596(?:0[2-5]|[12]0|3[05-9]|4[024-8]|[5-7]\\d|89|9[4-8])\\d{4}","\\d{9}",,,"596301234"],[,,"696(?:[0-479]\\d|5[01]|8[0-689])\\d{4}","\\d{9}",,,"696201234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"MQ",596,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MR:[,[,,"[2-48]\\d{7}","\\d{8}"],[,,"25[08]\\d{5}|35\\d{6}|45[1-7]\\d{5}","\\d{8}",,,"35123456"],[,,"(?:2(?:2\\d|70)|3(?:3\\d|6[1-36]|7[1-3])|4(?:[49]\\d|6[0457-9]|7[4-9]|8[01346-8]))\\d{5}","\\d{8}",,,"22123456"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"MR",222,"00",,,,,,,,[[,"([2-48]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MS:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"664491\\d{4}","\\d{7}(?:\\d{3})?",,,"6644912345"],[,,"66449[2-6]\\d{4}","\\d{10}",,,"6644923456"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"MS",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"664",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MT:[,[,,"[2357-9]\\d{7}","\\d{8}"],[,,"2(?:0(?:1[0-6]|3[1-4]|[69]\\d)|[1-357]\\d{2})\\d{4}","\\d{8}",,,"21001234"],[,,"(?:7(?:210|[79]\\d{2})|9(?:2(?:1[01]|31)|696|8(?:1[1-3]|89|97)|9\\d{2}))\\d{4}","\\d{8}",,,"96961234"],[,,"800[3467]\\d{4}","\\d{8}",,,"80071234"],[,,"5(?:0(?:0(?:37|43)|6\\d{2}|70\\d|9[0168])|[12]\\d0[1-5])\\d{3}","\\d{8}",,,"50037123"],[,,"NA","NA"],[,,"NA","NA"],[,,"3550\\d{4}","\\d{8}",,,"35501234"],"MT",356,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",,"","",0]],,[,,"7117\\d{4}","\\d{8}",,,"71171234"],,,[,,"NA","NA"],[,,"501\\d{5}","\\d{8}",,,"50112345"],,,[,,"NA","NA"]],MU:[,[,,"[2-9]\\d{6,7}","\\d{7,8}"],[,,"(?:2(?:[03478]\\d|1[0-7]|6[1-69])|4(?:[013568]\\d|2[4-7])|5(?:44\\d|471)|6\\d{2}|8(?:14|3[129]))\\d{4}","\\d{7,8}",,,"2012345"],[,,"5(?:2[59]\\d|4(?:2[1-389]|4\\d|7[1-9]|9\\d)|7\\d{2}|8(?:[2568]\\d|7[15-8])|9[0-8]\\d)\\d{4}","\\d{8}",,,"52512345"],[,,"80[012]\\d{4}","\\d{7}",,,"8001234"],[,,"30\\d{5}","\\d{7}",,,"3012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"3(?:20|9\\d)\\d{4}","\\d{7}",,,"3201234"],"MU",230,"0(?:0|[2-7]0|33)",,,,,,"020",,[[,"([2-46-9]\\d{2})(\\d{4})","$1 $2",["[2-46-9]"],"","",0],[,"(5\\d{3})(\\d{4})","$1 $2",["5"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MV:[,[,,"[3467]\\d{6}|9(?:00\\d{7}|\\d{6})","\\d{7,10}"],[,,"(?:3(?:0[01]|3[0-59])|6(?:[567][02468]|8[024689]|90))\\d{4}","\\d{7}",,,"6701234"],[,,"(?:46[46]|7[3-9]\\d|9[15-9]\\d)\\d{4}","\\d{7}",,,"7712345"],[,,"NA","NA"],[,,"900\\d{7}","\\d{10}",,,"9001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"MV",960,"0(?:0|19)",,,,,,"00",,[[,"(\\d{3})(\\d{4})","$1-$2",["[3467]|9(?:[1-9]|0[1-9])"],"","",0],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["900"],"","",0]],,[,,"781\\d{4}","\\d{7}",,,"7812345"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MW:[,[,,"(?:1(?:\\d{2})?|[2789]\\d{2})\\d{6}","\\d{7,9}"],[,,"(?:1[2-9]|21\\d{2})\\d{5}","\\d{7,9}",,,"1234567"],[,,"(?:111|77\\d|88\\d|99\\d)\\d{6}","\\d{9}",,,"991234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"MW",265,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1"],"0$1","",0],[,"(2\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1","",0],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1789]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MX:[,[,,"[1-9]\\d{9,10}","\\d{7,11}"],[,,"(?:33|55|81)\\d{8}|(?:2(?:2[2-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-6][1-9]|[37][1-8]|8[1-35-9]|9[2-689])|5(?:88|9[1-79])|6(?:1[2-68]|[234][1-9]|5[1-3689]|6[12457-9]|7[1-7]|8[67]|9[4-8])|7(?:[13467][1-9]|2[1-8]|5[13-9]|8[1-69]|9[17])|8(?:2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\\d{7}","\\d{7,10}",,,"2221234567"],[,,"1(?:(?:33|55|81)\\d{8}|(?:2(?:2[2-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-6][1-9]|[37][1-8]|8[1-35-9]|9[2-689])|5(?:88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[12457-9]|7[1-7]|8[67]|9[4-8])|7(?:[13467][1-9]|2[1-8]|5[13-9]|8[1-69]|9[17])|8(?:2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\\d{7})","\\d{11}",,,"12221234567"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"900\\d{7}","\\d{10}",,,"9001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"MX",52,"0[09]","01",,,"0[12]|04[45](\\d{10})","1$1",,,[[,"([358]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["33|55|81"],"01 $1","",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2467]|3[12457-9]|5[89]|8[02-9]|9[0-35-9]"],"01 $1","",1],[,"(1)([358]\\d)(\\d{4})(\\d{4})","044 $2 $3 $4",["1(?:33|55|81)"],"$1","",1],[,"(1)(\\d{3})(\\d{3})(\\d{4})","044 $2 $3 $4",["1(?:[2467]|3[12457-9]|5[89]|8[2-9]|9[1-35-9])"],"$1","",1]],[[,"([358]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["33|55|81"],"01 $1","",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2467]|3[12457-9]|5[89]|8[02-9]|9[0-35-9]"],"01 $1","",1],[,"(1)([358]\\d)(\\d{4})(\\d{4})","$1 $2 $3 $4",["1(?:33|55|81)"]],[,"(1)(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1(?:[2467]|3[12457-9]|5[89]|8[2-9]|9[1-35-9])"]]],[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]],MY:[,[,,"[13-9]\\d{7,9}","\\d{6,10}"],[,,"(?:3[2-9]\\d|[4-9][2-9])\\d{6}","\\d{6,9}",,,"323456789"],[,,"1(?:1[1-5]\\d{2}|[02-4679][2-9]\\d|59\\d{2}|8(?:1[23]|[2-9]\\d))\\d{5}","\\d{9,10}",,,"123456789"],[,,"1[378]00\\d{6}","\\d{10}",,,"1300123456"],[,,"1600\\d{6}","\\d{10}",,,"1600123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"154\\d{7}","\\d{10}",,,"1541234567"],"MY",60,"00","0",,,"0",,,,[[,"([4-79])(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1","",0],[,"(3)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1","",0],[,"([18]\\d)(\\d{3})(\\d{3,4})","$1-$2 $3",["1[02-46-9][1-9]|8"],"0$1","",0],[,"(1)([36-8]00)(\\d{2})(\\d{4})","$1-$2-$3-$4",["1[36-8]0"],"","",0],[,"(11)(\\d{4})(\\d{4})","$1-$2 $3",["11"],"0$1","",0],[,"(15[49])(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],MZ:[,[,,"[28]\\d{7,8}","\\d{8,9}"],[,,"2(?:[1346]\\d|5[0-2]|[78][12]|93)\\d{5}","\\d{8}",,,"21123456"],[,,"8[23467]\\d{7}","\\d{9}",,,"821234567"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"MZ",258,"00",,,,,,,,[[,"([28]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-7]"],"","",0],[,"(80\\d)(\\d{3})(\\d{3})","$1 $2 $3",["80"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],NA:[,[,,"[68]\\d{7,8}","\\d{8,9}"],[,,"6(?:1(?:17|2(?:[0189]\\d|[2-6]|7\\d?)|3(?:[01378]|2\\d)|4[01]|69|7[014])|2(?:17|5(?:[0-36-8]|4\\d?)|69|70)|3(?:17|2(?:[0237]\\d?|[14-689])|34|6[29]|7[01]|81)|4(?:17|2(?:[012]|7?)|4(?:[06]|1\\d)|5(?:[01357]|[25]\\d?)|69|7[01])|5(?:17|2(?:[0459]|[23678]\\d?)|69|7[01])|6(?:17|2(?:5|6\\d?)|38|42|69|7[01])|7(?:17|2(?:[569]|[234]\\d?)|3(?:0\\d?|[13])|69|7[01]))\\d{4}","\\d{8,9}",,,"61221234"],[,,"(?:60|8[125])\\d{7}","\\d{9}",,,"811234567"],[,,"NA","NA"],[,,"8701\\d{5}","\\d{9}",,,"870123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"8(?:3\\d{2}|86)\\d{5}","\\d{8,9}",,,"88612345"],"NA",264,"00","0",,,"0",,,,[[,"(8\\d)(\\d{3})(\\d{4})","$1 $2 $3",["8[1235]"],"0$1","",0],[,"(6\\d)(\\d{2,3})(\\d{4})","$1 $2 $3",["6"],"0$1","",0],[,"(88)(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1","",0],[,"(870)(\\d{3})(\\d{3})","$1 $2 $3",["870"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],NC:[,[,,"[2-57-9]\\d{5}","\\d{6}"],[,,"(?:2[03-9]|3[0-5]|4[1-7]|88)\\d{4}","\\d{6}",,,"201234"],[,,"(?:5[0-4]|[79]\\d|8[0-79])\\d{4}","\\d{6}",,,"751234"],[,,"NA","NA"],[,,"36\\d{4}","\\d{6}",,,"366711"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"NC",687,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[2-46-9]|5[0-4]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],NE:[,[,,"[0289]\\d{7}","\\d{8}"],[,,"2(?:0(?:20|3[1-7]|4[134]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\d{4}","\\d{8}",,,"20201234"],[,,"(?:8[89]|9\\d)\\d{6}","\\d{8}",,,"93123456"],[,,"08\\d{6}","\\d{8}",,,"08123456"],[,,"09\\d{6}","\\d{8}",,,"09123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"NE",227,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[289]|09"],"","",0],[,"(08)(\\d{3})(\\d{3})","$1 $2 $3",["08"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]],NF:[,[,,"[13]\\d{5}","\\d{5,6}"],[,,"(?:1(?:06|17|28|39)|3[012]\\d)\\d{3}","\\d{5,6}",,,"106609"],[,,"3[58]\\d{4}","\\d{5,6}",,,"381234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"NF",672,"00",,,,,,,,[[,"(\\d{2})(\\d{4})","$1 $2",["1"],"","",0],[,"(\\d)(\\d{5})","$1 $2",["3"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],NG:[,[,,"[1-6]\\d{5,8}|9\\d{5,9}|[78]\\d{5,13}","\\d{5,14}"],[,,"[12]\\d{6,7}|9(?:0[3-9]|[1-9]\\d)\\d{5}|(?:3\\d|4[023568]|5[02368]|6[02-469]|7[4-69]|8[2-9])\\d{6}|(?:4[47]|5[14579]|6[1578]|7[0-357])\\d{5,6}|(?:78|41)\\d{5}","\\d{5,9}",,,"12345678"],[,,"(?:1(?:7[34]\\d|8(?:04|[124579]\\d|8[0-3])|95\\d)|287[0-7]|3(?:18[1-8]|88[0-7]|9(?:8[5-9]|6[1-5]))|4(?:28[0-2]|6(?:7[1-9]|8[02-47])|88[0-2])|5(?:2(?:7[7-9]|8\\d)|38[1-79]|48[0-7]|68[4-7])|6(?:2(?:7[7-9]|8\\d)|4(?:3[7-9]|[68][129]|7[04-69]|9[1-8])|58[0-2]|98[7-9])|7(?:38[0-7]|69[1-8]|78[2-4])|8(?:28[3-9]|38[0-2]|4(?:2[12]|3[147-9]|5[346]|7[4-9]|8[014-689]|90)|58[1-8]|78[2-9]|88[5-7])|98[07]\\d)\\d{4}|(?:70(?:[13-9]\\d|2[1-9])|8(?:0[2-9]|1\\d)\\d|90[2359]\\d)\\d{6}","\\d{8,10}",,,"8021234567"],[,,"800\\d{7,11}","\\d{10,14}",,,"80017591759"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"NG",234,"009","0",,,"0",,,,[[,"([129])(\\d{3})(\\d{3,4})","$1 $2 $3",["[129]"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-6]|7(?:[1-79]|0[1-9])|8[2-9]"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["70|8[01]|90[2359]"],"0$1","",0],[,"([78]00)(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]00"],"0$1","",0],[,"([78]00)(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]00"],"0$1","",0],[,"(78)(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"700\\d{7,11}","\\d{10,14}",,,"7001234567"],,,[,,"NA","NA"]],NI:[,[,,"[12578]\\d{7}","\\d{8}"],[,,"2\\d{7}","\\d{8}",,,"21234567"],[,,"5(?:5[0-7]\\d{5}|[78]\\d{6})|7[5-8]\\d{6}|8\\d{7}","\\d{8}",,,"81234567"],[,,"1800\\d{4}","\\d{8}",,,"18001234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"NI",505,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],NL:[,[,,"1\\d{4,8}|[2-7]\\d{8}|[89]\\d{6,9}","\\d{5,10}"],[,,"(?:1[0135-8]|2[02-69]|3[0-68]|4[0135-9]|[57]\\d|8[478])\\d{7}","\\d{9}",,,"101234567"],[,,"6[1-58]\\d{7}","\\d{9}",,,"612345678"],[,,"800\\d{4,7}","\\d{7,10}",,,"8001234"],[,,"90[069]\\d{4,7}","\\d{7,10}",,,"9061234"],[,,"NA","NA"],[,,"NA","NA"],[,,"85\\d{7}","\\d{9}",,,"851234567"],"NL",31,"00","0",,,"0",,,,[[,"([1-578]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1[035]|2[0346]|3[03568]|4[0356]|5[0358]|7|8[4578]"],"0$1","",0],[,"([1-5]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1","",0],[,"(6)(\\d{8})","$1 $2",["6[0-57-9]"],"0$1","",0],[,"(66)(\\d{7})","$1 $2",["66"],"0$1","",0],[,"(14)(\\d{3,4})","$1 $2",["14"],"$1","",0],[,"([89]0\\d)(\\d{4,7})","$1 $2",["80|9"],"0$1","",0]],,[,,"66\\d{7}","\\d{9}",,,"662345678"],,,[,,"14\\d{3,4}","\\d{5,6}"],[,,"140(?:1(?:[035]|[16-8]\\d)|2(?:[0346]|[259]\\d)|3(?:[03568]|[124]\\d)|4(?:[0356]|[17-9]\\d)|5(?:[0358]|[124679]\\d)|7\\d|8[458])","\\d{5,6}",,,"14020"],,,[,,"NA","NA"]],NO:[,[,,"0\\d{4}|[2-9]\\d{7}","\\d{5}(?:\\d{3})?"],[,,"(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-4679]|7[0-8])\\d{6}","\\d{8}",,,"21234567"],[,,"(?:4[015-8]|5[89]|9\\d)\\d{6}","\\d{8}",,,"40612345"],[,,"80[01]\\d{5}","\\d{8}",,,"80012345"],[,,"82[09]\\d{5}","\\d{8}",,,"82012345"],[,,"810(?:0[0-6]|[2-8]\\d)\\d{3}","\\d{8}",,,"81021234"],[,,"880\\d{5}","\\d{8}",,,"88012345"],[,,"85[0-5]\\d{5}","\\d{8}",,,"85012345"],"NO",47,"00",,,,,,,,[[,"([489]\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[489]"],"","",0],[,"([235-7]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-7]"],"","",0]],,[,,"NA","NA"],1,,[,,"NA","NA"],[,,"0\\d{4}|81(?:0(?:0[7-9]|1\\d)|5\\d{2})\\d{3}","\\d{5}(?:\\d{3})?",,,"01234"],1,,[,,"81[23]\\d{5}","\\d{8}",,,"81212345"]],NP:[,[,,"[1-8]\\d{7}|9(?:[1-69]\\d{6,8}|7[2-6]\\d{5,7}|8\\d{8})","\\d{6,10}"],[,,"(?:1[0-6]\\d|2[13-79][2-6]|3[135-8][2-6]|4[146-9][2-6]|5[135-7][2-6]|6[13-9][2-6]|7[15-9][2-6]|8[1-46-9][2-6]|9[1-79][2-6])\\d{5}","\\d{6,8}",,,"14567890"],[,,"9(?:6[013]|7[245]|8[0-24-6])\\d{7}","\\d{10}",,,"9841234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"NP",977,"00","0",,,"0",,,,[[,"(1)(\\d{7})","$1-$2",["1[2-6]"],"0$1","",0],[,"(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-69]|7[15-9])"],"0$1","",0],[,"(9\\d{2})(\\d{7})","$1-$2",["9(?:6[013]|7[245]|8)"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],NR:[,[,,"[458]\\d{6}","\\d{7}"],[,,"(?:444|888)\\d{4}","\\d{7}",,,"4441234"],[,,"55[5-9]\\d{4}","\\d{7}",,,"5551234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"NR",674,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],NU:[,[,,"[1-5]\\d{3}","\\d{4}"],[,,"[34]\\d{3}","\\d{4}",,,"4002"],[,,"[125]\\d{3}","\\d{4}",,,"1234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"NU",683,"00",,,,,,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],NZ:[,[,,"6[235-9]\\d{6}|[2-57-9]\\d{7,10}","\\d{7,11}"],[,,"(?:3[2-79]|[49][2-9]|6[235-9]|7[2-57-9])\\d{6}|24099\\d{3}","\\d{7,8}",,,"32345678"],[,,"2(?:[028]\\d{7,8}|1(?:[03]\\d{5,7}|[12457]\\d{5,6}|[689]\\d{5})|[79]\\d{7})","\\d{8,10}",,,"211234567"],[,,"508\\d{6,7}|80\\d{6,8}","\\d{8,10}",,,"800123456"],[,,"90\\d{7,9}","\\d{9,11}",,,"900123456"],[,,"NA","NA"],[,,"70\\d{7}","\\d{9}",,,"701234567"],[,,"NA","NA"],"NZ",64,"0(?:0|161)","0",,,"0",,"00",,[[,"([34679])(\\d{3})(\\d{4})","$1-$2 $3",["[346]|7[2-57-9]|9[1-9]"],"0$1","",0],[,"(24099)(\\d{3})","$1 $2",["240","2409","24099"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["21"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:1[1-9]|[69]|7[0-35-9])|70|86"],"0$1","",0],[,"(2\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["2[028]"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|5|[89]0"],"0$1","",0]],,[,,"[28]6\\d{6,7}","\\d{8,9}",,,"26123456"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],OM:[,[,,"(?:2[2-6]|5|9[1-9])\\d{6}|800\\d{5,6}","\\d{7,9}"],[,,"2[2-6]\\d{6}","\\d{8}",,,"23123456"],[,,"9[1-9]\\d{6}","\\d{8}",,,"92123456"],[,,"8007\\d{4,5}|500\\d{4}","\\d{7,9}",,,"80071234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"OM",968,"00",,,,,,,,[[,"(2\\d)(\\d{6})","$1 $2",["2"],"","",0],[,"(9\\d{3})(\\d{4})","$1 $2",["9"],"","",0],[,"([58]00)(\\d{4,6})","$1 $2",["[58]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],PA:[,[,,"[1-9]\\d{6,7}","\\d{7,8}"],[,,"(?:1(?:0[02-579]|19|2[37]|3[03]|4[479]|57|65|7[016-8]|8[58]|9[1349])|2(?:[0235679]\\d|1[0-7]|4[04-9]|8[028])|3(?:[09]\\d|1[14-7]|2[0-3]|3[03]|4[0457]|5[56]|6[068]|7[06-8]|8[089])|4(?:3[013-69]|4\\d|7[0-689])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-267]|3[06]|[49]0|5[06-9]|7[0-24-7]|8[89])|8(?:[34]\\d|5[0-4]|8[02])|9(?:0[6-8]|1[016-8]|2[036-8]|3[3679]|40|5[0489]|6[06-9]|7[046-9]|8[36-8]|9[1-9]))\\d{4}","\\d{7}",,,"2001234"],[,,"(?:1[16]1|21[89]|8(?:1[01]|7[23]))\\d{4}|6(?:[024-9]\\d|1[0-5]|3[0-24-9])\\d{5}","\\d{7,8}",,,"60012345"],[,,"80[09]\\d{4}","\\d{7}",,,"8001234"],[,,"(?:779|8(?:2[235]|55|60|7[578]|86|95)|9(?:0[0-2]|81))\\d{4}","\\d{7}",,,"8601234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"PA",507,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"],"","",0],[,"(\\d{4})(\\d{4})","$1-$2",["6"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],PE:[,[,,"[14-9]\\d{7,8}","\\d{6,9}"],[,,"(?:1\\d|4[1-4]|5[1-46]|6[1-7]|7[2-46]|8[2-4])\\d{6}","\\d{6,8}",,,"11234567"],[,,"9\\d{8}","\\d{9}",,,"912345678"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"805\\d{5}","\\d{8}",,,"80512345"],[,,"801\\d{5}","\\d{8}",,,"80112345"],[,,"80[24]\\d{5}","\\d{8}",,,"80212345"],[,,"NA","NA"],"PE",51,"19(?:1[124]|77|90)00","0"," Anexo ",,"0",,,,[[,"(1)(\\d{7})","$1 $2",["1"],"(0$1)","",0],[,"([4-8]\\d)(\\d{6})","$1 $2",["[4-7]|8[2-4]"],"(0$1)","",0],[,"(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)","",0],[,"(9\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],PF:[,[,,"4\\d{5,7}|8\\d{7}","\\d{6}(?:\\d{2})?"],[,,"4(?:[09][45689]\\d|4)\\d{4}","\\d{6}(?:\\d{2})?",,,"40412345"],[,,"8[79]\\d{6}","\\d{8}",,,"87123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"PF",689,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4[09]|8[79]"],"","",0],[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"],"","",0]],,[,,"NA","NA"],,,[,,"44\\d{4}","\\d{6}",,,"441234"],[,,"NA","NA"],,,[,,"NA","NA"]],PG:[,[,,"[1-9]\\d{6,7}","\\d{7,8}"],[,,"(?:3[0-2]\\d|4[25]\\d|5[34]\\d|64[1-9]|77(?:[0-24]\\d|30)|85[02-46-9]|9[78]\\d)\\d{4}","\\d{7}",,,"3123456"],[,,"(?:20150|68\\d{2}|7(?:[0-369]\\d|75)\\d{2})\\d{3}","\\d{7,8}",,,"6812345"],[,,"180\\d{4}","\\d{7}",,,"1801234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"275\\d{4}","\\d{7}",,,"2751234"],"PG",675,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[13-689]|27"],"","",0],[,"(\\d{4})(\\d{4})","$1 $2",["20|7"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],PH:[,[,,"2\\d{5,7}|[3-9]\\d{7,9}|1800\\d{7,9}","\\d{5,13}"],[,,"2\\d{5}(?:\\d{2})?|(?:3[2-68]|4[2-9]|5[2-6]|6[2-58]|7[24578]|8[2-8])\\d{7}|88(?:22\\d{6}|42\\d{4})","\\d{5,10}",,,"21234567"],[,,"(?:81[37]|9(?:0[5-9]|1[024-9]|2[0-35-9]|3[02-9]|4[236-9]|50|7[34-79]|89|9[4-9]))\\d{7}","\\d{10}",,,"9051234567"],[,,"1800\\d{7,9}","\\d{11,13}",,,"180012345678"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"PH",63,"00","0",,,"0",,,,[[,"(2)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"(0$1)","",0],[,"(2)(\\d{5})","$1 $2",["2"],"(0$1)","",0],[,"(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|5(?:22|44)|642|8(?:62|8[245])","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)","",0],[,"(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)","",0],[,"([3-8]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[3-8]"],"(0$1)","",0],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["81|9"],"0$1","",0],[,"(1800)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"","",0],[,"(1800)(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],PK:[,[,,"1\\d{8}|[2-8]\\d{5,11}|9(?:[013-9]\\d{4,9}|2\\d(?:111\\d{6}|\\d{3,7}))","\\d{6,12}"],[,,"(?:21|42)[2-9]\\d{7}|(?:2[25]|4[0146-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\\d{6}|(?: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(?:1|2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8]))[2-9]\\d{5,6}|58[126]\\d{7}","\\d{6,10}",,,"2123456789"],[,,"3(?:0\\d|1[0-6]|2[0-5]|3[0-7]|4[0-8]|55|64)\\d{7}","\\d{10}",,,"3012345678"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"900\\d{5}","\\d{8}",,,"90012345"],[,,"NA","NA"],[,,"122\\d{6}","\\d{9}",,,"122044444"],[,,"NA","NA"],"PK",92,"00","0",,,"0",,,,[[,"(\\d{2})(111)(\\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)1","(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)11","(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)111"],"(0$1)","",0],[,"(\\d{3})(111)(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[349]|45|54|60|72|8[2-5]|9[2-9]","(?:2[349]|45|54|60|72|8[2-5]|9[2-9])\\d1","(?:2[349]|45|54|60|72|8[2-5]|9[2-9])\\d11","(?:2[349]|45|54|60|72|8[2-5]|9[2-9])\\d111"],"(0$1)","",0],[,"(\\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)","",0],[,"(\\d{3})(\\d{6,7})","$1 $2",["2[349]|45|54|60|72|8[2-5]|9[2-9]","(?:2[349]|45|54|60|72|8[2-5]|9[2-9])\\d[2-9]"],"(0$1)","",0],[,"(3\\d{2})(\\d{7})","$1 $2",["3"],"0$1","",0],[,"([15]\\d{3})(\\d{5,6})","$1 $2",["58[12]|1"],"(0$1)","",0],[,"(586\\d{2})(\\d{5})","$1 $2",["586"],"(0$1)","",0],[,"([89]00)(\\d{3})(\\d{2})","$1 $2 $3",["[89]00"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"(?:2(?:[125]|3[2358]|4[2-4]|9[2-8])|4(?:[0-246-9]|5[3479])|5(?:[1-35-7]|4[2-467])|6(?:[1-8]|0[468])|7(?:[14]|2[236])|8(?:[16]|2[2-689]|3[23578]|4[3478]|5[2356])|9(?:1|22|3[27-9]|4[2-6]|6[3569]|9[2-7]))111\\d{6}","\\d{11,12}",,,"21111825888"],,,[,,"NA","NA"]],PL:[,[,,"[12]\\d{6,8}|[3-57-9]\\d{8}|6\\d{5,8}","\\d{6,9}"],[,,"(?: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])\\d{7}|[12]2\\d{5}|","\\d{6,9}",,,"123456789"],[,,"(?:5[0137]|6[069]|7[2389]|88)\\d{7}","\\d{9}",,,"512345678"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"70\\d{7}","\\d{9}",,,"701234567"],[,,"801\\d{6}","\\d{9}",,,"801234567"],[,,"NA","NA"],[,,"39\\d{7}","\\d{9}",,,"391234567"],"PL",48,"00",,,,,,,,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[14]|2[0-57-9]|3[2-4]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145]"],"","",0],[,"(\\d{2})(\\d{1})(\\d{4})","$1 $2 $3",["[12]2"],"","",0],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["26|39|5[0137]|6[0469]|7[02389]|8[08]"],"","",0],[,"(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"],"","",0],[,"(\\d{3})(\\d{3})","$1 $2",["64"],"","",0]],,[,,"64\\d{4,7}","\\d{6,9}",,,"641234567"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],PM:[,[,,"[45]\\d{5}","\\d{6}"],[,,"41\\d{4}","\\d{6}",,,"411234"],[,,"55\\d{4}","\\d{6}",,,"551234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"PM",508,"00","0",,,"0",,,,[[,"([45]\\d)(\\d{2})(\\d{2})","$1 $2 $3",,"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],PR:[,[,,"[5789]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"(?:787|939)[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"7872345678"],[,,"(?:787|939)[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"7872345678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"PR",1,"011","1",,,"1",,,1,,,[,,"NA","NA"],,"787|939",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],PS:[,[,,"[24589]\\d{7,8}|1(?:[78]\\d{8}|[49]\\d{2,3})","\\d{4,10}"],[,,"(?:22[234789]|42[45]|82[01458]|92[369])\\d{5}","\\d{7,8}",,,"22234567"],[,,"5[69]\\d{7}","\\d{9}",,,"599123456"],[,,"1800\\d{6}","\\d{10}",,,"1800123456"],[,,"1(?:4|9\\d)\\d{2}","\\d{4,5}",,,"19123"],[,,"1700\\d{6}","\\d{10}",,,"1700123456"],[,,"NA","NA"],[,,"NA","NA"],"PS",970,"00","0",,,"0",,,,[[,"([2489])(2\\d{2})(\\d{4})","$1 $2 $3",["[2489]"],"0$1","",0],[,"(5[69]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1","",0],[,"(1[78]00)(\\d{3})(\\d{3})","$1 $2 $3",["1[78]"],"$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],PT:[,[,,"[2-46-9]\\d{8}","\\d{9}"],[,,"2(?:[12]\\d|[35][1-689]|4[1-59]|6[1-35689]|7[1-9]|8[1-69]|9[1256])\\d{6}","\\d{9}",,,"212345678"],[,,"9(?:[136]\\d{2}|2[0-79]\\d|480)\\d{5}","\\d{9}",,,"912345678"],[,,"80[02]\\d{6}","\\d{9}",,,"800123456"],[,,"76(?:0[1-57]|1[2-47]|2[237])\\d{5}","\\d{9}",,,"760123456"],[,,"80(?:8\\d|9[1579])\\d{5}","\\d{9}",,,"808123456"],[,,"884[128]\\d{5}","\\d{9}",,,"884123456"],[,,"30\\d{7}","\\d{9}",,,"301234567"],"PT",351,"00",,,,,,,,[[,"(2\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"],"","",0],[,"([2-46-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[3-9]|[346-9]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"70(?:7\\d|8[17])\\d{5}","\\d{9}",,,"707123456"],,,[,,"NA","NA"]],PW:[,[,,"[2-8]\\d{6}","\\d{7}"],[,,"2552255|(?:277|345|488|5(?:35|44|87)|6(?:22|54|79)|7(?:33|47)|8(?:24|55|76))\\d{4}","\\d{7}",,,"2771234"],[,,"(?:6[234689]0|77[45789])\\d{4}","\\d{7}",,,"6201234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"PW",680,"01[12]",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],PY:[,[,,"5[0-5]\\d{4,7}|[2-46-9]\\d{5,8}","\\d{5,9}"],[,,"(?:[26]1|3[289]|4[124678]|7[123]|8[1236])\\d{5,7}|(?:2(?:2[4568]|7[15]|9[1-5])|3(?:18|3[167]|4[2357]|51)|4(?:18|2[45]|3[12]|5[13]|64|71|9[1-47])|5(?:[1-4]\\d|5[0234])|6(?:3[1-3]|44|7[1-4678])|7(?:17|4[0-4]|6[1-578]|75|8[0-8])|858)\\d{5,6}","\\d{5,9}",,,"212345678"],[,,"9(?:6[12]|[78][1-6]|9[1-5])\\d{6}","\\d{9}",,,"961456789"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"8700[0-4]\\d{4}","\\d{9}",,,"870012345"],"PY",595,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{5,7})","$1 $2",["(?:[26]1|3[289]|4[124678]|7[123]|8[1236])"],"($1)","",0],[,"(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1","",0],[,"(\\d{3})(\\d{6})","$1 $2",["9[1-9]"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8700"],"","",0],[,"(\\d{3})(\\d{4,6})","$1 $2",["[2-8][1-9]"],"($1)","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"[2-9]0\\d{4,7}","\\d{6,9}",,,"201234567"],,,[,,"NA","NA"]],QA:[,[,,"[2-8]\\d{6,7}","\\d{7,8}"],[,,"4[04]\\d{6}","\\d{7,8}",,,"44123456"],[,,"[3567]\\d{7}","\\d{7,8}",,,"33123456"],[,,"800\\d{4}","\\d{7,8}",,,"8001234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"QA",974,"00",,,,,,,,[[,"([28]\\d{2})(\\d{4})","$1 $2",["[28]"],"","",0],[,"([3-7]\\d{3})(\\d{4})","$1 $2",["[3-7]"],"","",0]],,[,,"2(?:[12]\\d|61)\\d{4}","\\d{7}",,,"2123456"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],RE:[,[,,"[268]\\d{8}","\\d{9}"],[,,"262\\d{6}","\\d{9}",,,"262161234"],[,,"6(?:9[23]|47)\\d{6}","\\d{9}",,,"692123456"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"89[1-37-9]\\d{6}","\\d{9}",,,"891123456"],[,,"8(?:1[019]|2[0156]|84|90)\\d{6}","\\d{9}",,,"810123456"],[,,"NA","NA"],[,,"NA","NA"],"RE",262,"00","0",,,"0",,,,[[,"([268]\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"0$1","",0]],,[,,"NA","NA"],1,"262|6[49]|8",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],RO:[,[,,"2\\d{5,8}|[37-9]\\d{8}","\\d{6,9}"],[,,"2(?:1(?:\\d{7}|9\\d{3})|[3-6](?:\\d{7}|\\d9\\d{2}))|3[13-6]\\d{7}","\\d{6,9}",,,"211234567"],[,,"7(?:000|[1-8]\\d{2}|99\\d)\\d{5}","\\d{9}",,,"712345678"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"90[036]\\d{6}","\\d{9}",,,"900123456"],[,,"801\\d{6}","\\d{9}",,,"801123456"],[,,"802\\d{6}","\\d{9}",,,"802123456"],[,,"NA","NA"],"RO",40,"00","0"," int ",,"0",,,,[[,"([237]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1","",0],[,"(21)(\\d{4})","$1 $2",["21"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23][3-7]|[7-9]"],"0$1","",0],[,"(2\\d{2})(\\d{3})","$1 $2",["2[3-6]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"37\\d{7}","\\d{9}",,,"372123456"],,,[,,"NA","NA"]],RS:[,[,,"[126-9]\\d{4,11}|3(?:[0-79]\\d{3,10}|8[2-9]\\d{2,9})","\\d{5,12}"],[,,"(?:1(?:[02-9][2-9]|1[1-9])\\d|2(?:[0-24-7][2-9]\\d|[389](?:0[2-9]|[2-9]\\d))|3(?:[0-8][2-9]\\d|9(?:[2-9]\\d|0[2-9])))\\d{3,8}","\\d{5,12}",,,"10234567"],[,,"6(?:[0-689]|7\\d)\\d{6,7}","\\d{8,10}",,,"601234567"],[,,"800\\d{3,9}","\\d{6,12}",,,"80012345"],[,,"(?:90[0169]|78\\d)\\d{3,7}","\\d{6,12}",,,"90012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"RS",381,"00","0",,,"0",,,,[[,"([23]\\d{2})(\\d{4,9})","$1 $2",["(?:2[389]|39)0"],"0$1","",0],[,"([1-3]\\d)(\\d{5,10})","$1 $2",["1|2(?:[0-24-7]|[389][1-9])|3(?:[0-8]|9[1-9])"],"0$1","",0],[,"(6\\d)(\\d{6,8})","$1 $2",["6"],"0$1","",0],[,"([89]\\d{2})(\\d{3,9})","$1 $2",["[89]"],"0$1","",0],[,"(7[26])(\\d{4,9})","$1 $2",["7[26]"],"0$1","",0],[,"(7[08]\\d)(\\d{4,9})","$1 $2",["7[08]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"7[06]\\d{4,10}","\\d{6,12}",,,"700123456"],,,[,,"NA","NA"]],RU:[,[,,"[3489]\\d{9}","\\d{10}"],[,,"(?:3(?:0[12]|4[1-35-79]|5[1-3]|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]|6[1-35-7]|7[1-37-9]))\\d{7}","\\d{10}",,,"3011234567"],[,,"9\\d{9}","\\d{10}",,,"9123456789"],[,,"80[04]\\d{7}","\\d{10}",,,"8001234567"],[,,"80[39]\\d{7}","\\d{10}",,,"8091234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"RU",7,"810","8",,,"8",,"8~10",,[[,"(\\d{3})(\\d{2})(\\d{2})","$1-$2-$3",["[1-79]"],"$1","",1],[,"([3489]\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[34689]"],"8 ($1)","",1],[,"(7\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)","",1]],[[,"([3489]\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[34689]"],"8 ($1)","",1],[,"(7\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)","",1]],[,,"NA","NA"],1,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],RW:[,[,,"[027-9]\\d{7,8}","\\d{8,9}"],[,,"2[258]\\d{7}|06\\d{6}","\\d{8,9}",,,"250123456"],[,,"7[238]\\d{7}","\\d{9}",,,"720123456"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"900\\d{6}","\\d{9}",,,"900123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"RW",250,"00","0",,,"0",,,,[[,"(2\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"$1","",0],[,"([7-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1","",0],[,"(0\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]],SA:[,[,,"1\\d{7,8}|(?:[2-467]|92)\\d{7}|5\\d{8}|8\\d{9}","\\d{7,10}"],[,,"11\\d{7}|1?(?:2[24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\d{6}","\\d{7,9}",,,"112345678"],[,,"(?:5(?:[013-689]\\d|7[0-26-8])|811\\d)\\d{6}","\\d{9,10}",,,"512345678"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"NA","NA"],[,,"92[05]\\d{6}","\\d{9}",,,"920012345"],[,,"NA","NA"],[,,"NA","NA"],"SA",966,"00","0",,,"0",,,,[[,"([1-467])(\\d{3})(\\d{4})","$1 $2 $3",["[1-467]"],"0$1","",0],[,"(1\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1[1-467]"],"0$1","",0],[,"(5\\d)(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1","",0],[,"(92\\d{2})(\\d{5})","$1 $2",["92"],"$1","",0],[,"(800)(\\d{3})(\\d{4})","$1 $2 $3",["80"],"$1","",0],[,"(811)(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SB:[,[,,"[1-9]\\d{4,6}","\\d{5,7}"],[,,"(?:1[4-79]|[23]\\d|4[0-2]|5[03]|6[0-37])\\d{3}","\\d{5}",,,"40123"],[,,"48\\d{3}|7(?:30|[46-8]\\d|5[025-9]|9[0-5])\\d{4}|8[4-8]\\d{5}|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8])\\d{4}","\\d{5,7}",,,"7421234"],[,,"1[38]\\d{3}","\\d{5}",,,"18123"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"5[12]\\d{3}","\\d{5}",,,"51123"],"SB",677,"0[01]",,,,,,,,[[,"(\\d{2})(\\d{5})","$1 $2",["[7-9]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SC:[,[,,"[2468]\\d{5,6}","\\d{6,7}"],[,,"4[2-46]\\d{5}","\\d{7}",,,"4217123"],[,,"2[5-8]\\d{5}","\\d{7}",,,"2510123"],[,,"8000\\d{2}","\\d{6}",,,"800000"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"64\\d{5}","\\d{7}",,,"6412345"],"SC",248,"0[0-2]",,,,,,"00",,[[,"(\\d{3})(\\d{3})","$1 $2",["8"],"","",0],[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SD:[,[,,"[19]\\d{8}","\\d{9}"],[,,"1(?:[125]\\d|8[3567])\\d{6}","\\d{9}",,,"121231234"],[,,"9[0-3569]\\d{7}","\\d{9}",,,"911231234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"SD",249,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",,"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SE:[,[,,"[1-9]\\d{5,9}","\\d{5,10}"],[,,"1(?:0[1-8]\\d{6}|[136]\\d{5,7}|(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)\\d{5,6})|2(?:[136]\\d{5,7}|(?:2[0-7]|4[0136-8]|5[0138]|7[018]|8[01]|9[0-57])\\d{5,6})|3(?:[356]\\d{5,7}|(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])\\d{5,6})|4(?:0[1-9]\\d{4,6}|[246]\\d{5,7}|(?:1[013-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])\\d{5,6})|5(?:0[0-6]|[15][0-5]|2[0-68]|3[0-4]|4\\d|6[03-5]|7[013]|8[0-79]|9[01])\\d{5,6}|6(?:0[1-9]\\d{4,6}|3\\d{5,7}|(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])\\d{5,6})|8[1-9]\\d{5,7}|9(?:0[1-9]\\d{4,6}|(?:1[0-68]|2\\d|3[02-5]|4[0-3]|5[0-4]|[68][01]|7[0135-8])\\d{5,6})","\\d{5,9}",,,"8123456"],[,,"7[02369]\\d{7}","\\d{9}",,,"701234567"],[,,"20(?:0(?:0\\d{2}|[1-9](?:0\\d{1,4}|[1-9]\\d{4}))|1(?:0\\d{4}|[1-9]\\d{4,5})|[2-9]\\d{5})","\\d{6,9}",,,"20123456"],[,,"9(?:00|39|44)(?:1(?:[0-26]\\d{5}|[3-57-9]\\d{2})|2(?:[0-2]\\d{5}|[3-9]\\d{2})|3(?:[0139]\\d{5}|[24-8]\\d{2})|4(?:[045]\\d{5}|[1-36-9]\\d{2})|5(?:5\\d{5}|[0-46-9]\\d{2})|6(?:[679]\\d{5}|[0-58]\\d{2})|7(?:[078]\\d{5}|[1-69]\\d{2})|8(?:[578]\\d{5}|[0-469]\\d{2}))","\\d{7}(?:\\d{3})?",,,"9001234567"],[,,"77(?:0(?:0\\d{2}|[1-9](?:0\\d|[1-9]\\d{4}))|[1-6][1-9]\\d{5})","\\d{6}(?:\\d{3})?",,,"771234567"],[,,"75[1-8]\\d{6}","\\d{9}",,,"751234567"],[,,"NA","NA"],"SE",46,"00","0",,,"0",,,,[[,"(8)(\\d{2,3})(\\d{2,3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1","",0],[,"([1-69]\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|90"],"0$1","",0],[,"([1-69]\\d)(\\d{3})(\\d{2})","$1-$2 $3",["1[13689]|2[136]|3[1356]|4[0246]|54|6[03]|90"],"0$1","",0],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[2457]|2[2457-9]|3[0247-9]|4[1357-9]|5[0-35-9]|6[124-9]|9(?:[125-8]|3[0-5]|4[0-3])"],"0$1","",0],[,"(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2[2457-9]|3[0247-9]|4[1357-9]|5[0-35-9]|6[124-9]|9(?:[125-8]|3[0-5]|4[0-3])"],"0$1","",0],[,"(7\\d)(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["7"],"0$1","",0],[,"(77)(\\d{2})(\\d{2})","$1-$2$3",["7"],"0$1","",0],[,"(20)(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1","",0],[,"(9[034]\\d)(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9[034]"],"0$1","",0],[,"(9[034]\\d)(\\d{4})","$1-$2",["9[034]"],"0$1","",0]],[[,"(8)(\\d{2,3})(\\d{2,3})(\\d{2})","$1 $2 $3 $4",["8"]],[,"([1-69]\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|90"]],[,"([1-69]\\d)(\\d{3})(\\d{2})","$1 $2 $3",["1[13689]|2[136]|3[1356]|4[0246]|54|6[03]|90"]],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2457]|2[2457-9]|3[0247-9]|4[1357-9]|5[0-35-9]|6[124-9]|9(?:[125-8]|3[0-5]|4[0-3])"]],[,"(\\d{3})(\\d{2,3})(\\d{2})","$1 $2 $3",["1[2457]|2[2457-9]|3[0247-9]|4[1357-9]|5[0-35-9]|6[124-9]|9(?:[125-8]|3[0-5]|4[0-3])"]],[,"(7\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7"]],[,"(77)(\\d{2})(\\d{2})","$1 $2 $3",["7"]],[,"(20)(\\d{2,3})(\\d{2})","$1 $2 $3",["20"]],[,"(9[034]\\d)(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["9[034]"]],[,"(9[034]\\d)(\\d{4})","$1 $2",["9[034]"]]],[,,"74[02-9]\\d{6}","\\d{9}",,,"740123456"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SG:[,[,,"[36]\\d{7}|[17-9]\\d{7,10}","\\d{8,11}"],[,,"6[1-9]\\d{6}","\\d{8}",,,"61234567"],[,,"(?:8[1-8]|9[0-8])\\d{6}","\\d{8}",,,"81234567"],[,,"1?800\\d{7}","\\d{10,11}",,,"18001234567"],[,,"1900\\d{7}","\\d{11}",,,"19001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"3[12]\\d{6}","\\d{8}",,,"31234567"],"SG",65,"0[0-3]\\d",,,,,,,,[[,"([3689]\\d{3})(\\d{4})","$1 $2",["[369]|8[1-9]"],"","",0],[,"(1[89]00)(\\d{3})(\\d{4})","$1 $2 $3",["1[89]"],"","",0],[,"(7000)(\\d{4})(\\d{3})","$1 $2 $3",["70"],"","",0],[,"(800)(\\d{3})(\\d{4})","$1 $2 $3",["80"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"7000\\d{7}","\\d{11}",,,"70001234567"],,,[,,"NA","NA"]],SH:[,[,,"[256]\\d{4}","\\d{4,5}"],[,,"2(?:[0-57-9]\\d|6[4-9])\\d{2}","\\d{5}",,,"22158"],[,,"[56]\\d{4}","\\d{5}"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"262\\d{2}","\\d{5}"],"SH",290,"00",,,,,,,,,,[,,"NA","NA"],1,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SI:[,[,,"[1-7]\\d{6,7}|[89]\\d{4,7}","\\d{5,8}"],[,,"(?:1\\d|[25][2-8]|3[4-8]|4[24-8]|7[3-8])\\d{6}","\\d{7,8}",,,"11234567"],[,,"(?:[37][01]|4[0139]|51|6[48])\\d{6}","\\d{8}",,,"31234567"],[,,"80\\d{4,6}","\\d{6,8}",,,"80123456"],[,,"90\\d{4,6}|89[1-3]\\d{2,5}","\\d{5,8}",,,"90123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"(?:59|8[1-3])\\d{6}","\\d{8}",,,"59012345"],"SI",386,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[12]|3[4-8]|4[24-8]|5[2-8]|7[3-8]"],"(0$1)","",0],[,"([3-7]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1","",0],[,"([89][09])(\\d{3,6})","$1 $2",["[89][09]"],"0$1","",0],[,"([58]\\d{2})(\\d{5})","$1 $2",["59|8[1-3]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SJ:[,[,,"0\\d{4}|[4789]\\d{7}","\\d{5}(?:\\d{3})?"],[,,"79\\d{6}","\\d{8}",,,"79123456"],[,,"(?:4[015-8]|5[89]|9\\d)\\d{6}","\\d{8}",,,"41234567"],[,,"80[01]\\d{5}","\\d{8}",,,"80012345"],[,,"82[09]\\d{5}","\\d{8}",,,"82012345"],[,,"810(?:0[0-6]|[2-8]\\d)\\d{3}","\\d{8}",,,"81021234"],[,,"880\\d{5}","\\d{8}",,,"88012345"],[,,"85[0-5]\\d{5}","\\d{8}",,,"85012345"],"SJ",47,"00",,,,,,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"0\\d{4}|81(?:0(?:0[7-9]|1\\d)|5\\d{2})\\d{3}","\\d{5}(?:\\d{3})?",,,"01234"],1,,[,,"81[23]\\d{5}","\\d{8}",,,"81212345"]],SK:[,[,,"[2-689]\\d{8}","\\d{9}"],[,,"[2-5]\\d{8}","\\d{9}",,,"212345678"],[,,"9(?:0[1-8]|1[0-24-9]|4[0489])\\d{6}","\\d{9}",,,"912123456"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"9(?:[78]\\d{7}|00\\d{6})","\\d{9}",,,"900123456"],[,,"8[5-9]\\d{7}","\\d{9}",,,"850123456"],[,,"NA","NA"],[,,"6(?:5[0-4]|9[0-6])\\d{6}","\\d{9}",,,"690123456"],"SK",421,"00","0",,,"0",,,,[[,"(2)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1","",0],[,"([3-5]\\d)(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1","",0],[,"([689]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"(?:8(?:00|[5-9]\\d)|9(?:00|[78]\\d))\\d{6}","\\d{9}",,,"800123456"],[,,"96\\d{7}","\\d{9}",,,"961234567"],,,[,,"NA","NA"]],SL:[,[,,"[2-9]\\d{7}","\\d{6,8}"],[,,"[235]2[2-4][2-9]\\d{4}","\\d{6,8}",,,"22221234"],[,,"(?:2[15]|3[03-5]|4[04]|5[05]|66|7[6-9]|88|99)\\d{6}","\\d{6,8}",,,"25123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"SL",232,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{6})","$1 $2",,"(0$1)","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SM:[,[,,"[05-7]\\d{7,9}","\\d{6,10}"],[,,"0549(?:8[0157-9]|9\\d)\\d{4}","\\d{6,10}",,,"0549886377"],[,,"6[16]\\d{6}","\\d{8}",,,"66661212"],[,,"NA","NA"],[,,"7[178]\\d{6}","\\d{8}",,,"71123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"5[158]\\d{6}","\\d{8}",,,"58001110"],"SM",378,"00",,,,"(?:0549)?([89]\\d{5})","0549$1",,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"],"","",0],[,"(0549)(\\d{6})","$1 $2",["0"],"","",0],[,"(\\d{6})","0549 $1",["[89]"],"","",0]],[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"],"","",0],[,"(0549)(\\d{6})","($1) $2",["0"]],[,"(\\d{6})","(0549) $1",["[89]"]]],[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]],SN:[,[,,"[3789]\\d{8}","\\d{9}"],[,,"3(?:0(?:1[0-2]|80)|282|3(?:8[1-9]|9[3-9])|611|90[1-5])\\d{5}","\\d{9}",,,"301012345"],[,,"7(?:[067]\\d|21|8[0-26]|90)\\d{6}","\\d{9}",,,"701234567"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"88[4689]\\d{6}","\\d{9}",,,"884123456"],[,,"81[02468]\\d{6}","\\d{9}",,,"810123456"],[,,"NA","NA"],[,,"3392\\d{5}|93330\\d{4}","\\d{9}",,,"933301234"],"SN",221,"00",,,,,,,,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"],"","",0],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SO:[,[,,"[1-79]\\d{6,8}","\\d{7,9}"],[,,"(?:1\\d|2[0-79]|3[0-46-8]|4[0-7]|59)\\d{5}","\\d{7}",,,"4012345"],[,,"(?:15\\d|2(?:4\\d|8)|6[137-9]?\\d{2}|7[1-9]\\d|907\\d)\\d{5}","\\d{7,9}",,,"71123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"SO",252,"00","0",,,"0",,,,[[,"(\\d)(\\d{6})","$1 $2",["2[0-79]|[13-5]"],"","",0],[,"(\\d)(\\d{7})","$1 $2",["24|[67]"],"","",0],[,"(\\d{2})(\\d{5,7})","$1 $2",["15|28|6[1378]"],"","",0],[,"(69\\d)(\\d{6})","$1 $2",["69"],"","",0],[,"(90\\d)(\\d{3})(\\d{3})","$1 $2 $3",["90"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SR:[,[,,"[2-8]\\d{5,6}","\\d{6,7}"],[,,"(?:2[1-3]|3[0-7]|4\\d|5[2-58]|68\\d)\\d{4}","\\d{6,7}",,,"211234"],[,,"(?:7[124-7]|8[1-9])\\d{5}","\\d{7}",,,"7412345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"5(?:6\\d{4}|90[0-4]\\d{3})","\\d{6,7}",,,"561234"],"SR",597,"00",,,,,,,,[[,"(\\d{3})(\\d{3})","$1-$2",["[2-4]|5[2-58]"],"","",0],[,"(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"],"","",0],[,"(\\d{3})(\\d{4})","$1-$2",["59|[6-8]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SS:[,[,,"[19]\\d{8}","\\d{9}"],[,,"18\\d{7}","\\d{9}",,,"181234567"],[,,"(?:12|9[1257])\\d{7}","\\d{9}",,,"977123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"SS",211,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",,"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],ST:[,[,,"[29]\\d{6}","\\d{7}"],[,,"22\\d{5}","\\d{7}",,,"2221234"],[,,"9[89]\\d{5}","\\d{7}",,,"9812345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"ST",239,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SV:[,[,,"[267]\\d{7}|[89]\\d{6}(?:\\d{4})?","\\d{7,8}|\\d{11}"],[,,"2[1-6]\\d{6}","\\d{8}",,,"21234567"],[,,"[67]\\d{7}","\\d{8}",,,"70123456"],[,,"800\\d{4}(?:\\d{4})?","\\d{7}(?:\\d{4})?",,,"8001234"],[,,"900\\d{4}(?:\\d{4})?","\\d{7}(?:\\d{4})?",,,"9001234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"SV",503,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[267]"],"","",0],[,"(\\d{3})(\\d{4})","$1 $2",["[89]"],"","",0],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SX:[,[,,"[5789]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"7215(?:4[2-8]|8[239]|9[056])\\d{4}","\\d{7}(?:\\d{3})?",,,"7215425678"],[,,"7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}","\\d{10}",,,"7215205678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"SX",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"721",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SY:[,[,,"[1-59]\\d{7,8}","\\d{6,9}"],[,,"(?:1(?:1\\d?|4\\d|[2356])|2(?:1\\d?|[235])|3(?:[13]\\d|4)|4[13]|5[1-3])\\d{6}","\\d{6,9}",,,"112345678"],[,,"9(?:22|[35][0-8]|4\\d|6[024-9]|88|9[0-489])\\d{6}","\\d{9}",,,"944567890"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"SY",963,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1","",1],[,"(9\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1","",1]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],SZ:[,[,,"[027]\\d{7}","\\d{8}"],[,,"2(?:2(?:0[07]|[13]7|2[57])|3(?:0[34]|[1278]3|3[23]|[46][34])|(?:40[4-69]|67)|5(?:0[5-7]|1[6-9]|[23][78]|48|5[01]))\\d{4}","\\d{8}",,,"22171234"],[,,"7[6-8]\\d{6}","\\d{8}",,,"76123456"],[,,"0800\\d{4}","\\d{8}",,,"08001234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"SZ",268,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[027]"],"","",0]],,[,,"NA","NA"],,,[,,"0800\\d{4}","\\d{8}",,,"08001234"],[,,"NA","NA"],1,,[,,"NA","NA"]],TA:[,[,,"8\\d{3}","\\d{4}"],[,,"8\\d{3}","\\d{4}",,,"8999"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"TA",290,"00",,,,,,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],TC:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"649(?:712|9(?:4\\d|50))\\d{4}","\\d{7}(?:\\d{3})?",,,"6497121234"],[,,"649(?:2(?:3[129]|4[1-7])|3(?:3[1-389]|4[1-7])|4[34][1-3])\\d{4}","\\d{10}",,,"6492311234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"64971[01]\\d{4}","\\d{10}",,,"6497101234"],"TC",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"649",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],TD:[,[,,"[2679]\\d{7}","\\d{8}"],[,,"22(?:[3789]0|5[0-5]|6[89])\\d{4}","\\d{8}",,,"22501234"],[,,"(?:6[02368]\\d|77\\d|9(?:5[0-4]|9\\d))\\d{5}","\\d{8}",,,"63012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"TD",235,"00|16",,,,,,"00",,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],TG:[,[,,"[29]\\d{7}","\\d{8}"],[,,"2(?:2[2-7]|3[23]|44|55|66|77)\\d{5}","\\d{8}",,,"22212345"],[,,"9[0-389]\\d{6}","\\d{8}",,,"90112345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"TG",228,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],TH:[,[,,"[2-9]\\d{7,8}|1\\d{3}(?:\\d{5,6})?","\\d{4}|\\d{8,10}"],[,,"(?:2\\d|3[2-9]|4[2-5]|5[2-6]|7[3-7])\\d{6}","\\d{8}",,,"21234567"],[,,"(?:14|6[1-3]|[89]\\d)\\d{7}","\\d{9}",,,"812345678"],[,,"1800\\d{6}","\\d{10}",,,"1800123456"],[,,"1900\\d{6}","\\d{10}",,,"1900123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"6[08]\\d{7}","\\d{9}",,,"601234567"],"TH",66,"00","0",,,"0",,,,[[,"(2)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1","",0],[,"([13-9]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["14|[3-9]"],"0$1","",0],[,"(1[89]00)(\\d{3})(\\d{3})","$1 $2 $3",["1"],"$1","",0]],,[,,"NA","NA"],,,[,,"1\\d{3}","\\d{4}",,,"1100"],[,,"1\\d{3}","\\d{4}",,,"1100"],,,[,,"NA","NA"]],TJ:[,[,,"[3-59]\\d{8}","\\d{3,9}"],[,,"(?:3(?:1[3-5]|2[245]|3[12]|4[24-7]|5[25]|72)|4(?:46|74|87))\\d{6}","\\d{3,9}",,,"372123456"],[,,"(?:50[125]|9[0-35-9]\\d)\\d{6}","\\d{9}",,,"917123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"TJ",992,"810","8",,,"8",,"8~10",,[[,"([349]\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[34]7|91[78]"],"(8) $1","",1],[,"([459]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[48]|5|9(?:1[59]|[0235-9])"],"(8) $1","",1],[,"(331700)(\\d)(\\d{2})","$1 $2 $3",["331","3317","33170","331700"],"(8) $1","",1],[,"(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]","3(?:[1245]|3(?:[02-9]|1[0-589]))"],"(8) $1","",1]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],TK:[,[,,"[2-9]\\d{3}","\\d{4}"],[,,"[2-4]\\d{3}","\\d{4}",,,"3010"],[,,"[5-9]\\d{3}","\\d{4}",,,"5190"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"TK",690,"00",,,,,,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],TL:[,[,,"[2-489]\\d{6}|7\\d{6,7}","\\d{7,8}"],[,,"(?:2[1-5]|3[1-9]|4[1-4])\\d{5}","\\d{7}",,,"2112345"],[,,"7[3-8]\\d{6}","\\d{8}",,,"77212345"],[,,"80\\d{5}","\\d{7}",,,"8012345"],[,,"90\\d{5}","\\d{7}",,,"9012345"],[,,"NA","NA"],[,,"70\\d{5}","\\d{7}",,,"7012345"],[,,"NA","NA"],"TL",670,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[2-489]"],"","",0],[,"(\\d{4})(\\d{4})","$1 $2",["7"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],TM:[,[,,"[1-6]\\d{7}","\\d{8}"],[,,"(?:1(?:2\\d|3[1-9])|2(?:22|4[0-35-8])|3(?:22|4[03-9])|4(?:22|3[128]|4\\d|6[15])|5(?:22|5[7-9]|6[014-689]))\\d{5}","\\d{8}",,,"12345678"],[,,"6[2-9]\\d{6}","\\d{8}",,,"66123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"TM",993,"810","8",,,"8",,"8~10",,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)","",0],[,"(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1","",0],[,"(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["13|[2-5]"],"(8 $1)","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],TN:[,[,,"[2-57-9]\\d{7}","\\d{8}"],[,,"3[012]\\d{6}|7\\d{7}|81200\\d{3}","\\d{8}",,,"71234567"],[,,"(?:[259]\\d|4[0-24])\\d{6}","\\d{8}",,,"20123456"],[,,"8010\\d{4}","\\d{8}",,,"80101234"],[,,"88\\d{6}","\\d{8}",,,"88123456"],[,,"8[12]10\\d{4}","\\d{8}",,,"81101234"],[,,"NA","NA"],[,,"NA","NA"],"TN",216,"00",,,,,,,,[[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],TO:[,[,,"[02-8]\\d{4,6}","\\d{5,7}"],[,,"(?:2\\d|3[1-8]|4[1-4]|[56]0|7[0149]|8[05])\\d{3}","\\d{5}",,,"20123"],[,,"(?:7[578]|8[47-9])\\d{5}","\\d{7}",,,"7715123"],[,,"0800\\d{3}","\\d{7}",,,"0800222"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"TO",676,"00",,,,,,,,[[,"(\\d{2})(\\d{3})","$1-$2",["[1-6]|7[0-4]|8[05]"],"","",0],[,"(\\d{3})(\\d{4})","$1 $2",["7[5-9]|8[47-9]"],"","",0],[,"(\\d{4})(\\d{3})","$1 $2",["0"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]],TR:[,[,,"[2-589]\\d{9}|444\\d{4}","\\d{7,10}"],[,,"(?:2(?:[13][26]|[28][2468]|[45][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\d{7}","\\d{10}",,,"2123456789"],[,,"5(?:0[1-7]|22|[34]\\d|5[1-59]|9[246])\\d{7}","\\d{10}",,,"5012345678"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"900\\d{7}","\\d{10}",,,"9001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"TR",90,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[23]|4(?:[0-35-9]|4[0-35-9])"],"(0$1)","",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[589]"],"0$1","",1],[,"(444)(\\d{1})(\\d{3})","$1 $2 $3",["444"],"","",0]],,[,,"512\\d{7}","\\d{10}",,,"5123456789"],,,[,,"444\\d{4}","\\d{7}",,,"4441444"],[,,"444\\d{4}|850\\d{7}","\\d{7,10}",,,"4441444"],,,[,,"NA","NA"]],TT:[,[,,"[589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"868(?:2(?:[03]1|2[1-5])|6(?:0[79]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}","\\d{7}(?:\\d{3})?",,,"8682211234"],[,,"868(?:2(?:[789]\\d)|3(?:0[1-9]|1[02-9]|[2-9]\\d)|4[6-9]\\d|6(?:20|78|8\\d)|7(?:0[1-9]|1[02-9]|[2-9]\\d))\\d{4}","\\d{10}",,,"8682911234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"TT",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"868",[,,"NA","NA"],[,,"NA","NA"],,,[,,"868619\\d{4}","\\d{10}"]],TV:[,[,,"[29]\\d{4,5}","\\d{5,6}"],[,,"2[02-9]\\d{3}","\\d{5}",,,"20123"],[,,"90\\d{4}","\\d{6}",,,"901234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"TV",688,"00",,,,,,,,,,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],TW:[,[,,"[2-689]\\d{7,8}|7\\d{7,9}","\\d{8,10}"],[,,"[2-8]\\d{7,8}","\\d{8,9}",,,"21234567"],[,,"9\\d{8}","\\d{9}",,,"912345678"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"900\\d{6}","\\d{9}",,,"900123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"70\\d{8}","\\d{10}",,,"7012345678"],"TW",886,"0(?:0[25679]|19)","0","#",,"0",,,,[[,"([2-8])(\\d{3,4})(\\d{4})","$1 $2 $3",["[2-6]|[78][1-9]"],"0$1","",0],[,"([89]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["80|9"],"0$1","",0],[,"(70)(\\d{4})(\\d{4})","$1 $2 $3",["70"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],TZ:[,[,,"\\d{9}","\\d{7,9}"],[,,"2[2-8]\\d{7}","\\d{7,9}",,,"222345678"],[,,"(?:6[1578]|7[1-9])\\d{7}","\\d{9}",,,"612345678"],[,,"80[08]\\d{6}","\\d{9}",,,"800123456"],[,,"90\\d{7}","\\d{9}",,,"900123456"],[,,"8(?:40|6[01])\\d{6}","\\d{9}",,,"840123456"],[,,"NA","NA"],[,,"41\\d{7}","\\d{9}",,,"412345678"],"TZ",255,"00[056]","0",,,"0",,,,[[,"([24]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1","",0],[,"([67]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1","",0],[,"([89]\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],UA:[,[,,"[3-9]\\d{8}","\\d{5,9}"],[,,"(?:3[1-8]|4[13-8]|5[1-7]|6[12459])\\d{7}","\\d{5,9}",,,"311234567"],[,,"(?:39|50|6[36-8]|73|9[1-9])\\d{7}","\\d{9}",,,"391234567"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"900\\d{6}","\\d{9}",,,"900123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"89\\d{7}","\\d{9}",,,"891234567"],"UA",380,"00","0",,,"0",,"0~0",,[[,"([3-9]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[38]9|4(?:[45][0-5]|87)|5(?:0|6[37]|7[37])|6[36-8]|73|9[1-9]","[38]9|4(?:[45][0-5]|87)|5(?:0|6(?:3[14-7]|7)|7[37])|6[36-8]|73|9[1-9]"],"0$1","",0],[,"([3-689]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["3[1-8]2|4[13678]2|5(?:[12457]2|6[24])|6(?:[49]2|[12][29]|5[24])|8[0-8]|90","3(?:[1-46-8]2[013-9]|52)|4(?:[1378]2|62[013-9])|5(?:[12457]2|6[24])|6(?:[49]2|[12][29]|5[24])|8[0-8]|90"],"0$1","",0],[,"([3-6]\\d{3})(\\d{5})","$1 $2",["3(?:5[013-9]|[1-46-8])|4(?:[137][013-9]|6|[45][6-9]|8[4-6])|5(?:[1245][013-9]|6[0135-9]|3|7[4-6])|6(?:[49][013-9]|5[0135-9]|[12][13-8])","3(?:5[013-9]|[1-46-8](?:22|[013-9]))|4(?:[137][013-9]|6(?:[013-9]|22)|[45][6-9]|8[4-6])|5(?:[1245][013-9]|6(?:3[02389]|[015689])|3|7[4-6])|6(?:[49][013-9]|5[0135-9]|[12][13-8])"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],UG:[,[,,"\\d{9}","\\d{5,9}"],[,,"20(?:[0147]\\d{2}|2(?:40|[5-9]\\d)|3[23]\\d|5[0-4]\\d|6[03]\\d|8[0-2]\\d)\\d{4}|[34]\\d{8}","\\d{5,9}",,,"312345678"],[,,"2030\\d{5}|7(?:0[0-7]|[15789]\\d|2[03]|30|[46][0-4])\\d{6}","\\d{9}",,,"712345678"],[,,"800[123]\\d{5}","\\d{9}",,,"800123456"],[,,"90[123]\\d{6}","\\d{9}",,,"901123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"UG",256,"00[057]","0",,,"0",,,,[[,"(\\d{3})(\\d{6})","$1 $2",["[7-9]|20(?:[013-8]|2[5-9])|4(?:6[45]|[7-9])"],"0$1","",0],[,"(\\d{2})(\\d{7})","$1 $2",["3|4(?:[1-5]|6[0-36-9])"],"0$1","",0],[,"(2024)(\\d{5})","$1 $2",["2024"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],US:[,[,,"[2-9]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"(?:2(?:0[1-35-9]|1[02-9]|2[04589]|3[149]|4[08]|5[1-46]|6[0279]|7[026]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[014679]|4[67]|5[12]|6[014]|8[56])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|69|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-37]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[16]|5[017]|6[0-279]|78|8[12])|7(?:0[1-46-8]|1[02-9]|2[0457]|3[1247]|4[07]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|28|3[0-25]|4[3578]|5[06-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[01678]|4[0179]|5[12469]|7[0-3589]|8[0459]))[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"2015555555"],[,,"(?:2(?:0[1-35-9]|1[02-9]|2[04589]|3[149]|4[08]|5[1-46]|6[0279]|7[026]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[014679]|4[67]|5[12]|6[014]|8[56])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|69|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-37]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[16]|5[017]|6[0-279]|78|8[12])|7(?:0[1-46-8]|1[02-9]|2[0457]|3[1247]|4[07]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|28|3[0-25]|4[3578]|5[06-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[01678]|4[0179]|5[12469]|7[0-3589]|8[0459]))[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"2015555555"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"US",1,"011","1",,,"1",,,1,[[,"(\\d{3})(\\d{4})","$1-$2",,"","",1],[,"(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",,"","",1]],[[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3"]],[,,"NA","NA"],1,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],UY:[,[,,"[2489]\\d{6,7}","\\d{7,8}"],[,,"2\\d{7}|4[2-7]\\d{6}","\\d{7,8}",,,"21231234"],[,,"9[1-9]\\d{6}","\\d{8}",,,"94231234"],[,,"80[05]\\d{4}","\\d{7}",,,"8001234"],[,,"90[0-8]\\d{4}","\\d{7}",,,"9001234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"UY",598,"0(?:1[3-9]\\d|0)","0"," int. ",,"0",,"00",,[[,"(\\d{4})(\\d{4})","$1 $2",["[24]"],"","",0],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9[1-9]"],"0$1","",0],[,"(\\d{3})(\\d{4})","$1 $2",["[89]0"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],UZ:[,[,,"[679]\\d{8}","\\d{7,9}"],[,,"(?:6(?:1(?:22|3[124]|4[1-4]|5[123578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|6\\d{2}|7(?:[23]\\d|7[69])|9(?:22|4[1-8]|6[135]))|7(?:0(?:5[4-9]|6[0146]|7[12456]|9[135-8])|1[12]\\d|2(?:22|3[1345789]|4[123579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|6(?:22|3[12457]|4[13-8])|9(?:22|5[1-9])))\\d{5}","\\d{7,9}",,,"662345678"],[,,"6(?:1(?:2(?:98|2[01])|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:11\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4])|7\\d{2})|5(?:19[01]|2(?:27|9[26])|30\\d|59\\d|7\\d{2})|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|3[79]\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79])|9[0-3]\\d)|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079]))|9(?:2(?:1[1267]|5\\d|3[01]|7[0-4])|5[67]\\d|6(?:2[0-26]|8\\d)|7\\d{2}))\\d{4}|7(?:0\\d{3}|1(?:13[01]|6(?:0[47]|1[67]|66)|71[3-69]|98\\d)|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|33\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078])|9[4-6]\\d)|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0127]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|6(?:2(?:2[1245]|4[2-4])|39\\d|41[179]|5(?:[349]\\d|5[0-2])|7(?:0[017]|[13]\\d|22|44|55|67|88))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[05629]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07])))\\d{4}|9[0-57-9]\\d{7}","\\d{7,9}",,,"912345678"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"UZ",998,"810","8",,,"8",,"8~10",,[[,"([679]\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"8 $1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],VA:[,[,,"(?:0(?:878\\d{5}|6698\\d{5})|[1589]\\d{5,10}|3(?:[12457-9]\\d{8}|[36]\\d{7,9}))","\\d{6,11}"],[,,"06698\\d{5}","\\d{10}",,,"0669812345"],[,,"3(?:[12457-9]\\d{8}|6\\d{7,8}|3\\d{7,9})","\\d{9,11}",,,"3123456789"],[,,"80(?:0\\d{6}|3\\d{3})","\\d{6,9}",,,"800123456"],[,,"0878\\d{5}|1(?:44|6[346])\\d{6}|89(?:2\\d{3}|4(?:[0-4]\\d{2}|[5-9]\\d{4})|5(?:[0-4]\\d{2}|[5-9]\\d{6})|9\\d{6})","\\d{6,10}",,,"899123456"],[,,"84(?:[08]\\d{6}|[17]\\d{3})","\\d{6,9}",,,"848123456"],[,,"1(?:78\\d|99)\\d{6}","\\d{9,10}",,,"1781234567"],[,,"55\\d{8}","\\d{10}",,,"5512345678"],"VA",39,"00",,,,,,,,,,[,,"NA","NA"],,,[,,"848\\d{6}","\\d{9}",,,"848123456"],[,,"NA","NA"],1,,[,,"NA","NA"]],VC:[,[,,"[5789]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"784(?:266|3(?:6[6-9]|7\\d|8[0-24-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}","\\d{7}(?:\\d{3})?",,,"7842661234"],[,,"784(?:4(?:3[0-4]|5[45]|89|9[0-5])|5(?:2[6-9]|3[0-4]))\\d{4}","\\d{10}",,,"7844301234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"VC",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"784",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],VE:[,[,,"[24589]\\d{9}","\\d{7,10}"],[,,"(?:2(?:12|3[457-9]|[58][1-9]|[467]\\d|9[1-6])|50[01])\\d{7}","\\d{7,10}",,,"2121234567"],[,,"4(?:1[24-8]|2[46])\\d{7}","\\d{10}",,,"4121234567"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"900\\d{7}","\\d{10}",,,"9001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"VE",58,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{7})","$1-$2",,"0$1","$CC $1",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],VG:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"284(?:(?:229|4(?:22|9[45])|774|8(?:52|6[459]))\\d{4}|496[0-5]\\d{3})","\\d{7}(?:\\d{3})?",,,"2842291234"],[,,"284(?:(?:3(?:0[0-3]|4[0-367])|4(?:4[0-6]|68|99)|54[0-57])\\d{4}|496[6-9]\\d{3})","\\d{10}",,,"2843001234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"VG",1,"011","1",,,"1",,,,,,[,,"NA","NA"],,"284",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],VI:[,[,,"[3589]\\d{9}","\\d{7}(?:\\d{3})?"],[,,"340(?:2(?:01|2[0678]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-589]|27|7\\d)|884|998)\\d{4}","\\d{7}(?:\\d{3})?",,,"3406421234"],[,,"340(?:2(?:01|2[0678]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-589]|27|7\\d)|884|998)\\d{4}","\\d{7}(?:\\d{3})?",,,"3406421234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA"],[,,"5(?:00|33|44|66|77)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA"],"VI",1,"011","1",,,"1",,,1,,,[,,"NA","NA"],,"340",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],VN:[,[,,"[17]\\d{6,9}|[2-69]\\d{7,9}|8\\d{6,8}","\\d{7,10}"],[,,"(?:2(?:[025-79]|1[0189]|[348][01])|3(?:[0136-9]|[25][01])|4\\d|5(?:[01][01]|[2-9])|6(?:[0-46-8]|5[01])|7(?:[02-79]|[18][01])|8[1-9])\\d{7}","\\d{9,10}",,,"2101234567"],[,,"(?:9\\d|1(?:2\\d|6[2-9]|8[68]|99))\\d{7}","\\d{9,10}",,,"912345678"],[,,"1800\\d{4,6}","\\d{8,10}",,,"1800123456"],[,,"1900\\d{4,6}","\\d{8,10}",,,"1900123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"VN",84,"00","0",,,"0",,,,[[,"([17]99)(\\d{4})","$1 $2",["[17]99"],"0$1","",1],[,"([48])(\\d{4})(\\d{4})","$1 $2 $3",["[48]"],"0$1","",1],[,"([235-7]\\d)(\\d{4})(\\d{3})","$1 $2 $3",["2[025-79]|3[0136-9]|5[2-9]|6[0-46-8]|7[02-79]"],"0$1","",1],[,"(80)(\\d{5})","$1 $2",["80"],"0$1","",1],[,"(69\\d)(\\d{4,5})","$1 $2",["69"],"0$1","",1],[,"([235-7]\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["2[1348]|3[25]|5[01]|65|7[18]"],"0$1","",1],[,"(9\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1","",1],[,"(1[2689]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1(?:[26]|8[68]|99)"],"0$1","",1],[,"(1[89]00)(\\d{4,6})","$1 $2",["1[89]0"],"$1","",1]],,[,,"NA","NA"],,,[,,"[17]99\\d{4}|69\\d{5,6}","\\d{7,8}",,,"1992000"],[,,"[17]99\\d{4}|69\\d{5,6}|80\\d{5}","\\d{7,8}",,,"1992000"],,,[,,"NA","NA"]],VU:[,[,,"[2-57-9]\\d{4,6}","\\d{5,7}"],[,,"(?:2[02-9]\\d|3(?:[5-7]\\d|8[0-8])|48[4-9]|88\\d)\\d{2}","\\d{5}",,,"22123"],[,,"(?:5(?:7[2-5]|[3-69]\\d)|7[013-7]\\d)\\d{4}","\\d{7}",,,"5912345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"VU",678,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[579]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"3[03]\\d{3}|900\\d{4}","\\d{5,7}",,,"30123"],,,[,,"NA","NA"]],WF:[,[,,"[5-7]\\d{5}","\\d{6}"],[,,"(?:50|68|72)\\d{4}","\\d{6}",,,"501234"],[,,"(?:50|68|72)\\d{4}","\\d{6}",,,"501234"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"WF",681,"00",,,,,,,1,[[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],WS:[,[,,"[2-8]\\d{4,6}","\\d{5,7}"],[,,"(?:[2-5]\\d|6[1-9]|84\\d{2})\\d{3}","\\d{5,7}",,,"22123"],[,,"(?:60|7[25-7]\\d)\\d{4}","\\d{6,7}",,,"601234"],[,,"800\\d{3}","\\d{6}",,,"800123"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"WS",685,"0",,,,,,,,[[,"(8\\d{2})(\\d{3,4})","$1 $2",["8"],"","",0],[,"(7\\d)(\\d{5})","$1 $2",["7"],"","",0],[,"(\\d{5})","$1",["[2-6]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],YE:[,[,,"[1-7]\\d{6,8}","\\d{6,9}"],[,,"(?:1(?:7\\d|[2-68])|2[2-68]|3[2358]|4[2-58]|5[2-6]|6[3-58]|7[24-68])\\d{5}","\\d{6,8}",,,"1234567"],[,,"7[0137]\\d{7}","\\d{9}",,,"712345678"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"YE",967,"00","0",,,"0",,,,[[,"([1-7])(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7[24-68]"],"0$1","",0],[,"(7\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["7[0137]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],YT:[,[,,"[268]\\d{8}","\\d{9}"],[,,"2696[0-4]\\d{4}","\\d{9}",,,"269601234"],[,,"639\\d{6}","\\d{9}",,,"639123456"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"YT",262,"00","0",,,"0",,,,,,[,,"NA","NA"],,"269|63",[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],ZA:[,[,,"[1-79]\\d{8}|8(?:[067]\\d{7}|[1-4]\\d{3,7})","\\d{5,9}"],[,,"(?:1[0-8]|2[0-378]|3[1-69]|4\\d|5[1346-8])\\d{7}","\\d{9}",,,"101234567"],[,,"(?:6[0-5]|7[0-46-9])\\d{7}|8[1-4]\\d{3,7}","\\d{5,9}",,,"711234567"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"86[2-9]\\d{6}|90\\d{7}","\\d{9}",,,"862345678"],[,,"860\\d{6}","\\d{9}",,,"860123456"],[,,"NA","NA"],[,,"87\\d{7}","\\d{9}",,,"871234567"],"ZA",27,"00","0",,,"0",,,,[[,"(860)(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-79]|8(?:[0-47]|6[1-9])"],"0$1","",0],[,"(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1","",0],[,"(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"861\\d{6}","\\d{9}",,,"861123456"],,,[,,"NA","NA"]],ZM:[,[,,"[289]\\d{8}","\\d{9}"],[,,"21[1-8]\\d{6}","\\d{9}",,,"211234567"],[,,"9(?:5[05]|6\\d|7[1-9])\\d{6}","\\d{9}",,,"955123456"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"ZM",260,"00","0",,,"0",,,,[[,"([29]\\d)(\\d{7})","$1 $2",["[29]"],"0$1","",0],[,"(800)(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],ZW:[,[,,"2(?:[012457-9]\\d{3,8}|6\\d{3,6})|[13-79]\\d{4,8}|8[06]\\d{8}","\\d{3,10}"],[,,"(?:1[3-9]|2(?:0[45]|[16]|2[28]|[49]8?|58[23]|7[246]|8[1346-9])|3(?:08?|17?|3[78]|[2456]|7[1569]|8[379])|5(?:[07-9]|1[78]|483|5(?:7?|8))|6(?:0|28|37?|[45][68][78]|98?)|848)\\d{3,6}|(?:2(?:27|5|7[135789]|8[25])|3[39]|5[1-46]|6[126-8])\\d{4,6}|2(?:(?:0|70)\\d{5,6}|2[05]\\d{7})|(?:4\\d|9[2-8])\\d{4,7}","\\d{3,10}",,,"1312345"],[,,"7[1378]\\d{7}|86(?:22|44)\\d{6}","\\d{9,10}",,,"711234567"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"86(?:1[12]|30|55|77|8[367]|99)\\d{6}","\\d{10}",,,"8686123456"],"ZW",263,"00","0",,,"0",,,,[[,"([49])(\\d{3})(\\d{2,5})","$1 $2 $3",["4|9[2-9]"],"0$1","",0],[,"([179]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[19]1|7"],"0$1","",0],[,"(86\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["86[24]"],"0$1","",0],[,"([2356]\\d{2})(\\d{3,5})","$1 $2",["2(?:[278]|0[45]|[49]8)|3(?:08|17|3[78]|[78])|5[15][78]|6(?:[29]8|37|[68][78])"],"0$1","",0],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:[278]|0[45]|48)|3(?:08|17|3[78]|[78])|5[15][78]|6(?:[29]8|37|[68][78])|80"],"0$1","",0],[,"([1-356]\\d)(\\d{3,5})","$1 $2",["1[3-9]|2(?:[1-469]|0[0-35-9]|[45][0-79])|3(?:0[0-79]|1[0-689]|[24-69]|3[0-69])|5(?:[02-46-9]|[15][0-69])|6(?:[0145]|[29][0-79]|3[0-689]|[68][0-69])"],"0$1","",0],[,"([1-356]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[3-9]|2(?:[1-469]|0[0-35-9]|[45][0-79])|3(?:0[0-79]|1[0-689]|[24-69]|3[0-69])|5(?:[02-46-9]|[15][0-69])|6(?:[0145]|[29][0-79]|3[0-689]|[68][0-69])"],"0$1","",0],[,"([25]\\d{3})(\\d{3,5})","$1 $2",["(?:25|54)8","258[23]|5483"],"0$1","",0],[,"([25]\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["(?:25|54)8","258[23]|5483"],"0$1","",0],[,"(8\\d{3})(\\d{6})","$1 $2",["86"],"0$1","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],800:[,[,,"\\d{8}","\\d{8}",,,"12345678"],[,,"NA","NA",,,"12345678"],[,,"NA","NA",,,"12345678"],[,,"\\d{8}","\\d{8}",,,"12345678"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"001",800,"",,,,,,,1,[[,"(\\d{4})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]],808:[,[,,"\\d{8}","\\d{8}",,,"12345678"],[,,"NA","NA",,,"12345678"],[,,"NA","NA",,,"12345678"],[,,"NA","NA"],[,,"NA","NA"],[,,"\\d{8}","\\d{8}",,,"12345678"],[,,"NA","NA"],[,,"NA","NA"],"001",808,"",,,,,,,1,[[,"(\\d{4})(\\d{4})","$1 $2",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]],870:[,[,,"[35-7]\\d{8}","\\d{9}",,,"301234567"],[,,"NA","NA",,,"301234567"],[,,"(?:[356]\\d|7[6-8])\\d{7}","\\d{9}",,,"301234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"001",870,"",,,,,,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],878:[,[,,"1\\d{11}","\\d{12}",,,"101234567890"],[,,"NA","NA",,,"101234567890"],[,,"NA","NA",,,"101234567890"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"10\\d{10}","\\d{12}",,,"101234567890"],"001",878,"",,,,,,,1,[[,"(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],881:[,[,,"[67]\\d{8}","\\d{9}",,,"612345678"],[,,"NA","NA",,,"612345678"],[,,"[67]\\d{8}","\\d{9}",,,"612345678"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"001",881,"",,,,,,,,[[,"(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[67]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],882:[,[,,"[13]\\d{6,11}","\\d{7,12}",,,"3451234567"],[,,"NA","NA",,,"3451234567"],[,,"3(?:2\\d{3}|37\\d{2}|4(?:2|7\\d{3}))\\d{4}","\\d{7,10}",,,"3451234567"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15678]|9[0689])\\d{4}|6\\d{5,10})|345\\d{7}","\\d{7,12}",,,"3451234567"],"001",882,"",,,,,,,,[[,"(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"],"","",0],[,"(\\d{2})(\\d{5})","$1 $2",["16|342"],"","",0],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["34[57]"],"","",0],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["348"],"","",0],[,"(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1"],"","",0],[,"(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"],"","",0],[,"(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["16"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"348[57]\\d{7}","\\d{11}",,,"3451234567"]],883:[,[,,"51\\d{7}(?:\\d{3})?","\\d{9}(?:\\d{3})?",,,"510012345"],[,,"NA","NA",,,"510012345"],[,,"NA","NA",,,"510012345"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"51(?:00\\d{5}(?:\\d{3})?|[13]0\\d{8})","\\d{9}(?:\\d{3})?",,,"510012345"],"001",883,"",,,,,,,1,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"],"","",0],[,"(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["510"],"","",0],[,"(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"],"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],,,[,,"NA","NA"]],888:[,[,,"\\d{11}","\\d{11}",,,"12345678901"],[,,"NA","NA",,,"12345678901"],[,,"NA","NA",,,"12345678901"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"001",888,"",,,,,,,1,[[,"(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"\\d{11}","\\d{11}",,,"12345678901"],1,,[,,"NA","NA"]],979:[,[,,"\\d{9}","\\d{9}",,,"123456789"],[,,"NA","NA",,,"123456789"],[,,"NA","NA",,,"123456789"],[,,"NA","NA"],[,,"\\d{9}","\\d{9}",,,"123456789"],[,,"NA","NA"],[,,"NA","NA"],[,,"NA","NA"],"001",979,"",,,,,,,1,[[,"(\\d)(\\d{4})(\\d{4})","$1 $2 $3",,"","",0]],,[,,"NA","NA"],,,[,,"NA","NA"],[,,"NA","NA"],1,,[,,"NA","NA"]]}},_N={},kN=0;kN<IN.countries.length;kN++){const e=IN.countries[kN];if(e.prefixes)if(e.prefixes.length)for(var RN=0;RN<e.prefixes.length;RN++)_N[e.dialCode+e.prefixes[RN]]=[e.cca2.toUpperCase()];else _N[e.dialCode]=IN.countryCodes[e.dialCode];else _N[e.dialCode]=IN.countryCodes[e.dialCode]}function LN(e){var t="",n="";if("+"==e.charAt(0))for(var r="",i="",s=0;s<e.length&&(isNaN(parseFloat(e.charAt(s)))||(r+=e.charAt(s),_N[r]&&(t=e.substr(0,s+1)),4!=i.length))&&(isNaN(parseFloat(e.charAt(s)))||(i+=e.charAt(s),_N[i]&&(n=e.substr(0,s+1)),4!=i.length));s++);return{dialCode:n.replace(/\D/g,""),prefixesDialCode:t.replace(/\D/g,"")}}function DN(e,t){return ON(e,t[1])?ON(e,t[5])?4:ON(e,t[4])?3:ON(e,t[6])?5:ON(e,t[8])?6:ON(e,t[7])?7:ON(e,t[21])?8:ON(e,t[25])?9:ON(e,t[28])?10:ON(e,t[2])?t[18]||ON(e,t[3])?2:0:!t[18]&&ON(e,t[3])?1:-1:-1}function ON(e,t){return xN(e,t[3])&&xN(e,t[2])}function xN(e,t){var n="string"==typeof t?e.match("^(?:"+t+")$"):e.match(t);return!(!n||n[0].length!=e.length)}class PN{constructor(e,t,n,r){this.signIn=t,this.forgotPassword=n,this.submitTel=r,this.manager=TN(e)}close(){this.manager.close()}onSignOut(){this.manager.open((e=>{const t=()=>{e.onNavSignIn("")},n=()=>{e.onClose()};return{Hook:()=>{document.getElementById("tfr-sign-in").addEventListener("click",t),document.getElementById("tfr-close").addEventListener("click",n)},Unhook:()=>{document.getElementById("tfr-sign-in").removeEventListener("click",t),document.getElementById("tfr-close").removeEventListener("click",n)},Body:()=>`\n <div tfr-element="true" class="tfr-title-font tfr-light-22-300 tfr-mt-15-p tfr-mb-13-p">${mN}</div>\n <div class="tfr-t-a-center">\n <span id="tfr-sign-in" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor tfr-mr-20">${fN}</span>\n <span id="tfr-close" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor" >${lN}</span>\n </div>\n `}})({onNavSignIn:()=>this.toSignIn(),onClose:()=>this.close()}))}onNotCreated(){this.manager.open({Body:()=>`\n <div tfr-element="true" class="tfr-title-font tfr-light-22-300 tfr-c-black tfr-mt-60">${QA}</div>\n <div tfr-element="true" class="tfr-title-font tfr-light-22-300 tfr-c-black tfr-mb-60">${uN}</div>\n `,Hook:()=>{},Unhook:()=>{}})}onLoading(){this.manager.open(EN({timeoutMS:1e4}))}toScan(){this.manager.open((e=>{const t=()=>{e.onSignInNav()},n=()=>{const t=document.getElementById("tel-input").value;e.onTelSubmit(t)};return{Hook:()=>{CN("#tel-input"),document.getElementById("tel-button").addEventListener("click",n),document.getElementById("tfr-sign-in-nav").addEventListener("click",t)},Unhook:()=>{document.getElementById("tel-button").removeEventListener("click",n),document.getElementById("tfr-sign-in-nav").removeEventListener("click",t)},Body:()=>`\n <div tfr-element="true">\n <div tfr-element="true" class="tfr-title-font tfr-light-16-300 tfr-mt-10">${vN}</div>\n </div>\n <div tfr-element="true" class="tfr-logo-box">\n <video id="tfr-video" controls autoplay loop>\n <source src="https://assets.dev.thefittingroom.xyz/videos/the-fitting-room.mp4" />\n </video>\n </div>\n\n <div tfr-element="true" class="tfr-title-font tfr-light-16-300 tfr-mt-10">${ZA}</div>\n\n <div tfr-element="true" class="tfr-flex">\n <fieldset class="tfr-fieldset-element tfr-fieldset-inline tfr-mt-20">\n <legend tfr-element="true" class="tfr-label-element tfr-body-font tfr-14-default tfr-c-black-o5">${aN}</legend>\n <div tfr-element="true" class="tfr-flex">\n <input tfr-element="true" type="tel" id="tel-input" />\n </div>\n </fieldset>\n <button tfr-element="true" class="tfr-standard-button tfr-c-brand-bg tfr-c-whitetfr-title-font tfr-medium-16-default tfr-cursor tfr-mt-30" id="tel-button">\n ${hN}\n </button>\n </div>\n\n <div id="tfr-sign-in-nav" tfr-element="true" class="tfr-body-font tfr-mt-20 tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor">${tN}</div>\n `}})({onSignInNav:()=>this.toSignIn(),onTelSubmit:e=>this.submitTel(e)}))}toSignIn(){this.manager.open((e=>{const{email:t}=e,n=t=>{t.preventDefault();const n=document.getElementById("email-input").value,r=document.getElementById("password-input").value;s(),e.onSignIn(n,r,o)},r=()=>{const t=document.getElementById("email-input").value;e.onNavForgotPassword(t)},i=()=>{e.onNavScanCode()},s=()=>{document.querySelectorAll(".tfr-fieldset-element").forEach((e=>{e.classList.remove("tfr-fieldset-err")})),document.querySelectorAll(".tfr-label-element").forEach((e=>{e.classList.remove("tfr-c-red")}));const e=document.querySelector("#tfr-form-error");e.classList.remove("tfr-d-block"),e.innerHTML=""},o=e=>{document.querySelectorAll(".tfr-fieldset-element").forEach((e=>{e.classList.add("tfr-fieldset-err")})),document.querySelectorAll(".tfr-label-element").forEach((e=>{e.classList.add("tfr-c-red")}));const t=document.querySelector("#tfr-form-error");t.innerHTML=e||"Something went wrong",t.classList.add("tfr-d-block")};return{Hook:()=>{document.getElementById("tfr-sign-in-form").addEventListener("submit",n),document.getElementById("tfr-sign-in").addEventListener("click",n),document.getElementById("tfr-forgot-password").addEventListener("click",r),document.getElementById("tfr-scan-code").addEventListener("click",i)},Unhook:()=>{document.getElementById("tfr-sign-in-form").removeEventListener("submit",n),document.getElementById("tfr-sign-in").removeEventListener("click",n),document.getElementById("tfr-forgot-password").removeEventListener("click",r),document.getElementById("tfr-scan-code").removeEventListener("click",i)},Body:()=>`\n <form id="tfr-sign-in-form">\n <div class="tfr-title-font tfr-light-22-300 tfr-mt-10">${AN}</div>\n\n <fieldset class="tfr-fieldset-element tfr-fieldset tfr-mt-20">\n <legend tfr-element="true" class="tfr-label-element tfr-body-font tfr-14-default tfr-c-black-o5">${YA}</legend>\n <input tfr-element="true" type="email" id="email-input" value="${t||""}" />\n </fieldset>\n\n <fieldset class="tfr-fieldset-element tfr-fieldset tfr-mt-20">\n <legend tfr-element="true" class="tfr-label-element tfr-body-font tfr-14-default tfr-c-black-o5">${sN}</legend>\n <input tfr-element="true" type="password" id="password-input" />\n </fieldset>\n\n <div tfr-element="true" class="tfr-body-font tfr-12-default tfr-c-red tfr-mt-10 tfr-d-none" id="tfr-form-error"></div>\n\n <div class="tfr-mt-20">\n <span id="tfr-forgot-password" tfr-element="true" class="tfr-body-font tfr-14-default tfr-c-black-o5 tfr-underline tfr-cursor tfr-mr-15">${eN}</span>\n <span id="tfr-scan-code" tfr-element="true" class="tfr-body-font tfr-14-default tfr-c-black-o5 tfr-underline tfr-cursor">${WA}</span>\n </div>\n\n <button id="tfr-sign-in" tfr-element="true" class="tfr-standard-button tfr-c-brand-bg tfr-c-whitetfr-title-font tfr-medium-16-default tfr-cursor tfr-mt-30" id="sign-in-button" type="submit">\n ${AN}\n </button>\n </form>\n `}})({onSignIn:this.signIn,onNavForgotPassword:()=>this.toForgotPassword(),onNavScanCode:()=>this.toScan()}))}toForgotPassword(){this.manager.open((e=>{const t=()=>{const t=document.getElementById("tfr-email").value;e.onNavSignIn(t)},n=()=>{const t=document.getElementById("tfr-email").value;e.onPasswordReset(t)};return{Hook:()=>{document.getElementById("tfr-send-password-reset").addEventListener("click",n),document.getElementById("tfr-back-to-signin").addEventListener("click",t)},Unhook:()=>{document.getElementById("tfr-send-password-reset").removeEventListener("click",n),document.getElementById("tfr-back-to-signin").removeEventListener("click",t)},Body:()=>`\n <div tfr-element="true" class="tfr-title-font tfr-light-16-300 tfr-mt-20 tfr-w-70-p tfr-m-h-auto">${XA}</div>\n <fieldset class="tfr-fieldset-element tfr-fieldset tfr-mt-30">\n <legend tfr-element="true" class="tfr-label-element tfr-body-font tfr-14-default tfr-c-black-o5">${YA}</legend>\n <input tfr-element="true" type="email" id="tfr-email" />\n </fieldset>\n <div tfr-element="true" class="tfr-body-font tfr-12-default tfr-c-red tfr-mt-10 tfr-d-none" id="error-msg"></div>\n <div id="tfr-back-to-signin" tfr-element="true" class="tfr-body-font tfr-12-default tfr-c-black-o5 tfr-underline tfr-cursor tfr-mt-30">${KA}</div>\n <button id="tfr-send-password-reset" tfr-element="true" class="tfr-standard-button tfr-c-brand-bg tfr-c-whitetfr-title-font tfr-medium-16-default tfr-cursor tfr-mt-30">\n ${hN}\n </button>\n `}})({onNavSignIn:()=>this.toSignIn(),onPasswordReset:this.forgotPassword}))}toPasswordReset(){}onTryOn(e){this.manager.open((e=>{let t=()=>{};const r=()=>{e.onNavBack()},i=()=>{e.onClose()};return{Hook:()=>{const s=document.getElementById("tfr-tryon-image"),o=n("tfr-slider",((e,t)=>{console.debug("slider change",e,t),s.src=t}));if(Array.isArray(e.frames)&&e.frames.length>0){const n=o.Load(e.frames);if(n instanceof Error)return void console.error(n);t=n}document.getElementById("tfr-back").addEventListener("click",r),document.getElementById("tfr-close").addEventListener("click",i)},Unhook:()=>{t(),document.getElementById("tfr-back").removeEventListener("click",r),document.getElementById("tfr-close").removeEventListener("click",i)},Body:()=>`\n <div class="tfr-slider-wrapper">\n\t\t\t\t<img id="tfr-tryon-image" src="" />\n\t\t\t\t<input type="range" id="tfr-slider" />\n\t\t\t\t</div>\n\t\t\t\t<div class="tfr-t-a-center">\n <span id="tfr-back" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor tfr-mr-20">${dN}</span>\n <span id="tfr-close" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor" id="returnToSite">${cN}</span>\n </div>\n `}})({frames:e,onClose:()=>this.close(),onNavBack:()=>this.navBack()}))}onError(e){this.manager.open((e=>{const{error:t}=e,n=()=>{e.onNavBack()},r=()=>{e.onClose()};return{Hook:()=>{document.getElementById("tfr-back").addEventListener("click",n),document.getElementById("tfr-close").addEventListener("click",r)},Unhook:()=>{document.getElementById("tfr-back").removeEventListener("click",n),document.getElementById("tfr-close").removeEventListener("click",r)},Body:()=>(t||console.error("ErrorModal: No error provided"),`\n <div class="tfr-mt-15-p tfr-mb-13-p">\n <div tfr-element="true" class="tfr-title-font tfr-light-22-300 tfr-c-black">${t||NN}</div>\n </div>\n\n <div class="tfr-t-a-center">\n <span id="tfr-back" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor tfr-mr-20">${dN}</span>\n <span id="tfr-close" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor" id="returnToSite">${cN}</span>\n </div>\n `)}})({error:e,onClose:()=>this.close(),onNavBack:()=>this.navBack()}))}onSizeError(e,t){this.manager.open((e=>{const t=()=>{e.onNavBack()},n=()=>{e.onClose()};return{Hook:()=>{document.getElementById("tfr-back").addEventListener("click",t),document.getElementById("tfr-close").addEventListener("click",n)},Unhook:()=>{document.getElementById("tfr-back").removeEventListener("click",t),document.getElementById("tfr-close").removeEventListener("click",n)},Body:()=>{var t,n,r;return console.debug("rendering size error modal",e),`\n <div class="tfr-mt-15-p tfr-mb-13-p">\n <div tfr-element="true" class="tfr-title-font tfr-light-22-300 tfr-c-black">\n\t\t\t\t\t\t\t${rN} ${null===(t=e.sizes)||void 0===t?void 0:t.recommended} ${iN} ${null===(r=null===(n=e.sizes)||void 0===n?void 0:n.available)||void 0===r?void 0:r.join(" or ")}\n\t\t\t\t\t\t</div>\n </div>\n\n <div class="tfr-t-a-center">\n <span id="tfr-back" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor tfr-mr-20">${dN}</span>\n <span id="tfr-close" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor">${cN}</span>\n </div>\n `}}})({sizes:{recommended:e,available:t},onClose:()=>this.close(),onNavBack:()=>this.navBack()}))}navBack(){window.history.back()}}const MN="https://assets.dev.thefittingroom.xyz/shop-sdk/assets/login-icon.svg";class UN{constructor(e,t,n){this.onSignInClick=t,this.onSignOutClick=n,this._sku="",this.isLoggedIn=!1,this.redraw=null,this.init(e)}get sku(){return this._sku}setSku(e){this._sku=e}setIsLoggedIn(e){this.isLoggedIn=e,e?(this.tfrSizeRecActionLogin.style.display="none",this.tfrSizeRecActionLogout.style.display="block",this.tfrSizeRecTitle.style.display="block",this.tfrSizeRecSubtitle.style.display="block"):(this.tfrSizeRecActionLogin.style.display="block",this.tfrSizeRecActionLogout.style.display="none")}setLoading(e){e?(this.tfrSizeRecLoading.style.display="block",this.tfrSizeRecommendationsContainer.style.display="none"):(this.tfrSizeRecLoading.style.display="none",this.tfrSizeRecommendationsContainer.style.display="flex")}setGarmentLocations(e){if(!e||!e.length)return this.tfrSizeRecTitle.style.display="none",void(this.tfrSizeRecSubtitle.style.display="none");this.renderGarmentLocations(e),this.tfrSizeRecSelect.style.display="none"}setRecommendedSize({recommended:e,sizes:t}){this.renderSizeRec(e,t),this.tfrSizeRecSelect.style.display="flex"}setError(){this.tfrSizeRecTitle.style.display="none",this.tfrSizeRecSubtitle.style.display="none",this.isLoggedIn&&(this.tfrSizeRecommendationError.style.display="block",this.tfrSizeRecommendationError.innerHTML="No recommended size found.")}init(e){const t=document.getElementById(e);if(!t)throw new Error("Size rec main div not found");this.render(t),this.setElements(),this.bindEvents()}setElements(){this.tfrSizeRecTitle=document.getElementById("tfr-size-rec-title"),this.tfrSizeRecSubtitle=document.getElementById("tfr-size-rec-subtitle"),this.tfrSizeRecActionLogin=document.getElementById("tfr-size-rec-action-login"),this.tfrSizeRecActionLogout=document.getElementById("tfr-size-rec-action-logout"),this.tfrSizeRecTable=document.getElementById("tfr-size-rec-table"),this.tfrSizeRecommendationError=document.getElementById("tfr-size-recommendation-error"),this.tfrSizeRecSize=document.getElementById("tfr-size-rec-size"),this.tfrSizeRecSelect=document.getElementById("tfr-size-rec-select"),this.tfrSizeRecLoading=document.getElementById("tfr-size-rec-loading"),this.tfrSizeRecommendationsContainer=document.getElementById("tfr-size-recommendations-container")}bindEvents(){this.tfrSizeRecActionLogin.addEventListener("click",this.onSignInClick),this.tfrSizeRecActionLogout.addEventListener("click",this.onSignOutClick),this.tfrSizeRecSelect.addEventListener("click",this.onSizeRecSelectClick.bind(this))}onSizeRecSelectClick(e){const t=e.target;if(!t.classList.contains("tfr-size-rec-select-button"))return;e.preventDefault();const n=Number(t.getAttribute("data-index"));if(Number.isNaN(n))return;const r=document.querySelectorAll(".tfr-size-rec-select-button");r.forEach((e=>e.classList.remove("active"))),r.item(n).classList.add("active"),this.redraw(n)}renderSizeRec(e,t){this.tfrSizeRecSize.innerHTML=` ${e}`;const n=t.findIndex((({size:t})=>t===e));this.redraw=e=>this.renderSizeRecTable(t,e),this.redraw(n),this.renderSizeRecSelect(t,n)}renderSizeRecTable(e,t){const{locations:n}=e[t],r=n.sort((({location:e},{location:t})=>e<t?-1:1)).map((({location:e,fit:t,isPerfect:n})=>this.renderSizeRecTableRow(e,t,n))).join("");this.tfrSizeRecTable.innerHTML=r}renderSizeRecSelect(e,t){const n=e.map((({size:e})=>e)).map(((e,n)=>`<div class="tfr-size-rec-select-button ${n===t?"active":""}" data-index="${n}">${e}</div>`)).join("");this.tfrSizeRecSelect.innerHTML=n}renderSizeRecTableRow(e,t,n=!1){return`<div class="tfr-size-rec-table-row">\n <div class="tfr-size-rec-table-cell-left">${e}</div>\n <div class="tfr-size-rec-table-cell-right ${n?"perfect":""}">\n ${t}\n </div>\n </div>`}renderLoginCta(){return`<div class="tfr-size-rec-login-cta"><img src="${MN}" /> Login/Sign In to view</div>`}renderGarmentLocations(e){const t=e.sort().map((e=>this.renderSizeRecTableRow(e,this.renderLoginCta()))).join("");this.tfrSizeRecTable.innerHTML=t,this.tfrSizeRecSize.innerHTML=this.renderLoginCta()}render(e){const t=`<div id="tfr-size-recommendations">\n <div id="tfr-size-rec-loading">\n <div class="lds-ellipsis">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n </div>\n </div>\n <div id="tfr-size-recommendations-container">\n <img id="tfr-size-rec-login-svg" src="${MN}" />\n <div id="tfr-size-rec-title">\n Recommended Size:\n <div id="tfr-size-rec-size">\n <div class="tfr-size-rec-login-cta">\n <img src="${MN}" /> Login/Sign In to view\n </div>\n </div>\n </div>\n\n <div id="tfr-size-rec-select"></div>\n\n <div id="tfr-size-rec-subtitle">How it fits</div>\n\n <div id="tfr-size-rec-table"></div>\n\n <div id="tfr-size-rec-action">\n <div id="tfr-size-rec-action-login">Login to see your recommended size</div>\n <div id="tfr-size-rec-action-logout">Sign out of the Fitting Room</div>\n </div>\n\n <div class="tfr-powered-by">\n <div>Powered by</div>\n <div class="tfr-powered-by-logo"><img src="https://assets.dev.thefittingroom.xyz/shop-sdk/assets/tfr-door-brand.svg" /></div>\n <div class="tfr-powered-by-text-bold">The Fitting Room</div>\n </div>\n </div>\n </div>\n <div id="tfr-size-recommendation-error"></div>`;e.innerHTML=t}}class FN{constructor(e,t,n,r,i){this.tfrShop=n,this.onSignInClick=r,this.onSignOutClick=i,this.perfectFits=[qA.Fit.PERFECT_FIT,qA.Fit.SLIGHTLY_LOOSE,qA.Fit.SLIGHTLY_TIGHT],this.setCssVariables(t),this.sizeRecComponent=new UN(e,this.onSignInClick,this.onSignOutClick)}get sku(){return this.sizeRecComponent.sku}setSku(e){this.sizeRecComponent.setSku(e)}setIsLoggedIn(e){this.sizeRecComponent.setIsLoggedIn(e)}async setGarmentLocations(e=[]){this.sizeRecComponent.setLoading(!0);const t=await this.getGarmentLocations(e);console.debug("locations",t),console.debug("filledLocations",e),this.sizeRecComponent.setGarmentLocations(t||[]),this.sizeRecComponent.setLoading(!1)}async setRecommendedSize(){this.sizeRecComponent.setLoading(!0);const e=await this.getRecommenedSize();if(!e)return console.error("No sizes found for sku"),this.sizeRecComponent.setLoading(!1),void this.sizeRecComponent.setError();this.sizeRecComponent.setRecommendedSize(e),this.sizeRecComponent.setLoading(!1)}async getGarmentLocations(e){try{return await this.tfrShop.getMeasurementLocationsFromSku(this.sku,e)}catch(t){try{const t=await this.tfrShop.getStyleByBrandStyleId(this.sku);return await this.tfrShop.getMeasurementLocationsFromBrandStyleId(t.id,e)}catch(e){return console.error(e),this.sizeRecComponent.setError(),null}}}async getRecommenedSize(){try{const e=await this.tfrShop.getColorwaySizeAssetFromSku(this.sku);return await this.getRecommendedSizes(String(e.style_id))}catch(e){try{const e=await this.tfrShop.getStyleByBrandStyleId(this.sku);return await this.getRecommendedSizes(String(e.id))}catch(e){return console.error(e),this.sizeRecComponent.setError(),null}}}async getRecommendedSizes(e){const t=await this.tfrShop.getRecommendedSizes(e);return t?{recommended:t.recommended_size.label,sizes:t.fits.map((e=>({size:t.available_sizes.find((t=>t.id===e.size_id)).label,locations:e.measurement_location_fits.map((e=>({fit:qA.FitNames[e.fit],isPerfect:this.perfectFits.includes(e.fit),location:qA.MeasurementLocationName[e.measurement_location]})))})))}:null}setCssVariables(e){const t=document.querySelector(":root");e.brandColor&&t.style.setProperty("--tfr-brand-color",e.brandColor),e.black&&t.style.setProperty("--tfr-black",e.black),e.red&&t.style.setProperty("--tfr-red",e.red),e.white&&t.style.setProperty("--tfr-white",e.white),e.muted&&t.style.setProperty("--tfr-muted",e.muted),e.dark&&t.style.setProperty("--tfr-dark",e.dark),e.grey&&t.style.setProperty("--tfr-grey",e.grey),e.lightGrey&&t.style.setProperty("--tfr-light-grey",e.lightGrey),e.mainBorderColor&&t.style.setProperty("--tfr-main-border-color",e.mainBorderColor),e.mainBorderRadius&&t.style.setProperty("--tfr-main-border-radius",e.mainBorderRadius),e.mainBorderWidth&&t.style.setProperty("--tfr-main-border-width",e.mainBorderWidth),e.mainBgColor&&t.style.setProperty("--tfr-main-bg-color",e.mainBgColor),e.mainWidth&&t.style.setProperty("--tfr-main-width",e.mainWidth),e.mainVPadding&&t.style.setProperty("--tfr-main-v-padding",e.mainVPadding),e.mainHPadding&&t.style.setProperty("--tfr-main-h-padding",e.mainHPadding),e.mainFont&&t.style.setProperty("--tfr-main-font",e.mainFont),e.titleFont&&t.style.setProperty("--tfr-title-font",e.titleFont),e.subtitleFont&&t.style.setProperty("--tfr-subtitle-font",e.subtitleFont),e.rowFont&&t.style.setProperty("--tfr-row-font",e.rowFont),e.ctaFont&&t.style.setProperty("--tfr-cta-font",e.ctaFont),e.sizeSelectorTextColor&&t.style.setProperty("--tfr-size-selector-text-color",e.sizeSelectorTextColor),e.sizeSelectorBgColor&&t.style.setProperty("--tfr-size-selector-bg-color",e.sizeSelectorBgColor),e.sizeSelectorBgColorHover&&t.style.setProperty("--tfr-size-selector-bg-color-hover",e.sizeSelectorBgColorHover),e.sizeSelectorBgColorActive&&t.style.setProperty("--tfr-size-selector-bg-color-active",e.sizeSelectorBgColorActive)}}var BN;!function(e){e.NOT_CREATED="NOT_CREATED",e.CREATED="CREATED",e.PENDING="PENDING"}(BN||(BN={}));class zN{constructor(e,t,n,r={},i,s){this.shopId=e,this.hooks=r,this.isLoggedIn=!1,this.unsub=null;const o=s||("undefined"!=typeof process?process.env.NODE_ENV:"dev");this.tfrModal=new PN(t,this.signIn.bind(this),this.forgotPassword.bind(this),this.submitTel.bind(this)),this.tfrShop=((e,t="dev")=>("dev"!==t&&"development"!==t||console.warn("TfrShop is in development mode"),xu.getInstance().setEnv(t),new xA(e,new LA)))(Number(this.shopId),o),this.tfrSizeRec=new FN(n,i,this.tfrShop,this.onSignInClick.bind(this),this.signOut.bind(this))}get shop(){return this.tfrShop}get sku(){return this.tfrSizeRec.sku}async checkIfPublished(e){const t=await this.getStyle(e);return Boolean(null==t?void 0:t.is_published)}setSku(e){this.tfrSizeRec.setSku(e),this.isLoggedIn?this.tfrSizeRec.setRecommendedSize():this.setGarmentLocations()}async onInit(){var e,t;return this.isLoggedIn=await this.tfrShop.onInit(),this.tfrSizeRec.setIsLoggedIn(this.isLoggedIn),this.isLoggedIn?((null===(e=this.hooks)||void 0===e?void 0:e.onLogin)&&this.hooks.onLogin(),this.subscribeToProfileChanges()):((null===(t=this.hooks)||void 0===t?void 0:t.onLogout)&&this.hooks.onLogout(),this.unsubscribeFromProfileChanges()),this.isLoggedIn}close(){this.tfrModal.close()}async signOut(){var e;await this.tfrShop.user.logout(),(null===(e=this.hooks)||void 0===e?void 0:e.onLogout)&&this.hooks.onLogout(),this.isLoggedIn=!1,this.tfrSizeRec.setIsLoggedIn(!1),this.setGarmentLocations(),this.unsubscribeFromProfileChanges()}async signIn(e,t,n){var r;if(0==e.length||0==t.length)return n(gN);if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/.test(e))return n(JA);if(!(e=>!!e.match(/^.{7,}$/))(t))return n(oN);try{await this.tfrShop.user.login(e,t),(null===(r=this.hooks)||void 0===r?void 0:r.onLogin)&&this.hooks.onLogin(),this.tfrModal.close(),this.isLoggedIn=!0,this.tfrSizeRec.setIsLoggedIn(!0),this.tfrSizeRec.setRecommendedSize(),this.subscribeToProfileChanges()}catch(e){return n($N)}}setBrandUserId(e){this.tfrShop.user.setBrandUserId(e)}async submitTel(e){try{await this.tfrShop.submitTelephoneNumber(e),this.tfrModal.toSignIn()}catch(e){this.tfrModal.onError(NN)}}async forgotPassword(e){await this.tfrShop.user.sendPasswordResetEmail(e),this.tfrModal.toSignIn()}async passwordReset(e,t){await this.tfrShop.user.confirmPasswordReset(e,t),this.tfrModal.toPasswordReset()}async getMeasurementLocationsFromSku(e){return this.tfrShop.getMeasurementLocationsFromSku(e)}onSignInClick(){this.tfrModal.toScan()}onUserProfileChange(e){var t,n,r,i;switch(e.avatar_status){case BN.NOT_CREATED:(null===(t=this.hooks)||void 0===t?void 0:t.onError)&&this.hooks.onError(QA),this.tfrModal.onNotCreated();break;case BN.PENDING:(null===(n=this.hooks)||void 0===n?void 0:n.onLoading)&&this.hooks.onLoading();break;case BN.CREATED:(null===(r=this.hooks)||void 0===r?void 0:r.onLoadingComplete)&&this.hooks.onLoadingComplete();break;default:(null===(i=this.hooks)||void 0===i?void 0:i.onError)&&this.hooks.onError(NN),this.tfrModal.onError(NN)}}subscribeToProfileChanges(){this.unsub||(this.unsub=this.tfrShop.user.watchUserProfileForChanges((e=>this.onUserProfileChange(e))))}unsubscribeFromProfileChanges(){this.unsub&&(this.unsub(),this.unsub=null)}async setGarmentLocations(){var e,t;const n=await this.getStyle(this.sku),r=(null===(t=null===(e=null==n?void 0:n.sizes)||void 0===e?void 0:e[0])||void 0===t?void 0:t.garment_measurements.map((e=>e.garment_measurement_location)))||[];this.tfrSizeRec.setGarmentLocations(r)}async getStyle(e){try{const t=await this.tfrShop.getColorwaySizeAssetFromSku(e);return await this.tfrShop.getStyle(t.style_id)}catch(t){try{return await this.tfrShop.getStyleByBrandStyleId(e)}catch(e){return null}}}}const VN=async(e,t,n,r={},i={},s="dev")=>{const o=new zN(e,t,n,r,i,s);return await o.onInit(),o};export{n as InitImageSlider,VN as initFittingRoom};
|
|
3169
|
+
const Ip=d("authIdTokenMaxAge")||300;let Tp=null;function kp(t=Ut()){const e=Ot(t,"auth");if(e.isInitialized())return e.getImmediate();const n=function(t,e){const n=Ot(t,"auth");if(n.isInitialized()){const t=n.getImmediate();if(y(n.getOptions(),null!=e?e:{}))return t;$h(t,"already-initialized")}return n.initialize({options:e})}(t,{popupRedirectResolver:bp,persistence:[Pf,vf,bf]}),r=d("authTokenSyncURL");if(r){const t=(i=r,async t=>{const e=t&&await t.getIdTokenResult(),n=e&&((new Date).getTime()-Date.parse(e.issuedAtTime))/1e3;if(n&&n>Ip)return;const r=null==e?void 0:e.token;Tp!==r&&(Tp=r,await fetch(i,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))});!function(t,e,n){I(t).beforeAuthStateChanged(e,n)}(n,t,(()=>t(n.currentUser))),function(t,e,n,r){I(t).onIdTokenChanged(e,n,r)}(n,(e=>t(e)))}var i;const s=u("auth");return s&&qd(n,`http://${s}`),n}var Cp;Cp="Browser",Lt(new T("auth",((t,{options:e})=>{const n=t.getProvider("app").getImmediate(),r=t.getProvider("heartbeat"),{apiKey:i,authDomain:s}=n.options;return((t,n)=>{Wh(i&&!i.includes(":"),"invalid-api-key",{appName:t.name}),Wh(!(null==s?void 0:s.includes(":")),"argument-error",{appName:t.name});const r={apiKey:i,authDomain:s,clientPlatform:Cp,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:zd(Cp)},o=new Vd(t,n,r);return function(t,e){const n=(null==e?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Xh);(null==e?void 0:e.errorMap)&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,null==e?void 0:e.popupRedirectResolver)}(o,e),o})(n,r)}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((t,e,n)=>{t.getProvider("auth-internal").initialize()}))),Lt(new T("auth-internal",(t=>(t=>new Ep(t))(Hd(t.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),Ft(_p,Sp,function(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(Cp)),Ft(_p,Sp,"esm2017");class Ap extends Error{constructor(){super("Avatar not created"),this.name="AvatarNotCreatedError"}}class Rp extends Error{constructor(){super("user not logged in"),this.name="UserNotLoggedInError"}}class Np extends Error{constructor(){super("no colorway size assets found"),this.name="NoColorwaySizeAssetsFoundError"}}class Lp{constructor(t,e){this.firestore=t,this.brandUserId=null,this.auth=kp(e),this.auth.setPersistence(vf)}get id(){var t;return null===(t=this.user)||void 0===t?void 0:t.uid}onInit(){return new Promise((t=>{const e=this.auth.onAuthStateChanged((n=>{this.setUser(n),t(Boolean(n)),e()}))}))}setUser(t){this.user=t}setBrandUserId(t){this.brandUserId=t}async getToken(){var t;if(!(null===(t=this.user)||void 0===t?void 0:t.uid))throw new Rp;return await this.user.getIdToken()}async getUserProfile(){var t;if(!(null===(t=this.user)||void 0===t?void 0:t.uid))throw new Rp;return(await Nh(Hu(this.firestore,"users",this.id))).data()}watchUserProfileForChanges(t){let e;const n=yh(Vu(this.firestore,"users"),wh(new th("__name__"),"==",this.id));return e=Dh(n,(e=>t(e.docs[0].data()))),()=>e()}async login(t,e){this.auth.currentUser&&await this.auth.signOut();const n=await pf(this.auth,t,e);this.setUser(n.user)}async logout(){await this.auth.signOut(),this.setUser(null)}async sendPasswordResetEmail(t){await df(this.auth,t)}async confirmPasswordReset(t,e){await ff(this.auth,t,e)}}class Op{constructor(){this.promisefyOnSnapshot=(t,e)=>{let n;return{promise:new Promise((r=>{n=Dh(t,(t=>{r(t),e&&n()}))})),unsubscribe:()=>n()}};const t=Mt(Ph.getInstance().firebase);this.firestore=Yu(t),this.user=new Lp(this.firestore,t)}onInit(){return this.user.onInit()}query(t,e,n=!0){const r=yh(Vu(this.firestore,t),e);return this.promisefyOnSnapshot(r,n)}getDocs(t,e){return Oh(yh(Vu(this.firestore,t),...e))}async getDoc(t,e){const n=Hu(this.firestore,t,e),r=await Nh(n);return r.exists()?r.data():null}}const Dp=t=>{if(t.code===Hh)throw new Error("account has been disabled");throw new Error(t.message)};class xp{static get endpoint(){return Ph.getInstance().api.url}static async Fetch({user:t,endpointPath:e,method:n,body:r,useToken:i=!0}){const s=this.getUrl(e,i),o={method:n,headers:await this.getHeaders(t,i),credentials:"include"};r&&(o.body=JSON.stringify(r));const a=await fetch(s,o);if(a.ok)return a;if(500===a.status)throw new Error(a.statusText);const c=await a.json();return Promise.reject(c)}static getUrl(t,e){return e?`${this.endpoint}/v1${t}`:this.endpoint+t}static async getHeaders(t,e){if(!e)return{"Content-Type":"application/json"};return{"Content-Type":"application/json",Authorization:`Bearer ${await t.getToken()}`}}static Get(t,e,n){return this.Fetch({user:t,endpointPath:e,method:"GET",body:null,useToken:n})}static Post(t,e,n=null,r){return this.Fetch({user:t,endpointPath:e,method:"POST",body:n,useToken:r})}static Put(t,e,n,r){return this.Fetch({user:t,endpointPath:e,method:"PUT",body:n,useToken:r})}static Patch(t,e,n,r){return this.Fetch({user:t,endpointPath:e,method:"PATCH",body:n,useToken:r})}static Delete(t,e,n,r){return this.Fetch({user:t,endpointPath:e,method:"DELETE",body:n,useToken:r})}}class Pp{constructor(t,e){this.brandId=t,this.firebase=e,this.measurementLocations=new Map}get user(){return this.firebase.user}get isLoggedIn(){return!this.firebase||Boolean(this.user.id)}async onInit(){return await this.getMeasurementLocations(),this.firebase.onInit()}async getRecommendedSizes(t){var e,n;if(!this.isLoggedIn)throw new Rp;try{const r=await xp.Get(this.user,`/styles/${t}/recommendation`),i=await r.json();return(null===(e=null==i?void 0:i.fits)||void 0===e?void 0:e.length)&&(null===(n=null==i?void 0:i.recommended_size)||void 0===n?void 0:n.id)?i:null}catch(t){if("avatar not created"===(null==t?void 0:t.error))throw new Ap;throw t}}async submitTelephoneNumber(t){const e=t.replace(/[^\+0-9]/g,""),n=await xp.Post(this.user,"/ios-app-link",{phone_number:e},!1);console.log(n)}async getColorwaySizeAssetFromSku(t){const e=await this.getColorwaySizeAssets(null,[t]);if(!(null==e?void 0:e.size))throw new Np;return Array.from(e.values())[0]}async getColorwaySizeAssetFromBrandStyleId(t){const e=await this.getColorwaySizeAssets(t);if(!(null==e?void 0:e.size))throw new Np;return Array.from(e.values())[0]}async getMeasurementLocationsFromSku(t,e=[]){const n=await this.getColorwaySizeAssetFromSku(t);if(!n)throw new Error("No colorway size asset found for sku");const r=await this.getStyle(n.style_id);if(!r)throw new Error("Style category not found for style id");const i=await this.getGetTaxonomy(r.style_garment_category_id);if(!i)throw new Error("Taxonomy not found for style garment category id");return(e.length?i.garment_measurement_locations.female.filter((t=>e.includes(t))):i.garment_measurement_locations.female).map((t=>this.measurementLocations.has(t)?this.measurementLocations.get(t):t))}async getMeasurementLocationsFromBrandStyleId(t,e=[]){const n=await this.getColorwaySizeAssetFromBrandStyleId(t);if(!n)throw new Error("No colorway size asset found for brand style id");const r=await this.getStyle(n.style_id);if(!r)throw new Error("Style category not found for style id");const i=await this.getGetTaxonomy(r.style_garment_category_id);if(!i)throw new Error("Taxonomy not found for style garment category id");return(e.length?i.garment_measurement_locations.female.filter((t=>e.includes(t))):i.garment_measurement_locations.female).map((t=>this.measurementLocations.has(t)?this.measurementLocations.get(t):t))}async getStyleByBrandStyleId(t){var e,n;try{const r=[wh("brand_id","==",this.brandId)];r.push(wh("brand_style_id","==",t));return null===(n=null===(e=(await this.firebase.getDocs("styles",r)).docs)||void 0===e?void 0:e[0])||void 0===n?void 0:n.data()}catch(t){return Dp(t)}}async getColorwaySizeAssets(t,e){const n=[wh("brand_id","==",this.brandId)];t&&n.push(wh("style_id","==",t)),(null==e?void 0:e.length)>0&&n.push(wh("sku","in",e));try{const t=await this.firebase.getDocs("colorway_size_assets",n),e=new Map;return t.forEach((t=>{const n=t.data();e.set(n.id,n)})),e}catch(t){return Dp(t)}}async getStyle(t){try{return await this.firebase.getDoc("styles",String(t))}catch(t){return Dp(t)}}async getGetTaxonomy(t){try{return await this.firebase.getDoc("style_garment_categories",String(t))}catch(t){return Dp(t)}}async getMeasurementLocations(){(await this.fetchMeasurementLocations()).forEach((t=>{this.measurementLocations.set(t.name,t.label)}))}async fetchMeasurementLocations(){try{return(await this.firebase.getDocs("garment_measurement_locations",[])).docs.map((t=>t.data()))}catch(t){return Dp(t)}}}var Mp;!function(t){t.ACROSS_BACK="across_back",t.ACROSS_FRONT="across_front",t.ACROSS_SHOULDER="across_shoulder",t.ANKLE="ankle",t.ARMEYE="arm_eye",t.ARM_LENGTH_FROM_SHOULDER="arm_length_from_shoulder",t.BACK_CROTCH_LENGTH="back_crotch_length",t.BACK_NECK_TO_EBLOW="back_neck_to_elbow",t.BELOW_KNEE="below_knee",t.BICEP="bicep",t.BUST="bust",t.BUST_POINT_TO_BUST_POINT="bust_point_to_bust_point",t.CALF="calf",t.CB_NECK_TO_WAIST="cb_neck_to_waist",t.CB_NECK_TO_WRIST="cb_neck_to_wrist",t.CF_NECK_TO_WAIST="cf_neck_to_waist",t.ELBOW="elbow",t.FOREARM="forearm",t.FRONT_CROTCH_LENGTH="front_crotch_length",t.HIGH_HIP_PLACEMENT_FROM_WAIST="high_hip_placement",t.HIGH_HIP="high_hip",t.HSP_TO_ACROSS_BACK="hsp_to_across_back",t.HSP_TO_ACROSS_FRONT="hsp_to_across_front",t.HSP_TO_BUST_POINT="hsp_to_bust_point",t.HSP_TO_LOW_HIP_POSITION="hsp_to_low_hip_position",t.HSP_TO_WAIST_POSITION="hsp_to_waist_position",t.INSEAM="inseam",t.KNEE="knee",t.LOW_HIP="low_hip",t.LOW_HIP_PLACEMENT_FROM_WAIST="low_hip_placement",t.MID_NECK="mid_neck",t.NECK_AT_BASE="neck_base",t.SHOULDER_DROP="shoulder_drop",t.SHOULDER_TO_SHOULDER="shoulder_to_shoulder",t.SIDE_WAIST_TO_FLOOR="side_waist_to_floor",t.SIDE_WAIST_TO_KNEE="side_waist_to_knee",t.THIGH="thigh",t.TOTAL_RISE_LENGTH="total_rise_length",t.UNDER_BUST="under_bust",t.VERTICAL_TRUNK="vertical_trunk",t.WAIST="waist",t.WRIST="wrist"}(Mp||(Mp={}));const Up={[Mp.ACROSS_BACK]:"Across back",[Mp.ACROSS_FRONT]:"Across front",[Mp.ACROSS_SHOULDER]:"Across shoulder",[Mp.ANKLE]:"Ankle",[Mp.ARMEYE]:"Armeye",[Mp.ARM_LENGTH_FROM_SHOULDER]:"Arm length from shoulder",[Mp.BACK_CROTCH_LENGTH]:"Back crotch length",[Mp.BACK_NECK_TO_EBLOW]:"Back neck to eblow",[Mp.BELOW_KNEE]:"Below knee",[Mp.BICEP]:"Bicep",[Mp.BUST]:"Chest/Bust",[Mp.BUST_POINT_TO_BUST_POINT]:"Bust point to bust point",[Mp.CALF]:"Calf",[Mp.CB_NECK_TO_WAIST]:"Cb neck to waist",[Mp.CB_NECK_TO_WRIST]:"Cb neck to wrist",[Mp.CF_NECK_TO_WAIST]:"Cf neck to waist",[Mp.ELBOW]:"Elbow",[Mp.FOREARM]:"Forearm",[Mp.FRONT_CROTCH_LENGTH]:"Front crotch length",[Mp.HIGH_HIP_PLACEMENT_FROM_WAIST]:"High hip placement from waist",[Mp.HIGH_HIP]:"High hip",[Mp.HSP_TO_ACROSS_BACK]:"Hsp to across back",[Mp.HSP_TO_ACROSS_FRONT]:"Hsp to across front",[Mp.HSP_TO_BUST_POINT]:"Hsp to bust point",[Mp.HSP_TO_LOW_HIP_POSITION]:"Hsp to low hip position",[Mp.HSP_TO_WAIST_POSITION]:"Hsp to waist position",[Mp.INSEAM]:"Inseam",[Mp.KNEE]:"Knee",[Mp.LOW_HIP]:"Low hip",[Mp.LOW_HIP_PLACEMENT_FROM_WAIST]:"Low hip placement from waist",[Mp.MID_NECK]:"Mid neck",[Mp.NECK_AT_BASE]:"Neck at base",[Mp.SHOULDER_DROP]:"Shoulder drop",[Mp.SHOULDER_TO_SHOULDER]:"Shoulder to shoulder",[Mp.SIDE_WAIST_TO_FLOOR]:"Side waist to floor",[Mp.SIDE_WAIST_TO_KNEE]:"Side waist to knee",[Mp.THIGH]:"Thigh",[Mp.TOTAL_RISE_LENGTH]:"Total rise length",[Mp.UNDER_BUST]:"Under bust",[Mp.VERTICAL_TRUNK]:"Vertical trunk",[Mp.WAIST]:"Waist",[Mp.WRIST]:"Wrist"};var Fp;!function(t){t.BLOUSES="blouses",t.COATS="coats",t.DRESSES="dresses",t.JACKETS="jackets",t.PANTS="pants",t.PUFFERS_AND_PARKAS="puffer_and_parkas",t.SHORTS="shorts",t.SKIRTS="skirts",t.SWEATERS="sweaters",t.T_SHIRTS_AND_TANKS="t_shirts_and_tanks"}(Fp||(Fp={}));const zp={[Fp.BLOUSES]:[Mp.BUST,Mp.ACROSS_SHOULDER,Mp.WAIST,Mp.LOW_HIP,Mp.HIGH_HIP],[Fp.COATS]:[Mp.BUST,Mp.ACROSS_SHOULDER,Mp.WAIST,Mp.LOW_HIP,Mp.HIGH_HIP],[Fp.DRESSES]:[Mp.LOW_HIP,Mp.BUST,Mp.ACROSS_SHOULDER,Mp.WAIST],[Fp.JACKETS]:[Mp.BUST,Mp.ACROSS_SHOULDER,Mp.WAIST,Mp.LOW_HIP,Mp.HIGH_HIP],[Fp.PANTS]:[Mp.LOW_HIP,Mp.WAIST,Mp.THIGH,Mp.INSEAM],[Fp.PUFFERS_AND_PARKAS]:[Mp.BUST,Mp.ACROSS_SHOULDER,Mp.WAIST,Mp.LOW_HIP,Mp.HIGH_HIP],[Fp.SHORTS]:[Mp.LOW_HIP,Mp.WAIST,Mp.THIGH,Mp.INSEAM],[Fp.SKIRTS]:[Mp.LOW_HIP,Mp.WAIST],[Fp.SWEATERS]:[Mp.BUST,Mp.ACROSS_SHOULDER,Mp.WAIST,Mp.LOW_HIP,Mp.HIGH_HIP],[Fp.T_SHIRTS_AND_TANKS]:[Mp.BUST,Mp.ACROSS_SHOULDER,Mp.WAIST,Mp.LOW_HIP,Mp.HIGH_HIP]},Bp={activewear:"Active Wear",dresses:"Dresses",jackets_and_coats:"Jackets and Coats",jeans:"Jeans",jumpsuits_and_rompers:"Jumpsuits and Rompers",pants_and_shorts:"Pants and Shorts",skirts:"Skirts",suits_and_tailoring:"Suits and Tailoring",sweaters:"Sweaters",tops:"Tops"},Vp={a_line:"A Line",a_line_flared:"A Line Flared",blazers:"Blazers",bodycon:"Bodycon",bodysuits:"Bodysuits",boiler_suits:"Boiler Suits",bootcut:"Bootcut",cardigans:"Cardigans",cigarette:"Cigarette",corsets_and_bustiers:"Corsets and Bustiers",crewnecks:"Crewnecks",culottes:"Culottes",denim:"Denim",denim_jackets:"Denim Jackets",denim_shorts:"Denim Shorts",fit_and_flare:"Fit and Flare",flared:"Flared",hoodies_and_zipups:"Hoodies and Zipups",joggers:"Joggers",jumpsuits:"Jumpsuits",knit:"Knit",leggings:"Leggings",mom:"Mom",overalls:"Overalls",parkas:"Parkas",peacoats:"Peacoats",pencil:"Pencil",pleated:"Pleated",polos:"Polos",puffer_jackets:"Puffer Jackets",raincoats:"Raincoats",relaxed:"Relaxed",rompers:"Rompers",shackets:"Shackets",shirt:"Shirt",shirts_and_blouses:"Shirts and Blouses",skater:"Skater",skinny:"Skinny",slim:"Slim",slip:"Slip",sports_bras:"Sports Bras",straight:"Straight",suit_jackets:"Suit Jackets",suit_skirts:"Suit Skirts",suit_trousers:"Suit Trousers",suit_vests:"Suit Vests",sweatshirts:"Sweatshirts",t_shirts:"T-Shirts",tank_tops_and_camisoles:"Tank Tops and Camisoles",tapered:"Tapered",trench_coats:"Trench Coats",trousers:"Trousers",turtlenecks:"Turtleneck",unitards:"Unitards",v_necks:"V-Necks",wide_leg:"Wide Leg",wrap:"Wrap"},Hp={activewear:{leggings:Fp.PANTS,joggers:Fp.PANTS,sweatshirts:Fp.SWEATERS},dresses:{a_line:Fp.DRESSES,bodycon:Fp.DRESSES,fit_and_flare:Fp.DRESSES,knit:Fp.DRESSES,shirt:Fp.DRESSES,slip:Fp.DRESSES,straight:Fp.DRESSES,wrap:Fp.DRESSES},jackets_and_coats:{denim_jackets:Fp.JACKETS,parkas:Fp.PUFFERS_AND_PARKAS,peacoats:Fp.COATS,puffer_jackets:Fp.PUFFERS_AND_PARKAS,raincoats:Fp.COATS,rompers:Fp.COATS,shackets:Fp.JACKETS,trench_coats:Fp.COATS},jeans:{bootcut:Fp.PANTS,flared:Fp.PANTS,mom:Fp.PANTS,relaxed:Fp.PANTS,skinny:Fp.PANTS,slim:Fp.PANTS,straight:Fp.PANTS,tapered:Fp.PANTS,wide_leg:Fp.PANTS},jumpsuits_and_rompers:{boiler_suits:Fp.DRESSES,denim:Fp.DRESSES,jumpsuits:Fp.DRESSES,overalls:Fp.DRESSES,rompers:Fp.DRESSES,unitards:Fp.DRESSES},pants_and_shorts:{cigarette:Fp.PANTS,culottes:Fp.SHORTS,denim_shorts:Fp.SHORTS,flared:Fp.PANTS,joggers:Fp.PANTS,leggings:Fp.PANTS,skinny:Fp.PANTS,wide_leg:Fp.PANTS},skirts:{a_line_flared:Fp.SKIRTS,denim:Fp.SKIRTS,knit:Fp.SKIRTS,pencil:Fp.SKIRTS,pleated:Fp.SKIRTS,skater:Fp.SKIRTS,slip:Fp.SKIRTS,wrap:Fp.SKIRTS},suits_and_tailoring:{blazers:Fp.JACKETS,suit_jackets:Fp.JACKETS,suit_skirts:Fp.SKIRTS,suit_trousers:Fp.PANTS,suit_vests:Fp.SWEATERS,trousers:Fp.PANTS},sweaters:{cardigans:Fp.SWEATERS,crewnecks:Fp.SWEATERS,hoodies_and_zipups:Fp.SWEATERS,sweatshirts:Fp.SWEATERS,turtlenecks:Fp.SWEATERS,v_necks:Fp.SWEATERS},tops:{bodysuits:Fp.BLOUSES,corsets_and_bustiers:Fp.BLOUSES,polos:Fp.T_SHIRTS_AND_TANKS,shirts_and_blouses:Fp.BLOUSES,t_shirts:Fp.T_SHIRTS_AND_TANKS,tank_tops_and_camisoles:Fp.T_SHIRTS_AND_TANKS}};var jp;!function(t){t.TOO_TIGHT="too_tight",t.TIGHT="tight",t.SLIGHTLY_TIGHT="slightly_tight",t.PERFECT_FIT="perfect_fit",t.SLIGHTLY_LOOSE="slightly_loose",t.LOOSE="loose",t.OVERSIZED="oversized",t.TOO_SHORT="too_short",t.SHORT="short",t.SLIGHTLY_SHORT="slightly_short",t.SLIGHTLY_LONG="slightly_long",t.LONG="long",t.TOO_LONG="too_long"}(jp||(jp={}));const qp={[jp.TOO_TIGHT]:"Too Tight",[jp.TIGHT]:"Tight",[jp.SLIGHTLY_TIGHT]:"Slightly Tight",[jp.PERFECT_FIT]:"Perfect Fit",[jp.SLIGHTLY_LOOSE]:"Slightly Loose",[jp.LOOSE]:"Loose",[jp.OVERSIZED]:"Oversized",[jp.TOO_SHORT]:"Too Short",[jp.SHORT]:"Short",[jp.SLIGHTLY_SHORT]:"Slightly Short",[jp.SLIGHTLY_LONG]:"Slightly Long",[jp.LONG]:"Long",[jp.TOO_LONG]:"Too Long"};var $p;!function(t){t.NOT_CREATED="NOT_CREATED",t.CREATED="CREATED",t.PENDING="PENDING"}($p||($p={}));var Kp=Object.freeze({__proto__:null,get AvatarState(){return $p},get MeasurementLocation(){return Mp},MeasurementLocationName:Up,get Classification(){return Fp},ClassificationLocations:zp,CategoryNames:Bp,Categories:["activewear","dresses","jackets_and_coats","jeans","jumpsuits_and_rompers","pants_and_shorts","skirts","suits_and_tailoring","sweaters","tops"],SubcategoryNames:Vp,Taxonomy:Hp,get Fit(){return jp},FitNames:qp}),Gp="Back to sign in",Wp="Click here to download the app",Qp="Don't have an account?",Yp="Whoops! Looks like you don't have an avatar yet.",Jp="Email address",Xp="Please enter a valid email address.",Zp="Enter your email address, we will send you a link to reset your password.",tg="Forgot password?",eg="Have an account? Sign in",ng="Your avatar is loading...",rg="Unfortunately, that size is not available for try on.",ig="or",sg="Password",og="Please enter a valid password (at least 7 characters).",ag="Return to Catalog Page",cg="Return to Product Page",lg="Return to site",ug="Please return to The Fitting Room app to create your avatar.",hg="Scan the QR code to download the app",dg="Send",fg="Sign back in",pg="Sign in",gg="Something went wrong. Try again!",mg="You have successfully logged out!",yg="The Fitting Room",vg="Username or password is empty.",wg="Username or password is incorrect.",bg="End size uncertainty with",_g="Our technology captures your precise measurements, and considers things like fabric stretch and your individual physique for the perfect fit every time.";var Sg=[],Eg=[];function Ig(t,e){if(t&&"undefined"!=typeof document){var n,r=!0===e.prepend?"prepend":"append",i=!0===e.singleTag,s="string"==typeof e.container?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(i){var o=Sg.indexOf(s);-1===o&&(o=Sg.push(s)-1,Eg[o]={}),n=Eg[o]&&Eg[o][r]?Eg[o][r]:Eg[o][r]=a()}else n=a();65279===t.charCodeAt(0)&&(t=t.substring(1)),n.styleSheet?n.styleSheet.cssText+=t:n.appendChild(document.createTextNode(t))}function a(){var t=document.createElement("style");if(t.setAttribute("type","text/css"),e.attributes)for(var n=Object.keys(e.attributes),i=0;i<n.length;i++)t.setAttribute(n[i],e.attributes[n[i]]);var o="prepend"===r?"afterbegin":"beforeend";return s.insertAdjacentElement(o,t),t}}Ig(".tfr-c-white{color:var(--tfr-white)}.tfr-c-brand{color:var(--tfr-brand-color)}.tfr-c-brand-bg{background-color:var(--tfr-brand-color)}.tfr-c-black{color:var(--tfr-black)}.tfr-c-black-o5{color:rgba(0,0,0,.5)}.tfr-c-red{color:var(--tfr-red)}",{});Ig(".tfr-home-button-container{display:flex;flex-wrap:wrap;margin:20px}.tfr-home-button-container>button{border:0;cursor:pointer;height:60px;margin:20px;width:200px}.tfr-home-button-container>button:hover{background-color:#e6e6e6}[data-tfr=hidden]{display:none}.tfr-modal{background-color:rgba(0,0,0,.53);display:flex;height:100%;left:0;position:fixed;top:0;width:100%;z-index:10000}.tfr-modal-content{margin:auto;text-align:center;width:90%}.tfr-modal-content-flex{align-items:center;display:flex}.tfr-modal-content-container{background-color:#fff;border:1px solid #434343;border-radius:0;box-shadow:0 6px 6px #00000029;line-height:normal;margin:auto;max-height:100vh;max-width:709px;overflow:auto;width:100%}.tfr-close-container{text-align:end}.tfr-close{color:#aaa;font-size:28px;font-weight:700;height:50px;width:50px}.tfr-close:focus,.tfr-close:hover{color:#000;text-decoration:none}.tfr-cursor:hover{cursor:pointer}.tfr-underline{text-decoration:underline}.tfr-standard-button{border:0;border-radius:3px;color:#fff;height:43px;width:138px}.tfr-logo-container{align-items:center;display:flex}.tfr-modal-title-logo-container{align-items:center;display:flex;justify-content:center}.tfr-girl-clothes{display:inline-block;height:316px;width:253px}.tfr-t-a-center{text-align:center}.tfr-w-70-p{width:70%}.tfr-w-80-p{width:80%}.tfr-w-85-p{width:85%}.tfr-w-150{width:150px}.tfr-h-150{height:150px}.tfr-d-none{display:none}.tfr-d-block{display:block}.tfr-d-flex{display:flex}.tfr-how-it-works-item{align-items:center;display:flex;justify-items:center}.tfr-try-on-content{margin-left:60px}#tfr-tryon-image{max-width:30vw}.progress-bar{background-color:#fff;border:1px solid #bdbdbd;height:10px;margin:15px auto 0;width:55%}.progress-bar-fill{animation-duration:120s;animation-name:progress;background-color:#209da7;color:#fff;display:block;font-size:16px;height:100%;text-align:center;transition:width .6s linear}#tfr-video{height:100%;max-height:390px;max-width:390px}.tfr-logo-box{aspect-ratio:1;margin:auto;max-height:430px;max-width:430px;padding:20px}.tfr-flex,.tfr-logo-box{align-items:center;display:flex;justify-content:center}.tfr-qr-code{width:50%}.tfr-space-above{margin-top:10px}",{});Ig("input{border:none;box-shadow:none!important;width:100%}input:focus,select:focus,textarea:focus{border:none;outline:none}.tfr-fieldset{margin-left:auto;margin-right:auto;width:65%}.tfr-fieldset,.tfr-fieldset-inline{border-color:rgba(0,0,0,.5);border-radius:10px;border-width:1px;padding:5px 10px 10px;text-align:left}.tfr-fieldset-inline{margin-right:10px;width:250px}.tfr-fieldset-err{border-color:red}",{});Ig(".lds-ellipsis{display:inline-block;height:80px;position:relative;width:80px}.lds-ellipsis div{animation-timing-function:cubic-bezier(0,1,1,0);background:var(--tfr-brand-color);border-radius:50%;display:block;height:13px;position:absolute;top:33px;width:13px}.lds-ellipsis div:first-child{animation:lds-ellipsis1 .6s infinite;left:8px}.lds-ellipsis div:nth-child(2){animation:lds-ellipsis2 .6s infinite;left:8px}.lds-ellipsis div:nth-child(3){animation:lds-ellipsis2 .6s infinite;left:32px}.lds-ellipsis div:nth-child(4){animation:lds-ellipsis3 .6s infinite;left:56px}@keyframes lds-ellipsis1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0)}to{transform:translate(24px)}}",{});Ig("@media screen and (max-width:702px){.tfr-modal-title-logo-container{display:flex;flex-direction:column}}@media screen and (min-width:600px){.tfr-modal-content-container{border-radius:10px;height:auto}}@media screen and (max-width:599px){.tfr-mobile-hidden{display:none}.tfr-modal-content-container{min-height:100vh}.trf-logo-title{margin-bottom:10px}.tfr-modal-content-flex{height:calc(100vh - 76px)}}@media screen and (max-width:500px){.tfr-fieldset{width:90%}.tfr-how-it-works-item{flex-direction:column}.tfr-try-on-content{margin-left:0;margin-top:20px}}",{});Ig("#tfr-size-recommendations{background-color:var(--tfr-main-bg-color);border:var(--tfr-main-border-width) solid var(--tfr-main-border-color);border-radius:var(--tfr-main-border-radius);color:var(--tfr-dark);display:flex;font-family:var(--tfr-main-font);padding:var(--tfr-main-v-padding) var(--tfr-main-h-padding);width:var(--tfr-main-width)}#tfr-size-recommendations,#tfr-size-recommendations-container{align-items:center;flex-direction:column;justify-content:center}#tfr-size-recommendations-container{display:none;width:100%}#tfr-size-rec-login-svg{display:none}#tfr-size-rec-title{align-items:center;display:flex;font-family:var(--tfr-title-font);margin-bottom:8px}#tfr-size-rec-subtitle{font-family:var(--tfr-subtitle-font);margin-bottom:6px}#tfr-size-rec-subtitle,#tfr-size-rec-title{font-size:16px;font-weight:700}#tfr-size-rec-table{display:flex;flex-direction:column;font-size:12px;width:100%}.tfr-size-rec-table-row:first-of-type{border-top-width:2px}.tfr-size-rec-table-row{align-items:center;border-top:var(--tfr-main-border-width) solid var(--tfr-main-border-color);display:flex;font-family:var(--tfr-row-font);height:40px;justify-content:center}.tfr-size-rec-table-cell-left,.tfr-size-rec-table-cell-right{flex:1 1 0px}.tfr-size-rec-table-cell-left{font-weight:700;margin-right:70px;text-align:right}.tfr-size-rec-table-cell-right{margin-left:16px}.tfr-size-rec-table-cell-right.perfect{color:var(--tfr-brand-color)}#tfr-size-rec-size{display:inline-block}#tfr-size-rec-size>.tfr-size-rec-login-cta{font-weight:500;margin-left:10px}.tfr-size-rec-login-cta,.tfr-size-rec-table-cell-right{font-size:12px}.tfr-size-rec-login-cta{color:var(--tfr-muted);display:flex}#tfr-size-rec-action-login,#tfr-size-rec-action-logout{display:none;font-family:var(--tfr-cta-font)}#tfr-size-rec-action{cursor:pointer;font-size:16px;margin-top:14px;text-decoration:underline}#tfr-size-rec-select{background-color:var(--tfr-size-selector-bg-color);border-radius:8px;box-shadow:0 4px 4px 0 rgba(0,0,0,.3);color:var(--tfr-size-selector-text-color);display:none;font-size:14px;margin-bottom:20px;margin-top:10px}#tfr-size-rec-select,.tfr-size-rec-select-button{align-items:center;height:35px;justify-content:center}.tfr-size-rec-select-button{cursor:pointer;display:flex;transition:all .15s ease-in;width:80px}.tfr-size-rec-select-button:hover:not(.active){background-color:var(--tfr-size-selector-bg-color-hover);opacity:.7}.tfr-size-rec-select-button.active{background-color:var(--tfr-size-selector-bg-color-active);height:45px}.tfr-size-rec-select-button.active,.tfr-size-rec-select-button:first-of-type{border-bottom-left-radius:8px;border-top-left-radius:8px}.tfr-size-rec-select-button.active,.tfr-size-rec-select-button:last-of-type{border-bottom-right-radius:8px;border-top-right-radius:8px}.tfr-powered-by{align-items:center;display:flex;font-size:10px;margin-top:10px}.tfr-powered-by-logo{margin:0 4px}.tfr-powered-by-logo,.tfr-powered-by-logo img{height:24px}.tfr-powered-by-text-bold{font-weight:700}#tfr-size-recommendation-error{color:#8d0000;display:none}",{});Ig(".tfr-mt-10{margin-top:10px}.tfr-mt-20{margin-top:20px}.tfr-mt-15{margin-top:15px}.tfr-mt-30{margin-top:30px}.mt-40{margin-top:40px}.tfr-mb-40{margin-bottom:40px}.tfr-mb-20{margin-bottom:20px}.tfr-mr-10{margin-right:10px}.tfr-mr-15{margin-right:15px}.tfr-mt-50{margin-top:50px}.tfr-mt-60{margin-top:60px}.tfr-mb-60{margin-bottom:60px}.tfr-mr-20{margin-right:20px}.tfr-mt-15-p{margin-top:15%}.tfr-mb-13-p{margin-bottom:13%}.tfr-m-h-auto{margin-left:auto;margin-right:auto}.tfr-pt-20{padding-top:20px}.tfr-pb-50{padding-bottom:50px}.tfr-p-20{padding:20px}.tfr-pr-20{padding-right:20px}.tfr-pl-20{padding-left:20px}.tfr-pb-7-p{padding-bottom:7%}",{});Ig(".flag-container{bottom:0;left:0;padding:1px;right:0;right:auto;top:0}.flag-container:hover{cursor:pointer}.selected-flag{align-items:center;display:flex;height:100%;padding:0 6px 0 8px;position:relative;z-index:1}.flag.bd{background-position:-418px 0;height:12px}.arrow{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #555;height:0;margin-left:6px;width:0}.arrow-up{border-bottom:6px solid #555;border-top:none}.country-list{-webkit-overflow-scrolling:touch;background-color:#fff;border-radius:5px;box-shadow:0 8px 10px 1px rgba(57,64,78,.7),0 3px 14px 2px rgba(57,64,78,.7),0 5px 5px -3px rgba(57,64,78,.7);cursor:pointer;display:none;font-size:16px;line-height:18px;list-style:none;margin:0 0 0 -1px;max-height:500px;overflow:auto;padding:0;position:absolute;text-align:left;top:50%;transform:translateY(-50%);white-space:nowrap;width:100%;width:auto;z-index:2}.country-list.active{display:inline-block}.country{outline:0;padding:5px 26px 5px 15px}.country-list .divider{border-bottom:1px solid rgba(0,0,0,.12);margin-bottom:5px;padding-bottom:5px}.country.highlight{background-color:#c7cace}.flag-box{display:inline-block;width:20px}.country-name,.flag-box{margin-right:6px}.country-name,.dial-code,.flag-box{vertical-align:middle}",{});Ig(".tfr-title-font{font-family:Poppins,sans-serif}.tfr-body-font{font-family:Roboto,sans-serif}.tfr-light-24-300{font-size:24px;font-weight:300}.tfr-light-24-500{font-size:24px;font-weight:500}.tfr-light-22-300{font-size:22px;font-weight:300}.tfr-light-16-300{font-size:16px;font-weight:300}.tfr-medium-16-default{font-size:16px}.tfr-12-default{font-size:12px}.tfr-14-default{font-size:14px}.tfr-16-default{font-size:16px}",{});Ig(":root{--tfr-brand-color:#209da7;--tfr-black:#000;--tfr-red:red;--tfr-white:#fff;--tfr-muted:#a7a7a7;--tfr-dark:#121212;--tfr-grey:#878787;--tfr-light-grey:#f5f5f5;--tfr-main-border-color:hsla(0,0%,7%,.55);--tfr-main-border-radius:0;--tfr-main-border-width:1px;--tfr-main-bg-color:inherit;--tfr-main-width:440px;--tfr-main-v-padding:14px;--tfr-main-h-padding:20px;--tfr-main-font:inherit;--tfr-title-font:var(--tfr-main-font);--tfr-subtitle-font:var(--tfr-main-font);--tfr-row-font:var(--tfr-main-font);--tfr-cta-font:var(--tfr-main-font);--tfr-size-selector-text-color:var(--tfr-white);--tfr-size-selector-bg-color:var(--tfr-grey);--tfr-size-selector-bg-color-hover:var(--tfr-light-grey);--tfr-size-selector-bg-color-active:var(--tfr-dark)}",{});const Tg=t=>({Hook:()=>{const e=document.querySelector(".progress-bar-fill");!function(t,e){let n=0;const r=t/200;e.style.width=n+"%";const i=setInterval((()=>{n>=100?clearInterval(i):(n+=.5,e.style.width=n+"%")}),r)}(t.timeoutMS,e)},Unhook:()=>{},Body:()=>`\n <div tfr-element="true" class="tfr-title-font tfr-light-22-300 tfr-c-black tfr-mt-60" > ${ng} </div>\n <div class="progress-bar">\n <span class="progress-bar-fill"></span>\n </div>\n `}),kg=t=>{const e=document.getElementById(t);if(!e)throw new Error(`element with id ${t} not found`);let n;const r=()=>{n&&(n.Unhook(),a()),e.style.display="none"},i=t=>{"Escape"===t.key&&r()},s=t=>{const n=e.querySelector("#tfr-modal-background");t.target===n&&(console.debug("container close"),r())},o=()=>{e.querySelector("#tfr-close-container").addEventListener("click",r),document.addEventListener("keydown",i),document.addEventListener("click",s)},a=()=>{var n;const o=e.querySelector("#tfr-close-container");o?o.removeEventListener("click",r):(console.error("#tfr-close-container not found on unhook"),console.debug(null===(n=document.getElementById(t))||void 0===n?void 0:n.innerHTML)),document.removeEventListener("keydown",i),document.removeEventListener("click",s)};return{open:t=>{var r;n&&n.Unhook(),e.innerHTML=(r=t.Body(),`\n <div class="tfr-modal" id="tfr-modal-background">\n <div class="tfr-modal-content-container tfr-p-20">\n <div class="tfr-close-container">\n <span id="tfr-close-container" class="tfr-close tfr-cursor">×</span>\n </div>\n\n <div class="tfr-modal-content-flex">\n <div class="tfr-modal-content tfr-pt-20 tfr-pb-50">\n <div class="tfr-modal-title-logo-container">\n <div tfr-element="true" class="trf-logo-title tfr-title-font tfr-light-24-300 tfr-c-black tfr-mr-10">${bg}</div>\n <div tfr-element="true" class="tfr-logo-container">\n <div class="tfr-mr-15">\n <svg width="26" height="47" viewBox="0 0 68 124" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M0.911938 0L67.4819 17.09V106.49L0.911938 123.51V0Z" fill="#209DA7">\n </path>\n <path d="M52.8019 64.44C54.7791 64.44 56.3819 62.4387 56.3819 59.97C56.3819 57.5013 54.7791 55.5 52.8019 55.5C50.8248 55.5 49.2219 57.5013 49.2219 59.97C49.2219 62.4387 50.8248 64.44 52.8019 64.44Z" fill="white">\n </path>\n </svg>\n </div>\n <div tfr-element="true" class="tfr-title-font tfr-light-24-500 tfr-c-black tfr-mr-10">${yg}</div>\n </div>\n </div>\n ${r}\n </div>\n </div>\n </div>\n </div>\n `),o(),t.Hook(),e.style.display="block",n=t},close:r,Content:()=>n}},Cg=t=>{const e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),n=()=>{t.onSignInNav()},r=()=>{window.open("https://apps.apple.com/us/app/the-fitting-room-3d-body-scan/id1577417373","_blank")},i=()=>{window.open("https://play.google.com/store/apps/details?id=com.thefittingroom.marketplace","_blank")};return{Hook:()=>{document.getElementById("tfr-sign-in-nav").addEventListener("click",n),document.getElementById("tfr-app-store").addEventListener("click",r),document.getElementById("tfr-google-play").addEventListener("click",i)},Unhook:()=>{document.getElementById("tfr-sign-in-nav").removeEventListener("click",n),document.getElementById("tfr-app-store").removeEventListener("click",r),document.getElementById("tfr-google-play").removeEventListener("click",i)},Body:()=>`\n <div tfr-element="true">\n <div tfr-element="true" class="tfr-title-font tfr-light-16-300 tfr-mt-10">${_g}</div>\n </div>\n <div tfr-element="true" class="tfr-logo-box">\n <video id="tfr-video" controls autoplay loop>\n <source src="https://assets.dev.thefittingroom.xyz/videos/the-fitting-room.mp4" />\n </video>\n </div>\n\n <div tfr-element="true" class="tfr-title-font tfr-light-16-300 tfr-mt-10">${e?Wp:hg}</div>\n\n <div tfr-element="true" class="tfr-flex tfr-space-above">\n ${(()=>{const t="https://assets.dev.thefittingroom.xyz/images/";return e?`\n <img src="${t}apple.png" id="tfr-app-store" />\n <img src="${t}google.png" id="tfr-google-play" />\n `:`<img src="${t}qr.png" class="tfr-qr-code" />`})()}\n </div>\n\n <div id="tfr-sign-in-nav" tfr-element="true" class="tfr-body-font tfr-mt-20 tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor">${eg}</div>\n `}};class Ag{constructor(t,e,n,r){this.signIn=e,this.forgotPassword=n,this.submitTel=r,this.manager=kg(t)}close(){this.manager.close()}onSignOut(){this.manager.open((t=>{const e=()=>{t.onNavSignIn("")},n=()=>{t.onClose()};return{Hook:()=>{document.getElementById("tfr-sign-in").addEventListener("click",e),document.getElementById("tfr-close").addEventListener("click",n)},Unhook:()=>{document.getElementById("tfr-sign-in").removeEventListener("click",e),document.getElementById("tfr-close").removeEventListener("click",n)},Body:()=>`\n <div tfr-element="true" class="tfr-title-font tfr-light-22-300 tfr-mt-15-p tfr-mb-13-p">${mg}</div>\n <div class="tfr-t-a-center">\n <span id="tfr-sign-in" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor tfr-mr-20">${fg}</span>\n <span id="tfr-close" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor" >${lg}</span>\n </div>\n `}})({onNavSignIn:()=>this.toSignIn(),onClose:()=>this.close()}))}onNotCreated(){this.manager.open({Body:()=>`\n <div tfr-element="true" class="tfr-title-font tfr-light-22-300 tfr-c-black tfr-mt-60">${Yp}</div>\n <div tfr-element="true" class="tfr-title-font tfr-light-22-300 tfr-c-black tfr-mb-60">${ug}</div>\n `,Hook:()=>{},Unhook:()=>{}})}onLoading(){this.manager.open(Tg({timeoutMS:1e4}))}toScan(){this.manager.open(Cg({onSignInNav:()=>this.toSignIn(),onTelSubmit:t=>this.submitTel(t)}))}toSignIn(){this.manager.open((t=>{const{email:e}=t,n=e=>{e.preventDefault();const n=document.getElementById("email-input").value,r=document.getElementById("password-input").value;s(),t.onSignIn(n,r,o)},r=()=>{const e=document.getElementById("email-input").value;t.onNavForgotPassword(e)},i=()=>{t.onNavScanCode()},s=()=>{document.querySelectorAll(".tfr-fieldset-element").forEach((t=>{t.classList.remove("tfr-fieldset-err")})),document.querySelectorAll(".tfr-label-element").forEach((t=>{t.classList.remove("tfr-c-red")}));const t=document.querySelector("#tfr-form-error");t.classList.remove("tfr-d-block"),t.innerHTML=""},o=t=>{document.querySelectorAll(".tfr-fieldset-element").forEach((t=>{t.classList.add("tfr-fieldset-err")})),document.querySelectorAll(".tfr-label-element").forEach((t=>{t.classList.add("tfr-c-red")}));const e=document.querySelector("#tfr-form-error");e.innerHTML=t||"Something went wrong",e.classList.add("tfr-d-block")};return{Hook:()=>{document.getElementById("tfr-sign-in-form").addEventListener("submit",n),document.getElementById("tfr-sign-in").addEventListener("click",n),document.getElementById("tfr-forgot-password").addEventListener("click",r),document.getElementById("tfr-scan-code").addEventListener("click",i)},Unhook:()=>{document.getElementById("tfr-sign-in-form").removeEventListener("submit",n),document.getElementById("tfr-sign-in").removeEventListener("click",n),document.getElementById("tfr-forgot-password").removeEventListener("click",r),document.getElementById("tfr-scan-code").removeEventListener("click",i)},Body:()=>`\n <form id="tfr-sign-in-form">\n <div class="tfr-title-font tfr-light-22-300 tfr-mt-10">${pg}</div>\n\n <fieldset class="tfr-fieldset-element tfr-fieldset tfr-mt-20">\n <legend tfr-element="true" class="tfr-label-element tfr-body-font tfr-14-default tfr-c-black-o5">${Jp}</legend>\n <input tfr-element="true" type="email" id="email-input" value="${e||""}" />\n </fieldset>\n\n <fieldset class="tfr-fieldset-element tfr-fieldset tfr-mt-20">\n <legend tfr-element="true" class="tfr-label-element tfr-body-font tfr-14-default tfr-c-black-o5">${sg}</legend>\n <input tfr-element="true" type="password" id="password-input" />\n </fieldset>\n\n <div tfr-element="true" class="tfr-body-font tfr-12-default tfr-c-red tfr-mt-10 tfr-d-none" id="tfr-form-error"></div>\n\n <div class="tfr-mt-20">\n <span id="tfr-forgot-password" tfr-element="true" class="tfr-body-font tfr-14-default tfr-c-black-o5 tfr-underline tfr-cursor tfr-mr-15">${tg}</span>\n <span id="tfr-scan-code" tfr-element="true" class="tfr-body-font tfr-14-default tfr-c-black-o5 tfr-underline tfr-cursor">${Qp}</span>\n </div>\n\n <button id="tfr-sign-in" tfr-element="true" class="tfr-standard-button tfr-c-brand-bg tfr-c-whitetfr-title-font tfr-medium-16-default tfr-cursor tfr-mt-30" id="sign-in-button" type="submit">\n ${pg}\n </button>\n </form>\n `}})({onSignIn:this.signIn,onNavForgotPassword:()=>this.toForgotPassword(),onNavScanCode:()=>this.toScan()}))}toForgotPassword(){this.manager.open((t=>{const e=()=>{const e=document.getElementById("tfr-email").value;t.onNavSignIn(e)},n=()=>{const e=document.getElementById("tfr-email").value;t.onPasswordReset(e)};return{Hook:()=>{document.getElementById("tfr-send-password-reset").addEventListener("click",n),document.getElementById("tfr-back-to-signin").addEventListener("click",e)},Unhook:()=>{document.getElementById("tfr-send-password-reset").removeEventListener("click",n),document.getElementById("tfr-back-to-signin").removeEventListener("click",e)},Body:()=>`\n <div tfr-element="true" class="tfr-title-font tfr-light-16-300 tfr-mt-20 tfr-w-70-p tfr-m-h-auto">${Zp}</div>\n <fieldset class="tfr-fieldset-element tfr-fieldset tfr-mt-30">\n <legend tfr-element="true" class="tfr-label-element tfr-body-font tfr-14-default tfr-c-black-o5">${Jp}</legend>\n <input tfr-element="true" type="email" id="tfr-email" />\n </fieldset>\n <div tfr-element="true" class="tfr-body-font tfr-12-default tfr-c-red tfr-mt-10 tfr-d-none" id="error-msg"></div>\n <div id="tfr-back-to-signin" tfr-element="true" class="tfr-body-font tfr-12-default tfr-c-black-o5 tfr-underline tfr-cursor tfr-mt-30">${Gp}</div>\n <button id="tfr-send-password-reset" tfr-element="true" class="tfr-standard-button tfr-c-brand-bg tfr-c-whitetfr-title-font tfr-medium-16-default tfr-cursor tfr-mt-30">\n ${dg}\n </button>\n `}})({onNavSignIn:()=>this.toSignIn(),onPasswordReset:this.forgotPassword}))}toPasswordReset(){}onTryOn(t){this.manager.open((t=>{let e=()=>{};const r=()=>{t.onNavBack()},i=()=>{t.onClose()};return{Hook:()=>{const s=document.getElementById("tfr-tryon-image"),o=n("tfr-slider",((t,e)=>{console.debug("slider change",t,e),s.src=e}));if(Array.isArray(t.frames)&&t.frames.length>0){const n=o.Load(t.frames);if(n instanceof Error)return void console.error(n);e=n}document.getElementById("tfr-back").addEventListener("click",r),document.getElementById("tfr-close").addEventListener("click",i)},Unhook:()=>{e(),document.getElementById("tfr-back").removeEventListener("click",r),document.getElementById("tfr-close").removeEventListener("click",i)},Body:()=>`\n <div class="tfr-slider-wrapper">\n\t\t\t\t<img id="tfr-tryon-image" src="" />\n\t\t\t\t<input type="range" id="tfr-slider" />\n\t\t\t\t</div>\n\t\t\t\t<div class="tfr-t-a-center">\n <span id="tfr-back" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor tfr-mr-20">${ag}</span>\n <span id="tfr-close" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor" id="returnToSite">${cg}</span>\n </div>\n `}})({frames:t,onClose:()=>this.close(),onNavBack:()=>this.navBack()}))}onError(t){this.manager.open((t=>{const{error:e}=t,n=()=>{t.onNavBack()},r=()=>{t.onClose()};return{Hook:()=>{document.getElementById("tfr-back").addEventListener("click",n),document.getElementById("tfr-close").addEventListener("click",r)},Unhook:()=>{document.getElementById("tfr-back").removeEventListener("click",n),document.getElementById("tfr-close").removeEventListener("click",r)},Body:()=>(e||console.error("ErrorModal: No error provided"),`\n <div class="tfr-mt-15-p tfr-mb-13-p">\n <div tfr-element="true" class="tfr-title-font tfr-light-22-300 tfr-c-black">${e||gg}</div>\n </div>\n\n <div class="tfr-t-a-center">\n <span id="tfr-back" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor tfr-mr-20">${ag}</span>\n <span id="tfr-close" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor" id="returnToSite">${cg}</span>\n </div>\n `)}})({error:t,onClose:()=>this.close(),onNavBack:()=>this.navBack()}))}onSizeError(t,e){this.manager.open((t=>{const e=()=>{t.onNavBack()},n=()=>{t.onClose()};return{Hook:()=>{document.getElementById("tfr-back").addEventListener("click",e),document.getElementById("tfr-close").addEventListener("click",n)},Unhook:()=>{document.getElementById("tfr-back").removeEventListener("click",e),document.getElementById("tfr-close").removeEventListener("click",n)},Body:()=>{var e,n,r;return console.debug("rendering size error modal",t),`\n <div class="tfr-mt-15-p tfr-mb-13-p">\n <div tfr-element="true" class="tfr-title-font tfr-light-22-300 tfr-c-black">\n\t\t\t\t\t\t\t${rg} ${null===(e=t.sizes)||void 0===e?void 0:e.recommended} ${ig} ${null===(r=null===(n=t.sizes)||void 0===n?void 0:n.available)||void 0===r?void 0:r.join(" or ")}\n\t\t\t\t\t\t</div>\n </div>\n\n <div class="tfr-t-a-center">\n <span id="tfr-back" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor tfr-mr-20">${ag}</span>\n <span id="tfr-close" tfr-element="true" class="tfr-body-font tfr-16-default tfr-c-black-o5 tfr-underline tfr-cursor">${cg}</span>\n </div>\n `}}})({sizes:{recommended:t,available:e},onClose:()=>this.close(),onNavBack:()=>this.navBack()}))}navBack(){window.history.back()}}const Rg="https://assets.dev.thefittingroom.xyz/shop-sdk/assets/login-icon.svg";class Ng{constructor(t,e,n){this.onSignInClick=e,this.onSignOutClick=n,this._sku="",this.isLoggedIn=!1,this.redraw=null,this.init(t)}get sku(){return this._sku}setSku(t){this._sku=t}setIsLoggedIn(t){this.isLoggedIn=t,t?(this.tfrSizeRecActionLogin.style.display="none",this.tfrSizeRecActionLogout.style.display="block",this.tfrSizeRecTitle.style.display="block",this.tfrSizeRecSubtitle.style.display="block"):(this.tfrSizeRecActionLogin.style.display="block",this.tfrSizeRecActionLogout.style.display="none")}setLoading(t){t?(this.tfrSizeRecLoading.style.display="block",this.tfrSizeRecommendationsContainer.style.display="none"):(this.tfrSizeRecLoading.style.display="none",this.tfrSizeRecommendationsContainer.style.display="flex")}setGarmentLocations(t){if(!t||!t.length)return this.tfrSizeRecTitle.style.display="none",void(this.tfrSizeRecSubtitle.style.display="none");this.renderGarmentLocations(t),this.tfrSizeRecSelect.style.display="none"}setRecommendedSize({recommended:t,sizes:e}){this.renderSizeRec(t,e),this.tfrSizeRecSelect.style.display="flex"}setError(){this.tfrSizeRecTitle.style.display="none",this.tfrSizeRecSubtitle.style.display="none",this.isLoggedIn&&(this.tfrSizeRecommendationError.style.display="block",this.tfrSizeRecommendationError.innerHTML="No recommended size found.")}init(t){const e=document.getElementById(t);if(!e)throw new Error("Size rec main div not found");this.render(e),this.setElements(),this.bindEvents()}setElements(){this.tfrSizeRecTitle=document.getElementById("tfr-size-rec-title"),this.tfrSizeRecSubtitle=document.getElementById("tfr-size-rec-subtitle"),this.tfrSizeRecActionLogin=document.getElementById("tfr-size-rec-action-login"),this.tfrSizeRecActionLogout=document.getElementById("tfr-size-rec-action-logout"),this.tfrSizeRecTable=document.getElementById("tfr-size-rec-table"),this.tfrSizeRecommendationError=document.getElementById("tfr-size-recommendation-error"),this.tfrSizeRecSize=document.getElementById("tfr-size-rec-size"),this.tfrSizeRecSelect=document.getElementById("tfr-size-rec-select"),this.tfrSizeRecLoading=document.getElementById("tfr-size-rec-loading"),this.tfrSizeRecommendationsContainer=document.getElementById("tfr-size-recommendations-container")}bindEvents(){this.tfrSizeRecActionLogin.addEventListener("click",this.onSignInClick),this.tfrSizeRecActionLogout.addEventListener("click",this.onSignOutClick),this.tfrSizeRecSelect.addEventListener("click",this.onSizeRecSelectClick.bind(this))}onSizeRecSelectClick(t){const e=t.target;if(!e.classList.contains("tfr-size-rec-select-button"))return;t.preventDefault();const n=Number(e.getAttribute("data-index"));if(Number.isNaN(n))return;const r=document.querySelectorAll(".tfr-size-rec-select-button");r.forEach((t=>t.classList.remove("active"))),r.item(n).classList.add("active"),this.redraw(n)}renderSizeRec(t,e){this.tfrSizeRecSize.innerHTML=` ${t}`;const n=e.findIndex((({size:e})=>e===t));this.redraw=t=>this.renderSizeRecTable(e,t),this.redraw(n),this.renderSizeRecSelect(e,n)}renderSizeRecTable(t,e){const{locations:n}=t[e],r=n.sort((({location:t},{location:e})=>t<e?-1:1)).map((({location:t,fit:e,isPerfect:n})=>this.renderSizeRecTableRow(t,e,n))).join("");this.tfrSizeRecTable.innerHTML=r}renderSizeRecSelect(t,e){const n=t.map((({size:t})=>t)).map(((t,n)=>`<div class="tfr-size-rec-select-button ${n===e?"active":""}" data-index="${n}">${t}</div>`)).join("");this.tfrSizeRecSelect.innerHTML=n}renderSizeRecTableRow(t,e,n=!1){return`<div class="tfr-size-rec-table-row">\n <div class="tfr-size-rec-table-cell-left">${t}</div>\n <div class="tfr-size-rec-table-cell-right ${n?"perfect":""}">\n ${e}\n </div>\n </div>`}renderLoginCta(){return`<div class="tfr-size-rec-login-cta"><img src="${Rg}" /> Login/Sign In to view</div>`}renderGarmentLocations(t){const e=t.sort().map((t=>this.renderSizeRecTableRow(t,this.renderLoginCta()))).join("");this.tfrSizeRecTable.innerHTML=e,this.tfrSizeRecSize.innerHTML=this.renderLoginCta()}render(t){const e=`<div id="tfr-size-recommendations">\n <div id="tfr-size-rec-loading">\n <div class="lds-ellipsis">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n </div>\n </div>\n <div id="tfr-size-recommendations-container">\n <img id="tfr-size-rec-login-svg" src="${Rg}" />\n <div id="tfr-size-rec-title">\n Recommended Size:\n <div id="tfr-size-rec-size">\n <div class="tfr-size-rec-login-cta">\n <img src="${Rg}" /> Login/Sign In to view\n </div>\n </div>\n </div>\n\n <div id="tfr-size-rec-select"></div>\n\n <div id="tfr-size-rec-subtitle">How it fits</div>\n\n <div id="tfr-size-rec-table"></div>\n\n <div id="tfr-size-rec-action">\n <div id="tfr-size-rec-action-login">Login to see your recommended size</div>\n <div id="tfr-size-rec-action-logout">Sign out of the Fitting Room</div>\n </div>\n\n <div class="tfr-powered-by">\n <div>Powered by</div>\n <div class="tfr-powered-by-logo"><img src="https://assets.dev.thefittingroom.xyz/shop-sdk/assets/tfr-door-brand.svg" /></div>\n <div class="tfr-powered-by-text-bold">The Fitting Room</div>\n </div>\n </div>\n </div>\n <div id="tfr-size-recommendation-error"></div>`;t.innerHTML=e}}class Lg{constructor(t,e,n,r,i){this.tfrShop=n,this.onSignInClick=r,this.onSignOutClick=i,this.perfectFits=[Kp.Fit.PERFECT_FIT,Kp.Fit.SLIGHTLY_LOOSE,Kp.Fit.SLIGHTLY_TIGHT],this.setCssVariables(e),this.sizeRecComponent=new Ng(t,this.onSignInClick,this.onSignOutClick)}get sku(){return this.sizeRecComponent.sku}setSku(t){this.sizeRecComponent.setSku(t)}setIsLoggedIn(t){this.sizeRecComponent.setIsLoggedIn(t)}async setGarmentLocations(t=[]){this.sizeRecComponent.setLoading(!0);const e=await this.getGarmentLocations(t);console.debug("locations",e),console.debug("filledLocations",t),this.sizeRecComponent.setGarmentLocations(e||[]),this.sizeRecComponent.setLoading(!1)}async setRecommendedSize(){this.sizeRecComponent.setLoading(!0);const t=await this.getRecommenedSize();if(!t)return console.error("No sizes found for sku"),this.sizeRecComponent.setLoading(!1),void this.sizeRecComponent.setError();this.sizeRecComponent.setRecommendedSize(t),this.sizeRecComponent.setLoading(!1)}async getGarmentLocations(t){try{return await this.tfrShop.getMeasurementLocationsFromSku(this.sku,t)}catch(e){try{const e=await this.tfrShop.getStyleByBrandStyleId(this.sku);return await this.tfrShop.getMeasurementLocationsFromBrandStyleId(e.id,t)}catch(t){return console.error(t),this.sizeRecComponent.setError(),null}}}async getRecommenedSize(){try{const t=await this.tfrShop.getColorwaySizeAssetFromSku(this.sku);return await this.getRecommendedSizes(String(t.style_id))}catch(t){try{const t=await this.tfrShop.getStyleByBrandStyleId(this.sku);return await this.getRecommendedSizes(String(t.id))}catch(t){return console.error(t),this.sizeRecComponent.setError(),null}}}async getRecommendedSizes(t){const e=await this.tfrShop.getRecommendedSizes(t);return e?{recommended:e.recommended_size.label,sizes:e.fits.map((t=>({size:e.available_sizes.find((e=>e.id===t.size_id)).label,locations:t.measurement_location_fits.map((t=>({fit:Kp.FitNames[t.fit],isPerfect:this.perfectFits.includes(t.fit),location:Kp.MeasurementLocationName[t.measurement_location]})))})))}:null}setCssVariables(t){const e=document.querySelector(":root");t.brandColor&&e.style.setProperty("--tfr-brand-color",t.brandColor),t.black&&e.style.setProperty("--tfr-black",t.black),t.red&&e.style.setProperty("--tfr-red",t.red),t.white&&e.style.setProperty("--tfr-white",t.white),t.muted&&e.style.setProperty("--tfr-muted",t.muted),t.dark&&e.style.setProperty("--tfr-dark",t.dark),t.grey&&e.style.setProperty("--tfr-grey",t.grey),t.lightGrey&&e.style.setProperty("--tfr-light-grey",t.lightGrey),t.mainBorderColor&&e.style.setProperty("--tfr-main-border-color",t.mainBorderColor),t.mainBorderRadius&&e.style.setProperty("--tfr-main-border-radius",t.mainBorderRadius),t.mainBorderWidth&&e.style.setProperty("--tfr-main-border-width",t.mainBorderWidth),t.mainBgColor&&e.style.setProperty("--tfr-main-bg-color",t.mainBgColor),t.mainWidth&&e.style.setProperty("--tfr-main-width",t.mainWidth),t.mainVPadding&&e.style.setProperty("--tfr-main-v-padding",t.mainVPadding),t.mainHPadding&&e.style.setProperty("--tfr-main-h-padding",t.mainHPadding),t.mainFont&&e.style.setProperty("--tfr-main-font",t.mainFont),t.titleFont&&e.style.setProperty("--tfr-title-font",t.titleFont),t.subtitleFont&&e.style.setProperty("--tfr-subtitle-font",t.subtitleFont),t.rowFont&&e.style.setProperty("--tfr-row-font",t.rowFont),t.ctaFont&&e.style.setProperty("--tfr-cta-font",t.ctaFont),t.sizeSelectorTextColor&&e.style.setProperty("--tfr-size-selector-text-color",t.sizeSelectorTextColor),t.sizeSelectorBgColor&&e.style.setProperty("--tfr-size-selector-bg-color",t.sizeSelectorBgColor),t.sizeSelectorBgColorHover&&e.style.setProperty("--tfr-size-selector-bg-color-hover",t.sizeSelectorBgColorHover),t.sizeSelectorBgColorActive&&e.style.setProperty("--tfr-size-selector-bg-color-active",t.sizeSelectorBgColorActive)}}var Og;!function(t){t.NOT_CREATED="NOT_CREATED",t.CREATED="CREATED",t.PENDING="PENDING"}(Og||(Og={}));class Dg{constructor(t,e,n,r={},i,s){this.shopId=t,this.hooks=r,this.isLoggedIn=!1,this.unsub=null;const o=s||("undefined"!=typeof process?process.env.NODE_ENV:"dev");this.tfrModal=new Ag(e,this.signIn.bind(this),this.forgotPassword.bind(this),this.submitTel.bind(this)),this.tfrShop=((t,e="dev")=>("dev"!==e&&"development"!==e||console.warn("TfrShop is in development mode"),Ph.getInstance().setEnv(e),new Pp(t,new Op)))(Number(this.shopId),o),this.tfrSizeRec=new Lg(n,i,this.tfrShop,this.onSignInClick.bind(this),this.signOut.bind(this))}get shop(){return this.tfrShop}get sku(){return this.tfrSizeRec.sku}async checkIfPublished(t){const e=await this.getStyle(t);return Boolean(null==e?void 0:e.is_published)}setSku(t){this.tfrSizeRec.setSku(t),this.isLoggedIn?this.tfrSizeRec.setRecommendedSize():this.setGarmentLocations()}async onInit(){var t,e;return this.isLoggedIn=await this.tfrShop.onInit(),this.tfrSizeRec.setIsLoggedIn(this.isLoggedIn),this.isLoggedIn?((null===(t=this.hooks)||void 0===t?void 0:t.onLogin)&&this.hooks.onLogin(),this.subscribeToProfileChanges()):((null===(e=this.hooks)||void 0===e?void 0:e.onLogout)&&this.hooks.onLogout(),this.unsubscribeFromProfileChanges()),this.isLoggedIn}close(){this.tfrModal.close()}async signOut(){var t;await this.tfrShop.user.logout(),(null===(t=this.hooks)||void 0===t?void 0:t.onLogout)&&this.hooks.onLogout(),this.isLoggedIn=!1,this.tfrSizeRec.setIsLoggedIn(!1),this.setGarmentLocations(),this.unsubscribeFromProfileChanges()}async signIn(t,e,n){var r;if(0==t.length||0==e.length)return n(vg);if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/.test(t))return n(Xp);if(!(t=>!!t.match(/^.{7,}$/))(e))return n(og);try{await this.tfrShop.user.login(t,e),(null===(r=this.hooks)||void 0===r?void 0:r.onLogin)&&this.hooks.onLogin(),this.tfrModal.close(),this.isLoggedIn=!0,this.tfrSizeRec.setIsLoggedIn(!0),this.tfrSizeRec.setRecommendedSize(),this.subscribeToProfileChanges()}catch(t){return n(wg)}}setBrandUserId(t){this.tfrShop.user.setBrandUserId(t)}async submitTel(t){try{await this.tfrShop.submitTelephoneNumber(t),this.tfrModal.toSignIn()}catch(t){this.tfrModal.onError(gg)}}async forgotPassword(t){await this.tfrShop.user.sendPasswordResetEmail(t),this.tfrModal.toSignIn()}async passwordReset(t,e){await this.tfrShop.user.confirmPasswordReset(t,e),this.tfrModal.toPasswordReset()}async getMeasurementLocationsFromSku(t){return this.tfrShop.getMeasurementLocationsFromSku(t)}onSignInClick(){this.tfrModal.toScan()}onUserProfileChange(t){var e,n,r,i;switch(t.avatar_status){case Og.NOT_CREATED:(null===(e=this.hooks)||void 0===e?void 0:e.onError)&&this.hooks.onError(Yp),this.tfrModal.onNotCreated();break;case Og.PENDING:(null===(n=this.hooks)||void 0===n?void 0:n.onLoading)&&this.hooks.onLoading();break;case Og.CREATED:(null===(r=this.hooks)||void 0===r?void 0:r.onLoadingComplete)&&this.hooks.onLoadingComplete();break;default:(null===(i=this.hooks)||void 0===i?void 0:i.onError)&&this.hooks.onError(gg),this.tfrModal.onError(gg)}}subscribeToProfileChanges(){this.unsub||(this.unsub=this.tfrShop.user.watchUserProfileForChanges((t=>this.onUserProfileChange(t))))}unsubscribeFromProfileChanges(){this.unsub&&(this.unsub(),this.unsub=null)}async setGarmentLocations(){var t,e;const n=await this.getStyle(this.sku),r=(null===(e=null===(t=null==n?void 0:n.sizes)||void 0===t?void 0:t[0])||void 0===e?void 0:e.garment_measurements.map((t=>t.garment_measurement_location)))||[];this.tfrSizeRec.setGarmentLocations(r)}async getStyle(t){try{const e=await this.tfrShop.getColorwaySizeAssetFromSku(t);return await this.tfrShop.getStyle(e.style_id)}catch(e){try{return await this.tfrShop.getStyleByBrandStyleId(t)}catch(t){return null}}}}const xg=async(t,e,n,r={},i={},s="dev")=>{const o=new Dg(t,e,n,r,i,s);return await o.onInit(),o};export{n as InitImageSlider,xg as initFittingRoom};
|