@inspectr/app 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/dist/_astro/client.DghpSMxZ.js +33 -0
- package/dist/_astro/{index.uG8-tmmD.js → index.CtIA4zXx.js} +1 -1
- package/dist/_astro/{index.DqJDusVa.css → index.DkFoYwcI.css} +1 -1
- package/dist/_astro/ui.Ct8_qMBH.js +25 -0
- package/dist/index.html +2 -2
- package/package.json +2 -2
- package/dist/_astro/client.WCY5ZO72.js +0 -33
- package/dist/_astro/ui.VFnAlxts.js +0 -23
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import{r as Q,a as Re}from"./index.uG8-tmmD.js";var Qo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Qr={exports:{}},Dt={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Ur;function Vo(){if(Ur)return Dt;Ur=1;var s=Symbol.for("react.transitional.element"),p=Symbol.for("react.fragment");function d(b,O,A){var C=null;if(A!==void 0&&(C=""+A),O.key!==void 0&&(C=""+O.key),"key"in O){A={};for(var E in O)E!=="key"&&(A[E]=O[E])}else A=O;return O=A.ref,{$$typeof:s,type:b,key:C,ref:O!==void 0?O:null,props:A}}return Dt.Fragment=p,Dt.jsx=d,Dt.jsxs=d,Dt}var Vr;function Ho(){return Vr||(Vr=1,Qr.exports=Vo()),Qr.exports}var y=Ho(),sr={exports:{}},Wo=sr.exports,Hr;function Jo(){return Hr||(Hr=1,function(s,p){(function(d,b){s.exports=b()})(Wo,function(){var d=function(e,t){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])})(e,t)},b=function(){return(b=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function O(e,t,n){for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||((r=r||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var A=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Qo,C=Object.keys,E=Array.isArray;function T(e,t){return typeof t!="object"||C(t).forEach(function(n){e[n]=t[n]}),e}typeof Promise>"u"||A.Promise||(A.Promise=Promise);var L=Object.getPrototypeOf,z={}.hasOwnProperty;function M(e,t){return z.call(e,t)}function ie(e,t){typeof t=="function"&&(t=t(L(e))),(typeof Reflect>"u"?C:Reflect.ownKeys)(t).forEach(function(n){ae(e,n,t[n])})}var pe=Object.defineProperty;function ae(e,t,n,r){pe(e,t,T(n&&M(n,"get")&&typeof n.get=="function"?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function ge(e){return{from:function(t){return e.prototype=Object.create(t.prototype),ae(e.prototype,"constructor",e),{extend:ie.bind(null,e.prototype)}}}}var Ce=Object.getOwnPropertyDescriptor,Ie=[].slice;function re(e,t,n){return Ie.call(e,t,n)}function be(e,t){return t(e)}function Ae(e){if(!e)throw new Error("Assertion Failed")}function le(e){A.setImmediate?setImmediate(e):setTimeout(e,0)}function te(e,t){if(typeof t=="string"&&M(e,t))return e[t];if(!t)return e;if(typeof t!="string"){for(var n=[],r=0,o=t.length;r<o;++r){var i=te(e,t[r]);n.push(i)}return n}var a=t.indexOf(".");if(a!==-1){var u=e[t.substr(0,a)];return u==null?void 0:te(u,t.substr(a+1))}}function V(e,t,n){if(e&&t!==void 0&&!("isFrozen"in Object&&Object.isFrozen(e)))if(typeof t!="string"&&"length"in t){Ae(typeof n!="string"&&"length"in n);for(var r=0,o=t.length;r<o;++r)V(e,t[r],n[r])}else{var i,a,u=t.indexOf(".");u!==-1?(i=t.substr(0,u),(a=t.substr(u+1))===""?n===void 0?E(e)&&!isNaN(parseInt(i))?e.splice(i,1):delete e[i]:e[i]=n:V(u=!(u=e[i])||!M(e,i)?e[i]={}:u,a,n)):n===void 0?E(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function _e(e){var t,n={};for(t in e)M(e,t)&&(n[t]=e[t]);return n}var fe=[].concat;function Y(e){return fe.apply([],e)}var rt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Y([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return A[e]}),qe=new Set(rt.map(function(e){return A[e]})),Te=null;function Ke(e){return Te=new WeakMap,e=function t(n){if(!n||typeof n!="object")return n;var r=Te.get(n);if(r)return r;if(E(n)){r=[],Te.set(n,r);for(var o=0,i=n.length;o<i;++o)r.push(t(n[o]))}else if(qe.has(n.constructor))r=n;else{var a,u=L(n);for(a in r=u===Object.prototype?{}:Object.create(u),Te.set(n,r),n)M(n,a)&&(r[a]=t(n[a]))}return r}(e),Te=null,e}var tt={}.toString;function J(e){return tt.call(e).slice(8,-1)}var oe=typeof Symbol<"u"?Symbol.iterator:"@@iterator",Qe=typeof oe=="symbol"?function(e){var t;return e!=null&&(t=e[oe])&&t.apply(e)}:function(){return null};function Oe(e,t){return t=e.indexOf(t),0<=t&&e.splice(t,1),0<=t}var Pe={};function Be(e){var t,n,r,o;if(arguments.length===1){if(E(e))return e.slice();if(this===Pe&&typeof e=="string")return[e];if(o=Qe(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(e==null)return[e];if(typeof(t=e.length)!="number")return[e];for(n=new Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var $=typeof Symbol<"u"?function(e){return e[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},kt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Me=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(kt),ue={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function ye(e,t){this.name=e,this.message=t}function Ue(e,t){return e+". Errors: "+Object.keys(t).map(function(n){return t[n].toString()}).filter(function(n,r,o){return o.indexOf(n)===r}).join(`
|
|
10
|
-
`)}function De(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=Ue(e,t)}function ht(e,t){this.name="BulkError",this.failures=Object.keys(t).map(function(n){return t[n]}),this.failuresByPos=t,this.message=Ue(e,this.failures)}ge(ye).from(Error).extend({toString:function(){return this.name+": "+this.message}}),ge(De).from(ye),ge(ht).from(ye);var wn=Me.reduce(function(e,t){return e[t]=t+"Error",e},{}),fo=ye,U=Me.reduce(function(e,t){var n=t+"Error";function r(o,i){this.name=n,o?typeof o=="string"?(this.message="".concat(o).concat(i?`
|
|
11
|
-
`+i:""),this.inner=i||null):typeof o=="object"&&(this.message="".concat(o.name," ").concat(o.message),this.inner=o):(this.message=ue[t]||n,this.inner=null)}return ge(r).from(fo),e[t]=r,e},{});U.Syntax=SyntaxError,U.Type=TypeError,U.Range=RangeError;var cr=kt.reduce(function(e,t){return e[t+"Error"]=U[t],e},{}),zt=Me.reduce(function(e,t){return["Syntax","Type","Range"].indexOf(t)===-1&&(e[t+"Error"]=U[t]),e},{});function ne(){}function jt(e){return e}function ho(e,t){return e==null||e===jt?t:function(n){return t(e(n))}}function nt(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function po(e,t){return e===ne?t:function(){var n=e.apply(this,arguments);n!==void 0&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?nt(r,this.onsuccess):r),o&&(this.onerror=this.onerror?nt(o,this.onerror):o),i!==void 0?i:n}}function yo(e,t){return e===ne?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?nt(n,this.onsuccess):n),r&&(this.onerror=this.onerror?nt(r,this.onerror):r)}}function mo(e,t){return e===ne?t:function(n){var r=e.apply(this,arguments);T(n,r);var o=this.onsuccess,i=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),o&&(this.onsuccess=this.onsuccess?nt(o,this.onsuccess):o),i&&(this.onerror=this.onerror?nt(i,this.onerror):i),r===void 0?n===void 0?void 0:n:T(r,n)}}function vo(e,t){return e===ne?t:function(){return t.apply(this,arguments)!==!1&&e.apply(this,arguments)}}function jn(e,t){return e===ne?t:function(){var n=e.apply(this,arguments);if(n&&typeof n.then=="function"){for(var r=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return n.then(function(){return t.apply(r,i)})}return t.apply(this,arguments)}}zt.ModifyError=De,zt.DexieError=ye,zt.BulkError=ht;var Fe=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function lr(e){Fe=e}var _t={},fr=100,rt=typeof Promise>"u"?[]:function(){var e=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[e,L(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,L(t),e]}(),kt=rt[0],Me=rt[1],rt=rt[2],Me=Me&&Me.then,ot=kt&&kt.constructor,_n=!!rt,At=function(e,t){Ot.push([e,t]),Qt&&(queueMicrotask(bo),Qt=!1)},kn=!0,Qt=!0,it=[],Ut=[],An=jt,We={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ne,pgp:!1,env:{},finalize:ne},F=We,Ot=[],at=0,Vt=[];function R(e){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=F;if(typeof e!="function"){if(e!==_t)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Pn(this,this._value))}this._state=null,this._value=null,++t.ref,function n(r,o){try{o(function(i){if(r._state===null){if(i===r)throw new TypeError("A promise cannot be resolved with itself.");var a=r._lib&&pt();i&&typeof i.then=="function"?n(r,function(u,l){i instanceof R?i._then(u,l):i.then(u,l)}):(r._state=!0,r._value=i,hr(r)),a&&yt()}},Pn.bind(null,r))}catch(i){Pn(r,i)}}(this,e)}var On={get:function(){var e=F,t=Gt;function n(r,o){var i=this,a=!e.global&&(e!==F||t!==Gt),u=a&&!Ge(),l=new R(function(h,g){Cn(i,new dr(yr(r,e,a,u),yr(o,e,a,u),h,g,e))});return this._consoleTask&&(l._consoleTask=this._consoleTask),l}return n.prototype=_t,n},set:function(e){ae(this,"then",e&&e.prototype===_t?On:{get:function(){return e},set:On.set})}};function dr(e,t,n,r,o){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.resolve=n,this.reject=r,this.psd=o}function Pn(e,t){var n,r;Ut.push(t),e._state===null&&(n=e._lib&&pt(),t=An(t),e._state=!1,e._value=t,r=e,it.some(function(o){return o._value===r._value})||it.push(r),hr(e),n&&yt())}function hr(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)Cn(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),at===0&&(++at,At(function(){--at==0&&En()},[]))}function Cn(e,t){if(e._state!==null){var n=e._state?t.onFulfilled:t.onRejected;if(n===null)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++at,At(go,[n,e,t])}else e._listeners.push(t)}function go(e,t,n){try{var r,o=t._value;!t._state&&Ut.length&&(Ut=[]),r=Fe&&t._consoleTask?t._consoleTask.run(function(){return e(o)}):e(o),t._state||Ut.indexOf(o)!==-1||function(i){for(var a=it.length;a;)if(it[--a]._value===i._value)return it.splice(a,1)}(t),n.resolve(r)}catch(i){n.reject(i)}finally{--at==0&&En(),--n.psd.ref||n.psd.finalize()}}function bo(){st(We,function(){pt()&&yt()})}function pt(){var e=kn;return Qt=kn=!1,e}function yt(){var e,t,n;do for(;0<Ot.length;)for(e=Ot,Ot=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(0<Ot.length);Qt=kn=!0}function En(){var e=it;it=[],e.forEach(function(r){r._PSD.onunhandled.call(null,r._value,r)});for(var t=Vt.slice(0),n=t.length;n;)t[--n]()}function Ht(e){return new R(_t,!1,e)}function ce(e,t){var n=F;return function(){var r=pt(),o=F;try{return Xe(n,!0),e.apply(this,arguments)}catch(i){t&&t(i)}finally{Xe(o,!1),r&&yt()}}}ie(R.prototype,{then:On,_then:function(e,t){Cn(this,new dr(null,null,e,t,F))},catch:function(e){if(arguments.length===1)return this.then(null,e);var t=e,n=arguments[1];return typeof t=="function"?this.then(null,function(r){return(r instanceof t?n:Ht)(r)}):this.then(null,function(r){return(r&&r.name===t?n:Ht)(r)})},finally:function(e){return this.then(function(t){return R.resolve(e()).then(function(){return t})},function(t){return R.resolve(e()).then(function(){return Ht(t)})})},timeout:function(e,t){var n=this;return e<1/0?new R(function(r,o){var i=setTimeout(function(){return o(new U.Timeout(t))},e);n.then(r,o).finally(clearTimeout.bind(null,i))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&ae(R.prototype,Symbol.toStringTag,"Dexie.Promise"),We.env=pr(),ie(R,{all:function(){var e=Be.apply(null,arguments).map(Xt);return new R(function(t,n){e.length===0&&t([]);var r=e.length;e.forEach(function(o,i){return R.resolve(o).then(function(a){e[i]=a,--r||t(e)},n)})})},resolve:function(e){return e instanceof R?e:e&&typeof e.then=="function"?new R(function(t,n){e.then(t,n)}):new R(_t,!0,e)},reject:Ht,race:function(){var e=Be.apply(null,arguments).map(Xt);return new R(function(t,n){e.map(function(r){return R.resolve(r).then(t,n)})})},PSD:{get:function(){return F},set:function(e){return F=e}},totalEchoes:{get:function(){return Gt}},newPSD:Je,usePSD:st,scheduler:{get:function(){return At},set:function(e){At=e}},rejectionMapper:{get:function(){return An},set:function(e){An=e}},follow:function(e,t){return new R(function(n,r){return Je(function(o,i){var a=F;a.unhandleds=[],a.onunhandled=i,a.finalize=nt(function(){var u,l=this;u=function(){l.unhandleds.length===0?o():i(l.unhandleds[0])},Vt.push(function h(){u(),Vt.splice(Vt.indexOf(h),1)}),++at,At(function(){--at==0&&En()},[])},a.finalize),e()},t,n,r)})}}),ot&&(ot.allSettled&&ae(R,"allSettled",function(){var e=Be.apply(null,arguments).map(Xt);return new R(function(t){e.length===0&&t([]);var n=e.length,r=new Array(n);e.forEach(function(o,i){return R.resolve(o).then(function(a){return r[i]={status:"fulfilled",value:a}},function(a){return r[i]={status:"rejected",reason:a}}).then(function(){return--n||t(r)})})})}),ot.any&&typeof AggregateError<"u"&&ae(R,"any",function(){var e=Be.apply(null,arguments).map(Xt);return new R(function(t,n){e.length===0&&n(new AggregateError([]));var r=e.length,o=new Array(r);e.forEach(function(i,a){return R.resolve(i).then(function(u){return t(u)},function(u){o[a]=u,--r||n(new AggregateError(o))})})})}),ot.withResolvers&&(R.withResolvers=ot.withResolvers));var me={awaits:0,echoes:0,id:0},xo=0,Wt=[],Jt=0,Gt=0,wo=0;function Je(e,t,n,r){var o=F,i=Object.create(o);return i.parent=o,i.ref=0,i.global=!1,i.id=++wo,We.env,i.env=_n?{Promise:R,PromiseProp:{value:R,configurable:!0,writable:!0},all:R.all,race:R.race,allSettled:R.allSettled,any:R.any,resolve:R.resolve,reject:R.reject}:{},t&&T(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()},r=st(i,e,n,r),i.ref===0&&i.finalize(),r}function mt(){return me.id||(me.id=++xo),++me.awaits,me.echoes+=fr,me.id}function Ge(){return!!me.awaits&&(--me.awaits==0&&(me.id=0),me.echoes=me.awaits*fr,!0)}function Xt(e){return me.echoes&&e&&e.constructor===ot?(mt(),e.then(function(t){return Ge(),t},function(t){return Ge(),de(t)})):e}function jo(){var e=Wt[Wt.length-1];Wt.pop(),Xe(e,!1)}function Xe(e,t){var n,r=F;(t?!me.echoes||Jt++&&e===F:!Jt||--Jt&&e===F)||queueMicrotask(t?function(o){++Gt,me.echoes&&--me.echoes!=0||(me.echoes=me.awaits=me.id=0),Wt.push(F),Xe(o,!0)}.bind(null,e):jo),e!==F&&(F=e,r===We&&(We.env=pr()),_n&&(n=We.env.Promise,t=e.env,(r.global||e.global)&&(Object.defineProperty(A,"Promise",t.PromiseProp),n.all=t.all,n.race=t.race,n.resolve=t.resolve,n.reject=t.reject,t.allSettled&&(n.allSettled=t.allSettled),t.any&&(n.any=t.any))))}function pr(){var e=A.Promise;return _n?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(A,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function st(e,t,n,r,o){var i=F;try{return Xe(e,!0),t(n,r,o)}finally{Xe(i,!1)}}function yr(e,t,n,r){return typeof e!="function"?e:function(){var o=F;n&&mt(),Xe(t,!0);try{return e.apply(this,arguments)}finally{Xe(o,!1),r&&queueMicrotask(Ge)}}}function Nn(e){Promise===ot&&me.echoes===0?Jt===0?e():enqueueNativeMicroTask(e):setTimeout(e,0)}(""+Me).indexOf("[native code]")===-1&&(mt=Ge=ne);var de=R.reject,ut="",Ve="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",mr="String expected.",vt=[],Yt="__dbnames",Sn="readonly",Kn="readwrite";function ct(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var vr={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Zt(e){return typeof e!="string"||/\./.test(e)?function(t){return t}:function(t){return t[e]===void 0&&e in t&&delete(t=Ke(t))[e],t}}function gr(){throw U.Type()}function Z(e,t){try{var n=br(e),r=br(t);if(n!==r)return n==="Array"?1:r==="Array"?-1:n==="binary"?1:r==="binary"?-1:n==="string"?1:r==="string"?-1:n==="Date"?1:r!=="Date"?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(o,i){for(var a=o.length,u=i.length,l=a<u?a:u,h=0;h<l;++h)if(o[h]!==i[h])return o[h]<i[h]?-1:1;return a===u?0:a<u?-1:1}(xr(e),xr(t));case"Array":return function(o,i){for(var a=o.length,u=i.length,l=a<u?a:u,h=0;h<l;++h){var g=Z(o[h],i[h]);if(g!==0)return g}return a===u?0:a<u?-1:1}(e,t)}}catch{}return NaN}function br(e){var t=typeof e;return t!="object"?t:ArrayBuffer.isView(e)?"binary":(e=J(e),e==="ArrayBuffer"?"binary":e)}function xr(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var wr=(se.prototype._trans=function(e,t,n){var r=this._tx||F.trans,o=this.name,i=Fe&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(e==="readonly"?"read":"write"," ").concat(this.name));function a(h,g,c){if(!c.schema[o])throw new U.NotFound("Table "+o+" not part of transaction");return t(c.idbtrans,c)}var u=pt();try{var l=r&&r.db._novip===this.db._novip?r===F.trans?r._promise(e,a,n):Je(function(){return r._promise(e,a,n)},{trans:r,transless:F.transless||F}):function h(g,c,w,f){if(g.idbdb&&(g._state.openComplete||F.letThrough||g._vip)){var v=g._createTransaction(c,w,g._dbSchema);try{v.create(),g._state.PR1398_maxLoop=3}catch(x){return x.name===wn.InvalidState&&g.isOpen()&&0<--g._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),g.close({disableAutoOpen:!1}),g.open().then(function(){return h(g,c,w,f)})):de(x)}return v._promise(c,function(x,m){return Je(function(){return F.trans=v,f(x,m,v)})}).then(function(x){if(c==="readwrite")try{v.idbtrans.commit()}catch{}return c==="readonly"?x:v._completion.then(function(){return x})})}if(g._state.openComplete)return de(new U.DatabaseClosed(g._state.dbOpenError));if(!g._state.isBeingOpened){if(!g._state.autoOpen)return de(new U.DatabaseClosed);g.open().catch(ne)}return g._state.dbReadyPromise.then(function(){return h(g,c,w,f)})}(this.db,e,[this.name],a);return i&&(l._consoleTask=i,l=l.catch(function(h){return console.trace(h),de(h)})),l}finally{u&&yt()}},se.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):e==null?de(new U.Type("Invalid argument to Table.get()")):this._trans("readonly",function(r){return n.core.get({trans:r,key:e}).then(function(o){return n.hook.reading.fire(o)})}).then(t)},se.prototype.where=function(e){if(typeof e=="string")return new this.db.WhereClause(this,e);if(E(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=C(e);if(t.length===1)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(u){if(u.compound&&t.every(function(h){return 0<=u.keyPath.indexOf(h)})){for(var l=0;l<t.length;++l)if(t.indexOf(u.keyPath[l])===-1)return!1;return!0}return!1}).sort(function(u,l){return u.keyPath.length-l.keyPath.length})[0];if(n&&this.db._maxKey!==ut){var i=n.keyPath.slice(0,t.length);return this.where(i).equals(i.map(function(l){return e[l]}))}!n&&Fe&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var r=this.schema.idxByName;function o(u,l){return Z(u,l)===0}var a=t.reduce(function(c,l){var h=c[0],g=c[1],c=r[l],w=e[l];return[h||c,h||!c?ct(g,c&&c.multi?function(f){return f=te(f,l),E(f)&&f.some(function(v){return o(w,v)})}:function(f){return o(w,te(f,l))}):g]},[null,null]),i=a[0],a=a[1];return i?this.where(i.name).equals(e[i.keyPath]).filter(a):n?this.filter(a):this.where(t).equals("")},se.prototype.filter=function(e){return this.toCollection().and(e)},se.prototype.count=function(e){return this.toCollection().count(e)},se.prototype.offset=function(e){return this.toCollection().offset(e)},se.prototype.limit=function(e){return this.toCollection().limit(e)},se.prototype.each=function(e){return this.toCollection().each(e)},se.prototype.toArray=function(e){return this.toCollection().toArray(e)},se.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},se.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,E(e)?"[".concat(e.join("+"),"]"):e))},se.prototype.reverse=function(){return this.toCollection().reverse()},se.prototype.mapToClass=function(e){var t,n=this.db,r=this.name;function o(){return t!==null&&t.apply(this,arguments)||this}(this.schema.mappedClass=e).prototype instanceof gr&&(function(l,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");function g(){this.constructor=l}d(l,h),l.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}(o,t=e),Object.defineProperty(o.prototype,"db",{get:function(){return n},enumerable:!1,configurable:!0}),o.prototype.table=function(){return r},e=o);for(var i=new Set,a=e.prototype;a;a=L(a))Object.getOwnPropertyNames(a).forEach(function(l){return i.add(l)});function u(l){if(!l)return l;var h,g=Object.create(e.prototype);for(h in l)if(!i.has(h))try{g[h]=l[h]}catch{}return g}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=u,this.hook("reading",u),e},se.prototype.defineClass=function(){return this.mapToClass(function(e){T(this,e)})},se.prototype.add=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=Zt(i)(e)),this._trans("readwrite",function(u){return n.core.mutate({trans:u,type:"add",keys:t!=null?[t]:null,values:[a]})}).then(function(u){return u.numFailures?R.reject(u.failures[0]):u.lastResult}).then(function(u){if(i)try{V(e,i,u)}catch{}return u})},se.prototype.update=function(e,t){return typeof e!="object"||E(e)?this.where(":id").equals(e).modify(t):(e=te(e,this.schema.primKey.keyPath),e===void 0?de(new U.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t))},se.prototype.put=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=Zt(i)(e)),this._trans("readwrite",function(u){return n.core.mutate({trans:u,type:"put",values:[a],keys:t!=null?[t]:null})}).then(function(u){return u.numFailures?R.reject(u.failures[0]):u.lastResult}).then(function(u){if(i)try{V(e,i,u)}catch{}return u})},se.prototype.delete=function(e){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})}).then(function(n){return n.numFailures?R.reject(n.failures[0]):void 0})},se.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:vr})}).then(function(t){return t.numFailures?R.reject(t.failures[0]):void 0})},se.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n}).then(function(r){return r.map(function(o){return t.hook.reading.fire(o)})})})},se.prototype.bulkAdd=function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(a){var h=r.schema.primKey,u=h.auto,h=h.keyPath;if(h&&o)throw new U.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new U.InvalidArgument("Arguments objects and keys must have the same length");var l=e.length,h=h&&u?e.map(Zt(h)):e;return r.core.mutate({trans:a,type:"add",keys:o,values:h,wantResults:i}).then(function(v){var c=v.numFailures,w=v.results,f=v.lastResult,v=v.failures;if(c===0)return i?w:f;throw new ht("".concat(r.name,".bulkAdd(): ").concat(c," of ").concat(l," operations failed"),v)})})},se.prototype.bulkPut=function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(a){var h=r.schema.primKey,u=h.auto,h=h.keyPath;if(h&&o)throw new U.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new U.InvalidArgument("Arguments objects and keys must have the same length");var l=e.length,h=h&&u?e.map(Zt(h)):e;return r.core.mutate({trans:a,type:"put",keys:o,values:h,wantResults:i}).then(function(v){var c=v.numFailures,w=v.results,f=v.lastResult,v=v.failures;if(c===0)return i?w:f;throw new ht("".concat(r.name,".bulkPut(): ").concat(c," of ").concat(l," operations failed"),v)})})},se.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map(function(a){return a.key}),o=e.map(function(a){return a.changes}),i=[];return this._trans("readwrite",function(a){return n.getMany({trans:a,keys:r,cache:"clone"}).then(function(u){var l=[],h=[];e.forEach(function(c,w){var f=c.key,v=c.changes,x=u[w];if(x){for(var m=0,j=Object.keys(v);m<j.length;m++){var _=j[m],k=v[_];if(_===t.schema.primKey.keyPath){if(Z(k,f)!==0)throw new U.Constraint("Cannot update primary key in bulkUpdate()")}else V(x,_,k)}i.push(w),l.push(f),h.push(x)}});var g=l.length;return n.mutate({trans:a,type:"put",keys:l,values:h,updates:{keys:r,changeSpecs:o}}).then(function(c){var w=c.numFailures,f=c.failures;if(w===0)return g;for(var v=0,x=Object.keys(f);v<x.length;v++){var m,j=x[v],_=i[Number(j)];_!=null&&(m=f[j],delete f[j],f[_]=m)}throw new ht("".concat(t.name,".bulkUpdate(): ").concat(w," of ").concat(g," operations failed"),f)})})})},se.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",function(r){return t.core.mutate({trans:r,type:"delete",keys:e})}).then(function(a){var o=a.numFailures,i=a.lastResult,a=a.failures;if(o===0)return i;throw new ht("".concat(t.name,".bulkDelete(): ").concat(o," of ").concat(n," operations failed"),a)})},se);function se(){}function Pt(e){function t(a,u){if(u){for(var l=arguments.length,h=new Array(l-1);--l;)h[l-1]=arguments[l];return n[a].subscribe.apply(null,h),e}if(typeof a=="string")return n[a]}var n={};t.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return t;function i(a,u,l){if(typeof a!="object"){var h;u=u||vo;var g={subscribers:[],fire:l=l||ne,subscribe:function(c){g.subscribers.indexOf(c)===-1&&(g.subscribers.push(c),g.fire=u(g.fire,c))},unsubscribe:function(c){g.subscribers=g.subscribers.filter(function(w){return w!==c}),g.fire=g.subscribers.reduce(u,l)}};return n[a]=t[a]=g}C(h=a).forEach(function(c){var w=h[c];if(E(w))i(c,h[c][0],h[c][1]);else{if(w!=="asap")throw new U.InvalidArgument("Invalid event config");var f=i(c,jt,function(){for(var v=arguments.length,x=new Array(v);v--;)x[v]=arguments[v];f.subscribers.forEach(function(m){le(function(){m.apply(null,x)})})})}})}}function Ct(e,t){return ge(t).from({prototype:e}),t}function gt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Mn(e,t){e.filter=ct(e.filter,t)}function qn(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return ct(r(),t())}:t,e.justLimit=n&&!r}function $t(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new U.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function jr(e,t,n){var r=$t(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:e.dir==="prev",unique:!!e.unique,query:{index:r,range:e.range}})}function en(e,t,n,r){var o=e.replayFilter?ct(e.filter,e.replayFilter()):e.filter;if(e.or){var i={},a=function(u,l,h){var g,c;o&&!o(l,h,function(w){return l.stop(w)},function(w){return l.fail(w)})||((c=""+(g=l.primaryKey))=="[object ArrayBuffer]"&&(c=""+new Uint8Array(g)),M(i,c)||(i[c]=!0,t(u,l,h)))};return Promise.all([e.or._iterate(a,n),_r(jr(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return _r(jr(e,r,n),ct(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function _r(e,t,n,r){var o=ce(r?function(i,a,u){return n(r(i),a,u)}:n);return e.then(function(i){if(i)return i.start(function(){var a=function(){return i.continue()};t&&!t(i,function(u){return a=u},function(u){i.stop(u),a=ne},function(u){i.fail(u),a=ne})||o(i.value,i,function(u){return a=u}),a()})})}var Et=(kr.prototype.execute=function(e){var t=this["@@propmod"];if(t.add!==void 0){var n=t.add;if(E(n))return O(O([],E(e)?e:[],!0),n).sort();if(typeof n=="number")return(Number(e)||0)+n;if(typeof n=="bigint")try{return BigInt(e)+n}catch{return BigInt(0)+n}throw new TypeError("Invalid term ".concat(n))}if(t.remove!==void 0){var r=t.remove;if(E(r))return E(e)?e.filter(function(o){return!r.includes(o)}).sort():[];if(typeof r=="number")return Number(e)-r;if(typeof r=="bigint")try{return BigInt(e)-r}catch{return BigInt(0)-r}throw new TypeError("Invalid subtrahend ".concat(r))}return n=(n=t.replacePrefix)===null||n===void 0?void 0:n[0],n&&typeof e=="string"&&e.startsWith(n)?t.replacePrefix[1]+e.substring(n.length):e},kr);function kr(e){this["@@propmod"]=e}var _o=(ee.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,de.bind(null,n.error)):n.table._trans("readonly",e).then(t)},ee.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,de.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},ee.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ct(t.algorithm,e)},ee.prototype._iterate=function(e,t){return en(this._ctx,e,t,this._ctx.table.core)},ee.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&T(n,e),t._ctx=n,t},ee.prototype.raw=function(){return this._ctx.valueMapper=null,this},ee.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return en(t,e,n,t.table.core)})},ee.prototype.count=function(e){var t=this;return this._read(function(n){var r=t._ctx,o=r.table.core;if(gt(r,!0))return o.count({trans:n,query:{index:$t(r,o.schema),range:r.range}}).then(function(a){return Math.min(a,r.limit)});var i=0;return en(r,function(){return++i,!1},n,o).then(function(){return i})}).then(e)},ee.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(l,h){return h?i(l[n[h]],h-1):l[r]}var a=this._ctx.dir==="next"?1:-1;function u(l,h){return Z(i(l,o),i(h,o))*a}return this.toArray(function(l){return l.sort(u)}).then(t)},ee.prototype.toArray=function(e){var t=this;return this._read(function(n){var r=t._ctx;if(r.dir==="next"&>(r,!0)&&0<r.limit){var o=r.valueMapper,i=$t(r,r.table.core.schema);return r.table.core.query({trans:n,limit:r.limit,values:!0,query:{index:i,range:r.range}}).then(function(u){return u=u.result,o?u.map(o):u})}var a=[];return en(r,function(u){return a.push(u)},n,r.table.core).then(function(){return a})},e)},ee.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,gt(t)?qn(t,function(){var n=e;return function(r,o){return n===0||(n===1?--n:o(function(){r.advance(n),n=0}),!1)}}):qn(t,function(){var n=e;return function(){return--n<0}})),this},ee.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),qn(this._ctx,function(){var t=e;return function(n,r,o){return--t<=0&&r(o),0<=t}},!0),this},ee.prototype.until=function(e,t){return Mn(this._ctx,function(n,r,o){return!e(n.value)||(r(o),t)}),this},ee.prototype.first=function(e){return this.limit(1).toArray(function(t){return t[0]}).then(e)},ee.prototype.last=function(e){return this.reverse().first(e)},ee.prototype.filter=function(e){var t;return Mn(this._ctx,function(n){return e(n.value)}),(t=this._ctx).isMatch=ct(t.isMatch,e),this},ee.prototype.and=function(e){return this.filter(e)},ee.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},ee.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},ee.prototype.desc=function(){return this.reverse()},ee.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(n,r){e(r.key,r)})},ee.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},ee.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(n,r){e(r.primaryKey,r)})},ee.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(r,o){n.push(o.key)}).then(function(){return n}).then(e)},ee.prototype.primaryKeys=function(e){var t=this._ctx;if(t.dir==="next"&>(t,!0)&&0<t.limit)return this._read(function(r){var o=$t(t,t.table.core.schema);return t.table.core.query({trans:r,values:!1,limit:t.limit,query:{index:o,range:t.range}})}).then(function(r){return r.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(r,o){n.push(o.primaryKey)}).then(function(){return n}).then(e)},ee.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},ee.prototype.firstKey=function(e){return this.limit(1).keys(function(t){return t[0]}).then(e)},ee.prototype.lastKey=function(e){return this.reverse().firstKey(e)},ee.prototype.distinct=function(){var e=this._ctx,e=e.index&&e.table.schema.idxByName[e.index];if(!e||!e.multi)return this;var t={};return Mn(this._ctx,function(o){var r=o.primaryKey.toString(),o=M(t,r);return t[r]=!0,!o}),this},ee.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){var o,i,a;a=typeof e=="function"?e:(o=C(e),i=o.length,function(m){for(var j=!1,_=0;_<i;++_){var k=o[_],P=e[k],N=te(m,k);P instanceof Et?(V(m,k,P.execute(N)),j=!0):N!==P&&(V(m,k,P),j=!0)}return j});var u=n.table.core,c=u.schema.primaryKey,l=c.outbound,h=c.extractKey,g=200,c=t.db._options.modifyChunkSize;c&&(g=typeof c=="object"?c[u.name]||c["*"]||200:c);function w(m,k){var _=k.failures,k=k.numFailures;v+=m-k;for(var P=0,N=C(_);P<N.length;P++){var B=N[P];f.push(_[B])}}var f=[],v=0,x=[];return t.clone().primaryKeys().then(function(m){function j(k){var P=Math.min(g,m.length-k);return u.getMany({trans:r,keys:m.slice(k,k+P),cache:"immutable"}).then(function(N){for(var B=[],S=[],K=l?[]:null,D=[],q=0;q<P;++q){var I=N[q],W={value:Ke(I),primKey:m[k+q]};a.call(W,W.value,W)!==!1&&(W.value==null?D.push(m[k+q]):l||Z(h(I),h(W.value))===0?(S.push(W.value),l&&K.push(m[k+q])):(D.push(m[k+q]),B.push(W.value)))}return Promise.resolve(0<B.length&&u.mutate({trans:r,type:"add",values:B}).then(function(G){for(var X in G.failures)D.splice(parseInt(X),1);w(B.length,G)})).then(function(){return(0<S.length||_&&typeof e=="object")&&u.mutate({trans:r,type:"put",keys:K,values:S,criteria:_,changeSpec:typeof e!="function"&&e,isAdditionalChunk:0<k}).then(function(G){return w(S.length,G)})}).then(function(){return(0<D.length||_&&e===Bn)&&u.mutate({trans:r,type:"delete",keys:D,criteria:_,isAdditionalChunk:0<k}).then(function(G){return w(D.length,G)})}).then(function(){return m.length>k+P&&j(k+g)})})}var _=gt(n)&&n.limit===1/0&&(typeof e!="function"||e===Bn)&&{index:n.index,range:n.range};return j(0).then(function(){if(0<f.length)throw new De("Error modifying one or more objects",f,v,x);return m.length})})})},ee.prototype.delete=function(){var e=this._ctx,t=e.range;return gt(e)&&(e.isPrimKey||t.type===3)?this._write(function(n){var r=e.table.core.schema.primaryKey,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then(function(i){return e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then(function(a){var u=a.failures;if(a.lastResult,a.results,a=a.numFailures,a)throw new De("Could not delete some values",Object.keys(u).map(function(l){return u[l]}),i-a);return i-a})})}):this.modify(Bn)},ee);function ee(){}var Bn=function(e,t){return t.value=null};function ko(e,t){return e<t?-1:e===t?0:1}function Ao(e,t){return t<e?-1:e===t?0:1}function Ee(e,t,n){return e=e instanceof Or?new e.Collection(e):e,e._ctx.error=new(n||TypeError)(t),e}function bt(e){return new e.Collection(e,function(){return Ar("")}).limit(0)}function tn(e,t,n,r){var o,i,a,u,l,h,g,c=n.length;if(!n.every(function(v){return typeof v=="string"}))return Ee(e,mr);function w(v){o=v==="next"?function(m){return m.toUpperCase()}:function(m){return m.toLowerCase()},i=v==="next"?function(m){return m.toLowerCase()}:function(m){return m.toUpperCase()},a=v==="next"?ko:Ao;var x=n.map(function(m){return{lower:i(m),upper:o(m)}}).sort(function(m,j){return a(m.lower,j.lower)});u=x.map(function(m){return m.upper}),l=x.map(function(m){return m.lower}),g=(h=v)==="next"?"":r}w("next"),e=new e.Collection(e,function(){return Ye(u[0],l[c-1]+r)}),e._ondirectionchange=function(v){w(v)};var f=0;return e._addAlgorithm(function(v,x,m){var j=v.key;if(typeof j!="string")return!1;var _=i(j);if(t(_,l,f))return!0;for(var k=null,P=f;P<c;++P){var N=function(B,S,K,D,q,I){for(var W=Math.min(B.length,D.length),G=-1,X=0;X<W;++X){var Ne=S[X];if(Ne!==D[X])return q(B[X],K[X])<0?B.substr(0,X)+K[X]+K.substr(X+1):q(B[X],D[X])<0?B.substr(0,X)+D[X]+K.substr(X+1):0<=G?B.substr(0,G)+S[G]+K.substr(G+1):null;q(B[X],Ne)<0&&(G=X)}return W<D.length&&I==="next"?B+K.substr(B.length):W<B.length&&I==="prev"?B.substr(0,K.length):G<0?null:B.substr(0,G)+D[G]+K.substr(G+1)}(j,_,u[P],l[P],a,h);N===null&&k===null?f=P+1:(k===null||0<a(k,N))&&(k=N)}return x(k!==null?function(){v.continue(k+g)}:m),!1}),e}function Ye(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Ar(e){return{type:1,lower:e,upper:e}}var Or=(Object.defineProperty(ve.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),ve.prototype.between=function(e,t,n,r){n=n!==!1,r=r===!0;try{return 0<this._cmp(e,t)||this._cmp(e,t)===0&&(n||r)&&(!n||!r)?bt(this):new this.Collection(this,function(){return Ye(e,t,!n,!r)})}catch{return Ee(this,Ve)}},ve.prototype.equals=function(e){return e==null?Ee(this,Ve):new this.Collection(this,function(){return Ar(e)})},ve.prototype.above=function(e){return e==null?Ee(this,Ve):new this.Collection(this,function(){return Ye(e,void 0,!0)})},ve.prototype.aboveOrEqual=function(e){return e==null?Ee(this,Ve):new this.Collection(this,function(){return Ye(e,void 0,!1)})},ve.prototype.below=function(e){return e==null?Ee(this,Ve):new this.Collection(this,function(){return Ye(void 0,e,!1,!0)})},ve.prototype.belowOrEqual=function(e){return e==null?Ee(this,Ve):new this.Collection(this,function(){return Ye(void 0,e)})},ve.prototype.startsWith=function(e){return typeof e!="string"?Ee(this,mr):this.between(e,e+ut,!0,!0)},ve.prototype.startsWithIgnoreCase=function(e){return e===""?this.startsWith(e):tn(this,function(t,n){return t.indexOf(n[0])===0},[e],ut)},ve.prototype.equalsIgnoreCase=function(e){return tn(this,function(t,n){return t===n[0]},[e],"")},ve.prototype.anyOfIgnoreCase=function(){var e=Be.apply(Pe,arguments);return e.length===0?bt(this):tn(this,function(t,n){return n.indexOf(t)!==-1},e,"")},ve.prototype.startsWithAnyOfIgnoreCase=function(){var e=Be.apply(Pe,arguments);return e.length===0?bt(this):tn(this,function(t,n){return n.some(function(r){return t.indexOf(r)===0})},e,ut)},ve.prototype.anyOf=function(){var e=this,t=Be.apply(Pe,arguments),n=this._cmp;try{t.sort(n)}catch{return Ee(this,Ve)}if(t.length===0)return bt(this);var r=new this.Collection(this,function(){return Ye(t[0],t[t.length-1])});r._ondirectionchange=function(i){n=i==="next"?e._ascending:e._descending,t.sort(n)};var o=0;return r._addAlgorithm(function(i,a,u){for(var l=i.key;0<n(l,t[o]);)if(++o===t.length)return a(u),!1;return n(l,t[o])===0||(a(function(){i.continue(t[o])}),!1)}),r},ve.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},ve.prototype.noneOf=function(){var e=Be.apply(Pe,arguments);if(e.length===0)return new this.Collection(this);try{e.sort(this._ascending)}catch{return Ee(this,Ve)}var t=e.reduce(function(n,r){return n?n.concat([[n[n.length-1][1],r]]):[[-1/0,r]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},ve.prototype.inAnyRange=function(j,t){var n=this,r=this._cmp,o=this._ascending,i=this._descending,a=this._min,u=this._max;if(j.length===0)return bt(this);if(!j.every(function(_){return _[0]!==void 0&&_[1]!==void 0&&o(_[0],_[1])<=0}))return Ee(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",U.InvalidArgument);var l=!t||t.includeLowers!==!1,h=t&&t.includeUppers===!0,g,c=o;function w(_,k){return c(_[0],k[0])}try{(g=j.reduce(function(_,k){for(var P=0,N=_.length;P<N;++P){var B=_[P];if(r(k[0],B[1])<0&&0<r(k[1],B[0])){B[0]=a(B[0],k[0]),B[1]=u(B[1],k[1]);break}}return P===N&&_.push(k),_},[])).sort(w)}catch{return Ee(this,Ve)}var f=0,v=h?function(_){return 0<o(_,g[f][1])}:function(_){return 0<=o(_,g[f][1])},x=l?function(_){return 0<i(_,g[f][0])}:function(_){return 0<=i(_,g[f][0])},m=v,j=new this.Collection(this,function(){return Ye(g[0][0],g[g.length-1][1],!l,!h)});return j._ondirectionchange=function(_){c=_==="next"?(m=v,o):(m=x,i),g.sort(w)},j._addAlgorithm(function(_,k,P){for(var N,B=_.key;m(B);)if(++f===g.length)return k(P),!1;return!v(N=B)&&!x(N)||(n._cmp(B,g[f][1])===0||n._cmp(B,g[f][0])===0||k(function(){c===o?_.continue(g[f][0]):_.continue(g[f][1])}),!1)}),j},ve.prototype.startsWithAnyOf=function(){var e=Be.apply(Pe,arguments);return e.every(function(t){return typeof t=="string"})?e.length===0?bt(this):this.inAnyRange(e.map(function(t){return[t,t+ut]})):Ee(this,"startsWithAnyOf() only works with strings")},ve);function ve(){}function Le(e){return ce(function(t){return Nt(t),e(t.target.error),!1})}function Nt(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var St="storagemutated",Dn="x-storagemutated-1",Ze=Pt(null,St),Oo=(ze.prototype._lock=function(){return Ae(!F.global),++this._reculock,this._reculock!==1||F.global||(F.lockOwnerFor=this),this},ze.prototype._unlock=function(){if(Ae(!F.global),--this._reculock==0)for(F.global||(F.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{st(e[1],e[0])}catch{}}return this},ze.prototype._locked=function(){return this._reculock&&F.lockOwnerFor!==this},ze.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(Ae(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new U.DatabaseClosed(r);case"MissingAPIError":throw new U.MissingAPI(r.message,r);default:throw new U.OpenFailed(r)}if(!this.active)throw new U.TransactionInactive;return Ae(this._completion._state===null),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=ce(function(o){Nt(o),t._reject(e.error)}),e.onabort=ce(function(o){Nt(o),t.active&&t._reject(new U.Abort(e.error)),t.active=!1,t.on("abort").fire(o)}),e.oncomplete=ce(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&Ze.storagemutated.fire(e.mutatedParts)}),this},ze.prototype._promise=function(e,t,n){var r=this;if(e==="readwrite"&&this.mode!=="readwrite")return de(new U.ReadOnly("Transaction is readonly"));if(!this.active)return de(new U.TransactionInactive);if(this._locked())return new R(function(i,a){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,a)},F])});if(n)return Je(function(){var i=new R(function(a,u){r._lock();var l=t(a,u,r);l&&l.then&&l.then(a,u)});return i.finally(function(){return r._unlock()}),i._lib=!0,i});var o=new R(function(i,a){var u=t(i,a,r);u&&u.then&&u.then(i,a)});return o._lib=!0,o},ze.prototype._root=function(){return this.parent?this.parent._root():this},ze.prototype.waitFor=function(e){var t,n=this._root(),r=R.resolve(e);n._waitingFor?n._waitingFor=n._waitingFor.then(function(){return r}):(n._waitingFor=r,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function i(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=i)}());var o=n._waitingFor;return new R(function(i,a){r.then(function(u){return n._waitingQueue.push(ce(i.bind(null,u)))},function(u){return n._waitingQueue.push(ce(a.bind(null,u)))}).finally(function(){n._waitingFor===o&&(n._waitingFor=null)})})},ze.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new U.Abort))},ze.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(M(t,e))return t[e];var n=this.schema[e];if(!n)throw new U.NotFound("Table "+e+" not part of transaction");return n=new this.db.Table(e,n,this),n.core=this.db.core.table(e),t[e]=n},ze);function ze(){}function Rn(e,t,n,r,o,i,a){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+Pr(t)}}function Pr(e){return typeof e=="string"?e:e?"["+[].join.call(e,"+")+"]":""}function In(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(o){return[o.name,o]},n.reduce(function(o,i,a){return a=r(i,a),a&&(o[a[0]]=a[1]),o},{}))};var r}var Kt=function(e){try{return e.only([[]]),Kt=function(){return[[]]},[[]]}catch{return Kt=function(){return ut},ut}};function Tn(e){return e==null?function(){}:typeof e=="string"?(t=e).split(".").length===1?function(n){return n[t]}:function(n){return te(n,t)}:function(n){return te(n,e)};var t}function Cr(e){return[].slice.call(e)}var Po=0;function Mt(e){return e==null?":id":typeof e=="string"?e:"[".concat(e.join("+"),"]")}function Co(e,t,l){function r(m){if(m.type===3)return null;if(m.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var f=m.lower,v=m.upper,x=m.lowerOpen,m=m.upperOpen;return f===void 0?v===void 0?null:t.upperBound(v,!!m):v===void 0?t.lowerBound(f,!!x):t.bound(f,v,!!x,!!m)}function o(w){var f,v=w.name;return{name:v,schema:w,mutate:function(x){var m=x.trans,j=x.type,_=x.keys,k=x.values,P=x.range;return new Promise(function(N,B){N=ce(N);var S=m.objectStore(v),K=S.keyPath==null,D=j==="put"||j==="add";if(!D&&j!=="delete"&&j!=="deleteRange")throw new Error("Invalid operation type: "+j);var q,I=(_||k||{length:1}).length;if(_&&k&&_.length!==k.length)throw new Error("Given keys array must have same length as given values array.");if(I===0)return N({numFailures:0,failures:{},results:[],lastResult:void 0});function W(ke){++Ne,Nt(ke)}var G=[],X=[],Ne=0;if(j==="deleteRange"){if(P.type===4)return N({numFailures:Ne,failures:X,results:[],lastResult:void 0});P.type===3?G.push(q=S.clear()):G.push(q=S.delete(r(P)))}else{var K=D?K?[k,_]:[k,null]:[_,null],H=K[0],we=K[1];if(D)for(var je=0;je<I;++je)G.push(q=we&&we[je]!==void 0?S[j](H[je],we[je]):S[j](H[je])),q.onerror=W;else for(je=0;je<I;++je)G.push(q=S[j](H[je])),q.onerror=W}function yn(ke){ke=ke.target.result,G.forEach(function(dt,rr){return dt.error!=null&&(X[rr]=dt.error)}),N({numFailures:Ne,failures:X,results:j==="delete"?_:G.map(function(dt){return dt.result}),lastResult:ke})}q.onerror=function(ke){W(ke),yn(ke)},q.onsuccess=yn})},getMany:function(x){var m=x.trans,j=x.keys;return new Promise(function(_,k){_=ce(_);for(var P,N=m.objectStore(v),B=j.length,S=new Array(B),K=0,D=0,q=function(G){G=G.target,S[G._pos]=G.result,++D===K&&_(S)},I=Le(k),W=0;W<B;++W)j[W]!=null&&((P=N.get(j[W]))._pos=W,P.onsuccess=q,P.onerror=I,++K);K===0&&_(S)})},get:function(x){var m=x.trans,j=x.key;return new Promise(function(_,k){_=ce(_);var P=m.objectStore(v).get(j);P.onsuccess=function(N){return _(N.target.result)},P.onerror=Le(k)})},query:(f=h,function(x){return new Promise(function(m,j){m=ce(m);var _,k,P,K=x.trans,N=x.values,B=x.limit,q=x.query,S=B===1/0?void 0:B,D=q.index,q=q.range,K=K.objectStore(v),D=D.isPrimaryKey?K:K.index(D.name),q=r(q);if(B===0)return m({result:[]});f?((S=N?D.getAll(q,S):D.getAllKeys(q,S)).onsuccess=function(I){return m({result:I.target.result})},S.onerror=Le(j)):(_=0,k=!N&&"openKeyCursor"in D?D.openKeyCursor(q):D.openCursor(q),P=[],k.onsuccess=function(I){var W=k.result;return W?(P.push(N?W.value:W.primaryKey),++_===B?m({result:P}):void W.continue()):m({result:P})},k.onerror=Le(j))})}),openCursor:function(x){var m=x.trans,j=x.values,_=x.query,k=x.reverse,P=x.unique;return new Promise(function(N,B){N=ce(N);var D=_.index,S=_.range,K=m.objectStore(v),K=D.isPrimaryKey?K:K.index(D.name),D=k?P?"prevunique":"prev":P?"nextunique":"next",q=!j&&"openKeyCursor"in K?K.openKeyCursor(r(S),D):K.openCursor(r(S),D);q.onerror=Le(B),q.onsuccess=ce(function(I){var W,G,X,Ne,H=q.result;H?(H.___id=++Po,H.done=!1,W=H.continue.bind(H),G=(G=H.continuePrimaryKey)&&G.bind(H),X=H.advance.bind(H),Ne=function(){throw new Error("Cursor not stopped")},H.trans=m,H.stop=H.continue=H.continuePrimaryKey=H.advance=function(){throw new Error("Cursor not started")},H.fail=ce(B),H.next=function(){var we=this,je=1;return this.start(function(){return je--?we.continue():we.stop()}).then(function(){return we})},H.start=function(we){function je(){if(q.result)try{we()}catch(ke){H.fail(ke)}else H.done=!0,H.start=function(){throw new Error("Cursor behind last entry")},H.stop()}var yn=new Promise(function(ke,dt){ke=ce(ke),q.onerror=Le(dt),H.fail=dt,H.stop=function(rr){H.stop=H.continue=H.continuePrimaryKey=H.advance=Ne,ke(rr)}});return q.onsuccess=ce(function(ke){q.onsuccess=je,je()}),H.continue=W,H.continuePrimaryKey=G,H.advance=X,je(),yn},N(H)):N(null)},B)})},count:function(x){var m=x.query,j=x.trans,_=m.index,k=m.range;return new Promise(function(P,N){var B=j.objectStore(v),S=_.isPrimaryKey?B:B.index(_.name),B=r(k),S=B?S.count(B):S.count();S.onsuccess=ce(function(K){return P(K.target.result)}),S.onerror=Le(N)})}}}var i,a,u,g=(a=l,u=Cr((i=e).objectStoreNames),{schema:{name:i.name,tables:u.map(function(w){return a.objectStore(w)}).map(function(w){var f=w.keyPath,m=w.autoIncrement,v=E(f),x={},m={name:w.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:f==null,compound:v,keyPath:f,autoIncrement:m,unique:!0,extractKey:Tn(f)},indexes:Cr(w.indexNames).map(function(j){return w.index(j)}).map(function(P){var _=P.name,k=P.unique,N=P.multiEntry,P=P.keyPath,N={name:_,compound:E(P),keyPath:P,unique:k,multiEntry:N,extractKey:Tn(P)};return x[Mt(P)]=N}),getIndexByKeyPath:function(j){return x[Mt(j)]}};return x[":id"]=m.primaryKey,f!=null&&(x[Mt(f)]=m.primaryKey),m})},hasGetAll:0<u.length&&"getAll"in a.objectStore(u[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),l=g.schema,h=g.hasGetAll,g=l.tables.map(o),c={};return g.forEach(function(w){return c[w.name]=w}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(w){if(!c[w])throw new Error("Table '".concat(w,"' not found"));return c[w]},MIN_KEY:-1/0,MAX_KEY:Kt(t),schema:l}}function Eo(e,t,n,r){var o=n.IDBKeyRange;return n.indexedDB,{dbcore:(r=Co(t,o,r),e.dbcore.reduce(function(i,a){return a=a.create,b(b({},i),a(i))},r))}}function nn(e,r){var n=r.db,r=Eo(e._middlewares,n,e._deps,r);e.core=r.dbcore,e.tables.forEach(function(o){var i=o.name;e.core.schema.tables.some(function(a){return a.name===i})&&(o.core=e.core.table(i),e[i]instanceof e.Table&&(e[i].core=o.core))})}function rn(e,t,n,r){n.forEach(function(o){var i=r[o];t.forEach(function(a){var u=function l(h,g){return Ce(h,g)||(h=L(h))&&l(h,g)}(a,o);(!u||"value"in u&&u.value===void 0)&&(a===e.Transaction.prototype||a instanceof e.Transaction?ae(a,o,{get:function(){return this.table(o)},set:function(l){pe(this,o,{value:l,writable:!0,configurable:!0,enumerable:!0})}}):a[o]=new e.Table(o,i))})})}function Fn(e,t){t.forEach(function(n){for(var r in n)n[r]instanceof e.Table&&delete n[r]})}function No(e,t){return e._cfg.version-t._cfg.version}function So(e,t,n,r){var o=e._dbSchema;n.objectStoreNames.contains("$meta")&&!o.$meta&&(o.$meta=In("$meta",Nr("")[0],[]),e._storeNames.push("$meta"));var i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);var a=i._reject.bind(i),u=F.transless||F;Je(function(){return F.trans=i,F.transless=u,t!==0?(nn(e,n),h=t,((l=i).storeNames.includes("$meta")?l.table("$meta").get("version").then(function(g){return g??h}):R.resolve(h)).then(function(g){return w=g,f=i,v=n,x=[],g=(c=e)._versions,m=c._dbSchema=an(0,c.idbdb,v),(g=g.filter(function(j){return j._cfg.version>=w})).length!==0?(g.forEach(function(j){x.push(function(){var _=m,k=j._cfg.dbschema;sn(c,_,v),sn(c,k,v),m=c._dbSchema=k;var P=Ln(_,k);P.add.forEach(function(D){zn(v,D[0],D[1].primKey,D[1].indexes)}),P.change.forEach(function(D){if(D.recreate)throw new U.Upgrade("Not yet support for changing primary key");var q=v.objectStore(D.name);D.add.forEach(function(I){return on(q,I)}),D.change.forEach(function(I){q.deleteIndex(I.name),on(q,I)}),D.del.forEach(function(I){return q.deleteIndex(I)})});var N=j._cfg.contentUpgrade;if(N&&j._cfg.version>w){nn(c,v),f._memoizedTables={};var B=_e(k);P.del.forEach(function(D){B[D]=_[D]}),Fn(c,[c.Transaction.prototype]),rn(c,[c.Transaction.prototype],C(B),B),f.schema=B;var S,K=$(N);return K&&mt(),P=R.follow(function(){var D;(S=N(f))&&K&&(D=Ge.bind(null,null),S.then(D,D))}),S&&typeof S.then=="function"?R.resolve(S):P.then(function(){return S})}}),x.push(function(_){var k,P,N=j._cfg.dbschema;k=N,P=_,[].slice.call(P.db.objectStoreNames).forEach(function(B){return k[B]==null&&P.db.deleteObjectStore(B)}),Fn(c,[c.Transaction.prototype]),rn(c,[c.Transaction.prototype],c._storeNames,c._dbSchema),f.schema=c._dbSchema}),x.push(function(_){c.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(c.idbdb.version/10)===j._cfg.version?(c.idbdb.deleteObjectStore("$meta"),delete c._dbSchema.$meta,c._storeNames=c._storeNames.filter(function(k){return k!=="$meta"})):_.objectStore("$meta").put(j._cfg.version,"version"))})}),function j(){return x.length?R.resolve(x.shift()(f.idbtrans)).then(j):R.resolve()}().then(function(){Er(m,v)})):R.resolve();var c,w,f,v,x,m}).catch(a)):(C(o).forEach(function(g){zn(n,g,o[g].primKey,o[g].indexes)}),nn(e,n),void R.follow(function(){return e.on.populate.fire(i)}).catch(a));var l,h})}function Ko(e,t){Er(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var n=an(0,e.idbdb,t);sn(e,e._dbSchema,t);for(var r=0,o=Ln(n,e._dbSchema).change;r<o.length;r++){var i=function(a){if(a.change.length||a.recreate)return console.warn("Unable to patch indexes of table ".concat(a.name," because it has changes on the type of index or primary key.")),{value:void 0};var u=t.objectStore(a.name);a.add.forEach(function(l){Fe&&console.debug("Dexie upgrade patch: Creating missing index ".concat(a.name,".").concat(l.src)),on(u,l)})}(o[r]);if(typeof i=="object")return i.value}}function Ln(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var o=e[n],i=t[n];if(o){var a={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto)a.recreate=!0,r.change.push(a);else{var u=o.idxByName,l=i.idxByName,h=void 0;for(h in u)l[h]||a.del.push(h);for(h in l){var g=u[h],c=l[h];g?g.src!==c.src&&a.change.push(c):a.add.push(c)}(0<a.del.length||0<a.add.length||0<a.change.length)&&r.change.push(a)}}else r.add.push([n,i])}return r}function zn(e,t,n,r){var o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(i){return on(o,i)}),o}function Er(e,t){C(e).forEach(function(n){t.db.objectStoreNames.contains(n)||(Fe&&console.debug("Dexie: Creating missing table",n),zn(t,n,e[n].primKey,e[n].indexes))})}function on(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function an(e,t,n){var r={};return re(t.objectStoreNames,0).forEach(function(o){for(var i=n.objectStore(o),a=Rn(Pr(h=i.keyPath),h||"",!0,!1,!!i.autoIncrement,h&&typeof h!="string",!0),u=[],l=0;l<i.indexNames.length;++l){var g=i.index(i.indexNames[l]),h=g.keyPath,g=Rn(g.name,h,!!g.unique,!!g.multiEntry,!1,h&&typeof h!="string",!1);u.push(g)}r[o]=In(o,a,u)}),r}function sn(e,t,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var i=r[o],a=n.objectStore(i);e._hasGetAll="getAll"in a;for(var u=0;u<a.indexNames.length;++u){var l=a.indexNames[u],h=a.index(l).keyPath,g=typeof h=="string"?h:"["+re(h).join("+")+"]";!t[i]||(h=t[i].idxByName[g])&&(h.name=l,delete t[i].idxByName[g],t[i].idxByName[l]=h)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&A.WorkerGlobalScope&&A instanceof A.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function Nr(e){return e.split(",").map(function(t,n){var r=(t=t.trim()).replace(/([&*]|\+\+)/g,""),o=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return Rn(r,o||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),E(o),n===0)})}var Mo=(un.prototype._parseStoresSpec=function(e,t){C(e).forEach(function(n){if(e[n]!==null){var r=Nr(e[n]),o=r.shift();if(o.unique=!0,o.multi)throw new U.Schema("Primary key cannot be multi-valued");r.forEach(function(i){if(i.auto)throw new U.Schema("Only primary key can be marked as autoIncrement (++)");if(!i.keyPath)throw new U.Schema("Index must have a name and cannot be an empty string")}),t[n]=In(n,o,r)}})},un.prototype.stores=function(n){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?T(this._cfg.storesSource,n):n;var n=t._versions,r={},o={};return n.forEach(function(i){T(r,i._cfg.storesSource),o=i._cfg.dbschema={},i._parseStoresSpec(r,o)}),t._dbSchema=o,Fn(t,[t._allTables,t,t.Transaction.prototype]),rn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],C(o),o),t._storeNames=C(o),this},un.prototype.upgrade=function(e){return this._cfg.contentUpgrade=jn(this._cfg.contentUpgrade||ne,e),this},un);function un(){}function Qn(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new He(Yt,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function Un(e){return e&&typeof e.databases=="function"}function Vn(e){return Je(function(){return F.letThrough=!0,e()})}function Hn(e){return!("from"in e)}var xe=function(e,t){if(!this){var n=new xe;return e&&"d"in e&&T(n,e),n}T(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function qt(e,t,n){var r=Z(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(Hn(e))return T(e,{from:t,to:n,d:1});var o=e.l,r=e.r;if(Z(n,e.from)<0)return o?qt(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},Kr(e);if(0<Z(t,e.to))return r?qt(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},Kr(e);Z(t,e.from)<0&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<Z(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,o&&!e.l&&Bt(e,o),r&&n&&Bt(e,r)}}function Bt(e,t){Hn(t)||function n(r,l){var i=l.from,a=l.to,u=l.l,l=l.r;qt(r,i,a),u&&n(r,u),l&&n(r,l)}(e,t)}function Sr(e,t){var n=cn(t),r=n.next();if(r.done)return!1;for(var o=r.value,i=cn(e),a=i.next(o.from),u=a.value;!r.done&&!a.done;){if(Z(u.from,o.to)<=0&&0<=Z(u.to,o.from))return!0;Z(o.from,u.from)<0?o=(r=n.next(u.from)).value:u=(a=i.next(o.from)).value}return!1}function cn(e){var t=Hn(e)?null:{s:0,n:e};return{next:function(n){for(var r=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&Z(n,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||Z(n,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function Kr(e){var t,n,r=(((t=e.r)===null||t===void 0?void 0:t.d)||0)-(((n=e.l)===null||n===void 0?void 0:n.d)||0),o=1<r?"r":r<-1?"l":"";o&&(t=o=="r"?"l":"r",n=b({},e),r=e[o],e.from=r.from,e.to=r.to,e[o]=r[o],n[o]=r[t],(e[t]=n).d=Mr(n)),e.d=Mr(e)}function Mr(n){var t=n.r,n=n.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}function ln(e,t){return C(t).forEach(function(n){e[n]?Bt(e[n],t[n]):e[n]=function r(o){var i,a,u={};for(i in o)M(o,i)&&(a=o[i],u[i]=!a||typeof a!="object"||qe.has(a.constructor)?a:r(a));return u}(t[n])}),e}function Wn(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&Sr(t[n],e[n])})}ie(xe.prototype,((Me={add:function(e){return Bt(this,e),this},addKey:function(e){return qt(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(n){return qt(t,n,n)}),this},hasKey:function(e){var t=cn(this).next(e).value;return t&&Z(t.from,e)<=0&&0<=Z(t.to,e)}})[oe]=function(){return cn(this)},Me));var lt={},Jn={},Gn=!1;function fn(e){ln(Jn,e),Gn||(Gn=!0,setTimeout(function(){Gn=!1,Xn(Jn,!(Jn={}))},0))}function Xn(e,t){t===void 0&&(t=!1);var n=new Set;if(e.all)for(var r=0,o=Object.values(lt);r<o.length;r++)qr(a=o[r],e,n,t);else for(var i in e){var a,u=/^idb\:\/\/(.*)\/(.*)\//.exec(i);u&&(i=u[1],u=u[2],(a=lt["idb://".concat(i,"/").concat(u)])&&qr(a,e,n,t))}n.forEach(function(l){return l()})}function qr(e,t,n,r){for(var o=[],i=0,a=Object.entries(e.queries.query);i<a.length;i++){for(var u=a[i],l=u[0],h=[],g=0,c=u[1];g<c.length;g++){var w=c[g];Wn(t,w.obsSet)?w.subscribers.forEach(function(m){return n.add(m)}):r&&h.push(w)}r&&o.push([l,h])}if(r)for(var f=0,v=o;f<v.length;f++){var x=v[f],l=x[0],h=x[1];e.queries.query[l]=h}}function qo(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?de(t.dbOpenError):e});t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,o=Math.round(10*e.verno),i=!1;function a(){if(t.openCanceller!==r)throw new U.DatabaseClosed("db.open() was cancelled")}function u(){return new R(function(w,f){if(a(),!n)throw new U.MissingAPI;var v=e.name,x=t.autoSchema||!o?n.open(v):n.open(v,o);if(!x)throw new U.MissingAPI;x.onerror=Le(f),x.onblocked=ce(e._fireOnBlocked),x.onupgradeneeded=ce(function(m){var j;g=x.transaction,t.autoSchema&&!e._options.allowEmptyDB?(x.onerror=Nt,g.abort(),x.result.close(),(j=n.deleteDatabase(v)).onsuccess=j.onerror=ce(function(){f(new U.NoSuchDatabase("Database ".concat(v," doesnt exist")))})):(g.onerror=Le(f),m=m.oldVersion>Math.pow(2,62)?0:m.oldVersion,c=m<1,e.idbdb=x.result,i&&Ko(e,g),So(e,m/10,g,f))},f),x.onsuccess=ce(function(){g=null;var m,j,_,k,P,N=e.idbdb=x.result,B=re(N.objectStoreNames);if(0<B.length)try{var S=N.transaction((k=B).length===1?k[0]:k,"readonly");if(t.autoSchema)j=N,_=S,(m=e).verno=j.version/10,_=m._dbSchema=an(0,j,_),m._storeNames=re(j.objectStoreNames,0),rn(m,[m._allTables],C(_),_);else if(sn(e,e._dbSchema,S),((P=Ln(an(0,(P=e).idbdb,S),P._dbSchema)).add.length||P.change.some(function(K){return K.add.length||K.change.length}))&&!i)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),N.close(),o=N.version+1,i=!0,w(u());nn(e,S)}catch{}vt.push(e),N.onversionchange=ce(function(K){t.vcFired=!0,e.on("versionchange").fire(K)}),N.onclose=ce(function(K){e.on("close").fire(K)}),c&&(P=e._deps,S=v,N=P.indexedDB,P=P.IDBKeyRange,Un(N)||S===Yt||Qn(N,P).put({name:S}).catch(ne)),w()},f)}).catch(function(w){switch(w?.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),u();break;case"VersionError":if(0<o)return o=0,u()}return R.reject(w)})}var l,h=t.dbReadyResolve,g=null,c=!1;return R.race([r,(typeof navigator>"u"?R.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(w){function f(){return indexedDB.databases().finally(w)}l=setInterval(f,100),f()}).finally(function(){return clearInterval(l)}):Promise.resolve()).then(u)]).then(function(){return a(),t.onReadyBeingFired=[],R.resolve(Vn(function(){return e.on.ready.fire(e.vip)})).then(function w(){if(0<t.onReadyBeingFired.length){var f=t.onReadyBeingFired.reduce(jn,ne);return t.onReadyBeingFired=[],R.resolve(Vn(function(){return f(e.vip)})).then(w)}})}).finally(function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(w){t.dbOpenError=w;try{g&&g.abort()}catch{}return r===t.openCanceller&&e._close(),de(w)}).finally(function(){t.openComplete=!0,h()}).then(function(){var w;return c&&(w={},e.tables.forEach(function(f){f.schema.indexes.forEach(function(v){v.name&&(w["idb://".concat(e.name,"/").concat(f.name,"/").concat(v.name)]=new xe(-1/0,[[[]]]))}),w["idb://".concat(e.name,"/").concat(f.name,"/")]=w["idb://".concat(e.name,"/").concat(f.name,"/:dels")]=new xe(-1/0,[[[]]])}),Ze(St).fire(w),Xn(w,!0)),e})}function Yn(e){function t(i){return e.next(i)}var n=o(t),r=o(function(i){return e.throw(i)});function o(i){return function(l){var u=i(l),l=u.value;return u.done?l:l&&typeof l.then=="function"?l.then(n,r):E(l)?Promise.all(l).then(n,r):n(l)}}return o(t)()}function dn(e,t,n){for(var r=E(e)?e.slice():[e],o=0;o<n;++o)r.push(t);return r}var Bo={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return b(b({},e),{table:function(t){var n=e.table(t),r=n.schema,o={},i=[];function a(c,w,f){var v=Mt(c),x=o[v]=o[v]||[],m=c==null?0:typeof c=="string"?1:c.length,j=0<w,j=b(b({},f),{name:j?"".concat(v,"(virtual-from:").concat(f.name,")"):f.name,lowLevelIndex:f,isVirtual:j,keyTail:w,keyLength:m,extractKey:Tn(c),unique:!j&&f.unique});return x.push(j),j.isPrimaryKey||i.push(j),1<m&&a(m===2?c[0]:c.slice(0,m-1),w+1,f),x.sort(function(_,k){return _.keyTail-k.keyTail}),j}t=a(r.primaryKey.keyPath,0,r.primaryKey),o[":id"]=[t];for(var u=0,l=r.indexes;u<l.length;u++){var h=l[u];a(h.keyPath,0,h)}function g(c){var w,f=c.query.index;return f.isVirtual?b(b({},c),{query:{index:f.lowLevelIndex,range:(w=c.query.range,f=f.keyTail,{type:w.type===1?2:w.type,lower:dn(w.lower,w.lowerOpen?e.MAX_KEY:e.MIN_KEY,f),lowerOpen:!0,upper:dn(w.upper,w.upperOpen?e.MIN_KEY:e.MAX_KEY,f),upperOpen:!0})}}):c}return b(b({},n),{schema:b(b({},r),{primaryKey:t,indexes:i,getIndexByKeyPath:function(c){return(c=o[Mt(c)])&&c[0]}}),count:function(c){return n.count(g(c))},query:function(c){return n.query(g(c))},openCursor:function(c){var w=c.query.index,f=w.keyTail,v=w.isVirtual,x=w.keyLength;return v?n.openCursor(g(c)).then(function(j){return j&&m(j)}):n.openCursor(c);function m(j){return Object.create(j,{continue:{value:function(_){_!=null?j.continue(dn(_,c.reverse?e.MAX_KEY:e.MIN_KEY,f)):c.unique?j.continue(j.key.slice(0,x).concat(c.reverse?e.MIN_KEY:e.MAX_KEY,f)):j.continue()}},continuePrimaryKey:{value:function(_,k){j.continuePrimaryKey(dn(_,e.MAX_KEY,f),k)}},primaryKey:{get:function(){return j.primaryKey}},key:{get:function(){var _=j.key;return x===1?_[0]:_.slice(0,x)}},value:{get:function(){return j.value}}})}}})}})}};function Zn(e,t,n,r){return n=n||{},r=r||"",C(e).forEach(function(o){var i,a,u;M(t,o)?(i=e[o],a=t[o],typeof i=="object"&&typeof a=="object"&&i&&a?(u=J(i))!==J(a)?n[r+o]=t[o]:u==="Object"?Zn(i,a,n,r+o+"."):i!==a&&(n[r+o]=t[o]):i!==a&&(n[r+o]=t[o])):n[r+o]=void 0}),C(t).forEach(function(o){M(e,o)||(n[r+o]=t[o])}),n}function $n(e,t){return t.type==="delete"?t.keys:t.keys||t.values.map(e.extractKey)}var Do={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return b(b({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey;return b(b({},n),{mutate:function(o){var i=F.trans,a=i.table(t).hook,u=a.deleting,l=a.creating,h=a.updating;switch(o.type){case"add":if(l.fire===ne)break;return i._promise("readwrite",function(){return g(o)},!0);case"put":if(l.fire===ne&&h.fire===ne)break;return i._promise("readwrite",function(){return g(o)},!0);case"delete":if(u.fire===ne)break;return i._promise("readwrite",function(){return g(o)},!0);case"deleteRange":if(u.fire===ne)break;return i._promise("readwrite",function(){return function c(w,f,v){return n.query({trans:w,values:!1,query:{index:r,range:f},limit:v}).then(function(x){var m=x.result;return g({type:"delete",keys:m,trans:w}).then(function(j){return 0<j.numFailures?Promise.reject(j.failures[0]):m.length<v?{failures:[],numFailures:0,lastResult:void 0}:c(w,b(b({},f),{lower:m[m.length-1],lowerOpen:!0}),v)})})}(o.trans,o.range,1e4)},!0)}return n.mutate(o);function g(c){var w,f,v,x=F.trans,m=c.keys||$n(r,c);if(!m)throw new Error("Keys missing");return(c=c.type==="add"||c.type==="put"?b(b({},c),{keys:m}):b({},c)).type!=="delete"&&(c.values=O([],c.values)),c.keys&&(c.keys=O([],c.keys)),w=n,v=m,((f=c).type==="add"?Promise.resolve([]):w.getMany({trans:f.trans,keys:v,cache:"immutable"})).then(function(j){var _=m.map(function(k,P){var N,B,S,K=j[P],D={onerror:null,onsuccess:null};return c.type==="delete"?u.fire.call(D,k,K,x):c.type==="add"||K===void 0?(N=l.fire.call(D,k,c.values[P],x),k==null&&N!=null&&(c.keys[P]=k=N,r.outbound||V(c.values[P],r.keyPath,k))):(N=Zn(K,c.values[P]),(B=h.fire.call(D,N,k,K,x))&&(S=c.values[P],Object.keys(B).forEach(function(q){M(S,q)?S[q]=B[q]:V(S,q,B[q])}))),D});return n.mutate(c).then(function(k){for(var P=k.failures,N=k.results,B=k.numFailures,k=k.lastResult,S=0;S<m.length;++S){var K=(N||m)[S],D=_[S];K==null?D.onerror&&D.onerror(P[S]):D.onsuccess&&D.onsuccess(c.type==="put"&&j[S]?c.values[S]:K)}return{failures:P,results:N,numFailures:B,lastResult:k}}).catch(function(k){return _.forEach(function(P){return P.onerror&&P.onerror(k)}),Promise.reject(k)})})}}})}})}};function Br(e,t,n){try{if(!t||t.keys.length<e.length)return null;for(var r=[],o=0,i=0;o<t.keys.length&&i<e.length;++o)Z(t.keys[o],e[i])===0&&(r.push(n?Ke(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch{return null}}var Ro={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var n=e.table(t);return b(b({},n),{getMany:function(r){if(!r.cache)return n.getMany(r);var o=Br(r.keys,r.trans._cache,r.cache==="clone");return o?R.resolve(o):n.getMany(r).then(function(i){return r.trans._cache={keys:r.keys,values:r.cache==="clone"?Ke(i):i},i})},mutate:function(r){return r.type!=="add"&&(r.trans._cache=null),n.mutate(r)}})}}}};function Dr(e,t){return e.trans.mode==="readonly"&&!!e.subscr&&!e.trans.explicit&&e.trans.db._options.cache!=="disabled"&&!t.schema.primaryKey.outbound}function Rr(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Io={stack:"dbcore",level:0,name:"Observability",create:function(e){var t=e.schema.name,n=new xe(e.MIN_KEY,e.MAX_KEY);return b(b({},e),{transaction:function(r,o,i){if(F.subscr&&o!=="readonly")throw new U.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(F.querier));return e.transaction(r,o,i)},table:function(r){var o=e.table(r),i=o.schema,a=i.primaryKey,c=i.indexes,u=a.extractKey,l=a.outbound,h=a.autoIncrement&&c.filter(function(f){return f.compound&&f.keyPath.includes(a.keyPath)}),g=b(b({},o),{mutate:function(f){function v(q){return q="idb://".concat(t,"/").concat(r,"/").concat(q),k[q]||(k[q]=new xe)}var x,m,j,_=f.trans,k=f.mutatedParts||(f.mutatedParts={}),P=v(""),N=v(":dels"),B=f.type,D=f.type==="deleteRange"?[f.range]:f.type==="delete"?[f.keys]:f.values.length<50?[$n(a,f).filter(function(q){return q}),f.values]:[],S=D[0],K=D[1],D=f.trans._cache;return E(S)?(P.addKeys(S),(D=B==="delete"||S.length===K.length?Br(S,D):null)||N.addKeys(S),(D||K)&&(x=v,m=D,j=K,i.indexes.forEach(function(q){var I=x(q.name||"");function W(X){return X!=null?q.extractKey(X):null}function G(X){return q.multiEntry&&E(X)?X.forEach(function(Ne){return I.addKey(Ne)}):I.addKey(X)}(m||j).forEach(function(X,we){var H=m&&W(m[we]),we=j&&W(j[we]);Z(H,we)!==0&&(H!=null&&G(H),we!=null&&G(we))})}))):S?(K={from:(K=S.lower)!==null&&K!==void 0?K:e.MIN_KEY,to:(K=S.upper)!==null&&K!==void 0?K:e.MAX_KEY},N.add(K),P.add(K)):(P.add(n),N.add(n),i.indexes.forEach(function(q){return v(q.name).add(n)})),o.mutate(f).then(function(q){return!S||f.type!=="add"&&f.type!=="put"||(P.addKeys(q.results),h&&h.forEach(function(I){for(var W=f.values.map(function(H){return I.extractKey(H)}),G=I.keyPath.findIndex(function(H){return H===a.keyPath}),X=0,Ne=q.results.length;X<Ne;++X)W[X][G]=q.results[X];v(I.name).addKeys(W)})),_.mutatedParts=ln(_.mutatedParts||{},k),q})}}),c=function(v){var x=v.query,v=x.index,x=x.range;return[v,new xe((v=x.lower)!==null&&v!==void 0?v:e.MIN_KEY,(x=x.upper)!==null&&x!==void 0?x:e.MAX_KEY)]},w={get:function(f){return[a,new xe(f.key)]},getMany:function(f){return[a,new xe().addKeys(f.keys)]},count:c,query:c,openCursor:c};return C(w).forEach(function(f){g[f]=function(v){var x=F.subscr,m=!!x,j=Dr(F,o)&&Rr(f,v)?v.obsSet={}:x;if(m){var _=function(K){return K="idb://".concat(t,"/").concat(r,"/").concat(K),j[K]||(j[K]=new xe)},k=_(""),P=_(":dels"),x=w[f](v),m=x[0],x=x[1];if((f==="query"&&m.isPrimaryKey&&!v.values?P:_(m.name||"")).add(x),!m.isPrimaryKey){if(f!=="count"){var N=f==="query"&&l&&v.values&&o.query(b(b({},v),{values:!1}));return o[f].apply(this,arguments).then(function(K){if(f==="query"){if(l&&v.values)return N.then(function(W){return W=W.result,k.addKeys(W),K});var D=v.values?K.result.map(u):K.result;(v.values?k:P).addKeys(D)}else if(f==="openCursor"){var q=K,I=v.values;return q&&Object.create(q,{key:{get:function(){return P.addKey(q.primaryKey),q.key}},primaryKey:{get:function(){var W=q.primaryKey;return P.addKey(W),W}},value:{get:function(){return I&&k.addKey(q.primaryKey),q.value}}})}return K})}P.add(n)}}return o[f].apply(this,arguments)}}),g}})}};function Ir(e,t,n){if(n.numFailures===0)return t;if(t.type==="deleteRange")return null;var r=t.keys?t.keys.length:"values"in t&&t.values?t.values.length:1;return n.numFailures===r?null:(t=b({},t),E(t.keys)&&(t.keys=t.keys.filter(function(o,i){return!(i in n.failures)})),"values"in t&&E(t.values)&&(t.values=t.values.filter(function(o,i){return!(i in n.failures)})),t)}function er(e,t){return n=e,((r=t).lower===void 0||(r.lowerOpen?0<Z(n,r.lower):0<=Z(n,r.lower)))&&(e=e,(t=t).upper===void 0||(t.upperOpen?Z(e,t.upper)<0:Z(e,t.upper)<=0));var n,r}function Tr(e,t,w,r,o,i){if(!w||w.length===0)return e;var a=t.query.index,u=a.multiEntry,l=t.query.range,h=r.schema.primaryKey.extractKey,g=a.extractKey,c=(a.lowLevelIndex||a).extractKey,w=w.reduce(function(f,v){var x=f,m=[];if(v.type==="add"||v.type==="put")for(var j=new xe,_=v.values.length-1;0<=_;--_){var k,P=v.values[_],N=h(P);j.hasKey(N)||(k=g(P),(u&&E(k)?k.some(function(q){return er(q,l)}):er(k,l))&&(j.addKey(N),m.push(P)))}switch(v.type){case"add":var B=new xe().addKeys(t.values?f.map(function(I){return h(I)}):f),x=f.concat(t.values?m.filter(function(I){return I=h(I),!B.hasKey(I)&&(B.addKey(I),!0)}):m.map(function(I){return h(I)}).filter(function(I){return!B.hasKey(I)&&(B.addKey(I),!0)}));break;case"put":var S=new xe().addKeys(v.values.map(function(I){return h(I)}));x=f.filter(function(I){return!S.hasKey(t.values?h(I):I)}).concat(t.values?m:m.map(function(I){return h(I)}));break;case"delete":var K=new xe().addKeys(v.keys);x=f.filter(function(I){return!K.hasKey(t.values?h(I):I)});break;case"deleteRange":var D=v.range;x=f.filter(function(I){return!er(h(I),D)})}return x},e);return w===e?e:(w.sort(function(f,v){return Z(c(f),c(v))||Z(h(f),h(v))}),t.limit&&t.limit<1/0&&(w.length>t.limit?w.length=t.limit:e.length===t.limit&&w.length<t.limit&&(o.dirty=!0)),i?Object.freeze(w):w)}function Fr(e,t){return Z(e.lower,t.lower)===0&&Z(e.upper,t.upper)===0&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function To(e,t){return function(n,r,o,i){if(n===void 0)return r!==void 0?-1:0;if(r===void 0)return 1;if((r=Z(n,r))===0){if(o&&i)return 0;if(o)return 1;if(i)return-1}return r}(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&0<=function(n,r,o,i){if(n===void 0)return r!==void 0?1:0;if(r===void 0)return-1;if((r=Z(n,r))===0){if(o&&i)return 0;if(o)return-1;if(i)return 1}return r}(e.upper,t.upper,e.upperOpen,t.upperOpen)}function Fo(e,t,n,r){e.subscribers.add(n),r.addEventListener("abort",function(){var o,i;e.subscribers.delete(n),e.subscribers.size===0&&(o=e,i=t,setTimeout(function(){o.subscribers.size===0&&Oe(i,o)},3e3))})}var Lo={stack:"dbcore",level:0,name:"Cache",create:function(e){var t=e.schema.name;return b(b({},e),{transaction:function(n,r,o){var i,a,u=e.transaction(n,r,o);return r==="readwrite"&&(a=(i=new AbortController).signal,o=function(l){return function(){if(i.abort(),r==="readwrite"){for(var h=new Set,g=0,c=n;g<c.length;g++){var w=c[g],f=lt["idb://".concat(t,"/").concat(w)];if(f){var v=e.table(w),x=f.optimisticOps.filter(function(I){return I.trans===u});if(u._explicit&&l&&u.mutatedParts)for(var m=0,j=Object.values(f.queries.query);m<j.length;m++)for(var _=0,k=(B=j[m]).slice();_<k.length;_++)Wn((S=k[_]).obsSet,u.mutatedParts)&&(Oe(B,S),S.subscribers.forEach(function(I){return h.add(I)}));else if(0<x.length){f.optimisticOps=f.optimisticOps.filter(function(I){return I.trans!==u});for(var P=0,N=Object.values(f.queries.query);P<N.length;P++)for(var B,S,K,D=0,q=(B=N[P]).slice();D<q.length;D++)(S=q[D]).res!=null&&u.mutatedParts&&(l&&!S.dirty?(K=Object.isFrozen(S.res),K=Tr(S.res,S.req,x,v,S,K),S.dirty?(Oe(B,S),S.subscribers.forEach(function(I){return h.add(I)})):K!==S.res&&(S.res=K,S.promise=R.resolve({result:K}))):(S.dirty&&Oe(B,S),S.subscribers.forEach(function(I){return h.add(I)})))}}}h.forEach(function(I){return I()})}}},u.addEventListener("abort",o(!1),{signal:a}),u.addEventListener("error",o(!1),{signal:a}),u.addEventListener("complete",o(!0),{signal:a})),u},table:function(n){var r=e.table(n),o=r.schema.primaryKey;return b(b({},r),{mutate:function(i){var a=F.trans;if(o.outbound||a.db._options.cache==="disabled"||a.explicit||a.idbtrans.mode!=="readwrite")return r.mutate(i);var u=lt["idb://".concat(t,"/").concat(n)];return u?(a=r.mutate(i),i.type!=="add"&&i.type!=="put"||!(50<=i.values.length||$n(o,i).some(function(l){return l==null}))?(u.optimisticOps.push(i),i.mutatedParts&&fn(i.mutatedParts),a.then(function(l){0<l.numFailures&&(Oe(u.optimisticOps,i),(l=Ir(0,i,l))&&u.optimisticOps.push(l),i.mutatedParts&&fn(i.mutatedParts))}),a.catch(function(){Oe(u.optimisticOps,i),i.mutatedParts&&fn(i.mutatedParts)})):a.then(function(l){var h=Ir(0,b(b({},i),{values:i.values.map(function(g,c){var w;return l.failures[c]||(g=(w=o.keyPath)!==null&&w!==void 0&&w.includes(".")?Ke(g):b({},g),V(g,o.keyPath,l.results[c])),g})}),l);u.optimisticOps.push(h),queueMicrotask(function(){return i.mutatedParts&&fn(i.mutatedParts)})}),a):r.mutate(i)},query:function(i){if(!Dr(F,r)||!Rr("query",i))return r.query(i);var a=((h=F.trans)===null||h===void 0?void 0:h.db._options.cache)==="immutable",c=F,u=c.requery,l=c.signal,h=function(v,x,m,j){var _=lt["idb://".concat(v,"/").concat(x)];if(!_)return[];if(!(x=_.queries[m]))return[null,!1,_,null];var k=x[(j.query?j.query.index.name:null)||""];if(!k)return[null,!1,_,null];switch(m){case"query":var P=k.find(function(N){return N.req.limit===j.limit&&N.req.values===j.values&&Fr(N.req.query.range,j.query.range)});return P?[P,!0,_,k]:[k.find(function(N){return("limit"in N.req?N.req.limit:1/0)>=j.limit&&(!j.values||N.req.values)&&To(N.req.query.range,j.query.range)}),!1,_,k];case"count":return P=k.find(function(N){return Fr(N.req.query.range,j.query.range)}),[P,!!P,_,k]}}(t,n,"query",i),g=h[0],c=h[1],w=h[2],f=h[3];return g&&c?g.obsSet=i.obsSet:(c=r.query(i).then(function(v){var x=v.result;if(g&&(g.res=x),a){for(var m=0,j=x.length;m<j;++m)Object.freeze(x[m]);Object.freeze(x)}else v.result=Ke(x);return v}).catch(function(v){return f&&g&&Oe(f,g),Promise.reject(v)}),g={obsSet:i.obsSet,promise:c,subscribers:new Set,type:"query",req:i,dirty:!1},f?f.push(g):(f=[g],(w=w||(lt["idb://".concat(t,"/").concat(n)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[i.query.index.name||""]=f)),Fo(g,f,u,l),g.promise.then(function(v){return{result:Tr(v.result,i,w?.optimisticOps,r,g,a)}})}})}})}};function hn(e,t){return new Proxy(e,{get:function(n,r,o){return r==="db"?t:Reflect.get(n,r,o)}})}var He=(he.prototype.version=function(e){if(isNaN(e)||e<.1)throw new U.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new U.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter(function(r){return r._cfg.version===e})[0];return n||(n=new this.Version(e),t.push(n),t.sort(No),n.stores({}),this._state.autoSchema=!1,n)},he.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||F.letThrough||this._vip)?e():new R(function(n,r){if(t._state.openComplete)return r(new U.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void r(new U.DatabaseClosed);t.open().catch(ne)}t._state.dbReadyPromise.then(n,r)}).then(e)},he.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,o=e.name;return o&&this.unuse({stack:t,name:o}),e=this._middlewares[t]||(this._middlewares[t]=[]),e.push({stack:t,create:n,level:r??10,name:o}),e.sort(function(i,a){return i.level-a.level}),this},he.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(function(o){return r?o.create!==r:!!n&&o.name!==n})),this},he.prototype.open=function(){var e=this;return st(We,function(){return qo(e)})},he.prototype._close=function(){var e=this._state,t=vt.indexOf(this);if(0<=t&&vt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new R(function(n){e.dbReadyResolve=n}),e.openCanceller=new R(function(n,r){e.cancelOpen=r}))},he.prototype.close=function(n){var t=(n===void 0?{disableAutoOpen:!0}:n).disableAutoOpen,n=this._state;t?(n.isBeingOpened&&n.cancelOpen(new U.DatabaseClosed),this._close(),n.autoOpen=!1,n.dbOpenError=new U.DatabaseClosed):(this._close(),n.autoOpen=this._options.autoOpen||n.isBeingOpened,n.openComplete=!1,n.dbOpenError=null)},he.prototype.delete=function(e){var t=this;e===void 0&&(e={disableAutoOpen:!0});var n=0<arguments.length&&typeof arguments[0]!="object",r=this._state;return new R(function(o,i){function a(){t.close(e);var u=t._deps.indexedDB.deleteDatabase(t.name);u.onsuccess=ce(function(){var l,h,g;l=t._deps,h=t.name,g=l.indexedDB,l=l.IDBKeyRange,Un(g)||h===Yt||Qn(g,l).delete(h).catch(ne),o()}),u.onerror=Le(i),u.onblocked=t._fireOnBlocked}if(n)throw new U.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(a):a()})},he.prototype.backendDB=function(){return this.idbdb},he.prototype.isOpen=function(){return this.idbdb!==null},he.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&e.name==="DatabaseClosed"},he.prototype.hasFailed=function(){return this._state.dbOpenError!==null},he.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(he.prototype,"tables",{get:function(){var e=this;return C(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),he.prototype.transaction=function(){var e=function(t,n,r){var o=arguments.length;if(o<2)throw new U.InvalidArgument("Too few arguments");for(var i=new Array(o-1);--o;)i[o-1]=arguments[o];return r=i.pop(),[t,Y(i),r]}.apply(this,arguments);return this._transaction.apply(this,e)},he.prototype._transaction=function(e,t,n){var r=this,o=F.trans;o&&o.db===this&&e.indexOf("!")===-1||(o=null);var i,a,u=e.indexOf("?")!==-1;e=e.replace("!","").replace("?","");try{if(a=t.map(function(h){if(h=h instanceof r.Table?h.name:h,typeof h!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return h}),e=="r"||e===Sn)i=Sn;else{if(e!="rw"&&e!=Kn)throw new U.InvalidArgument("Invalid transaction mode: "+e);i=Kn}if(o){if(o.mode===Sn&&i===Kn){if(!u)throw new U.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach(function(h){if(o&&o.storeNames.indexOf(h)===-1){if(!u)throw new U.SubTransaction("Table "+h+" not included in parent transaction.");o=null}}),u&&o&&!o.active&&(o=null)}}catch(h){return o?o._promise(null,function(g,c){c(h)}):de(h)}var l=function h(g,c,w,f,v){return R.resolve().then(function(){var x=F.transless||F,m=g._createTransaction(c,w,g._dbSchema,f);if(m.explicit=!0,x={trans:m,transless:x},f)m.idbtrans=f.idbtrans;else try{m.create(),m.idbtrans._explicit=!0,g._state.PR1398_maxLoop=3}catch(k){return k.name===wn.InvalidState&&g.isOpen()&&0<--g._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),g.close({disableAutoOpen:!1}),g.open().then(function(){return h(g,c,w,null,v)})):de(k)}var j,_=$(v);return _&&mt(),x=R.follow(function(){var k;(j=v.call(m,m))&&(_?(k=Ge.bind(null,null),j.then(k,k)):typeof j.next=="function"&&typeof j.throw=="function"&&(j=Yn(j)))},x),(j&&typeof j.then=="function"?R.resolve(j).then(function(k){return m.active?k:de(new U.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):x.then(function(){return j})).then(function(k){return f&&m._resolve(),m._completion.then(function(){return k})}).catch(function(k){return m._reject(k),de(k)})})}.bind(null,this,i,a,o,n);return o?o._promise(i,l,"lock"):F.trans?st(F.transless,function(){return r._whenReady(l)}):this._whenReady(l)},he.prototype.table=function(e){if(!M(this._allTables,e))throw new U.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},he);function he(e,t){var n=this;this._middlewares={},this.verno=0;var r=he.dependencies;this._options=t=b({addons:he.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,cache:"cloned"},t),this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange},r=t.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var o,i,a,u,l,h={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:ne,dbReadyPromise:null,cancelOpen:ne,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:t.autoOpen};h.dbReadyPromise=new R(function(c){h.dbReadyResolve=c}),h.openCanceller=new R(function(c,w){h.cancelOpen=w}),this._state=h,this.name=e,this.on=Pt(this,"populate","blocked","versionchange","close",{ready:[jn,ne]}),this.on.ready.subscribe=be(this.on.ready.subscribe,function(c){return function(w,f){he.vip(function(){var v,x=n._state;x.openComplete?(x.dbOpenError||R.resolve().then(w),f&&c(w)):x.onReadyBeingFired?(x.onReadyBeingFired.push(w),f&&c(w)):(c(w),v=n,f||c(function m(){v.on.ready.unsubscribe(w),v.on.ready.unsubscribe(m)}))})}}),this.Collection=(o=this,Ct(_o.prototype,function(j,m){this.db=o;var f=vr,v=null;if(m)try{f=m()}catch(_){v=_}var x=j._ctx,m=x.table,j=m.hook.reading.fire;this._ctx={table:m,index:x.index,isPrimKey:!x.index||m.schema.primKey.keyPath&&x.index===m.schema.primKey.name,range:f,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:v,or:x.or,valueMapper:j!==jt?j:null}})),this.Table=(i=this,Ct(wr.prototype,function(c,w,f){this.db=i,this._tx=f,this.name=c,this.schema=w,this.hook=i._allTables[c]?i._allTables[c].hook:Pt(null,{creating:[po,ne],reading:[ho,jt],updating:[mo,ne],deleting:[yo,ne]})})),this.Transaction=(a=this,Ct(Oo.prototype,function(c,w,f,v,x){var m=this;this.db=a,this.mode=c,this.storeNames=w,this.schema=f,this.chromeTransactionDurability=v,this.idbtrans=null,this.on=Pt(this,"complete","error","abort"),this.parent=x||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new R(function(j,_){m._resolve=j,m._reject=_}),this._completion.then(function(){m.active=!1,m.on.complete.fire()},function(j){var _=m.active;return m.active=!1,m.on.error.fire(j),m.parent?m.parent._reject(j):_&&m.idbtrans&&m.idbtrans.abort(),de(j)})})),this.Version=(u=this,Ct(Mo.prototype,function(c){this.db=u,this._cfg={version:c,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(l=this,Ct(Or.prototype,function(c,w,f){if(this.db=l,this._ctx={table:c,index:w===":id"?null:w,or:f},this._cmp=this._ascending=Z,this._descending=function(v,x){return Z(x,v)},this._max=function(v,x){return 0<Z(v,x)?v:x},this._min=function(v,x){return Z(v,x)<0?v:x},this._IDBKeyRange=l._deps.IDBKeyRange,!this._IDBKeyRange)throw new U.MissingAPI})),this.on("versionchange",function(c){0<c.newVersion?console.warn("Another connection wants to upgrade database '".concat(n.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(n.name,"'. Closing db now to resume the delete request.")),n.close({disableAutoOpen:!1})}),this.on("blocked",function(c){!c.newVersion||c.newVersion<c.oldVersion?console.warn("Dexie.delete('".concat(n.name,"') was blocked")):console.warn("Upgrade '".concat(n.name,"' blocked by other connection holding version ").concat(c.oldVersion/10))}),this._maxKey=Kt(t.IDBKeyRange),this._createTransaction=function(c,w,f,v){return new n.Transaction(c,w,f,n._options.chromeTransactionDurability,v)},this._fireOnBlocked=function(c){n.on("blocked").fire(c),vt.filter(function(w){return w.name===n.name&&w!==n&&!w._state.vcFired}).map(function(w){return w.on("versionchange").fire(c)})},this.use(Ro),this.use(Lo),this.use(Io),this.use(Bo),this.use(Do);var g=new Proxy(this,{get:function(c,w,f){if(w==="_vip")return!0;if(w==="table")return function(x){return hn(n.table(x),g)};var v=Reflect.get(c,w,f);return v instanceof wr?hn(v,g):w==="tables"?v.map(function(x){return hn(x,g)}):w==="_createTransaction"?function(){return hn(v.apply(this,arguments),g)}:v}});this.vip=g,r.forEach(function(c){return c(n)})}var pn,Me=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",zo=(tr.prototype.subscribe=function(e,t,n){return this._subscribe(e&&typeof e!="function"?e:{next:e,error:t,complete:n})},tr.prototype[Me]=function(){return this},tr);function tr(e){this._subscribe=e}try{pn={indexedDB:A.indexedDB||A.mozIndexedDB||A.webkitIndexedDB||A.msIndexedDB,IDBKeyRange:A.IDBKeyRange||A.webkitIDBKeyRange}}catch{pn={indexedDB:null,IDBKeyRange:null}}function Lr(e){var t,n=!1,r=new zo(function(o){var i=$(e),a,u=!1,l={},h={},g={get closed(){return u},unsubscribe:function(){u||(u=!0,a&&a.abort(),c&&Ze.storagemutated.unsubscribe(f))}};o.start&&o.start(g);var c=!1,w=function(){return Nn(v)},f=function(x){ln(l,x),Wn(h,l)&&w()},v=function(){var x,m,j;!u&&pn.indexedDB&&(l={},x={},a&&a.abort(),a=new AbortController,j=function(_){var k=pt();try{i&&mt();var P=Je(e,_);return P=i?P.finally(Ge):P}finally{k&&yt()}}(m={subscr:x,signal:a.signal,requery:w,querier:e,trans:null}),Promise.resolve(j).then(function(_){n=!0,t=_,u||m.signal.aborted||(l={},function(k){for(var P in k)if(M(k,P))return;return 1}(h=x)||c||(Ze(St,f),c=!0),Nn(function(){return!u&&o.next&&o.next(_)}))},function(_){n=!1,["DatabaseClosedError","AbortError"].includes(_?.name)||u||Nn(function(){u||o.error&&o.error(_)})}))};return setTimeout(w,0),g});return r.hasValue=function(){return n},r.getValue=function(){return t},r}var ft=He;function nr(e){var t=$e;try{$e=!0,Ze.storagemutated.fire(e),Xn(e,!0)}finally{$e=t}}ie(ft,b(b({},zt),{delete:function(e){return new ft(e,{addons:[]}).delete()},exists:function(e){return new ft(e,{addons:[]}).open().then(function(t){return t.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{return t=ft.dependencies,n=t.indexedDB,t=t.IDBKeyRange,(Un(n)?Promise.resolve(n.databases()).then(function(r){return r.map(function(o){return o.name}).filter(function(o){return o!==Yt})}):Qn(n,t).toCollection().primaryKeys()).then(e)}catch{return de(new U.MissingAPI)}var t,n},defineClass:function(){return function(e){T(this,e)}},ignoreTransaction:function(e){return F.trans?st(F.transless,e):e()},vip:Vn,async:function(e){return function(){try{var t=Yn(e.apply(this,arguments));return t&&typeof t.then=="function"?t:R.resolve(t)}catch(n){return de(n)}}},spawn:function(e,t,n){try{var r=Yn(e.apply(n,t||[]));return r&&typeof r.then=="function"?r:R.resolve(r)}catch(o){return de(o)}},currentTransaction:{get:function(){return F.trans||null}},waitFor:function(e,t){return t=R.resolve(typeof e=="function"?ft.ignoreTransaction(e):e).timeout(t||6e4),F.trans?F.trans.waitFor(t):t},Promise:R,debug:{get:function(){return Fe},set:function(e){lr(e)}},derive:ge,extend:T,props:ie,override:be,Events:Pt,on:Ze,liveQuery:Lr,extendObservabilitySet:ln,getByKeyPath:te,setByKeyPath:V,delByKeyPath:function(e,t){typeof t=="string"?V(e,t,void 0):"length"in t&&[].map.call(t,function(n){V(e,n,void 0)})},shallowClone:_e,deepClone:Ke,getObjectDiff:Zn,cmp:Z,asap:le,minKey:-1/0,addons:[],connections:vt,errnames:wn,dependencies:pn,cache:lt,semVer:"4.0.11",version:"4.0.11".split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)})})),ft.maxKey=Kt(ft.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Ze(St,function(e){$e||(e=new CustomEvent(Dn,{detail:e}),$e=!0,dispatchEvent(e),$e=!1)}),addEventListener(Dn,function(e){e=e.detail,$e||nr(e)}));var xt,$e=!1,zr=function(){};return typeof BroadcastChannel<"u"&&((zr=function(){(xt=new BroadcastChannel(Dn)).onmessage=function(e){return e.data&&nr(e.data)}})(),typeof xt.unref=="function"&&xt.unref(),Ze(St,function(e){$e||xt.postMessage(e)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(e){if(!He.disableBfCache&&e.persisted){Fe&&console.debug("Dexie: handling persisted pagehide"),xt?.close();for(var t=0,n=vt;t<n.length;t++)n[t].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(e){!He.disableBfCache&&e.persisted&&(Fe&&console.debug("Dexie: handling persisted pageshow"),zr(),nr({all:new xe(-1/0,[[]])}))})),R.rejectionMapper=function(e,t){return!e||e instanceof ye||e instanceof TypeError||e instanceof SyntaxError||!e.name||!cr[e.name]?e:(t=new cr[e.name](t||e.message,e),"stack"in e&&ae(t,"stack",{get:function(){return this.inner.stack}}),t)},lr(Fe),b(He,Object.freeze({__proto__:null,Dexie:He,liveQuery:Lr,Entity:gr,cmp:Z,PropModification:Et,replacePrefix:function(e,t){return new Et({replacePrefix:[e,t]})},add:function(e){return new Et({add:e})},remove:function(e){return new Et({remove:e})},default:He,RangeSet:xe,mergeRanges:Bt,rangesOverlap:Sr}),{default:He}),He})}(sr)),sr.exports}var Go=Jo();const ur=Uo(Go),Wr=Symbol.for("Dexie"),gn=globalThis[Wr]||(globalThis[Wr]=ur);if(ur.semVer!==gn.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${ur.semVer} and ${gn.semVer}`);const{liveQuery:Xo,mergeRanges:ma,rangesOverlap:va,RangeSet:ga,cmp:ba,Entity:xa,PropModification:wa,replacePrefix:ja,add:_a,remove:ka}=gn;function Yo(s,p,d){var b,O;typeof s=="function"?(b=p||[],O=d):(b=[],O=p);var A=Re.useRef({hasResult:!1,result:O,error:null}),C=Re.useReducer(function(L){return L+1},0);C[0];var E=C[1],T=Re.useMemo(function(){var L=typeof s=="function"?s():s;if(!L||typeof L.subscribe!="function")throw s===L?new TypeError("Given argument to useObservable() was neither a valid observable nor a function."):new TypeError("Observable factory given to useObservable() did not return a valid observable.");if(!A.current.hasResult&&typeof window<"u"&&(typeof L.hasValue!="function"||L.hasValue()))if(typeof L.getValue=="function")A.current.result=L.getValue(),A.current.hasResult=!0;else{var z=L.subscribe(function(M){A.current.result=M,A.current.hasResult=!0});typeof z=="function"?z():z.unsubscribe()}return L},b);if(Re.useDebugValue(A.current.result),Re.useEffect(function(){var L=T.subscribe(function(z){var M=A.current;(M.error!==null||M.result!==z)&&(M.error=null,M.result=z,M.hasResult=!0,E())},function(z){var M=A.current;M.error!==z&&(M.error=z,E())});return typeof L=="function"?L:L.unsubscribe.bind(L)},b),A.current.error)throw A.current.error;return A.current.result}function Jr(s,p,d){return Yo(function(){return Xo(s)},p||[],d)}const to=s=>s>=200&&s<300?"bg-green-200 text-green-800":s>=300&&s<400?"bg-blue-200 text-blue-800":s>=400&&s<500?"bg-orange-600 text-orange-200":s>=500?"bg-red-800 text-red-100":"bg-gray-200 text-gray-800",Zo=["bg-blue-100","border-l-4","border-blue-700"].join(" "),$o=({request:s,reqId:p,onSelect:d,onRemove:b,selected:O})=>{var A,C;const E=T=>{d(T)};return y.jsx("li",{className:`flex items-center cursor-pointer hover:bg-gray-200 ${O?Zo:""}`,onClick:()=>{E(s)},children:y.jsxs("div",{className:"flex items-center p-2 w-full",children:[y.jsx("div",{className:"w-16 flex justify-center",children:y.jsx("span",{className:`inline-flex px-3 py-1 text-xs font-semibold rounded-full ${to((A=s?.response)==null?void 0:A.statusCode)}`,children:((C=s?.response)==null?void 0:C.statusCode)||"N/A"})}),y.jsx("div",{className:"w-20 text-center font-medium",children:s.method||"GET"}),y.jsx("div",{className:"flex-grow truncate text-left",children:s.path||s.url}),y.jsxs("div",{className:"w-20 text-gray-500 text-center",children:[s.latency,"ms"]}),y.jsx("button",{className:"w-8 h-8 flex items-center justify-center cursor-pointer text-red-500 hover:text-red-700",onClick:T=>{T.stopPropagation(),b(p)},children:"✕"})]})})},ei=({isOpen:s,onClose:p,sortField:d,sortDirection:b,filters:O,setSortField:A,setSortDirection:C,setFilters:E})=>{const T=()=>{A("time"),C("asc")},L=()=>{E({})};return y.jsxs(y.Fragment,{children:[s&&y.jsx("div",{className:"fixed inset-0 bg-black opacity-50",style:{zIndex:9998},onClick:p}),y.jsxs("div",{className:`fixed top-0 left-0 h-full w-100 bg-white shadow-xl transform transition-transform duration-300
|
|
12
|
-
${s?"translate-x-0":"-translate-x-full"}
|
|
13
|
-
`,style:{zIndex:9999},children:[y.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-300 bg-gray-50",children:[y.jsx("h2",{className:"pl-4 text-lg font-semibold text-gray-800",children:"Filter & Sort"}),y.jsx("button",{onClick:p,className:"text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer","aria-label":"Close",children:"×"})]}),y.jsxs("div",{className:"p-4 overflow-y-auto h-full",children:[y.jsxs("section",{className:"mb-6 ml-4 mr-4",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("h3",{className:"mb-3 text-xs font-bold text-gray-600 uppercase tracking-wide",children:"Sort By"}),y.jsx("button",{onClick:T,className:"text-xs text-blue-600 hover:underline cursor-pointer",children:"Reset"})]}),y.jsxs("div",{className:"space-y-3",children:[y.jsxs("label",{className:"flex items-center",children:[y.jsx("input",{type:"radio",name:"sortField",value:"time",checked:d==="time",onChange:z=>A(z.target.value),className:"form-radio text-blue-600"}),y.jsx("span",{className:"ml-3 text-gray-700",children:"Timestamp"})]}),y.jsxs("label",{className:"flex items-center",children:[y.jsx("input",{type:"radio",name:"sortField",value:"statusCode",checked:d==="statusCode",onChange:z=>A(z.target.value),className:"form-radio text-blue-600"}),y.jsx("span",{className:"ml-3 text-gray-700",children:"Status"})]}),y.jsxs("label",{className:"flex items-center",children:[y.jsx("input",{type:"radio",name:"sortField",value:"method",checked:d==="method",onChange:z=>A(z.target.value),className:"form-radio text-blue-600"}),y.jsx("span",{className:"ml-3 text-gray-700",children:"Method"})]})]}),y.jsxs("div",{className:"mt-4",children:[y.jsx("h4",{className:"mb-2 text-xs font-bold text-gray-600 uppercase tracking-wide",children:"Sort Direction"}),y.jsxs("div",{className:"space-y-3",children:[y.jsxs("label",{className:"flex items-center",children:[y.jsx("input",{type:"radio",name:"sortDirection",value:"asc",checked:b==="asc",onChange:z=>C(z.target.value),className:"form-radio text-blue-600"}),y.jsx("span",{className:"ml-3 text-gray-700",children:"Ascending"})]}),y.jsxs("label",{className:"flex items-center",children:[y.jsx("input",{type:"radio",name:"sortDirection",value:"desc",checked:b==="desc",onChange:z=>C(z.target.value),className:"form-radio text-blue-600"}),y.jsx("span",{className:"ml-3 text-gray-700",children:"Descending"})]})]})]})]}),y.jsxs("section",{className:"mb-6 ml-4 mr-4",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("h3",{className:"mb-3 text-xs font-bold text-gray-600 uppercase tracking-wide",children:"Filters"}),y.jsx("button",{onClick:L,className:"text-xs text-blue-600 hover:underline cursor-pointer",children:"Reset"})]}),y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{children:[y.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Status"}),y.jsx("input",{type:"number",placeholder:"e.g. 200",value:O.status||"",onChange:z=>E(M=>({...M,status:z.target.value})),className:"block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]}),y.jsxs("div",{children:[y.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Method"}),y.jsxs("select",{value:O.method||"",onChange:z=>E(M=>({...M,method:z.target.value})),className:"block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm",children:[y.jsx("option",{value:"",children:"Any"}),y.jsx("option",{value:"GET",children:"GET"}),y.jsx("option",{value:"POST",children:"POST"}),y.jsx("option",{value:"PUT",children:"PUT"}),y.jsx("option",{value:"PATCH",children:"PATCH"}),y.jsx("option",{value:"DELETE",children:"DELETE"}),y.jsx("option",{value:"OPTIONS",children:"OPTIONS"})]})]}),y.jsxs("div",{children:[y.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Path"}),y.jsx("input",{type:"text",placeholder:"e.g. /api/users",value:O.path||"",onChange:z=>E(M=>({...M,path:z.target.value})),className:"block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]}),y.jsxs("div",{children:[y.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Duration (ms)"}),y.jsxs("div",{className:"flex space-x-2",children:[y.jsx("input",{type:"number",placeholder:"Min",value:O.durationMin||"",onChange:z=>E(M=>({...M,durationMin:z.target.value})),className:"w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"}),y.jsx("input",{type:"number",placeholder:"Max",value:O.durationMax||"",onChange:z=>E(M=>({...M,durationMax:z.target.value})),className:"w-1/2 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]}),y.jsxs("div",{children:[y.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Host"}),y.jsx("input",{type:"text",placeholder:"e.g. localhost",value:O.host||"",onChange:z=>E(M=>({...M,host:z.target.value})),className:"block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-blue-500 focus:border-blue-500 sm:text-sm"})]})]})]})]})]})]})},ti=({currentPage:s,totalPages:p,onPageChange:d})=>{const b=((O,A)=>{const C=[];if(A<=7)for(let E=1;E<=A;E++)C.push(E);else if(O<=4){for(let E=1;E<=5;E++)C.push(E);C.push("ellipsis"),C.push(A)}else if(O>=A-3){C.push(1),C.push("ellipsis");for(let E=A-4;E<=A;E++)C.push(E)}else C.push(1),C.push("ellipsis"),C.push(O-1),C.push(O),C.push(O+1),C.push("ellipsis"),C.push(A);return C})(s,p);return y.jsx("nav",{className:"p-2 border-t border-gray-300",children:y.jsxs("ul",{className:"flex items-center justify-center -space-x-px h-8 text-sm",children:[y.jsx("li",{children:y.jsxs("button",{onClick:()=>d(s-1),disabled:s<=1,className:"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-e-0 border-gray-300 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 disabled:opacity-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer",children:[y.jsx("span",{className:"sr-only",children:"Previous"}),y.jsx("svg",{className:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:y.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 1 1 5l4 4"})})]})}),b.map((O,A)=>{if(O==="ellipsis")return y.jsx("li",{children:y.jsx("span",{className:"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 cursor-pointer",children:"..."})},`ellipsis-${A}`);const C=O===s;return y.jsx("li",{children:y.jsx("button",{onClick:()=>d(O),className:C?"z-10 flex items-center justify-center px-3 h-8 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white cursor-pointer":"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer",children:O})},O)}),y.jsx("li",{children:y.jsxs("button",{onClick:()=>d(s+1),disabled:s>=p,className:"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 disabled:opacity-50 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer",children:[y.jsx("span",{className:"sr-only",children:"Next"}),y.jsx("svg",{className:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:y.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})})]})})]})})},ni=({requests:s,onSelect:p,onRemove:d,clearRequests:b,selectedRequest:O,currentPage:A,totalPages:C,totalCount:E,onPageChange:T,sortField:L,sortDirection:z,filters:M,setSortField:ie,setSortDirection:pe,setFilters:ae})=>{const[ge,Ce]=Q.useState(!1);return y.jsxs("div",{className:"flex flex-col h-full relative",children:[y.jsxs("div",{className:"p-4 flex justify-between items-center",children:[y.jsxs("span",{className:"font-bold text-xl",children:["Requests (",s.length," of ",E,")"]}),y.jsxs("div",{className:"space-x-2",children:[y.jsx("button",{className:"px-3 py-1 bg-blue-500 text-white rounded text-xs cursor-pointer",onClick:()=>Ce(!0),children:"Filters"}),y.jsx("button",{className:"px-3 py-1 bg-red-500 text-white rounded text-xs cursor-pointer",onClick:b,children:"Clear All"})]})]}),y.jsxs("div",{className:"flex items-center bg-gray-200 p-2 border-b border-gray-300 text-sm font-bold cursor-pointer",onClick:()=>Ce(!0),children:[y.jsx("div",{className:"w-16 text-center",children:"Status"}),y.jsx("div",{className:"w-20 text-center",children:"Method"}),y.jsx("div",{className:"flex-grow text-left",children:"Path"}),y.jsx("div",{className:"w-20 text-center",children:"Duration"}),y.jsx("div",{className:"w-10"})]}),y.jsx("ul",{className:"overflow-y-auto flex-grow",style:{maxHeight:"calc(100vh - 40px - 100px - 49px)"},children:s.map((Ie,re)=>{const be=Ie.id||re;return y.jsx($o,{reqId:be,request:Ie,onSelect:p,onRemove:d,selected:O&&O.id===be},be)})}),y.jsx(ti,{currentPage:A,totalPages:C,onPageChange:T}),y.jsx(ei,{isOpen:ge,onClose:()=>Ce(!1),sortField:L,sortDirection:z,filters:M,setSortField:ie,setSortDirection:pe,setFilters:ae})]})},ri=({request:s})=>{var p,d;const b=O=>{if(!O)return"N/A";const A=new Date(O),C=A.toLocaleDateString("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}),E=A.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return`${C} at ${E}`};return y.jsxs("div",{className:"mb-4 p-4 bg-white rounded shadow",children:[y.jsx("h2",{className:"font-bold text-lg mb-2",children:"Request Details"}),y.jsxs("div",{className:"flex flex-col space-y-1",children:[y.jsxs("div",{className:"flex items-center space-x-2 font-mono text-lg",children:[y.jsx("span",{className:"font-bold",children:s.method}),y.jsx("span",{className:"text-blue-600",children:s.path}),y.jsx("span",{className:`inline-flex px-3 py-1 text-xs font-semibold rounded-full ${to((p=s?.response)==null?void 0:p.statusCode)}`,children:(d=s?.response)==null?void 0:d.statusCode}),y.jsx("span",{className:"text-sm",children:s.response.statusMessage})]}),y.jsx("div",{className:"text-gray-600",children:s.url}),y.jsxs("div",{className:"text-gray-500 text-xs",children:["Received on ",b(s.request.timestamp)," • Took ",s.latency,"ms to respond"]})]})]})};function oi(s,p,d){return p in s?Object.defineProperty(s,p,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[p]=d,s}function Gr(s,p){var d=Object.keys(s);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(s);p&&(b=b.filter(function(O){return Object.getOwnPropertyDescriptor(s,O).enumerable})),d.push.apply(d,b)}return d}function Xr(s){for(var p=1;p<arguments.length;p++){var d=arguments[p]!=null?arguments[p]:{};p%2?Gr(Object(d),!0).forEach(function(b){oi(s,b,d[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(d)):Gr(Object(d)).forEach(function(b){Object.defineProperty(s,b,Object.getOwnPropertyDescriptor(d,b))})}return s}function ii(s,p){if(s==null)return{};var d={},b=Object.keys(s),O,A;for(A=0;A<b.length;A++)O=b[A],!(p.indexOf(O)>=0)&&(d[O]=s[O]);return d}function ai(s,p){if(s==null)return{};var d=ii(s,p),b,O;if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(s);for(O=0;O<A.length;O++)b=A[O],!(p.indexOf(b)>=0)&&Object.prototype.propertyIsEnumerable.call(s,b)&&(d[b]=s[b])}return d}function si(s,p){return ui(s)||ci(s,p)||li(s,p)||fi()}function ui(s){if(Array.isArray(s))return s}function ci(s,p){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(s)))){var d=[],b=!0,O=!1,A=void 0;try{for(var C=s[Symbol.iterator](),E;!(b=(E=C.next()).done)&&(d.push(E.value),!(p&&d.length===p));b=!0);}catch(T){O=!0,A=T}finally{try{!b&&C.return!=null&&C.return()}finally{if(O)throw A}}return d}}function li(s,p){if(s){if(typeof s=="string")return Yr(s,p);var d=Object.prototype.toString.call(s).slice(8,-1);if(d==="Object"&&s.constructor&&(d=s.constructor.name),d==="Map"||d==="Set")return Array.from(s);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return Yr(s,p)}}function Yr(s,p){(p==null||p>s.length)&&(p=s.length);for(var d=0,b=new Array(p);d<p;d++)b[d]=s[d];return b}function fi(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
14
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function di(s,p,d){return p in s?Object.defineProperty(s,p,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[p]=d,s}function Zr(s,p){var d=Object.keys(s);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(s);p&&(b=b.filter(function(O){return Object.getOwnPropertyDescriptor(s,O).enumerable})),d.push.apply(d,b)}return d}function $r(s){for(var p=1;p<arguments.length;p++){var d=arguments[p]!=null?arguments[p]:{};p%2?Zr(Object(d),!0).forEach(function(b){di(s,b,d[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(d)):Zr(Object(d)).forEach(function(b){Object.defineProperty(s,b,Object.getOwnPropertyDescriptor(d,b))})}return s}function hi(){for(var s=arguments.length,p=new Array(s),d=0;d<s;d++)p[d]=arguments[d];return function(b){return p.reduceRight(function(O,A){return A(O)},b)}}function It(s){return function p(){for(var d=this,b=arguments.length,O=new Array(b),A=0;A<b;A++)O[A]=arguments[A];return O.length>=s.length?s.apply(this,O):function(){for(var C=arguments.length,E=new Array(C),T=0;T<C;T++)E[T]=arguments[T];return p.apply(d,[].concat(O,E))}}}function bn(s){return{}.toString.call(s).includes("Object")}function pi(s){return!Object.keys(s).length}function Ft(s){return typeof s=="function"}function yi(s,p){return Object.prototype.hasOwnProperty.call(s,p)}function mi(s,p){return bn(p)||et("changeType"),Object.keys(p).some(function(d){return!yi(s,d)})&&et("changeField"),p}function vi(s){Ft(s)||et("selectorType")}function gi(s){Ft(s)||bn(s)||et("handlerType"),bn(s)&&Object.values(s).some(function(p){return!Ft(p)})&&et("handlersType")}function bi(s){s||et("initialIsRequired"),bn(s)||et("initialType"),pi(s)&&et("initialContent")}function xi(s,p){throw new Error(s[p]||s.default)}var wi={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},et=It(xi)(wi),mn={changes:mi,selector:vi,handler:gi,initial:bi};function ji(s){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};mn.initial(s),mn.handler(p);var d={current:s},b=It(Ai)(d,p),O=It(ki)(d),A=It(mn.changes)(s),C=It(_i)(d);function E(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(z){return z};return mn.selector(L),L(d.current)}function T(L){hi(b,O,A,C)(L)}return[E,T]}function _i(s,p){return Ft(p)?p(s.current):p}function ki(s,p){return s.current=$r($r({},s.current),p),p}function Ai(s,p,d){return Ft(p)?p(s.current):Object.keys(d).forEach(function(b){var O;return(O=p[b])===null||O===void 0?void 0:O.call(p,s.current[b])}),d}var Oi={create:ji},Pi={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function Ci(s){return function p(){for(var d=this,b=arguments.length,O=new Array(b),A=0;A<b;A++)O[A]=arguments[A];return O.length>=s.length?s.apply(this,O):function(){for(var C=arguments.length,E=new Array(C),T=0;T<C;T++)E[T]=arguments[T];return p.apply(d,[].concat(O,E))}}}function Ei(s){return{}.toString.call(s).includes("Object")}function Ni(s){return s||eo("configIsRequired"),Ei(s)||eo("configType"),s.urls?(Si(),{paths:{vs:s.urls.monacoBase}}):s}function Si(){console.warn(no.deprecation)}function Ki(s,p){throw new Error(s[p]||s.default)}var no={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
15
|
-
You are using deprecated way of configuration.
|
|
16
|
-
|
|
17
|
-
Instead of using
|
|
18
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
19
|
-
use
|
|
20
|
-
monaco.config({ paths: { vs: '...' } })
|
|
21
|
-
|
|
22
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
23
|
-
`},eo=Ci(Ki)(no),Mi={config:Ni},qi=function(){for(var s=arguments.length,p=new Array(s),d=0;d<s;d++)p[d]=arguments[d];return function(b){return p.reduceRight(function(O,A){return A(O)},b)}};function ro(s,p){return Object.keys(p).forEach(function(d){p[d]instanceof Object&&s[d]&&Object.assign(p[d],ro(s[d],p[d]))}),Xr(Xr({},s),p)}var Bi={type:"cancelation",msg:"operation is manually canceled"};function or(s){var p=!1,d=new Promise(function(b,O){s.then(function(A){return p?O(Bi):b(A)}),s.catch(O)});return d.cancel=function(){return p=!0},d}var Di=Oi.create({config:Pi,isInitialized:!1,resolve:null,reject:null,monaco:null}),oo=si(Di,2),Lt=oo[0],xn=oo[1];function Ri(s){var p=Mi.config(s),d=p.monaco,b=ai(p,["monaco"]);xn(function(O){return{config:ro(O.config,b),monaco:d}})}function Ii(){var s=Lt(function(p){var d=p.monaco,b=p.isInitialized,O=p.resolve;return{monaco:d,isInitialized:b,resolve:O}});if(!s.isInitialized){if(xn({isInitialized:!0}),s.monaco)return s.resolve(s.monaco),or(ir);if(window.monaco&&window.monaco.editor)return io(window.monaco),s.resolve(window.monaco),or(ir);qi(Ti,Li)(zi)}return or(ir)}function Ti(s){return document.body.appendChild(s)}function Fi(s){var p=document.createElement("script");return s&&(p.src=s),p}function Li(s){var p=Lt(function(b){var O=b.config,A=b.reject;return{config:O,reject:A}}),d=Fi("".concat(p.config.paths.vs,"/loader.js"));return d.onload=function(){return s()},d.onerror=p.reject,d}function zi(){var s=Lt(function(d){var b=d.config,O=d.resolve,A=d.reject;return{config:b,resolve:O,reject:A}}),p=window.require;p.config(s.config),p(["vs/editor/editor.main"],function(d){io(d),s.resolve(d)},function(d){s.reject(d)})}function io(s){Lt().monaco||xn({monaco:s})}function Qi(){return Lt(function(s){var p=s.monaco;return p})}var ir=new Promise(function(s,p){return xn({resolve:s,reject:p})}),ao={config:Ri,init:Ii,__getMonacoInstance:Qi},Ui={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ar=Ui,Vi={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Hi=Vi;function Wi({children:s}){return Re.createElement("div",{style:Hi.container},s)}var Ji=Wi,Gi=Ji;function Xi({width:s,height:p,isEditorReady:d,loading:b,_ref:O,className:A,wrapperProps:C}){return Re.createElement("section",{style:{...ar.wrapper,width:s,height:p},...C},!d&&Re.createElement(Gi,null,b),Re.createElement("div",{ref:O,style:{...ar.fullWidth,...!d&&ar.hide},className:A}))}var Yi=Xi,so=Q.memo(Yi);function Zi(s){Q.useEffect(s,[])}var uo=Zi;function $i(s,p,d=!0){let b=Q.useRef(!0);Q.useEffect(b.current||!d?()=>{b.current=!1}:s,p)}var Se=$i;function Tt(){}function wt(s,p,d,b){return ea(s,b)||ta(s,p,d,b)}function ea(s,p){return s.editor.getModel(co(s,p))}function ta(s,p,d,b){return s.editor.createModel(p,d,b?co(s,b):void 0)}function co(s,p){return s.Uri.parse(p)}function na({original:s,modified:p,language:d,originalLanguage:b,modifiedLanguage:O,originalModelPath:A,modifiedModelPath:C,keepCurrentOriginalModel:E=!1,keepCurrentModifiedModel:T=!1,theme:L="light",loading:z="Loading...",options:M={},height:ie="100%",width:pe="100%",className:ae,wrapperProps:ge={},beforeMount:Ce=Tt,onMount:Ie=Tt}){let[re,be]=Q.useState(!1),[Ae,le]=Q.useState(!0),te=Q.useRef(null),V=Q.useRef(null),_e=Q.useRef(null),fe=Q.useRef(Ie),Y=Q.useRef(Ce),qe=Q.useRef(!1);uo(()=>{let J=ao.init();return J.then(oe=>(V.current=oe)&&le(!1)).catch(oe=>oe?.type!=="cancelation"&&console.error("Monaco initialization: error:",oe)),()=>te.current?tt():J.cancel()}),Se(()=>{if(te.current&&V.current){let J=te.current.getOriginalEditor(),oe=wt(V.current,s||"",b||d||"text",A||"");oe!==J.getModel()&&J.setModel(oe)}},[A],re),Se(()=>{if(te.current&&V.current){let J=te.current.getModifiedEditor(),oe=wt(V.current,p||"",O||d||"text",C||"");oe!==J.getModel()&&J.setModel(oe)}},[C],re),Se(()=>{let J=te.current.getModifiedEditor();J.getOption(V.current.editor.EditorOption.readOnly)?J.setValue(p||""):p!==J.getValue()&&(J.executeEdits("",[{range:J.getModel().getFullModelRange(),text:p||"",forceMoveMarkers:!0}]),J.pushUndoStop())},[p],re),Se(()=>{var J,oe;(oe=(J=te.current)==null?void 0:J.getModel())==null||oe.original.setValue(s||"")},[s],re),Se(()=>{let{original:J,modified:oe}=te.current.getModel();V.current.editor.setModelLanguage(J,b||d||"text"),V.current.editor.setModelLanguage(oe,O||d||"text")},[d,b,O],re),Se(()=>{var J;(J=V.current)==null||J.editor.setTheme(L)},[L],re),Se(()=>{var J;(J=te.current)==null||J.updateOptions(M)},[M],re);let Te=Q.useCallback(()=>{var J;if(!V.current)return;Y.current(V.current);let oe=wt(V.current,s||"",b||d||"text",A||""),Qe=wt(V.current,p||"",O||d||"text",C||"");(J=te.current)==null||J.setModel({original:oe,modified:Qe})},[d,p,O,s,b,A,C]),Ke=Q.useCallback(()=>{var J;!qe.current&&_e.current&&(te.current=V.current.editor.createDiffEditor(_e.current,{automaticLayout:!0,...M}),Te(),(J=V.current)==null||J.editor.setTheme(L),be(!0),qe.current=!0)},[M,L,Te]);Q.useEffect(()=>{re&&fe.current(te.current,V.current)},[re]),Q.useEffect(()=>{!Ae&&!re&&Ke()},[Ae,re,Ke]);function tt(){var J,oe,Qe,Oe;let Pe=(J=te.current)==null?void 0:J.getModel();E||(oe=Pe?.original)==null||oe.dispose(),T||(Qe=Pe?.modified)==null||Qe.dispose(),(Oe=te.current)==null||Oe.dispose()}return Re.createElement(so,{width:pe,height:ie,isEditorReady:re,loading:z,_ref:_e,className:ae,wrapperProps:ge})}var ra=na;Q.memo(ra);function oa(s){let p=Q.useRef();return Q.useEffect(()=>{p.current=s},[s]),p.current}var ia=oa,vn=new Map;function aa({defaultValue:s,defaultLanguage:p,defaultPath:d,value:b,language:O,path:A,theme:C="light",line:E,loading:T="Loading...",options:L={},overrideServices:z={},saveViewState:M=!0,keepCurrentModel:ie=!1,width:pe="100%",height:ae="100%",className:ge,wrapperProps:Ce={},beforeMount:Ie=Tt,onMount:re=Tt,onChange:be,onValidate:Ae=Tt}){let[le,te]=Q.useState(!1),[V,_e]=Q.useState(!0),fe=Q.useRef(null),Y=Q.useRef(null),qe=Q.useRef(null),Te=Q.useRef(re),Ke=Q.useRef(Ie),tt=Q.useRef(),J=Q.useRef(b),oe=ia(A),Qe=Q.useRef(!1),Oe=Q.useRef(!1);uo(()=>{let $=ao.init();return $.then(ue=>(fe.current=ue)&&_e(!1)).catch(ue=>ue?.type!=="cancelation"&&console.error("Monaco initialization: error:",ue)),()=>Y.current?Be():$.cancel()}),Se(()=>{var $,ue,ye,Ue;let De=wt(fe.current,s||b||"",p||O||"",A||d||"");De!==(($=Y.current)==null?void 0:$.getModel())&&(M&&vn.set(oe,(ue=Y.current)==null?void 0:ue.saveViewState()),(ye=Y.current)==null||ye.setModel(De),M&&((Ue=Y.current)==null||Ue.restoreViewState(vn.get(A))))},[A],le),Se(()=>{var $;($=Y.current)==null||$.updateOptions(L)},[L],le),Se(()=>{!Y.current||b===void 0||(Y.current.getOption(fe.current.editor.EditorOption.readOnly)?Y.current.setValue(b):b!==Y.current.getValue()&&(Oe.current=!0,Y.current.executeEdits("",[{range:Y.current.getModel().getFullModelRange(),text:b,forceMoveMarkers:!0}]),Y.current.pushUndoStop(),Oe.current=!1))},[b],le),Se(()=>{var $,ue;let ye=($=Y.current)==null?void 0:$.getModel();ye&&O&&((ue=fe.current)==null||ue.editor.setModelLanguage(ye,O))},[O],le),Se(()=>{var $;E!==void 0&&(($=Y.current)==null||$.revealLine(E))},[E],le),Se(()=>{var $;($=fe.current)==null||$.editor.setTheme(C)},[C],le);let Pe=Q.useCallback(()=>{var $;if(!(!qe.current||!fe.current)&&!Qe.current){Ke.current(fe.current);let ue=A||d,ye=wt(fe.current,b||s||"",p||O||"",ue||"");Y.current=($=fe.current)==null?void 0:$.editor.create(qe.current,{model:ye,automaticLayout:!0,...L},z),M&&Y.current.restoreViewState(vn.get(ue)),fe.current.editor.setTheme(C),E!==void 0&&Y.current.revealLine(E),te(!0),Qe.current=!0}},[s,p,d,b,O,A,L,z,M,C,E]);Q.useEffect(()=>{le&&Te.current(Y.current,fe.current)},[le]),Q.useEffect(()=>{!V&&!le&&Pe()},[V,le,Pe]),J.current=b,Q.useEffect(()=>{var $,ue;le&&be&&(($=tt.current)==null||$.dispose(),tt.current=(ue=Y.current)==null?void 0:ue.onDidChangeModelContent(ye=>{Oe.current||be(Y.current.getValue(),ye)}))},[le,be]),Q.useEffect(()=>{if(le){let $=fe.current.editor.onDidChangeMarkers(ue=>{var ye;let Ue=(ye=Y.current.getModel())==null?void 0:ye.uri;if(Ue&&ue.find(De=>De.path===Ue.path)){let De=fe.current.editor.getModelMarkers({resource:Ue});Ae?.(De)}});return()=>{$?.dispose()}}return()=>{}},[le,Ae]);function Be(){var $,ue;($=tt.current)==null||$.dispose(),ie?M&&vn.set(A,Y.current.saveViewState()):(ue=Y.current.getModel())==null||ue.dispose(),Y.current.dispose()}return Re.createElement(so,{width:pe,height:ae,isEditorReady:le,loading:T,_ref:qe,className:ge,wrapperProps:Ce})}var sa=aa,ua=Q.memo(sa),lo=ua;const ca=({request:s})=>{const[p,d]=Q.useState(!1),[b,O]=Q.useState(!1),A=L=>Object.entries(L||{}).map(([z,M])=>y.jsxs("tr",{children:[y.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-slate-500 text-xs",children:z}),y.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-xs",children:M})]},z)),C=s.request.payload,E=!C||typeof C=="object"&&Object.keys(C).length===0||typeof C=="string"&&(C.trim()===""||C.trim()==="{}"),T=L=>{try{const z=JSON.parse(L);return JSON.stringify(z,null,2)}catch{return L}};return y.jsxs("div",{children:[y.jsxs("div",{className:"mb-4",children:[y.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200",onClick:()=>d(!p),children:["Query Parameters (",Object.keys(s.request.queryParams||{}).length,")"]}),p&&y.jsx("div",{className:"p-0",children:y.jsxs("table",{className:"w-full border-collapse border border-gray-300",children:[y.jsx("thead",{children:y.jsxs("tr",{className:"bg-gray-100",children:[y.jsx("th",{className:"border border-slate-200 px-2 py-1 w-1/4 text-left",children:"Key"}),y.jsx("th",{className:"border border-slate-200 px-2 py-1 text-left",children:"Value"})]})}),y.jsx("tbody",{children:A(s.request.queryParams)})]})})]}),y.jsxs("div",{className:"mb-4",children:[y.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200",onClick:()=>O(!b),children:["Headers (",Object.keys(s.request.headers||{}).length,")"]}),b&&y.jsx("div",{className:"p-0",children:y.jsxs("table",{className:"w-full border-collapse border border-gray-300",children:[y.jsx("thead",{children:y.jsxs("tr",{className:"bg-gray-100",children:[y.jsx("th",{className:"border border-slate-200 px-2 py-1 w-1/4 text-left",children:"Header"}),y.jsx("th",{className:"border border-slate-200 px-2 py-1 text-left",children:"Value"})]})}),y.jsx("tbody",{children:A(s.request.headers)})]})})]}),y.jsxs("div",{children:[y.jsx("button",{className:"w-full p-2 text-left font-bold bg-gray-200",children:"Request Body"}),E?y.jsx("div",{className:"hidden"}):y.jsx("div",{className:"bg-white rounded-b shadow p-0 h-100",children:y.jsx(lo,{height:"100%",defaultLanguage:"json",value:T(C),options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})})]})]})},la=({request:s})=>{const[p,d]=Q.useState(!1),b=E=>Object.entries(E||{}).map(([T,L])=>y.jsxs("tr",{children:[y.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-slate-500 text-xs",children:T}),y.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-xs",children:L})]},T)),O=s.response.payload,A=!O||typeof O=="object"&&Object.keys(O).length===0||typeof O=="string"&&(O.trim()===""||O.trim()==="{}"),C=E=>{try{const T=JSON.parse(E);return JSON.stringify(T,null,2)}catch{return E}};return y.jsxs("div",{children:[y.jsxs("div",{className:"mb-4",children:[y.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200",onClick:()=>d(!p),children:["Headers (",Object.keys(s.response.headers||{}).length,")"]}),p&&y.jsx("div",{className:"p-0",children:y.jsxs("table",{className:"w-full border-collapse border border-gray-300",children:[y.jsx("thead",{children:y.jsxs("tr",{className:"bg-gray-100",children:[y.jsx("th",{className:"border border-slate-200 px-2 py-1 w-1/4 text-left",children:"Header"}),y.jsx("th",{className:"border border-slate-200 px-2 py-1 text-left",children:"Value"})]})}),y.jsx("tbody",{children:b(s.response.headers)})]})})]}),y.jsxs("div",{children:[y.jsx("button",{className:"w-full p-2 text-left font-bold bg-gray-200",children:"Response Body"}),A?y.jsx("div",{className:"hidden"}):y.jsx("div",{className:"bg-white rounded-b shadow p-0 h-100",children:y.jsx(lo,{height:"100%",defaultLanguage:"json",value:C(O),options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})})]})]})},fa=({request:s,currentTab:p,setCurrentTab:d})=>s?y.jsxs("div",{children:[y.jsx(ri,{request:s}),y.jsxs("div",{className:"flex space-x-2",children:[y.jsx("button",{className:`px-4 py-2 rounded-t ${p==="request"?"bg-blue-600 text-white":"bg-gray-200 text-gray-700"}`,onClick:()=>d("request"),children:"Request"}),y.jsx("button",{className:`px-4 py-2 rounded-t ${p==="response"?"bg-blue-600 text-white":"bg-gray-200 text-gray-700"}`,onClick:()=>d("response"),children:"Response"})]}),y.jsx("div",{className:"p-4 bg-white rounded-b shadow",children:p==="request"?y.jsx(ca,{request:s}):y.jsx(la,{request:s})})]}):y.jsx("div",{className:"text-gray-500",children:"No request selected."}),da="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAACHxJREFUeJztnX+MFGcdxiul8UWMcECtlSIcR+GKYKsHhTu9dsQr9PhxV+TSEtTYVqXVHnD9AZWWhkG7tY1pY2uUtrYRQhZbTyC1Ftyilhg1Ri0Ww4gh1pomeze3O8ZaClZ68PoZ50gu6+zdLjd732FmnuT5j5DvPJ/bfZ93fu155yVKlChRokSJEg1FatLssXi09ByxE6FfjHfjU/g/+HE8TnquWKgv/D9jXeCf4irp+SItAj4f/9wn/DN+EL9Les7IinCXDxC+63/ij0vPGUn1LbivDQLA9Y+lZ42kCPZ6fLoEACdxrfS8kZL7vY5/XUL4Z7xVeuZIiUA/XOJf/xn/FV8kPXdkRJj3lBG+7tsffEF67kjI3ekOUj0zuAVfjtfg7/R5pfTskRBBzsJvFQn/V8kOOAARosL34tfxOwU+VST8N8ZMr7+sPe3svW27o295Kq+/uDWvb3o0rz/3zbxe9UCu5wYzd1/bppySPr7QizDvxr1lfs9/a+0zPW3tO53TRQBoAPSuuDe3Qfr4Qi/C/FuZ4b9dbXxm0rrO/CsA0AMA0CvuyR2VPr7Qi0APlQng+Y5dzlUA6C0BwEHp4wu9CPQ6/O8yKuaC23c7z3V05vUgAE7wFbRU+vhCL+XtdJvwdvzDfn7VB0AWV92xx+kEQAYAGQBkAJABQAYAGQBkAPAsABayCCdnR89Gyjv1/CMfADukZ4uFCHoC/pMPgOukZ4uFCLq2yLpwofRssRBBf8on/C7puWIjwr7ZB8A+6bnOSRHceHxbvxNlpfi3PgA2r3/BWXXX806aFpSmBaVpQWlaUJoWlKYFpWlBaVpQmhaUpgWlP70xt6P1ztz2pWty3792dc/TTTf1PGWssp9obLO/29Bq3zJ/iT1WOp+Kqq/NfK/MjVYxLwTAcwDQANAl7AP0io05DQANAA0ADQANAA0AXd9i63nN9qNzmrqjW1UJ7WP4HwGEfxxXA+BokACuvNa2ATBdOqeKidDq8b8CAJB979S6KgCcCBhAHgCzpHOqmAjuAnfxDADA4TWdr05av9fRAX8F7QLACOmcKirCm4ifxFaJdk9BFJ6e3r9hnzMTABYALABYALAAYAHAAoAFAAsAFgAsAFgAsABgAcACgAUACwAWACwAHG5osR+bv9hOrh0XirAb8JsFALZJzxUbEXaz8m667Q/gIem5YiPCXumzBrRLzxUbEfZXfAC0Ss8VGxH2Rh8Ac6XnCq2Ud0FlKV6Nbw3AewsBjJ919bS7M85aWpBJCzJpQSYtyKQFmbQgkxZk0oJMWpBJCzJpQSYtyKQFmbQgkxZk0oJMWpBJCzJpQSY11GQfYNYt6DYvb+w2Z9d3mTPndJkzrugyp83KbqqpzS6fOj0b7oqqvLuW9wfQ8wf08vs7xwLgtaD3AQDQANAA0ADQANAA0ADQANDVl2ZfnDItO0Y656IinDZV3n2bZ+Newq/CWQEAp6fUZJdL51xUbjup9F8/zhP+hTgnAEBPrsneKp1zURHOlfjtCgPIEf4HsCMA4ASfgI9K51xUyjvd3KG8uxUqBeB1wp+Mjw0zgC4AtLMGnC+d87CKwDsLAFjl/h8rv54bCYCLADCh5c7cOABULVrd8z4AjAbAKAC8u6HFvgAAIyJ9PeBspLx7goYEINEQlAAQVgJAWAmAsxAhVeGpATnj04IUbqQFGbQggxZk0IIMWpBBCzJoQQYtyKAFGbQggxZksAgbLMIGLchgETZoQQaLsMEibLAIG7Qgg0XYoAUZtCCDFmTQggxakEELMmouy1ZL5zqolPd0y2Oq/Acsyt0HTMHHh7mGnqaGPk0NHSWdc1Ep767mSoZ/BsCH8JsCG7FeNmKLpHMuKsJZW+HwXR8j/PcLnoq4QzrnoiKcxcPwCdCEPwHbAgBO8QkI70MehDMKb1XFn2YMxPU3b5kIgL8LANjOGhD+t3IR0iX4amwE4G2FAMbWNkwHwPwht6Ab7QUAuAYATQBYAIBPFm1BtdkZ0rmKSHmPrRZ+Cj4hPVdsRNhf9gFwg/RcsZEbtg+Au6Tnio0Ie5H6/4s8j0jPFRsp/zuq09JznbMivDr88hCr6Esb9jl1QdbQhhb70LzF9jzpfCoqghuDfx/AXuDI6m2vXBL4PqDZ/sOcpu7w3nYyVBFcIz4WAAAbj1//gnM84I3YMQA0SudUMSnvfW+5AAC4zwzXAOBIwAB6ADBTOqeKiuA2K+91kkOFsAQAewIE8M68ZnuLdD4Vl/KuGSzs2+GaJfpFHwApACwBQAoAKQCkAJACQAoAKQCkAJACwP0A+BoAtgxwb+jmhlZ72fwldnjP9UuKsG/0AfAz6bliI8K+ygeAu5Yk9/AMhwj6UuX/tsQPSs8WCxH0OHzQB8D10rPFQgQ9Aj/jA+BZ6dkiJ0IdqbwbfN3TFf2fF/Z7xcH/NmS0oF8O8pzwQVpQR9um3Ejp4wu9lPeMQanXld2HQZpv3+38oIR9gPve0C9JH1/oRaBHy9yQZTp2OXPXdeZPlvDaykPSxxd6EeiRMgGcvHjusskA+F0JAF6WPr7Qi0BX4RNlQtjavrO7GQC9g7w3tE36+EIv5T1ls0x5L/TYVuCXigB4a3R13Ufa087DADgAgAMAOACAXwBgf98bs1pZhOP1dEvQIugZ+I0iEP6IJ/b7t251na28W1vC+1zXuSTl3fj1kwG+in6DP4+vwd/APcp7u9bj0rNHRoS5rsz1wf3dgc9Kzx0ZEWZNGfsE139RyS9rBCvl/VZkqQCSW1iClvJeBlLKDcDupctJ0vNGTsr7NaXDJQDYKT1rZKW8p3EGejGI24CukJ4zsurr+XsGAPBV6RkjL+VdqPG70WsHfo/0fLGQ8h6J/bbyzh/l8X0q+W354ZdKLtAnSpQoUaJEicrRfwFj5g/5zsKE0wAAAABJRU5ErkJggg==",ha=({sseEndpoint:s,setSseEndpoint:p,isConnected:d})=>{const[b,O]=Q.useState(!1),[A,C]=Q.useState(s);Q.useEffect(()=>{if(typeof window<"u"){const T=localStorage.getItem("sseEndpoint");!s&&T&&(C(T),p(T))}},[s,p]);const E=()=>{typeof window<"u"&&localStorage.setItem("sseEndpoint",A),p(A),O(!1)};return y.jsxs("div",{className:"fixed bottom-0 left-0 w-full",children:[y.jsxs("div",{className:"flex items-center justify-between bg-gray-200 px-4 py-2 w-full cursor-pointer select-none",onClick:()=>O(T=>!T),children:[y.jsx("div",{className:"flex items-center gap-4",children:y.jsxs("span",{className:`px-2 py-1 rounded-full text-xs font-semibold flex items-center ${d?"bg-green-500 text-white":"bg-red-500"}`,children:[y.jsx("span",{className:`w-2 h-2 rounded-full mr-1 ${d?"bg-green-800":"bg-red-800"}`}),d?"Connected":"Disconnected"]})}),y.jsxs("a",{href:"https://github.com/thim81/inspectr",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[y.jsx("img",{src:da,alt:"Inspectr Logo",className:"h-6"}),y.jsx("span",{className:"text-gray-700 font-semibold text-sm",children:"Inspectr"})]})]}),y.jsx("div",{className:`bg-gray-100 border-t border-gray-300 transition-all duration-300 overflow-hidden ${b?"max-h-40 opacity-100 py-4":"max-h-0 opacity-0 py-0"}`,children:y.jsxs("div",{className:"px-6",children:[y.jsxs("div",{className:"grid grid-cols-2 gap-4 items-center",children:[y.jsx("div",{children:y.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Configuration"})}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("label",{className:"text-gray-700 font-semibold whitespace-nowrap",children:"SSE Endpoint:"}),y.jsx("input",{type:"text",value:A,onChange:T=>C(T.target.value),className:"border p-2 rounded flex-1 bg-white",placeholder:"Enter SSE Endpoint..."})]})]}),y.jsx("div",{className:"flex justify-end mt-4",children:y.jsx("button",{onClick:E,className:"bg-green-600 text-white px-4 py-2 rounded-md",children:"Apply"})})]})})]})};class pa{constructor(){this.db=new gn("InspectrDB"),this.db.version(1).stores({events:"id, time, method, statusCode, path, latency, server"})}transformEvent(p){var d;const{id:b,time:O,data:A}=p;return{id:b,time:O,method:A.method,url:A.url,server:A.server,path:A.path,clientIp:A.clientIp,latency:A.latency,statusCode:(d=A.response)==null?void 0:d.statusCode,raw:p}}async upsertEvent(p){const d=this.transformEvent(p);return await this.db.events.put(d)}async deleteEvent(p){return await this.db.events.delete(p)}async getEvent(p){return await this.db.events.get(p)}async queryEvents(p={}){const{filters:d={},sort:b={field:"time",order:"desc"},page:O=1,pageSize:A=20}=p;await this.db.events.count();let C=this.db.events.toCollection();if(await C.toArray(),d.timestampRange){let M=new Date;if(d.timestampRange==="24H")M.setHours(M.getHours()-24);else if(d.timestampRange==="48H")M.setHours(M.getHours()-48);else if(d.timestampRange==="week")M.setDate(M.getDate()-7);else if(d.timestampRange==="month")M.setMonth(M.getMonth()-1);else if(d.timestampRange.start&&d.timestampRange.end){const ie=new Date(d.timestampRange.start),pe=new Date(d.timestampRange.end);C=C.filter(ae=>{const ge=new Date(ae.time);return ge>=ie&&ge<=pe})}["24H","48H","week","month"].includes(d.timestampRange)&&(C=C.filter(ie=>new Date(ie.time)>=M))}d.status!==void 0&&d?.status.length>2&&(C=C.filter(M=>Number(M.statusCode)===Number(d.status))),d.method&&(C=C.filter(M=>M.method.toLowerCase()===d.method.toLowerCase())),d.path&&(C=C.filter(M=>M.path.includes(d.path))),d.durationMin&&(C=C.filter(M=>Number(M.latency)>=Number(d.durationMin))),d.durationMax&&(C=C.filter(M=>Number(M.latency)<=Number(d.durationMax))),d.host&&(C=C.filter(M=>M.server.toLowerCase().includes(d.host.toLowerCase())));let E;if(typeof C.orderBy=="function")try{E=C.orderBy(b.field),b.order==="desc"&&(E=E.reverse())}catch(M){console.error("[EventDB] orderBy error, fallback sorting:",M),E=(await C.toArray()).sort((ie,pe)=>{const ae=b.field;return ie[ae]<pe[ae]?b.order==="asc"?-1:1:ie[ae]>pe[ae]?b.order==="asc"?1:-1:0})}else E=(await C.toArray()).sort((M,ie)=>{const pe=b.field;return M[pe]<ie[pe]?b.order==="asc"?-1:1:M[pe]>ie[pe]?b.order==="asc"?1:-1:0});let T;Array.isArray(E)?T=E:T=await E.toArray();const L=(O-1)*A;let z;return Array.isArray(E)?z=T.slice(L,L+A):typeof E.offset=="function"?z=await E.offset(L).limit(A).toArray():z=[],z.map(M=>({id:M.id,...M.raw.data}))}async clearEvents(){return await this.db.events.clear()}}const Rt=new pa,Aa=({sseEndpoint:s})=>{const[p,d]=Q.useState(null),[b,O]=Q.useState("request"),[A,C]=Q.useState("/api/sse"),[E,T]=Q.useState(!1),L=100,[z,M]=Q.useState(1),[ie,pe]=Q.useState("time"),[ae,ge]=Q.useState("desc"),[Ce,Ie]=Q.useState({}),re=Jr(()=>Rt.queryEvents({sort:{field:ie,order:ae},filters:Ce,page:z,pageSize:L}),[z,ie,ae,Ce]),be=Jr(()=>Rt.db.events.count(),[]),Ae=be?Math.ceil(be/L):1;Q.useEffect(()=>{if(typeof window<"u"){const V=localStorage.getItem("sseEndpoint");!s&&V&&C(V)}},[s]),Q.useEffect(()=>{const V=()=>`req-${Math.random().toString(36).substr(2,9)}`,_e=new EventSource(A);return console.log(`Inspectr EventSource created with URL: ${A}`),_e.onopen=()=>{console.log("SSE Inspectr connection opened"),T(!0)},_e.onmessage=fe=>{try{const Y=JSON.parse(fe.data);Y.id||(Y.id=V()),Rt.upsertEvent(Y).catch(qe=>console.error("Error saving event to DB:",qe))}catch(Y){console.error("Error parsing SSE Inspectr data:",Y)}},_e.onerror=fe=>{console.error("SSE Inspectr error:",fe),T(!1)},()=>{console.log("Closing Inspectr EventSource"),_e.close(),T(!1)}},[A]),Q.useEffect(()=>{!p&&re&&re.length>0&&d(re[0])},[re,p]);const le=()=>{d(null),Rt.clearEvents().catch(V=>console.error("Error clearing events from DB:",V))},te=V=>{p&&(p.id||"")===V&&d(null),Rt.deleteEvent(V).catch(_e=>console.error("Error deleting event from DB:",_e))};return y.jsxs("div",{className:"flex flex-col h-screen",children:[y.jsxs("div",{className:"flex flex-grow",children:[y.jsx("div",{className:"w-1/3 border-r border-gray-300 overflow-y-auto",children:y.jsx(ni,{requests:re||[],onSelect:d,onRemove:te,clearRequests:le,selectedRequest:p,currentPage:z,totalPages:Ae,totalCount:be||0,onPageChange:M,sortField:ie,sortDirection:ae,filters:Ce,setSortField:pe,setSortDirection:ge,setFilters:Ie})}),y.jsx("div",{className:"w-2/3 p-4",children:y.jsx(fa,{request:p,currentTab:b,setCurrentTab:O})})]}),y.jsx(ha,{sseEndpoint:A,setSseEndpoint:C,isConnected:E})]})};export{Aa as InspectrApp};
|