@instantdb/platform 1.0.41 → 1.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,17 @@
1
1
 
2
- > @instantdb/platform@1.0.41 build /home/runner/work/instant/instant/client/packages/platform
2
+ > @instantdb/platform@1.0.42 build /home/runner/work/instant/instant/client/packages/platform
3
3
  > rm -rf dist; npm run build:tshy && npm run build:standalone && npm run check-exports
4
4
 
5
5
  npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
6
6
  npm warn Unknown user config "always-auth". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
7
7
 
8
- > @instantdb/platform@1.0.41 build:tshy
8
+ > @instantdb/platform@1.0.42 build:tshy
9
9
  > tshy
10
10
 
11
11
  npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
12
12
  npm warn Unknown user config "always-auth". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
13
13
 
14
- > @instantdb/platform@1.0.41 build:standalone
14
+ > @instantdb/platform@1.0.42 build:standalone
15
15
  > vite build
16
16
 
17
17
  vite v5.4.14 building for production...
@@ -21,15 +21,15 @@ rendering chunks...
21
21
  computing gzip size...
22
22
  dist/standalone/index.umd.cjs 364.59 kB │ gzip: 100.33 kB
23
23
  dist/standalone/index.js 486.59 kB │ gzip: 116.91 kB
24
- ✓ built in 2.88s
24
+ ✓ built in 3.29s
25
25
  npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
26
26
  npm warn Unknown user config "always-auth". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
27
27
 
28
- > @instantdb/platform@1.0.41 check-exports
28
+ > @instantdb/platform@1.0.42 check-exports
29
29
  > attw --pack .
30
30
 
31
31
 
32
- @instantdb/platform v1.0.41
32
+ @instantdb/platform v1.0.42
33
33
 
34
34
  Build tools:
35
35
  - @arethetypeswrong/cli@^0.17.4
@@ -839,7 +839,7 @@ class ve extends W {
839
839
  }
840
840
  }
841
841
  typeof window < "u" && typeof window.localStorage < "u" && (window.localStorage.getItem("devBackend"), window.localStorage.getItem("__instantLogging"), window.localStorage.getItem("__devtoolLocalDash"));
842
- const Be = "v1.0.41";
842
+ const Be = "v1.0.42";
843
843
  class ae {
844
844
  constructor(t, s, e, i = { indexed: !1, unique: !1 }) {
845
845
  m(this, "valueType");
@@ -1,4 +1,4 @@
1
- (function(w,N){typeof exports=="object"&&typeof module<"u"?N(exports):typeof define=="function"&&define.amd?define(["exports"],N):(w=typeof globalThis<"u"?globalThis:w||self,N(w.instant={}))})(this,function(w){"use strict";var Mo=Object.defineProperty;var Ji=w=>{throw TypeError(w)};var Fo=(w,N,k)=>N in w?Mo(w,N,{enumerable:!0,configurable:!0,writable:!0,value:k}):w[N]=k;var m=(w,N,k)=>Fo(w,typeof N!="symbol"?N+"":N,k),Ts=(w,N,k)=>N.has(w)||Ji("Cannot "+k);var x=(w,N,k)=>(Ts(w,N,"read from private field"),k?k.call(w):N.get(w)),K=(w,N,k)=>N.has(w)?Ji("Cannot add the same private member more than once"):N instanceof WeakSet?N.add(w):N.set(w,k),Y=(w,N,k,Ke)=>(Ts(w,N,"write to private field"),Ke?Ke.call(w,k):N.set(w,k),k),ce=(w,N,k)=>(Ts(w,N,"access private method"),k);var X,rt,Ve,He,at,te,he,nt,De,oe,se,Ot,Dt,Lt,F,_;class N extends Error{constructor(s){super(s.message);m(this,"error");m(this,"errorDescription");const e=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,N),this.name="InstantOAuthError",this.error=s.error,this.errorDescription=s.errorDescription}get[Symbol.toStringTag](){return"InstantOAuthError"}}const k={Remove:"remove",Replace:"replace",Add:"add"},Ke=Symbol.for("__MUTATIVE_PROXY_DRAFT__"),ct=Symbol.iterator,re={mutable:"mutable",immutable:"immutable"},Ft={};function Je(r,t){return r instanceof Map?r.has(t):Object.prototype.hasOwnProperty.call(r,t)}function As(r,t){if(t in r){let s=Reflect.getPrototypeOf(r);for(;s;){const e=Reflect.getOwnPropertyDescriptor(s,t);if(e)return e;s=Reflect.getPrototypeOf(s)}}}function Ss(r){return Object.getPrototypeOf(r)===Set.prototype}function Is(r){return Object.getPrototypeOf(r)===Map.prototype}function ee(r){var t;return(t=r.copy)!==null&&t!==void 0?t:r.original}function Bt(r){return!!L(r)}function L(r){return typeof r!="object"?null:r==null?void 0:r[Ke]}function Rt(r){var t;const s=L(r);return s?(t=s.copy)!==null&&t!==void 0?t:s.original:r}function Se(r,t){if(!r||typeof r!="object")return!1;let s;return Object.getPrototypeOf(r)===Object.prototype||Array.isArray(r)||r instanceof Map||r instanceof Set||!!(t!=null&&t.mark)&&((s=t.mark(r,re))===re.immutable||typeof s=="function")}function Es(r,t=[]){if(Object.hasOwnProperty.call(r,"key")){const s=r.parent.copy,e=L(xe(s,r.key));if(e!==null&&(e==null?void 0:e.original)!==r.original)return null;const i=r.parent.type===3,a=i?Array.from(r.parent.setMap.keys()).indexOf(r.key):r.key;if(!(i&&s.size>a||Je(s,a)))return null;t.push(a)}if(r.parent)return Es(r.parent,t);t.reverse();try{Wi(r.copy,t)}catch{return null}return t}function We(r){return Array.isArray(r)?1:r instanceof Map?2:r instanceof Set?3:0}function xe(r,t){return We(r)===2?r.get(t):r[t]}function _t(r,t,s){We(r)===2?r.set(t,s):r[t]=s}function jt(r,t){const s=L(r);return(s?ee(s):r)[t]}function Ie(r,t){return r===t?r!==0||1/r===1/t:r!==r&&t!==t}function Ee(r,t){return t?r:[""].concat(r).map(s=>{const e=`${s}`;return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")}function Wi(r,t){for(let s=0;s<t.length-1;s+=1){const e=t[s];if(r=xe(We(r)===3?Array.from(r):r,e),typeof r!="object")throw new Error(`Cannot resolve patch at '${t.join("/")}'.`)}return r}function Gi(r){const t=Object.create(Object.getPrototypeOf(r));return Reflect.ownKeys(r).forEach(s=>{let e=Reflect.getOwnPropertyDescriptor(r,s);if(e.enumerable&&e.configurable&&e.writable){t[s]=r[s];return}e.writable||(e.writable=!0,e.configurable=!0),(e.get||e.set)&&(e={configurable:!0,writable:!0,enumerable:e.enumerable,value:r[s]}),Reflect.defineProperty(t,s,e)}),t}const Xi=Object.prototype.propertyIsEnumerable;function Yi(r,t){let s;if(Array.isArray(r))return Array.prototype.concat.call(r);if(r instanceof Set){if(!Ss(r)){const e=Object.getPrototypeOf(r).constructor;return new e(r.values())}return Set.prototype.difference?Set.prototype.difference.call(r,new Set):new Set(r.values())}else if(r instanceof Map){if(!Is(r)){const e=Object.getPrototypeOf(r).constructor;return new e(r)}return new Map(r)}else if(t!=null&&t.mark&&(s=t.mark(r,re),s!==void 0)&&s!==re.mutable){if(s===re.immutable)return Gi(r);if(typeof s=="function"){if(t.enablePatches||t.enableAutoFreeze)throw new Error("You can't use mark and patches or auto freeze together.");return s()}throw new Error(`Unsupported mark result: ${s}`)}else if(typeof r=="object"&&Object.getPrototypeOf(r)===Object.prototype){const e={};return Object.keys(r).forEach(i=>{e[i]=r[i]}),Object.getOwnPropertySymbols(r).forEach(i=>{Xi.call(r,i)&&(e[i]=r[i])}),e}else throw new Error("Please check mark() to ensure that it is a stable marker draftable function.")}function J(r){r.copy||(r.copy=Yi(r.original,r.options))}function Ge(r){if(!Se(r))return Rt(r);if(Array.isArray(r))return r.map(Ge);if(r instanceof Map){const s=Array.from(r.entries()).map(([e,i])=>[e,Ge(i)]);if(!Is(r)){const e=Object.getPrototypeOf(r).constructor;return new e(s)}return new Map(s)}if(r instanceof Set){const s=Array.from(r).map(Ge);if(!Ss(r)){const e=Object.getPrototypeOf(r).constructor;return new e(s)}return new Set(s)}const t=Object.create(Object.getPrototypeOf(r));for(const s in r)t[s]=Ge(r[s]);return t}function ht(r){return Bt(r)?Ge(r):r}function le(r){var t;r.assignedMap=(t=r.assignedMap)!==null&&t!==void 0?t:new Map,r.operated||(r.operated=!0,r.parent&&le(r.parent))}function Qi(r,t){const s=We(r);if(s===0)Reflect.ownKeys(r).forEach(e=>{t(e,r[e],r)});else if(s===1){let e=0;for(const i of r)t(e,i,r),e+=1}else r.forEach((e,i)=>t(i,e,r))}function Cs(r,t,s){if(Bt(r)||!Se(r,s)||t.has(r)||Object.isFrozen(r))return;const e=r instanceof Set,i=e?new Map:void 0;if(t.add(r),Qi(r,(a,n)=>{var o;if(Bt(n)){const c=L(n);J(c);const h=!((o=c.assignedMap)===null||o===void 0)&&o.size||c.operated?c.copy:c.original;_t(e?i:r,a,h)}else Cs(n,t,s)}),i){const a=r,n=Array.from(a);a.clear(),n.forEach(o=>{a.add(i.has(o)?i.get(o):o)})}}function Zi(r,t){const s=r.type===3?r.setMap:r.copy;r.finalities.revoke.length>1&&r.assignedMap.get(t)&&s&&Cs(xe(s,t),r.finalities.handledSet,r.options)}function Ut(r){r.type===3&&r.copy&&(r.copy.clear(),r.setMap.forEach(t=>{r.copy.add(Rt(t))}))}function $t(r,t,s,e){if(r.operated&&r.assignedMap&&r.assignedMap.size>0&&!r.finalized){if(s&&e){const a=Es(r);a&&t(r,a,s,e)}r.finalized=!0}}function qt(r,t,s,e){const i=L(s);i&&(i.callbacks||(i.callbacks=[]),i.callbacks.push((a,n)=>{var o;const c=r.type===3?r.setMap:r.copy;if(Ie(xe(c,t),s)){let h=i.original;i.copy&&(h=i.copy),Ut(r),$t(r,e,a,n),r.options.enableAutoFreeze&&(r.options.updatedValues=(o=r.options.updatedValues)!==null&&o!==void 0?o:new WeakMap,r.options.updatedValues.set(h,i.original)),_t(c,t,h)}}),r.options.enableAutoFreeze&&i.finalities!==r.finalities&&(r.options.enableAutoFreeze=!1)),Se(s,r.options)&&r.finalities.draft.push(()=>{const a=r.type===3?r.setMap:r.copy;Ie(xe(a,t),s)&&Zi(r,t)})}function er(r,t,s,e,i){let{original:a,assignedMap:n,options:o}=r,c=r.copy;c.length<a.length&&([a,c]=[c,a],[s,e]=[e,s]);for(let h=0;h<a.length;h+=1)if(n.get(h.toString())&&c[h]!==a[h]){const l=t.concat([h]),u=Ee(l,i);s.push({op:k.Replace,path:u,value:ht(c[h])}),e.push({op:k.Replace,path:u,value:ht(a[h])})}for(let h=a.length;h<c.length;h+=1){const l=t.concat([h]),u=Ee(l,i);s.push({op:k.Add,path:u,value:ht(c[h])})}if(a.length<c.length){const{arrayLengthAssignment:h=!0}=o.enablePatches;if(h){const l=t.concat(["length"]),u=Ee(l,i);e.push({op:k.Replace,path:u,value:a.length})}else for(let l=c.length;a.length<l;l-=1){const u=t.concat([l-1]),f=Ee(u,i);e.push({op:k.Remove,path:f})}}}function tr({original:r,copy:t,assignedMap:s},e,i,a,n){s.forEach((o,c)=>{const h=xe(r,c),l=ht(xe(t,c)),u=o?Je(r,c)?k.Replace:k.Add:k.Remove;if(Ie(h,l)&&u===k.Replace)return;const f=e.concat(c),d=Ee(f,n);i.push(u===k.Remove?{op:u,path:d}:{op:u,path:d,value:l}),a.push(u===k.Add?{op:k.Remove,path:d}:u===k.Remove?{op:k.Add,path:d,value:h}:{op:k.Replace,path:d,value:h})})}function sr({original:r,copy:t},s,e,i,a){let n=0;r.forEach(o=>{if(!t.has(o)){const c=s.concat([n]),h=Ee(c,a);e.push({op:k.Remove,path:h,value:o}),i.unshift({op:k.Add,path:h,value:o})}n+=1}),n=0,t.forEach(o=>{if(!r.has(o)){const c=s.concat([n]),h=Ee(c,a);e.push({op:k.Add,path:h,value:o}),i.unshift({op:k.Remove,path:h,value:o})}n+=1})}function Xe(r,t,s,e){const{pathAsArray:i=!0}=r.options.enablePatches;switch(r.type){case 0:case 2:return tr(r,t,s,e,i);case 1:return er(r,t,s,e,i);case 3:return sr(r,t,s,e,i)}}const lt=(r,t,s=!1)=>{if(typeof r=="object"&&r!==null&&(!Se(r,t)||s))throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.")},zt={get size(){return ee(L(this)).size},has(r){return ee(L(this)).has(r)},set(r,t){const s=L(this),e=ee(s);return(!e.has(r)||!Ie(e.get(r),t))&&(J(s),le(s),s.assignedMap.set(r,!0),s.copy.set(r,t),qt(s,r,t,Xe)),this},delete(r){if(!this.has(r))return!1;const t=L(this);return J(t),le(t),t.original.has(r)?t.assignedMap.set(r,!1):t.assignedMap.delete(r),t.copy.delete(r),!0},clear(){const r=L(this);if(this.size){J(r),le(r),r.assignedMap=new Map;for(const[t]of r.original)r.assignedMap.set(t,!1);r.copy.clear()}},forEach(r,t){const s=L(this);ee(s).forEach((e,i)=>{r.call(t,this.get(i),i,this)})},get(r){var t,s;const e=L(this),i=ee(e).get(r),a=((s=(t=e.options).mark)===null||s===void 0?void 0:s.call(t,i,re))===re.mutable;if(e.options.strict&&lt(i,e.options,a),a||e.finalized||!Se(i,e.options)||i!==e.original.get(r))return i;const n=Ft.createDraft({original:i,parentDraft:e,key:r,finalities:e.finalities,options:e.options});return J(e),e.copy.set(r,n),n},keys(){return ee(L(this)).keys()},values(){const r=this.keys();return{[ct]:()=>this.values(),next:()=>{const t=r.next();return t.done?t:{done:!1,value:this.get(t.value)}}}},entries(){const r=this.keys();return{[ct]:()=>this.entries(),next:()=>{const t=r.next();if(t.done)return t;const s=this.get(t.value);return{done:!1,value:[t.value,s]}}}},[ct](){return this.entries()}},ir=Reflect.ownKeys(zt),ks=(r,t,{isValuesIterator:s})=>()=>{var e,i;const a=t.next();if(a.done)return a;const n=a.value;let o=r.setMap.get(n);const c=L(o),h=((i=(e=r.options).mark)===null||i===void 0?void 0:i.call(e,o,re))===re.mutable;if(r.options.strict&&lt(n,r.options,h),!h&&!c&&Se(n,r.options)&&!r.finalized&&r.original.has(n)){const l=Ft.createDraft({original:n,parentDraft:r,key:n,finalities:r.finalities,options:r.options});r.setMap.set(n,l),o=l}else c&&(o=c.proxy);return{done:!1,value:s?o:[o,o]}},ut={get size(){return L(this).setMap.size},has(r){const t=L(this);if(t.setMap.has(r))return!0;J(t);const s=L(r);return!!(s&&t.setMap.has(s.original))},add(r){const t=L(this);return this.has(r)||(J(t),le(t),t.assignedMap.set(r,!0),t.setMap.set(r,r),qt(t,r,r,Xe)),this},delete(r){if(!this.has(r))return!1;const t=L(this);J(t),le(t);const s=L(r);return s&&t.setMap.has(s.original)?(t.assignedMap.set(s.original,!1),t.setMap.delete(s.original)):(!s&&t.setMap.has(r)?t.assignedMap.set(r,!1):t.assignedMap.delete(r),t.setMap.delete(r))},clear(){if(!this.size)return;const r=L(this);J(r),le(r);for(const t of r.original)r.assignedMap.set(t,!1);r.setMap.clear()},values(){const r=L(this);J(r);const t=r.setMap.keys();return{[Symbol.iterator]:()=>this.values(),next:ks(r,t,{isValuesIterator:!0})}},entries(){const r=L(this);J(r);const t=r.setMap.keys();return{[Symbol.iterator]:()=>this.entries(),next:ks(r,t,{isValuesIterator:!1})}},keys(){return this.values()},[ct](){return this.values()},forEach(r,t){const s=this.values();let e=s.next();for(;!e.done;)r.call(t,e.value,e.value,this),e=s.next()}};Set.prototype.difference&&Object.assign(ut,{intersection(r){return Set.prototype.intersection.call(new Set(this.values()),r)},union(r){return Set.prototype.union.call(new Set(this.values()),r)},difference(r){return Set.prototype.difference.call(new Set(this.values()),r)},symmetricDifference(r){return Set.prototype.symmetricDifference.call(new Set(this.values()),r)},isSubsetOf(r){return Set.prototype.isSubsetOf.call(new Set(this.values()),r)},isSupersetOf(r){return Set.prototype.isSupersetOf.call(new Set(this.values()),r)},isDisjointFrom(r){return Set.prototype.isDisjointFrom.call(new Set(this.values()),r)}});const rr=Reflect.ownKeys(ut),Ns=new WeakSet,vs={get(r,t,s){var e,i;const a=(e=r.copy)===null||e===void 0?void 0:e[t];if(a&&Ns.has(a))return a;if(t===Ke)return r;let n;if(r.options.mark){const h=t==="size"&&(r.original instanceof Map||r.original instanceof Set)?Reflect.get(r.original,t):Reflect.get(r.original,t,s);if(n=r.options.mark(h,re),n===re.mutable)return r.options.strict&&lt(h,r.options,!0),h}const o=ee(r);if(o instanceof Map&&ir.includes(t)){if(t==="size")return Object.getOwnPropertyDescriptor(zt,"size").get.call(r.proxy);const h=zt[t];if(h)return h.bind(r.proxy)}if(o instanceof Set&&rr.includes(t)){if(t==="size")return Object.getOwnPropertyDescriptor(ut,"size").get.call(r.proxy);const h=ut[t];if(h)return h.bind(r.proxy)}if(!Je(o,t)){const h=As(o,t);return h?"value"in h?h.value:(i=h.get)===null||i===void 0?void 0:i.call(r.proxy):void 0}const c=o[t];if(r.options.strict&&lt(c,r.options),r.finalized||!Se(c,r.options))return c;if(c===jt(r.original,t)){if(J(r),r.copy[t]=Os({original:r.original[t],parentDraft:r,key:r.type===1?Number(t):t,finalities:r.finalities,options:r.options}),typeof n=="function"){const h=L(r.copy[t]);return J(h),le(h),h.copy}return r.copy[t]}return c},set(r,t,s){var e;if(r.type===3||r.type===2)throw new Error("Map/Set draft does not support any property assignment.");let i;if(r.type===1&&t!=="length"&&!(Number.isInteger(i=Number(t))&&i>=0&&(t===0||i===0||String(i)===String(t))))throw new Error("Only supports setting array indices and the 'length' property.");const a=As(ee(r),t);if(a!=null&&a.set)return a.set.call(r.proxy,s),!0;const n=jt(ee(r),t),o=L(n);return o&&Ie(o.original,s)?(r.copy[t]=s,r.assignedMap=(e=r.assignedMap)!==null&&e!==void 0?e:new Map,r.assignedMap.set(t,!1),!0):(Ie(s,n)&&(s!==void 0||Je(r.original,t))||(J(r),le(r),Je(r.original,t)&&Ie(s,r.original[t])?r.assignedMap.delete(t):r.assignedMap.set(t,!0),r.copy[t]=s,qt(r,t,s,Xe)),!0)},has(r,t){return t in ee(r)},ownKeys(r){return Reflect.ownKeys(ee(r))},getOwnPropertyDescriptor(r,t){const s=ee(r),e=Reflect.getOwnPropertyDescriptor(s,t);return e&&{writable:!0,configurable:r.type!==1||t!=="length",enumerable:e.enumerable,value:s[t]}},getPrototypeOf(r){return Reflect.getPrototypeOf(r.original)},setPrototypeOf(){throw new Error("Cannot call 'setPrototypeOf()' on drafts")},defineProperty(){throw new Error("Cannot call 'defineProperty()' on drafts")},deleteProperty(r,t){var s;return r.type===1?vs.set.call(this,r,t,void 0,r.proxy):(jt(r.original,t)!==void 0||t in r.original?(J(r),le(r),r.assignedMap.set(t,!1)):(r.assignedMap=(s=r.assignedMap)!==null&&s!==void 0?s:new Map,r.assignedMap.delete(t)),r.copy&&delete r.copy[t],!0)}};function Os(r){const{original:t,parentDraft:s,key:e,finalities:i,options:a}=r,n=We(t),o={type:n,finalized:!1,parent:s,original:t,copy:null,proxy:null,finalities:i,options:a,setMap:n===3?new Map(t.entries()):void 0};(e||"key"in r)&&(o.key=e);const{proxy:c,revoke:h}=Proxy.revocable(n===1?Object.assign([],o):o,vs);if(i.revoke.push(h),Ns.add(c),o.proxy=c,s){const l=s;l.finalities.draft.push((u,f)=>{var d,P;const S=L(c);let B=l.type===3?l.setMap:l.copy;const C=xe(B,e),D=L(C);if(D){let U=D.original;D.operated&&(U=Rt(C)),Ut(D),$t(D,Xe,u,f),l.options.enableAutoFreeze&&(l.options.updatedValues=(d=l.options.updatedValues)!==null&&d!==void 0?d:new WeakMap,l.options.updatedValues.set(U,D.original)),_t(B,e,U)}(P=S.callbacks)===null||P===void 0||P.forEach(U=>{U(u,f)})})}else{const l=L(c);l.finalities.draft.push((u,f)=>{Ut(l),$t(l,Xe,u,f)})}return c}Ft.createDraft=Os,Object.prototype.constructor.toString();const z=[];for(let r=0;r<256;++r)z.push((r+256).toString(16).slice(1));function ar(r,t=0){return(z[r[t+0]]+z[r[t+1]]+z[r[t+2]]+z[r[t+3]]+"-"+z[r[t+4]]+z[r[t+5]]+"-"+z[r[t+6]]+z[r[t+7]]+"-"+z[r[t+8]]+z[r[t+9]]+"-"+z[r[t+10]]+z[r[t+11]]+z[r[t+12]]+z[r[t+13]]+z[r[t+14]]+z[r[t+15]]).toLowerCase()}let Vt;const nr=new Uint8Array(16);function or(){if(!Vt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Vt=crypto.getRandomValues.bind(crypto)}return Vt(nr)}const Ds={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function cr(r,t,s){var i;if(Ds.randomUUID&&!r)return Ds.randomUUID();r=r||{};const e=r.random??((i=r.rng)==null?void 0:i.call(r))??or();if(e.length<16)throw new Error("Random bytes length must be >= 16");return e[6]=e[6]&15|64,e[8]=e[8]&63|128,ar(e)}function Ls(){return cr()}function hr(r,t){return r.localeCompare(t)}function lr(){let r=hr;if(typeof Intl=="object"&&Intl.hasOwnProperty("Collator"))try{r=Intl.Collator("en-US").compare}catch{}return r}lr();function ur(){const t={__etype:1,__ops:1,create:1,update:1,link:1,unlink:1,delete:1,merge:1,ruleParams:1};return new Set(Object.keys(t))}const pr=ur();function pt(r,t,s){const e={__etype:r,__ops:s};return new Proxy(e,{get:(i,a)=>{if(a==="__ops")return s;if(a==="__etype")return r;if(pr.has(a))return(n,o)=>pt(r,t,[...s,o?[a,r,t,n,o]:[a,r,t,n]])}})}function fr(r,t){return`lookup__${r}__${JSON.stringify(t)}`}function dr(r){return r.startsWith("lookup__")}function Ms(r){const[t,s,...e]=r.split("__");return[s,JSON.parse(e.join("__"))]}function mr(r){return new Proxy({__etype:r},{get(t,s){if(s==="lookup")return(i,a)=>pt(r,Ms(fr(i,a)),[]);if(s==="__etype")return r;const e=s;return dr(e)?pt(r,Ms(e),[]):pt(r,e,[])}})}function yr(){return new Proxy({},{get(r,t){return mr(t)}})}yr();class W extends Error{constructor(s,e,i){super(s);m(this,"hint");m(this,"traceId");this.hint=e,i&&(this.traceId=i);const a=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,a),Error.captureStackTrace&&Error.captureStackTrace(this,W),this.name="InstantError"}get[Symbol.toStringTag](){return"InstantError"}}class Ce extends W{constructor(s){var a,n;const e=((a=s.body)==null?void 0:a.message)||`API Error (${s.status})`;super(e,s.body.hint,((n=s.body)==null?void 0:n.traceId)||s.body["trace-id"]);m(this,"body");m(this,"status");const i=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,i),Error.captureStackTrace&&Error.captureStackTrace(this,Ce),this.name="InstantAPIError",this.status=s.status,this.body=s.body}get[Symbol.toStringTag](){return"InstantAPIError"}}typeof window<"u"&&typeof window.localStorage<"u"&&(window.localStorage.getItem("devBackend"),window.localStorage.getItem("__instantLogging"),window.localStorage.getItem("__devtoolLocalDash"));const ke="v1.0.41";class ae{constructor(t,s,e,i={indexed:!1,unique:!1}){m(this,"valueType");m(this,"required");m(this,"isIndexed");m(this,"config");m(this,"metadata",{});this.valueType=t,this.required=s,this.isIndexed=e,this.config=i}clientRequired(){return new ae(this.valueType,!1,this.isIndexed,this.config)}optional(){return new ae(this.valueType,!1,this.isIndexed,this.config)}unique(){return new ae(this.valueType,this.required,this.isIndexed,{...this.config,unique:!0})}indexed(){return new ae(this.valueType,this.required,!0,{...this.config,indexed:!0})}}class ft{constructor(t,s){m(this,"attrs");m(this,"links");this.attrs=t,this.links=s}asType(){return new ft(this.attrs,this.links)}}class dt{constructor(t,s,e){m(this,"entities");m(this,"links");m(this,"rooms");this.entities=t,this.links=s,this.rooms=e}withRoomSchema(){return new dt(this.entities,this.links,{})}}var Fs;(function(r){r.InitialSyncBatch="InitialSyncBatch",r.InitialSyncComplete="InitialSyncComplete",r.LoadFromStorage="LoadFromStorage",r.SyncTransaction="SyncTransaction",r.Error="Error"})(Fs||(Fs={}));function xr(r,t){return new dt(Bs(r,t),t,void 0)}function Pr(r){return new ft(r,{})}function br(){return new ae("string",!0,!1)}function gr(){return new ae("number",!0,!1)}function wr(){return new ae("boolean",!0,!1)}function Tr(){return new ae("date",!0,!1)}function Ar(){return new ae("json",!0,!1)}function Sr(){return new ae("json",!0,!1)}function Bs(r,t){var i,a,n,o;const s={fwd:{},rev:{}};for(const c of Object.values(t))(i=s.fwd)[a=c.forward.on]||(i[a]={}),(n=s.rev)[o=c.reverse.on]||(n[o]={}),s.fwd[c.forward.on][c.forward.label]={entityName:c.reverse.on,cardinality:c.forward.has},s.rev[c.reverse.on][c.reverse.label]={entityName:c.forward.on,cardinality:c.reverse.has};return Object.fromEntries(Object.entries(r).map(([c,h])=>[c,new ft(h.attrs,{...s.fwd[c],...s.rev[c]})]))}function Ir({entities:r,links:t,rooms:s}){const e=t??{},i=s??{};return new dt(Bs(r,e),e,i)}const V={graph:xr,schema:Ir,entity:Pr,string:br,number:gr,boolean:wr,date:Tr,json:Ar,any:Sr};function Er(){return globalThis.__instantDbSchemaHashStore=globalThis.__instantDbSchemaHashStore??new WeakMap,globalThis.__instantDbSchemaHashStore}function Cr(){return globalThis.__instantDbStore=globalThis.__instantDbStore??{},globalThis.__instantDbStore}Cr(),Er();function kr(){const r="0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz-._~";let t="";for(const s of crypto.getRandomValues(new Uint8Array(64)))t=t+r[s%r.length];return t}function Nr(r){return crypto.subtle.digest({name:"SHA-256"},new TextEncoder().encode(r))}function vr(r){return r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Or(r){return Nr(r).then(t=>vr(btoa(String.fromCharCode(...Array.from(new Uint8Array(t))))))}function Dr(){const r=Math.min(800,Math.floor(window.outerWidth*.8)),t=Math.min(630,Math.floor(window.outerHeight*.5)),s={width:r,height:t,left:Math.round(window.screenX+(window.outerWidth-r)/2),top:Math.round(window.screenY+(window.outerHeight-t)/8)},e={width:s.width,height:s.height,left:s.left,top:s.top,toolbar:0,scrollbars:1,status:1,resizable:1,menuBar:0,rel:"opener"};return Object.keys(e).map(i=>`${i}=${e[i]}`).join(",")}let Rs=null;function Lr({clientId:r,state:t,codeChallenge:s,apiURI:e,redirectUri:i,scopes:a}){const n=new URL(`${e}/platform/oauth/start`);return n.searchParams.set("client_id",r),n.searchParams.set("redirect_uri",i),n.searchParams.set("scope",a.join(" ")),n.searchParams.set("state",t),n.searchParams.set("response_type","code"),n.searchParams.set("code_challenge",s),n.searchParams.set("code_challenge_method","S256"),n.toString()}async function Mr({code:r,clientId:t,verifier:s,apiURI:e,redirectUri:i}){const a=await fetch(`${e}/platform/oauth/token`,{method:"POST",headers:{"Content-type":"application/json","Instant-Platform-Version":ke,"Instant-Core-Version":ke},body:JSON.stringify({grant_type:"authorization_code",code:r,redirect_uri:i,client_id:t,code_verifier:s})});if(!a.ok){const o=await a.text();let c;try{const h=JSON.parse(o);c={error:h.error,errorDescription:h.error_description,message:`OAuth error: ${h.error||"server_error"}`}}catch{c={error:"server_error",message:"OAuth error: server_error"}}throw new N(c)}const n=await a.json();return{token:n.access_token,expiresAt:new Date(Date.now()+(n.expires_in-30)*1e3)}}function Fr(){if(typeof window>"u")throw new Error("This function may only be used in a browser context.");const r=new URL(window.location.href).searchParams,t=r.get("state"),s=r.get("error"),e=r.get("error_description"),i=r.get("code");if(!t)throw new Error("Invalid redirect. The state param is missing.");const a=new BroadcastChannel(t);return a.addEventListener("message",n=>{n.data.type==="oauth-redirect-window-done"&&window.close()}),a.postMessage({type:"oauth-redirect",state:t,error:s,errorDescription:e,code:i}),()=>{a.close()}}function Br({clientId:r,apiURI:t,redirectUri:s,scopes:e}){if(typeof window>"u")throw new Error("OAuth flow can only be started on the client.");const i=Rs;i&&i.close();const a=crypto.randomUUID(),n=kr(),o=new BroadcastChannel(a),c=new Promise((l,u)=>{o.addEventListener("message",async f=>{if(f.data.type!=="oauth-redirect")return;const{state:d,error:P,code:S,errorDescription:B}=f.data;if(!(!d||d!==a)){if(S)try{const C=await Mr({clientId:r,code:S,verifier:n,apiURI:t,redirectUri:s});l(C)}catch(C){C instanceof N&&u(C),u(new N({error:"server_error",message:"OAuth error exchanging code for token"}))}else u(typeof P=="string"?new N({error:P,errorDescription:B,message:`OAuth error: ${P}`}):new N({error:"server_error",message:"OAuth error: server_error"}));o.postMessage({type:"oauth-redirect-window-done"})}})}),h=window.open("",`instantdb_oauth_${Math.random()}`.replace(".",""),Dr());return h?(Rs=h,Or(n).then(l=>{const u=Lr({clientId:r,state:a,codeChallenge:l,apiURI:t,redirectUri:s,scopes:e});h.location.href=u}),c.finally(()=>o.close())):Promise.reject({error:"Could not open Auth window"})}class Rr{constructor(t){m(this,"redirectUri");m(this,"clientId");m(this,"apiURI");this.redirectUri=t.redirectUri,this.apiURI=t.apiURI??"https://api.instantdb.com",this.clientId=t.clientId}startClientOnlyFlow(t){return Br({clientId:this.clientId,apiURI:this.apiURI,redirectUri:this.redirectUri,scopes:t})}handleClientRedirect(){return Fr()}}function _r(r,t){if(r==null)return{};var s={};for(var e in r)if({}.hasOwnProperty.call(r,e)){if(t.indexOf(e)!==-1)continue;s[e]=r[e]}return s}class Pe{constructor(t,s,e){m(this,"line");m(this,"column");m(this,"index");this.line=t,this.column=s,this.index=e}}class mt{constructor(t,s){m(this,"start");m(this,"end");m(this,"filename");m(this,"identifierName");this.start=t,this.end=s}}function ie(r,t){const{line:s,column:e,index:i}=r;return new Pe(s,e+t,i+t)}const _s="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";var jr={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:_s},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:_s}};const js={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},yt=r=>r.type==="UpdateExpression"?js.UpdateExpression[`${r.prefix}`]:js[r.type];var Ur={AccessorIsGenerator:({kind:r})=>`A ${r}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:r})=>`Missing initializer in ${r} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:r})=>`\`${r}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:r,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.
1
+ (function(w,N){typeof exports=="object"&&typeof module<"u"?N(exports):typeof define=="function"&&define.amd?define(["exports"],N):(w=typeof globalThis<"u"?globalThis:w||self,N(w.instant={}))})(this,function(w){"use strict";var Mo=Object.defineProperty;var Ji=w=>{throw TypeError(w)};var Fo=(w,N,k)=>N in w?Mo(w,N,{enumerable:!0,configurable:!0,writable:!0,value:k}):w[N]=k;var m=(w,N,k)=>Fo(w,typeof N!="symbol"?N+"":N,k),Ts=(w,N,k)=>N.has(w)||Ji("Cannot "+k);var x=(w,N,k)=>(Ts(w,N,"read from private field"),k?k.call(w):N.get(w)),K=(w,N,k)=>N.has(w)?Ji("Cannot add the same private member more than once"):N instanceof WeakSet?N.add(w):N.set(w,k),Y=(w,N,k,Ke)=>(Ts(w,N,"write to private field"),Ke?Ke.call(w,k):N.set(w,k),k),ce=(w,N,k)=>(Ts(w,N,"access private method"),k);var X,rt,Ve,He,at,te,he,nt,De,oe,se,Ot,Dt,Lt,F,_;class N extends Error{constructor(s){super(s.message);m(this,"error");m(this,"errorDescription");const e=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,N),this.name="InstantOAuthError",this.error=s.error,this.errorDescription=s.errorDescription}get[Symbol.toStringTag](){return"InstantOAuthError"}}const k={Remove:"remove",Replace:"replace",Add:"add"},Ke=Symbol.for("__MUTATIVE_PROXY_DRAFT__"),ct=Symbol.iterator,re={mutable:"mutable",immutable:"immutable"},Ft={};function Je(r,t){return r instanceof Map?r.has(t):Object.prototype.hasOwnProperty.call(r,t)}function As(r,t){if(t in r){let s=Reflect.getPrototypeOf(r);for(;s;){const e=Reflect.getOwnPropertyDescriptor(s,t);if(e)return e;s=Reflect.getPrototypeOf(s)}}}function Ss(r){return Object.getPrototypeOf(r)===Set.prototype}function Is(r){return Object.getPrototypeOf(r)===Map.prototype}function ee(r){var t;return(t=r.copy)!==null&&t!==void 0?t:r.original}function Bt(r){return!!L(r)}function L(r){return typeof r!="object"?null:r==null?void 0:r[Ke]}function Rt(r){var t;const s=L(r);return s?(t=s.copy)!==null&&t!==void 0?t:s.original:r}function Se(r,t){if(!r||typeof r!="object")return!1;let s;return Object.getPrototypeOf(r)===Object.prototype||Array.isArray(r)||r instanceof Map||r instanceof Set||!!(t!=null&&t.mark)&&((s=t.mark(r,re))===re.immutable||typeof s=="function")}function Es(r,t=[]){if(Object.hasOwnProperty.call(r,"key")){const s=r.parent.copy,e=L(xe(s,r.key));if(e!==null&&(e==null?void 0:e.original)!==r.original)return null;const i=r.parent.type===3,a=i?Array.from(r.parent.setMap.keys()).indexOf(r.key):r.key;if(!(i&&s.size>a||Je(s,a)))return null;t.push(a)}if(r.parent)return Es(r.parent,t);t.reverse();try{Wi(r.copy,t)}catch{return null}return t}function We(r){return Array.isArray(r)?1:r instanceof Map?2:r instanceof Set?3:0}function xe(r,t){return We(r)===2?r.get(t):r[t]}function _t(r,t,s){We(r)===2?r.set(t,s):r[t]=s}function jt(r,t){const s=L(r);return(s?ee(s):r)[t]}function Ie(r,t){return r===t?r!==0||1/r===1/t:r!==r&&t!==t}function Ee(r,t){return t?r:[""].concat(r).map(s=>{const e=`${s}`;return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")}function Wi(r,t){for(let s=0;s<t.length-1;s+=1){const e=t[s];if(r=xe(We(r)===3?Array.from(r):r,e),typeof r!="object")throw new Error(`Cannot resolve patch at '${t.join("/")}'.`)}return r}function Gi(r){const t=Object.create(Object.getPrototypeOf(r));return Reflect.ownKeys(r).forEach(s=>{let e=Reflect.getOwnPropertyDescriptor(r,s);if(e.enumerable&&e.configurable&&e.writable){t[s]=r[s];return}e.writable||(e.writable=!0,e.configurable=!0),(e.get||e.set)&&(e={configurable:!0,writable:!0,enumerable:e.enumerable,value:r[s]}),Reflect.defineProperty(t,s,e)}),t}const Xi=Object.prototype.propertyIsEnumerable;function Yi(r,t){let s;if(Array.isArray(r))return Array.prototype.concat.call(r);if(r instanceof Set){if(!Ss(r)){const e=Object.getPrototypeOf(r).constructor;return new e(r.values())}return Set.prototype.difference?Set.prototype.difference.call(r,new Set):new Set(r.values())}else if(r instanceof Map){if(!Is(r)){const e=Object.getPrototypeOf(r).constructor;return new e(r)}return new Map(r)}else if(t!=null&&t.mark&&(s=t.mark(r,re),s!==void 0)&&s!==re.mutable){if(s===re.immutable)return Gi(r);if(typeof s=="function"){if(t.enablePatches||t.enableAutoFreeze)throw new Error("You can't use mark and patches or auto freeze together.");return s()}throw new Error(`Unsupported mark result: ${s}`)}else if(typeof r=="object"&&Object.getPrototypeOf(r)===Object.prototype){const e={};return Object.keys(r).forEach(i=>{e[i]=r[i]}),Object.getOwnPropertySymbols(r).forEach(i=>{Xi.call(r,i)&&(e[i]=r[i])}),e}else throw new Error("Please check mark() to ensure that it is a stable marker draftable function.")}function J(r){r.copy||(r.copy=Yi(r.original,r.options))}function Ge(r){if(!Se(r))return Rt(r);if(Array.isArray(r))return r.map(Ge);if(r instanceof Map){const s=Array.from(r.entries()).map(([e,i])=>[e,Ge(i)]);if(!Is(r)){const e=Object.getPrototypeOf(r).constructor;return new e(s)}return new Map(s)}if(r instanceof Set){const s=Array.from(r).map(Ge);if(!Ss(r)){const e=Object.getPrototypeOf(r).constructor;return new e(s)}return new Set(s)}const t=Object.create(Object.getPrototypeOf(r));for(const s in r)t[s]=Ge(r[s]);return t}function ht(r){return Bt(r)?Ge(r):r}function le(r){var t;r.assignedMap=(t=r.assignedMap)!==null&&t!==void 0?t:new Map,r.operated||(r.operated=!0,r.parent&&le(r.parent))}function Qi(r,t){const s=We(r);if(s===0)Reflect.ownKeys(r).forEach(e=>{t(e,r[e],r)});else if(s===1){let e=0;for(const i of r)t(e,i,r),e+=1}else r.forEach((e,i)=>t(i,e,r))}function Cs(r,t,s){if(Bt(r)||!Se(r,s)||t.has(r)||Object.isFrozen(r))return;const e=r instanceof Set,i=e?new Map:void 0;if(t.add(r),Qi(r,(a,n)=>{var o;if(Bt(n)){const c=L(n);J(c);const h=!((o=c.assignedMap)===null||o===void 0)&&o.size||c.operated?c.copy:c.original;_t(e?i:r,a,h)}else Cs(n,t,s)}),i){const a=r,n=Array.from(a);a.clear(),n.forEach(o=>{a.add(i.has(o)?i.get(o):o)})}}function Zi(r,t){const s=r.type===3?r.setMap:r.copy;r.finalities.revoke.length>1&&r.assignedMap.get(t)&&s&&Cs(xe(s,t),r.finalities.handledSet,r.options)}function Ut(r){r.type===3&&r.copy&&(r.copy.clear(),r.setMap.forEach(t=>{r.copy.add(Rt(t))}))}function $t(r,t,s,e){if(r.operated&&r.assignedMap&&r.assignedMap.size>0&&!r.finalized){if(s&&e){const a=Es(r);a&&t(r,a,s,e)}r.finalized=!0}}function qt(r,t,s,e){const i=L(s);i&&(i.callbacks||(i.callbacks=[]),i.callbacks.push((a,n)=>{var o;const c=r.type===3?r.setMap:r.copy;if(Ie(xe(c,t),s)){let h=i.original;i.copy&&(h=i.copy),Ut(r),$t(r,e,a,n),r.options.enableAutoFreeze&&(r.options.updatedValues=(o=r.options.updatedValues)!==null&&o!==void 0?o:new WeakMap,r.options.updatedValues.set(h,i.original)),_t(c,t,h)}}),r.options.enableAutoFreeze&&i.finalities!==r.finalities&&(r.options.enableAutoFreeze=!1)),Se(s,r.options)&&r.finalities.draft.push(()=>{const a=r.type===3?r.setMap:r.copy;Ie(xe(a,t),s)&&Zi(r,t)})}function er(r,t,s,e,i){let{original:a,assignedMap:n,options:o}=r,c=r.copy;c.length<a.length&&([a,c]=[c,a],[s,e]=[e,s]);for(let h=0;h<a.length;h+=1)if(n.get(h.toString())&&c[h]!==a[h]){const l=t.concat([h]),u=Ee(l,i);s.push({op:k.Replace,path:u,value:ht(c[h])}),e.push({op:k.Replace,path:u,value:ht(a[h])})}for(let h=a.length;h<c.length;h+=1){const l=t.concat([h]),u=Ee(l,i);s.push({op:k.Add,path:u,value:ht(c[h])})}if(a.length<c.length){const{arrayLengthAssignment:h=!0}=o.enablePatches;if(h){const l=t.concat(["length"]),u=Ee(l,i);e.push({op:k.Replace,path:u,value:a.length})}else for(let l=c.length;a.length<l;l-=1){const u=t.concat([l-1]),f=Ee(u,i);e.push({op:k.Remove,path:f})}}}function tr({original:r,copy:t,assignedMap:s},e,i,a,n){s.forEach((o,c)=>{const h=xe(r,c),l=ht(xe(t,c)),u=o?Je(r,c)?k.Replace:k.Add:k.Remove;if(Ie(h,l)&&u===k.Replace)return;const f=e.concat(c),d=Ee(f,n);i.push(u===k.Remove?{op:u,path:d}:{op:u,path:d,value:l}),a.push(u===k.Add?{op:k.Remove,path:d}:u===k.Remove?{op:k.Add,path:d,value:h}:{op:k.Replace,path:d,value:h})})}function sr({original:r,copy:t},s,e,i,a){let n=0;r.forEach(o=>{if(!t.has(o)){const c=s.concat([n]),h=Ee(c,a);e.push({op:k.Remove,path:h,value:o}),i.unshift({op:k.Add,path:h,value:o})}n+=1}),n=0,t.forEach(o=>{if(!r.has(o)){const c=s.concat([n]),h=Ee(c,a);e.push({op:k.Add,path:h,value:o}),i.unshift({op:k.Remove,path:h,value:o})}n+=1})}function Xe(r,t,s,e){const{pathAsArray:i=!0}=r.options.enablePatches;switch(r.type){case 0:case 2:return tr(r,t,s,e,i);case 1:return er(r,t,s,e,i);case 3:return sr(r,t,s,e,i)}}const lt=(r,t,s=!1)=>{if(typeof r=="object"&&r!==null&&(!Se(r,t)||s))throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.")},zt={get size(){return ee(L(this)).size},has(r){return ee(L(this)).has(r)},set(r,t){const s=L(this),e=ee(s);return(!e.has(r)||!Ie(e.get(r),t))&&(J(s),le(s),s.assignedMap.set(r,!0),s.copy.set(r,t),qt(s,r,t,Xe)),this},delete(r){if(!this.has(r))return!1;const t=L(this);return J(t),le(t),t.original.has(r)?t.assignedMap.set(r,!1):t.assignedMap.delete(r),t.copy.delete(r),!0},clear(){const r=L(this);if(this.size){J(r),le(r),r.assignedMap=new Map;for(const[t]of r.original)r.assignedMap.set(t,!1);r.copy.clear()}},forEach(r,t){const s=L(this);ee(s).forEach((e,i)=>{r.call(t,this.get(i),i,this)})},get(r){var t,s;const e=L(this),i=ee(e).get(r),a=((s=(t=e.options).mark)===null||s===void 0?void 0:s.call(t,i,re))===re.mutable;if(e.options.strict&&lt(i,e.options,a),a||e.finalized||!Se(i,e.options)||i!==e.original.get(r))return i;const n=Ft.createDraft({original:i,parentDraft:e,key:r,finalities:e.finalities,options:e.options});return J(e),e.copy.set(r,n),n},keys(){return ee(L(this)).keys()},values(){const r=this.keys();return{[ct]:()=>this.values(),next:()=>{const t=r.next();return t.done?t:{done:!1,value:this.get(t.value)}}}},entries(){const r=this.keys();return{[ct]:()=>this.entries(),next:()=>{const t=r.next();if(t.done)return t;const s=this.get(t.value);return{done:!1,value:[t.value,s]}}}},[ct](){return this.entries()}},ir=Reflect.ownKeys(zt),ks=(r,t,{isValuesIterator:s})=>()=>{var e,i;const a=t.next();if(a.done)return a;const n=a.value;let o=r.setMap.get(n);const c=L(o),h=((i=(e=r.options).mark)===null||i===void 0?void 0:i.call(e,o,re))===re.mutable;if(r.options.strict&&lt(n,r.options,h),!h&&!c&&Se(n,r.options)&&!r.finalized&&r.original.has(n)){const l=Ft.createDraft({original:n,parentDraft:r,key:n,finalities:r.finalities,options:r.options});r.setMap.set(n,l),o=l}else c&&(o=c.proxy);return{done:!1,value:s?o:[o,o]}},ut={get size(){return L(this).setMap.size},has(r){const t=L(this);if(t.setMap.has(r))return!0;J(t);const s=L(r);return!!(s&&t.setMap.has(s.original))},add(r){const t=L(this);return this.has(r)||(J(t),le(t),t.assignedMap.set(r,!0),t.setMap.set(r,r),qt(t,r,r,Xe)),this},delete(r){if(!this.has(r))return!1;const t=L(this);J(t),le(t);const s=L(r);return s&&t.setMap.has(s.original)?(t.assignedMap.set(s.original,!1),t.setMap.delete(s.original)):(!s&&t.setMap.has(r)?t.assignedMap.set(r,!1):t.assignedMap.delete(r),t.setMap.delete(r))},clear(){if(!this.size)return;const r=L(this);J(r),le(r);for(const t of r.original)r.assignedMap.set(t,!1);r.setMap.clear()},values(){const r=L(this);J(r);const t=r.setMap.keys();return{[Symbol.iterator]:()=>this.values(),next:ks(r,t,{isValuesIterator:!0})}},entries(){const r=L(this);J(r);const t=r.setMap.keys();return{[Symbol.iterator]:()=>this.entries(),next:ks(r,t,{isValuesIterator:!1})}},keys(){return this.values()},[ct](){return this.values()},forEach(r,t){const s=this.values();let e=s.next();for(;!e.done;)r.call(t,e.value,e.value,this),e=s.next()}};Set.prototype.difference&&Object.assign(ut,{intersection(r){return Set.prototype.intersection.call(new Set(this.values()),r)},union(r){return Set.prototype.union.call(new Set(this.values()),r)},difference(r){return Set.prototype.difference.call(new Set(this.values()),r)},symmetricDifference(r){return Set.prototype.symmetricDifference.call(new Set(this.values()),r)},isSubsetOf(r){return Set.prototype.isSubsetOf.call(new Set(this.values()),r)},isSupersetOf(r){return Set.prototype.isSupersetOf.call(new Set(this.values()),r)},isDisjointFrom(r){return Set.prototype.isDisjointFrom.call(new Set(this.values()),r)}});const rr=Reflect.ownKeys(ut),Ns=new WeakSet,vs={get(r,t,s){var e,i;const a=(e=r.copy)===null||e===void 0?void 0:e[t];if(a&&Ns.has(a))return a;if(t===Ke)return r;let n;if(r.options.mark){const h=t==="size"&&(r.original instanceof Map||r.original instanceof Set)?Reflect.get(r.original,t):Reflect.get(r.original,t,s);if(n=r.options.mark(h,re),n===re.mutable)return r.options.strict&&lt(h,r.options,!0),h}const o=ee(r);if(o instanceof Map&&ir.includes(t)){if(t==="size")return Object.getOwnPropertyDescriptor(zt,"size").get.call(r.proxy);const h=zt[t];if(h)return h.bind(r.proxy)}if(o instanceof Set&&rr.includes(t)){if(t==="size")return Object.getOwnPropertyDescriptor(ut,"size").get.call(r.proxy);const h=ut[t];if(h)return h.bind(r.proxy)}if(!Je(o,t)){const h=As(o,t);return h?"value"in h?h.value:(i=h.get)===null||i===void 0?void 0:i.call(r.proxy):void 0}const c=o[t];if(r.options.strict&&lt(c,r.options),r.finalized||!Se(c,r.options))return c;if(c===jt(r.original,t)){if(J(r),r.copy[t]=Os({original:r.original[t],parentDraft:r,key:r.type===1?Number(t):t,finalities:r.finalities,options:r.options}),typeof n=="function"){const h=L(r.copy[t]);return J(h),le(h),h.copy}return r.copy[t]}return c},set(r,t,s){var e;if(r.type===3||r.type===2)throw new Error("Map/Set draft does not support any property assignment.");let i;if(r.type===1&&t!=="length"&&!(Number.isInteger(i=Number(t))&&i>=0&&(t===0||i===0||String(i)===String(t))))throw new Error("Only supports setting array indices and the 'length' property.");const a=As(ee(r),t);if(a!=null&&a.set)return a.set.call(r.proxy,s),!0;const n=jt(ee(r),t),o=L(n);return o&&Ie(o.original,s)?(r.copy[t]=s,r.assignedMap=(e=r.assignedMap)!==null&&e!==void 0?e:new Map,r.assignedMap.set(t,!1),!0):(Ie(s,n)&&(s!==void 0||Je(r.original,t))||(J(r),le(r),Je(r.original,t)&&Ie(s,r.original[t])?r.assignedMap.delete(t):r.assignedMap.set(t,!0),r.copy[t]=s,qt(r,t,s,Xe)),!0)},has(r,t){return t in ee(r)},ownKeys(r){return Reflect.ownKeys(ee(r))},getOwnPropertyDescriptor(r,t){const s=ee(r),e=Reflect.getOwnPropertyDescriptor(s,t);return e&&{writable:!0,configurable:r.type!==1||t!=="length",enumerable:e.enumerable,value:s[t]}},getPrototypeOf(r){return Reflect.getPrototypeOf(r.original)},setPrototypeOf(){throw new Error("Cannot call 'setPrototypeOf()' on drafts")},defineProperty(){throw new Error("Cannot call 'defineProperty()' on drafts")},deleteProperty(r,t){var s;return r.type===1?vs.set.call(this,r,t,void 0,r.proxy):(jt(r.original,t)!==void 0||t in r.original?(J(r),le(r),r.assignedMap.set(t,!1)):(r.assignedMap=(s=r.assignedMap)!==null&&s!==void 0?s:new Map,r.assignedMap.delete(t)),r.copy&&delete r.copy[t],!0)}};function Os(r){const{original:t,parentDraft:s,key:e,finalities:i,options:a}=r,n=We(t),o={type:n,finalized:!1,parent:s,original:t,copy:null,proxy:null,finalities:i,options:a,setMap:n===3?new Map(t.entries()):void 0};(e||"key"in r)&&(o.key=e);const{proxy:c,revoke:h}=Proxy.revocable(n===1?Object.assign([],o):o,vs);if(i.revoke.push(h),Ns.add(c),o.proxy=c,s){const l=s;l.finalities.draft.push((u,f)=>{var d,P;const S=L(c);let B=l.type===3?l.setMap:l.copy;const C=xe(B,e),D=L(C);if(D){let U=D.original;D.operated&&(U=Rt(C)),Ut(D),$t(D,Xe,u,f),l.options.enableAutoFreeze&&(l.options.updatedValues=(d=l.options.updatedValues)!==null&&d!==void 0?d:new WeakMap,l.options.updatedValues.set(U,D.original)),_t(B,e,U)}(P=S.callbacks)===null||P===void 0||P.forEach(U=>{U(u,f)})})}else{const l=L(c);l.finalities.draft.push((u,f)=>{Ut(l),$t(l,Xe,u,f)})}return c}Ft.createDraft=Os,Object.prototype.constructor.toString();const z=[];for(let r=0;r<256;++r)z.push((r+256).toString(16).slice(1));function ar(r,t=0){return(z[r[t+0]]+z[r[t+1]]+z[r[t+2]]+z[r[t+3]]+"-"+z[r[t+4]]+z[r[t+5]]+"-"+z[r[t+6]]+z[r[t+7]]+"-"+z[r[t+8]]+z[r[t+9]]+"-"+z[r[t+10]]+z[r[t+11]]+z[r[t+12]]+z[r[t+13]]+z[r[t+14]]+z[r[t+15]]).toLowerCase()}let Vt;const nr=new Uint8Array(16);function or(){if(!Vt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Vt=crypto.getRandomValues.bind(crypto)}return Vt(nr)}const Ds={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function cr(r,t,s){var i;if(Ds.randomUUID&&!r)return Ds.randomUUID();r=r||{};const e=r.random??((i=r.rng)==null?void 0:i.call(r))??or();if(e.length<16)throw new Error("Random bytes length must be >= 16");return e[6]=e[6]&15|64,e[8]=e[8]&63|128,ar(e)}function Ls(){return cr()}function hr(r,t){return r.localeCompare(t)}function lr(){let r=hr;if(typeof Intl=="object"&&Intl.hasOwnProperty("Collator"))try{r=Intl.Collator("en-US").compare}catch{}return r}lr();function ur(){const t={__etype:1,__ops:1,create:1,update:1,link:1,unlink:1,delete:1,merge:1,ruleParams:1};return new Set(Object.keys(t))}const pr=ur();function pt(r,t,s){const e={__etype:r,__ops:s};return new Proxy(e,{get:(i,a)=>{if(a==="__ops")return s;if(a==="__etype")return r;if(pr.has(a))return(n,o)=>pt(r,t,[...s,o?[a,r,t,n,o]:[a,r,t,n]])}})}function fr(r,t){return`lookup__${r}__${JSON.stringify(t)}`}function dr(r){return r.startsWith("lookup__")}function Ms(r){const[t,s,...e]=r.split("__");return[s,JSON.parse(e.join("__"))]}function mr(r){return new Proxy({__etype:r},{get(t,s){if(s==="lookup")return(i,a)=>pt(r,Ms(fr(i,a)),[]);if(s==="__etype")return r;const e=s;return dr(e)?pt(r,Ms(e),[]):pt(r,e,[])}})}function yr(){return new Proxy({},{get(r,t){return mr(t)}})}yr();class W extends Error{constructor(s,e,i){super(s);m(this,"hint");m(this,"traceId");this.hint=e,i&&(this.traceId=i);const a=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,a),Error.captureStackTrace&&Error.captureStackTrace(this,W),this.name="InstantError"}get[Symbol.toStringTag](){return"InstantError"}}class Ce extends W{constructor(s){var a,n;const e=((a=s.body)==null?void 0:a.message)||`API Error (${s.status})`;super(e,s.body.hint,((n=s.body)==null?void 0:n.traceId)||s.body["trace-id"]);m(this,"body");m(this,"status");const i=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,i),Error.captureStackTrace&&Error.captureStackTrace(this,Ce),this.name="InstantAPIError",this.status=s.status,this.body=s.body}get[Symbol.toStringTag](){return"InstantAPIError"}}typeof window<"u"&&typeof window.localStorage<"u"&&(window.localStorage.getItem("devBackend"),window.localStorage.getItem("__instantLogging"),window.localStorage.getItem("__devtoolLocalDash"));const ke="v1.0.42";class ae{constructor(t,s,e,i={indexed:!1,unique:!1}){m(this,"valueType");m(this,"required");m(this,"isIndexed");m(this,"config");m(this,"metadata",{});this.valueType=t,this.required=s,this.isIndexed=e,this.config=i}clientRequired(){return new ae(this.valueType,!1,this.isIndexed,this.config)}optional(){return new ae(this.valueType,!1,this.isIndexed,this.config)}unique(){return new ae(this.valueType,this.required,this.isIndexed,{...this.config,unique:!0})}indexed(){return new ae(this.valueType,this.required,!0,{...this.config,indexed:!0})}}class ft{constructor(t,s){m(this,"attrs");m(this,"links");this.attrs=t,this.links=s}asType(){return new ft(this.attrs,this.links)}}class dt{constructor(t,s,e){m(this,"entities");m(this,"links");m(this,"rooms");this.entities=t,this.links=s,this.rooms=e}withRoomSchema(){return new dt(this.entities,this.links,{})}}var Fs;(function(r){r.InitialSyncBatch="InitialSyncBatch",r.InitialSyncComplete="InitialSyncComplete",r.LoadFromStorage="LoadFromStorage",r.SyncTransaction="SyncTransaction",r.Error="Error"})(Fs||(Fs={}));function xr(r,t){return new dt(Bs(r,t),t,void 0)}function Pr(r){return new ft(r,{})}function br(){return new ae("string",!0,!1)}function gr(){return new ae("number",!0,!1)}function wr(){return new ae("boolean",!0,!1)}function Tr(){return new ae("date",!0,!1)}function Ar(){return new ae("json",!0,!1)}function Sr(){return new ae("json",!0,!1)}function Bs(r,t){var i,a,n,o;const s={fwd:{},rev:{}};for(const c of Object.values(t))(i=s.fwd)[a=c.forward.on]||(i[a]={}),(n=s.rev)[o=c.reverse.on]||(n[o]={}),s.fwd[c.forward.on][c.forward.label]={entityName:c.reverse.on,cardinality:c.forward.has},s.rev[c.reverse.on][c.reverse.label]={entityName:c.forward.on,cardinality:c.reverse.has};return Object.fromEntries(Object.entries(r).map(([c,h])=>[c,new ft(h.attrs,{...s.fwd[c],...s.rev[c]})]))}function Ir({entities:r,links:t,rooms:s}){const e=t??{},i=s??{};return new dt(Bs(r,e),e,i)}const V={graph:xr,schema:Ir,entity:Pr,string:br,number:gr,boolean:wr,date:Tr,json:Ar,any:Sr};function Er(){return globalThis.__instantDbSchemaHashStore=globalThis.__instantDbSchemaHashStore??new WeakMap,globalThis.__instantDbSchemaHashStore}function Cr(){return globalThis.__instantDbStore=globalThis.__instantDbStore??{},globalThis.__instantDbStore}Cr(),Er();function kr(){const r="0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz-._~";let t="";for(const s of crypto.getRandomValues(new Uint8Array(64)))t=t+r[s%r.length];return t}function Nr(r){return crypto.subtle.digest({name:"SHA-256"},new TextEncoder().encode(r))}function vr(r){return r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Or(r){return Nr(r).then(t=>vr(btoa(String.fromCharCode(...Array.from(new Uint8Array(t))))))}function Dr(){const r=Math.min(800,Math.floor(window.outerWidth*.8)),t=Math.min(630,Math.floor(window.outerHeight*.5)),s={width:r,height:t,left:Math.round(window.screenX+(window.outerWidth-r)/2),top:Math.round(window.screenY+(window.outerHeight-t)/8)},e={width:s.width,height:s.height,left:s.left,top:s.top,toolbar:0,scrollbars:1,status:1,resizable:1,menuBar:0,rel:"opener"};return Object.keys(e).map(i=>`${i}=${e[i]}`).join(",")}let Rs=null;function Lr({clientId:r,state:t,codeChallenge:s,apiURI:e,redirectUri:i,scopes:a}){const n=new URL(`${e}/platform/oauth/start`);return n.searchParams.set("client_id",r),n.searchParams.set("redirect_uri",i),n.searchParams.set("scope",a.join(" ")),n.searchParams.set("state",t),n.searchParams.set("response_type","code"),n.searchParams.set("code_challenge",s),n.searchParams.set("code_challenge_method","S256"),n.toString()}async function Mr({code:r,clientId:t,verifier:s,apiURI:e,redirectUri:i}){const a=await fetch(`${e}/platform/oauth/token`,{method:"POST",headers:{"Content-type":"application/json","Instant-Platform-Version":ke,"Instant-Core-Version":ke},body:JSON.stringify({grant_type:"authorization_code",code:r,redirect_uri:i,client_id:t,code_verifier:s})});if(!a.ok){const o=await a.text();let c;try{const h=JSON.parse(o);c={error:h.error,errorDescription:h.error_description,message:`OAuth error: ${h.error||"server_error"}`}}catch{c={error:"server_error",message:"OAuth error: server_error"}}throw new N(c)}const n=await a.json();return{token:n.access_token,expiresAt:new Date(Date.now()+(n.expires_in-30)*1e3)}}function Fr(){if(typeof window>"u")throw new Error("This function may only be used in a browser context.");const r=new URL(window.location.href).searchParams,t=r.get("state"),s=r.get("error"),e=r.get("error_description"),i=r.get("code");if(!t)throw new Error("Invalid redirect. The state param is missing.");const a=new BroadcastChannel(t);return a.addEventListener("message",n=>{n.data.type==="oauth-redirect-window-done"&&window.close()}),a.postMessage({type:"oauth-redirect",state:t,error:s,errorDescription:e,code:i}),()=>{a.close()}}function Br({clientId:r,apiURI:t,redirectUri:s,scopes:e}){if(typeof window>"u")throw new Error("OAuth flow can only be started on the client.");const i=Rs;i&&i.close();const a=crypto.randomUUID(),n=kr(),o=new BroadcastChannel(a),c=new Promise((l,u)=>{o.addEventListener("message",async f=>{if(f.data.type!=="oauth-redirect")return;const{state:d,error:P,code:S,errorDescription:B}=f.data;if(!(!d||d!==a)){if(S)try{const C=await Mr({clientId:r,code:S,verifier:n,apiURI:t,redirectUri:s});l(C)}catch(C){C instanceof N&&u(C),u(new N({error:"server_error",message:"OAuth error exchanging code for token"}))}else u(typeof P=="string"?new N({error:P,errorDescription:B,message:`OAuth error: ${P}`}):new N({error:"server_error",message:"OAuth error: server_error"}));o.postMessage({type:"oauth-redirect-window-done"})}})}),h=window.open("",`instantdb_oauth_${Math.random()}`.replace(".",""),Dr());return h?(Rs=h,Or(n).then(l=>{const u=Lr({clientId:r,state:a,codeChallenge:l,apiURI:t,redirectUri:s,scopes:e});h.location.href=u}),c.finally(()=>o.close())):Promise.reject({error:"Could not open Auth window"})}class Rr{constructor(t){m(this,"redirectUri");m(this,"clientId");m(this,"apiURI");this.redirectUri=t.redirectUri,this.apiURI=t.apiURI??"https://api.instantdb.com",this.clientId=t.clientId}startClientOnlyFlow(t){return Br({clientId:this.clientId,apiURI:this.apiURI,redirectUri:this.redirectUri,scopes:t})}handleClientRedirect(){return Fr()}}function _r(r,t){if(r==null)return{};var s={};for(var e in r)if({}.hasOwnProperty.call(r,e)){if(t.indexOf(e)!==-1)continue;s[e]=r[e]}return s}class Pe{constructor(t,s,e){m(this,"line");m(this,"column");m(this,"index");this.line=t,this.column=s,this.index=e}}class mt{constructor(t,s){m(this,"start");m(this,"end");m(this,"filename");m(this,"identifierName");this.start=t,this.end=s}}function ie(r,t){const{line:s,column:e,index:i}=r;return new Pe(s,e+t,i+t)}const _s="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";var jr={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:_s},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:_s}};const js={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},yt=r=>r.type==="UpdateExpression"?js.UpdateExpression[`${r.prefix}`]:js[r.type];var Ur={AccessorIsGenerator:({kind:r})=>`A ${r}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:r})=>`Missing initializer in ${r} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:r})=>`\`${r}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:r,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.
2
2
  - Did you mean \`export { '${r}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:r})=>`'${r==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:r})=>`Unsyntactic ${r==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:r})=>`A string literal cannot be used as an imported binding.
3
3
  - Did you mean \`import { "${r}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:r})=>`Expected number in radix ${r}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:r})=>`Escape sequence in keyword ${r}.`,InvalidIdentifier:({identifierName:r})=>`Invalid identifier ${r}.`,InvalidLhs:({ancestor:r})=>`Invalid left-hand side in ${yt(r)}.`,InvalidLhsBinding:({ancestor:r})=>`Binding invalid left-hand side in ${yt(r)}.`,InvalidLhsOptionalChaining:({ancestor:r})=>`Invalid optional chaining in the left-hand side of ${yt(r)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:r})=>`Unexpected character '${r}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:r})=>`Private name #${r} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:r})=>`Label '${r}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:r})=>`This experimental syntax requires enabling the parser plugin: ${r.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:r})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${r.map(t=>JSON.stringify(t)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:r})=>`Duplicate key "${r}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:r})=>`An export name cannot include a lone surrogate, found '\\u${r.toString(16)}'.`,ModuleExportUndefined:({localName:r})=>`Export '${r}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:r})=>`Private names are only allowed in property accesses (\`obj.#${r}\`) or in \`in\` expressions (\`#${r} in obj\`).`,PrivateNameRedeclaration:({identifierName:r})=>`Duplicate private name #${r}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:r})=>`Unexpected keyword '${r}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:r})=>`Unexpected reserved word '${r}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:r,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${r?`, expected "${r}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:r,onlyValidPropertyName:t})=>`The only valid meta property for ${r} is ${r}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:r})=>`Identifier '${r}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},$r={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:r})=>`Assigning to '${r}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:r})=>`Binding '${r}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},qr={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:r})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(r)}\`.`};const zr=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]);var Vr=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic references are only supported when using the `"proposal": "hack"` version of the pipeline proposal.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:r})=>`Invalid topic token ${r}. In order to use ${r} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${r}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:r})=>`Hack-style pipe body cannot be an unparenthesized ${yt({type:r})}; please wrap it in parentheses.`},{});const Hr=["message"];function Us(r,t,s){Object.defineProperty(r,t,{enumerable:!1,configurable:!0,value:s})}function Kr({toMessage:r,code:t,reasonCode:s,syntaxPlugin:e}){const i=s==="MissingPlugin"||s==="MissingOneOfPlugins";return function a(n,o){const c=new SyntaxError;return c.code=t,c.reasonCode=s,c.loc=n,c.pos=n.index,c.syntaxPlugin=e,i&&(c.missingPlugin=o.missingPlugin),Us(c,"clone",function(l={}){const{line:u,column:f,index:d}=l.loc??n;return a(new Pe(u,f,d),Object.assign({},o,l.details))}),Us(c,"details",o),Object.defineProperty(c,"message",{configurable:!0,get(){const h=`${r(o)} (${n.line}:${n.column})`;return this.message=h,h},set(h){Object.defineProperty(this,"message",{value:h,writable:!0})}}),c}}function ue(r,t){if(Array.isArray(r))return e=>ue(e,r[0]);const s={};for(const e of Object.keys(r)){const i=r[e],a=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:n}=a,o=_r(a,Hr),c=typeof n=="string"?()=>n:n;s[e]=Kr(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:e,toMessage:c},t?{syntaxPlugin:t}:{},o))}return s}const p=Object.assign({},ue(jr),ue(Ur),ue($r),ue(qr),ue`pipelineOperator`(Vr));function Jr(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!0,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Wr(r){const t=Jr();if(r==null)return t;if(r.annexB!=null&&r.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(const s of Object.keys(t))r[s]!=null&&(t[s]=r[s]);if(t.startLine===1)r.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:r.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if(r.startColumn==null||r.startIndex==null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");return t}const{defineProperty:Gr}=Object,$s=(r,t)=>{r&&Gr(r,t,{enumerable:!1,value:r[t]})};function Ye(r){return $s(r.loc.start,"index"),$s(r.loc.end,"index"),r}var Xr=r=>class extends r{parse(){const s=Ye(super.parse());return this.optionFlags&256&&(s.tokens=s.tokens.map(Ye)),s}parseRegExpLiteral({pattern:s,flags:e}){let i=null;try{i=new RegExp(s,e)}catch{}const a=this.estreeParseLiteral(i);return a.regex={pattern:s,flags:e},a}parseBigIntLiteral(s){let e;try{e=BigInt(s)}catch{e=null}const i=this.estreeParseLiteral(e);return i.bigint=String(i.value||s),i}parseDecimalLiteral(s){const i=this.estreeParseLiteral(null);return i.decimal=String(i.value||s),i}estreeParseLiteral(s){return this.parseLiteral(s,"Literal")}parseStringLiteral(s){return this.estreeParseLiteral(s)}parseNumericLiteral(s){return this.estreeParseLiteral(s)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(s){return this.estreeParseLiteral(s)}estreeParseChainExpression(s,e){const i=this.startNodeAtNode(s);return i.expression=s,this.finishNodeAt(i,"ChainExpression",e)}directiveToStmt(s){const e=s.value;delete s.value,this.castNodeTo(e,"Literal"),e.raw=e.extra.raw,e.value=e.extra.expressionValue;const i=this.castNodeTo(s,"ExpressionStatement");return i.expression=e,i.directive=e.extra.rawValue,delete e.extra,i}fillOptionalPropertiesForTSESLint(s){}cloneEstreeStringLiteral(s){const{start:e,end:i,loc:a,range:n,raw:o,value:c}=s,h=Object.create(s.constructor.prototype);return h.type="Literal",h.start=e,h.end=i,h.loc=a,h.range=n,h.raw=o,h.value=c,h}initFunction(s,e){super.initFunction(s,e),s.expression=!1}checkDeclaration(s){s!=null&&this.isObjectProperty(s)?this.checkDeclaration(s.value):super.checkDeclaration(s)}getObjectOrClassMethodParams(s){return s.value.params}isValidDirective(s){var e;return s.type==="ExpressionStatement"&&s.expression.type==="Literal"&&typeof s.expression.value=="string"&&!((e=s.expression.extra)!=null&&e.parenthesized)}parseBlockBody(s,e,i,a,n){super.parseBlockBody(s,e,i,a,n);const o=s.directives.map(c=>this.directiveToStmt(c));s.body=o.concat(s.body),delete s.directives}parsePrivateName(){const s=super.parsePrivateName();return this.convertPrivateNameToPrivateIdentifier(s)}convertPrivateNameToPrivateIdentifier(s){const e=super.getPrivateNameSV(s);return s=s,delete s.id,s.name=e,this.castNodeTo(s,"PrivateIdentifier")}isPrivateName(s){return s.type==="PrivateIdentifier"}getPrivateNameSV(s){return s.name}parseLiteral(s,e){const i=super.parseLiteral(s,e);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(s,e,i=!1){super.parseFunctionBody(s,e,i),s.expression=s.body.type!=="BlockStatement"}parseMethod(s,e,i,a,n,o,c=!1){let h=this.startNode();h.kind=s.kind,h=super.parseMethod(h,e,i,a,n,o,c),delete h.kind;const{typeParameters:l}=s;l&&(delete s.typeParameters,h.typeParameters=l,this.resetStartLocationFromNode(h,l));const u=this.castNodeTo(h,this.hasPlugin("typescript")&&!h.body?"TSEmptyBodyFunctionExpression":"FunctionExpression");return s.value=u,o==="ClassPrivateMethod"&&(s.computed=!1),this.hasPlugin("typescript")&&s.abstract?(delete s.abstract,this.finishNode(s,"TSAbstractMethodDefinition")):o==="ObjectMethod"?(s.kind==="method"&&(s.kind="init"),s.shorthand=!1,this.finishNode(s,"Property")):this.finishNode(s,"MethodDefinition")}nameIsConstructor(s){return s.type==="Literal"?s.value==="constructor":super.nameIsConstructor(s)}parseClassProperty(...s){const e=super.parseClassProperty(...s);return e.abstract&&this.hasPlugin("typescript")?(delete e.abstract,this.castNodeTo(e,"TSAbstractPropertyDefinition")):this.castNodeTo(e,"PropertyDefinition"),e}parseClassPrivateProperty(...s){const e=super.parseClassPrivateProperty(...s);return e.abstract&&this.hasPlugin("typescript")?this.castNodeTo(e,"TSAbstractPropertyDefinition"):this.castNodeTo(e,"PropertyDefinition"),e.computed=!1,e}parseClassAccessorProperty(s){const e=super.parseClassAccessorProperty(s);return e.abstract&&this.hasPlugin("typescript")?(delete e.abstract,this.castNodeTo(e,"TSAbstractAccessorProperty")):this.castNodeTo(e,"AccessorProperty"),e}parseObjectProperty(s,e,i,a){const n=super.parseObjectProperty(s,e,i,a);return n&&(n.kind="init",this.castNodeTo(n,"Property")),n}finishObjectProperty(s){return s.kind="init",this.finishNode(s,"Property")}isValidLVal(s,e,i){return s==="Property"?"value":super.isValidLVal(s,e,i)}isAssignable(s,e){return s!=null&&this.isObjectProperty(s)?this.isAssignable(s.value,e):super.isAssignable(s,e)}toAssignable(s,e=!1){if(s!=null&&this.isObjectProperty(s)){const{key:i,value:a}=s;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(a,e)}else super.toAssignable(s,e)}toAssignableObjectExpressionProp(s,e,i){s.type==="Property"&&(s.kind==="get"||s.kind==="set")?this.raise(p.PatternHasAccessor,s.key):s.type==="Property"&&s.method?this.raise(p.PatternHasMethod,s.key):super.toAssignableObjectExpressionProp(s,e,i)}finishCallExpression(s,e){const i=super.finishCallExpression(s,e);return i.callee.type==="Import"?(this.castNodeTo(i,"ImportExpression"),i.source=i.arguments[0],i.options=i.arguments[1]??null,i.attributes=i.arguments[1]??null,delete i.arguments,delete i.callee):i.type==="OptionalCallExpression"?this.castNodeTo(i,"CallExpression"):i.optional=!1,i}toReferencedArguments(s){s.type!=="ImportExpression"&&super.toReferencedArguments(s)}parseExport(s,e){var n;const i=this.state.lastTokStartLoc,a=super.parseExport(s,e);switch(a.type){case"ExportAllDeclaration":a.exported=null;break;case"ExportNamedDeclaration":a.specifiers.length===1&&a.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(a,"ExportAllDeclaration"),a.exported=a.specifiers[0].exported,delete a.specifiers);case"ExportDefaultDeclaration":{const{declaration:o}=a;(o==null?void 0:o.type)==="ClassDeclaration"&&((n=o.decorators)==null?void 0:n.length)>0&&o.start===a.start&&this.resetStartLocation(a,i)}break}return a}stopParseSubscript(s,e){const i=super.stopParseSubscript(s,e);return e.optionalChainMember?this.estreeParseChainExpression(i,s.loc.end):i}parseMember(s,e,i,a,n){const o=super.parseMember(s,e,i,a,n);return o.type==="OptionalMemberExpression"?this.castNodeTo(o,"MemberExpression"):o.optional=!1,o}isOptionalMemberExpression(s){return s.type==="ChainExpression"?s.expression.type==="MemberExpression":super.isOptionalMemberExpression(s)}hasPropertyAsPrivateName(s){return s.type==="ChainExpression"&&(s=s.expression),super.hasPropertyAsPrivateName(s)}isObjectProperty(s){return s.type==="Property"&&s.kind==="init"&&!s.method}isObjectMethod(s){return s.type==="Property"&&(s.method||s.kind==="get"||s.kind==="set")}castNodeTo(s,e){const i=super.castNodeTo(s,e);return this.fillOptionalPropertiesForTSESLint(i),i}cloneIdentifier(s){const e=super.cloneIdentifier(s);return this.fillOptionalPropertiesForTSESLint(e),e}cloneStringLiteral(s){return s.type==="Literal"?this.cloneEstreeStringLiteral(s):super.cloneStringLiteral(s)}finishNodeAt(s,e,i){return Ye(super.finishNodeAt(s,e,i))}finishNode(s,e){const i=super.finishNode(s,e);return this.fillOptionalPropertiesForTSESLint(i),i}resetStartLocation(s,e){super.resetStartLocation(s,e),Ye(s)}resetEndLocation(s,e=this.state.lastTokEndLoc){super.resetEndLocation(s,e),Ye(s)}};class xt{constructor(t,s){m(this,"token");m(this,"preserveSpace");this.token=t,this.preserveSpace=!!s}}const M={brace:new xt("{"),j_oTag:new xt("<tag"),j_cTag:new xt("</tag"),j_expr:new xt("<tag>...</tag>",!0)},I=!0,y=!0,Ht=!0,Qe=!0,be=!0,Yr=!0;class qs{constructor(t,s={}){m(this,"label");m(this,"keyword");m(this,"beforeExpr");m(this,"startsExpr");m(this,"rightAssociative");m(this,"isLoop");m(this,"isAssign");m(this,"prefix");m(this,"postfix");m(this,"binop");this.label=t,this.keyword=s.keyword,this.beforeExpr=!!s.beforeExpr,this.startsExpr=!!s.startsExpr,this.rightAssociative=!!s.rightAssociative,this.isLoop=!!s.isLoop,this.isAssign=!!s.isAssign,this.prefix=!!s.prefix,this.postfix=!!s.postfix,this.binop=s.binop!=null?s.binop:null}}const Kt=new Map;function v(r,t={}){t.keyword=r;const s=T(r,t);return Kt.set(r,s),s}function G(r,t){return T(r,{beforeExpr:I,binop:t})}let Ze=-1;const Jt=[],Wt=[],Gt=[],Xt=[],Yt=[],Qt=[];function T(r,t={}){return++Ze,Wt.push(r),Gt.push(t.binop??-1),Xt.push(t.beforeExpr??!1),Yt.push(t.startsExpr??!1),Qt.push(t.prefix??!1),Jt.push(new qs(r,t)),Ze}function E(r,t={}){return++Ze,Kt.set(r,Ze),Wt.push(r),Gt.push(t.binop??-1),Xt.push(t.beforeExpr??!1),Yt.push(t.startsExpr??!1),Qt.push(t.prefix??!1),Jt.push(new qs("name",t)),Ze}const Qr={bracketL:T("[",{beforeExpr:I,startsExpr:y}),bracketHashL:T("#[",{beforeExpr:I,startsExpr:y}),bracketBarL:T("[|",{beforeExpr:I,startsExpr:y}),bracketR:T("]"),bracketBarR:T("|]"),braceL:T("{",{beforeExpr:I,startsExpr:y}),braceBarL:T("{|",{beforeExpr:I,startsExpr:y}),braceHashL:T("#{",{beforeExpr:I,startsExpr:y}),braceR:T("}"),braceBarR:T("|}"),parenL:T("(",{beforeExpr:I,startsExpr:y}),parenR:T(")"),comma:T(",",{beforeExpr:I}),semi:T(";",{beforeExpr:I}),colon:T(":",{beforeExpr:I}),doubleColon:T("::",{beforeExpr:I}),dot:T("."),question:T("?",{beforeExpr:I}),questionDot:T("?."),arrow:T("=>",{beforeExpr:I}),template:T("template"),ellipsis:T("...",{beforeExpr:I}),backQuote:T("`",{startsExpr:y}),dollarBraceL:T("${",{beforeExpr:I,startsExpr:y}),templateTail:T("...`",{startsExpr:y}),templateNonTail:T("...${",{beforeExpr:I,startsExpr:y}),at:T("@"),hash:T("#",{startsExpr:y}),interpreterDirective:T("#!..."),eq:T("=",{beforeExpr:I,isAssign:Qe}),assign:T("_=",{beforeExpr:I,isAssign:Qe}),slashAssign:T("_=",{beforeExpr:I,isAssign:Qe}),xorAssign:T("_=",{beforeExpr:I,isAssign:Qe}),moduloAssign:T("_=",{beforeExpr:I,isAssign:Qe}),incDec:T("++/--",{prefix:be,postfix:Yr,startsExpr:y}),bang:T("!",{beforeExpr:I,prefix:be,startsExpr:y}),tilde:T("~",{beforeExpr:I,prefix:be,startsExpr:y}),doubleCaret:T("^^",{startsExpr:y}),doubleAt:T("@@",{startsExpr:y}),pipeline:G("|>",0),nullishCoalescing:G("??",1),logicalOR:G("||",1),logicalAND:G("&&",2),bitwiseOR:G("|",3),bitwiseXOR:G("^",4),bitwiseAND:G("&",5),equality:G("==/!=/===/!==",6),lt:G("</>/<=/>=",7),gt:G("</>/<=/>=",7),relational:G("</>/<=/>=",7),bitShift:G("<</>>/>>>",8),bitShiftL:G("<</>>/>>>",8),bitShiftR:G("<</>>/>>>",8),plusMin:T("+/-",{beforeExpr:I,binop:9,prefix:be,startsExpr:y}),modulo:T("%",{binop:10,startsExpr:y}),star:T("*",{binop:10}),slash:G("/",10),exponent:T("**",{beforeExpr:I,binop:11,rightAssociative:!0}),_in:v("in",{beforeExpr:I,binop:7}),_instanceof:v("instanceof",{beforeExpr:I,binop:7}),_break:v("break"),_case:v("case",{beforeExpr:I}),_catch:v("catch"),_continue:v("continue"),_debugger:v("debugger"),_default:v("default",{beforeExpr:I}),_else:v("else",{beforeExpr:I}),_finally:v("finally"),_function:v("function",{startsExpr:y}),_if:v("if"),_return:v("return",{beforeExpr:I}),_switch:v("switch"),_throw:v("throw",{beforeExpr:I,prefix:be,startsExpr:y}),_try:v("try"),_var:v("var"),_const:v("const"),_with:v("with"),_new:v("new",{beforeExpr:I,startsExpr:y}),_this:v("this",{startsExpr:y}),_super:v("super",{startsExpr:y}),_class:v("class",{startsExpr:y}),_extends:v("extends",{beforeExpr:I}),_export:v("export"),_import:v("import",{startsExpr:y}),_null:v("null",{startsExpr:y}),_true:v("true",{startsExpr:y}),_false:v("false",{startsExpr:y}),_typeof:v("typeof",{beforeExpr:I,prefix:be,startsExpr:y}),_void:v("void",{beforeExpr:I,prefix:be,startsExpr:y}),_delete:v("delete",{beforeExpr:I,prefix:be,startsExpr:y}),_do:v("do",{isLoop:Ht,beforeExpr:I}),_for:v("for",{isLoop:Ht}),_while:v("while",{isLoop:Ht}),_as:E("as",{startsExpr:y}),_assert:E("assert",{startsExpr:y}),_async:E("async",{startsExpr:y}),_await:E("await",{startsExpr:y}),_defer:E("defer",{startsExpr:y}),_from:E("from",{startsExpr:y}),_get:E("get",{startsExpr:y}),_let:E("let",{startsExpr:y}),_meta:E("meta",{startsExpr:y}),_of:E("of",{startsExpr:y}),_sent:E("sent",{startsExpr:y}),_set:E("set",{startsExpr:y}),_source:E("source",{startsExpr:y}),_static:E("static",{startsExpr:y}),_using:E("using",{startsExpr:y}),_yield:E("yield",{startsExpr:y}),_asserts:E("asserts",{startsExpr:y}),_checks:E("checks",{startsExpr:y}),_exports:E("exports",{startsExpr:y}),_global:E("global",{startsExpr:y}),_implements:E("implements",{startsExpr:y}),_intrinsic:E("intrinsic",{startsExpr:y}),_infer:E("infer",{startsExpr:y}),_is:E("is",{startsExpr:y}),_mixins:E("mixins",{startsExpr:y}),_proto:E("proto",{startsExpr:y}),_require:E("require",{startsExpr:y}),_satisfies:E("satisfies",{startsExpr:y}),_keyof:E("keyof",{startsExpr:y}),_readonly:E("readonly",{startsExpr:y}),_unique:E("unique",{startsExpr:y}),_abstract:E("abstract",{startsExpr:y}),_declare:E("declare",{startsExpr:y}),_enum:E("enum",{startsExpr:y}),_module:E("module",{startsExpr:y}),_namespace:E("namespace",{startsExpr:y}),_interface:E("interface",{startsExpr:y}),_type:E("type",{startsExpr:y}),_opaque:E("opaque",{startsExpr:y}),name:T("name",{startsExpr:y}),placeholder:T("%%",{startsExpr:!0}),string:T("string",{startsExpr:y}),num:T("num",{startsExpr:y}),bigint:T("bigint",{startsExpr:y}),decimal:T("decimal",{startsExpr:y}),regexp:T("regexp",{startsExpr:y}),privateName:T("#name",{startsExpr:y}),eof:T("eof"),jsxName:T("jsxName"),jsxText:T("jsxText",{beforeExpr:!0}),jsxTagStart:T("jsxTagStart",{startsExpr:!0}),jsxTagEnd:T("jsxTagEnd")};function O(r){return r>=93&&r<=133}function Zr(r){return r<=92}function ne(r){return r>=58&&r<=133}function zs(r){return r>=58&&r<=137}function ea(r){return Xt[r]}function et(r){return Yt[r]}function ta(r){return r>=29&&r<=33}function Vs(r){return r>=129&&r<=131}function sa(r){return r>=90&&r<=92}function Zt(r){return r>=58&&r<=92}function ia(r){return r>=39&&r<=59}function ra(r){return r===34}function aa(r){return Qt[r]}function na(r){return r>=121&&r<=123}function oa(r){return r>=124&&r<=130}function ge(r){return Wt[r]}function Pt(r){return Gt[r]}function ca(r){return r===57}function es(r){return r>=24&&r<=25}function Hs(r){return Jt[r]}let ts="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Ks="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";const ha=new RegExp("["+ts+"]"),la=new RegExp("["+ts+Ks+"]");ts=Ks=null;const Js=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],ua=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function ss(r,t){let s=65536;for(let e=0,i=t.length;e<i;e+=2){if(s+=t[e],s>r)return!1;if(s+=t[e+1],s>=r)return!0}return!1}function pe(r){return r<65?r===36:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&ha.test(String.fromCharCode(r)):ss(r,Js)}function Fe(r){return r<48?r===36:r<58?!0:r<65?!1:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&la.test(String.fromCharCode(r)):ss(r,Js)||ss(r,ua)}const is={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},pa=new Set(is.keyword),fa=new Set(is.strict),da=new Set(is.strictBind);function Ws(r,t){return t&&r==="await"||r==="enum"}function Gs(r,t){return Ws(r,t)||fa.has(r)}function Xs(r){return da.has(r)}function Ys(r,t){return Gs(r,t)||Xs(r)}function ma(r){return pa.has(r)}function ya(r,t,s){return r===64&&t===64&&pe(s)}const xa=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Pa(r){return xa.has(r)}class rs{constructor(t){m(this,"flags",0);m(this,"names",new Map);m(this,"firstLexicalName","");this.flags=t}}class as{constructor(t,s){m(this,"parser");m(this,"scopeStack",[]);m(this,"inModule");m(this,"undefinedExports",new Map);this.parser=t,this.inModule=s}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){const t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){const{flags:s}=this.scopeStack[t];if(s&128)return!0;if(s&707)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new rs(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,s,e){let i=this.currentScope();if(s&8||s&16){this.checkRedeclarationInScope(i,t,s,e);let a=i.names.get(t)||0;s&16?a=a|4:(i.firstLexicalName||(i.firstLexicalName=t),a=a|2),i.names.set(t,a),s&8&&this.maybeExportDefined(i,t)}else if(s&4)for(let a=this.scopeStack.length-1;a>=0&&(i=this.scopeStack[a],this.checkRedeclarationInScope(i,t,s,e),i.names.set(t,(i.names.get(t)||0)|1),this.maybeExportDefined(i,t),!(i.flags&643));--a);this.parser.inModule&&i.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,s){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(s)}checkRedeclarationInScope(t,s,e,i){this.isRedeclaredInScope(t,s,e)&&this.parser.raise(p.VarRedeclaration,i,{identifierName:s})}isRedeclaredInScope(t,s,e){if(!(e&1))return!1;if(e&8)return t.names.has(s);const i=t.names.get(s);return e&16?(i&2)>0||!this.treatFunctionsAsVarInScope(t)&&(i&1)>0:(i&2)>0&&!(t.flags&8&&t.firstLexicalName===s)||!this.treatFunctionsAsVarInScope(t)&&(i&4)>0}checkLocalExport(t){const{name:s}=t;this.scopeStack[0].names.has(s)||this.undefinedExports.set(s,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){const{flags:s}=this.scopeStack[t];if(s&643)return s}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){const{flags:s}=this.scopeStack[t];if(s&707&&!(s&4))return s}}}class ba extends rs{constructor(){super(...arguments);m(this,"declareFunctions",new Set)}}class ga extends as{createScope(t){return new ba(t)}declareName(t,s,e){const i=this.currentScope();if(s&2048){this.checkRedeclarationInScope(i,t,s,e),this.maybeExportDefined(i,t),i.declareFunctions.add(t);return}super.declareName(t,s,e)}isRedeclaredInScope(t,s,e){if(super.isRedeclaredInScope(t,s,e))return!0;if(e&2048&&!t.declareFunctions.has(s)){const i=t.names.get(s);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}}const wa=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),A=ue`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:r})=>`Cannot overwrite reserved type ${r}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:r,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${r} = true,\` or \`${r} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:r,enumName:t})=>`Enum member names need to be unique, but the name \`${r}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:r})=>`Enum \`${r}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:r,enumName:t})=>`Enum type \`${r}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:r})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${r}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:r,memberName:t,explicitType:s})=>`Enum \`${r}\` has type \`${s}\`, so the initializer of \`${t}\` needs to be a ${s} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:r,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${r}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:r,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${r}\`.`,EnumInvalidMemberName:({enumName:r,memberName:t,suggestion:s})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${s}\`, in enum \`${r}\`.`,EnumNumberMemberNotInitialized:({enumName:r,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${r}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:r})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${r}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:r})=>`Unexpected reserved type ${r}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:r,suggestion:t})=>`\`declare export ${r}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function Ta(r){return r.type==="DeclareExportAllDeclaration"||r.type==="DeclareExportDeclaration"&&(!r.declaration||r.declaration.type!=="TypeAlias"&&r.declaration.type!=="InterfaceDeclaration")}function Qs(r){return r.importKind==="type"||r.importKind==="typeof"}const Aa={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Sa(r,t){const s=[],e=[];for(let i=0;i<r.length;i++)(t(r[i],i,r)?s:e).push(r[i]);return[s,e]}const Ia=/\*?\s*@((?:no)?flow)\b/;var Ea=r=>class extends r{constructor(){super(...arguments);m(this,"flowPragma")}getScopeHandler(){return ga}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,i){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,i)}addComment(e){if(this.flowPragma===void 0){const i=Ia.exec(e.value);if(i)if(i[1]==="flow")this.flowPragma="flow";else if(i[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){const i=this.state.inType;this.state.inType=!0,this.expect(e||14);const a=this.flowParseType();return this.state.inType=i,a}flowParsePredicate(){const e=this.startNode(),i=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>i.index+1&&this.raise(A.UnexpectedSpaceBetweenModuloChecks,i),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){const e=this.state.inType;this.state.inType=!0,this.expect(14);let i=null,a=null;return this.match(54)?(this.state.inType=e,a=this.flowParsePredicate()):(i=this.flowParseType(),this.state.inType=e,this.match(54)&&(a=this.flowParsePredicate())),[i,a]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();const i=e.id=this.parseIdentifier(),a=this.startNode(),n=this.startNode();this.match(47)?a.typeParameters=this.flowParseTypeParameterDeclaration():a.typeParameters=null,this.expect(10);const o=this.flowParseFunctionTypeParams();return a.params=o.params,a.rest=o.rest,a.this=o._this,this.expect(11),[a.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),n.typeAnnotation=this.finishNode(a,"FunctionTypeAnnotation"),i.typeAnnotation=this.finishNode(n,"TypeAnnotation"),this.resetEndLocation(i),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,i){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(i&&this.raise(A.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,i);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();const i=e.body=this.startNode(),a=i.body=[];for(this.expect(5);!this.match(8);){let c=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(A.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(c)):(this.expectContextual(125,A.UnsupportedStatementInDeclareModule),c=this.flowParseDeclare(c,!0)),a.push(c)}this.scope.exit(),this.expect(8),this.finishNode(i,"BlockStatement");let n=null,o=!1;return a.forEach(c=>{Ta(c)?(n==="CommonJS"&&this.raise(A.AmbiguousDeclareModuleKind,c),n="ES"):c.type==="DeclareModuleExports"&&(o&&this.raise(A.DuplicateDeclareModuleExports,c),n==="ES"&&this.raise(A.AmbiguousDeclareModuleKind,c),n="CommonJS",o=!0)}),e.kind=n||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,i){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!i){const a=this.state.value;throw this.raise(A.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:a,suggestion:Aa[a]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"?(e.default=!1,delete e.exportKind,this.castNodeTo(e,"DeclareExportDeclaration")):this.castNodeTo(e,"DeclareExportAllDeclaration");this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();const i=this.flowParseTypeAlias(e);return this.castNodeTo(i,"DeclareTypeAlias"),i}flowParseDeclareOpaqueType(e){this.next();const i=this.flowParseOpaqueType(e,!0);return this.castNodeTo(i,"DeclareOpaqueType"),i}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,i){if(e.id=this.flowParseRestrictedIdentifier(!i,!0),this.scope.declareName(e.id.name,i?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!i&&this.eat(12));if(i){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:i,allowExact:!1,allowSpread:!1,allowProto:i,allowInexact:!1})}flowParseInterfaceExtends(){const e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(A.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,i,a){wa.has(e)&&this.raise(a?A.AssignReservedType:A.UnexpectedReservedType,i,{reservedType:e})}flowParseRestrictedIdentifier(e,i){return this.checkReservedType(this.state.value,this.state.startLoc,i),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,i){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,i||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){const i=this.state.startLoc,a=this.startNode(),n=this.flowParseVariance(),o=this.flowParseTypeAnnotatableIdentifier();return a.name=o.name,a.variance=n,a.bound=o.typeAnnotation,this.match(29)?(this.eat(29),a.default=this.flowParseType()):e&&this.raise(A.MissingTypeParamDefault,i),this.finishNode(a,"TypeParameter")}flowParseTypeParameterDeclaration(){const e=this.state.inType,i=this.startNode();i.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let a=!1;do{const n=this.flowParseTypeParameter(a);i.params.push(n),n.default&&(a=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(i,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==M.brace){const i=this.state.context;this.state.context=[i[0]];try{return e()}finally{this.state.context=i}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){const e=this.startNode(),i=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);const a=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=a}),this.state.inType=i,!this.state.inType&&this.curContext()===M.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return;const e=this.startNode(),i=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=i,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){const e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,i,a){return e.static=i,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=a,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,i){return e.static=i,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,i){const a=this.startNode();return e.static=i,e.value=this.flowParseObjectTypeMethodish(a),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:i,allowSpread:a,allowProto:n,allowInexact:o}){const c=this.state.inType;this.state.inType=!0;const h=this.startNode();h.callProperties=[],h.properties=[],h.indexers=[],h.internalSlots=[];let l,u,f=!1;for(i&&this.match(6)?(this.expect(6),l=9,u=!0):(this.expect(5),l=8,u=!1),h.exact=u;!this.match(l);){let P=!1,S=null,B=null;const C=this.startNode();if(n&&this.isContextual(118)){const U=this.lookahead();U.type!==14&&U.type!==17&&(this.next(),S=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){const U=this.lookahead();U.type!==14&&U.type!==17&&(this.next(),P=!0)}const D=this.flowParseVariance();if(this.eat(0))S!=null&&this.unexpected(S),this.eat(0)?(D&&this.unexpected(D.loc.start),h.internalSlots.push(this.flowParseObjectTypeInternalSlot(C,P))):h.indexers.push(this.flowParseObjectTypeIndexer(C,P,D));else if(this.match(10)||this.match(47))S!=null&&this.unexpected(S),D&&this.unexpected(D.loc.start),h.callProperties.push(this.flowParseObjectTypeCallProperty(C,P));else{let U="init";if(this.isContextual(99)||this.isContextual(104)){const g=this.lookahead();zs(g.type)&&(U=this.state.value,this.next())}const ye=this.flowParseObjectTypeProperty(C,P,S,D,U,a,o??!u);ye===null?(f=!0,B=this.state.lastTokStartLoc):h.properties.push(ye)}this.flowObjectTypeSemicolon(),B&&!this.match(8)&&!this.match(9)&&this.raise(A.UnexpectedExplicitInexactInObject,B)}this.expect(l),a&&(h.inexact=f);const d=this.finishNode(h,"ObjectTypeAnnotation");return this.state.inType=c,d}flowParseObjectTypeProperty(e,i,a,n,o,c,h){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(c?h||this.raise(A.InexactInsideExact,this.state.lastTokStartLoc):this.raise(A.InexactInsideNonObject,this.state.lastTokStartLoc),n&&this.raise(A.InexactVariance,n),null):(c||this.raise(A.UnexpectedSpreadType,this.state.lastTokStartLoc),a!=null&&this.unexpected(a),n&&this.raise(A.SpreadVariance,n),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=i,e.proto=a!=null,e.kind=o;let l=!1;return this.match(47)||this.match(10)?(e.method=!0,a!=null&&this.unexpected(a),n&&this.unexpected(n.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(o==="get"||o==="set")&&this.flowCheckGetterSetterParams(e),!c&&e.key.name==="constructor"&&e.value.this&&this.raise(A.ThisParamBannedInConstructor,e.value.this)):(o!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(l=!0),e.value=this.flowParseTypeInitialiser(),e.variance=n),e.optional=l,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){const i=e.kind==="get"?0:1,a=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?A.GetterMayNotHaveThisParam:A.SetterMayNotHaveThisParam,e.value.this),a!==i&&this.raise(e.kind==="get"?p.BadGetterArity:p.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(p.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,i){e??(e=this.state.startLoc);let a=i||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){const n=this.startNodeAt(e);n.qualification=a,n.id=this.flowParseRestrictedIdentifier(!0),a=this.finishNode(n,"QualifiedTypeIdentifier")}return a}flowParseGenericType(e,i){const a=this.startNodeAt(e);return a.typeParameters=null,a.id=this.flowParseQualifiedTypeIdentifier(e,i),this.match(47)&&(a.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(a,"GenericTypeAnnotation")}flowParseTypeofType(){const e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){const e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(e.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let i=null,a=!1,n=null;const o=this.startNode(),c=this.lookahead(),h=this.state.type===78;return c.type===14||c.type===17?(h&&!e&&this.raise(A.ThisParamMustBeFirst,o),i=this.parseIdentifier(h),this.eat(17)&&(a=!0,h&&this.raise(A.ThisParamMayNotBeOptional,o)),n=this.flowParseTypeInitialiser()):n=this.flowParseType(),o.name=i,o.optional=a,o.typeAnnotation=n,this.finishNode(o,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){const i=this.startNodeAt(e.loc.start);return i.name=null,i.optional=!1,i.typeAnnotation=e,this.finishNode(i,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let i=null,a=null;for(this.match(78)&&(a=this.flowParseFunctionTypeParam(!0),a.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(i=this.flowParseFunctionTypeParam(!1)),{params:e,rest:i,_this:a}}flowIdentToTypeAnnotation(e,i,a){switch(a.name){case"any":return this.finishNode(i,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(i,"BooleanTypeAnnotation");case"mixed":return this.finishNode(i,"MixedTypeAnnotation");case"empty":return this.finishNode(i,"EmptyTypeAnnotation");case"number":return this.finishNode(i,"NumberTypeAnnotation");case"string":return this.finishNode(i,"StringTypeAnnotation");case"symbol":return this.finishNode(i,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(a.name),this.flowParseGenericType(e,a)}}flowParsePrimaryType(){const e=this.state.startLoc,i=this.startNode();let a,n,o=!1;const c=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,n=this.flowParseTupleType(),this.state.noAnonFunctionType=c,n;case 47:{const h=this.startNode();return h.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),a=this.flowParseFunctionTypeParams(),h.params=a.params,h.rest=a.rest,h.this=a._this,this.expect(11),this.expect(19),h.returnType=this.flowParseType(),this.finishNode(h,"FunctionTypeAnnotation")}case 10:{const h=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(O(this.state.type)||this.match(78)){const l=this.lookahead().type;o=l!==17&&l!==14}else o=!0;if(o){if(this.state.noAnonFunctionType=!1,n=this.flowParseType(),this.state.noAnonFunctionType=c,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),n;this.eat(12)}return n?a=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(n)]):a=this.flowParseFunctionTypeParams(),h.params=a.params,h.rest=a.rest,h.this=a._this,this.expect(11),this.expect(19),h.returnType=this.flowParseType(),h.typeParameters=null,this.finishNode(h,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return i.value=this.match(85),this.next(),this.finishNode(i,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",i);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",i);throw this.raise(A.UnexpectedSubtractionOperand,this.state.startLoc)}this.unexpected();return;case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(i,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(i,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(i,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(i,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(Zt(this.state.type)){const h=ge(this.state.type);return this.next(),super.createIdentifier(i,h)}else if(O(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,i,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){const e=this.state.startLoc;let i=this.flowParsePrimaryType(),a=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){const n=this.startNodeAt(e),o=this.eat(18);a=a||o,this.expect(0),!o&&this.match(3)?(n.elementType=i,this.next(),i=this.finishNode(n,"ArrayTypeAnnotation")):(n.objectType=i,n.indexType=this.flowParseType(),this.expect(3),a?(n.optional=o,i=this.finishNode(n,"OptionalIndexedAccessType")):i=this.finishNode(n,"IndexedAccessType"))}return i}flowParsePrefixType(){const e=this.startNode();return this.eat(17)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){const e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){const i=this.startNodeAt(e.loc.start);return i.params=[this.reinterpretTypeAsFunctionTypeParam(e)],i.rest=null,i.this=null,i.returnType=this.flowParseType(),i.typeParameters=null,this.finishNode(i,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){const e=this.startNode();this.eat(45);const i=this.flowParseAnonFunctionWithoutParens();for(e.types=[i];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?i:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){const e=this.startNode();this.eat(43);const i=this.flowParseIntersectionType();for(e.types=[i];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?i:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){const e=this.state.inType;this.state.inType=!0;const i=this.flowParseUnionType();return this.state.inType=e,i}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){const e=this.state.startLoc,i=this.parseIdentifier();return this.flowParseGenericType(e,i)}else return this.flowParseType()}flowParseTypeAnnotation(){const e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(e){const i=e?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(i.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(i)),i}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}flowParseVariance(){let e=null;return this.match(53)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,i,a=!1){if(i){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,a));return}super.parseFunctionBody(e,!1,a)}parseFunctionBodyAndFinish(e,i,a=!1){if(this.match(14)){const n=this.startNode();[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=n.typeAnnotation?this.finishNode(n,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,i,a)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){const a=this.lookahead();if(ne(a.type)){const n=this.startNode();return this.next(),this.flowParseInterface(n)}}else if(this.isContextual(126)){const a=this.startNode();return this.next(),this.flowParseEnumDeclaration(a)}const i=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(i)&&(this.flowPragma=null),i}parseExpressionStatement(e,i,a){if(i.type==="Identifier"){if(i.name==="declare"){if(this.match(80)||O(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(O(this.state.type)){if(i.name==="interface")return this.flowParseInterface(e);if(i.name==="type")return this.flowParseTypeAlias(e);if(i.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,i,a)}shouldParseExportDeclaration(){const{type:e}=this.state;return e===126||Vs(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){const{type:e}=this.state;return e===126||Vs(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){const e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,i,a){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){const d=this.lookaheadCharCode();if(d===44||d===61||d===58||d===41)return this.setOptionalParametersError(a),e}this.expect(17);const n=this.state.clone(),o=this.state.noArrowAt,c=this.startNodeAt(i);let{consequent:h,failed:l}=this.tryParseConditionalConsequent(),[u,f]=this.getArrowLikeExpressions(h);if(l||f.length>0){const d=[...o];if(f.length>0){this.state=n,this.state.noArrowAt=d;for(let P=0;P<f.length;P++)d.push(f[P].start);({consequent:h,failed:l}=this.tryParseConditionalConsequent()),[u,f]=this.getArrowLikeExpressions(h)}l&&u.length>1&&this.raise(A.AmbiguousConditionalArrow,n.startLoc),l&&u.length===1&&(this.state=n,d.push(u[0].start),this.state.noArrowAt=d,{consequent:h,failed:l}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(h,!0),this.state.noArrowAt=o,this.expect(14),c.test=e,c.consequent=h,c.alternate=this.forwardNoArrowParamsConversionAt(c,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(c,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);const e=this.parseMaybeAssignAllowIn(),i=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:i}}getArrowLikeExpressions(e,i){const a=[e],n=[];for(;a.length!==0;){const o=a.pop();o.type==="ArrowFunctionExpression"&&o.body.type!=="BlockStatement"?(o.typeParameters||!o.returnType?this.finishArrowValidation(o):n.push(o),a.push(o.body)):o.type==="ConditionalExpression"&&(a.push(o.consequent),a.push(o.alternate))}return i?(n.forEach(o=>this.finishArrowValidation(o)),[n,[]]):Sa(n,o=>o.params.every(c=>this.isAssignable(c,!0)))}finishArrowValidation(e){var i;this.toAssignableList(e.params,(i=e.extra)==null?void 0:i.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,i){let a;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),a=i(),this.state.noArrowParamsConversionAt.pop()):a=i(),a}parseParenItem(e,i){const a=super.parseParenItem(e,i);if(this.eat(17)&&(a.optional=!0,this.resetEndLocation(e)),this.match(14)){const n=this.startNodeAt(i);return n.expression=a,n.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(n,"TypeCastExpression")}return a}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";const i=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(i)}else if(this.isContextual(131)){e.exportKind="type";const i=this.startNode();return this.next(),this.flowParseOpaqueType(i,!1)}else if(this.isContextual(129)){e.exportKind="type";const i=this.startNode();return this.next(),this.flowParseInterface(i)}else if(this.isContextual(126)){e.exportKind="value";const i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){const{startLoc:i}=this.state,a=super.maybeParseExportNamespaceSpecifier(e);return a&&e.exportKind==="type"&&this.unexpected(i),a}parseClassId(e,i,a){super.parseClassId(e,i,a),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,i,a){const{startLoc:n}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,i))return;i.declare=!0}super.parseClassMember(e,i,a),i.declare&&(i.type!=="ClassProperty"&&i.type!=="ClassPrivateProperty"&&i.type!=="PropertyDefinition"?this.raise(A.DeclareClassElement,n):i.value&&this.raise(A.DeclareClassFieldInitializer,i.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){const e=super.readWord1(),i="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(p.InvalidIdentifier,this.state.curPosition(),{identifierName:i}),this.finishToken(132,i)}getTokenFromCode(e){const i=this.input.charCodeAt(this.state.pos+1);e===123&&i===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?i===46?this.finishOp(18,2):this.finishOp(17,1):ya(e,i,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,i){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,i):super.isAssignable(e,i)}toAssignable(e,i=!1){!i&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,i)}toAssignableList(e,i,a){for(let n=0;n<e.length;n++){const o=e[n];(o==null?void 0:o.type)==="TypeCastExpression"&&(e[n]=this.typeCastToParameter(o))}super.toAssignableList(e,i,a)}toReferencedList(e,i){var a;for(let n=0;n<e.length;n++){const o=e[n];o&&o.type==="TypeCastExpression"&&!((a=o.extra)!=null&&a.parenthesized)&&(e.length>1||!i)&&this.raise(A.TypeCastInPattern,o.typeAnnotation)}return e}parseArrayLike(e,i,a,n){const o=super.parseArrayLike(e,i,a,n);return i&&!this.state.maybeInArrowParameters&&this.toReferencedList(o.elements),o}isValidLVal(e,i,a){return e==="TypeCastExpression"||super.isValidLVal(e,i,a)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,i,a,n,o,c){if(i.variance&&this.unexpected(i.variance.loc.start),delete i.variance,this.match(47)&&(i.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,i,a,n,o,c),i.params&&o){const h=i.params;h.length>0&&this.isThisParam(h[0])&&this.raise(A.ThisParamBannedInConstructor,i)}else if(i.type==="MethodDefinition"&&o&&i.value.params){const h=i.value.params;h.length>0&&this.isThisParam(h[0])&&this.raise(A.ThisParamBannedInConstructor,i)}}pushClassPrivateMethod(e,i,a,n){i.variance&&this.unexpected(i.variance.loc.start),delete i.variance,this.match(47)&&(i.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,i,a,n)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeArguments=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();const i=e.implements=[];do{const a=this.startNode();a.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?a.typeParameters=this.flowParseTypeParameterInstantiation():a.typeParameters=null,i.push(this.finishNode(a,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);const i=this.getObjectOrClassMethodParams(e);if(i.length>0){const a=i[0];this.isThisParam(a)&&e.kind==="get"?this.raise(A.GetterMayNotHaveThisParam,a):this.isThisParam(a)&&this.raise(A.SetterMayNotHaveThisParam,a)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,i,a,n,o,c,h){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let l;this.match(47)&&!c&&(l=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());const u=super.parseObjPropValue(e,i,a,n,o,c,h);return l&&((u.value||u).typeParameters=l),u}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(A.PatternIsOptional,e),this.isThisParam(e)&&this.raise(A.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(A.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(A.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,i){const a=super.parseMaybeDefault(e,i);return a.type==="AssignmentPattern"&&a.typeAnnotation&&a.right.start<a.typeAnnotation.start&&this.raise(A.TypeBeforeInitializer,a.typeAnnotation),a}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(A.ImportReflectionHasImportType,e.specifiers[0].loc.start)}parseImportSpecifierLocal(e,i,a){i.local=Qs(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(i,a))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){if(!e)return!0;const i=this.lookaheadCharCode();return i===123||i===42}return!e&&this.isContextual(87)}applyImportPhase(e,i,a,n){if(super.applyImportPhase(e,i,a,n),i){if(!a&&this.match(65))return;e.exportKind=a==="type"?a:"value"}else a==="type"&&this.match(55)&&this.unexpected(),e.importKind=a==="type"||a==="typeof"?a:"value"}parseImportSpecifier(e,i,a,n,o){const c=e.imported;let h=null;c.type==="Identifier"&&(c.name==="type"?h="type":c.name==="typeof"&&(h="typeof"));let l=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){const f=this.parseIdentifier(!0);h!==null&&!ne(this.state.type)?(e.imported=f,e.importKind=h,e.local=this.cloneIdentifier(f)):(e.imported=c,e.importKind=null,e.local=this.parseIdentifier())}else{if(h!==null&&ne(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=h;else{if(i)throw this.raise(p.ImportBindingIsString,e,{importName:c.value});e.imported=c,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(l=!0,e.local=this.cloneIdentifier(e.imported))}const u=Qs(e);return a&&u&&this.raise(A.ImportTypeShorthandOnlyInPureImport,e),(a||u)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),l&&!a&&!u&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,i){const a=e.kind;a!=="get"&&a!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,i)}parseVarId(e,i){super.parseVarId(e,i),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,i){if(this.match(14)){const a=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=a}return super.parseAsyncArrowFromCallExpression(e,i)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,i){let a=null,n;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(a=this.state.clone(),n=this.tryParse(()=>super.parseMaybeAssign(e,i),a),!n.error)return n.node;const{context:o}=this.state,c=o[o.length-1];(c===M.j_oTag||c===M.j_expr)&&o.pop()}if(n!=null&&n.error||this.match(47)){a=a||this.state.clone();let o;const c=this.tryParse(l=>{var d;o=this.flowParseTypeParameterDeclaration();const u=this.forwardNoArrowParamsConversionAt(o,()=>{const P=super.parseMaybeAssign(e,i);return this.resetStartLocationFromNode(P,o),P});(d=u.extra)!=null&&d.parenthesized&&l();const f=this.maybeUnwrapTypeCastExpression(u);return f.type!=="ArrowFunctionExpression"&&l(),f.typeParameters=o,this.resetStartLocationFromNode(f,o),u},a);let h=null;if(c.node&&this.maybeUnwrapTypeCastExpression(c.node).type==="ArrowFunctionExpression"){if(!c.error&&!c.aborted)return c.node.async&&this.raise(A.UnexpectedTypeParameterBeforeAsyncArrowFunction,o),c.node;h=c.node}if(n!=null&&n.node)return this.state=n.failState,n.node;if(h)return this.state=c.failState,h;throw n!=null&&n.thrown?n.error:c.thrown?c.error:this.raise(A.UnexpectedTokenAfterTypeParameter,o)}return super.parseMaybeAssign(e,i)}parseArrow(e){if(this.match(14)){const i=this.tryParse(()=>{const a=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;const n=this.startNode();return[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=a,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),n});if(i.thrown)return null;i.error&&(this.state=i.failState),e.returnType=i.node.typeAnnotation?this.finishNode(i.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,i){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=i:super.setArrowFunctionParameters(e,i)}checkParams(e,i,a,n=!0){if(!(a&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let o=0;o<e.params.length;o++)this.isThisParam(e.params[o])&&o>0&&this.raise(A.ThisParamMustBeFirst,e.params[o]);super.checkParams(e,i,a,n)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,i,a){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(i.index)){this.next();const n=this.startNodeAt(i);n.callee=e,n.arguments=super.parseCallExpressionArguments(11),e=this.finishNode(n,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){const n=this.state.clone(),o=this.tryParse(h=>this.parseAsyncArrowWithTypeParameters(i)||h(),n);if(!o.error&&!o.aborted)return o.node;const c=this.tryParse(()=>super.parseSubscripts(e,i,a),n);if(c.node&&!c.error)return c.node;if(o.node)return this.state=o.failState,o.node;if(c.node)return this.state=c.failState,c.node;throw o.error||c.error}return super.parseSubscripts(e,i,a)}parseSubscript(e,i,a,n){if(this.match(18)&&this.isLookaheadToken_lt()){if(n.optionalChainMember=!0,a)return n.stop=!0,e;this.next();const o=this.startNodeAt(i);return o.callee=e,o.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),o.arguments=this.parseCallExpressionArguments(11),o.optional=!0,this.finishCallExpression(o,!0)}else if(!a&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){const o=this.startNodeAt(i);o.callee=e;const c=this.tryParse(()=>(o.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),o.arguments=super.parseCallExpressionArguments(11),n.optionalChainMember&&(o.optional=!1),this.finishCallExpression(o,n.optionalChainMember)));if(c.node)return c.error&&(this.state=c.failState),c.node}return super.parseSubscript(e,i,a,n)}parseNewCallee(e){super.parseNewCallee(e);let i=null;this.shouldParseTypes()&&this.match(47)&&(i=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=i}parseAsyncArrowWithTypeParameters(e){const i=this.startNodeAt(e);if(this.parseFunctionParams(i,!1),!!this.parseArrow(i))return super.parseArrowExpression(i,void 0,!0)}readToken_mult_modulo(e){const i=this.input.charCodeAt(this.state.pos+1);if(e===42&&i===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){const i=this.input.charCodeAt(this.state.pos+1);if(e===124&&i===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,i){const a=super.parseTopLevel(e,i);return this.state.hasFlowComment&&this.raise(A.UnterminatedFlowComment,this.state.curPosition()),a}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(A.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();const e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){const{pos:e}=this.state;let i=2;for(;[32,9].includes(this.input.charCodeAt(e+i));)i++;const a=this.input.charCodeAt(i+e),n=this.input.charCodeAt(i+e+1);return a===58&&n===58?i+2:this.input.slice(i+e,i+e+12)==="flow-include"?i+12:a===58&&n!==58?i:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:i,memberName:a}){this.raise(A.EnumBooleanMemberNotInitialized,e,{memberName:a,enumName:i})}flowEnumErrorInvalidMemberInitializer(e,i){return this.raise(i.explicitType?i.explicitType==="symbol"?A.EnumInvalidMemberInitializerSymbolType:A.EnumInvalidMemberInitializerPrimaryType:A.EnumInvalidMemberInitializerUnknownType,e,i)}flowEnumErrorNumberMemberNotInitialized(e,i){this.raise(A.EnumNumberMemberNotInitialized,e,i)}flowEnumErrorStringMemberInconsistentlyInitialized(e,i){this.raise(A.EnumStringMemberInconsistentlyInitialized,e,i)}flowEnumMemberInit(){const e=this.state.startLoc,i=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{const a=this.parseNumericLiteral(this.state.value);return i()?{type:"number",loc:a.loc.start,value:a}:{type:"invalid",loc:e}}case 134:{const a=this.parseStringLiteral(this.state.value);return i()?{type:"string",loc:a.loc.start,value:a}:{type:"invalid",loc:e}}case 85:case 86:{const a=this.parseBooleanLiteral(this.match(85));return i()?{type:"boolean",loc:a.loc.start,value:a}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){const e=this.state.startLoc,i=this.parseIdentifier(!0),a=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:i,init:a}}flowEnumCheckExplicitTypeMismatch(e,i,a){const{explicitType:n}=i;n!==null&&n!==a&&this.flowEnumErrorInvalidMemberInitializer(e,i)}flowEnumMembers({enumName:e,explicitType:i}){const a=new Set,n={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]};let o=!1;for(;!this.match(8);){if(this.eat(21)){o=!0;break}const c=this.startNode(),{id:h,init:l}=this.flowEnumMemberRaw(),u=h.name;if(u==="")continue;/^[a-z]/.test(u)&&this.raise(A.EnumInvalidMemberName,h,{memberName:u,suggestion:u[0].toUpperCase()+u.slice(1),enumName:e}),a.has(u)&&this.raise(A.EnumDuplicateMemberName,h,{memberName:u,enumName:e}),a.add(u);const f={enumName:e,explicitType:i,memberName:u};switch(c.id=h,l.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(l.loc,f,"boolean"),c.init=l.value,n.booleanMembers.push(this.finishNode(c,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(l.loc,f,"number"),c.init=l.value,n.numberMembers.push(this.finishNode(c,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(l.loc,f,"string"),c.init=l.value,n.stringMembers.push(this.finishNode(c,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(l.loc,f);case"none":switch(i){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(l.loc,f);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(l.loc,f);break;default:n.defaultedMembers.push(this.finishNode(c,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:n,hasUnknownMembers:o}}flowEnumStringMembers(e,i,{enumName:a}){if(e.length===0)return i;if(i.length===0)return e;if(i.length>e.length){for(const n of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:a});return i}else{for(const n of i)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:a});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!O(this.state.type))throw this.raise(A.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});const{value:i}=this.state;return this.next(),i!=="boolean"&&i!=="number"&&i!=="string"&&i!=="symbol"&&this.raise(A.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:i}),i}flowEnumBody(e,i){const a=i.name,n=i.loc.start,o=this.flowEnumParseExplicitType({enumName:a});this.expect(5);const{members:c,hasUnknownMembers:h}=this.flowEnumMembers({enumName:a,explicitType:o});switch(e.hasUnknownMembers=h,o){case"boolean":return e.explicitType=!0,e.members=c.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=c.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(c.stringMembers,c.defaultedMembers,{enumName:a}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=c.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{const l=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;const u=c.booleanMembers.length,f=c.numberMembers.length,d=c.stringMembers.length,P=c.defaultedMembers.length;if(!u&&!f&&!d&&!P)return l();if(!u&&!f)return e.members=this.flowEnumStringMembers(c.stringMembers,c.defaultedMembers,{enumName:a}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!f&&!d&&u>=P){for(const S of c.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(S.loc.start,{enumName:a,memberName:S.id.name});return e.members=c.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!u&&!d&&f>=P){for(const S of c.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(S.loc.start,{enumName:a,memberName:S.id.name});return e.members=c.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(A.EnumInconsistentMemberValues,n,{enumName:a}),l()}}}flowParseEnumDeclaration(e){const i=this.parseIdentifier();return e.id=i,e.body=this.flowEnumBody(this.startNode(),i),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){const e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){const i=this.input.charCodeAt(e+1);return i!==60&&i!==61}return!1}reScan_lt_gt(){const{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){const{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}};const Ca={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},ka=/\r\n|[\r\n\u2028\u2029]/,bt=new RegExp(ka.source,"g");function Be(r){switch(r){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Zs(r,t,s){for(let e=t;e<s;e++)if(Be(r.charCodeAt(e)))return!0;return!1}const ns=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,os=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function Na(r){switch(r){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}const fe=ue`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:r})=>`Expected corresponding JSX closing tag for <${r}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:r,HTMLEntity:t})=>`Unexpected token \`${r}\`. Did you mean \`${t}\` or \`{'${r}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function we(r){return r?r.type==="JSXOpeningFragment"||r.type==="JSXClosingFragment":!1}function Re(r){if(r.type==="JSXIdentifier")return r.name;if(r.type==="JSXNamespacedName")return r.namespace.name+":"+r.name.name;if(r.type==="JSXMemberExpression")return Re(r.object)+"."+Re(r.property);throw new Error("Node had unexpected type: "+r.type)}var va=r=>class extends r{jsxReadToken(){let s="",e=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(fe.UnterminatedJsxContent,this.state.startLoc);const i=this.input.charCodeAt(this.state.pos);switch(i){case 60:case 123:if(this.state.pos===this.state.start){i===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(i);return}s+=this.input.slice(e,this.state.pos),this.finishToken(142,s);return;case 38:s+=this.input.slice(e,this.state.pos),s+=this.jsxReadEntity(),e=this.state.pos;break;case 62:case 125:this.raise(fe.UnexpectedToken,this.state.curPosition(),{unexpected:this.input[this.state.pos],HTMLEntity:i===125?"&rbrace;":"&gt;"});default:Be(i)?(s+=this.input.slice(e,this.state.pos),s+=this.jsxReadNewLine(!0),e=this.state.pos):++this.state.pos}}}jsxReadNewLine(s){const e=this.input.charCodeAt(this.state.pos);let i;return++this.state.pos,e===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,i=s?`
4
4
  `:`\r
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instantdb/platform",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
4
4
  "description": "Instant's platform package for managing Instant apps.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/instantdb/instant/tree/main/client/packages/platform",
@@ -55,9 +55,9 @@
55
55
  "dependencies": {
56
56
  "@babel/parser": "^8.0.0-beta.0",
57
57
  "@babel/types": "^8.0.0-beta.0",
58
- "@instantdb/core": "1.0.41",
59
- "@instantdb/version": "1.0.41",
60
- "@instantdb/webhooks": "1.0.41"
58
+ "@instantdb/core": "1.0.42",
59
+ "@instantdb/version": "1.0.42",
60
+ "@instantdb/webhooks": "1.0.42"
61
61
  },
62
62
  "scripts": {
63
63
  "test": "vitest",