@laboratoria/sdk-js 7.6.0-beta.2 → 7.6.0-beta.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -9263,16 +9263,27 @@ const Bo = /* @__PURE__ */ jo(Fo), _t = (n, e) => async (t, r = {}) => {
9263
9263
  enum: [
9264
9264
  "draft",
9265
9265
  "published",
9266
- "cancelled"
9266
+ "cancelled",
9267
+ "archived"
9267
9268
  ]
9268
9269
  },
9269
9270
  title: {
9270
9271
  type: "string"
9271
9272
  },
9272
- date: {
9273
+ start: {
9274
+ type: "string",
9275
+ format: "date-time"
9276
+ },
9277
+ end: {
9273
9278
  type: "string",
9274
9279
  format: "date-time"
9275
9280
  },
9281
+ timezone: {
9282
+ type: [
9283
+ "string",
9284
+ "null"
9285
+ ]
9286
+ },
9276
9287
  lang: {
9277
9288
  type: "string",
9278
9289
  enum: [
@@ -9296,12 +9307,6 @@ const Bo = /* @__PURE__ */ jo(Fo), _t = (n, e) => async (t, r = {}) => {
9296
9307
  maxTickets: {
9297
9308
  type: "integer"
9298
9309
  },
9299
- duration: {
9300
- type: [
9301
- "string",
9302
- "null"
9303
- ]
9304
- },
9305
9310
  isOnline: {
9306
9311
  type: "boolean"
9307
9312
  },
@@ -9327,6 +9332,12 @@ const Bo = /* @__PURE__ */ jo(Fo), _t = (n, e) => async (t, r = {}) => {
9327
9332
  "null"
9328
9333
  ]
9329
9334
  },
9335
+ videoUrl: {
9336
+ type: [
9337
+ "string",
9338
+ "null"
9339
+ ]
9340
+ },
9330
9341
  rsvps: {
9331
9342
  type: "array",
9332
9343
  items: {
@@ -9355,6 +9366,15 @@ const Bo = /* @__PURE__ */ jo(Fo), _t = (n, e) => async (t, r = {}) => {
9355
9366
  "null"
9356
9367
  ]
9357
9368
  },
9369
+ status: {
9370
+ type: "string",
9371
+ enum: [
9372
+ "yes",
9373
+ "no",
9374
+ "waitlist",
9375
+ "maybe"
9376
+ ]
9377
+ },
9358
9378
  event: {
9359
9379
  $ref: "#/definitions/Event"
9360
9380
  },
@@ -9801,20 +9821,22 @@ const Bo = /* @__PURE__ */ jo(Fo), _t = (n, e) => async (t, r = {}) => {
9801
9821
  inputProps: [
9802
9822
  "status",
9803
9823
  "title",
9804
- "date",
9824
+ "start",
9825
+ "end",
9826
+ "timezone",
9805
9827
  "lang",
9806
9828
  "cover",
9807
9829
  "shortDescription",
9808
9830
  "description",
9809
9831
  "maxTickets",
9810
- "duration",
9811
9832
  "isOnline",
9812
9833
  "venue",
9813
9834
  "onlineVenue",
9814
- "zoomMeetingId"
9835
+ "zoomMeetingId",
9836
+ "videoUrl"
9815
9837
  ],
9816
9838
  searchProps: ["title"],
9817
- defaultProps: ["title", "date", "lang", "cover", "description"],
9839
+ defaultProps: ["title", "date", "lang", "cover", "shortDescription"],
9818
9840
  properties: {
9819
9841
  description: {
9820
9842
  inputType: "textarea"
@@ -103,7 +103,7 @@
103
103
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104
104
  * See the License for the specific language governing permissions and
105
105
  * limitations under the License.
106
- */const or="FirebaseError";class J extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=or,Object.setPrototypeOf(this,J.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ge.prototype.create)}}class ge{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?ar(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new J(i,a,r)}}function ar(n,e){return n.replace(cr,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const cr=/\{\$([^}]+)}/g;function lr(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function Re(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const s=n[i],o=e[i];if(St(s)&&St(o)){if(!Re(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function St(n){return n!==null&&typeof n=="object"}/**
106
+ */const or="FirebaseError";class J extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=or,Object.setPrototypeOf(this,J.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,me.prototype.create)}}class me{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?ar(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new J(i,a,r)}}function ar(n,e){return n.replace(cr,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const cr=/\{\$([^}]+)}/g;function lr(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function Re(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const s=n[i],o=e[i];if(St(s)&&St(o)){if(!Re(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function St(n){return n!==null&&typeof n=="object"}/**
107
107
  * @license
108
108
  * Copyright 2017 Google LLC
109
109
  *
@@ -118,7 +118,7 @@
118
118
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119
119
  * See the License for the specific language governing permissions and
120
120
  * limitations under the License.
121
- */function me(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function ye(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function _e(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function dr(n,e){const t=new ur(n,e);return t.subscribe.bind(t)}class ur{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");hr(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=qe),i.error===void 0&&(i.error=qe),i.complete===void 0&&(i.complete=qe);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function hr(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function qe(){}/**
121
+ */function ge(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function ye(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function _e(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function dr(n,e){const t=new ur(n,e);return t.subscribe.bind(t)}class ur{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");hr(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=qe),i.error===void 0&&(i.error=qe),i.complete===void 0&&(i.complete=qe);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function hr(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function qe(){}/**
122
122
  * @license
123
123
  * Copyright 2021 Google LLC
124
124
  *
@@ -163,7 +163,7 @@
163
163
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
164
164
  * See the License for the specific language governing permissions and
165
165
  * limitations under the License.
166
- */class fr{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new Zn;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),i=(t=e==null?void 0:e.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(gr(e))try{this.getOrInitializeService({instanceIdentifier:ne})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=ne){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=ne){return this.instances.has(e)}getOptions(e=ne){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,t){var r;const i=this.normalizeInstanceIdentifier(t),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:pr(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=ne){return this.component?this.component.multipleInstances?e:ne:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function pr(n){return n===ne?void 0:n}function gr(n){return n.instantiationMode==="EAGER"}/**
166
+ */class fr{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new Zn;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),i=(t=e==null?void 0:e.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(mr(e))try{this.getOrInitializeService({instanceIdentifier:ne})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=ne){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=ne){return this.instances.has(e)}getOptions(e=ne){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,t){var r;const i=this.normalizeInstanceIdentifier(t),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:pr(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=ne){return this.component?this.component.multipleInstances?e:ne:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function pr(n){return n===ne?void 0:n}function mr(n){return n.instantiationMode==="EAGER"}/**
167
167
  * @license
168
168
  * Copyright 2019 Google LLC
169
169
  *
@@ -178,7 +178,7 @@
178
178
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
179
179
  * See the License for the specific language governing permissions and
180
180
  * limitations under the License.
181
- */class mr{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new fr(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
181
+ */class gr{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new fr(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
182
182
  * @license
183
183
  * Copyright 2017 Google LLC
184
184
  *
@@ -268,7 +268,7 @@
268
268
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
269
269
  * See the License for the specific language governing permissions and
270
270
  * limitations under the License.
271
- */const ai={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","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","server-app-deleted":"Firebase Server App has been 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}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},G=new ge("app","Firebase",ai);/**
271
+ */const ai={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","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","server-app-deleted":"Firebase Server App has been 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}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},G=new me("app","Firebase",ai);/**
272
272
  * @license
273
273
  * Copyright 2019 Google LLC
274
274
  *
@@ -298,7 +298,7 @@
298
298
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
299
299
  * See the License for the specific language governing permissions and
300
300
  * limitations under the License.
301
- */const be=ii;function Mt(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:tt,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw G.create("bad-app-name",{appName:String(i)});if(t||(t=Tt()),!t)throw G.create("no-options");const s=Pe.get(i);if(s){if(Re(t,s.options)&&Re(r,s.config))return s;throw G.create("duplicate-app",{appName:i})}const o=new mr(i);for(const c of nt.values())o.addComponent(c);const a=new ci(t,r,o);return Pe.set(i,a),a}function li(n=tt){const e=Pe.get(n);if(!e&&n===tt&&Tt())return Mt();if(!e)throw G.create("no-app",{appName:n});return e}function ce(n,e,t){var r;let i=(r=si[n])!==null&&r!==void 0?r:n;t&&(i+=`-${t}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const a=[`Unable to register library "${i}" with version "${e}":`];s&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),re.warn(a.join(" "));return}ve(new ae(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
301
+ */const be=ii;function Mt(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:tt,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw G.create("bad-app-name",{appName:String(i)});if(t||(t=Tt()),!t)throw G.create("no-options");const s=Pe.get(i);if(s){if(Re(t,s.options)&&Re(r,s.config))return s;throw G.create("duplicate-app",{appName:i})}const o=new gr(i);for(const c of nt.values())o.addComponent(c);const a=new ci(t,r,o);return Pe.set(i,a),a}function li(n=tt){const e=Pe.get(n);if(!e&&n===tt&&Tt())return Mt();if(!e)throw G.create("no-app",{appName:n});return e}function ce(n,e,t){var r;let i=(r=si[n])!==null&&r!==void 0?r:n;t&&(i+=`-${t}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const a=[`Unable to register library "${i}" with version "${e}":`];s&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),re.warn(a.join(" "));return}ve(new ae(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
302
302
  * @license
303
303
  * Copyright 2021 Google LLC
304
304
  *
@@ -328,7 +328,7 @@
328
328
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
329
329
  * See the License for the specific language governing permissions and
330
330
  * limitations under the License.
331
- */const fi=1024,pi=30*24*60*60*1e3;class gi{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new yi(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,t;const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=Bt();if(!(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s)))return this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{const a=new Date(o.date).valueOf();return Date.now()-a<=pi}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var e;if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=Bt(),{heartbeatsToSend:r,unsentEntries:i}=mi(this._heartbeatsCache.heartbeats),s=wt(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}}function Bt(){return new Date().toISOString().substring(0,10)}function mi(n,e=fi){const t=[];let r=n.slice();for(const i of n){const s=t.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),Vt(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),Vt(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class yi{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return ir()?sr().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await hi(this.app);return t!=null&&t.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return jt(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return jt(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function Vt(n){return wt(JSON.stringify({version:2,heartbeats:n})).length}/**
331
+ */const fi=1024,pi=30*24*60*60*1e3;class mi{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new yi(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,t;const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=Bt();if(!(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s)))return this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{const a=new Date(o.date).valueOf();return Date.now()-a<=pi}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var e;if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=Bt(),{heartbeatsToSend:r,unsentEntries:i}=gi(this._heartbeatsCache.heartbeats),s=wt(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}}function Bt(){return new Date().toISOString().substring(0,10)}function gi(n,e=fi){const t=[];let r=n.slice();for(const i of n){const s=t.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),Vt(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),Vt(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class yi{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return ir()?sr().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await hi(this.app);return t!=null&&t.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return jt(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const i=await this.read();return jt(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function Vt(n){return wt(JSON.stringify({version:2,heartbeats:n})).length}/**
332
332
  * @license
333
333
  * Copyright 2019 Google LLC
334
334
  *
@@ -343,7 +343,7 @@
343
343
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
344
344
  * See the License for the specific language governing permissions and
345
345
  * limitations under the License.
346
- */function _i(n){ve(new ae("platform-logger",e=>new Nr(e),"PRIVATE")),ve(new ae("heartbeat",e=>new gi(e),"PRIVATE")),ce(et,Dt,n),ce(et,Dt,"esm2017"),ce("fire-js","")}_i("");var vi="firebase",bi="10.11.1";/**
346
+ */function _i(n){ve(new ae("platform-logger",e=>new Nr(e),"PRIVATE")),ve(new ae("heartbeat",e=>new mi(e),"PRIVATE")),ce(et,Dt,n),ce(et,Dt,"esm2017"),ce("fire-js","")}_i("");var vi="firebase",bi="10.11.1";/**
347
347
  * @license
348
348
  * Copyright 2020 Google LLC
349
349
  *
@@ -358,7 +358,7 @@
358
358
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
359
359
  * See the License for the specific language governing permissions and
360
360
  * limitations under the License.
361
- */ce(vi,bi,"app");function it(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}typeof SuppressedError=="function"&&SuppressedError;function Ht(){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 Ii=Ht,xt=new ge("auth","Firebase",Ht());/**
361
+ */ce(vi,bi,"app");function it(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}typeof SuppressedError=="function"&&SuppressedError;function Ht(){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 Ii=Ht,xt=new me("auth","Firebase",Ht());/**
362
362
  * @license
363
363
  * Copyright 2020 Google LLC
364
364
  *
@@ -388,7 +388,7 @@
388
388
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
389
389
  * See the License for the specific language governing permissions and
390
390
  * limitations under the License.
391
- */function D(n,...e){throw st(n,...e)}function M(n,...e){return st(n,...e)}function Wt(n,e,t){const r=Object.assign(Object.assign({},Ii()),{[e]:t});return new ge("auth","Firebase",r).create(e,{appName:n.name})}function K(n){return Wt(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function st(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return xt.create(n,...e)}function y(n,e,...t){if(!n)throw st(e,...t)}function B(n){const e="INTERNAL ASSERTION FAILED: "+n;throw ke(e),new Error(e)}function V(n,e){n||B(e)}/**
391
+ */function D(n,...e){throw st(n,...e)}function M(n,...e){return st(n,...e)}function Wt(n,e,t){const r=Object.assign(Object.assign({},Ii()),{[e]:t});return new me("auth","Firebase",r).create(e,{appName:n.name})}function K(n){return Wt(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function st(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return xt.create(n,...e)}function y(n,e,...t){if(!n)throw st(e,...t)}function B(n){const e="INTERNAL ASSERTION FAILED: "+n;throw ke(e),new Error(e)}function V(n,e){n||B(e)}/**
392
392
  * @license
393
393
  * Copyright 2020 Google LLC
394
394
  *
@@ -493,7 +493,7 @@
493
493
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
494
494
  * See the License for the specific language governing permissions and
495
495
  * limitations under the License.
496
- */const Ci=new we(3e4,6e4);function Y(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function H(n,e,t,r,i={}){return qt(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=me(Object.assign({key:n.config.apiKey},o)).slice(1),c=await n._getAdditionalHeaders();return c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode),Jt.fetch()(Gt(n,n.config.apiHost,t,a),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},s))})}async function qt(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},Si),e);try{const i=new Pi(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw De(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[c,u]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw De(n,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw De(n,"email-already-in-use",o);if(c==="USER_DISABLED")throw De(n,"user-disabled",o);const _=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw Wt(n,_,u);D(n,_)}}catch(i){if(i instanceof J)throw i;D(n,"network-request-failed",{message:String(i)})}}async function Ne(n,e,t,r,i={}){const s=await H(n,e,t,r,i);return"mfaPendingCredential"in s&&D(n,"multi-factor-auth-required",{_serverResponse:s}),s}function Gt(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?at(n.config,i):`${n.config.apiScheme}://${i}`}function Ri(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Pi{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(M(this.auth,"network-request-failed")),Ci.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function De(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=M(n,e,r);return i.customData._tokenResponse=t,i}function Kt(n){return n!==void 0&&n.enterprise!==void 0}class Oi{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return Ri(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function ki(n,e){return H(n,"GET","/v2/recaptchaConfig",Y(n,e))}/**
496
+ */const Ci=new we(3e4,6e4);function Y(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function H(n,e,t,r,i={}){return qt(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=ge(Object.assign({key:n.config.apiKey},o)).slice(1),c=await n._getAdditionalHeaders();return c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode),Jt.fetch()(Gt(n,n.config.apiHost,t,a),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},s))})}async function qt(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},Si),e);try{const i=new Pi(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw De(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[c,u]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw De(n,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw De(n,"email-already-in-use",o);if(c==="USER_DISABLED")throw De(n,"user-disabled",o);const _=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw Wt(n,_,u);D(n,_)}}catch(i){if(i instanceof J)throw i;D(n,"network-request-failed",{message:String(i)})}}async function Ne(n,e,t,r,i={}){const s=await H(n,e,t,r,i);return"mfaPendingCredential"in s&&D(n,"multi-factor-auth-required",{_serverResponse:s}),s}function Gt(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?at(n.config,i):`${n.config.apiScheme}://${i}`}function Ri(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Pi{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(M(this.auth,"network-request-failed")),Ci.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function De(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=M(n,e,r);return i.customData._tokenResponse=t,i}function Kt(n){return n!==void 0&&n.enterprise!==void 0}class Oi{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return Ri(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function ki(n,e){return H(n,"GET","/v2/recaptchaConfig",Y(n,e))}/**
497
497
  * @license
498
498
  * Copyright 2020 Google LLC
499
499
  *
@@ -598,7 +598,7 @@
598
598
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
599
599
  * See the License for the specific language governing permissions and
600
600
  * limitations under the License.
601
- */async function ji(n,e){const t=await qt(n,{},async()=>{const r=me({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=Gt(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Jt.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function Fi(n,e){return H(n,"POST","/v2/accounts:revokeToken",Y(n,e))}/**
601
+ */async function ji(n,e){const t=await qt(n,{},async()=>{const r=ge({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=Gt(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Jt.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function Fi(n,e){return H(n,"POST","/v2/accounts:revokeToken",Y(n,e))}/**
602
602
  * @license
603
603
  * Copyright 2020 Google LLC
604
604
  *
@@ -628,7 +628,7 @@
628
628
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
629
629
  * See the License for the specific language governing permissions and
630
630
  * limitations under the License.
631
- */function Q(n,e){y(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class x{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=it(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new $i(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new dt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await Te(this,this.stsTokenManager.getToken(this.auth,e));return y(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return Di(this,e)}reload(){return Mi(this)}_assign(e){this!==e&&(y(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new x(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){y(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await Le(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(F(this.auth.app))return Promise.reject(K(this.auth));const e=await this.getIdToken();return await Te(this,Ni(this.auth,{idToken:e})),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(e=>Object.assign({},e)),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(e,t){var r,i,s,o,a,c,u,_;const b=(r=t.displayName)!==null&&r!==void 0?r:void 0,S=(i=t.email)!==null&&i!==void 0?i:void 0,O=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,L=(o=t.photoURL)!==null&&o!==void 0?o:void 0,v=(a=t.tenantId)!==null&&a!==void 0?a:void 0,I=(c=t._redirectEventId)!==null&&c!==void 0?c:void 0,N=(u=t.createdAt)!==null&&u!==void 0?u:void 0,C=(_=t.lastLoginAt)!==null&&_!==void 0?_:void 0,{uid:z,emailVerified:$,isAnonymous:l,providerData:m,stsTokenManager:d}=t;y(z&&d,e,"internal-error");const w=le.fromJSON(this.name,d);y(typeof z=="string",e,"internal-error"),Q(b,e.name),Q(S,e.name),y(typeof $=="boolean",e,"internal-error"),y(typeof l=="boolean",e,"internal-error"),Q(O,e.name),Q(L,e.name),Q(v,e.name),Q(I,e.name),Q(N,e.name),Q(C,e.name);const E=new x({uid:z,auth:e,email:S,emailVerified:$,displayName:b,isAnonymous:l,photoURL:L,phoneNumber:O,tenantId:v,stsTokenManager:w,createdAt:N,lastLoginAt:C});return m&&Array.isArray(m)&&(E.providerData=m.map(A=>Object.assign({},A))),I&&(E._redirectEventId=I),E}static async _fromIdTokenResponse(e,t,r=!1){const i=new le;i.updateFromServerResponse(t);const s=new x({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await Le(s),s}static async _fromGetAccountInfoResponse(e,t,r){const i=t.users[0];y(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?Xt(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!(s!=null&&s.length),a=new le;a.updateFromIdToken(r);const c=new x({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:o}),u={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new dt(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(s!=null&&s.length)};return Object.assign(c,u),c}}/**
631
+ */function Q(n,e){y(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class x{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=it(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new $i(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new dt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await Te(this,this.stsTokenManager.getToken(this.auth,e));return y(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return Di(this,e)}reload(){return Mi(this)}_assign(e){this!==e&&(y(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new x(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){y(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await Le(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(F(this.auth.app))return Promise.reject(K(this.auth));const e=await this.getIdToken();return await Te(this,Ni(this.auth,{idToken:e})),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(e=>Object.assign({},e)),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(e,t){var r,i,s,o,a,c,u,_;const b=(r=t.displayName)!==null&&r!==void 0?r:void 0,S=(i=t.email)!==null&&i!==void 0?i:void 0,O=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,L=(o=t.photoURL)!==null&&o!==void 0?o:void 0,v=(a=t.tenantId)!==null&&a!==void 0?a:void 0,I=(c=t._redirectEventId)!==null&&c!==void 0?c:void 0,N=(u=t.createdAt)!==null&&u!==void 0?u:void 0,C=(_=t.lastLoginAt)!==null&&_!==void 0?_:void 0,{uid:z,emailVerified:$,isAnonymous:l,providerData:g,stsTokenManager:d}=t;y(z&&d,e,"internal-error");const w=le.fromJSON(this.name,d);y(typeof z=="string",e,"internal-error"),Q(b,e.name),Q(S,e.name),y(typeof $=="boolean",e,"internal-error"),y(typeof l=="boolean",e,"internal-error"),Q(O,e.name),Q(L,e.name),Q(v,e.name),Q(I,e.name),Q(N,e.name),Q(C,e.name);const E=new x({uid:z,auth:e,email:S,emailVerified:$,displayName:b,isAnonymous:l,photoURL:L,phoneNumber:O,tenantId:v,stsTokenManager:w,createdAt:N,lastLoginAt:C});return g&&Array.isArray(g)&&(E.providerData=g.map(A=>Object.assign({},A))),I&&(E._redirectEventId=I),E}static async _fromIdTokenResponse(e,t,r=!1){const i=new le;i.updateFromServerResponse(t);const s=new x({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await Le(s),s}static async _fromGetAccountInfoResponse(e,t,r){const i=t.users[0];y(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?Xt(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!(s!=null&&s.length),a=new le;a.updateFromIdToken(r);const c=new x({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:o}),u={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new dt(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(s!=null&&s.length)};return Object.assign(c,u),c}}/**
632
632
  * @license
633
633
  * Copyright 2020 Google LLC
634
634
  *
@@ -763,7 +763,7 @@
763
763
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
764
764
  * See the License for the specific language governing permissions and
765
765
  * limitations under the License.
766
- */class qi{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new hn(this),this.idTokenSubscription=new hn(this),this.beforeStateQueue=new xi(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=xt,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=W(t)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await de.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const t=await Yt(this,{idToken:e}),r=await x._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(r)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if(F(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,a=i==null?void 0:i._redirectEventId,c=await this.tryRedirectSignIn(e);(!o||o===a)&&(c!=null&&c.user)&&(i=c.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return y(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Le(e)}catch(t){if((t==null?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Ai()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(F(this.app))return Promise.reject(K(this));const t=e?j(e):null;return t&&y(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&y(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return F(this.app)?Promise.reject(K(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return F(this.app)?Promise.reject(K(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(W(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await Wi(this),t=new Ji(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new ge("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(r.tenantId=this.tenantId),await Fi(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&W(e)||this._popupRedirectResolver;y(t,this,"argument-error"),this.redirectPersistenceManager=await de.create(this,[W(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,r;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===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 e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(y(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof t=="function"){const c=e.addObserver(t,r,i);return()=>{o=!0,c()}}else{const c=e.addObserver(t);return()=>{o=!0,c()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return y(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=un(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(t["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(t["X-Firebase-AppCheck"]=i),t}async _getAppCheckToken(){var e;const t=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return t!=null&&t.error&&wi(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function ie(n){return j(n)}class hn{constructor(e){this.auth=e,this.observer=null,this.addObserver=dr(t=>this.observer=t)}get next(){return y(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
766
+ */class qi{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new hn(this),this.idTokenSubscription=new hn(this),this.beforeStateQueue=new xi(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=xt,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=W(t)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await de.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const t=await Yt(this,{idToken:e}),r=await x._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(r)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if(F(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,a=i==null?void 0:i._redirectEventId,c=await this.tryRedirectSignIn(e);(!o||o===a)&&(c!=null&&c.user)&&(i=c.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return y(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Le(e)}catch(t){if((t==null?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Ai()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(F(this.app))return Promise.reject(K(this));const t=e?j(e):null;return t&&y(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&y(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return F(this.app)?Promise.reject(K(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return F(this.app)?Promise.reject(K(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(W(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await Wi(this),t=new Ji(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new me("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(r.tenantId=this.tenantId),await Fi(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&W(e)||this._popupRedirectResolver;y(t,this,"argument-error"),this.redirectPersistenceManager=await de.create(this,[W(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,r;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===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 e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(y(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof t=="function"){const c=e.addObserver(t,r,i);return()=>{o=!0,c()}}else{const c=e.addObserver(t);return()=>{o=!0,c()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return y(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=un(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(t["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(t["X-Firebase-AppCheck"]=i),t}async _getAppCheckToken(){var e;const t=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return t!=null&&t.error&&wi(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function ie(n){return j(n)}class hn{constructor(e){this.auth=e,this.observer=null,this.addObserver=dr(t=>this.observer=t)}get next(){return y(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
767
767
  * @license
768
768
  * Copyright 2020 Google LLC
769
769
  *
@@ -793,7 +793,7 @@
793
793
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
794
794
  * See the License for the specific language governing permissions and
795
795
  * limitations under the License.
796
- */function ts(n,e){const t=$t(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(Re(s,e??{}))return i;D(i,"already-initialized")}return t.initialize({options:e})}function ns(n,e){const t=(e==null?void 0:e.persistence)||[],r=(Array.isArray(t)?t:[t]).map(W);e!=null&&e.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function rs(n,e,t){const r=ie(n);y(r._canInitEmulator,r,"emulator-config-failed"),y(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!(t!=null&&t.disableWarnings),s=gn(e),{host:o,port:a}=is(e),c=a===null?"":`:${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||ss()}function gn(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function is(n){const e=gn(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:mn(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:mn(o)}}}function mn(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function ss(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/**
796
+ */function ts(n,e){const t=$t(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(Re(s,e??{}))return i;D(i,"already-initialized")}return t.initialize({options:e})}function ns(n,e){const t=(e==null?void 0:e.persistence)||[],r=(Array.isArray(t)?t:[t]).map(W);e!=null&&e.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function rs(n,e,t){const r=ie(n);y(r._canInitEmulator,r,"emulator-config-failed"),y(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!(t!=null&&t.disableWarnings),s=mn(e),{host:o,port:a}=is(e),c=a===null?"":`:${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||ss()}function mn(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function is(n){const e=mn(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:gn(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:gn(o)}}}function gn(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function ss(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/**
797
797
  * @license
798
798
  * Copyright 2020 Google LLC
799
799
  *
@@ -883,7 +883,7 @@
883
883
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
884
884
  * See the License for the specific language governing permissions and
885
885
  * limitations under the License.
886
- */const hs="http://localhost";class se extends ft{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new se(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):D("argument-error"),t}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(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,s=it(t,["providerId","signInMethod"]);if(!r||!i)return null;const o=new se(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return ue(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,ue(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,ue(e,t)}buildRequest(){const e={requestUri:hs,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=me(t)}return e}}/**
886
+ */const hs="http://localhost";class se extends ft{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new se(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):D("argument-error"),t}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(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,s=it(t,["providerId","signInMethod"]);if(!r||!i)return null;const o=new se(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return ue(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,ue(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,ue(e,t)}buildRequest(){const e={requestUri:hs,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=ge(t)}return e}}/**
887
887
  * @license
888
888
  * Copyright 2020 Google LLC
889
889
  *
@@ -1033,7 +1033,7 @@
1033
1033
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1034
1034
  * See the License for the specific language governing permissions and
1035
1035
  * limitations under the License.
1036
- */class je extends J{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,je.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new je(e,t,r,i)}}function vn(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?je._fromErrorAndOperation(n,s,e,r):s})}async function gs(n,e,t=!1){const r=await Te(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return fe._forOperation(n,"link",r)}/**
1036
+ */class je extends J{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,je.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new je(e,t,r,i)}}function vn(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?je._fromErrorAndOperation(n,s,e,r):s})}async function ms(n,e,t=!1){const r=await Te(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return fe._forOperation(n,"link",r)}/**
1037
1037
  * @license
1038
1038
  * Copyright 2019 Google LLC
1039
1039
  *
@@ -1048,7 +1048,7 @@
1048
1048
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1049
1049
  * See the License for the specific language governing permissions and
1050
1050
  * limitations under the License.
1051
- */async function ms(n,e,t=!1){const{auth:r}=n;if(F(r.app))return Promise.reject(K(r));const i="reauthenticate";try{const s=await Te(n,vn(r,i,e,n),t);y(s.idToken,r,"internal-error");const o=lt(s.idToken);y(o,r,"internal-error");const{sub:a}=o;return y(n.uid===a,r,"user-mismatch"),fe._forOperation(n,i,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&D(r,"user-mismatch"),s}}/**
1051
+ */async function gs(n,e,t=!1){const{auth:r}=n;if(F(r.app))return Promise.reject(K(r));const i="reauthenticate";try{const s=await Te(n,vn(r,i,e,n),t);y(s.idToken,r,"internal-error");const o=lt(s.idToken);y(o,r,"internal-error");const{sub:a}=o;return y(n.uid===a,r,"user-mismatch"),fe._forOperation(n,i,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&D(r,"user-mismatch"),s}}/**
1052
1052
  * @license
1053
1053
  * Copyright 2020 Google LLC
1054
1054
  *
@@ -1183,7 +1183,7 @@
1183
1183
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1184
1184
  * See the License for the specific language governing permissions and
1185
1185
  * limitations under the License.
1186
- */function gt(n="",e=10){let t="";for(let r=0;r<e;r++)t+=Math.floor(Math.random()*10);return n+t}/**
1186
+ */function mt(n="",e=10){let t="";for(let r=0;r<e;r++)t+=Math.floor(Math.random()*10);return n+t}/**
1187
1187
  * @license
1188
1188
  * Copyright 2019 Google LLC
1189
1189
  *
@@ -1198,7 +1198,7 @@
1198
1198
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1199
1199
  * See the License for the specific language governing permissions and
1200
1200
  * limitations under the License.
1201
- */class ks{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((a,c)=>{const u=gt("",20);i.port1.start();const _=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(b){const S=b;if(S.data.eventId===u)switch(S.data.status){case"ack":clearTimeout(_),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(S.data.response);break;default:clearTimeout(_),clearTimeout(s),c(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:u,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1201
+ */class ks{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((a,c)=>{const u=mt("",20);i.port1.start();const _=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(b){const S=b;if(S.data.eventId===u)switch(S.data.status){case"ack":clearTimeout(_),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(S.data.response);break;default:clearTimeout(_),clearTimeout(s),c(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:u,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1202
1202
  * @license
1203
1203
  * Copyright 2020 Google LLC
1204
1204
  *
@@ -1243,7 +1243,7 @@
1243
1243
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1244
1244
  * See the License for the specific language governing permissions and
1245
1245
  * limitations under the License.
1246
- */const Sn="firebaseLocalStorageDb",Ms=1,Ve="firebaseLocalStorage",Cn="fbase_key";class Ce{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function He(n,e){return n.transaction([Ve],e?"readwrite":"readonly").objectStore(Ve)}function Us(){const n=indexedDB.deleteDatabase(Sn);return new Ce(n).toPromise()}function mt(){const n=indexedDB.open(Sn,Ms);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(Ve,{keyPath:Cn})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(Ve)?e(r):(r.close(),await Us(),e(await mt()))})})}async function Rn(n,e,t){const r=He(n,!0).put({[Cn]:e,value:t});return new Ce(r).toPromise()}async function js(n,e){const t=He(n,!1).get(e),r=await new Ce(t).toPromise();return r===void 0?null:r.value}function Pn(n,e){const t=He(n,!0).delete(e);return new Ce(t).toPromise()}const Fs=800,Bs=3;class On{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:(this.db=await mt(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>Bs)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return An()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Be._getInstance($s()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await Ds(),!this.activeServiceWorker)return;this.sender=new ks(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((t=r[0])===null||t===void 0)&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Ls()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await mt();return await Rn(e,Fe,"1"),await Pn(e,Fe),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>Rn(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>js(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Pn(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=He(i,!1).getAll();return new Ce(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Fs)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}On.type="LOCAL";const Vs=On;new we(3e4,6e4);/**
1246
+ */const Sn="firebaseLocalStorageDb",Ms=1,Ve="firebaseLocalStorage",Cn="fbase_key";class Ce{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function He(n,e){return n.transaction([Ve],e?"readwrite":"readonly").objectStore(Ve)}function Us(){const n=indexedDB.deleteDatabase(Sn);return new Ce(n).toPromise()}function gt(){const n=indexedDB.open(Sn,Ms);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(Ve,{keyPath:Cn})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(Ve)?e(r):(r.close(),await Us(),e(await gt()))})})}async function Rn(n,e,t){const r=He(n,!0).put({[Cn]:e,value:t});return new Ce(r).toPromise()}async function js(n,e){const t=He(n,!1).get(e),r=await new Ce(t).toPromise();return r===void 0?null:r.value}function Pn(n,e){const t=He(n,!0).delete(e);return new Ce(t).toPromise()}const Fs=800,Bs=3;class On{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:(this.db=await gt(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>Bs)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return An()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Be._getInstance($s()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await Ds(),!this.activeServiceWorker)return;this.sender=new ks(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((t=r[0])===null||t===void 0)&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Ls()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await gt();return await Rn(e,Fe,"1"),await Pn(e,Fe),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>Rn(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>js(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Pn(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=He(i,!1).getAll();return new Ce(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Fs)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}On.type="LOCAL";const Vs=On;new we(3e4,6e4);/**
1247
1247
  * @license
1248
1248
  * Copyright 2021 Google LLC
1249
1249
  *
@@ -1273,7 +1273,7 @@
1273
1273
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1274
1274
  * See the License for the specific language governing permissions and
1275
1275
  * limitations under the License.
1276
- */class yt extends ft{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return ue(e,this._buildIdpRequest())}_linkToIdToken(e,t){return ue(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return ue(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={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 e&&(t.idToken=e),t}}function xs(n){return bn(n.auth,new yt(n),n.bypassAuthState)}function Ws(n){const{auth:e,user:t}=n;return y(t,e,"internal-error"),ms(t,new yt(n),n.bypassAuthState)}async function zs(n){const{auth:e,user:t}=n;return y(t,e,"internal-error"),gs(t,new yt(n),n.bypassAuthState)}/**
1276
+ */class yt extends ft{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return ue(e,this._buildIdpRequest())}_linkToIdToken(e,t){return ue(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return ue(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={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 e&&(t.idToken=e),t}}function xs(n){return bn(n.auth,new yt(n),n.bypassAuthState)}function Ws(n){const{auth:e,user:t}=n;return y(t,e,"internal-error"),gs(t,new yt(n),n.bypassAuthState)}async function zs(n){const{auth:e,user:t}=n;return y(t,e,"internal-error"),ms(t,new yt(n),n.bypassAuthState)}/**
1277
1277
  * @license
1278
1278
  * Copyright 2020 Google LLC
1279
1279
  *
@@ -1303,7 +1303,7 @@
1303
1303
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1304
1304
  * See the License for the specific language governing permissions and
1305
1305
  * limitations under the License.
1306
- */const Js=new we(2e3,1e4);class pe extends kn{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,pe.currentPopupAction&&pe.currentPopupAction.cancel(),pe.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return y(e,this.auth,"internal-error"),e}async onExecution(){V(this.filter.length===1,"Popup operations only handle one event");const e=gt();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(M(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(M(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,pe.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,r;if(!((r=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(M(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Js.get())};e()}}pe.currentPopupAction=null;/**
1306
+ */const Js=new we(2e3,1e4);class pe extends kn{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,pe.currentPopupAction&&pe.currentPopupAction.cancel(),pe.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return y(e,this.auth,"internal-error"),e}async onExecution(){V(this.filter.length===1,"Popup operations only handle one event");const e=mt();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(M(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(M(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,pe.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,r;if(!((r=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(M(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Js.get())};e()}}pe.currentPopupAction=null;/**
1307
1307
  * @license
1308
1308
  * Copyright 2020 Google LLC
1309
1309
  *
@@ -1393,7 +1393,7 @@
1393
1393
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1394
1394
  * See the License for the specific language governing permissions and
1395
1395
  * limitations under the License.
1396
- */const ho=new we(5e3,15e3),fo="__/auth/iframe",po="emulator/auth/iframe",go={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},mo=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function yo(n){const e=n.config;y(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?at(e,po):`https://${n.config.authDomain}/${fo}`,r={apiKey:e.apiKey,appName:n.name,v:be},i=mo.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${me(r).slice(1)}`}async function _o(n){const e=await uo(n),t=U().gapi;return y(t,n,"internal-error"),e.open({where:document.body,url:yo(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:go,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=M(n,"network-request-failed"),a=U().setTimeout(()=>{s(o)},ho.get());function c(){U().clearTimeout(a),i(r)}r.ping(c).then(c,()=>{s(o)})}))}/**
1396
+ */const ho=new we(5e3,15e3),fo="__/auth/iframe",po="emulator/auth/iframe",mo={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},go=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function yo(n){const e=n.config;y(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?at(e,po):`https://${n.config.authDomain}/${fo}`,r={apiKey:e.apiKey,appName:n.name,v:be},i=go.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${ge(r).slice(1)}`}async function _o(n){const e=await uo(n),t=U().gapi;return y(t,n,"internal-error"),e.open({where:document.body,url:yo(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:mo,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=M(n,"network-request-failed"),a=U().setTimeout(()=>{s(o)},ho.get());function c(){U().clearTimeout(a),i(r)}r.ping(c).then(c,()=>{s(o)})}))}/**
1397
1397
  * @license
1398
1398
  * Copyright 2020 Google LLC.
1399
1399
  *
@@ -1423,7 +1423,7 @@
1423
1423
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1424
1424
  * See the License for the specific language governing permissions and
1425
1425
  * limitations under the License.
1426
- */const So="__/auth/handler",Co="emulator/auth/handler",Ro=encodeURIComponent("fac");async function Mn(n,e,t,r,i,s){y(n.config.authDomain,n,"auth-domain-config-required"),y(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:be,eventId:i};if(e instanceof yn){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",lr(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[_,b]of Object.entries(s||{}))o[_]=b}if(e instanceof Se){const _=e.getScopes().filter(b=>b!=="");_.length>0&&(o.scopes=_.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const _ of Object.keys(a))a[_]===void 0&&delete a[_];const c=await n._getAppCheckToken(),u=c?`#${Ro}=${encodeURIComponent(c)}`:"";return`${Po(n)}?${me(a).slice(1)}${u}`}function Po({config:n}){return n.emulator?at(n,Co):`https://${n.authDomain}/${So}`}/**
1426
+ */const So="__/auth/handler",Co="emulator/auth/handler",Ro=encodeURIComponent("fac");async function Mn(n,e,t,r,i,s){y(n.config.authDomain,n,"auth-domain-config-required"),y(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:be,eventId:i};if(e instanceof yn){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",lr(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[_,b]of Object.entries(s||{}))o[_]=b}if(e instanceof Se){const _=e.getScopes().filter(b=>b!=="");_.length>0&&(o.scopes=_.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const _ of Object.keys(a))a[_]===void 0&&delete a[_];const c=await n._getAppCheckToken(),u=c?`#${Ro}=${encodeURIComponent(c)}`:"";return`${Po(n)}?${ge(a).slice(1)}${u}`}function Po({config:n}){return n.emulator?at(n,Co):`https://${n.authDomain}/${So}`}/**
1427
1427
  * @license
1428
1428
  * Copyright 2020 Google LLC
1429
1429
  *
@@ -1438,7 +1438,7 @@
1438
1438
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1439
1439
  * See the License for the specific language governing permissions and
1440
1440
  * limitations under the License.
1441
- */const _t="webStorageSupport";class Oo{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Tn,this._completeRedirectFn=Zs,this._overrideRedirectResult=Ys}async _openPopup(e,t,r,i){var s;V((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await Mn(e,t,r,ot(),i);return To(e,o,gt())}async _openRedirect(e,t,r,i){await this._originValidation(e);const s=await Mn(e,t,r,ot(),i);return Ns(s),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(V(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await _o(e),r=new to(e);return t.register("authEvent",i=>(y(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(_t,{type:_t},i=>{var s;const o=(s=i==null?void 0:i[0])===null||s===void 0?void 0:s[_t];o!==void 0&&t(!!o),D(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=oo(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return dn()||ut()||Me()}}const ko=Oo;var Un="@firebase/auth",jn="1.7.2";/**
1441
+ */const _t="webStorageSupport";class Oo{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Tn,this._completeRedirectFn=Zs,this._overrideRedirectResult=Ys}async _openPopup(e,t,r,i){var s;V((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await Mn(e,t,r,ot(),i);return To(e,o,mt())}async _openRedirect(e,t,r,i){await this._originValidation(e);const s=await Mn(e,t,r,ot(),i);return Ns(s),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(V(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await _o(e),r=new to(e);return t.register("authEvent",i=>(y(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(_t,{type:_t},i=>{var s;const o=(s=i==null?void 0:i[0])===null||s===void 0?void 0:s[_t];o!==void 0&&t(!!o),D(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=oo(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return dn()||ut()||Me()}}const ko=Oo;var Un="@firebase/auth",jn="1.7.2";/**
1442
1442
  * @license
1443
1443
  * Copyright 2020 Google LLC
1444
1444
  *
@@ -1483,4 +1483,4 @@
1483
1483
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1484
1484
  * See the License for the specific language governing permissions and
1485
1485
  * limitations under the License.
1486
- */const $o=5*60,Mo=At("authIdTokenMaxAge")||$o;let Fn=null;const Uo=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>Mo)return;const i=t==null?void 0:t.token;Fn!==i&&(Fn=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function jo(n=li()){const e=$t(n,"auth");if(e.isInitialized())return e.getImmediate();const t=ts(n,{popupRedirectResolver:ko,persistence:[Vs,Ps,Tn]}),r=At("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(r,location.origin);if(location.origin===s.origin){const o=Uo(s.toString());Es(t,o,()=>o(t.currentUser)),ws(t,a=>o(a))}}const i=Xn("auth");return i&&rs(t,`http://${i}`),t}function Fo(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}Gi({loadJS(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=M("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",Fo().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="}),Lo("Browser");var Bo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bn={exports:{}};(function(n){(function(e){function t(l,m){var d=(l&65535)+(m&65535),w=(l>>16)+(m>>16)+(d>>16);return w<<16|d&65535}function r(l,m){return l<<m|l>>>32-m}function i(l,m,d,w,E,A){return t(r(t(t(m,l),t(w,A)),E),d)}function s(l,m,d,w,E,A,R){return i(m&d|~m&w,l,m,E,A,R)}function o(l,m,d,w,E,A,R){return i(m&w|d&~w,l,m,E,A,R)}function a(l,m,d,w,E,A,R){return i(m^d^w,l,m,E,A,R)}function c(l,m,d,w,E,A,R){return i(d^(m|~w),l,m,E,A,R)}function u(l,m){l[m>>5]|=128<<m%32,l[(m+64>>>9<<4)+14]=m;var d,w,E,A,R,h=1732584193,f=-271733879,p=-1732584194,g=271733878;for(d=0;d<l.length;d+=16)w=h,E=f,A=p,R=g,h=s(h,f,p,g,l[d],7,-680876936),g=s(g,h,f,p,l[d+1],12,-389564586),p=s(p,g,h,f,l[d+2],17,606105819),f=s(f,p,g,h,l[d+3],22,-1044525330),h=s(h,f,p,g,l[d+4],7,-176418897),g=s(g,h,f,p,l[d+5],12,1200080426),p=s(p,g,h,f,l[d+6],17,-1473231341),f=s(f,p,g,h,l[d+7],22,-45705983),h=s(h,f,p,g,l[d+8],7,1770035416),g=s(g,h,f,p,l[d+9],12,-1958414417),p=s(p,g,h,f,l[d+10],17,-42063),f=s(f,p,g,h,l[d+11],22,-1990404162),h=s(h,f,p,g,l[d+12],7,1804603682),g=s(g,h,f,p,l[d+13],12,-40341101),p=s(p,g,h,f,l[d+14],17,-1502002290),f=s(f,p,g,h,l[d+15],22,1236535329),h=o(h,f,p,g,l[d+1],5,-165796510),g=o(g,h,f,p,l[d+6],9,-1069501632),p=o(p,g,h,f,l[d+11],14,643717713),f=o(f,p,g,h,l[d],20,-373897302),h=o(h,f,p,g,l[d+5],5,-701558691),g=o(g,h,f,p,l[d+10],9,38016083),p=o(p,g,h,f,l[d+15],14,-660478335),f=o(f,p,g,h,l[d+4],20,-405537848),h=o(h,f,p,g,l[d+9],5,568446438),g=o(g,h,f,p,l[d+14],9,-1019803690),p=o(p,g,h,f,l[d+3],14,-187363961),f=o(f,p,g,h,l[d+8],20,1163531501),h=o(h,f,p,g,l[d+13],5,-1444681467),g=o(g,h,f,p,l[d+2],9,-51403784),p=o(p,g,h,f,l[d+7],14,1735328473),f=o(f,p,g,h,l[d+12],20,-1926607734),h=a(h,f,p,g,l[d+5],4,-378558),g=a(g,h,f,p,l[d+8],11,-2022574463),p=a(p,g,h,f,l[d+11],16,1839030562),f=a(f,p,g,h,l[d+14],23,-35309556),h=a(h,f,p,g,l[d+1],4,-1530992060),g=a(g,h,f,p,l[d+4],11,1272893353),p=a(p,g,h,f,l[d+7],16,-155497632),f=a(f,p,g,h,l[d+10],23,-1094730640),h=a(h,f,p,g,l[d+13],4,681279174),g=a(g,h,f,p,l[d],11,-358537222),p=a(p,g,h,f,l[d+3],16,-722521979),f=a(f,p,g,h,l[d+6],23,76029189),h=a(h,f,p,g,l[d+9],4,-640364487),g=a(g,h,f,p,l[d+12],11,-421815835),p=a(p,g,h,f,l[d+15],16,530742520),f=a(f,p,g,h,l[d+2],23,-995338651),h=c(h,f,p,g,l[d],6,-198630844),g=c(g,h,f,p,l[d+7],10,1126891415),p=c(p,g,h,f,l[d+14],15,-1416354905),f=c(f,p,g,h,l[d+5],21,-57434055),h=c(h,f,p,g,l[d+12],6,1700485571),g=c(g,h,f,p,l[d+3],10,-1894986606),p=c(p,g,h,f,l[d+10],15,-1051523),f=c(f,p,g,h,l[d+1],21,-2054922799),h=c(h,f,p,g,l[d+8],6,1873313359),g=c(g,h,f,p,l[d+15],10,-30611744),p=c(p,g,h,f,l[d+6],15,-1560198380),f=c(f,p,g,h,l[d+13],21,1309151649),h=c(h,f,p,g,l[d+4],6,-145523070),g=c(g,h,f,p,l[d+11],10,-1120210379),p=c(p,g,h,f,l[d+2],15,718787259),f=c(f,p,g,h,l[d+9],21,-343485551),h=t(h,w),f=t(f,E),p=t(p,A),g=t(g,R);return[h,f,p,g]}function _(l){var m,d="",w=l.length*32;for(m=0;m<w;m+=8)d+=String.fromCharCode(l[m>>5]>>>m%32&255);return d}function b(l){var m,d=[];for(d[(l.length>>2)-1]=void 0,m=0;m<d.length;m+=1)d[m]=0;var w=l.length*8;for(m=0;m<w;m+=8)d[m>>5]|=(l.charCodeAt(m/8)&255)<<m%32;return d}function S(l){return _(u(b(l),l.length*8))}function O(l,m){var d,w=b(l),E=[],A=[],R;for(E[15]=A[15]=void 0,w.length>16&&(w=u(w,l.length*8)),d=0;d<16;d+=1)E[d]=w[d]^909522486,A[d]=w[d]^1549556828;return R=u(E.concat(b(m)),512+m.length*8),_(u(A.concat(R),640))}function L(l){var m="0123456789abcdef",d="",w,E;for(E=0;E<l.length;E+=1)w=l.charCodeAt(E),d+=m.charAt(w>>>4&15)+m.charAt(w&15);return d}function v(l){return unescape(encodeURIComponent(l))}function I(l){return S(v(l))}function N(l){return L(I(l))}function C(l,m){return O(v(l),v(m))}function z(l,m){return L(C(l,m))}function $(l,m,d){return m?d?C(m,l):z(m,l):d?I(l):N(l)}n.exports?n.exports=$:e.md5=$})(Bo)})(Bn);var Ho=Bn.exports;const xo=Vo(Ho),vt=(n,e)=>async(t,r={})=>{const i=e?await e.getIdToken():null,s=await fetch(`${n}${t}`,{mode:"cors",...r,headers:{...i&&{authorization:`Bearer ${i}`},...r.body&&{"content-type":"application/json"},...r.headers},...r.body&&{body:JSON.stringify(r.body)}}),o=await s.json();if(s.status>202)throw Object.assign(new Error((o==null?void 0:o.message)||`HTTP Error ${s.status}`),{status:s.status,code:o==null?void 0:o.code,body:o});return o},Wo=n=>{const e=n.properties||{},t=n.inputProps||Object.keys(e),r=(i,s)=>{const o=e[i]||{};if([null,void 0].includes(s))return o.isRequired?{id:"value-missing-validation-error"}:void 0;if(o.enum)return o.enum.includes(s)?void 0:{id:"enum-validation-error",values:{enum:o.enum,value:s}};switch(o.type){case"integer":if(o.isScalar&&(typeof s!="number"||Number.isNaN(s)))return{id:"invalid-number-validation-error"};break;case"date":break;case"boolean":break;case"json":case"string":default:if(o.isRequired&&!s)return{id:"value-missing-validation-error"};break}};return{validate:i=>t.reduce((s,o)=>{const a=r(o,i[o]);return a?{...s,[o]:a}:s},{}),validateAttr:r}},zo=(n={})=>Object.keys(n).length?`?q=${JSON.stringify(n)}`:"",Jo=n=>[...n].reduce((e,t)=>t===t.toUpperCase()?`${e}-${t.toLowerCase()}`:`${e}${t}`,""),qo=n=>`${n[0].toLowerCase()}${n.slice(1)}`,Go=n=>{const e=Jo(n);return(t,r)=>`/${e}${t?`/${encodeURIComponent(t)}`:""}${zo(r)}`},Vn=(n,e)=>{const t=Array.isArray(e.inputProps);return Object.keys(n).reduce((r,i)=>{if(t&&!e.inputProps.includes(i))return r;const{isRef:s,isScalar:o,isRequired:a}=e.properties[i]||{};return s&&o&&!a&&n[i]===null?r:{...r,[i]:n[i]}},{})},Ko=({primaryKey:n,properties:e,...t})=>({primaryKey:n||"id",properties:Object.keys(e||{}).reduce((r,i)=>{var b,S;const s=e[i]||{},{type:o,isScalar:a,isRequired:c,isRef:u=!1}=typeof s.type=="string"?s.type==="array"?s.enum?{type:"string",isScalar:!1,isRequired:!1}:(b=s.items)!=null&&b.$ref?{type:s.items.$ref.split("/").pop(),isScalar:!1,isRequired:!1,isRef:!0}:{type:(S=s.items)==null?void 0:S.type,isScalar:!1,isRequired:!1}:{type:s.format==="date-time"?"date":s.type,isScalar:!0,isRequired:!0}:Array.isArray(s.type)?s.type.length===2?{type:s.format==="date-time"?"date":s.type[0],isScalar:!0,isRequired:!1}:{type:"json",isScalar:!0,isRequired:s.type.includes("null")}:s.$ref?{type:s.$ref.split("/").pop(),isScalar:!0,isRequired:!0,isRef:!0}:{type:s.anyOf[0].$ref.split("/").pop(),isScalar:!0,isRequired:!1,isRef:!0},_=s.inputType||(o==="integer"?"number":o);return{...r,[i]:{...e[i],type:o,isScalar:a,isRequired:typeof s.isRequired=="boolean"?s.isRequired:c,isRef:u,inputType:_}}},{}),...t}),Yo=(n,e,t,r={},i={})=>{const s=Ko(r),{primaryKey:o,properties:a}=s,c=Wo(s),u=Go(t),_=(...v)=>vt(n,e.authUser)(...v),b=({data:v,...I})=>_(u(null,I),{method:"POST",body:Vn(v,s)}),S=({data:v,...I})=>{const{where:N,...C}=I;return _(u(N[o],C),{method:"PUT",body:Vn(v,s)})},O=v=>{if(!v)return v;const I=Object.keys(v).reduce((N,C)=>{var E;const z=a[C]||{},{type:$,isScalar:l,isRef:m,format:d,items:w}=z;if(m){const A=qo($);return l?{...N,[C]:i[A].parse(v[C])}:{...N,[C]:typeof((E=i[A])==null?void 0:E.parse)=="function"?v[C].map(R=>i[A].parse(R)):v[C]}}return{...N,[C]:$==="date"&&v[C]?new Date(v[C]):v[C]}},{});return typeof s.parse=="function"?s.parse(I):I},L=Object.keys(a||{}).reduce((v,I)=>a[I].isRef&&a[I].isScalar&&a[I].isRequired?Object.assign(v,{all:v.all.concat(I),oneToOne:v.oneToOne.concat(I),requiredOneToOne:v.requiredOneToOne.concat(I)}):a[I].isRef&&a[I].isScalar?Object.assign(v,{all:v.all.concat(I),oneToOne:v.oneToOne.concat(I),optionalOneToOne:v.optionalOneToOne.concat(I)}):a[I].isRef?Object.assign(v,{all:v.all.concat(I),oneToMany:v.oneToMany.concat(I)}):v,{all:[],oneToOne:[],requiredOneToOne:[],optionalOneToOne:[],oneToMany:[]});return{get schema(){return s},get relations(){return L},parse:O,validateAttr:c.validateAttr,validate:c.validate,findMany:v=>_(u(null,v)).then(I=>I.map(O)),findById:(v,I)=>_(u(v,I)).then(O),create:b,update:S,upsert:v=>v.where[o]?S({where:v.where,data:v.update}):b({data:v.create}),delete:v=>_(u(v),{method:"DELETE"}),stats:()=>_(u("_stats")),search:(v,I={})=>{var d;const{searchProps:N}=s,z=v.split(" ").reduce((w,E)=>[...w,{OR:N.reduce((A,R)=>{const h=R.split(".");return[...A,h.reduceRight((f,p)=>({[p]:f}),{contains:E,mode:"insensitive"})]},[])}],[]),$={...I.select,...I.include},l=(d=s.defaultProps)!=null&&d.length?Object.assign(...s.defaultProps.map(w=>({[w]:!0}))):null,m=Object.keys($).length?$:l;return _(u(null,{where:{...I.where,AND:z},...!!m&&{select:m},...I.orderBy&&{orderBy:I.orderBy},take:I.take||100}))}}},Qo=(n,e,t)=>Object.keys(t.properties).reduce((r,i)=>{const s=t.properties[i].$ref.split("/").pop();return Object.assign(r,{[i]:Yo(n,e,t.definitions[s].plural||`${i}s`,t.definitions[s],r)})},{}),Xo=(n,e)=>Object.keys(n.definitions).reduce((t,r)=>({...t,[r]:e[r]?{...n.definitions[r],...e[r],properties:Object.keys(n.definitions[r].properties).reduce((i,s)=>({...i,[s]:{...n.definitions[r].properties[s],...(e[r].properties||{})[s]}}),e[r].properties||{})}:n.definitions[r]}),{}),bt={$schema:"http://json-schema.org/draft-07/schema#",definitions:{Country:{type:"object",properties:{code:{type:"string"},name:{type:"string"},incomeFilter:{type:["integer","null"]},canApply:{type:"boolean",default:!1},capital:{type:"array",items:{type:"string"}},timeZone:{type:["string","null"]},flag:{type:["string","null"]},currency:{anyOf:[{$ref:"#/definitions/Currency"},{type:"null"}]},contracts:{type:"array",items:{$ref:"#/definitions/Contract"}},users:{type:"array",items:{$ref:"#/definitions/User"}},applications:{type:"array",items:{$ref:"#/definitions/Application"}},applicationNationalities:{type:"array",items:{$ref:"#/definitions/Application"}},educationLevels:{type:"array",items:{$ref:"#/definitions/EducationLevel"}},universities:{type:"array",items:{$ref:"#/definitions/University"}},companies:{type:"array",items:{$ref:"#/definitions/Company"}},jobs:{type:"array",items:{$ref:"#/definitions/Job"}},jobReviews:{type:"array",items:{$ref:"#/definitions/JobReviewCountry"}}}},Currency:{type:"object",properties:{code:{type:"string"},name:{type:"string"},symbol:{type:"string"},countries:{type:"array",items:{$ref:"#/definitions/Country"}}}},User:{type:"object",properties:{uid:{type:"string"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},email:{type:"string"},firstName:{type:"string"},lastName:{type:["string","null"]},role:{type:["string","null"],enum:["staff","manager","finance","admin"]},disabled:{type:"boolean",default:!1},lang:{type:["string","null"],enum:["en","es","pt"]},referralSource:{type:["string","null"],enum:["word_of_mouth","codigo_m","social","google","print","tv","radio","other"]},identifiesAsFemale:{type:["boolean","null"]},dateOfBirth:{type:["string","null"],format:"date-time"},identificationNumber:{type:["string","null"]},mobileNumber:{type:["string","null"]},github:{type:["string","null"]},linkedin:{type:["string","null"]},bio:{type:["string","null"]},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},signupCohort:{anyOf:[{$ref:"#/definitions/Cohort"},{type:"null"}]},applications:{type:"array",items:{$ref:"#/definitions/Application"}},contractsAsCheckPilot:{type:"array",items:{$ref:"#/definitions/Contract"}},contracts:{type:"array",items:{$ref:"#/definitions/Contract"}},dropouts:{type:"array",items:{$ref:"#/definitions/Dropout"}},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}},messages:{type:"array",items:{$ref:"#/definitions/Message"}},students:{type:"array",items:{$ref:"#/definitions/Student"}},activityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},authoredActivityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},jobReviews:{type:"array",items:{$ref:"#/definitions/JobReview"}},jobApplications:{type:"array",items:{$ref:"#/definitions/JobApplication"}},eventRsvps:{type:"array",items:{$ref:"#/definitions/EventRsvp"}}}},Track:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},programs:{type:"array",items:{$ref:"#/definitions/Program"}},crawlerQueries:{type:"array",items:{$ref:"#/definitions/CrawlerQuery"}},jobProfileTypes:{type:"array",items:{$ref:"#/definitions/JobProfileType"}},jobReviews:{type:"array",items:{$ref:"#/definitions/JobReviewTrack"}},applicationChallenges:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeTrack"}}}},Program:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},description:{type:["string","null"]},langs:{type:"array",enum:["en","es","pt"]},hidden:{type:"boolean",default:!1},track:{$ref:"#/definitions/Track"},cohorts:{type:"array",items:{$ref:"#/definitions/Cohort"}},stages:{type:"array",items:{$ref:"#/definitions/Stage"}}}},Stage:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},order:{type:"integer"},program:{$ref:"#/definitions/Program"},cohorts:{type:"array",items:{$ref:"#/definitions/Cohort"}}}},Cohort:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},lang:{type:["string","null"],enum:["en","es","pt"]},start:{type:"string",format:"date-time"},end:{type:"string",format:"date-time"},timeZone:{type:["string","null"]},startTime:{type:["string","null"]},endTime:{type:["string","null"]},legacySlug:{type:"string"},vacancies:{type:["integer","null"]},admissionStart:{type:["string","null"],format:"date-time"},admissionEnd:{type:["string","null"],format:"date-time"},admissionCountries:{type:"array",items:{type:"string"}},placementStart:{type:["string","null"],format:"date-time"},placementDuration:{type:["integer","null"]},program:{$ref:"#/definitions/Program"},stage:{$ref:"#/definitions/Stage"},applications:{type:"array",items:{$ref:"#/definitions/Application"}},links:{type:"array",items:{$ref:"#/definitions/CohortLink"}},dropouts:{type:"array",items:{$ref:"#/definitions/Dropout"}},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}},students:{type:"array",items:{$ref:"#/definitions/Student"}},signupUsers:{type:"array",items:{$ref:"#/definitions/User"}},activityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},jobApplications:{type:"array",items:{$ref:"#/definitions/JobApplication"}}}},Student:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},legacyStudentCode:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"},projecTeamMembers:{type:"array",items:{$ref:"#/definitions/StudentProjecTeamMember"}}}},CohortLink:{type:"object",properties:{id:{type:"integer"},url:{type:"string"},visibility:{type:"string",enum:["public","members","staff","team","admin"]},cohort:{$ref:"#/definitions/Cohort"}}},Dropout:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},date:{type:"string",format:"date-time"},reasonDetail:{type:["string","null"]},notes:{type:["string","null"]},staffSad:{type:"boolean"},covidRelated:{type:["boolean","null"]},reason:{type:"string",enum:["dropout","noShow","invitedToLeave","changeCohort"]},completedProjects:{type:"integer"},lastProject:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"}}},IscedLevel:{type:"object",properties:{id:{type:"integer"},label:{type:"string"},educationLevels:{type:"array",items:{$ref:"#/definitions/EducationLevel"}}}},EducationLevel:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},label:{type:"string"},country:{$ref:"#/definitions/Country"},iscedLevel:{$ref:"#/definitions/IscedLevel"},applications:{type:"array",items:{$ref:"#/definitions/Application"}}}},University:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},name:{type:"string"},filter:{type:"boolean"},country:{$ref:"#/definitions/Country"},applications:{type:"array",items:{$ref:"#/definitions/Application"}}}},Application:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},dateOfBirth:{type:"string",format:"date-time"},isAllowedToWork:{type:"boolean"},hasValidIdDocument:{type:"boolean"},locality:{type:["number","string","boolean","object","array","null"]},householdSize:{type:"integer"},children:{type:"integer"},householdIncome:{type:"integer"},racialIdentity:{type:["string","null"]},schoolType:{type:["string","null"],enum:["private","public","other","subsidized","mixed"]},educationSubject:{type:["string","null"],enum:["design_and_media","software_engineering","engineering","management_and_business","languages","science","health","social_sciences","arts","comms_and_advertising","education","cooking","tourism","economics_and_accounting","law","other"]},isStudying:{type:"boolean"},englishLevel:{type:["string","null"],enum:["NO","A1","A2","B1","B2","C1","C2"]},workStatus:{type:"string",enum:["never","not_now","yes"]},isLookingForWork:{type:["boolean","null"]},monthsLookingForWork:{type:["integer","null"]},monthsUnemployed:{type:["integer","null"]},workRole:{type:["string","null"],enum:["waitress","promoter","manager","cashier","intern","operative","call_center","receptionist","sales_agent","assistant","professional","technical","consultant","other"]},freelance:{type:["boolean","null"]},workFormal:{type:["boolean","null"]},workIncome:{type:["integer","null"]},failedFilters:{type:"array",items:{type:"string"}},bypassFilters:{type:"boolean",default:!1},isReady:{type:"boolean",default:!1},isReturningApplicant:{type:["boolean","null"]},legacyAdmissionCohortSlug:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"},country:{$ref:"#/definitions/Country"},nationality:{$ref:"#/definitions/Country"},educationLevel:{$ref:"#/definitions/EducationLevel"},university:{anyOf:[{$ref:"#/definitions/University"},{type:"null"}]},challengeAssignments:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeAssignment"}}},config:{maxAge:120}},ApplicationChallenge:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},slug:{type:"string"},version:{type:"string"},trackId:{type:"integer"},tracks:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeTrack"}},langs:{type:"array",enum:["en","es","pt"]},json:{type:"string"},archived:{type:"boolean",default:!1},assignments:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeAssignment"}}}},ApplicationChallengeAssignment:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},application:{$ref:"#/definitions/Application"},challenge:{$ref:"#/definitions/ApplicationChallenge"}}},ApplicationChallengeTrack:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},applicationChallenge:{$ref:"#/definitions/ApplicationChallenge"},track:{$ref:"#/definitions/Track"}}},ActivityLogEntry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},type:{type:"string",enum:["challenge","application_filter","application_filter_bypass","application_cohort_change","project_assessment","project_assessment_request","project_assessment_assignment","project_assessment_bypass"]},data:{type:["number","string","boolean","object","array","null"]},path:{type:"string"},author:{$ref:"#/definitions/User"},user:{$ref:"#/definitions/User"},cohort:{$ref:"#/definitions/Cohort"}}},StudentProject:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},projectSlug:{type:"string"},projectVersion:{type:"string"},links:{type:"array",items:{$ref:"#/definitions/StudentProjectLink"}},team:{type:"array",items:{$ref:"#/definitions/StudentProjecTeamMember"}}}},StudentProjecTeamMember:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},studentProject:{$ref:"#/definitions/StudentProject"},student:{$ref:"#/definitions/Student"}}},StudentProjectLink:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},url:{type:"string"},studentProject:{$ref:"#/definitions/StudentProject"}}},Contract:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},isEmployment:{type:"boolean"},feeAmount:{type:"integer"},hoursPerWeek:{type:"integer"},start:{type:"string",format:"date-time"},end:{type:["string","null"],format:"date-time"},isTrial:{type:"boolean",default:!1},source:{type:["string","null"],enum:["graduate","referral","jazzhr","web","linkedin","other"]},checkPilot:{anyOf:[{$ref:"#/definitions/User"},{type:"null"}]},country:{$ref:"#/definitions/Country"},user:{$ref:"#/definitions/User"},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}}}},Gig:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},role:{type:"string",enum:["bm","pdc","js","ux"]},hoursPerWeek:{type:"integer"},start:{type:"string",format:"date-time"},end:{type:["string","null"],format:"date-time"},cohort:{$ref:"#/definitions/Cohort"},contract:{$ref:"#/definitions/Contract"},user:{$ref:"#/definitions/User"}}},Message:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},key:{type:"string"},from:{type:"string"},to:{type:"string"},transport:{type:"string",enum:["mandrill","slack"]},status:{type:"string",default:"PENDING",enum:["PENDING","QUEUED","ERROR","SENT"]},data:{type:["number","string","boolean","object","array","null"]},taskInfo:{type:["number","string","boolean","object","array","null"]},user:{anyOf:[{$ref:"#/definitions/User"},{type:"null"}]},logs:{type:"array",items:{$ref:"#/definitions/MessageLog"}}}},MessageLog:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},statusText:{type:["string","null"]},message:{$ref:"#/definitions/Message"}}},Industry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},companies:{type:"array",items:{$ref:"#/definitions/Company"}}}},Company:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},source:{type:"string"},sourceId:{type:"string"},name:{type:"string"},size:{type:["string","null"],enum:["A_2_10","B_11_50","C_51_200","D_201_500","E_501_1000","F_1001_5000","G_5001_10000","H_10001_plus"]},data:{type:["number","string","boolean","object","array","null"]},web:{type:["string","null"]},twitter:{type:["string","null"]},github:{type:["string","null"]},facebook:{type:["string","null"]},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},industry:{anyOf:[{$ref:"#/definitions/Industry"},{type:"null"}]},jobs:{type:"array",items:{$ref:"#/definitions/Job"}},categories:{type:"array",enum:["Tech_Consultancy","Digital_Transformation","Agency","Startups","High_tech","Traditional_Consulting"]}}},Job:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},source:{type:"string"},sourceId:{type:"string"},title:{type:"string"},publishedAt:{type:"string",format:"date-time"},modality:{type:"string"},publicUrl:{type:["string","null"]},location:{type:["string","null"]},data:{type:["number","string","boolean","object","array","null"]},description:{type:["string","null"]},descriptionHTML:{type:["string","null"]},functions:{type:["string","null"]},functionsHTML:{type:["string","null"]},seniority:{type:["string","null"]},remote:{type:["boolean","null"]},remoteOption:{type:["string","null"],enum:["remote_for_now","locally_remote","fully_remote","no_remote","mixed"]},lang:{type:["string","null"],enum:["en","es","pt"]},maxSalary:{type:["integer","null"]},minSalary:{type:["integer","null"]},minExperience:{type:["integer","null"]},maxExperience:{type:["integer","null"]},tags:{type:"array",items:{type:"string"}},company:{$ref:"#/definitions/Company"},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},reviews:{type:"array",items:{$ref:"#/definitions/JobReview"}},applications:{type:"array",items:{$ref:"#/definitions/JobApplication"}},crawlerQueries:{type:"array",items:{$ref:"#/definitions/JobCrawlerQuery"}},crawlerLocations:{type:"array",items:{$ref:"#/definitions/JobCrawlerLocation"}}}},JobProfileType:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},learningObjectives:{type:["number","string","boolean","object","array","null"]},track:{anyOf:[{$ref:"#/definitions/Track"},{type:"null"}]},reviews:{type:"array",items:{$ref:"#/definitions/JobReviewProfileType"}}}},JobReview:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},isValid:{type:"boolean"},invalidReason:{type:["string","null"],enum:["unrelated","experience","qualifications","other"]},comment:{type:["string","null"]},author:{$ref:"#/definitions/User"},job:{$ref:"#/definitions/Job"},profileTypes:{type:"array",items:{$ref:"#/definitions/JobReviewProfileType"}},validCountries:{type:"array",items:{$ref:"#/definitions/JobReviewCountry"}},validTracks:{type:"array",items:{$ref:"#/definitions/JobReviewTrack"}}}},JobReviewProfileType:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},review:{$ref:"#/definitions/JobReview"},profileType:{$ref:"#/definitions/JobProfileType"}}},JobApplication:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},status:{type:"string",default:"pending",enum:["pending","applied","interview","challenge","followup","hired","not_hired"]},hireDate:{type:["string","null"],format:"date-time"},jobStartDate:{type:["string","null"],format:"date-time"},netSalary:{type:["integer","null"]},grossSalary:{type:["integer","null"]},currency:{type:["string","null"]},job:{$ref:"#/definitions/Job"},user:{$ref:"#/definitions/User"},cohort:{anyOf:[{$ref:"#/definitions/Cohort"},{type:"null"}]}}},CrawlerQuery:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},query:{type:"string"},enabled:{type:"boolean",default:!0},track:{$ref:"#/definitions/Track"},jobs:{type:"array",items:{$ref:"#/definitions/JobCrawlerQuery"}}}},JobCrawlerQuery:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},job:{$ref:"#/definitions/Job"},query:{$ref:"#/definitions/CrawlerQuery"}}},CrawlerLocation:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},enabled:{type:"boolean",default:!0},jobs:{type:"array",items:{$ref:"#/definitions/JobCrawlerLocation"}}}},JobCrawlerLocation:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},job:{$ref:"#/definitions/Job"},location:{$ref:"#/definitions/CrawlerLocation"}}},JobReviewCountry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},review:{$ref:"#/definitions/JobReview"},country:{$ref:"#/definitions/Country"}}},JobReviewTrack:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},review:{$ref:"#/definitions/JobReview"},track:{$ref:"#/definitions/Track"}}},Event:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},status:{type:"string",enum:["draft","published","cancelled"]},title:{type:"string"},date:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},cover:{type:"string"},shortDescription:{type:"string"},description:{type:["string","null"]},maxTickets:{type:"integer"},duration:{type:["string","null"]},isOnline:{type:"boolean"},venue:{type:["number","string","boolean","object","array","null"]},onlineVenue:{type:["string","null"]},zoomMeetingId:{type:["string","null"]},rsvps:{type:"array",items:{$ref:"#/definitions/EventRsvp"}}}},EventRsvp:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},event:{$ref:"#/definitions/Event"},user:{$ref:"#/definitions/User"}}}},type:"object",properties:{country:{$ref:"#/definitions/Country"},currency:{$ref:"#/definitions/Currency"},user:{$ref:"#/definitions/User"},track:{$ref:"#/definitions/Track"},program:{$ref:"#/definitions/Program"},stage:{$ref:"#/definitions/Stage"},cohort:{$ref:"#/definitions/Cohort"},student:{$ref:"#/definitions/Student"},cohortLink:{$ref:"#/definitions/CohortLink"},dropout:{$ref:"#/definitions/Dropout"},iscedLevel:{$ref:"#/definitions/IscedLevel"},educationLevel:{$ref:"#/definitions/EducationLevel"},university:{$ref:"#/definitions/University"},application:{$ref:"#/definitions/Application"},applicationChallenge:{$ref:"#/definitions/ApplicationChallenge"},applicationChallengeAssignment:{$ref:"#/definitions/ApplicationChallengeAssignment"},applicationChallengeTrack:{$ref:"#/definitions/ApplicationChallengeTrack"},activityLogEntry:{$ref:"#/definitions/ActivityLogEntry"},studentProject:{$ref:"#/definitions/StudentProject"},studentProjecTeamMember:{$ref:"#/definitions/StudentProjecTeamMember"},studentProjectLink:{$ref:"#/definitions/StudentProjectLink"},contract:{$ref:"#/definitions/Contract"},gig:{$ref:"#/definitions/Gig"},message:{$ref:"#/definitions/Message"},messageLog:{$ref:"#/definitions/MessageLog"},industry:{$ref:"#/definitions/Industry"},company:{$ref:"#/definitions/Company"},job:{$ref:"#/definitions/Job"},jobProfileType:{$ref:"#/definitions/JobProfileType"},jobReview:{$ref:"#/definitions/JobReview"},jobReviewProfileType:{$ref:"#/definitions/JobReviewProfileType"},jobApplication:{$ref:"#/definitions/JobApplication"},crawlerQuery:{$ref:"#/definitions/CrawlerQuery"},jobCrawlerQuery:{$ref:"#/definitions/JobCrawlerQuery"},crawlerLocation:{$ref:"#/definitions/CrawlerLocation"},jobCrawlerLocation:{$ref:"#/definitions/JobCrawlerLocation"},jobReviewCountry:{$ref:"#/definitions/JobReviewCountry"},jobReviewTrack:{$ref:"#/definitions/JobReviewTrack"},event:{$ref:"#/definitions/Event"},eventRsvp:{$ref:"#/definitions/EventRsvp"}}},Hn=24*(60*60*1e3),Zo={Country:{primaryKey:"code",plural:"countries",inputProps:["name","incomeFilter","currency","canApply","flag"],searchProps:["code","name","timeZone"],defaultProps:["code","name","timeZone","currency"],getOptionLabel:({code:n,name:e})=>`${n} / ${e}`},Currency:{primaryKey:"code",plural:"currencies",searchProps:["code","name"],defaultProps:["code","name","symbol"]},ActivityLogEntry:{plural:"activityLog"},User:{primaryKey:"uid",inputProps:["firstName","lastName","email","password","lang","identifiesAsFemale","dateOfBirth","country","identificationNumber","mobileNumber","github","linkedin","bio","role","signupCohort","disabled","referralSource"],searchProps:["firstName","lastName","email"],getOptionLabel:({firstName:n,lastName:e,email:t})=>`${n} ${e} (${t})`,properties:{email:{inputType:"email"},lastName:{isRequired:!0},mobileNumber:{inputType:"phone"},bio:{inputType:"textarea"}},parse:n=>{const e=n.github?`https://github.com/${n.github}.png?size=`:`https://www.gravatar.com/avatar/${xo(n.email)}?s=`;return{...n,fullName:`${n.firstName||""}${n.lastName?` ${n.lastName}`:""}`,avatar:t=>`${e}${t}`,isStaff:["staff","manager","finance","admin"].includes(n.role),isManager:["manager","finance","admin"].includes(n.role),isFinance:["finance","admin"].includes(n.role),isAdmin:n.role==="admin"}}},Track:{searchProps:["name"]},Program:{searchProps:["name"]},Stage:{searchProps:["name"]},Cohort:{inputProps:["program","stage","lang","name","start","end","timeZone","startTime","endTime","vacancies","admissionStart","admissionEnd","placementStart","admissionCountries","links"],searchProps:["name"],getOptionLabel:({id:n,name:e,stage:t})=>`${e}${t?` - ${t.name}`:""} (id: ${n})`,properties:{},parse:n=>{var s,o;const e=Date.now();let t;if(n.placementStart){const a=n.placementDuration||270;new Date(+n.placementStart+a*24*60*60*1e3)<e?t="placement_ended":n.placementStart<e&&(t="placement_started")}!t&&n.end<e&&(t="ended"),!t&&n.start<e&&(t="started");const r=n.admissionEnd?+n.admissionEnd+Hn:!1;!t&&r&&r<e&&(t="admission_ended"),!t&&n.admissionStart&&n.admissionStart<e&&(t="admission_started"),!t&&n.admissionStart&&n.admissionEnd&&(t="planned"),t||(t="draft");const i=n.start>e&&n.vacancies?n.vacancies:((s=n._count)==null?void 0:s.students)||((o=n.students)==null?void 0:o.length)||0;return{...n,status:t,size:i}}},Student:{inputProps:["cohort","user"],searchProps:["user.firstName","user.lastName","user.email"],defaultProps:["id","cohort","user"],getOptionLabel:({user:n,cohort:e})=>`${n==null?void 0:n.firstName} ${(n==null?void 0:n.lastName)||""} (${e==null?void 0:e.name})`},Dropout:{inputProps:["cohort","user","date","reason","reasonDetail","lastProject","completedProjects","notes","staffSad","covidRelated"],searchProps:["user.uid","user.firstName","user.lastName","user.email","cohort.name"]},Contract:{inputProps:["user","country","isEmployment","feeAmount","hoursPerWeek","start","end","isTrial","checkPilot","source"],searchProps:["user.firstName","user.lastName","user.email"],getOptionLabel:({id:n,user:e})=>`${e==null?void 0:e.firstName} (id: ${n})`},Gig:{inputProps:["cohort","user","contract","role","hoursPerWeek","start","end"]},Application:{inputProps:["user","cohort","dateOfBirth","country","locality","nationality","isAllowedToWork","hasValidIdDocument","householdSize","children","householdIncome","racialIdentity","educationLevel","schoolType","educationSubject","university","isStudying","englishLevel","workStatus","isLookingForWork","monthsLookingForWork","monthsUnemployed","workRole","freelance","workFormal","workIncome","isReady","bypassFilters"],properties:{locality:{isRequired:!0},englishLevel:{isRequired:!0},isReady:{isRequired:!1},bypassFilters:{isRequired:!1}},parse:n=>{var s,o,a;const e=typeof n.hasFailedFilters=="boolean"?n.hasFailedFilters:typeof((s=n.failedFilters)==null?void 0:s.length)=="number"?n.failedFilters.length>0:void 0;if(!((o=n.cohort)!=null&&o.admissionEnd)||typeof e>"u")return n;const t=Date.now(),{maxAge:r}=bt.definitions.Application.config;let i;return n.isReady?i="ready":e&&!n.bypassFilters?i="rejected":n.createdAt<t-r*Hn?i="expired":((a=n.cohort)==null?void 0:a.status)!=="admission_started"?i="admission_ended":i="active",{...n,status:i}}},IscedLevel:{parse:n=>{const e=Math.floor(n.id/10);return{...n,level:e,completed:e*10<n.id}}},EducationLevel:{searchProps:["label"]},University:{plural:"universities",searchProps:["name"]},Company:{plural:"companies"},CrawlerQuery:{plural:"crawlerQueries"},JobCrawlerQuery:{plural:"jobCrawlerQueries"},Event:{inputProps:["status","title","date","lang","cover","shortDescription","description","maxTickets","duration","isOnline","venue","onlineVenue","zoomMeetingId"],searchProps:["title"],defaultProps:["title","date","lang","cover","description"],properties:{description:{inputType:"textarea"}}}},ea=(n,e)=>({...Qo(n,e,{...bt,definitions:Xo(bt,Zo)}),gcpLog:{getEntries:async t=>await vt(n,e.authUser)(`/gcp-logs?q=${JSON.stringify(t)}`)}}),ta=(n,e)=>{const t=vt(n,e.authUser);return{project:{findMany:(r={})=>t(`/projects?q=${JSON.stringify(r)}`),findBySlug:(r,i={})=>t(`/projects/${r}?q=${JSON.stringify(i)}`)},topic:{findMany:(r={})=>t(`/topics?q=${JSON.stringify(r)}`),findBySlug:(r,i={})=>t(`/topics/${r}?q=${JSON.stringify(i)}`)},learningObjective:{findMany:(r={})=>t(`/learning-objectives?q=${JSON.stringify(r)}`)}}},ze=n=>n>9?`${n}`:`0${n}`,xn=n=>`${ze(n.getUTCDate())}/${ze(n.getUTCMonth()+1)}/${n.getUTCFullYear()}`,Wn=n=>`${ze(n.getUTCHours())}:${ze(n.getUTCMinutes())}:${n.getUTCSeconds()} UTC`,na=n=>`${xn(n)} ${Wn(n)}`,ra={es:"es-ES",pt:"pt-BR"},ia=(n,e="es",t=!1)=>new Intl.DateTimeFormat(ra[e],{...t&&{year:"numeric"},month:"long",day:"numeric",timeZone:"UTC"}).format(new Date(n)),sa=(n,e)=>{let t=e.getFullYear()-n.getFullYear();const r=e.getMonth()-n.getMonth();return(r<0||r===0&&e.getDate()<n.getDate())&&t--,t},oa=(n,e,t)=>{const r=i=>new Intl.NumberFormat(`${i}-${e}`,{currency:t});return r(e==="CR"?"en":n)},aa=(n,e,t,r)=>oa(e,t,r).format(n),ca=n=>parseInt(n.replace(/[,\.]/g,""),10),la=n=>{try{return JSON.parse(window.localStorage.getItem(n))}catch{return null}},da=({firebaseApiKey:n="AIzaSyAXbaEbpq8NOfn0r8mIrcoHvoGRkJThwdc",firebaseProject:e="laboratoria-la",coreApiUrl:t="https://us-central1-outpost-272720.cloudfunctions.net/core-api"}={})=>{const r=Mt({apiKey:n,authDomain:`${e}.firebaseapp.com`,databaseURL:`https://${e}.firebaseio.com`,projectId:e}),i=jo(r),s={authUser:void 0,user:void 0},o=ea(t,s);return{...ta(t,s),...o,auth:{onChange:u=>Ts(i,_=>{if(!_)return Object.assign(s,{authUser:null,user:null}),u(s);Object.assign(s,{authUser:_}),o.user.findById(_.uid).then(b=>{Object.assign(s,{user:b}),u(s)}).catch(b=>{console.error(b),Object.assign(s,{authUser:null,user:null}),u(s)})}),signIn:(u,_)=>Is(i,u,_),signOut:()=>As(i),sendPasswordResetEmail:u=>bs(i,u)},firebaseApp:r}};k.createApp=da,k.formatCurrency=aa,k.formatDate=xn,k.formatDateTime=na,k.formatMonth=ia,k.formatTime=Wn,k.getAgeAt=sa,k.loadFromLocalStorage=la,k.parseCurrency=ca,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
1486
+ */const $o=5*60,Mo=At("authIdTokenMaxAge")||$o;let Fn=null;const Uo=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>Mo)return;const i=t==null?void 0:t.token;Fn!==i&&(Fn=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function jo(n=li()){const e=$t(n,"auth");if(e.isInitialized())return e.getImmediate();const t=ts(n,{popupRedirectResolver:ko,persistence:[Vs,Ps,Tn]}),r=At("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(r,location.origin);if(location.origin===s.origin){const o=Uo(s.toString());Es(t,o,()=>o(t.currentUser)),ws(t,a=>o(a))}}const i=Xn("auth");return i&&rs(t,`http://${i}`),t}function Fo(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}Gi({loadJS(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=M("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",Fo().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="}),Lo("Browser");var Bo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bn={exports:{}};(function(n){(function(e){function t(l,g){var d=(l&65535)+(g&65535),w=(l>>16)+(g>>16)+(d>>16);return w<<16|d&65535}function r(l,g){return l<<g|l>>>32-g}function i(l,g,d,w,E,A){return t(r(t(t(g,l),t(w,A)),E),d)}function s(l,g,d,w,E,A,R){return i(g&d|~g&w,l,g,E,A,R)}function o(l,g,d,w,E,A,R){return i(g&w|d&~w,l,g,E,A,R)}function a(l,g,d,w,E,A,R){return i(g^d^w,l,g,E,A,R)}function c(l,g,d,w,E,A,R){return i(d^(g|~w),l,g,E,A,R)}function u(l,g){l[g>>5]|=128<<g%32,l[(g+64>>>9<<4)+14]=g;var d,w,E,A,R,h=1732584193,f=-271733879,p=-1732584194,m=271733878;for(d=0;d<l.length;d+=16)w=h,E=f,A=p,R=m,h=s(h,f,p,m,l[d],7,-680876936),m=s(m,h,f,p,l[d+1],12,-389564586),p=s(p,m,h,f,l[d+2],17,606105819),f=s(f,p,m,h,l[d+3],22,-1044525330),h=s(h,f,p,m,l[d+4],7,-176418897),m=s(m,h,f,p,l[d+5],12,1200080426),p=s(p,m,h,f,l[d+6],17,-1473231341),f=s(f,p,m,h,l[d+7],22,-45705983),h=s(h,f,p,m,l[d+8],7,1770035416),m=s(m,h,f,p,l[d+9],12,-1958414417),p=s(p,m,h,f,l[d+10],17,-42063),f=s(f,p,m,h,l[d+11],22,-1990404162),h=s(h,f,p,m,l[d+12],7,1804603682),m=s(m,h,f,p,l[d+13],12,-40341101),p=s(p,m,h,f,l[d+14],17,-1502002290),f=s(f,p,m,h,l[d+15],22,1236535329),h=o(h,f,p,m,l[d+1],5,-165796510),m=o(m,h,f,p,l[d+6],9,-1069501632),p=o(p,m,h,f,l[d+11],14,643717713),f=o(f,p,m,h,l[d],20,-373897302),h=o(h,f,p,m,l[d+5],5,-701558691),m=o(m,h,f,p,l[d+10],9,38016083),p=o(p,m,h,f,l[d+15],14,-660478335),f=o(f,p,m,h,l[d+4],20,-405537848),h=o(h,f,p,m,l[d+9],5,568446438),m=o(m,h,f,p,l[d+14],9,-1019803690),p=o(p,m,h,f,l[d+3],14,-187363961),f=o(f,p,m,h,l[d+8],20,1163531501),h=o(h,f,p,m,l[d+13],5,-1444681467),m=o(m,h,f,p,l[d+2],9,-51403784),p=o(p,m,h,f,l[d+7],14,1735328473),f=o(f,p,m,h,l[d+12],20,-1926607734),h=a(h,f,p,m,l[d+5],4,-378558),m=a(m,h,f,p,l[d+8],11,-2022574463),p=a(p,m,h,f,l[d+11],16,1839030562),f=a(f,p,m,h,l[d+14],23,-35309556),h=a(h,f,p,m,l[d+1],4,-1530992060),m=a(m,h,f,p,l[d+4],11,1272893353),p=a(p,m,h,f,l[d+7],16,-155497632),f=a(f,p,m,h,l[d+10],23,-1094730640),h=a(h,f,p,m,l[d+13],4,681279174),m=a(m,h,f,p,l[d],11,-358537222),p=a(p,m,h,f,l[d+3],16,-722521979),f=a(f,p,m,h,l[d+6],23,76029189),h=a(h,f,p,m,l[d+9],4,-640364487),m=a(m,h,f,p,l[d+12],11,-421815835),p=a(p,m,h,f,l[d+15],16,530742520),f=a(f,p,m,h,l[d+2],23,-995338651),h=c(h,f,p,m,l[d],6,-198630844),m=c(m,h,f,p,l[d+7],10,1126891415),p=c(p,m,h,f,l[d+14],15,-1416354905),f=c(f,p,m,h,l[d+5],21,-57434055),h=c(h,f,p,m,l[d+12],6,1700485571),m=c(m,h,f,p,l[d+3],10,-1894986606),p=c(p,m,h,f,l[d+10],15,-1051523),f=c(f,p,m,h,l[d+1],21,-2054922799),h=c(h,f,p,m,l[d+8],6,1873313359),m=c(m,h,f,p,l[d+15],10,-30611744),p=c(p,m,h,f,l[d+6],15,-1560198380),f=c(f,p,m,h,l[d+13],21,1309151649),h=c(h,f,p,m,l[d+4],6,-145523070),m=c(m,h,f,p,l[d+11],10,-1120210379),p=c(p,m,h,f,l[d+2],15,718787259),f=c(f,p,m,h,l[d+9],21,-343485551),h=t(h,w),f=t(f,E),p=t(p,A),m=t(m,R);return[h,f,p,m]}function _(l){var g,d="",w=l.length*32;for(g=0;g<w;g+=8)d+=String.fromCharCode(l[g>>5]>>>g%32&255);return d}function b(l){var g,d=[];for(d[(l.length>>2)-1]=void 0,g=0;g<d.length;g+=1)d[g]=0;var w=l.length*8;for(g=0;g<w;g+=8)d[g>>5]|=(l.charCodeAt(g/8)&255)<<g%32;return d}function S(l){return _(u(b(l),l.length*8))}function O(l,g){var d,w=b(l),E=[],A=[],R;for(E[15]=A[15]=void 0,w.length>16&&(w=u(w,l.length*8)),d=0;d<16;d+=1)E[d]=w[d]^909522486,A[d]=w[d]^1549556828;return R=u(E.concat(b(g)),512+g.length*8),_(u(A.concat(R),640))}function L(l){var g="0123456789abcdef",d="",w,E;for(E=0;E<l.length;E+=1)w=l.charCodeAt(E),d+=g.charAt(w>>>4&15)+g.charAt(w&15);return d}function v(l){return unescape(encodeURIComponent(l))}function I(l){return S(v(l))}function N(l){return L(I(l))}function C(l,g){return O(v(l),v(g))}function z(l,g){return L(C(l,g))}function $(l,g,d){return g?d?C(g,l):z(g,l):d?I(l):N(l)}n.exports?n.exports=$:e.md5=$})(Bo)})(Bn);var Ho=Bn.exports;const xo=Vo(Ho),vt=(n,e)=>async(t,r={})=>{const i=e?await e.getIdToken():null,s=await fetch(`${n}${t}`,{mode:"cors",...r,headers:{...i&&{authorization:`Bearer ${i}`},...r.body&&{"content-type":"application/json"},...r.headers},...r.body&&{body:JSON.stringify(r.body)}}),o=await s.json();if(s.status>202)throw Object.assign(new Error((o==null?void 0:o.message)||`HTTP Error ${s.status}`),{status:s.status,code:o==null?void 0:o.code,body:o});return o},Wo=n=>{const e=n.properties||{},t=n.inputProps||Object.keys(e),r=(i,s)=>{const o=e[i]||{};if([null,void 0].includes(s))return o.isRequired?{id:"value-missing-validation-error"}:void 0;if(o.enum)return o.enum.includes(s)?void 0:{id:"enum-validation-error",values:{enum:o.enum,value:s}};switch(o.type){case"integer":if(o.isScalar&&(typeof s!="number"||Number.isNaN(s)))return{id:"invalid-number-validation-error"};break;case"date":break;case"boolean":break;case"json":case"string":default:if(o.isRequired&&!s)return{id:"value-missing-validation-error"};break}};return{validate:i=>t.reduce((s,o)=>{const a=r(o,i[o]);return a?{...s,[o]:a}:s},{}),validateAttr:r}},zo=(n={})=>Object.keys(n).length?`?q=${JSON.stringify(n)}`:"",Jo=n=>[...n].reduce((e,t)=>t===t.toUpperCase()?`${e}-${t.toLowerCase()}`:`${e}${t}`,""),qo=n=>`${n[0].toLowerCase()}${n.slice(1)}`,Go=n=>{const e=Jo(n);return(t,r)=>`/${e}${t?`/${encodeURIComponent(t)}`:""}${zo(r)}`},Vn=(n,e)=>{const t=Array.isArray(e.inputProps);return Object.keys(n).reduce((r,i)=>{if(t&&!e.inputProps.includes(i))return r;const{isRef:s,isScalar:o,isRequired:a}=e.properties[i]||{};return s&&o&&!a&&n[i]===null?r:{...r,[i]:n[i]}},{})},Ko=({primaryKey:n,properties:e,...t})=>({primaryKey:n||"id",properties:Object.keys(e||{}).reduce((r,i)=>{var b,S;const s=e[i]||{},{type:o,isScalar:a,isRequired:c,isRef:u=!1}=typeof s.type=="string"?s.type==="array"?s.enum?{type:"string",isScalar:!1,isRequired:!1}:(b=s.items)!=null&&b.$ref?{type:s.items.$ref.split("/").pop(),isScalar:!1,isRequired:!1,isRef:!0}:{type:(S=s.items)==null?void 0:S.type,isScalar:!1,isRequired:!1}:{type:s.format==="date-time"?"date":s.type,isScalar:!0,isRequired:!0}:Array.isArray(s.type)?s.type.length===2?{type:s.format==="date-time"?"date":s.type[0],isScalar:!0,isRequired:!1}:{type:"json",isScalar:!0,isRequired:s.type.includes("null")}:s.$ref?{type:s.$ref.split("/").pop(),isScalar:!0,isRequired:!0,isRef:!0}:{type:s.anyOf[0].$ref.split("/").pop(),isScalar:!0,isRequired:!1,isRef:!0},_=s.inputType||(o==="integer"?"number":o);return{...r,[i]:{...e[i],type:o,isScalar:a,isRequired:typeof s.isRequired=="boolean"?s.isRequired:c,isRef:u,inputType:_}}},{}),...t}),Yo=(n,e,t,r={},i={})=>{const s=Ko(r),{primaryKey:o,properties:a}=s,c=Wo(s),u=Go(t),_=(...v)=>vt(n,e.authUser)(...v),b=({data:v,...I})=>_(u(null,I),{method:"POST",body:Vn(v,s)}),S=({data:v,...I})=>{const{where:N,...C}=I;return _(u(N[o],C),{method:"PUT",body:Vn(v,s)})},O=v=>{if(!v)return v;const I=Object.keys(v).reduce((N,C)=>{var E;const z=a[C]||{},{type:$,isScalar:l,isRef:g,format:d,items:w}=z;if(g){const A=qo($);return l?{...N,[C]:i[A].parse(v[C])}:{...N,[C]:typeof((E=i[A])==null?void 0:E.parse)=="function"?v[C].map(R=>i[A].parse(R)):v[C]}}return{...N,[C]:$==="date"&&v[C]?new Date(v[C]):v[C]}},{});return typeof s.parse=="function"?s.parse(I):I},L=Object.keys(a||{}).reduce((v,I)=>a[I].isRef&&a[I].isScalar&&a[I].isRequired?Object.assign(v,{all:v.all.concat(I),oneToOne:v.oneToOne.concat(I),requiredOneToOne:v.requiredOneToOne.concat(I)}):a[I].isRef&&a[I].isScalar?Object.assign(v,{all:v.all.concat(I),oneToOne:v.oneToOne.concat(I),optionalOneToOne:v.optionalOneToOne.concat(I)}):a[I].isRef?Object.assign(v,{all:v.all.concat(I),oneToMany:v.oneToMany.concat(I)}):v,{all:[],oneToOne:[],requiredOneToOne:[],optionalOneToOne:[],oneToMany:[]});return{get schema(){return s},get relations(){return L},parse:O,validateAttr:c.validateAttr,validate:c.validate,findMany:v=>_(u(null,v)).then(I=>I.map(O)),findById:(v,I)=>_(u(v,I)).then(O),create:b,update:S,upsert:v=>v.where[o]?S({where:v.where,data:v.update}):b({data:v.create}),delete:v=>_(u(v),{method:"DELETE"}),stats:()=>_(u("_stats")),search:(v,I={})=>{var d;const{searchProps:N}=s,z=v.split(" ").reduce((w,E)=>[...w,{OR:N.reduce((A,R)=>{const h=R.split(".");return[...A,h.reduceRight((f,p)=>({[p]:f}),{contains:E,mode:"insensitive"})]},[])}],[]),$={...I.select,...I.include},l=(d=s.defaultProps)!=null&&d.length?Object.assign(...s.defaultProps.map(w=>({[w]:!0}))):null,g=Object.keys($).length?$:l;return _(u(null,{where:{...I.where,AND:z},...!!g&&{select:g},...I.orderBy&&{orderBy:I.orderBy},take:I.take||100}))}}},Qo=(n,e,t)=>Object.keys(t.properties).reduce((r,i)=>{const s=t.properties[i].$ref.split("/").pop();return Object.assign(r,{[i]:Yo(n,e,t.definitions[s].plural||`${i}s`,t.definitions[s],r)})},{}),Xo=(n,e)=>Object.keys(n.definitions).reduce((t,r)=>({...t,[r]:e[r]?{...n.definitions[r],...e[r],properties:Object.keys(n.definitions[r].properties).reduce((i,s)=>({...i,[s]:{...n.definitions[r].properties[s],...(e[r].properties||{})[s]}}),e[r].properties||{})}:n.definitions[r]}),{}),bt={$schema:"http://json-schema.org/draft-07/schema#",definitions:{Country:{type:"object",properties:{code:{type:"string"},name:{type:"string"},incomeFilter:{type:["integer","null"]},canApply:{type:"boolean",default:!1},capital:{type:"array",items:{type:"string"}},timeZone:{type:["string","null"]},flag:{type:["string","null"]},currency:{anyOf:[{$ref:"#/definitions/Currency"},{type:"null"}]},contracts:{type:"array",items:{$ref:"#/definitions/Contract"}},users:{type:"array",items:{$ref:"#/definitions/User"}},applications:{type:"array",items:{$ref:"#/definitions/Application"}},applicationNationalities:{type:"array",items:{$ref:"#/definitions/Application"}},educationLevels:{type:"array",items:{$ref:"#/definitions/EducationLevel"}},universities:{type:"array",items:{$ref:"#/definitions/University"}},companies:{type:"array",items:{$ref:"#/definitions/Company"}},jobs:{type:"array",items:{$ref:"#/definitions/Job"}},jobReviews:{type:"array",items:{$ref:"#/definitions/JobReviewCountry"}}}},Currency:{type:"object",properties:{code:{type:"string"},name:{type:"string"},symbol:{type:"string"},countries:{type:"array",items:{$ref:"#/definitions/Country"}}}},User:{type:"object",properties:{uid:{type:"string"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},email:{type:"string"},firstName:{type:"string"},lastName:{type:["string","null"]},role:{type:["string","null"],enum:["staff","manager","finance","admin"]},disabled:{type:"boolean",default:!1},lang:{type:["string","null"],enum:["en","es","pt"]},referralSource:{type:["string","null"],enum:["word_of_mouth","codigo_m","social","google","print","tv","radio","other"]},identifiesAsFemale:{type:["boolean","null"]},dateOfBirth:{type:["string","null"],format:"date-time"},identificationNumber:{type:["string","null"]},mobileNumber:{type:["string","null"]},github:{type:["string","null"]},linkedin:{type:["string","null"]},bio:{type:["string","null"]},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},signupCohort:{anyOf:[{$ref:"#/definitions/Cohort"},{type:"null"}]},applications:{type:"array",items:{$ref:"#/definitions/Application"}},contractsAsCheckPilot:{type:"array",items:{$ref:"#/definitions/Contract"}},contracts:{type:"array",items:{$ref:"#/definitions/Contract"}},dropouts:{type:"array",items:{$ref:"#/definitions/Dropout"}},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}},messages:{type:"array",items:{$ref:"#/definitions/Message"}},students:{type:"array",items:{$ref:"#/definitions/Student"}},activityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},authoredActivityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},jobReviews:{type:"array",items:{$ref:"#/definitions/JobReview"}},jobApplications:{type:"array",items:{$ref:"#/definitions/JobApplication"}},eventRsvps:{type:"array",items:{$ref:"#/definitions/EventRsvp"}}}},Track:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},programs:{type:"array",items:{$ref:"#/definitions/Program"}},crawlerQueries:{type:"array",items:{$ref:"#/definitions/CrawlerQuery"}},jobProfileTypes:{type:"array",items:{$ref:"#/definitions/JobProfileType"}},jobReviews:{type:"array",items:{$ref:"#/definitions/JobReviewTrack"}},applicationChallenges:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeTrack"}}}},Program:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},description:{type:["string","null"]},langs:{type:"array",enum:["en","es","pt"]},hidden:{type:"boolean",default:!1},track:{$ref:"#/definitions/Track"},cohorts:{type:"array",items:{$ref:"#/definitions/Cohort"}},stages:{type:"array",items:{$ref:"#/definitions/Stage"}}}},Stage:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},order:{type:"integer"},program:{$ref:"#/definitions/Program"},cohorts:{type:"array",items:{$ref:"#/definitions/Cohort"}}}},Cohort:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},lang:{type:["string","null"],enum:["en","es","pt"]},start:{type:"string",format:"date-time"},end:{type:"string",format:"date-time"},timeZone:{type:["string","null"]},startTime:{type:["string","null"]},endTime:{type:["string","null"]},legacySlug:{type:"string"},vacancies:{type:["integer","null"]},admissionStart:{type:["string","null"],format:"date-time"},admissionEnd:{type:["string","null"],format:"date-time"},admissionCountries:{type:"array",items:{type:"string"}},placementStart:{type:["string","null"],format:"date-time"},placementDuration:{type:["integer","null"]},program:{$ref:"#/definitions/Program"},stage:{$ref:"#/definitions/Stage"},applications:{type:"array",items:{$ref:"#/definitions/Application"}},links:{type:"array",items:{$ref:"#/definitions/CohortLink"}},dropouts:{type:"array",items:{$ref:"#/definitions/Dropout"}},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}},students:{type:"array",items:{$ref:"#/definitions/Student"}},signupUsers:{type:"array",items:{$ref:"#/definitions/User"}},activityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},jobApplications:{type:"array",items:{$ref:"#/definitions/JobApplication"}}}},Student:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},legacyStudentCode:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"},projecTeamMembers:{type:"array",items:{$ref:"#/definitions/StudentProjecTeamMember"}}}},CohortLink:{type:"object",properties:{id:{type:"integer"},url:{type:"string"},visibility:{type:"string",enum:["public","members","staff","team","admin"]},cohort:{$ref:"#/definitions/Cohort"}}},Dropout:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},date:{type:"string",format:"date-time"},reasonDetail:{type:["string","null"]},notes:{type:["string","null"]},staffSad:{type:"boolean"},covidRelated:{type:["boolean","null"]},reason:{type:"string",enum:["dropout","noShow","invitedToLeave","changeCohort"]},completedProjects:{type:"integer"},lastProject:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"}}},IscedLevel:{type:"object",properties:{id:{type:"integer"},label:{type:"string"},educationLevels:{type:"array",items:{$ref:"#/definitions/EducationLevel"}}}},EducationLevel:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},label:{type:"string"},country:{$ref:"#/definitions/Country"},iscedLevel:{$ref:"#/definitions/IscedLevel"},applications:{type:"array",items:{$ref:"#/definitions/Application"}}}},University:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},name:{type:"string"},filter:{type:"boolean"},country:{$ref:"#/definitions/Country"},applications:{type:"array",items:{$ref:"#/definitions/Application"}}}},Application:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},dateOfBirth:{type:"string",format:"date-time"},isAllowedToWork:{type:"boolean"},hasValidIdDocument:{type:"boolean"},locality:{type:["number","string","boolean","object","array","null"]},householdSize:{type:"integer"},children:{type:"integer"},householdIncome:{type:"integer"},racialIdentity:{type:["string","null"]},schoolType:{type:["string","null"],enum:["private","public","other","subsidized","mixed"]},educationSubject:{type:["string","null"],enum:["design_and_media","software_engineering","engineering","management_and_business","languages","science","health","social_sciences","arts","comms_and_advertising","education","cooking","tourism","economics_and_accounting","law","other"]},isStudying:{type:"boolean"},englishLevel:{type:["string","null"],enum:["NO","A1","A2","B1","B2","C1","C2"]},workStatus:{type:"string",enum:["never","not_now","yes"]},isLookingForWork:{type:["boolean","null"]},monthsLookingForWork:{type:["integer","null"]},monthsUnemployed:{type:["integer","null"]},workRole:{type:["string","null"],enum:["waitress","promoter","manager","cashier","intern","operative","call_center","receptionist","sales_agent","assistant","professional","technical","consultant","other"]},freelance:{type:["boolean","null"]},workFormal:{type:["boolean","null"]},workIncome:{type:["integer","null"]},failedFilters:{type:"array",items:{type:"string"}},bypassFilters:{type:"boolean",default:!1},isReady:{type:"boolean",default:!1},isReturningApplicant:{type:["boolean","null"]},legacyAdmissionCohortSlug:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"},country:{$ref:"#/definitions/Country"},nationality:{$ref:"#/definitions/Country"},educationLevel:{$ref:"#/definitions/EducationLevel"},university:{anyOf:[{$ref:"#/definitions/University"},{type:"null"}]},challengeAssignments:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeAssignment"}}},config:{maxAge:120}},ApplicationChallenge:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},slug:{type:"string"},version:{type:"string"},trackId:{type:"integer"},tracks:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeTrack"}},langs:{type:"array",enum:["en","es","pt"]},json:{type:"string"},archived:{type:"boolean",default:!1},assignments:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeAssignment"}}}},ApplicationChallengeAssignment:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},application:{$ref:"#/definitions/Application"},challenge:{$ref:"#/definitions/ApplicationChallenge"}}},ApplicationChallengeTrack:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},applicationChallenge:{$ref:"#/definitions/ApplicationChallenge"},track:{$ref:"#/definitions/Track"}}},ActivityLogEntry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},type:{type:"string",enum:["challenge","application_filter","application_filter_bypass","application_cohort_change","project_assessment","project_assessment_request","project_assessment_assignment","project_assessment_bypass"]},data:{type:["number","string","boolean","object","array","null"]},path:{type:"string"},author:{$ref:"#/definitions/User"},user:{$ref:"#/definitions/User"},cohort:{$ref:"#/definitions/Cohort"}}},StudentProject:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},projectSlug:{type:"string"},projectVersion:{type:"string"},links:{type:"array",items:{$ref:"#/definitions/StudentProjectLink"}},team:{type:"array",items:{$ref:"#/definitions/StudentProjecTeamMember"}}}},StudentProjecTeamMember:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},studentProject:{$ref:"#/definitions/StudentProject"},student:{$ref:"#/definitions/Student"}}},StudentProjectLink:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},url:{type:"string"},studentProject:{$ref:"#/definitions/StudentProject"}}},Contract:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},isEmployment:{type:"boolean"},feeAmount:{type:"integer"},hoursPerWeek:{type:"integer"},start:{type:"string",format:"date-time"},end:{type:["string","null"],format:"date-time"},isTrial:{type:"boolean",default:!1},source:{type:["string","null"],enum:["graduate","referral","jazzhr","web","linkedin","other"]},checkPilot:{anyOf:[{$ref:"#/definitions/User"},{type:"null"}]},country:{$ref:"#/definitions/Country"},user:{$ref:"#/definitions/User"},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}}}},Gig:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},role:{type:"string",enum:["bm","pdc","js","ux"]},hoursPerWeek:{type:"integer"},start:{type:"string",format:"date-time"},end:{type:["string","null"],format:"date-time"},cohort:{$ref:"#/definitions/Cohort"},contract:{$ref:"#/definitions/Contract"},user:{$ref:"#/definitions/User"}}},Message:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},key:{type:"string"},from:{type:"string"},to:{type:"string"},transport:{type:"string",enum:["mandrill","slack"]},status:{type:"string",default:"PENDING",enum:["PENDING","QUEUED","ERROR","SENT"]},data:{type:["number","string","boolean","object","array","null"]},taskInfo:{type:["number","string","boolean","object","array","null"]},user:{anyOf:[{$ref:"#/definitions/User"},{type:"null"}]},logs:{type:"array",items:{$ref:"#/definitions/MessageLog"}}}},MessageLog:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},statusText:{type:["string","null"]},message:{$ref:"#/definitions/Message"}}},Industry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},companies:{type:"array",items:{$ref:"#/definitions/Company"}}}},Company:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},source:{type:"string"},sourceId:{type:"string"},name:{type:"string"},size:{type:["string","null"],enum:["A_2_10","B_11_50","C_51_200","D_201_500","E_501_1000","F_1001_5000","G_5001_10000","H_10001_plus"]},data:{type:["number","string","boolean","object","array","null"]},web:{type:["string","null"]},twitter:{type:["string","null"]},github:{type:["string","null"]},facebook:{type:["string","null"]},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},industry:{anyOf:[{$ref:"#/definitions/Industry"},{type:"null"}]},jobs:{type:"array",items:{$ref:"#/definitions/Job"}},categories:{type:"array",enum:["Tech_Consultancy","Digital_Transformation","Agency","Startups","High_tech","Traditional_Consulting"]}}},Job:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},source:{type:"string"},sourceId:{type:"string"},title:{type:"string"},publishedAt:{type:"string",format:"date-time"},modality:{type:"string"},publicUrl:{type:["string","null"]},location:{type:["string","null"]},data:{type:["number","string","boolean","object","array","null"]},description:{type:["string","null"]},descriptionHTML:{type:["string","null"]},functions:{type:["string","null"]},functionsHTML:{type:["string","null"]},seniority:{type:["string","null"]},remote:{type:["boolean","null"]},remoteOption:{type:["string","null"],enum:["remote_for_now","locally_remote","fully_remote","no_remote","mixed"]},lang:{type:["string","null"],enum:["en","es","pt"]},maxSalary:{type:["integer","null"]},minSalary:{type:["integer","null"]},minExperience:{type:["integer","null"]},maxExperience:{type:["integer","null"]},tags:{type:"array",items:{type:"string"}},company:{$ref:"#/definitions/Company"},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},reviews:{type:"array",items:{$ref:"#/definitions/JobReview"}},applications:{type:"array",items:{$ref:"#/definitions/JobApplication"}},crawlerQueries:{type:"array",items:{$ref:"#/definitions/JobCrawlerQuery"}},crawlerLocations:{type:"array",items:{$ref:"#/definitions/JobCrawlerLocation"}}}},JobProfileType:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},learningObjectives:{type:["number","string","boolean","object","array","null"]},track:{anyOf:[{$ref:"#/definitions/Track"},{type:"null"}]},reviews:{type:"array",items:{$ref:"#/definitions/JobReviewProfileType"}}}},JobReview:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},isValid:{type:"boolean"},invalidReason:{type:["string","null"],enum:["unrelated","experience","qualifications","other"]},comment:{type:["string","null"]},author:{$ref:"#/definitions/User"},job:{$ref:"#/definitions/Job"},profileTypes:{type:"array",items:{$ref:"#/definitions/JobReviewProfileType"}},validCountries:{type:"array",items:{$ref:"#/definitions/JobReviewCountry"}},validTracks:{type:"array",items:{$ref:"#/definitions/JobReviewTrack"}}}},JobReviewProfileType:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},review:{$ref:"#/definitions/JobReview"},profileType:{$ref:"#/definitions/JobProfileType"}}},JobApplication:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},status:{type:"string",default:"pending",enum:["pending","applied","interview","challenge","followup","hired","not_hired"]},hireDate:{type:["string","null"],format:"date-time"},jobStartDate:{type:["string","null"],format:"date-time"},netSalary:{type:["integer","null"]},grossSalary:{type:["integer","null"]},currency:{type:["string","null"]},job:{$ref:"#/definitions/Job"},user:{$ref:"#/definitions/User"},cohort:{anyOf:[{$ref:"#/definitions/Cohort"},{type:"null"}]}}},CrawlerQuery:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},query:{type:"string"},enabled:{type:"boolean",default:!0},track:{$ref:"#/definitions/Track"},jobs:{type:"array",items:{$ref:"#/definitions/JobCrawlerQuery"}}}},JobCrawlerQuery:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},job:{$ref:"#/definitions/Job"},query:{$ref:"#/definitions/CrawlerQuery"}}},CrawlerLocation:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},enabled:{type:"boolean",default:!0},jobs:{type:"array",items:{$ref:"#/definitions/JobCrawlerLocation"}}}},JobCrawlerLocation:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},job:{$ref:"#/definitions/Job"},location:{$ref:"#/definitions/CrawlerLocation"}}},JobReviewCountry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},review:{$ref:"#/definitions/JobReview"},country:{$ref:"#/definitions/Country"}}},JobReviewTrack:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},review:{$ref:"#/definitions/JobReview"},track:{$ref:"#/definitions/Track"}}},Event:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},status:{type:"string",enum:["draft","published","cancelled","archived"]},title:{type:"string"},start:{type:"string",format:"date-time"},end:{type:"string",format:"date-time"},timezone:{type:["string","null"]},lang:{type:"string",enum:["en","es","pt"]},cover:{type:"string"},shortDescription:{type:"string"},description:{type:["string","null"]},maxTickets:{type:"integer"},isOnline:{type:"boolean"},venue:{type:["number","string","boolean","object","array","null"]},onlineVenue:{type:["string","null"]},zoomMeetingId:{type:["string","null"]},videoUrl:{type:["string","null"]},rsvps:{type:"array",items:{$ref:"#/definitions/EventRsvp"}}}},EventRsvp:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},status:{type:"string",enum:["yes","no","waitlist","maybe"]},event:{$ref:"#/definitions/Event"},user:{$ref:"#/definitions/User"}}}},type:"object",properties:{country:{$ref:"#/definitions/Country"},currency:{$ref:"#/definitions/Currency"},user:{$ref:"#/definitions/User"},track:{$ref:"#/definitions/Track"},program:{$ref:"#/definitions/Program"},stage:{$ref:"#/definitions/Stage"},cohort:{$ref:"#/definitions/Cohort"},student:{$ref:"#/definitions/Student"},cohortLink:{$ref:"#/definitions/CohortLink"},dropout:{$ref:"#/definitions/Dropout"},iscedLevel:{$ref:"#/definitions/IscedLevel"},educationLevel:{$ref:"#/definitions/EducationLevel"},university:{$ref:"#/definitions/University"},application:{$ref:"#/definitions/Application"},applicationChallenge:{$ref:"#/definitions/ApplicationChallenge"},applicationChallengeAssignment:{$ref:"#/definitions/ApplicationChallengeAssignment"},applicationChallengeTrack:{$ref:"#/definitions/ApplicationChallengeTrack"},activityLogEntry:{$ref:"#/definitions/ActivityLogEntry"},studentProject:{$ref:"#/definitions/StudentProject"},studentProjecTeamMember:{$ref:"#/definitions/StudentProjecTeamMember"},studentProjectLink:{$ref:"#/definitions/StudentProjectLink"},contract:{$ref:"#/definitions/Contract"},gig:{$ref:"#/definitions/Gig"},message:{$ref:"#/definitions/Message"},messageLog:{$ref:"#/definitions/MessageLog"},industry:{$ref:"#/definitions/Industry"},company:{$ref:"#/definitions/Company"},job:{$ref:"#/definitions/Job"},jobProfileType:{$ref:"#/definitions/JobProfileType"},jobReview:{$ref:"#/definitions/JobReview"},jobReviewProfileType:{$ref:"#/definitions/JobReviewProfileType"},jobApplication:{$ref:"#/definitions/JobApplication"},crawlerQuery:{$ref:"#/definitions/CrawlerQuery"},jobCrawlerQuery:{$ref:"#/definitions/JobCrawlerQuery"},crawlerLocation:{$ref:"#/definitions/CrawlerLocation"},jobCrawlerLocation:{$ref:"#/definitions/JobCrawlerLocation"},jobReviewCountry:{$ref:"#/definitions/JobReviewCountry"},jobReviewTrack:{$ref:"#/definitions/JobReviewTrack"},event:{$ref:"#/definitions/Event"},eventRsvp:{$ref:"#/definitions/EventRsvp"}}},Hn=24*(60*60*1e3),Zo={Country:{primaryKey:"code",plural:"countries",inputProps:["name","incomeFilter","currency","canApply","flag"],searchProps:["code","name","timeZone"],defaultProps:["code","name","timeZone","currency"],getOptionLabel:({code:n,name:e})=>`${n} / ${e}`},Currency:{primaryKey:"code",plural:"currencies",searchProps:["code","name"],defaultProps:["code","name","symbol"]},ActivityLogEntry:{plural:"activityLog"},User:{primaryKey:"uid",inputProps:["firstName","lastName","email","password","lang","identifiesAsFemale","dateOfBirth","country","identificationNumber","mobileNumber","github","linkedin","bio","role","signupCohort","disabled","referralSource"],searchProps:["firstName","lastName","email"],getOptionLabel:({firstName:n,lastName:e,email:t})=>`${n} ${e} (${t})`,properties:{email:{inputType:"email"},lastName:{isRequired:!0},mobileNumber:{inputType:"phone"},bio:{inputType:"textarea"}},parse:n=>{const e=n.github?`https://github.com/${n.github}.png?size=`:`https://www.gravatar.com/avatar/${xo(n.email)}?s=`;return{...n,fullName:`${n.firstName||""}${n.lastName?` ${n.lastName}`:""}`,avatar:t=>`${e}${t}`,isStaff:["staff","manager","finance","admin"].includes(n.role),isManager:["manager","finance","admin"].includes(n.role),isFinance:["finance","admin"].includes(n.role),isAdmin:n.role==="admin"}}},Track:{searchProps:["name"]},Program:{searchProps:["name"]},Stage:{searchProps:["name"]},Cohort:{inputProps:["program","stage","lang","name","start","end","timeZone","startTime","endTime","vacancies","admissionStart","admissionEnd","placementStart","admissionCountries","links"],searchProps:["name"],getOptionLabel:({id:n,name:e,stage:t})=>`${e}${t?` - ${t.name}`:""} (id: ${n})`,properties:{},parse:n=>{var s,o;const e=Date.now();let t;if(n.placementStart){const a=n.placementDuration||270;new Date(+n.placementStart+a*24*60*60*1e3)<e?t="placement_ended":n.placementStart<e&&(t="placement_started")}!t&&n.end<e&&(t="ended"),!t&&n.start<e&&(t="started");const r=n.admissionEnd?+n.admissionEnd+Hn:!1;!t&&r&&r<e&&(t="admission_ended"),!t&&n.admissionStart&&n.admissionStart<e&&(t="admission_started"),!t&&n.admissionStart&&n.admissionEnd&&(t="planned"),t||(t="draft");const i=n.start>e&&n.vacancies?n.vacancies:((s=n._count)==null?void 0:s.students)||((o=n.students)==null?void 0:o.length)||0;return{...n,status:t,size:i}}},Student:{inputProps:["cohort","user"],searchProps:["user.firstName","user.lastName","user.email"],defaultProps:["id","cohort","user"],getOptionLabel:({user:n,cohort:e})=>`${n==null?void 0:n.firstName} ${(n==null?void 0:n.lastName)||""} (${e==null?void 0:e.name})`},Dropout:{inputProps:["cohort","user","date","reason","reasonDetail","lastProject","completedProjects","notes","staffSad","covidRelated"],searchProps:["user.uid","user.firstName","user.lastName","user.email","cohort.name"]},Contract:{inputProps:["user","country","isEmployment","feeAmount","hoursPerWeek","start","end","isTrial","checkPilot","source"],searchProps:["user.firstName","user.lastName","user.email"],getOptionLabel:({id:n,user:e})=>`${e==null?void 0:e.firstName} (id: ${n})`},Gig:{inputProps:["cohort","user","contract","role","hoursPerWeek","start","end"]},Application:{inputProps:["user","cohort","dateOfBirth","country","locality","nationality","isAllowedToWork","hasValidIdDocument","householdSize","children","householdIncome","racialIdentity","educationLevel","schoolType","educationSubject","university","isStudying","englishLevel","workStatus","isLookingForWork","monthsLookingForWork","monthsUnemployed","workRole","freelance","workFormal","workIncome","isReady","bypassFilters"],properties:{locality:{isRequired:!0},englishLevel:{isRequired:!0},isReady:{isRequired:!1},bypassFilters:{isRequired:!1}},parse:n=>{var s,o,a;const e=typeof n.hasFailedFilters=="boolean"?n.hasFailedFilters:typeof((s=n.failedFilters)==null?void 0:s.length)=="number"?n.failedFilters.length>0:void 0;if(!((o=n.cohort)!=null&&o.admissionEnd)||typeof e>"u")return n;const t=Date.now(),{maxAge:r}=bt.definitions.Application.config;let i;return n.isReady?i="ready":e&&!n.bypassFilters?i="rejected":n.createdAt<t-r*Hn?i="expired":((a=n.cohort)==null?void 0:a.status)!=="admission_started"?i="admission_ended":i="active",{...n,status:i}}},IscedLevel:{parse:n=>{const e=Math.floor(n.id/10);return{...n,level:e,completed:e*10<n.id}}},EducationLevel:{searchProps:["label"]},University:{plural:"universities",searchProps:["name"]},Company:{plural:"companies"},CrawlerQuery:{plural:"crawlerQueries"},JobCrawlerQuery:{plural:"jobCrawlerQueries"},Event:{inputProps:["status","title","start","end","timezone","lang","cover","shortDescription","description","maxTickets","isOnline","venue","onlineVenue","zoomMeetingId","videoUrl"],searchProps:["title"],defaultProps:["title","date","lang","cover","shortDescription"],properties:{description:{inputType:"textarea"}}}},ea=(n,e)=>({...Qo(n,e,{...bt,definitions:Xo(bt,Zo)}),gcpLog:{getEntries:async t=>await vt(n,e.authUser)(`/gcp-logs?q=${JSON.stringify(t)}`)}}),ta=(n,e)=>{const t=vt(n,e.authUser);return{project:{findMany:(r={})=>t(`/projects?q=${JSON.stringify(r)}`),findBySlug:(r,i={})=>t(`/projects/${r}?q=${JSON.stringify(i)}`)},topic:{findMany:(r={})=>t(`/topics?q=${JSON.stringify(r)}`),findBySlug:(r,i={})=>t(`/topics/${r}?q=${JSON.stringify(i)}`)},learningObjective:{findMany:(r={})=>t(`/learning-objectives?q=${JSON.stringify(r)}`)}}},ze=n=>n>9?`${n}`:`0${n}`,xn=n=>`${ze(n.getUTCDate())}/${ze(n.getUTCMonth()+1)}/${n.getUTCFullYear()}`,Wn=n=>`${ze(n.getUTCHours())}:${ze(n.getUTCMinutes())}:${n.getUTCSeconds()} UTC`,na=n=>`${xn(n)} ${Wn(n)}`,ra={es:"es-ES",pt:"pt-BR"},ia=(n,e="es",t=!1)=>new Intl.DateTimeFormat(ra[e],{...t&&{year:"numeric"},month:"long",day:"numeric",timeZone:"UTC"}).format(new Date(n)),sa=(n,e)=>{let t=e.getFullYear()-n.getFullYear();const r=e.getMonth()-n.getMonth();return(r<0||r===0&&e.getDate()<n.getDate())&&t--,t},oa=(n,e,t)=>{const r=i=>new Intl.NumberFormat(`${i}-${e}`,{currency:t});return r(e==="CR"?"en":n)},aa=(n,e,t,r)=>oa(e,t,r).format(n),ca=n=>parseInt(n.replace(/[,\.]/g,""),10),la=n=>{try{return JSON.parse(window.localStorage.getItem(n))}catch{return null}},da=({firebaseApiKey:n="AIzaSyAXbaEbpq8NOfn0r8mIrcoHvoGRkJThwdc",firebaseProject:e="laboratoria-la",coreApiUrl:t="https://us-central1-outpost-272720.cloudfunctions.net/core-api"}={})=>{const r=Mt({apiKey:n,authDomain:`${e}.firebaseapp.com`,databaseURL:`https://${e}.firebaseio.com`,projectId:e}),i=jo(r),s={authUser:void 0,user:void 0},o=ea(t,s);return{...ta(t,s),...o,auth:{onChange:u=>Ts(i,_=>{if(!_)return Object.assign(s,{authUser:null,user:null}),u(s);Object.assign(s,{authUser:_}),o.user.findById(_.uid).then(b=>{Object.assign(s,{user:b}),u(s)}).catch(b=>{console.error(b),Object.assign(s,{authUser:null,user:null}),u(s)})}),signIn:(u,_)=>Is(i,u,_),signOut:()=>As(i),sendPasswordResetEmail:u=>bs(i,u)},firebaseApp:r}};k.createApp=da,k.formatCurrency=aa,k.formatDate=xn,k.formatDateTime=na,k.formatMonth=ia,k.formatTime=Wn,k.getAgeAt=sa,k.loadFromLocalStorage=la,k.parseCurrency=ca,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laboratoria/sdk-js",
3
- "version": "7.6.0-beta.2",
3
+ "version": "7.6.0-beta.5",
4
4
  "description": "Laboratoria JavaScript (browser) SDK",
5
5
  "license": "MIT",
6
6
  "type": "module",