@inspectr/ui 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(k,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],l):(k=typeof globalThis<"u"?globalThis:k||self,l(k.InspectrUI={},k.React))})(this,function(k,l){"use strict";var ge={exports:{}},se={};/**
1
+ (function(Re,q){typeof exports=="object"&&typeof module<"u"?q(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],q):(Re=typeof globalThis<"u"?globalThis:Re||self,q(Re.InspectrUI={},Re.React))})(this,function(Re,q){"use strict";var So=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Po(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var tn={exports:{}},It={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Se;function ct(){if(Se)return se;Se=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(o,s,i){var d=null;if(i!==void 0&&(d=""+i),s.key!==void 0&&(d=""+s.key),"key"in s){i={};for(var f in s)f!=="key"&&(i[f]=s[f])}else i=s;return s=i.ref,{$$typeof:e,type:o,key:d,ref:s!==void 0?s:null,props:i}}return se.Fragment=r,se.jsx=n,se.jsxs=n,se}var ie={};/**
9
+ */var wr;function No(){if(wr)return It;wr=1;var s=Symbol.for("react.transitional.element"),p=Symbol.for("react.fragment");function h(b,O,k){var S=null;if(k!==void 0&&(S=""+k),O.key!==void 0&&(S=""+O.key),"key"in O){k={};for(var P in O)P!=="key"&&(k[P]=O[P])}else k=O;return O=k.ref,{$$typeof:s,type:b,key:S,ref:O!==void 0?O:null,props:k}}return It.Fragment=p,It.jsx=h,It.jsxs=h,It}var Dt={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,22 +14,26 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Oe;function ut(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&function(){function e(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===K?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case C:return"Portal";case G:return"Profiler";case w:return"StrictMode";case X:return"Suspense";case $:return"SuspenseList"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case v:return(t.displayName||"Context")+".Provider";case S:return(t._context.displayName||"Context")+".Consumer";case W:var c=t.render;return t=t.displayName,t||(t=c.displayName||c.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case U:return c=t.displayName||null,c!==null?c:e(t.type)||"Memo";case g:c=t._payload,t=t._init;try{return e(t(c))}catch{}}return null}function r(t){return""+t}function n(t){try{r(t);var c=!1}catch{c=!0}if(c){c=console;var u=c.error,b=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return u.call(c,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),r(t)}}function o(){}function s(){if(F===0){Y=console.log,$e=console.info,Ke=console.warn,et=console.error,tt=console.group,rt=console.groupCollapsed,nt=console.groupEnd;var t={configurable:!0,enumerable:!0,value:o,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}F++}function i(){if(F--,F===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:h({},t,{value:Y}),info:h({},t,{value:$e}),warn:h({},t,{value:Ke}),error:h({},t,{value:et}),group:h({},t,{value:tt}),groupCollapsed:h({},t,{value:rt}),groupEnd:h({},t,{value:nt})})}0>F&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function d(t){if(Ee===void 0)try{throw Error()}catch(u){var c=u.stack.trim().match(/\n( *(at )?)/);Ee=c&&c[1]||"",ot=-1<u.stack.indexOf(`
18
- at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
19
- `+Ee+t+ot}function f(t,c){if(!t||Ce)return"";var u=Ne.get(t);if(u!==void 0)return u;Ce=!0,u=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var b=null;b=J.H,J.H=null,s();try{var M={DetermineComponentFrameRoot:function(){try{if(c){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(_){var xe=_}Reflect.construct(t,[],ee)}else{try{ee.call()}catch(_){xe=_}t.call(ee.prototype)}}else{try{throw Error()}catch(_){xe=_}(ee=t())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(_){if(_&&xe&&typeof _.stack=="string")return[_.stack,xe.stack]}return[null,null]}};M.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(M.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(M.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=M.DetermineComponentFrameRoot(),V=m[0],ae=m[1];if(V&&ae){var L=V.split(`
20
- `),ne=ae.split(`
21
- `);for(m=y=0;y<L.length&&!L[y].includes("DetermineComponentFrameRoot");)y++;for(;m<ne.length&&!ne[m].includes("DetermineComponentFrameRoot");)m++;if(y===L.length||m===ne.length)for(y=L.length-1,m=ne.length-1;1<=y&&0<=m&&L[y]!==ne[m];)m--;for(;1<=y&&0<=m;y--,m--)if(L[y]!==ne[m]){if(y!==1||m!==1)do if(y--,m--,0>m||L[y]!==ne[m]){var fe=`
22
- `+L[y].replace(" at new "," at ");return t.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",t.displayName)),typeof t=="function"&&Ne.set(t,fe),fe}while(1<=y&&0<=m);break}}}finally{Ce=!1,J.H=b,i(),Error.prepareStackTrace=u}return L=(L=t?t.displayName||t.name:"")?d(L):"",typeof t=="function"&&Ne.set(t,L),L}function p(t){if(t==null)return"";if(typeof t=="function"){var c=t.prototype;return f(t,!(!c||!c.isReactComponent))}if(typeof t=="string")return d(t);switch(t){case X:return d("Suspense");case $:return d("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case W:return t=f(t.render,!1),t;case U:return p(t.type);case g:c=t._payload,t=t._init;try{return p(t(c))}catch{}}return""}function x(){var t=J.A;return t===null?null:t.getOwner()}function N(t){if(ve.call(t,"key")){var c=Object.getOwnPropertyDescriptor(t,"key").get;if(c&&c.isReactWarning)return!1}return t.key!==void 0}function R(t,c){function u(){at||(at=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",c))}u.isReactWarning=!0,Object.defineProperty(t,"key",{get:u,configurable:!0})}function te(){var t=e(this.type);return st[t]||(st[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function Q(t,c,u,b,M,y){return u=y.ref,t={$$typeof:q,type:t,key:c,props:y,_owner:M},(u!==void 0?u:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:te}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function B(t,c,u,b,M,y){if(typeof t=="string"||typeof t=="function"||t===E||t===G||t===w||t===X||t===$||t===j||typeof t=="object"&&t!==null&&(t.$$typeof===g||t.$$typeof===U||t.$$typeof===v||t.$$typeof===S||t.$$typeof===W||t.$$typeof===A||t.getModuleId!==void 0)){var m=c.children;if(m!==void 0)if(b)if(O(m)){for(b=0;b<m.length;b++)z(m[b],t);Object.freeze&&Object.freeze(m)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else z(m,t)}else m="",(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(m+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),t===null?b="null":O(t)?b="array":t!==void 0&&t.$$typeof===q?(b="<"+(e(t.type)||"Unknown")+" />",m=" Did you accidentally export a JSX literal instead of a component?"):b=typeof t,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,m);if(ve.call(c,"key")){m=e(t);var V=Object.keys(c).filter(function(L){return L!=="key"});b=0<V.length?"{key: someKey, "+V.join(": ..., ")+": ...}":"{key: someKey}",it[m+b]||(V=0<V.length?"{"+V.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var jr;function To(){return jr||(jr=1,process.env.NODE_ENV!=="production"&&function(){function s(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Me?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case ae:return"Fragment";case ve:return"Portal";case Se:return"Profiler";case $:return"StrictMode";case Le:return"Suspense";case Ke:return"SuspenseList"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case te:return(l.displayName||"Context")+".Provider";case ge:return(l._context.displayName||"Context")+".Consumer";case qe:var z=l.render;return l=l.displayName,l||(l=z.displayName||z.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case nt:return z=l.displayName||null,z!==null?z:s(l.type)||"Memo";case Y:z=l._payload,l=l._init;try{return s(l(z))}catch{}}return null}function p(l){return""+l}function h(l){try{p(l);var z=!1}catch{z=!0}if(z){z=console;var L=z.error,ie=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return L.call(z,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ie),p(l)}}function b(){}function O(){if(Qe===0){Ue=console.log,at=console.info,Ot=console.warn,cn=console.error,H=console.group,Qt=console.groupCollapsed,gt=console.groupEnd;var l={configurable:!0,enumerable:!0,value:b,writable:!0};Object.defineProperties(console,{info:l,log:l,warn:l,error:l,group:l,groupCollapsed:l,groupEnd:l})}Qe++}function k(){if(Qe--,Qe===0){var l={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Z({},l,{value:Ue}),info:Z({},l,{value:at}),warn:Z({},l,{value:Ot}),error:Z({},l,{value:cn}),group:Z({},l,{value:H}),groupCollapsed:Z({},l,{value:Qt}),groupEnd:Z({},l,{value:gt})})}0>Qe&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function S(l){if(se===void 0)try{throw Error()}catch(L){var z=L.stack.trim().match(/\n( *(at )?)/);se=z&&z[1]||"",lt=-1<L.stack.indexOf(`
18
+ at`)?" (<anonymous>)":-1<L.stack.indexOf("@")?"@unknown:0:0":""}return`
19
+ `+se+l+lt}function P(l,z){if(!l||Ut)return"";var L=rt.get(l);if(L!==void 0)return L;Ut=!0,L=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var ie=null;ie=Ee.H,Ee.H=null,O();try{var we={DetermineComponentFrameRoot:function(){try{if(z){var Ge=function(){throw Error()};if(Object.defineProperty(Ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ge,[])}catch(Pe){var ft=Pe}Reflect.construct(l,[],Ge)}else{try{Ge.call()}catch(Pe){ft=Pe}l.call(Ge.prototype)}}else{try{throw Error()}catch(Pe){ft=Pe}(Ge=l())&&typeof Ge.catch=="function"&&Ge.catch(function(){})}}catch(Pe){if(Pe&&ft&&typeof Pe.stack=="string")return[Pe.stack,ft.stack]}return[null,null]}};we.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var ce=Object.getOwnPropertyDescriptor(we.DetermineComponentFrameRoot,"name");ce&&ce.configurable&&Object.defineProperty(we.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var J=we.DetermineComponentFrameRoot(),Ye=J[0],Ze=J[1];if(Ye&&Ze){var Oe=Ye.split(`
20
+ `),et=Ze.split(`
21
+ `);for(J=ce=0;ce<Oe.length&&!Oe[ce].includes("DetermineComponentFrameRoot");)ce++;for(;J<et.length&&!et[J].includes("DetermineComponentFrameRoot");)J++;if(ce===Oe.length||J===et.length)for(ce=Oe.length-1,J=et.length-1;1<=ce&&0<=J&&Oe[ce]!==et[J];)J--;for(;1<=ce&&0<=J;ce--,J--)if(Oe[ce]!==et[J]){if(ce!==1||J!==1)do if(ce--,J--,0>J||Oe[ce]!==et[J]){var Je=`
22
+ `+Oe[ce].replace(" at new "," at ");return l.displayName&&Je.includes("<anonymous>")&&(Je=Je.replace("<anonymous>",l.displayName)),typeof l=="function"&&rt.set(l,Je),Je}while(1<=ce&&0<=J);break}}}finally{Ut=!1,Ee.H=ie,k(),Error.prepareStackTrace=L}return Oe=(Oe=l?l.displayName||l.name:"")?S(Oe):"",typeof l=="function"&&rt.set(l,Oe),Oe}function M(l){if(l==null)return"";if(typeof l=="function"){var z=l.prototype;return P(l,!(!z||!z.isReactComponent))}if(typeof l=="string")return S(l);switch(l){case Le:return S("Suspense");case Ke:return S("SuspenseList")}if(typeof l=="object")switch(l.$$typeof){case qe:return l=P(l.render,!1),l;case nt:return M(l.type);case Y:z=l._payload,l=l._init;try{return M(l(z))}catch{}}return""}function Q(){var l=Ee.A;return l===null?null:l.getOwner()}function U(l){if(ze.call(l,"key")){var z=Object.getOwnPropertyDescriptor(l,"key").get;if(z&&z.isReactWarning)return!1}return l.key!==void 0}function W(l,z){function L(){ln||(ln=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",z))}L.isReactWarning=!0,Object.defineProperty(l,"key",{get:L,configurable:!0})}function G(){var l=s(this.type);return fn[l]||(fn[l]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),l=this.props.ref,l!==void 0?l:null}function Ae(l,z,L,ie,we,ce){return L=ce.ref,l={$$typeof:ke,type:l,key:z,props:ce,_owner:we},(L!==void 0?L:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:G}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function fe(l,z,L,ie,we,ce){if(typeof l=="string"||typeof l=="function"||l===ae||l===Se||l===$||l===Le||l===Ke||l===le||typeof l=="object"&&l!==null&&(l.$$typeof===Y||l.$$typeof===nt||l.$$typeof===te||l.$$typeof===ge||l.$$typeof===qe||l.$$typeof===pe||l.getModuleId!==void 0)){var J=z.children;if(J!==void 0)if(ie)if(be(J)){for(ie=0;ie<J.length;ie++)he(J[ie],l);Object.freeze&&Object.freeze(J)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else he(J,l)}else J="",(l===void 0||typeof l=="object"&&l!==null&&Object.keys(l).length===0)&&(J+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),l===null?ie="null":be(l)?ie="array":l!==void 0&&l.$$typeof===ke?(ie="<"+(s(l.type)||"Unknown")+" />",J=" Did you accidentally export a JSX literal instead of a component?"):ie=typeof l,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ie,J);if(ze.call(z,"key")){J=s(l);var Ye=Object.keys(z).filter(function(Oe){return Oe!=="key"});ie=0<Ye.length?"{key: someKey, "+Ye.join(": ..., ")+": ...}":"{key: someKey}",dn[J+ie]||(Ye=0<Ye.length?"{"+Ye.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
23
23
  let props = %s;
24
24
  <%s {...props} />
25
25
  React keys must be passed directly to JSX without using spread:
26
26
  let props = %s;
27
- <%s key={someKey} {...props} />`,b,m,V,m),it[m+b]=!0)}if(m=null,u!==void 0&&(n(u),m=""+u),N(c)&&(n(c.key),m=""+c.key),"key"in c){u={};for(var ae in c)ae!=="key"&&(u[ae]=c[ae])}else u=c;return m&&R(u,typeof t=="function"?t.displayName||t.name||"Unknown":t),Q(t,m,y,M,x(),u)}function z(t,c){if(typeof t=="object"&&t&&t.$$typeof!==jr){if(O(t))for(var u=0;u<t.length;u++){var b=t[u];P(b)&&H(b,c)}else if(P(t))t._store&&(t._store.validated=1);else if(t===null||typeof t!="object"?u=null:(u=D&&t[D]||t["@@iterator"],u=typeof u=="function"?u:null),typeof u=="function"&&u!==t.entries&&(u=u.call(t),u!==t))for(;!(t=u.next()).done;)P(t.value)&&H(t.value,c)}}function P(t){return typeof t=="object"&&t!==null&&t.$$typeof===q}function H(t,c){if(t._store&&!t._store.validated&&t.key==null&&(t._store.validated=1,c=T(c),!lt[c])){lt[c]=!0;var u="";t&&t._owner!=null&&t._owner!==x()&&(u=null,typeof t._owner.tag=="number"?u=e(t._owner.type):typeof t._owner.name=="string"&&(u=t._owner.name),u=" It was passed a child from "+u+".");var b=J.getCurrentStack;J.getCurrentStack=function(){var M=p(t.type);return b&&(M+=b()||""),M},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',c,u),J.getCurrentStack=b}}function T(t){var c="",u=x();return u&&(u=e(u.type))&&(c=`
27
+ <%s key={someKey} {...props} />`,ie,J,Ye,J),dn[J+ie]=!0)}if(J=null,L!==void 0&&(h(L),J=""+L),U(z)&&(h(z.key),J=""+z.key),"key"in z){L={};for(var Ze in z)Ze!=="key"&&(L[Ze]=z[Ze])}else L=z;return J&&W(L,typeof l=="function"?l.displayName||l.name||"Unknown":l),Ae(l,J,ce,we,Q(),L)}function he(l,z){if(typeof l=="object"&&l&&l.$$typeof!==zn){if(be(l))for(var L=0;L<l.length;L++){var ie=l[L];me(ie)&&We(ie,z)}else if(me(l))l._store&&(l._store.validated=1);else if(l===null||typeof l!="object"?L=null:(L=He&&l[He]||l["@@iterator"],L=typeof L=="function"?L:null),typeof L=="function"&&L!==l.entries&&(L=L.call(l),L!==l))for(;!(l=L.next()).done;)me(l.value)&&We(l.value,z)}}function me(l){return typeof l=="object"&&l!==null&&l.$$typeof===ke}function We(l,z){if(l._store&&!l._store.validated&&l.key==null&&(l._store.validated=1,z=de(z),!Ct[z])){Ct[z]=!0;var L="";l&&l._owner!=null&&l._owner!==Q()&&(L=null,typeof l._owner.tag=="number"?L=s(l._owner.type):typeof l._owner.name=="string"&&(L=l._owner.name),L=" It was passed a child from "+L+".");var ie=Ee.getCurrentStack;Ee.getCurrentStack=function(){var we=M(l.type);return ie&&(we+=ie()||""),we},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',z,L),Ee.getCurrentStack=ie}}function de(l){var z="",L=Q();return L&&(L=s(L.type))&&(z=`
28
28
 
29
- Check the render method of \``+u+"`."),c||(t=e(t))&&(c=`
29
+ Check the render method of \``+L+"`."),z||(l=s(l))&&(z=`
30
30
 
31
- Check the top-level render call using <`+t+">."),c}var re=l,q=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),v=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),j=Symbol.for("react.offscreen"),D=Symbol.iterator,K=Symbol.for("react.client.reference"),J=re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve=Object.prototype.hasOwnProperty,h=Object.assign,A=Symbol.for("react.client.reference"),O=Array.isArray,F=0,Y,$e,Ke,et,tt,rt,nt;o.__reactDisabledLog=!0;var Ee,ot,Ce=!1,Ne=new(typeof WeakMap=="function"?WeakMap:Map),jr=Symbol.for("react.client.reference"),at,st={},it={},lt={};ie.Fragment=E,ie.jsx=function(t,c,u,b,M){return B(t,c,u,!1,b,M)},ie.jsxs=function(t,c,u,b,M){return B(t,c,u,!0,b,M)}}()),ie}var Re;function dt(){return Re||(Re=1,process.env.NODE_ENV==="production"?ge.exports=ct():ge.exports=ut()),ge.exports}var a=dt();const je=e=>e>=200&&e<300?"bg-green-200 text-green-800":e>=300&&e<400?"bg-blue-200 text-blue-800":e>=400&&e<500?"bg-orange-600 text-orange-200":e>=500?"bg-red-800 text-red-100":"bg-gray-200 text-gray-800",ft=["bg-blue-100","border-l-4","border-blue-700"].join(" "),Pe=({request:e,reqId:r,onSelect:n,onRemove:o,selected:s})=>{const i=d=>{n(d)};return a.jsx("li",{className:`flex items-center cursor-pointer hover:bg-gray-200 ${s?ft:""}`,onClick:()=>{i(e)},children:a.jsxs("div",{className:"flex items-center p-2 w-full",children:[a.jsx("div",{className:"w-16 flex justify-center",children:a.jsx("span",{className:`inline-flex px-3 py-1 text-xs font-semibold rounded-full ${je(e.response.status)}`,children:e.response.status||"N/A"})}),a.jsx("div",{className:"w-20 text-center font-medium",children:e.request.method||"GET"}),a.jsx("div",{className:"flex-grow truncate text-left",children:e.endpoint||e.url}),a.jsxs("div",{className:"w-20 text-gray-500 text-center",children:[e.latency,"ms"]}),a.jsx("button",{className:"w-8 h-8 flex items-center justify-center text-red-500 hover:text-red-700",onClick:d=>{d.stopPropagation(),o(r)},children:"✕"})]})})},Te=({requests:e,onSelect:r,onRemove:n,clearRequests:o,selectedRequest:s})=>a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"p-4 flex justify-between items-center",children:[a.jsxs("span",{className:"font-bold text-xl",children:["Requests (",e.length,")"]}),a.jsx("button",{className:"px-3 py-1 bg-red-500 text-white rounded text-xs",onClick:o,children:"Clear All"})]}),a.jsxs("div",{className:"flex items-center bg-gray-200 p-2 border-b border-gray-300 text-sm font-bold",children:[a.jsx("div",{className:"w-16 text-center",children:"Status"}),a.jsx("div",{className:"w-20 text-center",children:"Method"}),a.jsx("div",{className:"flex-grow text-left",children:"URL"}),a.jsx("div",{className:"w-20 text-center",children:"Duration"}),a.jsx("div",{className:"w-10"})]}),a.jsx("ul",{className:"overflow-y-auto flex-grow",style:{maxHeight:"calc(100vh - 40px - 100px)"},children:e.map((i,d)=>{const f=i.id||d;return a.jsx(Pe,{reqId:f,request:i,onSelect:r,onRemove:n,selected:s&&s.id===f},f)})})]}),Me=({request:e})=>{const r=n=>{if(!n)return"N/A";const o=new Date(n),s=o.toLocaleDateString("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}),i=o.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return`${s} at ${i}`};return a.jsxs("div",{className:"mb-4 p-4 bg-white rounded shadow",children:[a.jsx("h2",{className:"font-bold text-lg mb-2",children:"Request Details"}),a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsxs("div",{className:"flex items-center space-x-2 font-mono text-lg",children:[a.jsx("span",{className:"font-bold",children:e.request.method}),a.jsx("span",{className:"text-blue-600",children:e.endpoint}),a.jsx("span",{className:`inline-flex px-3 py-1 text-xs font-semibold rounded-full ${je(e.response.status)}`,children:e.response.status})]}),a.jsx("div",{className:"text-gray-600",children:e.url}),a.jsxs("div",{className:"text-gray-500 text-xs",children:["Received on ",r(e.timestamp)," • Took ",e.latency,"ms to respond"]})]})]})};function gt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function ke(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function Le(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?ke(Object(n),!0).forEach(function(o){gt(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function pt(e,r){if(e==null)return{};var n={},o=Object.keys(e),s,i;for(i=0;i<o.length;i++)s=o[i],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}function mt(e,r){if(e==null)return{};var n=pt(e,r),o,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)o=i[s],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function ht(e,r){return bt(e)||vt(e,r)||xt(e,r)||jt()}function bt(e){if(Array.isArray(e))return e}function vt(e,r){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],o=!0,s=!1,i=void 0;try{for(var d=e[Symbol.iterator](),f;!(o=(f=d.next()).done)&&(n.push(f.value),!(r&&n.length===r));o=!0);}catch(p){s=!0,i=p}finally{try{!o&&d.return!=null&&d.return()}finally{if(s)throw i}}return n}}function xt(e,r){if(e){if(typeof e=="string")return Qe(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qe(e,r)}}function Qe(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function jt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
32
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function At(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Ie(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function Be(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ie(Object(n),!0).forEach(function(o){At(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function yt(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(o){return r.reduceRight(function(s,i){return i(s)},o)}}function le(e){return function r(){for(var n=this,o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];return s.length>=e.length?e.apply(this,s):function(){for(var d=arguments.length,f=new Array(d),p=0;p<d;p++)f[p]=arguments[p];return r.apply(n,[].concat(s,f))}}}function pe(e){return{}.toString.call(e).includes("Object")}function wt(e){return!Object.keys(e).length}function ce(e){return typeof e=="function"}function Et(e,r){return Object.prototype.hasOwnProperty.call(e,r)}function Ct(e,r){return pe(r)||Z("changeType"),Object.keys(r).some(function(n){return!Et(e,n)})&&Z("changeField"),r}function Nt(e){ce(e)||Z("selectorType")}function St(e){ce(e)||pe(e)||Z("handlerType"),pe(e)&&Object.values(e).some(function(r){return!ce(r)})&&Z("handlersType")}function Ot(e){e||Z("initialIsRequired"),pe(e)||Z("initialType"),wt(e)&&Z("initialContent")}function Rt(e,r){throw new Error(e[r]||e.default)}var Pt={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"},Z=le(Rt)(Pt),me={changes:Ct,selector:Nt,handler:St,initial:Ot};function Tt(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};me.initial(e),me.handler(r);var n={current:e},o=le(Lt)(n,r),s=le(kt)(n),i=le(me.changes)(e),d=le(Mt)(n);function f(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(N){return N};return me.selector(x),x(n.current)}function p(x){yt(o,s,i,d)(x)}return[f,p]}function Mt(e,r){return ce(r)?r(e.current):r}function kt(e,r){return e.current=Be(Be({},e.current),r),r}function Lt(e,r,n){return ce(r)?r(e.current):Object.keys(n).forEach(function(o){var s;return(s=r[o])===null||s===void 0?void 0:s.call(r,e.current[o])}),n}var Qt={create:Tt},It={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function Bt(e){return function r(){for(var n=this,o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];return s.length>=e.length?e.apply(this,s):function(){for(var d=arguments.length,f=new Array(d),p=0;p<d;p++)f[p]=arguments[p];return r.apply(n,[].concat(s,f))}}}function zt(e){return{}.toString.call(e).includes("Object")}function Jt(e){return e||Je("configIsRequired"),zt(e)||Je("configType"),e.urls?(qt(),{paths:{vs:e.urls.monacoBase}}):e}function qt(){console.warn(ze.deprecation)}function Dt(e,r){throw new Error(e[r]||e.default)}var ze={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!
31
+ Check the top-level render call using <`+l+">."),z}var Ce=q,ke=Symbol.for("react.transitional.element"),ve=Symbol.for("react.portal"),ae=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),Se=Symbol.for("react.profiler"),ge=Symbol.for("react.consumer"),te=Symbol.for("react.context"),qe=Symbol.for("react.forward_ref"),Le=Symbol.for("react.suspense"),Ke=Symbol.for("react.suspense_list"),nt=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),He=Symbol.iterator,Me=Symbol.for("react.client.reference"),Ee=Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ze=Object.prototype.hasOwnProperty,Z=Object.assign,pe=Symbol.for("react.client.reference"),be=Array.isArray,Qe=0,Ue,at,Ot,cn,H,Qt,gt;b.__reactDisabledLog=!0;var se,lt,Ut=!1,rt=new(typeof WeakMap=="function"?WeakMap:Map),zn=Symbol.for("react.client.reference"),ln,fn={},dn={},Ct={};Dt.Fragment=ae,Dt.jsx=function(l,z,L,ie,we){return fe(l,z,L,!1,ie,we)},Dt.jsxs=function(l,z,L,ie,we){return fe(l,z,L,!0,ie,we)}}()),Dt}var _r;function Ro(){return _r||(_r=1,process.env.NODE_ENV==="production"?tn.exports=No():tn.exports=To()),tn.exports}var y=Ro(),nn={exports:{}},Ko=nn.exports,Ar;function Mo(){return Ar||(Ar=1,function(s,p){(function(h,b){s.exports=b()})(Ko,function(){var h=function(e,t){return(h=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 k=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:So,S=Object.keys,P=Array.isArray;function M(e,t){return typeof t!="object"||S(t).forEach(function(n){e[n]=t[n]}),e}typeof Promise>"u"||k.Promise||(k.Promise=Promise);var Q=Object.getPrototypeOf,U={}.hasOwnProperty;function W(e,t){return U.call(e,t)}function G(e,t){typeof t=="function"&&(t=t(Q(e))),(typeof Reflect>"u"?S:Reflect.ownKeys)(t).forEach(function(n){fe(e,n,t[n])})}var Ae=Object.defineProperty;function fe(e,t,n,r){Ae(e,t,M(n&&W(n,"get")&&typeof n.get=="function"?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function he(e){return{from:function(t){return e.prototype=Object.create(t.prototype),fe(e.prototype,"constructor",e),{extend:G.bind(null,e.prototype)}}}}var me=Object.getOwnPropertyDescriptor,We=[].slice;function de(e,t,n){return We.call(e,t,n)}function Ce(e,t){return t(e)}function ke(e){if(!e)throw new Error("Assertion Failed")}function ve(e){k.setImmediate?setImmediate(e):setTimeout(e,0)}function ae(e,t){if(typeof t=="string"&&W(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=ae(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:ae(u,t.substr(a+1))}}function $(e,t,n){if(e&&t!==void 0&&!("isFrozen"in Object&&Object.isFrozen(e)))if(typeof t!="string"&&"length"in t){ke(typeof n!="string"&&"length"in n);for(var r=0,o=t.length;r<o;++r)$(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?P(e)&&!isNaN(parseInt(i))?e.splice(i,1):delete e[i]:e[i]=n:$(u=!(u=e[i])||!W(e,i)?e[i]={}:u,a,n)):n===void 0?P(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function Se(e){var t,n={};for(t in e)W(e,t)&&(n[t]=e[t]);return n}var ge=[].concat;function te(e){return ge.apply([],e)}var ce="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(te([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return k[e]}),qe=new Set(ce.map(function(e){return k[e]})),Le=null;function Ke(e){return Le=new WeakMap,e=function t(n){if(!n||typeof n!="object")return n;var r=Le.get(n);if(r)return r;if(P(n)){r=[],Le.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=Q(n);for(a in r=u===Object.prototype?{}:Object.create(u),Le.set(n,r),n)W(n,a)&&(r[a]=t(n[a]))}return r}(e),Le=null,e}var nt={}.toString;function Y(e){return nt.call(e).slice(8,-1)}var le=typeof Symbol<"u"?Symbol.iterator:"@@iterator",He=typeof le=="symbol"?function(e){var t;return e!=null&&(t=e[le])&&t.apply(e)}:function(){return null};function Me(e,t){return t=e.indexOf(t),0<=t&&e.splice(t,1),0<=t}var Ee={};function ze(e){var t,n,r,o;if(arguments.length===1){if(P(e))return e.slice();if(this===Ee&&typeof e=="string")return[e];if(o=He(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 Z=typeof Symbol<"u"?function(e){return e[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},we=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],tt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(we),pe={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 be(e,t){this.name=e,this.message=t}function Qe(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(`
32
+ `)}function Ue(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=Qe(e,t)}function at(e,t){this.name="BulkError",this.failures=Object.keys(t).map(function(n){return t[n]}),this.failuresByPos=t,this.message=Qe(e,this.failures)}he(be).from(Error).extend({toString:function(){return this.name+": "+this.message}}),he(Ue).from(be),he(at).from(be);var Ot=tt.reduce(function(e,t){return e[t]=t+"Error",e},{}),cn=be,H=tt.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?`
33
+ `+i:""),this.inner=i||null):typeof o=="object"&&(this.message="".concat(o.name," ").concat(o.message),this.inner=o):(this.message=pe[t]||n,this.inner=null)}return he(r).from(cn),e[t]=r,e},{});H.Syntax=SyntaxError,H.Type=TypeError,H.Range=RangeError;var Qt=we.reduce(function(e,t){return e[t+"Error"]=H[t],e},{}),gt=tt.reduce(function(e,t){return["Syntax","Type","Range"].indexOf(t)===-1&&(e[t+"Error"]=H[t]),e},{});function se(){}function lt(e){return e}function Ut(e,t){return e==null||e===lt?t:function(n){return t(e(n))}}function rt(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function zn(e,t){return e===se?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?rt(r,this.onsuccess):r),o&&(this.onerror=this.onerror?rt(o,this.onerror):o),i!==void 0?i:n}}function ln(e,t){return e===se?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?rt(n,this.onsuccess):n),r&&(this.onerror=this.onerror?rt(r,this.onerror):r)}}function fn(e,t){return e===se?t:function(n){var r=e.apply(this,arguments);M(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?rt(o,this.onsuccess):o),i&&(this.onerror=this.onerror?rt(i,this.onerror):i),r===void 0?n===void 0?void 0:n:M(r,n)}}function dn(e,t){return e===se?t:function(){return t.apply(this,arguments)!==!1&&e.apply(this,arguments)}}function Ct(e,t){return e===se?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)}}gt.ModifyError=Ue,gt.DexieError=be,gt.BulkError=at;var l=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function z(e){l=e}var L={},ie=100,ce=typeof Promise>"u"?[]:function(){var e=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[e,Q(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,Q(t),e]}(),we=ce[0],tt=ce[1],ce=ce[2],tt=tt&&tt.then,J=we&&we.constructor,Ye=!!ce,Ze=function(e,t){Vt.push([e,t]),et&&(queueMicrotask(Ji),et=!1)},Oe=!0,et=!0,Je=[],Ge=[],ft=lt,Pe={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:se,pgp:!1,env:{},finalize:se},V=Pe,Vt=[],bt=0,hn=[];function B(e){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=V;if(typeof e!="function"){if(e!==L)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Un(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&&St();i&&typeof i.then=="function"?n(r,function(u,f){i instanceof B?i._then(u,f):i.then(u,f)}):(r._state=!0,r._value=i,Xr(r)),a&&Pt()}},Un.bind(null,r))}catch(i){Un(r,i)}}(this,e)}var Qn={get:function(){var e=V,t=vn;function n(r,o){var i=this,a=!e.global&&(e!==V||t!==vn),u=a&&!ht(),f=new B(function(m,x){Vn(i,new $r(eo(r,e,a,u),eo(o,e,a,u),m,x,e))});return this._consoleTask&&(f._consoleTask=this._consoleTask),f}return n.prototype=L,n},set:function(e){fe(this,"then",e&&e.prototype===L?Qn:{get:function(){return e},set:Qn.set})}};function $r(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 Un(e,t){var n,r;Ge.push(t),e._state===null&&(n=e._lib&&St(),t=ft(t),e._state=!1,e._value=t,r=e,Je.some(function(o){return o._value===r._value})||Je.push(r),Xr(e),n&&Pt())}function Xr(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)Vn(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),bt===0&&(++bt,Ze(function(){--bt==0&&Wn()},[]))}function Vn(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,++bt,Ze(Yi,[n,e,t])}else e._listeners.push(t)}function Yi(e,t,n){try{var r,o=t._value;!t._state&&Ge.length&&(Ge=[]),r=l&&t._consoleTask?t._consoleTask.run(function(){return e(o)}):e(o),t._state||Ge.indexOf(o)!==-1||function(i){for(var a=Je.length;a;)if(Je[--a]._value===i._value)return Je.splice(a,1)}(t),n.resolve(r)}catch(i){n.reject(i)}finally{--bt==0&&Wn(),--n.psd.ref||n.psd.finalize()}}function Ji(){xt(Pe,function(){St()&&Pt()})}function St(){var e=Oe;return et=Oe=!1,e}function Pt(){var e,t,n;do for(;0<Vt.length;)for(e=Vt,Vt=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(0<Vt.length);et=Oe=!0}function Wn(){var e=Je;Je=[],e.forEach(function(r){r._PSD.onunhandled.call(null,r._value,r)});for(var t=hn.slice(0),n=t.length;n;)t[--n]()}function pn(e){return new B(L,!1,e)}function xe(e,t){var n=V;return function(){var r=St(),o=V;try{return pt(n,!0),e.apply(this,arguments)}catch(i){t&&t(i)}finally{pt(o,!1),r&&Pt()}}}G(B.prototype,{then:Qn,_then:function(e,t){Vn(this,new $r(null,null,e,t,V))},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:pn)(r)}):this.then(null,function(r){return(r&&r.name===t?n:pn)(r)})},finally:function(e){return this.then(function(t){return B.resolve(e()).then(function(){return t})},function(t){return B.resolve(e()).then(function(){return pn(t)})})},timeout:function(e,t){var n=this;return e<1/0?new B(function(r,o){var i=setTimeout(function(){return o(new H.Timeout(t))},e);n.then(r,o).finally(clearTimeout.bind(null,i))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&fe(B.prototype,Symbol.toStringTag,"Dexie.Promise"),Pe.env=Zr(),G(B,{all:function(){var e=ze.apply(null,arguments).map(gn);return new B(function(t,n){e.length===0&&t([]);var r=e.length;e.forEach(function(o,i){return B.resolve(o).then(function(a){e[i]=a,--r||t(e)},n)})})},resolve:function(e){return e instanceof B?e:e&&typeof e.then=="function"?new B(function(t,n){e.then(t,n)}):new B(L,!0,e)},reject:pn,race:function(){var e=ze.apply(null,arguments).map(gn);return new B(function(t,n){e.map(function(r){return B.resolve(r).then(t,n)})})},PSD:{get:function(){return V},set:function(e){return V=e}},totalEchoes:{get:function(){return vn}},newPSD:dt,usePSD:xt,scheduler:{get:function(){return Ze},set:function(e){Ze=e}},rejectionMapper:{get:function(){return ft},set:function(e){ft=e}},follow:function(e,t){return new B(function(n,r){return dt(function(o,i){var a=V;a.unhandleds=[],a.onunhandled=i,a.finalize=rt(function(){var u,f=this;u=function(){f.unhandleds.length===0?o():i(f.unhandleds[0])},hn.push(function m(){u(),hn.splice(hn.indexOf(m),1)}),++bt,Ze(function(){--bt==0&&Wn()},[])},a.finalize),e()},t,n,r)})}}),J&&(J.allSettled&&fe(B,"allSettled",function(){var e=ze.apply(null,arguments).map(gn);return new B(function(t){e.length===0&&t([]);var n=e.length,r=new Array(n);e.forEach(function(o,i){return B.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)})})})}),J.any&&typeof AggregateError<"u"&&fe(B,"any",function(){var e=ze.apply(null,arguments).map(gn);return new B(function(t,n){e.length===0&&n(new AggregateError([]));var r=e.length,o=new Array(r);e.forEach(function(i,a){return B.resolve(i).then(function(u){return t(u)},function(u){o[a]=u,--r||n(new AggregateError(o))})})})}),J.withResolvers&&(B.withResolvers=J.withResolvers));var Ne={awaits:0,echoes:0,id:0},Gi=0,mn=[],yn=0,vn=0,$i=0;function dt(e,t,n,r){var o=V,i=Object.create(o);return i.parent=o,i.ref=0,i.global=!1,i.id=++$i,Pe.env,i.env=Ye?{Promise:B,PromiseProp:{value:B,configurable:!0,writable:!0},all:B.all,race:B.race,allSettled:B.allSettled,any:B.any,resolve:B.resolve,reject:B.reject}:{},t&&M(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()},r=xt(i,e,n,r),i.ref===0&&i.finalize(),r}function Nt(){return Ne.id||(Ne.id=++Gi),++Ne.awaits,Ne.echoes+=ie,Ne.id}function ht(){return!!Ne.awaits&&(--Ne.awaits==0&&(Ne.id=0),Ne.echoes=Ne.awaits*ie,!0)}function gn(e){return Ne.echoes&&e&&e.constructor===J?(Nt(),e.then(function(t){return ht(),t},function(t){return ht(),je(t)})):e}function Xi(){var e=mn[mn.length-1];mn.pop(),pt(e,!1)}function pt(e,t){var n,r=V;(t?!Ne.echoes||yn++&&e===V:!yn||--yn&&e===V)||queueMicrotask(t?(function(o){++vn,Ne.echoes&&--Ne.echoes!=0||(Ne.echoes=Ne.awaits=Ne.id=0),mn.push(V),pt(o,!0)}).bind(null,e):Xi),e!==V&&(V=e,r===Pe&&(Pe.env=Zr()),Ye&&(n=Pe.env.Promise,t=e.env,(r.global||e.global)&&(Object.defineProperty(k,"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 Zr(){var e=k.Promise;return Ye?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(k,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function xt(e,t,n,r,o){var i=V;try{return pt(e,!0),t(n,r,o)}finally{pt(i,!1)}}function eo(e,t,n,r){return typeof e!="function"?e:function(){var o=V;n&&Nt(),pt(t,!0);try{return e.apply(this,arguments)}finally{pt(o,!1),r&&queueMicrotask(ht)}}}function Hn(e){Promise===J&&Ne.echoes===0?yn===0?e():enqueueNativeMicroTask(e):setTimeout(e,0)}(""+tt).indexOf("[native code]")===-1&&(Nt=ht=se);var je=B.reject,wt="￿",st="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",to="String expected.",Tt=[],bn="__dbnames",Yn="readonly",Jn="readwrite";function jt(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var no={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function xn(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 ro(){throw H.Type()}function oe(e,t){try{var n=oo(e),r=oo(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,f=a<u?a:u,m=0;m<f;++m)if(o[m]!==i[m])return o[m]<i[m]?-1:1;return a===u?0:a<u?-1:1}(io(e),io(t));case"Array":return function(o,i){for(var a=o.length,u=i.length,f=a<u?a:u,m=0;m<f;++m){var x=oe(o[m],i[m]);if(x!==0)return x}return a===u?0:a<u?-1:1}(e,t)}}catch{}return NaN}function oo(e){var t=typeof e;return t!="object"?t:ArrayBuffer.isView(e)?"binary":(e=Y(e),e==="ArrayBuffer"?"binary":e)}function io(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var ao=(ye.prototype._trans=function(e,t,n){var r=this._tx||V.trans,o=this.name,i=l&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(e==="readonly"?"read":"write"," ").concat(this.name));function a(m,x,c){if(!c.schema[o])throw new H.NotFound("Table "+o+" not part of transaction");return t(c.idbtrans,c)}var u=St();try{var f=r&&r.db._novip===this.db._novip?r===V.trans?r._promise(e,a,n):dt(function(){return r._promise(e,a,n)},{trans:r,transless:V.transless||V}):function m(x,c,j,d){if(x.idbdb&&(x._state.openComplete||V.letThrough||x._vip)){var g=x._createTransaction(c,j,x._dbSchema);try{g.create(),x._state.PR1398_maxLoop=3}catch(w){return w.name===Ot.InvalidState&&x.isOpen()&&0<--x._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),x.close({disableAutoOpen:!1}),x.open().then(function(){return m(x,c,j,d)})):je(w)}return g._promise(c,function(w,v){return dt(function(){return V.trans=g,d(w,v,g)})}).then(function(w){if(c==="readwrite")try{g.idbtrans.commit()}catch{}return c==="readonly"?w:g._completion.then(function(){return w})})}if(x._state.openComplete)return je(new H.DatabaseClosed(x._state.dbOpenError));if(!x._state.isBeingOpened){if(!x._state.autoOpen)return je(new H.DatabaseClosed);x.open().catch(se)}return x._state.dbReadyPromise.then(function(){return m(x,c,j,d)})}(this.db,e,[this.name],a);return i&&(f._consoleTask=i,f=f.catch(function(m){return console.trace(m),je(m)})),f}finally{u&&Pt()}},ye.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):e==null?je(new H.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)},ye.prototype.where=function(e){if(typeof e=="string")return new this.db.WhereClause(this,e);if(P(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=S(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(m){return 0<=u.keyPath.indexOf(m)})){for(var f=0;f<t.length;++f)if(t.indexOf(u.keyPath[f])===-1)return!1;return!0}return!1}).sort(function(u,f){return u.keyPath.length-f.keyPath.length})[0];if(n&&this.db._maxKey!==wt){var i=n.keyPath.slice(0,t.length);return this.where(i).equals(i.map(function(f){return e[f]}))}!n&&l&&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,f){return oe(u,f)===0}var a=t.reduce(function(c,f){var m=c[0],x=c[1],c=r[f],j=e[f];return[m||c,m||!c?jt(x,c&&c.multi?function(d){return d=ae(d,f),P(d)&&d.some(function(g){return o(j,g)})}:function(d){return o(j,ae(d,f))}):x]},[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("")},ye.prototype.filter=function(e){return this.toCollection().and(e)},ye.prototype.count=function(e){return this.toCollection().count(e)},ye.prototype.offset=function(e){return this.toCollection().offset(e)},ye.prototype.limit=function(e){return this.toCollection().limit(e)},ye.prototype.each=function(e){return this.toCollection().each(e)},ye.prototype.toArray=function(e){return this.toCollection().toArray(e)},ye.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},ye.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,P(e)?"[".concat(e.join("+"),"]"):e))},ye.prototype.reverse=function(){return this.toCollection().reverse()},ye.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 ro&&(function(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");function x(){this.constructor=f}h(f,m),f.prototype=m===null?Object.create(m):(x.prototype=m.prototype,new x)}(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=Q(a))Object.getOwnPropertyNames(a).forEach(function(f){return i.add(f)});function u(f){if(!f)return f;var m,x=Object.create(e.prototype);for(m in f)if(!i.has(m))try{x[m]=f[m]}catch{}return x}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=u,this.hook("reading",u),e},ye.prototype.defineClass=function(){return this.mapToClass(function(e){M(this,e)})},ye.prototype.add=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=xn(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?B.reject(u.failures[0]):u.lastResult}).then(function(u){if(i)try{$(e,i,u)}catch{}return u})},ye.prototype.update=function(e,t){return typeof e!="object"||P(e)?this.where(":id").equals(e).modify(t):(e=ae(e,this.schema.primKey.keyPath),e===void 0?je(new H.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t))},ye.prototype.put=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=xn(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?B.reject(u.failures[0]):u.lastResult}).then(function(u){if(i)try{$(e,i,u)}catch{}return u})},ye.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?B.reject(n.failures[0]):void 0})},ye.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:no})}).then(function(t){return t.numFailures?B.reject(t.failures[0]):void 0})},ye.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)})})})},ye.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 m=r.schema.primKey,u=m.auto,m=m.keyPath;if(m&&o)throw new H.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new H.InvalidArgument("Arguments objects and keys must have the same length");var f=e.length,m=m&&u?e.map(xn(m)):e;return r.core.mutate({trans:a,type:"add",keys:o,values:m,wantResults:i}).then(function(g){var c=g.numFailures,j=g.results,d=g.lastResult,g=g.failures;if(c===0)return i?j:d;throw new at("".concat(r.name,".bulkAdd(): ").concat(c," of ").concat(f," operations failed"),g)})})},ye.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 m=r.schema.primKey,u=m.auto,m=m.keyPath;if(m&&o)throw new H.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new H.InvalidArgument("Arguments objects and keys must have the same length");var f=e.length,m=m&&u?e.map(xn(m)):e;return r.core.mutate({trans:a,type:"put",keys:o,values:m,wantResults:i}).then(function(g){var c=g.numFailures,j=g.results,d=g.lastResult,g=g.failures;if(c===0)return i?j:d;throw new at("".concat(r.name,".bulkPut(): ").concat(c," of ").concat(f," operations failed"),g)})})},ye.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 f=[],m=[];e.forEach(function(c,j){var d=c.key,g=c.changes,w=u[j];if(w){for(var v=0,_=Object.keys(g);v<_.length;v++){var A=_[v],E=g[A];if(A===t.schema.primKey.keyPath){if(oe(E,d)!==0)throw new H.Constraint("Cannot update primary key in bulkUpdate()")}else $(w,A,E)}i.push(j),f.push(d),m.push(w)}});var x=f.length;return n.mutate({trans:a,type:"put",keys:f,values:m,updates:{keys:r,changeSpecs:o}}).then(function(c){var j=c.numFailures,d=c.failures;if(j===0)return x;for(var g=0,w=Object.keys(d);g<w.length;g++){var v,_=w[g],A=i[Number(_)];A!=null&&(v=d[_],delete d[_],d[A]=v)}throw new at("".concat(t.name,".bulkUpdate(): ").concat(j," of ").concat(x," operations failed"),d)})})})},ye.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 at("".concat(t.name,".bulkDelete(): ").concat(o," of ").concat(n," operations failed"),a)})},ye);function ye(){}function Wt(e){function t(a,u){if(u){for(var f=arguments.length,m=new Array(f-1);--f;)m[f-1]=arguments[f];return n[a].subscribe.apply(null,m),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,f){if(typeof a!="object"){var m;u=u||dn;var x={subscribers:[],fire:f=f||se,subscribe:function(c){x.subscribers.indexOf(c)===-1&&(x.subscribers.push(c),x.fire=u(x.fire,c))},unsubscribe:function(c){x.subscribers=x.subscribers.filter(function(j){return j!==c}),x.fire=x.subscribers.reduce(u,f)}};return n[a]=t[a]=x}S(m=a).forEach(function(c){var j=m[c];if(P(j))i(c,m[c][0],m[c][1]);else{if(j!=="asap")throw new H.InvalidArgument("Invalid event config");var d=i(c,lt,function(){for(var g=arguments.length,w=new Array(g);g--;)w[g]=arguments[g];d.subscribers.forEach(function(v){ve(function(){v.apply(null,w)})})})}})}}function Ht(e,t){return he(t).from({prototype:e}),t}function Rt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Gn(e,t){e.filter=jt(e.filter,t)}function $n(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return jt(r(),t())}:t,e.justLimit=n&&!r}function wn(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new H.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function so(e,t,n){var r=wn(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 jn(e,t,n,r){var o=e.replayFilter?jt(e.filter,e.replayFilter()):e.filter;if(e.or){var i={},a=function(u,f,m){var x,c;o&&!o(f,m,function(j){return f.stop(j)},function(j){return f.fail(j)})||((c=""+(x=f.primaryKey))=="[object ArrayBuffer]"&&(c=""+new Uint8Array(x)),W(i,c)||(i[c]=!0,t(u,f,m)))};return Promise.all([e.or._iterate(a,n),uo(so(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return uo(so(e,r,n),jt(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function uo(e,t,n,r){var o=xe(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=se},function(u){i.fail(u),a=se})||o(i.value,i,function(u){return a=u}),a()})})}var Yt=(co.prototype.execute=function(e){var t=this["@@propmod"];if(t.add!==void 0){var n=t.add;if(P(n))return O(O([],P(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(P(r))return P(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},co);function co(e){this["@@propmod"]=e}var Zi=(ue.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,je.bind(null,n.error)):n.table._trans("readonly",e).then(t)},ue.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,je.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},ue.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=jt(t.algorithm,e)},ue.prototype._iterate=function(e,t){return jn(this._ctx,e,t,this._ctx.table.core)},ue.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&M(n,e),t._ctx=n,t},ue.prototype.raw=function(){return this._ctx.valueMapper=null,this},ue.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return jn(t,e,n,t.table.core)})},ue.prototype.count=function(e){var t=this;return this._read(function(n){var r=t._ctx,o=r.table.core;if(Rt(r,!0))return o.count({trans:n,query:{index:wn(r,o.schema),range:r.range}}).then(function(a){return Math.min(a,r.limit)});var i=0;return jn(r,function(){return++i,!1},n,o).then(function(){return i})}).then(e)},ue.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(f,m){return m?i(f[n[m]],m-1):f[r]}var a=this._ctx.dir==="next"?1:-1;function u(f,m){return oe(i(f,o),i(m,o))*a}return this.toArray(function(f){return f.sort(u)}).then(t)},ue.prototype.toArray=function(e){var t=this;return this._read(function(n){var r=t._ctx;if(r.dir==="next"&&Rt(r,!0)&&0<r.limit){var o=r.valueMapper,i=wn(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 jn(r,function(u){return a.push(u)},n,r.table.core).then(function(){return a})},e)},ue.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,Rt(t)?$n(t,function(){var n=e;return function(r,o){return n===0||(n===1?--n:o(function(){r.advance(n),n=0}),!1)}}):$n(t,function(){var n=e;return function(){return--n<0}})),this},ue.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),$n(this._ctx,function(){var t=e;return function(n,r,o){return--t<=0&&r(o),0<=t}},!0),this},ue.prototype.until=function(e,t){return Gn(this._ctx,function(n,r,o){return!e(n.value)||(r(o),t)}),this},ue.prototype.first=function(e){return this.limit(1).toArray(function(t){return t[0]}).then(e)},ue.prototype.last=function(e){return this.reverse().first(e)},ue.prototype.filter=function(e){var t;return Gn(this._ctx,function(n){return e(n.value)}),(t=this._ctx).isMatch=jt(t.isMatch,e),this},ue.prototype.and=function(e){return this.filter(e)},ue.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},ue.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},ue.prototype.desc=function(){return this.reverse()},ue.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(n,r){e(r.key,r)})},ue.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},ue.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(n,r){e(r.primaryKey,r)})},ue.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)},ue.prototype.primaryKeys=function(e){var t=this._ctx;if(t.dir==="next"&&Rt(t,!0)&&0<t.limit)return this._read(function(r){var o=wn(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)},ue.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},ue.prototype.firstKey=function(e){return this.limit(1).keys(function(t){return t[0]}).then(e)},ue.prototype.lastKey=function(e){return this.reverse().firstKey(e)},ue.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 Gn(this._ctx,function(o){var r=o.primaryKey.toString(),o=W(t,r);return t[r]=!0,!o}),this},ue.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=S(e),i=o.length,function(v){for(var _=!1,A=0;A<i;++A){var E=o[A],C=e[E],N=ae(v,E);C instanceof Yt?($(v,E,C.execute(N)),_=!0):N!==C&&($(v,E,C),_=!0)}return _});var u=n.table.core,c=u.schema.primaryKey,f=c.outbound,m=c.extractKey,x=200,c=t.db._options.modifyChunkSize;c&&(x=typeof c=="object"?c[u.name]||c["*"]||200:c);function j(v,E){var A=E.failures,E=E.numFailures;g+=v-E;for(var C=0,N=S(A);C<N.length;C++){var I=N[C];d.push(A[I])}}var d=[],g=0,w=[];return t.clone().primaryKeys().then(function(v){function _(E){var C=Math.min(x,v.length-E);return u.getMany({trans:r,keys:v.slice(E,E+C),cache:"immutable"}).then(function(N){for(var I=[],T=[],R=f?[]:null,D=[],K=0;K<C;++K){var F=N[K],ee={value:Ke(F),primKey:v[E+K]};a.call(ee,ee.value,ee)!==!1&&(ee.value==null?D.push(v[E+K]):f||oe(m(F),m(ee.value))===0?(T.push(ee.value),f&&R.push(v[E+K])):(D.push(v[E+K]),I.push(ee.value)))}return Promise.resolve(0<I.length&&u.mutate({trans:r,type:"add",values:I}).then(function(ne){for(var re in ne.failures)D.splice(parseInt(re),1);j(I.length,ne)})).then(function(){return(0<T.length||A&&typeof e=="object")&&u.mutate({trans:r,type:"put",keys:R,values:T,criteria:A,changeSpec:typeof e!="function"&&e,isAdditionalChunk:0<E}).then(function(ne){return j(T.length,ne)})}).then(function(){return(0<D.length||A&&e===Xn)&&u.mutate({trans:r,type:"delete",keys:D,criteria:A,isAdditionalChunk:0<E}).then(function(ne){return j(D.length,ne)})}).then(function(){return v.length>E+C&&_(E+x)})})}var A=Rt(n)&&n.limit===1/0&&(typeof e!="function"||e===Xn)&&{index:n.index,range:n.range};return _(0).then(function(){if(0<d.length)throw new Ue("Error modifying one or more objects",d,g,w);return v.length})})})},ue.prototype.delete=function(){var e=this._ctx,t=e.range;return Rt(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 Ue("Could not delete some values",Object.keys(u).map(function(f){return u[f]}),i-a);return i-a})})}):this.modify(Xn)},ue);function ue(){}var Xn=function(e,t){return t.value=null};function ea(e,t){return e<t?-1:e===t?0:1}function ta(e,t){return t<e?-1:e===t?0:1}function $e(e,t,n){return e=e instanceof fo?new e.Collection(e):e,e._ctx.error=new(n||TypeError)(t),e}function Kt(e){return new e.Collection(e,function(){return lo("")}).limit(0)}function _n(e,t,n,r){var o,i,a,u,f,m,x,c=n.length;if(!n.every(function(g){return typeof g=="string"}))return $e(e,to);function j(g){o=g==="next"?function(v){return v.toUpperCase()}:function(v){return v.toLowerCase()},i=g==="next"?function(v){return v.toLowerCase()}:function(v){return v.toUpperCase()},a=g==="next"?ea:ta;var w=n.map(function(v){return{lower:i(v),upper:o(v)}}).sort(function(v,_){return a(v.lower,_.lower)});u=w.map(function(v){return v.upper}),f=w.map(function(v){return v.lower}),x=(m=g)==="next"?"":r}j("next"),e=new e.Collection(e,function(){return mt(u[0],f[c-1]+r)}),e._ondirectionchange=function(g){j(g)};var d=0;return e._addAlgorithm(function(g,w,v){var _=g.key;if(typeof _!="string")return!1;var A=i(_);if(t(A,f,d))return!0;for(var E=null,C=d;C<c;++C){var N=function(I,T,R,D,K,F){for(var ee=Math.min(I.length,D.length),ne=-1,re=0;re<ee;++re){var Xe=T[re];if(Xe!==D[re])return K(I[re],R[re])<0?I.substr(0,re)+R[re]+R.substr(re+1):K(I[re],D[re])<0?I.substr(0,re)+D[re]+R.substr(re+1):0<=ne?I.substr(0,ne)+T[ne]+R.substr(ne+1):null;K(I[re],Xe)<0&&(ne=re)}return ee<D.length&&F==="next"?I+R.substr(I.length):ee<I.length&&F==="prev"?I.substr(0,R.length):ne<0?null:I.substr(0,ne)+D[ne]+R.substr(ne+1)}(_,A,u[C],f[C],a,m);N===null&&E===null?d=C+1:(E===null||0<a(E,N))&&(E=N)}return w(E!==null?function(){g.continue(E+x)}:v),!1}),e}function mt(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function lo(e){return{type:1,lower:e,upper:e}}var fo=(Object.defineProperty(Te.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Te.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)?Kt(this):new this.Collection(this,function(){return mt(e,t,!n,!r)})}catch{return $e(this,st)}},Te.prototype.equals=function(e){return e==null?$e(this,st):new this.Collection(this,function(){return lo(e)})},Te.prototype.above=function(e){return e==null?$e(this,st):new this.Collection(this,function(){return mt(e,void 0,!0)})},Te.prototype.aboveOrEqual=function(e){return e==null?$e(this,st):new this.Collection(this,function(){return mt(e,void 0,!1)})},Te.prototype.below=function(e){return e==null?$e(this,st):new this.Collection(this,function(){return mt(void 0,e,!1,!0)})},Te.prototype.belowOrEqual=function(e){return e==null?$e(this,st):new this.Collection(this,function(){return mt(void 0,e)})},Te.prototype.startsWith=function(e){return typeof e!="string"?$e(this,to):this.between(e,e+wt,!0,!0)},Te.prototype.startsWithIgnoreCase=function(e){return e===""?this.startsWith(e):_n(this,function(t,n){return t.indexOf(n[0])===0},[e],wt)},Te.prototype.equalsIgnoreCase=function(e){return _n(this,function(t,n){return t===n[0]},[e],"")},Te.prototype.anyOfIgnoreCase=function(){var e=ze.apply(Ee,arguments);return e.length===0?Kt(this):_n(this,function(t,n){return n.indexOf(t)!==-1},e,"")},Te.prototype.startsWithAnyOfIgnoreCase=function(){var e=ze.apply(Ee,arguments);return e.length===0?Kt(this):_n(this,function(t,n){return n.some(function(r){return t.indexOf(r)===0})},e,wt)},Te.prototype.anyOf=function(){var e=this,t=ze.apply(Ee,arguments),n=this._cmp;try{t.sort(n)}catch{return $e(this,st)}if(t.length===0)return Kt(this);var r=new this.Collection(this,function(){return mt(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 f=i.key;0<n(f,t[o]);)if(++o===t.length)return a(u),!1;return n(f,t[o])===0||(a(function(){i.continue(t[o])}),!1)}),r},Te.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Te.prototype.noneOf=function(){var e=ze.apply(Ee,arguments);if(e.length===0)return new this.Collection(this);try{e.sort(this._ascending)}catch{return $e(this,st)}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})},Te.prototype.inAnyRange=function(_,t){var n=this,r=this._cmp,o=this._ascending,i=this._descending,a=this._min,u=this._max;if(_.length===0)return Kt(this);if(!_.every(function(A){return A[0]!==void 0&&A[1]!==void 0&&o(A[0],A[1])<=0}))return $e(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",H.InvalidArgument);var f=!t||t.includeLowers!==!1,m=t&&t.includeUppers===!0,x,c=o;function j(A,E){return c(A[0],E[0])}try{(x=_.reduce(function(A,E){for(var C=0,N=A.length;C<N;++C){var I=A[C];if(r(E[0],I[1])<0&&0<r(E[1],I[0])){I[0]=a(I[0],E[0]),I[1]=u(I[1],E[1]);break}}return C===N&&A.push(E),A},[])).sort(j)}catch{return $e(this,st)}var d=0,g=m?function(A){return 0<o(A,x[d][1])}:function(A){return 0<=o(A,x[d][1])},w=f?function(A){return 0<i(A,x[d][0])}:function(A){return 0<=i(A,x[d][0])},v=g,_=new this.Collection(this,function(){return mt(x[0][0],x[x.length-1][1],!f,!m)});return _._ondirectionchange=function(A){c=A==="next"?(v=g,o):(v=w,i),x.sort(j)},_._addAlgorithm(function(A,E,C){for(var N,I=A.key;v(I);)if(++d===x.length)return E(C),!1;return!g(N=I)&&!w(N)||(n._cmp(I,x[d][1])===0||n._cmp(I,x[d][0])===0||E(function(){c===o?A.continue(x[d][0]):A.continue(x[d][1])}),!1)}),_},Te.prototype.startsWithAnyOf=function(){var e=ze.apply(Ee,arguments);return e.every(function(t){return typeof t=="string"})?e.length===0?Kt(this):this.inAnyRange(e.map(function(t){return[t,t+wt]})):$e(this,"startsWithAnyOf() only works with strings")},Te);function Te(){}function ot(e){return xe(function(t){return Jt(t),e(t.target.error),!1})}function Jt(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Gt="storagemutated",Zn="x-storagemutated-1",yt=Wt(null,Gt),na=(it.prototype._lock=function(){return ke(!V.global),++this._reculock,this._reculock!==1||V.global||(V.lockOwnerFor=this),this},it.prototype._unlock=function(){if(ke(!V.global),--this._reculock==0)for(V.global||(V.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{xt(e[1],e[0])}catch{}}return this},it.prototype._locked=function(){return this._reculock&&V.lockOwnerFor!==this},it.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(ke(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new H.DatabaseClosed(r);case"MissingAPIError":throw new H.MissingAPI(r.message,r);default:throw new H.OpenFailed(r)}if(!this.active)throw new H.TransactionInactive;return ke(this._completion._state===null),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=xe(function(o){Jt(o),t._reject(e.error)}),e.onabort=xe(function(o){Jt(o),t.active&&t._reject(new H.Abort(e.error)),t.active=!1,t.on("abort").fire(o)}),e.oncomplete=xe(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&yt.storagemutated.fire(e.mutatedParts)}),this},it.prototype._promise=function(e,t,n){var r=this;if(e==="readwrite"&&this.mode!=="readwrite")return je(new H.ReadOnly("Transaction is readonly"));if(!this.active)return je(new H.TransactionInactive);if(this._locked())return new B(function(i,a){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,a)},V])});if(n)return dt(function(){var i=new B(function(a,u){r._lock();var f=t(a,u,r);f&&f.then&&f.then(a,u)});return i.finally(function(){return r._unlock()}),i._lib=!0,i});var o=new B(function(i,a){var u=t(i,a,r);u&&u.then&&u.then(i,a)});return o._lib=!0,o},it.prototype._root=function(){return this.parent?this.parent._root():this},it.prototype.waitFor=function(e){var t,n=this._root(),r=B.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 B(function(i,a){r.then(function(u){return n._waitingQueue.push(xe(i.bind(null,u)))},function(u){return n._waitingQueue.push(xe(a.bind(null,u)))}).finally(function(){n._waitingFor===o&&(n._waitingFor=null)})})},it.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new H.Abort))},it.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(W(t,e))return t[e];var n=this.schema[e];if(!n)throw new H.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},it);function it(){}function er(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?"++":"")+ho(t)}}function ho(e){return typeof e=="string"?e:e?"["+[].join.call(e,"+")+"]":""}function tr(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 $t=function(e){try{return e.only([[]]),$t=function(){return[[]]},[[]]}catch{return $t=function(){return wt},wt}};function nr(e){return e==null?function(){}:typeof e=="string"?(t=e).split(".").length===1?function(n){return n[t]}:function(n){return ae(n,t)}:function(n){return ae(n,e)};var t}function po(e){return[].slice.call(e)}var ra=0;function Xt(e){return e==null?":id":typeof e=="string"?e:"[".concat(e.join("+"),"]")}function oa(e,t,f){function r(v){if(v.type===3)return null;if(v.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var d=v.lower,g=v.upper,w=v.lowerOpen,v=v.upperOpen;return d===void 0?g===void 0?null:t.upperBound(g,!!v):g===void 0?t.lowerBound(d,!!w):t.bound(d,g,!!w,!!v)}function o(j){var d,g=j.name;return{name:g,schema:j,mutate:function(w){var v=w.trans,_=w.type,A=w.keys,E=w.values,C=w.range;return new Promise(function(N,I){N=xe(N);var T=v.objectStore(g),R=T.keyPath==null,D=_==="put"||_==="add";if(!D&&_!=="delete"&&_!=="deleteRange")throw new Error("Invalid operation type: "+_);var K,F=(A||E||{length:1}).length;if(A&&E&&A.length!==E.length)throw new Error("Given keys array must have same length as given values array.");if(F===0)return N({numFailures:0,failures:{},results:[],lastResult:void 0});function ee(Fe){++Xe,Jt(Fe)}var ne=[],re=[],Xe=0;if(_==="deleteRange"){if(C.type===4)return N({numFailures:Xe,failures:re,results:[],lastResult:void 0});C.type===3?ne.push(K=T.clear()):ne.push(K=T.delete(r(C)))}else{var R=D?R?[E,A]:[E,null]:[A,null],X=R[0],De=R[1];if(D)for(var Be=0;Be<F;++Be)ne.push(K=De&&De[Be]!==void 0?T[_](X[Be],De[Be]):T[_](X[Be])),K.onerror=ee;else for(Be=0;Be<F;++Be)ne.push(K=T[_](X[Be])),K.onerror=ee}function In(Fe){Fe=Fe.target.result,ne.forEach(function(Et,xr){return Et.error!=null&&(re[xr]=Et.error)}),N({numFailures:Xe,failures:re,results:_==="delete"?A:ne.map(function(Et){return Et.result}),lastResult:Fe})}K.onerror=function(Fe){ee(Fe),In(Fe)},K.onsuccess=In})},getMany:function(w){var v=w.trans,_=w.keys;return new Promise(function(A,E){A=xe(A);for(var C,N=v.objectStore(g),I=_.length,T=new Array(I),R=0,D=0,K=function(ne){ne=ne.target,T[ne._pos]=ne.result,++D===R&&A(T)},F=ot(E),ee=0;ee<I;++ee)_[ee]!=null&&((C=N.get(_[ee]))._pos=ee,C.onsuccess=K,C.onerror=F,++R);R===0&&A(T)})},get:function(w){var v=w.trans,_=w.key;return new Promise(function(A,E){A=xe(A);var C=v.objectStore(g).get(_);C.onsuccess=function(N){return A(N.target.result)},C.onerror=ot(E)})},query:(d=m,function(w){return new Promise(function(v,_){v=xe(v);var A,E,C,R=w.trans,N=w.values,I=w.limit,K=w.query,T=I===1/0?void 0:I,D=K.index,K=K.range,R=R.objectStore(g),D=D.isPrimaryKey?R:R.index(D.name),K=r(K);if(I===0)return v({result:[]});d?((T=N?D.getAll(K,T):D.getAllKeys(K,T)).onsuccess=function(F){return v({result:F.target.result})},T.onerror=ot(_)):(A=0,E=!N&&"openKeyCursor"in D?D.openKeyCursor(K):D.openCursor(K),C=[],E.onsuccess=function(F){var ee=E.result;return ee?(C.push(N?ee.value:ee.primaryKey),++A===I?v({result:C}):void ee.continue()):v({result:C})},E.onerror=ot(_))})}),openCursor:function(w){var v=w.trans,_=w.values,A=w.query,E=w.reverse,C=w.unique;return new Promise(function(N,I){N=xe(N);var D=A.index,T=A.range,R=v.objectStore(g),R=D.isPrimaryKey?R:R.index(D.name),D=E?C?"prevunique":"prev":C?"nextunique":"next",K=!_&&"openKeyCursor"in R?R.openKeyCursor(r(T),D):R.openCursor(r(T),D);K.onerror=ot(I),K.onsuccess=xe(function(F){var ee,ne,re,Xe,X=K.result;X?(X.___id=++ra,X.done=!1,ee=X.continue.bind(X),ne=(ne=X.continuePrimaryKey)&&ne.bind(X),re=X.advance.bind(X),Xe=function(){throw new Error("Cursor not stopped")},X.trans=v,X.stop=X.continue=X.continuePrimaryKey=X.advance=function(){throw new Error("Cursor not started")},X.fail=xe(I),X.next=function(){var De=this,Be=1;return this.start(function(){return Be--?De.continue():De.stop()}).then(function(){return De})},X.start=function(De){function Be(){if(K.result)try{De()}catch(Fe){X.fail(Fe)}else X.done=!0,X.start=function(){throw new Error("Cursor behind last entry")},X.stop()}var In=new Promise(function(Fe,Et){Fe=xe(Fe),K.onerror=ot(Et),X.fail=Et,X.stop=function(xr){X.stop=X.continue=X.continuePrimaryKey=X.advance=Xe,Fe(xr)}});return K.onsuccess=xe(function(Fe){K.onsuccess=Be,Be()}),X.continue=ee,X.continuePrimaryKey=ne,X.advance=re,Be(),In},N(X)):N(null)},I)})},count:function(w){var v=w.query,_=w.trans,A=v.index,E=v.range;return new Promise(function(C,N){var I=_.objectStore(g),T=A.isPrimaryKey?I:I.index(A.name),I=r(E),T=I?T.count(I):T.count();T.onsuccess=xe(function(R){return C(R.target.result)}),T.onerror=ot(N)})}}}var i,a,u,x=(a=f,u=po((i=e).objectStoreNames),{schema:{name:i.name,tables:u.map(function(j){return a.objectStore(j)}).map(function(j){var d=j.keyPath,v=j.autoIncrement,g=P(d),w={},v={name:j.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:d==null,compound:g,keyPath:d,autoIncrement:v,unique:!0,extractKey:nr(d)},indexes:po(j.indexNames).map(function(_){return j.index(_)}).map(function(C){var A=C.name,E=C.unique,N=C.multiEntry,C=C.keyPath,N={name:A,compound:P(C),keyPath:C,unique:E,multiEntry:N,extractKey:nr(C)};return w[Xt(C)]=N}),getIndexByKeyPath:function(_){return w[Xt(_)]}};return w[":id"]=v.primaryKey,d!=null&&(w[Xt(d)]=v.primaryKey),v})},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)}),f=x.schema,m=x.hasGetAll,x=f.tables.map(o),c={};return x.forEach(function(j){return c[j.name]=j}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(j){if(!c[j])throw new Error("Table '".concat(j,"' not found"));return c[j]},MIN_KEY:-1/0,MAX_KEY:$t(t),schema:f}}function ia(e,t,n,r){var o=n.IDBKeyRange;return n.indexedDB,{dbcore:(r=oa(t,o,r),e.dbcore.reduce(function(i,a){return a=a.create,b(b({},i),a(i))},r))}}function An(e,r){var n=r.db,r=ia(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 En(e,t,n,r){n.forEach(function(o){var i=r[o];t.forEach(function(a){var u=function f(m,x){return me(m,x)||(m=Q(m))&&f(m,x)}(a,o);(!u||"value"in u&&u.value===void 0)&&(a===e.Transaction.prototype||a instanceof e.Transaction?fe(a,o,{get:function(){return this.table(o)},set:function(f){Ae(this,o,{value:f,writable:!0,configurable:!0,enumerable:!0})}}):a[o]=new e.Table(o,i))})})}function rr(e,t){t.forEach(function(n){for(var r in n)n[r]instanceof e.Table&&delete n[r]})}function aa(e,t){return e._cfg.version-t._cfg.version}function sa(e,t,n,r){var o=e._dbSchema;n.objectStoreNames.contains("$meta")&&!o.$meta&&(o.$meta=tr("$meta",yo("")[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=V.transless||V;dt(function(){return V.trans=i,V.transless=u,t!==0?(An(e,n),m=t,((f=i).storeNames.includes("$meta")?f.table("$meta").get("version").then(function(x){return x??m}):B.resolve(m)).then(function(x){return j=x,d=i,g=n,w=[],x=(c=e)._versions,v=c._dbSchema=On(0,c.idbdb,g),(x=x.filter(function(_){return _._cfg.version>=j})).length!==0?(x.forEach(function(_){w.push(function(){var A=v,E=_._cfg.dbschema;Cn(c,A,g),Cn(c,E,g),v=c._dbSchema=E;var C=or(A,E);C.add.forEach(function(D){ir(g,D[0],D[1].primKey,D[1].indexes)}),C.change.forEach(function(D){if(D.recreate)throw new H.Upgrade("Not yet support for changing primary key");var K=g.objectStore(D.name);D.add.forEach(function(F){return kn(K,F)}),D.change.forEach(function(F){K.deleteIndex(F.name),kn(K,F)}),D.del.forEach(function(F){return K.deleteIndex(F)})});var N=_._cfg.contentUpgrade;if(N&&_._cfg.version>j){An(c,g),d._memoizedTables={};var I=Se(E);C.del.forEach(function(D){I[D]=A[D]}),rr(c,[c.Transaction.prototype]),En(c,[c.Transaction.prototype],S(I),I),d.schema=I;var T,R=Z(N);return R&&Nt(),C=B.follow(function(){var D;(T=N(d))&&R&&(D=ht.bind(null,null),T.then(D,D))}),T&&typeof T.then=="function"?B.resolve(T):C.then(function(){return T})}}),w.push(function(A){var E,C,N=_._cfg.dbschema;E=N,C=A,[].slice.call(C.db.objectStoreNames).forEach(function(I){return E[I]==null&&C.db.deleteObjectStore(I)}),rr(c,[c.Transaction.prototype]),En(c,[c.Transaction.prototype],c._storeNames,c._dbSchema),d.schema=c._dbSchema}),w.push(function(A){c.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(c.idbdb.version/10)===_._cfg.version?(c.idbdb.deleteObjectStore("$meta"),delete c._dbSchema.$meta,c._storeNames=c._storeNames.filter(function(E){return E!=="$meta"})):A.objectStore("$meta").put(_._cfg.version,"version"))})}),function _(){return w.length?B.resolve(w.shift()(d.idbtrans)).then(_):B.resolve()}().then(function(){mo(v,g)})):B.resolve();var c,j,d,g,w,v}).catch(a)):(S(o).forEach(function(x){ir(n,x,o[x].primKey,o[x].indexes)}),An(e,n),void B.follow(function(){return e.on.populate.fire(i)}).catch(a));var f,m})}function ua(e,t){mo(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=On(0,e.idbdb,t);Cn(e,e._dbSchema,t);for(var r=0,o=or(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(f){l&&console.debug("Dexie upgrade patch: Creating missing index ".concat(a.name,".").concat(f.src)),kn(u,f)})}(o[r]);if(typeof i=="object")return i.value}}function or(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,f=i.idxByName,m=void 0;for(m in u)f[m]||a.del.push(m);for(m in f){var x=u[m],c=f[m];x?x.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 ir(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 kn(o,i)}),o}function mo(e,t){S(e).forEach(function(n){t.db.objectStoreNames.contains(n)||(l&&console.debug("Dexie: Creating missing table",n),ir(t,n,e[n].primKey,e[n].indexes))})}function kn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function On(e,t,n){var r={};return de(t.objectStoreNames,0).forEach(function(o){for(var i=n.objectStore(o),a=er(ho(m=i.keyPath),m||"",!0,!1,!!i.autoIncrement,m&&typeof m!="string",!0),u=[],f=0;f<i.indexNames.length;++f){var x=i.index(i.indexNames[f]),m=x.keyPath,x=er(x.name,m,!!x.unique,!!x.multiEntry,!1,m&&typeof m!="string",!1);u.push(x)}r[o]=tr(o,a,u)}),r}function Cn(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 f=a.indexNames[u],m=a.index(f).keyPath,x=typeof m=="string"?m:"["+de(m).join("+")+"]";!t[i]||(m=t[i].idxByName[x])&&(m.name=f,delete t[i].idxByName[x],t[i].idxByName[f]=m)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&k.WorkerGlobalScope&&k instanceof k.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function yo(e){return e.split(",").map(function(t,n){var r=(t=t.trim()).replace(/([&*]|\+\+)/g,""),o=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return er(r,o||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),P(o),n===0)})}var ca=(Sn.prototype._parseStoresSpec=function(e,t){S(e).forEach(function(n){if(e[n]!==null){var r=yo(e[n]),o=r.shift();if(o.unique=!0,o.multi)throw new H.Schema("Primary key cannot be multi-valued");r.forEach(function(i){if(i.auto)throw new H.Schema("Only primary key can be marked as autoIncrement (++)");if(!i.keyPath)throw new H.Schema("Index must have a name and cannot be an empty string")}),t[n]=tr(n,o,r)}})},Sn.prototype.stores=function(n){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?M(this._cfg.storesSource,n):n;var n=t._versions,r={},o={};return n.forEach(function(i){M(r,i._cfg.storesSource),o=i._cfg.dbschema={},i._parseStoresSpec(r,o)}),t._dbSchema=o,rr(t,[t._allTables,t,t.Transaction.prototype]),En(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],S(o),o),t._storeNames=S(o),this},Sn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=Ct(this._cfg.contentUpgrade||se,e),this},Sn);function Sn(){}function ar(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new ut(bn,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function sr(e){return e&&typeof e.databases=="function"}function ur(e){return dt(function(){return V.letThrough=!0,e()})}function cr(e){return!("from"in e)}var Ie=function(e,t){if(!this){var n=new Ie;return e&&"d"in e&&M(n,e),n}M(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function Zt(e,t,n){var r=oe(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(cr(e))return M(e,{from:t,to:n,d:1});var o=e.l,r=e.r;if(oe(n,e.from)<0)return o?Zt(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},go(e);if(0<oe(t,e.to))return r?Zt(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},go(e);oe(t,e.from)<0&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<oe(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,o&&!e.l&&en(e,o),r&&n&&en(e,r)}}function en(e,t){cr(t)||function n(r,f){var i=f.from,a=f.to,u=f.l,f=f.r;Zt(r,i,a),u&&n(r,u),f&&n(r,f)}(e,t)}function vo(e,t){var n=Pn(t),r=n.next();if(r.done)return!1;for(var o=r.value,i=Pn(e),a=i.next(o.from),u=a.value;!r.done&&!a.done;){if(oe(u.from,o.to)<=0&&0<=oe(u.to,o.from))return!0;oe(o.from,u.from)<0?o=(r=n.next(u.from)).value:u=(a=i.next(o.from)).value}return!1}function Pn(e){var t=cr(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&&oe(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||oe(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 go(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=bo(n)),e.d=bo(e)}function bo(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 Nn(e,t){return S(t).forEach(function(n){e[n]?en(e[n],t[n]):e[n]=function r(o){var i,a,u={};for(i in o)W(o,i)&&(a=o[i],u[i]=!a||typeof a!="object"||qe.has(a.constructor)?a:r(a));return u}(t[n])}),e}function lr(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&vo(t[n],e[n])})}G(Ie.prototype,((tt={add:function(e){return en(this,e),this},addKey:function(e){return Zt(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(n){return Zt(t,n,n)}),this},hasKey:function(e){var t=Pn(this).next(e).value;return t&&oe(t.from,e)<=0&&0<=oe(t.to,e)}})[le]=function(){return Pn(this)},tt));var _t={},fr={},dr=!1;function Tn(e){Nn(fr,e),dr||(dr=!0,setTimeout(function(){dr=!1,hr(fr,!(fr={}))},0))}function hr(e,t){t===void 0&&(t=!1);var n=new Set;if(e.all)for(var r=0,o=Object.values(_t);r<o.length;r++)xo(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=_t["idb://".concat(i,"/").concat(u)])&&xo(a,e,n,t))}n.forEach(function(f){return f()})}function xo(e,t,n,r){for(var o=[],i=0,a=Object.entries(e.queries.query);i<a.length;i++){for(var u=a[i],f=u[0],m=[],x=0,c=u[1];x<c.length;x++){var j=c[x];lr(t,j.obsSet)?j.subscribers.forEach(function(v){return n.add(v)}):r&&m.push(j)}r&&o.push([f,m])}if(r)for(var d=0,g=o;d<g.length;d++){var w=g[d],f=w[0],m=w[1];e.queries.query[f]=m}}function la(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?je(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 H.DatabaseClosed("db.open() was cancelled")}function u(){return new B(function(j,d){if(a(),!n)throw new H.MissingAPI;var g=e.name,w=t.autoSchema||!o?n.open(g):n.open(g,o);if(!w)throw new H.MissingAPI;w.onerror=ot(d),w.onblocked=xe(e._fireOnBlocked),w.onupgradeneeded=xe(function(v){var _;x=w.transaction,t.autoSchema&&!e._options.allowEmptyDB?(w.onerror=Jt,x.abort(),w.result.close(),(_=n.deleteDatabase(g)).onsuccess=_.onerror=xe(function(){d(new H.NoSuchDatabase("Database ".concat(g," doesnt exist")))})):(x.onerror=ot(d),v=v.oldVersion>Math.pow(2,62)?0:v.oldVersion,c=v<1,e.idbdb=w.result,i&&ua(e,x),sa(e,v/10,x,d))},d),w.onsuccess=xe(function(){x=null;var v,_,A,E,C,N=e.idbdb=w.result,I=de(N.objectStoreNames);if(0<I.length)try{var T=N.transaction((E=I).length===1?E[0]:E,"readonly");if(t.autoSchema)_=N,A=T,(v=e).verno=_.version/10,A=v._dbSchema=On(0,_,A),v._storeNames=de(_.objectStoreNames,0),En(v,[v._allTables],S(A),A);else if(Cn(e,e._dbSchema,T),((C=or(On(0,(C=e).idbdb,T),C._dbSchema)).add.length||C.change.some(function(R){return R.add.length||R.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,j(u());An(e,T)}catch{}Tt.push(e),N.onversionchange=xe(function(R){t.vcFired=!0,e.on("versionchange").fire(R)}),N.onclose=xe(function(R){e.on("close").fire(R)}),c&&(C=e._deps,T=g,N=C.indexedDB,C=C.IDBKeyRange,sr(N)||T===bn||ar(N,C).put({name:T}).catch(se)),j()},d)}).catch(function(j){switch(j==null?void 0:j.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 B.reject(j)})}var f,m=t.dbReadyResolve,x=null,c=!1;return B.race([r,(typeof navigator>"u"?B.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(j){function d(){return indexedDB.databases().finally(j)}f=setInterval(d,100),d()}).finally(function(){return clearInterval(f)}):Promise.resolve()).then(u)]).then(function(){return a(),t.onReadyBeingFired=[],B.resolve(ur(function(){return e.on.ready.fire(e.vip)})).then(function j(){if(0<t.onReadyBeingFired.length){var d=t.onReadyBeingFired.reduce(Ct,se);return t.onReadyBeingFired=[],B.resolve(ur(function(){return d(e.vip)})).then(j)}})}).finally(function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(j){t.dbOpenError=j;try{x&&x.abort()}catch{}return r===t.openCanceller&&e._close(),je(j)}).finally(function(){t.openComplete=!0,m()}).then(function(){var j;return c&&(j={},e.tables.forEach(function(d){d.schema.indexes.forEach(function(g){g.name&&(j["idb://".concat(e.name,"/").concat(d.name,"/").concat(g.name)]=new Ie(-1/0,[[[]]]))}),j["idb://".concat(e.name,"/").concat(d.name,"/")]=j["idb://".concat(e.name,"/").concat(d.name,"/:dels")]=new Ie(-1/0,[[[]]])}),yt(Gt).fire(j),hr(j,!0)),e})}function pr(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(f){var u=i(f),f=u.value;return u.done?f:f&&typeof f.then=="function"?f.then(n,r):P(f)?Promise.all(f).then(n,r):n(f)}}return o(t)()}function Rn(e,t,n){for(var r=P(e)?e.slice():[e],o=0;o<n;++o)r.push(t);return r}var fa={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,j,d){var g=Xt(c),w=o[g]=o[g]||[],v=c==null?0:typeof c=="string"?1:c.length,_=0<j,_=b(b({},d),{name:_?"".concat(g,"(virtual-from:").concat(d.name,")"):d.name,lowLevelIndex:d,isVirtual:_,keyTail:j,keyLength:v,extractKey:nr(c),unique:!_&&d.unique});return w.push(_),_.isPrimaryKey||i.push(_),1<v&&a(v===2?c[0]:c.slice(0,v-1),j+1,d),w.sort(function(A,E){return A.keyTail-E.keyTail}),_}t=a(r.primaryKey.keyPath,0,r.primaryKey),o[":id"]=[t];for(var u=0,f=r.indexes;u<f.length;u++){var m=f[u];a(m.keyPath,0,m)}function x(c){var j,d=c.query.index;return d.isVirtual?b(b({},c),{query:{index:d.lowLevelIndex,range:(j=c.query.range,d=d.keyTail,{type:j.type===1?2:j.type,lower:Rn(j.lower,j.lowerOpen?e.MAX_KEY:e.MIN_KEY,d),lowerOpen:!0,upper:Rn(j.upper,j.upperOpen?e.MIN_KEY:e.MAX_KEY,d),upperOpen:!0})}}):c}return b(b({},n),{schema:b(b({},r),{primaryKey:t,indexes:i,getIndexByKeyPath:function(c){return(c=o[Xt(c)])&&c[0]}}),count:function(c){return n.count(x(c))},query:function(c){return n.query(x(c))},openCursor:function(c){var j=c.query.index,d=j.keyTail,g=j.isVirtual,w=j.keyLength;return g?n.openCursor(x(c)).then(function(_){return _&&v(_)}):n.openCursor(c);function v(_){return Object.create(_,{continue:{value:function(A){A!=null?_.continue(Rn(A,c.reverse?e.MAX_KEY:e.MIN_KEY,d)):c.unique?_.continue(_.key.slice(0,w).concat(c.reverse?e.MIN_KEY:e.MAX_KEY,d)):_.continue()}},continuePrimaryKey:{value:function(A,E){_.continuePrimaryKey(Rn(A,e.MAX_KEY,d),E)}},primaryKey:{get:function(){return _.primaryKey}},key:{get:function(){var A=_.key;return w===1?A[0]:A.slice(0,w)}},value:{get:function(){return _.value}}})}}})}})}};function mr(e,t,n,r){return n=n||{},r=r||"",S(e).forEach(function(o){var i,a,u;W(t,o)?(i=e[o],a=t[o],typeof i=="object"&&typeof a=="object"&&i&&a?(u=Y(i))!==Y(a)?n[r+o]=t[o]:u==="Object"?mr(i,a,n,r+o+"."):i!==a&&(n[r+o]=t[o]):i!==a&&(n[r+o]=t[o])):n[r+o]=void 0}),S(t).forEach(function(o){W(e,o)||(n[r+o]=t[o])}),n}function yr(e,t){return t.type==="delete"?t.keys:t.keys||t.values.map(e.extractKey)}var da={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=V.trans,a=i.table(t).hook,u=a.deleting,f=a.creating,m=a.updating;switch(o.type){case"add":if(f.fire===se)break;return i._promise("readwrite",function(){return x(o)},!0);case"put":if(f.fire===se&&m.fire===se)break;return i._promise("readwrite",function(){return x(o)},!0);case"delete":if(u.fire===se)break;return i._promise("readwrite",function(){return x(o)},!0);case"deleteRange":if(u.fire===se)break;return i._promise("readwrite",function(){return function c(j,d,g){return n.query({trans:j,values:!1,query:{index:r,range:d},limit:g}).then(function(w){var v=w.result;return x({type:"delete",keys:v,trans:j}).then(function(_){return 0<_.numFailures?Promise.reject(_.failures[0]):v.length<g?{failures:[],numFailures:0,lastResult:void 0}:c(j,b(b({},d),{lower:v[v.length-1],lowerOpen:!0}),g)})})}(o.trans,o.range,1e4)},!0)}return n.mutate(o);function x(c){var j,d,g,w=V.trans,v=c.keys||yr(r,c);if(!v)throw new Error("Keys missing");return(c=c.type==="add"||c.type==="put"?b(b({},c),{keys:v}):b({},c)).type!=="delete"&&(c.values=O([],c.values)),c.keys&&(c.keys=O([],c.keys)),j=n,g=v,((d=c).type==="add"?Promise.resolve([]):j.getMany({trans:d.trans,keys:g,cache:"immutable"})).then(function(_){var A=v.map(function(E,C){var N,I,T,R=_[C],D={onerror:null,onsuccess:null};return c.type==="delete"?u.fire.call(D,E,R,w):c.type==="add"||R===void 0?(N=f.fire.call(D,E,c.values[C],w),E==null&&N!=null&&(c.keys[C]=E=N,r.outbound||$(c.values[C],r.keyPath,E))):(N=mr(R,c.values[C]),(I=m.fire.call(D,N,E,R,w))&&(T=c.values[C],Object.keys(I).forEach(function(K){W(T,K)?T[K]=I[K]:$(T,K,I[K])}))),D});return n.mutate(c).then(function(E){for(var C=E.failures,N=E.results,I=E.numFailures,E=E.lastResult,T=0;T<v.length;++T){var R=(N||v)[T],D=A[T];R==null?D.onerror&&D.onerror(C[T]):D.onsuccess&&D.onsuccess(c.type==="put"&&_[T]?c.values[T]:R)}return{failures:C,results:N,numFailures:I,lastResult:E}}).catch(function(E){return A.forEach(function(C){return C.onerror&&C.onerror(E)}),Promise.reject(E)})})}}})}})}};function wo(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)oe(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 ha={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=wo(r.keys,r.trans._cache,r.cache==="clone");return o?B.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 jo(e,t){return e.trans.mode==="readonly"&&!!e.subscr&&!e.trans.explicit&&e.trans.db._options.cache!=="disabled"&&!t.schema.primaryKey.outbound}function _o(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var pa={stack:"dbcore",level:0,name:"Observability",create:function(e){var t=e.schema.name,n=new Ie(e.MIN_KEY,e.MAX_KEY);return b(b({},e),{transaction:function(r,o,i){if(V.subscr&&o!=="readonly")throw new H.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(V.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,f=a.outbound,m=a.autoIncrement&&c.filter(function(d){return d.compound&&d.keyPath.includes(a.keyPath)}),x=b(b({},o),{mutate:function(d){function g(K){return K="idb://".concat(t,"/").concat(r,"/").concat(K),E[K]||(E[K]=new Ie)}var w,v,_,A=d.trans,E=d.mutatedParts||(d.mutatedParts={}),C=g(""),N=g(":dels"),I=d.type,D=d.type==="deleteRange"?[d.range]:d.type==="delete"?[d.keys]:d.values.length<50?[yr(a,d).filter(function(K){return K}),d.values]:[],T=D[0],R=D[1],D=d.trans._cache;return P(T)?(C.addKeys(T),(D=I==="delete"||T.length===R.length?wo(T,D):null)||N.addKeys(T),(D||R)&&(w=g,v=D,_=R,i.indexes.forEach(function(K){var F=w(K.name||"");function ee(re){return re!=null?K.extractKey(re):null}function ne(re){return K.multiEntry&&P(re)?re.forEach(function(Xe){return F.addKey(Xe)}):F.addKey(re)}(v||_).forEach(function(re,De){var X=v&&ee(v[De]),De=_&&ee(_[De]);oe(X,De)!==0&&(X!=null&&ne(X),De!=null&&ne(De))})}))):T?(R={from:(R=T.lower)!==null&&R!==void 0?R:e.MIN_KEY,to:(R=T.upper)!==null&&R!==void 0?R:e.MAX_KEY},N.add(R),C.add(R)):(C.add(n),N.add(n),i.indexes.forEach(function(K){return g(K.name).add(n)})),o.mutate(d).then(function(K){return!T||d.type!=="add"&&d.type!=="put"||(C.addKeys(K.results),m&&m.forEach(function(F){for(var ee=d.values.map(function(X){return F.extractKey(X)}),ne=F.keyPath.findIndex(function(X){return X===a.keyPath}),re=0,Xe=K.results.length;re<Xe;++re)ee[re][ne]=K.results[re];g(F.name).addKeys(ee)})),A.mutatedParts=Nn(A.mutatedParts||{},E),K})}}),c=function(g){var w=g.query,g=w.index,w=w.range;return[g,new Ie((g=w.lower)!==null&&g!==void 0?g:e.MIN_KEY,(w=w.upper)!==null&&w!==void 0?w:e.MAX_KEY)]},j={get:function(d){return[a,new Ie(d.key)]},getMany:function(d){return[a,new Ie().addKeys(d.keys)]},count:c,query:c,openCursor:c};return S(j).forEach(function(d){x[d]=function(g){var w=V.subscr,v=!!w,_=jo(V,o)&&_o(d,g)?g.obsSet={}:w;if(v){var A=function(R){return R="idb://".concat(t,"/").concat(r,"/").concat(R),_[R]||(_[R]=new Ie)},E=A(""),C=A(":dels"),w=j[d](g),v=w[0],w=w[1];if((d==="query"&&v.isPrimaryKey&&!g.values?C:A(v.name||"")).add(w),!v.isPrimaryKey){if(d!=="count"){var N=d==="query"&&f&&g.values&&o.query(b(b({},g),{values:!1}));return o[d].apply(this,arguments).then(function(R){if(d==="query"){if(f&&g.values)return N.then(function(ee){return ee=ee.result,E.addKeys(ee),R});var D=g.values?R.result.map(u):R.result;(g.values?E:C).addKeys(D)}else if(d==="openCursor"){var K=R,F=g.values;return K&&Object.create(K,{key:{get:function(){return C.addKey(K.primaryKey),K.key}},primaryKey:{get:function(){var ee=K.primaryKey;return C.addKey(ee),ee}},value:{get:function(){return F&&E.addKey(K.primaryKey),K.value}}})}return R})}C.add(n)}}return o[d].apply(this,arguments)}}),x}})}};function Ao(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),P(t.keys)&&(t.keys=t.keys.filter(function(o,i){return!(i in n.failures)})),"values"in t&&P(t.values)&&(t.values=t.values.filter(function(o,i){return!(i in n.failures)})),t)}function vr(e,t){return n=e,((r=t).lower===void 0||(r.lowerOpen?0<oe(n,r.lower):0<=oe(n,r.lower)))&&(e=e,(t=t).upper===void 0||(t.upperOpen?oe(e,t.upper)<0:oe(e,t.upper)<=0));var n,r}function Eo(e,t,j,r,o,i){if(!j||j.length===0)return e;var a=t.query.index,u=a.multiEntry,f=t.query.range,m=r.schema.primaryKey.extractKey,x=a.extractKey,c=(a.lowLevelIndex||a).extractKey,j=j.reduce(function(d,g){var w=d,v=[];if(g.type==="add"||g.type==="put")for(var _=new Ie,A=g.values.length-1;0<=A;--A){var E,C=g.values[A],N=m(C);_.hasKey(N)||(E=x(C),(u&&P(E)?E.some(function(K){return vr(K,f)}):vr(E,f))&&(_.addKey(N),v.push(C)))}switch(g.type){case"add":var I=new Ie().addKeys(t.values?d.map(function(F){return m(F)}):d),w=d.concat(t.values?v.filter(function(F){return F=m(F),!I.hasKey(F)&&(I.addKey(F),!0)}):v.map(function(F){return m(F)}).filter(function(F){return!I.hasKey(F)&&(I.addKey(F),!0)}));break;case"put":var T=new Ie().addKeys(g.values.map(function(F){return m(F)}));w=d.filter(function(F){return!T.hasKey(t.values?m(F):F)}).concat(t.values?v:v.map(function(F){return m(F)}));break;case"delete":var R=new Ie().addKeys(g.keys);w=d.filter(function(F){return!R.hasKey(t.values?m(F):F)});break;case"deleteRange":var D=g.range;w=d.filter(function(F){return!vr(m(F),D)})}return w},e);return j===e?e:(j.sort(function(d,g){return oe(c(d),c(g))||oe(m(d),m(g))}),t.limit&&t.limit<1/0&&(j.length>t.limit?j.length=t.limit:e.length===t.limit&&j.length<t.limit&&(o.dirty=!0)),i?Object.freeze(j):j)}function ko(e,t){return oe(e.lower,t.lower)===0&&oe(e.upper,t.upper)===0&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function ma(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=oe(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=oe(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 ya(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&&Me(i,o)},3e3))})}var va={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(f){return function(){if(i.abort(),r==="readwrite"){for(var m=new Set,x=0,c=n;x<c.length;x++){var j=c[x],d=_t["idb://".concat(t,"/").concat(j)];if(d){var g=e.table(j),w=d.optimisticOps.filter(function(F){return F.trans===u});if(u._explicit&&f&&u.mutatedParts)for(var v=0,_=Object.values(d.queries.query);v<_.length;v++)for(var A=0,E=(I=_[v]).slice();A<E.length;A++)lr((T=E[A]).obsSet,u.mutatedParts)&&(Me(I,T),T.subscribers.forEach(function(F){return m.add(F)}));else if(0<w.length){d.optimisticOps=d.optimisticOps.filter(function(F){return F.trans!==u});for(var C=0,N=Object.values(d.queries.query);C<N.length;C++)for(var I,T,R,D=0,K=(I=N[C]).slice();D<K.length;D++)(T=K[D]).res!=null&&u.mutatedParts&&(f&&!T.dirty?(R=Object.isFrozen(T.res),R=Eo(T.res,T.req,w,g,T,R),T.dirty?(Me(I,T),T.subscribers.forEach(function(F){return m.add(F)})):R!==T.res&&(T.res=R,T.promise=B.resolve({result:R}))):(T.dirty&&Me(I,T),T.subscribers.forEach(function(F){return m.add(F)})))}}}m.forEach(function(F){return F()})}}},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=V.trans;if(o.outbound||a.db._options.cache==="disabled"||a.explicit||a.idbtrans.mode!=="readwrite")return r.mutate(i);var u=_t["idb://".concat(t,"/").concat(n)];return u?(a=r.mutate(i),i.type!=="add"&&i.type!=="put"||!(50<=i.values.length||yr(o,i).some(function(f){return f==null}))?(u.optimisticOps.push(i),i.mutatedParts&&Tn(i.mutatedParts),a.then(function(f){0<f.numFailures&&(Me(u.optimisticOps,i),(f=Ao(0,i,f))&&u.optimisticOps.push(f),i.mutatedParts&&Tn(i.mutatedParts))}),a.catch(function(){Me(u.optimisticOps,i),i.mutatedParts&&Tn(i.mutatedParts)})):a.then(function(f){var m=Ao(0,b(b({},i),{values:i.values.map(function(x,c){var j;return f.failures[c]?x:(x=(j=o.keyPath)!==null&&j!==void 0&&j.includes(".")?Ke(x):b({},x),$(x,o.keyPath,f.results[c]),x)})}),f);u.optimisticOps.push(m),queueMicrotask(function(){return i.mutatedParts&&Tn(i.mutatedParts)})}),a):r.mutate(i)},query:function(i){if(!jo(V,r)||!_o("query",i))return r.query(i);var a=((m=V.trans)===null||m===void 0?void 0:m.db._options.cache)==="immutable",c=V,u=c.requery,f=c.signal,m=function(g,w,v,_){var A=_t["idb://".concat(g,"/").concat(w)];if(!A)return[];if(!(w=A.queries[v]))return[null,!1,A,null];var E=w[(_.query?_.query.index.name:null)||""];if(!E)return[null,!1,A,null];switch(v){case"query":var C=E.find(function(N){return N.req.limit===_.limit&&N.req.values===_.values&&ko(N.req.query.range,_.query.range)});return C?[C,!0,A,E]:[E.find(function(N){return("limit"in N.req?N.req.limit:1/0)>=_.limit&&(!_.values||N.req.values)&&ma(N.req.query.range,_.query.range)}),!1,A,E];case"count":return C=E.find(function(N){return ko(N.req.query.range,_.query.range)}),[C,!!C,A,E]}}(t,n,"query",i),x=m[0],c=m[1],j=m[2],d=m[3];return x&&c?x.obsSet=i.obsSet:(c=r.query(i).then(function(g){var w=g.result;if(x&&(x.res=w),a){for(var v=0,_=w.length;v<_;++v)Object.freeze(w[v]);Object.freeze(w)}else g.result=Ke(w);return g}).catch(function(g){return d&&x&&Me(d,x),Promise.reject(g)}),x={obsSet:i.obsSet,promise:c,subscribers:new Set,type:"query",req:i,dirty:!1},d?d.push(x):(d=[x],(j=j||(_t["idb://".concat(t,"/").concat(n)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[i.query.index.name||""]=d)),ya(x,d,u,f),x.promise.then(function(g){return{result:Eo(g.result,i,j==null?void 0:j.optimisticOps,r,x,a)}})}})}})}};function Kn(e,t){return new Proxy(e,{get:function(n,r,o){return r==="db"?t:Reflect.get(n,r,o)}})}var ut=(_e.prototype.version=function(e){if(isNaN(e)||e<.1)throw new H.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new H.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(aa),n.stores({}),this._state.autoSchema=!1,n)},_e.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||V.letThrough||this._vip)?e():new B(function(n,r){if(t._state.openComplete)return r(new H.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void r(new H.DatabaseClosed);t.open().catch(se)}t._state.dbReadyPromise.then(n,r)}).then(e)},_e.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},_e.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},_e.prototype.open=function(){var e=this;return xt(Pe,function(){return la(e)})},_e.prototype._close=function(){var e=this._state,t=Tt.indexOf(this);if(0<=t&&Tt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new B(function(n){e.dbReadyResolve=n}),e.openCanceller=new B(function(n,r){e.cancelOpen=r}))},_e.prototype.close=function(n){var t=(n===void 0?{disableAutoOpen:!0}:n).disableAutoOpen,n=this._state;t?(n.isBeingOpened&&n.cancelOpen(new H.DatabaseClosed),this._close(),n.autoOpen=!1,n.dbOpenError=new H.DatabaseClosed):(this._close(),n.autoOpen=this._options.autoOpen||n.isBeingOpened,n.openComplete=!1,n.dbOpenError=null)},_e.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 B(function(o,i){function a(){t.close(e);var u=t._deps.indexedDB.deleteDatabase(t.name);u.onsuccess=xe(function(){var f,m,x;f=t._deps,m=t.name,x=f.indexedDB,f=f.IDBKeyRange,sr(x)||m===bn||ar(x,f).delete(m).catch(se),o()}),u.onerror=ot(i),u.onblocked=t._fireOnBlocked}if(n)throw new H.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(a):a()})},_e.prototype.backendDB=function(){return this.idbdb},_e.prototype.isOpen=function(){return this.idbdb!==null},_e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&e.name==="DatabaseClosed"},_e.prototype.hasFailed=function(){return this._state.dbOpenError!==null},_e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(_e.prototype,"tables",{get:function(){var e=this;return S(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),_e.prototype.transaction=function(){var e=(function(t,n,r){var o=arguments.length;if(o<2)throw new H.InvalidArgument("Too few arguments");for(var i=new Array(o-1);--o;)i[o-1]=arguments[o];return r=i.pop(),[t,te(i),r]}).apply(this,arguments);return this._transaction.apply(this,e)},_e.prototype._transaction=function(e,t,n){var r=this,o=V.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(m){if(m=m instanceof r.Table?m.name:m,typeof m!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return m}),e=="r"||e===Yn)i=Yn;else{if(e!="rw"&&e!=Jn)throw new H.InvalidArgument("Invalid transaction mode: "+e);i=Jn}if(o){if(o.mode===Yn&&i===Jn){if(!u)throw new H.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach(function(m){if(o&&o.storeNames.indexOf(m)===-1){if(!u)throw new H.SubTransaction("Table "+m+" not included in parent transaction.");o=null}}),u&&o&&!o.active&&(o=null)}}catch(m){return o?o._promise(null,function(x,c){c(m)}):je(m)}var f=(function m(x,c,j,d,g){return B.resolve().then(function(){var w=V.transless||V,v=x._createTransaction(c,j,x._dbSchema,d);if(v.explicit=!0,w={trans:v,transless:w},d)v.idbtrans=d.idbtrans;else try{v.create(),v.idbtrans._explicit=!0,x._state.PR1398_maxLoop=3}catch(E){return E.name===Ot.InvalidState&&x.isOpen()&&0<--x._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),x.close({disableAutoOpen:!1}),x.open().then(function(){return m(x,c,j,null,g)})):je(E)}var _,A=Z(g);return A&&Nt(),w=B.follow(function(){var E;(_=g.call(v,v))&&(A?(E=ht.bind(null,null),_.then(E,E)):typeof _.next=="function"&&typeof _.throw=="function"&&(_=pr(_)))},w),(_&&typeof _.then=="function"?B.resolve(_).then(function(E){return v.active?E:je(new H.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):w.then(function(){return _})).then(function(E){return d&&v._resolve(),v._completion.then(function(){return E})}).catch(function(E){return v._reject(E),je(E)})})}).bind(null,this,i,a,o,n);return o?o._promise(i,f,"lock"):V.trans?xt(V.transless,function(){return r._whenReady(f)}):this._whenReady(f)},_e.prototype.table=function(e){if(!W(this._allTables,e))throw new H.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},_e);function _e(e,t){var n=this;this._middlewares={},this.verno=0;var r=_e.dependencies;this._options=t=b({addons:_e.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,f,m={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:se,dbReadyPromise:null,cancelOpen:se,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:t.autoOpen};m.dbReadyPromise=new B(function(c){m.dbReadyResolve=c}),m.openCanceller=new B(function(c,j){m.cancelOpen=j}),this._state=m,this.name=e,this.on=Wt(this,"populate","blocked","versionchange","close",{ready:[Ct,se]}),this.on.ready.subscribe=Ce(this.on.ready.subscribe,function(c){return function(j,d){_e.vip(function(){var g,w=n._state;w.openComplete?(w.dbOpenError||B.resolve().then(j),d&&c(j)):w.onReadyBeingFired?(w.onReadyBeingFired.push(j),d&&c(j)):(c(j),g=n,d||c(function v(){g.on.ready.unsubscribe(j),g.on.ready.unsubscribe(v)}))})}}),this.Collection=(o=this,Ht(Zi.prototype,function(_,v){this.db=o;var d=no,g=null;if(v)try{d=v()}catch(A){g=A}var w=_._ctx,v=w.table,_=v.hook.reading.fire;this._ctx={table:v,index:w.index,isPrimKey:!w.index||v.schema.primKey.keyPath&&w.index===v.schema.primKey.name,range:d,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:g,or:w.or,valueMapper:_!==lt?_:null}})),this.Table=(i=this,Ht(ao.prototype,function(c,j,d){this.db=i,this._tx=d,this.name=c,this.schema=j,this.hook=i._allTables[c]?i._allTables[c].hook:Wt(null,{creating:[zn,se],reading:[Ut,lt],updating:[fn,se],deleting:[ln,se]})})),this.Transaction=(a=this,Ht(na.prototype,function(c,j,d,g,w){var v=this;this.db=a,this.mode=c,this.storeNames=j,this.schema=d,this.chromeTransactionDurability=g,this.idbtrans=null,this.on=Wt(this,"complete","error","abort"),this.parent=w||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 B(function(_,A){v._resolve=_,v._reject=A}),this._completion.then(function(){v.active=!1,v.on.complete.fire()},function(_){var A=v.active;return v.active=!1,v.on.error.fire(_),v.parent?v.parent._reject(_):A&&v.idbtrans&&v.idbtrans.abort(),je(_)})})),this.Version=(u=this,Ht(ca.prototype,function(c){this.db=u,this._cfg={version:c,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(f=this,Ht(fo.prototype,function(c,j,d){if(this.db=f,this._ctx={table:c,index:j===":id"?null:j,or:d},this._cmp=this._ascending=oe,this._descending=function(g,w){return oe(w,g)},this._max=function(g,w){return 0<oe(g,w)?g:w},this._min=function(g,w){return oe(g,w)<0?g:w},this._IDBKeyRange=f._deps.IDBKeyRange,!this._IDBKeyRange)throw new H.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=$t(t.IDBKeyRange),this._createTransaction=function(c,j,d,g){return new n.Transaction(c,j,d,n._options.chromeTransactionDurability,g)},this._fireOnBlocked=function(c){n.on("blocked").fire(c),Tt.filter(function(j){return j.name===n.name&&j!==n&&!j._state.vcFired}).map(function(j){return j.on("versionchange").fire(c)})},this.use(ha),this.use(va),this.use(pa),this.use(fa),this.use(da);var x=new Proxy(this,{get:function(c,j,d){if(j==="_vip")return!0;if(j==="table")return function(w){return Kn(n.table(w),x)};var g=Reflect.get(c,j,d);return g instanceof ao?Kn(g,x):j==="tables"?g.map(function(w){return Kn(w,x)}):j==="_createTransaction"?function(){return Kn(g.apply(this,arguments),x)}:g}});this.vip=x,r.forEach(function(c){return c(n)})}var Mn,tt=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",ga=(gr.prototype.subscribe=function(e,t,n){return this._subscribe(e&&typeof e!="function"?e:{next:e,error:t,complete:n})},gr.prototype[tt]=function(){return this},gr);function gr(e){this._subscribe=e}try{Mn={indexedDB:k.indexedDB||k.mozIndexedDB||k.webkitIndexedDB||k.msIndexedDB,IDBKeyRange:k.IDBKeyRange||k.webkitIDBKeyRange}}catch{Mn={indexedDB:null,IDBKeyRange:null}}function Oo(e){var t,n=!1,r=new ga(function(o){var i=Z(e),a,u=!1,f={},m={},x={get closed(){return u},unsubscribe:function(){u||(u=!0,a&&a.abort(),c&&yt.storagemutated.unsubscribe(d))}};o.start&&o.start(x);var c=!1,j=function(){return Hn(g)},d=function(w){Nn(f,w),lr(m,f)&&j()},g=function(){var w,v,_;!u&&Mn.indexedDB&&(f={},w={},a&&a.abort(),a=new AbortController,_=function(A){var E=St();try{i&&Nt();var C=dt(e,A);return C=i?C.finally(ht):C}finally{E&&Pt()}}(v={subscr:w,signal:a.signal,requery:j,querier:e,trans:null}),Promise.resolve(_).then(function(A){n=!0,t=A,u||v.signal.aborted||(f={},function(E){for(var C in E)if(W(E,C))return;return 1}(m=w)||c||(yt(Gt,d),c=!0),Hn(function(){return!u&&o.next&&o.next(A)}))},function(A){n=!1,["DatabaseClosedError","AbortError"].includes(A==null?void 0:A.name)||u||Hn(function(){u||o.error&&o.error(A)})}))};return setTimeout(j,0),x});return r.hasValue=function(){return n},r.getValue=function(){return t},r}var At=ut;function br(e){var t=vt;try{vt=!0,yt.storagemutated.fire(e),hr(e,!0)}finally{vt=t}}G(At,b(b({},gt),{delete:function(e){return new At(e,{addons:[]}).delete()},exists:function(e){return new At(e,{addons:[]}).open().then(function(t){return t.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{return t=At.dependencies,n=t.indexedDB,t=t.IDBKeyRange,(sr(n)?Promise.resolve(n.databases()).then(function(r){return r.map(function(o){return o.name}).filter(function(o){return o!==bn})}):ar(n,t).toCollection().primaryKeys()).then(e)}catch{return je(new H.MissingAPI)}var t,n},defineClass:function(){return function(e){M(this,e)}},ignoreTransaction:function(e){return V.trans?xt(V.transless,e):e()},vip:ur,async:function(e){return function(){try{var t=pr(e.apply(this,arguments));return t&&typeof t.then=="function"?t:B.resolve(t)}catch(n){return je(n)}}},spawn:function(e,t,n){try{var r=pr(e.apply(n,t||[]));return r&&typeof r.then=="function"?r:B.resolve(r)}catch(o){return je(o)}},currentTransaction:{get:function(){return V.trans||null}},waitFor:function(e,t){return t=B.resolve(typeof e=="function"?At.ignoreTransaction(e):e).timeout(t||6e4),V.trans?V.trans.waitFor(t):t},Promise:B,debug:{get:function(){return l},set:function(e){z(e)}},derive:he,extend:M,props:G,override:Ce,Events:Wt,on:yt,liveQuery:Oo,extendObservabilitySet:Nn,getByKeyPath:ae,setByKeyPath:$,delByKeyPath:function(e,t){typeof t=="string"?$(e,t,void 0):"length"in t&&[].map.call(t,function(n){$(e,n,void 0)})},shallowClone:Se,deepClone:Ke,getObjectDiff:mr,cmp:oe,asap:ve,minKey:-1/0,addons:[],connections:Tt,errnames:Ot,dependencies:Mn,cache:_t,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)})})),At.maxKey=$t(At.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(yt(Gt,function(e){vt||(e=new CustomEvent(Zn,{detail:e}),vt=!0,dispatchEvent(e),vt=!1)}),addEventListener(Zn,function(e){e=e.detail,vt||br(e)}));var Mt,vt=!1,Co=function(){};return typeof BroadcastChannel<"u"&&((Co=function(){(Mt=new BroadcastChannel(Zn)).onmessage=function(e){return e.data&&br(e.data)}})(),typeof Mt.unref=="function"&&Mt.unref(),yt(Gt,function(e){vt||Mt.postMessage(e)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(e){if(!ut.disableBfCache&&e.persisted){l&&console.debug("Dexie: handling persisted pagehide"),Mt!=null&&Mt.close();for(var t=0,n=Tt;t<n.length;t++)n[t].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(e){!ut.disableBfCache&&e.persisted&&(l&&console.debug("Dexie: handling persisted pageshow"),Co(),br({all:new Ie(-1/0,[[]])}))})),B.rejectionMapper=function(e,t){return!e||e instanceof be||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Qt[e.name]?e:(t=new Qt[e.name](t||e.message,e),"stack"in e&&fe(t,"stack",{get:function(){return this.inner.stack}}),t)},z(l),b(ut,Object.freeze({__proto__:null,Dexie:ut,liveQuery:Oo,Entity:ro,cmp:oe,PropModification:Yt,replacePrefix:function(e,t){return new Yt({replacePrefix:[e,t]})},add:function(e){return new Yt({add:e})},remove:function(e){return new Yt({remove:e})},default:ut,RangeSet:Ie,mergeRanges:en,rangesOverlap:vo}),{default:ut}),ut})}(nn)),nn.exports}var Io=Mo();const Dn=Po(Io),Er=Symbol.for("Dexie"),rn=globalThis[Er]||(globalThis[Er]=Dn);if(Dn.semVer!==rn.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Dn.semVer} and ${rn.semVer}`);const{liveQuery:Do,mergeRanges:ba,rangesOverlap:xa,RangeSet:wa,cmp:ja,Entity:_a,PropModification:Aa,replacePrefix:Ea,add:ka,remove:Oa}=rn;function Bo(s,p,h){var b,O;typeof s=="function"?(b=p||[],O=h):(b=[],O=p);var k=q.useRef({hasResult:!1,result:O,error:null}),S=q.useReducer(function(Q){return Q+1},0);S[0];var P=S[1],M=q.useMemo(function(){var Q=typeof s=="function"?s():s;if(!Q||typeof Q.subscribe!="function")throw s===Q?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(!k.current.hasResult&&typeof window<"u"&&(typeof Q.hasValue!="function"||Q.hasValue()))if(typeof Q.getValue=="function")k.current.result=Q.getValue(),k.current.hasResult=!0;else{var U=Q.subscribe(function(W){k.current.result=W,k.current.hasResult=!0});typeof U=="function"?U():U.unsubscribe()}return Q},b);if(q.useDebugValue(k.current.result),q.useEffect(function(){var Q=M.subscribe(function(U){var W=k.current;(W.error!==null||W.result!==U)&&(W.error=null,W.result=U,W.hasResult=!0,P())},function(U){var W=k.current;W.error!==U&&(W.error=U,P())});return typeof Q=="function"?Q:Q.unsubscribe.bind(Q)},b),k.current.error)throw k.current.error;return k.current.result}function kr(s,p,h){return Bo(function(){return Do(s)},p||[],h)}const Bn=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",qo=["bg-blue-100","border-l-4","border-blue-700"].join(" "),Or=({request:s,reqId:p,onSelect:h,onRemove:b,selected:O})=>{var S,P;const k=M=>{h(M)};return y.jsx("li",{className:`flex items-center cursor-pointer hover:bg-gray-200 ${O?qo:""}`,onClick:()=>{k(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 ${Bn((S=s==null?void 0:s.response)==null?void 0:S.statusCode)}`,children:((P=s==null?void 0:s.response)==null?void 0:P.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:M=>{M.stopPropagation(),b(p)},children:"✕"})]})})},Cr=({isOpen:s,onClose:p,sortField:h,sortDirection:b,filters:O,setSortField:k,setSortDirection:S,setFilters:P})=>{const M=()=>{k("time"),S("asc")},Q=()=>{P({})};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
34
+ ${s?"translate-x-0":"-translate-x-full"}
35
+ `,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:M,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:h==="time",onChange:U=>k(U.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:h==="statusCode",onChange:U=>k(U.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:h==="method",onChange:U=>k(U.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:U=>S(U.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:U=>S(U.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:Q,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:U=>P(W=>({...W,status:U.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:U=>P(W=>({...W,method:U.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:U=>P(W=>({...W,path:U.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:U=>P(W=>({...W,durationMin:U.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:U=>P(W=>({...W,durationMax:U.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:U=>P(W=>({...W,host:U.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"})]})]})]})]})]})]})},Sr=({currentPage:s,totalPages:p,onPageChange:h})=>{const O=((k,S)=>{const P=[];if(S<=7)for(let M=1;M<=S;M++)P.push(M);else if(k<=4){for(let M=1;M<=5;M++)P.push(M);P.push("ellipsis"),P.push(S)}else if(k>=S-3){P.push(1),P.push("ellipsis");for(let M=S-4;M<=S;M++)P.push(M)}else P.push(1),P.push("ellipsis"),P.push(k-1),P.push(k),P.push(k+1),P.push("ellipsis"),P.push(S);return P})(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:()=>h(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"})})]})}),O.map((k,S)=>{if(k==="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-${S}`);const P=k===s;return y.jsx("li",{children:y.jsx("button",{onClick:()=>h(k),className:P?"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:k})},k)}),y.jsx("li",{children:y.jsxs("button",{onClick:()=>h(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"})})]})})]})})},Pr=({requests:s,onSelect:p,onRemove:h,clearRequests:b,selectedRequest:O,currentPage:k,totalPages:S,totalCount:P,onPageChange:M,sortField:Q,sortDirection:U,filters:W,setSortField:G,setSortDirection:Ae,setFilters:fe})=>{const[he,me]=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 ",P,")"]}),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:()=>me(!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:()=>me(!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((We,de)=>{const Ce=We.id||de;return y.jsx(Or,{reqId:Ce,request:We,onSelect:p,onRemove:h,selected:O&&O.id===Ce},Ce)})}),y.jsx(Sr,{currentPage:k,totalPages:S,onPageChange:M}),y.jsx(Cr,{isOpen:he,onClose:()=>me(!1),sortField:Q,sortDirection:U,filters:W,setSortField:G,setSortDirection:Ae,setFilters:fe})]})},Nr=({request:s})=>{var h,b;const p=O=>{if(!O)return"N/A";const k=new Date(O),S=k.toLocaleDateString("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}),P=k.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return`${S} at ${P}`};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 ${Bn((h=s==null?void 0:s.response)==null?void 0:h.statusCode)}`,children:(b=s==null?void 0:s.response)==null?void 0:b.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 ",p(s.request.timestamp)," • Took ",s.latency,"ms to respond"]})]})]})};function Fo(s,p,h){return p in s?Object.defineProperty(s,p,{value:h,enumerable:!0,configurable:!0,writable:!0}):s[p]=h,s}function Tr(s,p){var h=Object.keys(s);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(s);p&&(b=b.filter(function(O){return Object.getOwnPropertyDescriptor(s,O).enumerable})),h.push.apply(h,b)}return h}function Rr(s){for(var p=1;p<arguments.length;p++){var h=arguments[p]!=null?arguments[p]:{};p%2?Tr(Object(h),!0).forEach(function(b){Fo(s,b,h[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(h)):Tr(Object(h)).forEach(function(b){Object.defineProperty(s,b,Object.getOwnPropertyDescriptor(h,b))})}return s}function Lo(s,p){if(s==null)return{};var h={},b=Object.keys(s),O,k;for(k=0;k<b.length;k++)O=b[k],!(p.indexOf(O)>=0)&&(h[O]=s[O]);return h}function zo(s,p){if(s==null)return{};var h=Lo(s,p),b,O;if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(s);for(O=0;O<k.length;O++)b=k[O],!(p.indexOf(b)>=0)&&Object.prototype.propertyIsEnumerable.call(s,b)&&(h[b]=s[b])}return h}function Qo(s,p){return Uo(s)||Vo(s,p)||Wo(s,p)||Ho()}function Uo(s){if(Array.isArray(s))return s}function Vo(s,p){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(s)))){var h=[],b=!0,O=!1,k=void 0;try{for(var S=s[Symbol.iterator](),P;!(b=(P=S.next()).done)&&(h.push(P.value),!(p&&h.length===p));b=!0);}catch(M){O=!0,k=M}finally{try{!b&&S.return!=null&&S.return()}finally{if(O)throw k}}return h}}function Wo(s,p){if(s){if(typeof s=="string")return Kr(s,p);var h=Object.prototype.toString.call(s).slice(8,-1);if(h==="Object"&&s.constructor&&(h=s.constructor.name),h==="Map"||h==="Set")return Array.from(s);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return Kr(s,p)}}function Kr(s,p){(p==null||p>s.length)&&(p=s.length);for(var h=0,b=new Array(p);h<p;h++)b[h]=s[h];return b}function Ho(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
36
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yo(s,p,h){return p in s?Object.defineProperty(s,p,{value:h,enumerable:!0,configurable:!0,writable:!0}):s[p]=h,s}function Mr(s,p){var h=Object.keys(s);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(s);p&&(b=b.filter(function(O){return Object.getOwnPropertyDescriptor(s,O).enumerable})),h.push.apply(h,b)}return h}function Ir(s){for(var p=1;p<arguments.length;p++){var h=arguments[p]!=null?arguments[p]:{};p%2?Mr(Object(h),!0).forEach(function(b){Yo(s,b,h[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(h)):Mr(Object(h)).forEach(function(b){Object.defineProperty(s,b,Object.getOwnPropertyDescriptor(h,b))})}return s}function Jo(){for(var s=arguments.length,p=new Array(s),h=0;h<s;h++)p[h]=arguments[h];return function(b){return p.reduceRight(function(O,k){return k(O)},b)}}function Bt(s){return function p(){for(var h=this,b=arguments.length,O=new Array(b),k=0;k<b;k++)O[k]=arguments[k];return O.length>=s.length?s.apply(this,O):function(){for(var S=arguments.length,P=new Array(S),M=0;M<S;M++)P[M]=arguments[M];return p.apply(h,[].concat(O,P))}}}function on(s){return{}.toString.call(s).includes("Object")}function Go(s){return!Object.keys(s).length}function qt(s){return typeof s=="function"}function $o(s,p){return Object.prototype.hasOwnProperty.call(s,p)}function Xo(s,p){return on(p)||ct("changeType"),Object.keys(p).some(function(h){return!$o(s,h)})&&ct("changeField"),p}function Zo(s){qt(s)||ct("selectorType")}function ei(s){qt(s)||on(s)||ct("handlerType"),on(s)&&Object.values(s).some(function(p){return!qt(p)})&&ct("handlersType")}function ti(s){s||ct("initialIsRequired"),on(s)||ct("initialType"),Go(s)&&ct("initialContent")}function ni(s,p){throw new Error(s[p]||s.default)}var ri={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"},ct=Bt(ni)(ri),an={changes:Xo,selector:Zo,handler:ei,initial:ti};function oi(s){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};an.initial(s),an.handler(p);var h={current:s},b=Bt(si)(h,p),O=Bt(ai)(h),k=Bt(an.changes)(s),S=Bt(ii)(h);function P(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(U){return U};return an.selector(Q),Q(h.current)}function M(Q){Jo(b,O,k,S)(Q)}return[P,M]}function ii(s,p){return qt(p)?p(s.current):p}function ai(s,p){return s.current=Ir(Ir({},s.current),p),p}function si(s,p,h){return qt(p)?p(s.current):Object.keys(h).forEach(function(b){var O;return(O=p[b])===null||O===void 0?void 0:O.call(p,s.current[b])}),h}var ui={create:oi},ci={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function li(s){return function p(){for(var h=this,b=arguments.length,O=new Array(b),k=0;k<b;k++)O[k]=arguments[k];return O.length>=s.length?s.apply(this,O):function(){for(var S=arguments.length,P=new Array(S),M=0;M<S;M++)P[M]=arguments[M];return p.apply(h,[].concat(O,P))}}}function fi(s){return{}.toString.call(s).includes("Object")}function di(s){return s||Br("configIsRequired"),fi(s)||Br("configType"),s.urls?(hi(),{paths:{vs:s.urls.monacoBase}}):s}function hi(){console.warn(Dr.deprecation)}function pi(s,p){throw new Error(s[p]||s.default)}var Dr={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!
33
37
  You are using deprecated way of configuration.
34
38
 
35
39
  Instead of using
@@ -38,4 +42,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
38
42
  monaco.config({ paths: { vs: '...' } })
39
43
 
40
44
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
41
- `},Je=Bt(Dt)(ze),Ft={config:Jt},Wt=function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return function(s){return n.reduceRight(function(i,d){return d(i)},s)}};function qe(e,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&e[n]&&Object.assign(r[n],qe(e[n],r[n]))}),Le(Le({},e),r)}var Ht={type:"cancelation",msg:"operation is manually canceled"};function Ae(e){var r=!1,n=new Promise(function(o,s){e.then(function(i){return r?s(Ht):o(i)}),e.catch(s)});return n.cancel=function(){return r=!0},n}var Ut=Qt.create({config:It,isInitialized:!1,resolve:null,reject:null,monaco:null}),De=ht(Ut,2),ue=De[0],he=De[1];function Yt(e){var r=Ft.config(e),n=r.monaco,o=mt(r,["monaco"]);he(function(s){return{config:qe(s.config,o),monaco:n}})}function Vt(){var e=ue(function(r){var n=r.monaco,o=r.isInitialized,s=r.resolve;return{monaco:n,isInitialized:o,resolve:s}});if(!e.isInitialized){if(he({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Ae(ye);if(window.monaco&&window.monaco.editor)return Fe(window.monaco),e.resolve(window.monaco),Ae(ye);Wt(_t,Gt)(Xt)}return Ae(ye)}function _t(e){return document.body.appendChild(e)}function Zt(e){var r=document.createElement("script");return e&&(r.src=e),r}function Gt(e){var r=ue(function(o){var s=o.config,i=o.reject;return{config:s,reject:i}}),n=Zt("".concat(r.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=r.reject,n}function Xt(){var e=ue(function(n){var o=n.config,s=n.resolve,i=n.reject;return{config:o,resolve:s,reject:i}}),r=window.require;r.config(e.config),r(["vs/editor/editor.main"],function(n){Fe(n),e.resolve(n)},function(n){e.reject(n)})}function Fe(e){ue().monaco||he({monaco:e})}function $t(){return ue(function(e){var r=e.monaco;return r})}var ye=new Promise(function(e,r){return he({resolve:e,reject:r})}),We={config:Yt,init:Vt,__getMonacoInstance:$t},Kt={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},we=Kt,er={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},tr=er;function rr({children:e}){return l.createElement("div",{style:tr.container},e)}var nr=rr,or=nr;function ar({width:e,height:r,isEditorReady:n,loading:o,_ref:s,className:i,wrapperProps:d}){return l.createElement("section",{style:{...we.wrapper,width:e,height:r},...d},!n&&l.createElement(or,null,o),l.createElement("div",{ref:s,style:{...we.fullWidth,...!n&&we.hide},className:i}))}var sr=ar,He=l.memo(sr);function ir(e){l.useEffect(e,[])}var Ue=ir;function lr(e,r,n=!0){let o=l.useRef(!0);l.useEffect(o.current||!n?()=>{o.current=!1}:e,r)}var I=lr;function de(){}function oe(e,r,n,o){return cr(e,o)||ur(e,r,n,o)}function cr(e,r){return e.editor.getModel(Ye(e,r))}function ur(e,r,n,o){return e.editor.createModel(r,n,o?Ye(e,o):void 0)}function Ye(e,r){return e.Uri.parse(r)}function dr({original:e,modified:r,language:n,originalLanguage:o,modifiedLanguage:s,originalModelPath:i,modifiedModelPath:d,keepCurrentOriginalModel:f=!1,keepCurrentModifiedModel:p=!1,theme:x="light",loading:N="Loading...",options:R={},height:te="100%",width:Q="100%",className:B,wrapperProps:z={},beforeMount:P=de,onMount:H=de}){let[T,re]=l.useState(!1),[q,C]=l.useState(!0),E=l.useRef(null),w=l.useRef(null),G=l.useRef(null),S=l.useRef(H),v=l.useRef(P),W=l.useRef(!1);Ue(()=>{let g=We.init();return g.then(j=>(w.current=j)&&C(!1)).catch(j=>(j==null?void 0:j.type)!=="cancelation"&&console.error("Monaco initialization: error:",j)),()=>E.current?U():g.cancel()}),I(()=>{if(E.current&&w.current){let g=E.current.getOriginalEditor(),j=oe(w.current,e||"",o||n||"text",i||"");j!==g.getModel()&&g.setModel(j)}},[i],T),I(()=>{if(E.current&&w.current){let g=E.current.getModifiedEditor(),j=oe(w.current,r||"",s||n||"text",d||"");j!==g.getModel()&&g.setModel(j)}},[d],T),I(()=>{let g=E.current.getModifiedEditor();g.getOption(w.current.editor.EditorOption.readOnly)?g.setValue(r||""):r!==g.getValue()&&(g.executeEdits("",[{range:g.getModel().getFullModelRange(),text:r||"",forceMoveMarkers:!0}]),g.pushUndoStop())},[r],T),I(()=>{var g,j;(j=(g=E.current)==null?void 0:g.getModel())==null||j.original.setValue(e||"")},[e],T),I(()=>{let{original:g,modified:j}=E.current.getModel();w.current.editor.setModelLanguage(g,o||n||"text"),w.current.editor.setModelLanguage(j,s||n||"text")},[n,o,s],T),I(()=>{var g;(g=w.current)==null||g.editor.setTheme(x)},[x],T),I(()=>{var g;(g=E.current)==null||g.updateOptions(R)},[R],T);let X=l.useCallback(()=>{var D;if(!w.current)return;v.current(w.current);let g=oe(w.current,e||"",o||n||"text",i||""),j=oe(w.current,r||"",s||n||"text",d||"");(D=E.current)==null||D.setModel({original:g,modified:j})},[n,r,s,e,o,i,d]),$=l.useCallback(()=>{var g;!W.current&&G.current&&(E.current=w.current.editor.createDiffEditor(G.current,{automaticLayout:!0,...R}),X(),(g=w.current)==null||g.editor.setTheme(x),re(!0),W.current=!0)},[R,x,X]);l.useEffect(()=>{T&&S.current(E.current,w.current)},[T]),l.useEffect(()=>{!q&&!T&&$()},[q,T,$]);function U(){var j,D,K,J;let g=(j=E.current)==null?void 0:j.getModel();f||((D=g==null?void 0:g.original)==null||D.dispose()),p||((K=g==null?void 0:g.modified)==null||K.dispose()),(J=E.current)==null||J.dispose()}return l.createElement(He,{width:Q,height:te,isEditorReady:T,loading:N,_ref:G,className:B,wrapperProps:z})}var fr=dr;l.memo(fr);function gr(e){let r=l.useRef();return l.useEffect(()=>{r.current=e},[e]),r.current}var pr=gr,be=new Map;function mr({defaultValue:e,defaultLanguage:r,defaultPath:n,value:o,language:s,path:i,theme:d="light",line:f,loading:p="Loading...",options:x={},overrideServices:N={},saveViewState:R=!0,keepCurrentModel:te=!1,width:Q="100%",height:B="100%",className:z,wrapperProps:P={},beforeMount:H=de,onMount:T=de,onChange:re,onValidate:q=de}){let[C,E]=l.useState(!1),[w,G]=l.useState(!0),S=l.useRef(null),v=l.useRef(null),W=l.useRef(null),X=l.useRef(T),$=l.useRef(H),U=l.useRef(),g=l.useRef(o),j=pr(i),D=l.useRef(!1),K=l.useRef(!1);Ue(()=>{let h=We.init();return h.then(A=>(S.current=A)&&G(!1)).catch(A=>(A==null?void 0:A.type)!=="cancelation"&&console.error("Monaco initialization: error:",A)),()=>v.current?ve():h.cancel()}),I(()=>{var A,O,F,Y;let h=oe(S.current,e||o||"",r||s||"",i||n||"");h!==((A=v.current)==null?void 0:A.getModel())&&(R&&be.set(j,(O=v.current)==null?void 0:O.saveViewState()),(F=v.current)==null||F.setModel(h),R&&((Y=v.current)==null||Y.restoreViewState(be.get(i))))},[i],C),I(()=>{var h;(h=v.current)==null||h.updateOptions(x)},[x],C),I(()=>{!v.current||o===void 0||(v.current.getOption(S.current.editor.EditorOption.readOnly)?v.current.setValue(o):o!==v.current.getValue()&&(K.current=!0,v.current.executeEdits("",[{range:v.current.getModel().getFullModelRange(),text:o,forceMoveMarkers:!0}]),v.current.pushUndoStop(),K.current=!1))},[o],C),I(()=>{var A,O;let h=(A=v.current)==null?void 0:A.getModel();h&&s&&((O=S.current)==null||O.editor.setModelLanguage(h,s))},[s],C),I(()=>{var h;f!==void 0&&((h=v.current)==null||h.revealLine(f))},[f],C),I(()=>{var h;(h=S.current)==null||h.editor.setTheme(d)},[d],C);let J=l.useCallback(()=>{var h;if(!(!W.current||!S.current)&&!D.current){$.current(S.current);let A=i||n,O=oe(S.current,o||e||"",r||s||"",A||"");v.current=(h=S.current)==null?void 0:h.editor.create(W.current,{model:O,automaticLayout:!0,...x},N),R&&v.current.restoreViewState(be.get(A)),S.current.editor.setTheme(d),f!==void 0&&v.current.revealLine(f),E(!0),D.current=!0}},[e,r,n,o,s,i,x,N,R,d,f]);l.useEffect(()=>{C&&X.current(v.current,S.current)},[C]),l.useEffect(()=>{!w&&!C&&J()},[w,C,J]),g.current=o,l.useEffect(()=>{var h,A;C&&re&&((h=U.current)==null||h.dispose(),U.current=(A=v.current)==null?void 0:A.onDidChangeModelContent(O=>{K.current||re(v.current.getValue(),O)}))},[C,re]),l.useEffect(()=>{if(C){let h=S.current.editor.onDidChangeMarkers(A=>{var F;let O=(F=v.current.getModel())==null?void 0:F.uri;if(O&&A.find(Y=>Y.path===O.path)){let Y=S.current.editor.getModelMarkers({resource:O});q==null||q(Y)}});return()=>{h==null||h.dispose()}}return()=>{}},[C,q]);function ve(){var h,A;(h=U.current)==null||h.dispose(),te?R&&be.set(i,v.current.saveViewState()):(A=v.current.getModel())==null||A.dispose(),v.current.dispose()}return l.createElement(He,{width:Q,height:B,isEditorReady:C,loading:p,_ref:W,className:z,wrapperProps:P})}var hr=mr,br=l.memo(hr),Ve=br;const _e=({request:e})=>{const[r,n]=l.useState(!1),[o,s]=l.useState(!1),i=x=>Object.entries(x||{}).map(([N,R])=>a.jsxs("tr",{children:[a.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-slate-500 text-xs",children:N}),a.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-xs",children:R})]},N)),d=e.request.payload,f=!d||typeof d=="object"&&Object.keys(d).length===0||typeof d=="string"&&(d.trim()===""||d.trim()==="{}"),p=x=>{try{const N=JSON.parse(x);return JSON.stringify(N,null,2)}catch{return x}};return a.jsxs("div",{children:[a.jsxs("div",{className:"mb-4",children:[a.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200",onClick:()=>n(!r),children:["Query Parameters (",Object.keys(e.request.queryParams||{}).length,")"]}),r&&a.jsx("div",{className:"p-0",children:a.jsxs("table",{className:"w-full border-collapse border border-gray-300",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-gray-100",children:[a.jsx("th",{className:"border border-slate-200 px-2 py-1 w-1/4 text-left",children:"Key"}),a.jsx("th",{className:"border border-slate-200 px-2 py-1 text-left",children:"Value"})]})}),a.jsx("tbody",{children:i(e.request.queryParams)})]})})]}),a.jsxs("div",{className:"mb-4",children:[a.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200",onClick:()=>s(!o),children:["Headers (",Object.keys(e.request.headers||{}).length,")"]}),o&&a.jsx("div",{className:"p-0",children:a.jsxs("table",{className:"w-full border-collapse border border-gray-300",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-gray-100",children:[a.jsx("th",{className:"border border-slate-200 px-2 py-1 w-1/4 text-left",children:"Header"}),a.jsx("th",{className:"border border-slate-200 px-2 py-1 text-left",children:"Value"})]})}),a.jsx("tbody",{children:i(e.request.headers)})]})})]}),a.jsxs("div",{children:[a.jsx("button",{className:"w-full p-2 text-left font-bold bg-gray-200",children:"Request Body"}),f?a.jsx("div",{className:"hidden"}):a.jsx("div",{className:"bg-white rounded-b shadow p-0 h-100",children:a.jsx(Ve,{height:"100%",defaultLanguage:"json",value:p(d),options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})})]})]})},Ze=({request:e})=>{const[r,n]=l.useState(!1),o=f=>Object.entries(f||{}).map(([p,x])=>a.jsxs("tr",{children:[a.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-slate-500 text-xs",children:p}),a.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-xs",children:x})]},p)),s=e.response.payload,i=!s||typeof s=="object"&&Object.keys(s).length===0||typeof s=="string"&&(s.trim()===""||s.trim()==="{}"),d=f=>{try{const p=JSON.parse(f);return JSON.stringify(p,null,2)}catch{return f}};return a.jsxs("div",{children:[a.jsxs("div",{className:"mb-4",children:[a.jsxs("button",{className:"w-full p-2 text-left font-bold bg-gray-200",onClick:()=>n(!r),children:["Headers (",Object.keys(e.response.headers||{}).length,")"]}),r&&a.jsx("div",{className:"p-0",children:a.jsxs("table",{className:"w-full border-collapse border border-gray-300",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-gray-100",children:[a.jsx("th",{className:"border border-slate-200 px-2 py-1 w-1/4 text-left",children:"Header"}),a.jsx("th",{className:"border border-slate-200 px-2 py-1 text-left",children:"Value"})]})}),a.jsx("tbody",{children:o(e.response.headers)})]})})]}),a.jsxs("div",{children:[a.jsx("button",{className:"w-full p-2 text-left font-bold bg-gray-200",children:"Response Body"}),i?a.jsx("div",{className:"hidden"}):a.jsx("div",{className:"bg-white rounded-b shadow p-0 h-100",children:a.jsx(Ve,{height:"100%",defaultLanguage:"json",value:d(s),options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})})]})]})},Ge=({request:e,currentTab:r,setCurrentTab:n})=>e?a.jsxs("div",{children:[a.jsx(Me,{request:e}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("button",{className:`px-4 py-2 rounded-t ${r==="request"?"bg-blue-600 text-white":"bg-gray-200 text-gray-700"}`,onClick:()=>n("request"),children:"Request"}),a.jsx("button",{className:`px-4 py-2 rounded-t ${r==="response"?"bg-blue-600 text-white":"bg-gray-200 text-gray-700"}`,onClick:()=>n("response"),children:"Response"})]}),a.jsx("div",{className:"p-4 bg-white rounded-b shadow",children:r==="request"?a.jsx(_e,{request:e}):a.jsx(Ze,{request:e})})]}):a.jsx("div",{className:"text-gray-500",children:"No request selected."}),vr="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==",Xe=({sseEndpoint:e,setSseEndpoint:r,isConnected:n})=>{const[o,s]=l.useState(!1),[i,d]=l.useState(e);l.useEffect(()=>{if(typeof window<"u"){const p=localStorage.getItem("sseEndpoint");!e&&p&&(d(p),r(p))}},[e,r]);const f=()=>{typeof window<"u"&&localStorage.setItem("sseEndpoint",i),r(i),s(!1)};return a.jsxs("div",{className:"fixed bottom-0 left-0 w-full",children:[a.jsxs("div",{className:"flex items-center justify-between bg-gray-200 px-4 py-2 w-full cursor-pointer select-none",onClick:()=>s(p=>!p),children:[a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs("span",{className:`px-2 py-1 rounded-full text-xs font-semibold flex items-center ${n?"bg-green-500":"bg-red-500"}`,children:[a.jsx("span",{className:`w-2 h-2 rounded-full mr-1 ${n?"bg-green-800":"bg-red-800"}`}),n?"Connected":"Disconnected"]})}),a.jsxs("a",{href:"https://github.com/thim81/inspectr",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[a.jsx("img",{src:vr,alt:"Inspectr Logo",className:"h-6"}),a.jsx("span",{className:"text-gray-700 font-semibold text-sm",children:"Inspectr"})]})]}),a.jsx("div",{className:`bg-gray-100 border-t border-gray-300 transition-all duration-300 overflow-hidden ${o?"max-h-40 opacity-100 py-4":"max-h-0 opacity-0 py-0"}`,children:a.jsxs("div",{className:"px-6",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4 items-center",children:[a.jsx("div",{children:a.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Configuration"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("label",{className:"text-gray-700 font-semibold whitespace-nowrap",children:"SSE Endpoint:"}),a.jsx("input",{type:"text",value:i,onChange:p=>d(p.target.value),className:"border p-2 rounded flex-1 bg-white",placeholder:"Enter SSE Endpoint..."})]})]}),a.jsx("div",{className:"flex justify-end mt-4",children:a.jsx("button",{onClick:f,className:"bg-green-600 text-white px-4 py-2 rounded-md",children:"Apply"})})]})})]})},xr=({sseEndpoint:e})=>{const[r,n]=l.useState([]),[o,s]=l.useState(null),[i,d]=l.useState("request"),[f,p]=l.useState("/api/sse"),[x,N]=l.useState(!1);l.useEffect(()=>{if(typeof window<"u"){const Q=localStorage.getItem("sseEndpoint");!e&&Q&&p(Q)}},[f]),l.useEffect(()=>{const Q=()=>`req-${Math.random().toString(36).substr(2,9)}`,B=new EventSource(f);return console.log(`EventSource created with URL: ${f}`),B.onopen=()=>{console.log("SSE connection opened"),N(!0)},B.onmessage=z=>{try{const P=JSON.parse(z.data);P.id||(P.id=Q()),n(H=>(H.length===0&&s(P),[P,...H]))}catch(P){console.error("Error parsing SSE data:",P)}},B.onerror=z=>{console.error("SSE error:",z),N(!1)},()=>{console.log("Closing EventSource"),B.close(),N(!1)}},[f]);const R=()=>{n([]),s(null)},te=Q=>{n(B=>B.filter((z,P)=>z.id?z.id!==Q:P!==Q)),o&&(o.id||"")===Q&&s(null)};return a.jsxs("div",{className:"flex flex-col h-screen",children:[a.jsxs("div",{className:"flex flex-grow",children:[a.jsx("div",{className:"w-1/3 border-r border-gray-300 overflow-y-auto",children:a.jsx(Te,{requests:r,onSelect:s,onRemove:te,clearRequests:R,selectedRequest:o})}),a.jsx("div",{className:"w-2/3 p-4",children:a.jsx(Ge,{request:o,currentTab:i,setCurrentTab:d})})]}),a.jsx(Xe,{sseEndpoint:f,setSseEndpoint:p,isConnected:x})]})};k.InspectrApp=xr,k.RequestContent=_e,k.RequestDetail=Me,k.RequestDetailsPanel=Ge,k.RequestList=Te,k.RequestListItem=Pe,k.ResponseContent=Ze,k.SettingsPanel=Xe,k.getStatusClass=je,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
45
+ `},Br=li(pi)(Dr),mi={config:di},yi=function(){for(var p=arguments.length,h=new Array(p),b=0;b<p;b++)h[b]=arguments[b];return function(O){return h.reduceRight(function(k,S){return S(k)},O)}};function qr(s,p){return Object.keys(p).forEach(function(h){p[h]instanceof Object&&s[h]&&Object.assign(p[h],qr(s[h],p[h]))}),Rr(Rr({},s),p)}var vi={type:"cancelation",msg:"operation is manually canceled"};function qn(s){var p=!1,h=new Promise(function(b,O){s.then(function(k){return p?O(vi):b(k)}),s.catch(O)});return h.cancel=function(){return p=!0},h}var gi=ui.create({config:ci,isInitialized:!1,resolve:null,reject:null,monaco:null}),Fr=Qo(gi,2),Ft=Fr[0],sn=Fr[1];function bi(s){var p=mi.config(s),h=p.monaco,b=zo(p,["monaco"]);sn(function(O){return{config:qr(O.config,b),monaco:h}})}function xi(){var s=Ft(function(p){var h=p.monaco,b=p.isInitialized,O=p.resolve;return{monaco:h,isInitialized:b,resolve:O}});if(!s.isInitialized){if(sn({isInitialized:!0}),s.monaco)return s.resolve(s.monaco),qn(Fn);if(window.monaco&&window.monaco.editor)return Lr(window.monaco),s.resolve(window.monaco),qn(Fn);yi(wi,_i)(Ai)}return qn(Fn)}function wi(s){return document.body.appendChild(s)}function ji(s){var p=document.createElement("script");return s&&(p.src=s),p}function _i(s){var p=Ft(function(b){var O=b.config,k=b.reject;return{config:O,reject:k}}),h=ji("".concat(p.config.paths.vs,"/loader.js"));return h.onload=function(){return s()},h.onerror=p.reject,h}function Ai(){var s=Ft(function(h){var b=h.config,O=h.resolve,k=h.reject;return{config:b,resolve:O,reject:k}}),p=window.require;p.config(s.config),p(["vs/editor/editor.main"],function(h){Lr(h),s.resolve(h)},function(h){s.reject(h)})}function Lr(s){Ft().monaco||sn({monaco:s})}function Ei(){return Ft(function(s){var p=s.monaco;return p})}var Fn=new Promise(function(s,p){return sn({resolve:s,reject:p})}),zr={config:bi,init:xi,__getMonacoInstance:Ei},ki={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ln=ki,Oi={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Ci=Oi;function Si({children:s}){return q.createElement("div",{style:Ci.container},s)}var Pi=Si,Ni=Pi;function Ti({width:s,height:p,isEditorReady:h,loading:b,_ref:O,className:k,wrapperProps:S}){return q.createElement("section",{style:{...Ln.wrapper,width:s,height:p},...S},!h&&q.createElement(Ni,null,b),q.createElement("div",{ref:O,style:{...Ln.fullWidth,...!h&&Ln.hide},className:k}))}var Ri=Ti,Qr=q.memo(Ri);function Ki(s){q.useEffect(s,[])}var Ur=Ki;function Mi(s,p,h=!0){let b=q.useRef(!0);q.useEffect(b.current||!h?()=>{b.current=!1}:s,p)}var Ve=Mi;function Lt(){}function kt(s,p,h,b){return Ii(s,b)||Di(s,p,h,b)}function Ii(s,p){return s.editor.getModel(Vr(s,p))}function Di(s,p,h,b){return s.editor.createModel(p,h,b?Vr(s,b):void 0)}function Vr(s,p){return s.Uri.parse(p)}function Bi({original:s,modified:p,language:h,originalLanguage:b,modifiedLanguage:O,originalModelPath:k,modifiedModelPath:S,keepCurrentOriginalModel:P=!1,keepCurrentModifiedModel:M=!1,theme:Q="light",loading:U="Loading...",options:W={},height:G="100%",width:Ae="100%",className:fe,wrapperProps:he={},beforeMount:me=Lt,onMount:We=Lt}){let[de,Ce]=q.useState(!1),[ke,ve]=q.useState(!0),ae=q.useRef(null),$=q.useRef(null),Se=q.useRef(null),ge=q.useRef(We),te=q.useRef(me),qe=q.useRef(!1);Ur(()=>{let Y=zr.init();return Y.then(le=>($.current=le)&&ve(!1)).catch(le=>(le==null?void 0:le.type)!=="cancelation"&&console.error("Monaco initialization: error:",le)),()=>ae.current?nt():Y.cancel()}),Ve(()=>{if(ae.current&&$.current){let Y=ae.current.getOriginalEditor(),le=kt($.current,s||"",b||h||"text",k||"");le!==Y.getModel()&&Y.setModel(le)}},[k],de),Ve(()=>{if(ae.current&&$.current){let Y=ae.current.getModifiedEditor(),le=kt($.current,p||"",O||h||"text",S||"");le!==Y.getModel()&&Y.setModel(le)}},[S],de),Ve(()=>{let Y=ae.current.getModifiedEditor();Y.getOption($.current.editor.EditorOption.readOnly)?Y.setValue(p||""):p!==Y.getValue()&&(Y.executeEdits("",[{range:Y.getModel().getFullModelRange(),text:p||"",forceMoveMarkers:!0}]),Y.pushUndoStop())},[p],de),Ve(()=>{var Y,le;(le=(Y=ae.current)==null?void 0:Y.getModel())==null||le.original.setValue(s||"")},[s],de),Ve(()=>{let{original:Y,modified:le}=ae.current.getModel();$.current.editor.setModelLanguage(Y,b||h||"text"),$.current.editor.setModelLanguage(le,O||h||"text")},[h,b,O],de),Ve(()=>{var Y;(Y=$.current)==null||Y.editor.setTheme(Q)},[Q],de),Ve(()=>{var Y;(Y=ae.current)==null||Y.updateOptions(W)},[W],de);let Le=q.useCallback(()=>{var He;if(!$.current)return;te.current($.current);let Y=kt($.current,s||"",b||h||"text",k||""),le=kt($.current,p||"",O||h||"text",S||"");(He=ae.current)==null||He.setModel({original:Y,modified:le})},[h,p,O,s,b,k,S]),Ke=q.useCallback(()=>{var Y;!qe.current&&Se.current&&(ae.current=$.current.editor.createDiffEditor(Se.current,{automaticLayout:!0,...W}),Le(),(Y=$.current)==null||Y.editor.setTheme(Q),Ce(!0),qe.current=!0)},[W,Q,Le]);q.useEffect(()=>{de&&ge.current(ae.current,$.current)},[de]),q.useEffect(()=>{!ke&&!de&&Ke()},[ke,de,Ke]);function nt(){var le,He,Me,Ee;let Y=(le=ae.current)==null?void 0:le.getModel();P||((He=Y==null?void 0:Y.original)==null||He.dispose()),M||((Me=Y==null?void 0:Y.modified)==null||Me.dispose()),(Ee=ae.current)==null||Ee.dispose()}return q.createElement(Qr,{width:Ae,height:G,isEditorReady:de,loading:U,_ref:Se,className:fe,wrapperProps:he})}var qi=Bi;q.memo(qi);function Fi(s){let p=q.useRef();return q.useEffect(()=>{p.current=s},[s]),p.current}var Li=Fi,un=new Map;function zi({defaultValue:s,defaultLanguage:p,defaultPath:h,value:b,language:O,path:k,theme:S="light",line:P,loading:M="Loading...",options:Q={},overrideServices:U={},saveViewState:W=!0,keepCurrentModel:G=!1,width:Ae="100%",height:fe="100%",className:he,wrapperProps:me={},beforeMount:We=Lt,onMount:de=Lt,onChange:Ce,onValidate:ke=Lt}){let[ve,ae]=q.useState(!1),[$,Se]=q.useState(!0),ge=q.useRef(null),te=q.useRef(null),qe=q.useRef(null),Le=q.useRef(de),Ke=q.useRef(We),nt=q.useRef(),Y=q.useRef(b),le=Li(k),He=q.useRef(!1),Me=q.useRef(!1);Ur(()=>{let Z=zr.init();return Z.then(pe=>(ge.current=pe)&&Se(!1)).catch(pe=>(pe==null?void 0:pe.type)!=="cancelation"&&console.error("Monaco initialization: error:",pe)),()=>te.current?ze():Z.cancel()}),Ve(()=>{var pe,be,Qe,Ue;let Z=kt(ge.current,s||b||"",p||O||"",k||h||"");Z!==((pe=te.current)==null?void 0:pe.getModel())&&(W&&un.set(le,(be=te.current)==null?void 0:be.saveViewState()),(Qe=te.current)==null||Qe.setModel(Z),W&&((Ue=te.current)==null||Ue.restoreViewState(un.get(k))))},[k],ve),Ve(()=>{var Z;(Z=te.current)==null||Z.updateOptions(Q)},[Q],ve),Ve(()=>{!te.current||b===void 0||(te.current.getOption(ge.current.editor.EditorOption.readOnly)?te.current.setValue(b):b!==te.current.getValue()&&(Me.current=!0,te.current.executeEdits("",[{range:te.current.getModel().getFullModelRange(),text:b,forceMoveMarkers:!0}]),te.current.pushUndoStop(),Me.current=!1))},[b],ve),Ve(()=>{var pe,be;let Z=(pe=te.current)==null?void 0:pe.getModel();Z&&O&&((be=ge.current)==null||be.editor.setModelLanguage(Z,O))},[O],ve),Ve(()=>{var Z;P!==void 0&&((Z=te.current)==null||Z.revealLine(P))},[P],ve),Ve(()=>{var Z;(Z=ge.current)==null||Z.editor.setTheme(S)},[S],ve);let Ee=q.useCallback(()=>{var Z;if(!(!qe.current||!ge.current)&&!He.current){Ke.current(ge.current);let pe=k||h,be=kt(ge.current,b||s||"",p||O||"",pe||"");te.current=(Z=ge.current)==null?void 0:Z.editor.create(qe.current,{model:be,automaticLayout:!0,...Q},U),W&&te.current.restoreViewState(un.get(pe)),ge.current.editor.setTheme(S),P!==void 0&&te.current.revealLine(P),ae(!0),He.current=!0}},[s,p,h,b,O,k,Q,U,W,S,P]);q.useEffect(()=>{ve&&Le.current(te.current,ge.current)},[ve]),q.useEffect(()=>{!$&&!ve&&Ee()},[$,ve,Ee]),Y.current=b,q.useEffect(()=>{var Z,pe;ve&&Ce&&((Z=nt.current)==null||Z.dispose(),nt.current=(pe=te.current)==null?void 0:pe.onDidChangeModelContent(be=>{Me.current||Ce(te.current.getValue(),be)}))},[ve,Ce]),q.useEffect(()=>{if(ve){let Z=ge.current.editor.onDidChangeMarkers(pe=>{var Qe;let be=(Qe=te.current.getModel())==null?void 0:Qe.uri;if(be&&pe.find(Ue=>Ue.path===be.path)){let Ue=ge.current.editor.getModelMarkers({resource:be});ke==null||ke(Ue)}});return()=>{Z==null||Z.dispose()}}return()=>{}},[ve,ke]);function ze(){var Z,pe;(Z=nt.current)==null||Z.dispose(),G?W&&un.set(k,te.current.saveViewState()):(pe=te.current.getModel())==null||pe.dispose(),te.current.dispose()}return q.createElement(Qr,{width:Ae,height:fe,isEditorReady:ve,loading:M,_ref:qe,className:he,wrapperProps:me})}var Qi=zi,Ui=q.memo(Qi),Wr=Ui;const Hr=({request:s})=>{const[p,h]=q.useState(!1),[b,O]=q.useState(!1),k=Q=>Object.entries(Q||{}).map(([U,W])=>y.jsxs("tr",{children:[y.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-slate-500 text-xs",children:U}),y.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-xs",children:W})]},U)),S=s.request.payload,P=!S||typeof S=="object"&&Object.keys(S).length===0||typeof S=="string"&&(S.trim()===""||S.trim()==="{}"),M=Q=>{try{const U=JSON.parse(Q);return JSON.stringify(U,null,2)}catch{return Q}};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:()=>h(!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:k(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:k(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"}),P?y.jsx("div",{className:"hidden"}):y.jsx("div",{className:"bg-white rounded-b shadow p-0 h-100",children:y.jsx(Wr,{height:"100%",defaultLanguage:"json",value:M(S),options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})})]})]})},Yr=({request:s})=>{const[p,h]=q.useState(!1),b=P=>Object.entries(P||{}).map(([M,Q])=>y.jsxs("tr",{children:[y.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-slate-500 text-xs",children:M}),y.jsx("td",{className:"border border-slate-200 px-2 py-1 font-mono text-xs",children:Q})]},M)),O=s.response.payload,k=!O||typeof O=="object"&&Object.keys(O).length===0||typeof O=="string"&&(O.trim()===""||O.trim()==="{}"),S=P=>{try{const M=JSON.parse(P);return JSON.stringify(M,null,2)}catch{return P}};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:()=>h(!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"}),k?y.jsx("div",{className:"hidden"}):y.jsx("div",{className:"bg-white rounded-b shadow p-0 h-100",children:y.jsx(Wr,{height:"100%",defaultLanguage:"json",value:S(O),options:{readOnly:!0,minimap:{enabled:!1},automaticLayout:!0,fontFamily:'"Cascadia Code", "Jetbrains Mono", "Fira Code", "Menlo", "Consolas", monospace',tabSize:2,scrollBeyondLastLine:!1}})})]})]})},Jr=({request:s,currentTab:p,setCurrentTab:h})=>s?y.jsxs("div",{children:[y.jsx(Nr,{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:()=>h("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:()=>h("response"),children:"Response"})]}),y.jsx("div",{className:"p-4 bg-white rounded-b shadow",children:p==="request"?y.jsx(Hr,{request:s}):y.jsx(Yr,{request:s})})]}):y.jsx("div",{className:"text-gray-500",children:"No request selected."}),Vi="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==",Gr=({sseEndpoint:s,setSseEndpoint:p,isConnected:h})=>{const[b,O]=q.useState(!1),[k,S]=q.useState(s);q.useEffect(()=>{if(typeof window<"u"){const M=localStorage.getItem("sseEndpoint");!s&&M&&(S(M),p(M))}},[s,p]);const P=()=>{typeof window<"u"&&localStorage.setItem("sseEndpoint",k),p(k),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(M=>!M),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 ${h?"bg-green-500 text-white":"bg-red-500"}`,children:[y.jsx("span",{className:`w-2 h-2 rounded-full mr-1 ${h?"bg-green-800":"bg-red-800"}`}),h?"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:Vi,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:k,onChange:M=>S(M.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:P,className:"bg-green-600 text-white px-4 py-2 rounded-md",children:"Apply"})})]})})]})};class Wi{constructor(){this.db=new rn("InspectrDB"),this.db.version(1).stores({events:"id, time, method, statusCode, path, latency, server"})}transformEvent(p){var k;const{id:h,time:b,data:O}=p;return{id:h,time:b,method:O.method,url:O.url,server:O.server,path:O.path,clientIp:O.clientIp,latency:O.latency,statusCode:(k=O.response)==null?void 0:k.statusCode,raw:p}}async upsertEvent(p){const h=this.transformEvent(p);return await this.db.events.put(h)}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:h={},sort:b={field:"time",order:"desc"},page:O=1,pageSize:k=20}=p;await this.db.events.count();let S=this.db.events.toCollection();if(await S.toArray(),h.timestampRange){let G=new Date;if(h.timestampRange==="24H")G.setHours(G.getHours()-24);else if(h.timestampRange==="48H")G.setHours(G.getHours()-48);else if(h.timestampRange==="week")G.setDate(G.getDate()-7);else if(h.timestampRange==="month")G.setMonth(G.getMonth()-1);else if(h.timestampRange.start&&h.timestampRange.end){const Ae=new Date(h.timestampRange.start),fe=new Date(h.timestampRange.end);S=S.filter(he=>{const me=new Date(he.time);return me>=Ae&&me<=fe})}["24H","48H","week","month"].includes(h.timestampRange)&&(S=S.filter(Ae=>new Date(Ae.time)>=G))}h.status!==void 0&&(h==null?void 0:h.status.length)>2&&(S=S.filter(G=>Number(G.statusCode)===Number(h.status))),h.method&&(S=S.filter(G=>G.method.toLowerCase()===h.method.toLowerCase())),h.path&&(S=S.filter(G=>G.path.includes(h.path))),h.durationMin&&(S=S.filter(G=>Number(G.latency)>=Number(h.durationMin))),h.durationMax&&(S=S.filter(G=>Number(G.latency)<=Number(h.durationMax))),h.host&&(S=S.filter(G=>G.server.toLowerCase().includes(h.host.toLowerCase())));let P;if(typeof S.orderBy=="function")try{P=S.orderBy(b.field),b.order==="desc"&&(P=P.reverse())}catch(G){console.error("[EventDB] orderBy error, fallback sorting:",G),P=(await S.toArray()).sort((fe,he)=>{const me=b.field;return fe[me]<he[me]?b.order==="asc"?-1:1:fe[me]>he[me]?b.order==="asc"?1:-1:0})}else P=(await S.toArray()).sort((Ae,fe)=>{const he=b.field;return Ae[he]<fe[he]?b.order==="asc"?-1:1:Ae[he]>fe[he]?b.order==="asc"?1:-1:0});let M;Array.isArray(P)?M=P:M=await P.toArray();const Q=(O-1)*k;let U;return Array.isArray(P)?U=M.slice(Q,Q+k):typeof P.offset=="function"?U=await P.offset(Q).limit(k).toArray():U=[],U.map(G=>({id:G.id,...G.raw.data}))}async clearEvents(){return await this.db.events.clear()}}const zt=new Wi,Hi=({sseEndpoint:s})=>{const[p,h]=q.useState(null),[b,O]=q.useState("request"),[k,S]=q.useState("/api/sse"),[P,M]=q.useState(!1),Q=100,[U,W]=q.useState(1),[G,Ae]=q.useState("time"),[fe,he]=q.useState("desc"),[me,We]=q.useState({}),de=kr(()=>zt.queryEvents({sort:{field:G,order:fe},filters:me,page:U,pageSize:Q}),[U,G,fe,me]),Ce=kr(()=>zt.db.events.count(),[]),ke=Ce?Math.ceil(Ce/Q):1;q.useEffect(()=>{if(typeof window<"u"){const $=localStorage.getItem("sseEndpoint");!s&&$&&S($)}},[s]),q.useEffect(()=>{const $=()=>`req-${Math.random().toString(36).substr(2,9)}`,Se=new EventSource(k);return console.log(`Inspectr EventSource created with URL: ${k}`),Se.onopen=()=>{console.log("SSE Inspectr connection opened"),M(!0)},Se.onmessage=ge=>{try{const te=JSON.parse(ge.data);te.id||(te.id=$()),zt.upsertEvent(te).catch(qe=>console.error("Error saving event to DB:",qe))}catch(te){console.error("Error parsing SSE Inspectr data:",te)}},Se.onerror=ge=>{console.error("SSE Inspectr error:",ge),M(!1)},()=>{console.log("Closing Inspectr EventSource"),Se.close(),M(!1)}},[k]),q.useEffect(()=>{!p&&de&&de.length>0&&h(de[0])},[de,p]);const ve=()=>{h(null),zt.clearEvents().catch($=>console.error("Error clearing events from DB:",$))},ae=$=>{p&&(p.id||"")===$&&h(null),zt.deleteEvent($).catch(Se=>console.error("Error deleting event from DB:",Se))};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(Pr,{requests:de||[],onSelect:h,onRemove:ae,clearRequests:ve,selectedRequest:p,currentPage:U,totalPages:ke,totalCount:Ce||0,onPageChange:W,sortField:G,sortDirection:fe,filters:me,setSortField:Ae,setSortDirection:he,setFilters:We})}),y.jsx("div",{className:"w-2/3 p-4",children:y.jsx(Jr,{request:p,currentTab:b,setCurrentTab:O})})]}),y.jsx(Gr,{sseEndpoint:k,setSseEndpoint:S,isConnected:P})]})};Re.InspectrApp=Hi,Re.RequestContent=Hr,Re.RequestDetail=Nr,Re.RequestDetailsPanel=Jr,Re.RequestList=Pr,Re.RequestListItem=Or,Re.RequestListPagination=Sr,Re.RequestListSidePanel=Cr,Re.ResponseContent=Yr,Re.SettingsPanel=Gr,Re.getStatusClass=Bn,Object.defineProperty(Re,Symbol.toStringTag,{value:"Module"})});