pocketbase-react 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pocketbase-react.js +10 -8
- package/dist/pocketbase-react.min.js +4 -4
- package/es/context/Pocketbase.d.ts +1 -1
- package/es/context/Pocketbase.js +1 -1
- package/es/context/client.d.ts +1 -1
- package/es/context/content.d.ts +12 -6
- package/es/hooks/useClientContext.d.ts +1 -1
- package/lib/context/Pocketbase.js +1 -1
- package/package.json +3 -3
- package/src/context/Pocketbase.tsx +1 -1
- package/src/context/client.tsx +1 -1
- package/src/context/content.tsx +13 -6
package/dist/pocketbase-react.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react-dom')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react-dom'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PocketbaseReact = {}, global.reactDom));
|
|
5
|
-
})(this, (function (exports, reactDom) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react-dom'), require('pocketbase')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react-dom', 'pocketbase'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PocketbaseReact = {}, global.reactDom, global.Pocketbase));
|
|
5
|
+
})(this, (function (exports, reactDom, PocketBase) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var PocketBase__default = /*#__PURE__*/_interopDefaultLegacy(PocketBase);
|
|
6
10
|
|
|
7
11
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
8
12
|
|
|
@@ -3529,7 +3533,7 @@
|
|
|
3529
3533
|
records: records
|
|
3530
3534
|
});
|
|
3531
3535
|
|
|
3532
|
-
function n$1(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];{var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}}function r$1(n){return !!n&&!!n[Q]}function t$1(n){return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s$1(n)||v$1(n))}function i$1(n,r,t){void 0===t&&(t=!1),0===o$1(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o$1(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s$1(n)?2:v$1(n)?3:0}function u$1(n,r){return 2===o$1(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a$1(n,r){return 2===o$1(n)?n.get(r):n[r]}function f$1(n,r,t){var e=o$1(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t;}function c$1(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s$1(n){return X&&n instanceof Map}function v$1(n){return q&&n instanceof Set}function p$1(n){return n.o||n.t}function l$1(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d$1(n,e){return void 0===e&&(e=!1),y$1(n)||r$1(n)||!t$1(n)?n:(o$1(n)>1&&(n.set=n.add=n.clear=n.delete=h$1),Object.freeze(n),e&&i$1(n,(function(n,r){return d$1(r,!0)}),!0),n)}function h$1(){n$1(2);}function y$1(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b$1(r){var t=tn[r];return t||n$1(18,r),t}function m$1(n,r){tn[n]||(tn[n]=r);}function _$1(){return U||n$1(0),U}function j$1(n,r){r&&(b$1("Patches"),n.u=[],n.s=[],n.v=r);}function O$1(n){g$1(n),n.p.forEach(S$1),n.p=null;}function g$1(n){n===U&&(U=n.l);}function w$1(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S$1(n){var r=n[Q];0===r.i||1===r.i?r.j():r.O=!0;}function P$1(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b$1("ES5").S(e,r,o),o?(i[Q].P&&(O$1(e),n$1(4)),t$1(r)&&(r=M(e,r),e.l||x$1(e,r)),e.u&&b$1("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),O$1(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y$1(r))return r;var e=r[Q];if(!e)return i$1(r,(function(i,o){return A$1(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x$1(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l$1(e.k):e.o;i$1(3===e.i?new Set(o):o,(function(r,i){return A$1(n,e,o,r,i,t)})),x$1(n,o,!1),t&&n.u&&b$1("Patches").R(e,t,n.u,n.s);}return e.o}function A$1(e,i,o,a,c,s){if(c===o&&n$1(5),r$1(c)){var v=M(e,c,s&&i&&3!==i.i&&!u$1(i.D,a)?s.concat(a):void 0);if(f$1(o,a,v),!r$1(v))return;e.m=!1;}if(t$1(c)&&!y$1(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x$1(e,c);}}function x$1(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d$1(r,t);}function z(n,r){var t=n[Q];return (t?p$1(t):n)[r]}function I$1(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k$1(n){n.P||(n.P=!0,n.l&&k$1(n.l));}function E$1(n){n.o||(n.o=l$1(n.t));}function R$1(n,r,t){var e=s$1(r)?b$1("MapSet").N(r,t):v$1(r)?b$1("MapSet").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_$1(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b$1("ES5").J(r,t);return (t?t.A:_$1()).p.push(e),e}function D(e){return r$1(e)||n$1(22,e),function n(r){if(!t$1(r))return r;var e,u=r[Q],c=o$1(r);if(u){if(!u.P&&(u.i<4||!b$1("ES5").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1;}else e=F(r,c);return i$1(e,(function(r,t){u&&a$1(u.t,r)===t||f$1(e,r,n(t));})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l$1(n)}function N(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return f(r),en.get(r,n)},set:function(r){var t=this[Q];f(t),en.set(t,n,r);}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k$1(t);break;case 4:o(t)&&k$1(t);}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u$1(r,o))return !0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c$1(f,a))return !0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return !0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return !0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return !0;return !1}function f(r){r.O&&n$1(3,JSON.stringify(p$1(r)));}var s={};m$1("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable);}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_$1(),P:!1,I:!1,D:{},l:r,t:n,k:i,o:null,O:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r$1(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.D,c=t.i;if(4===c)i$1(o,(function(r){r!==Q&&(void 0!==e[r]||u$1(e,r)?f[r]||n(o[r]):(f[r]=!0,k$1(t)));})),i$1(e,(function(n){void 0!==o[n]||u$1(o,n)||(f[n]=!1,k$1(t));}));else if(5===c){if(a(t)&&(k$1(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l]);}}}}(n.p[0]),e(n.p));},K:function(n){return 4===n.i?o(n):a(n)}});}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p$1(n);if(!u$1(e,r))return function(n,r,t){var e,i=I$1(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t$1(i)?i:i===z(n.t,r)?(E$1(n),n.o[r]=R$1(n.A.h,i,n)):i},has:function(n,r){return r in p$1(n)},ownKeys:function(n){return Reflect.ownKeys(p$1(n))},set:function(n,r,t){var e=I$1(p$1(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p$1(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c$1(t,i)&&(void 0!==t||u$1(n.t,r)))return !0;E$1(n),k$1(n);}return n.o[r]===t&&"number"!=typeof t&&(void 0!==t||r in n.o)||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E$1(n),k$1(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p$1(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n$1(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n$1(12);}},on={};i$1(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return isNaN(parseInt(t))&&n$1(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "length"!==t&&isNaN(parseInt(t))&&n$1(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.g=B,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n$1(6),void 0!==o&&"function"!=typeof o&&n$1(7),t$1(r)){var c=w$1(e),s=R$1(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?O$1(c):g$1(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j$1(c,o),P$1(n,c)}),(function(n){throw O$1(c),n})):(j$1(c,o),P$1(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.F&&d$1(f,!0),o){var p=[],l=[];b$1("Patches").M(r,f,p,l),o(p,l);}return f}n$1(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t$1(e)||n$1(8),r$1(e)&&(e=D(e));var i=w$1(this),o=R$1(this,e,void 0);return o[Q].C=!0,g$1(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];(e&&e.C||n$1(9),e.I&&n$1(10));var i=e.A;return j$1(i,t),P$1(void 0,i)},i.setAutoFreeze=function(n){this.F=n;},i.setUseProxies=function(r){r&&!B&&n$1(20),this.g=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b$1("Patches").$;return r$1(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un;an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);
|
|
3536
|
+
function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];{var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}}function r(n){return !!n&&!!n[Q]}function t(n){return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t;}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0),n)}function h(){n(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r);}function _(){return U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function O(n){g(n),n.p.forEach(S),n.p=null;}function g(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.O=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b("ES5").S(e,r,o),o?(i[Q].P&&(O(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b("Patches").R(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s){if(c===o&&n(5),r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1;}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function R(n,r,t){var e=s(r)?b("MapSet").N(r,t):v(r)?b("MapSet").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function D(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1;}else e=F(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function N(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return f(r),en.get(r,n)},set:function(r){var t=this[Q];f(t),en.set(t,n,r);}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t);}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return !0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return !0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return !0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return !0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return !0;return !1}function f(r){r.O&&n(3,JSON.stringify(p(r)));}var s={};m("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable);}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:i,o:null,O:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.D,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)));})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(t));}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l]);}}}}(n.p[0]),e(n.p));},K:function(n){return 4===n.i?o(n):a(n)}});}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=R(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return !0;E(n),k(n);}return n.o[r]===t&&"number"!=typeof t&&(void 0!==t||r in n.o)||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E(n),k(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.g=B,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=R(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?O(c):g(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw O(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.F&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l);}return f}n(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,g(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.F=n;},i.setUseProxies=function(r){r&&!B&&n(20),this.g=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un;an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);
|
|
3533
3537
|
|
|
3534
3538
|
/** A function that accepts a potential "extra argument" value to be injected later,
|
|
3535
3539
|
* and returns an instance of the thunk middleware that uses that value
|
|
@@ -6028,8 +6032,6 @@
|
|
|
6028
6032
|
}, props.children);
|
|
6029
6033
|
};
|
|
6030
6034
|
|
|
6031
|
-
var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e;}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i);}var n=function(){return n=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};function i(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{u(i.next(t));}catch(t){r(t);}}function a(t){try{u(i.throw(t));}catch(t){r(t);}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e);}))).then(s,a);}u((i=i.apply(t,e||[])).next());}))}function o(t,e){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){s.label=r[1];break}if(6===r[0]&&s.label<o[1]){s.label=o[1],o=r;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(r);break}o[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s);}catch(t){r=[6,t],i=0;}finally{n=o=0;}if(5&r[0])throw r[1];return {value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}var r,s=function(t){function i(e){var n,o=this;return (o=t.call(this,"ClientResponseError")||this).url="",o.status=0,o.data={},o.isAbort=!1,o.originalError=null,Object.setPrototypeOf(o,i.prototype),e instanceof i||(o.originalError=e),null!==e&&"object"==typeof e&&(o.url="string"==typeof e.url?e.url:"",o.status="number"==typeof e.status?e.status:0,o.data=null!==e.data&&"object"==typeof e.data?e.data:{}),"undefined"!=typeof DOMException&&e instanceof DOMException&&(o.isAbort=!0),o.name="ClientResponseError "+o.status,o.message=(null===(n=o.data)||void 0===n?void 0:n.message)||"Something went wrong while processing your request.",o}return e(i,t),i.prototype.toJSON=function(){return n({},this)},i}(Error),a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function u(t,e,n){var i=Object.assign({},n||{}),o=i.encode||c;if(!a.test(t))throw new TypeError("argument name is invalid");var r=o(e);if(r&&!a.test(r))throw new TypeError("argument val is invalid");var s=t+"="+r;if(null!=i.maxAge){var u=i.maxAge-0;if(isNaN(u)||!isFinite(u))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+Math.floor(u);}if(i.domain){if(!a.test(i.domain))throw new TypeError("option domain is invalid");s+="; Domain="+i.domain;}if(i.path){if(!a.test(i.path))throw new TypeError("option path is invalid");s+="; Path="+i.path;}if(i.expires){if(!function(t){return "[object Date]"===Object.prototype.toString.call(t)||t instanceof Date}(i.expires)||isNaN(i.expires.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+i.expires.toUTCString();}if(i.httpOnly&&(s+="; HttpOnly"),i.secure&&(s+="; Secure"),i.priority)switch("string"==typeof i.priority?i.priority.toLowerCase():i.priority){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(i.sameSite)switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s}function l(t){return -1!==t.indexOf("%")?decodeURIComponent(t):t}function c(t){return encodeURIComponent(t)}function d(t){if(t)try{var e=decodeURIComponent(r(t.split(".")[1]).split("").map((function(t){return "%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(e)||{}}catch(t){}return {}}r="function"==typeof atob?atob:function(t){return Buffer.from(t,"base64").toString("binary")};var h=function(){function t(t){void 0===t&&(t={}),this.load(t||{});}return t.prototype.load=function(t){this.id=void 0!==t.id?t.id:"",this.created=void 0!==t.created?t.created:"",this.updated=void 0!==t.updated?t.updated:"";},Object.defineProperty(t.prototype,"isNew",{get:function(){return !this.id||"00000000-0000-0000-0000-000000000000"===this.id},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new this.constructor(JSON.parse(JSON.stringify(this)))},t.prototype.export=function(){return Object.assign({},this)},t}(),p=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.load=function(e){t.prototype.load.call(this,e);for(var n=0,i=Object.entries(e);n<i.length;n++){var o=i[n],r=o[0],s=o[1];this[r]=s;}this["@collectionId"]=void 0!==e["@collectionId"]?e["@collectionId"]:"",this["@collectionName"]=void 0!==e["@collectionName"]?e["@collectionName"]:"",this["@expand"]=void 0!==e["@expand"]?e["@expand"]:{};},n}(h),f=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.load=function(e){t.prototype.load.call(this,e),this.email="string"==typeof e.email?e.email:"",this.verified=!!e.verified,this.lastResetSentAt="string"==typeof e.lastResetSentAt?e.lastResetSentAt:"",this.lastVerificationSentAt="string"==typeof e.lastVerificationSentAt?e.lastVerificationSentAt:"",this.profile=e.profile?new p(e.profile):null;},n}(h),v=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.load=function(e){t.prototype.load.call(this,e),this.avatar="number"==typeof e.avatar?e.avatar:0,this.email="string"==typeof e.email?e.email:"",this.lastResetSentAt="string"==typeof e.lastResetSentAt?e.lastResetSentAt:"";},n}(h),y=function(){function t(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[];}return Object.defineProperty(t.prototype,"token",{get:function(){return this.baseToken},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.baseModel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isValid",{get:function(){return !function(t,e){void 0===e&&(e=0);var n=d(t);return !(Object.keys(n).length>0&&(!n.exp||n.exp-e>Date.now()/1e3))}(this.token)},enumerable:!1,configurable:!0}),t.prototype.save=function(t,e){this.baseToken=t||"",this.baseModel=null!==e&&"object"==typeof e?"undefined"!==(null==e?void 0:e.verified)?new f(e):new v(e):null,this.triggerChange();},t.prototype.clear=function(){this.baseToken="",this.baseModel=null,this.triggerChange();},t.prototype.loadFromCookie=function(t,e){void 0===e&&(e="pb_auth");var n=function(t,e){var n={};if("string"!=typeof t)return n;for(var i=Object.assign({},e||{}).decode||l,o=0;o<t.length;){var r=t.indexOf("=",o);if(-1===r)break;var s=t.indexOf(";",o);if(-1===s)s=t.length;else if(s<r){o=t.lastIndexOf(";",r-1)+1;continue}var a=t.slice(o,r).trim();if(void 0===n[a]){var u=t.slice(r+1,s).trim();34===u.charCodeAt(0)&&(u=u.slice(1,-1));try{n[a]=i(u);}catch(t){n[a]=u;}}o=s+1;}return n}(t||"")[e]||"",i={};try{(null===typeof(i=JSON.parse(n))||"object"!=typeof i||Array.isArray(i))&&(i={});}catch(t){}this.save(i.token||"",i.model||{});},t.prototype.exportToCookie=function(t,e){var n,i,o;void 0===e&&(e="pb_auth");var r={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=d(this.token);(null==s?void 0:s.exp)?r.expires=new Date(1e3*s.exp):r.expires=new Date("1970-01-01"),t=Object.assign({},r,t);var a={token:this.token,model:(null===(n=this.model)||void 0===n?void 0:n.export())||null},l=u(e,JSON.stringify(a),t),c="undefined"!=typeof Blob?new Blob([l]).size:l.length;return a.model&&c>4096&&(a.model={id:null===(i=null==a?void 0:a.model)||void 0===i?void 0:i.id,email:null===(o=null==a?void 0:a.model)||void 0===o?void 0:o.email},this.model instanceof f&&(a.model.verified=this.model.verified),l=u(e,JSON.stringify(a),t)),l},t.prototype.onChange=function(t){var e=this;return this._onChangeCallbacks.push(t),function(){for(var n=e._onChangeCallbacks.length-1;n>=0;n--)if(e._onChangeCallbacks[n]==t)return delete e._onChangeCallbacks[n],void e._onChangeCallbacks.splice(n,1)}},t.prototype.triggerChange=function(){for(var t=0,e=this._onChangeCallbacks;t<e.length;t++){var n=e[t];n&&n(this.token,this.model);}},t}(),m=function(t){function n(e){void 0===e&&(e="pocketbase_auth");var n=t.call(this)||this;return n.storageFallback={},n.storageKey=e,n}return e(n,t),Object.defineProperty(n.prototype,"token",{get:function(){return (this._storageGet(this.storageKey)||{}).token||""},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){var t,e=this._storageGet(this.storageKey)||{};return null===e||"object"!=typeof e||null===e.model||"object"!=typeof e.model?null:void 0!==(null===(t=e.model)||void 0===t?void 0:t.verified)?new f(e.model):new v(e.model)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,n){this._storageSet(this.storageKey,{token:e,model:n}),t.prototype.save.call(this,e,n);},n.prototype.clear=function(){this._storageRemove(this.storageKey),t.prototype.clear.call(this);},n.prototype._storageGet=function(t){var e;if("undefined"!=typeof window&&(null===window||void 0===window?void 0:window.localStorage)){var n=(null===(e=null===window||void 0===window?void 0:window.localStorage)||void 0===e?void 0:e.getItem(t))||"";try{return JSON.parse(n)}catch(t){return n}}return this.storageFallback[t]},n.prototype._storageSet=function(t,e){var n;if("undefined"!=typeof window&&(null===window||void 0===window?void 0:window.localStorage)){var i=e;"string"!=typeof e&&(i=JSON.stringify(e)),null===(n=null===window||void 0===window?void 0:window.localStorage)||void 0===n||n.setItem(t,i);}else this.storageFallback[t]=e;},n.prototype._storageRemove=function(t){var e;"undefined"!=typeof window&&(null===(e=null===window||void 0===window?void 0:window.localStorage)||void 0===e||e.removeItem(t)),delete this.storageFallback[t];},n}(y),b=function(t){this.client=t;},g=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getAll=function(t){return void 0===t&&(t={}),this.client.send("/api/settings",{method:"GET",params:t}).then((function(t){return t||{}}))},n.prototype.update=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.client.send("/api/settings",{method:"PATCH",params:e,body:t}).then((function(t){return t||{}}))},n.prototype.testS3=function(t){return void 0===t&&(t={}),this.client.send("/api/settings/test/s3",{method:"POST",params:t}).then((function(){return !0}))},n.prototype.testEmail=function(t,e,n){void 0===n&&(n={});var i={email:t,template:e};return this.client.send("/api/settings/test/email",{method:"POST",params:n,body:i}).then((function(){return !0}))},n}(b),w=function(t,e,n,i,o){this.page=t>0?t:1,this.perPage=e>=0?e:0,this.totalItems=n>=0?n:0,this.totalPages=i>=0?i:0,this.items=o||[];},S=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype._getFullList=function(t,e,n){var r=this;void 0===e&&(e=100),void 0===n&&(n={});var s=[],a=function(u){return i(r,void 0,void 0,(function(){return o(this,(function(i){return [2,this._getList(t,u,e,n).then((function(t){var e=t,n=e.items,i=e.totalItems;return s=s.concat(n),n.length&&i>s.length?a(u+1):s}))]}))}))};return a(1)},n.prototype._getList=function(t,e,n,i){var o=this;return void 0===e&&(e=1),void 0===n&&(n=30),void 0===i&&(i={}),i=Object.assign({page:e,perPage:n},i),this.client.send(t,{method:"GET",params:i}).then((function(t){var e=[];if(null==t?void 0:t.items){t.items=t.items||[];for(var n=0,i=t.items;n<i.length;n++){var r=i[n];e.push(o.decode(r));}}return new w((null==t?void 0:t.page)||1,(null==t?void 0:t.perPage)||0,(null==t?void 0:t.totalItems)||0,(null==t?void 0:t.totalPages)||0,e)}))},n.prototype._getOne=function(t,e,n){var i=this;return void 0===n&&(n={}),this.client.send(t+"/"+encodeURIComponent(e),{method:"GET",params:n}).then((function(t){return i.decode(t)}))},n.prototype._create=function(t,e,n){var i=this;return void 0===e&&(e={}),void 0===n&&(n={}),this.client.send(t,{method:"POST",params:n,body:e}).then((function(t){return i.decode(t)}))},n.prototype._update=function(t,e,n,i){var o=this;return void 0===n&&(n={}),void 0===i&&(i={}),this.client.send(t+"/"+encodeURIComponent(e),{method:"PATCH",params:i,body:n}).then((function(t){return o.decode(t)}))},n.prototype._delete=function(t,e,n){return void 0===n&&(n={}),this.client.send(t+"/"+encodeURIComponent(e),{method:"DELETE",params:n}).then((function(){return !0}))},n}(b),O=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getFullList=function(t,e){return void 0===t&&(t=100),void 0===e&&(e={}),this._getFullList(this.baseCrudPath(),t,e)},n.prototype.getList=function(t,e,n){return void 0===t&&(t=1),void 0===e&&(e=30),void 0===n&&(n={}),this._getList(this.baseCrudPath(),t,e,n)},n.prototype.getOne=function(t,e){return void 0===e&&(e={}),this._getOne(this.baseCrudPath(),t,e)},n.prototype.create=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this._create(this.baseCrudPath(),t,e)},n.prototype.update=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),this._update(this.baseCrudPath(),t,e,n)},n.prototype.delete=function(t,e){return void 0===e&&(e={}),this._delete(this.baseCrudPath(),t,e)},n}(S),C=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.decode=function(t){return new v(t)},n.prototype.baseCrudPath=function(){return "/api/admins"},n.prototype.authResponse=function(t){var e=this.decode((null==t?void 0:t.admin)||{});return (null==t?void 0:t.token)&&(null==t?void 0:t.admin)&&this.client.authStore.save(t.token,e),Object.assign({},t,{token:(null==t?void 0:t.token)||"",admin:e})},n.prototype.authViaEmail=function(t,e,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),n=Object.assign({email:t,password:e},n),this.client.send(this.baseCrudPath()+"/auth-via-email",{method:"POST",params:i,body:n,headers:{Authorization:""}}).then(this.authResponse.bind(this))},n.prototype.refresh=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.client.send(this.baseCrudPath()+"/refresh",{method:"POST",params:e,body:t}).then(this.authResponse.bind(this))},n.prototype.requestPasswordReset=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),e=Object.assign({email:t},e),this.client.send(this.baseCrudPath()+"/request-password-reset",{method:"POST",params:n,body:e}).then((function(){return !0}))},n.prototype.confirmPasswordReset=function(t,e,n,i,o){return void 0===i&&(i={}),void 0===o&&(o={}),i=Object.assign({token:t,password:e,passwordConfirm:n},i),this.client.send(this.baseCrudPath()+"/confirm-password-reset",{method:"POST",params:o,body:i}).then(this.authResponse.bind(this))},n}(O),P=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.load=function(e){t.prototype.load.call(this,e),this.userId="string"==typeof e.userId?e.userId:"",this.provider="string"==typeof e.provider?e.provider:"",this.providerId="string"==typeof e.providerId?e.providerId:"";},n}(h),j=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.decode=function(t){return new f(t)},n.prototype.baseCrudPath=function(){return "/api/users"},n.prototype.authResponse=function(t){var e=this.decode((null==t?void 0:t.user)||{});return (null==t?void 0:t.token)&&(null==t?void 0:t.user)&&this.client.authStore.save(t.token,e),Object.assign({},t,{token:(null==t?void 0:t.token)||"",user:e})},n.prototype.listAuthMethods=function(t){return void 0===t&&(t={}),this.client.send(this.baseCrudPath()+"/auth-methods",{method:"GET",params:t}).then((function(t){return Object.assign({},t,{emailPassword:!!(null==t?void 0:t.emailPassword),authProviders:Array.isArray(null==t?void 0:t.authProviders)?null==t?void 0:t.authProviders:[]})}))},n.prototype.authViaEmail=function(t,e,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),n=Object.assign({email:t,password:e},n),this.client.send(this.baseCrudPath()+"/auth-via-email",{method:"POST",params:i,body:n,headers:{Authorization:""}}).then(this.authResponse.bind(this))},n.prototype.authViaOAuth2=function(t,e,n,i,o,r){return void 0===o&&(o={}),void 0===r&&(r={}),o=Object.assign({provider:t,code:e,codeVerifier:n,redirectUrl:i},o),this.client.send(this.baseCrudPath()+"/auth-via-oauth2",{method:"POST",params:r,body:o,headers:{Authorization:""}}).then(this.authResponse.bind(this))},n.prototype.refresh=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.client.send(this.baseCrudPath()+"/refresh",{method:"POST",params:e,body:t}).then(this.authResponse.bind(this))},n.prototype.requestPasswordReset=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),e=Object.assign({email:t},e),this.client.send(this.baseCrudPath()+"/request-password-reset",{method:"POST",params:n,body:e}).then((function(){return !0}))},n.prototype.confirmPasswordReset=function(t,e,n,i,o){return void 0===i&&(i={}),void 0===o&&(o={}),i=Object.assign({token:t,password:e,passwordConfirm:n},i),this.client.send(this.baseCrudPath()+"/confirm-password-reset",{method:"POST",params:o,body:i}).then(this.authResponse.bind(this))},n.prototype.requestVerification=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),e=Object.assign({email:t},e),this.client.send(this.baseCrudPath()+"/request-verification",{method:"POST",params:n,body:e}).then((function(){return !0}))},n.prototype.confirmVerification=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),e=Object.assign({token:t},e),this.client.send(this.baseCrudPath()+"/confirm-verification",{method:"POST",params:n,body:e}).then(this.authResponse.bind(this))},n.prototype.requestEmailChange=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),e=Object.assign({newEmail:t},e),this.client.send(this.baseCrudPath()+"/request-email-change",{method:"POST",params:n,body:e}).then((function(){return !0}))},n.prototype.confirmEmailChange=function(t,e,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),n=Object.assign({token:t,password:e},n),this.client.send(this.baseCrudPath()+"/confirm-email-change",{method:"POST",params:i,body:n}).then(this.authResponse.bind(this))},n.prototype.listExternalAuths=function(t,e){return void 0===e&&(e={}),this.client.send(this.baseCrudPath()+"/"+encodeURIComponent(t)+"/external-auths",{method:"GET",params:e}).then((function(t){var e=[];if(Array.isArray(t))for(var n=0,i=t;n<i.length;n++){var o=i[n];e.push(new P(o));}return e}))},n.prototype.unlinkExternalAuth=function(t,e,n){return void 0===n&&(n={}),this.client.send(this.baseCrudPath()+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(e),{method:"DELETE",params:n}).then((function(){return !0}))},n}(O),R=function(){function t(t){void 0===t&&(t={}),this.load(t||{});}return t.prototype.load=function(t){this.id=void 0!==t.id?t.id:"",this.name=void 0!==t.name?t.name:"",this.type=void 0!==t.type?t.type:"text",this.system=!!t.system,this.required=!!t.required,this.unique=!!t.unique,this.options="object"==typeof t.options&&null!==t.options?t.options:{};},t}(),k=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.load=function(e){t.prototype.load.call(this,e),this.name="string"==typeof e.name?e.name:"",this.system=!!e.system,this.listRule="string"==typeof e.listRule?e.listRule:null,this.viewRule="string"==typeof e.viewRule?e.viewRule:null,this.createRule="string"==typeof e.createRule?e.createRule:null,this.updateRule="string"==typeof e.updateRule?e.updateRule:null,this.deleteRule="string"==typeof e.deleteRule?e.deleteRule:null,e.schema=Array.isArray(e.schema)?e.schema:[],this.schema=[];for(var n=0,i=e.schema;n<i.length;n++){var o=i[n];this.schema.push(new R(o));}},n}(h),E=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.decode=function(t){return new k(t)},n.prototype.baseCrudPath=function(){return "/api/collections"},n.prototype.import=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n={}),i(this,void 0,void 0,(function(){return o(this,(function(i){return [2,this.client.send(this.baseCrudPath()+"/import",{method:"PUT",params:n,body:{collections:t,deleteMissing:e}}).then((function(){return !0}))]}))}))},n}(O),T=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.decode=function(t){return new p(t)},n.prototype.baseCrudPath=function(t){return "/api/collections/"+encodeURIComponent(t)+"/records"},n.prototype.getFileUrl=function(t,e,n){void 0===n&&(n={});var i=[];i.push(this.client.baseUrl.replace(/\/+$/gm,"")),i.push("api"),i.push("files"),i.push(t["@collectionId"]),i.push(t.id),i.push(e);var o=i.join("/");if(Object.keys(n).length){var r=new URLSearchParams(n);o+=(o.includes("?")?"&":"?")+r;}return o},n}(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getFullList=function(t,e,n){return void 0===e&&(e=100),void 0===n&&(n={}),this._getFullList(this.baseCrudPath(t),e,n)},n.prototype.getList=function(t,e,n,i){return void 0===e&&(e=1),void 0===n&&(n=30),void 0===i&&(i={}),this._getList(this.baseCrudPath(t),e,n,i)},n.prototype.getOne=function(t,e,n){return void 0===n&&(n={}),this._getOne(this.baseCrudPath(t),e,n)},n.prototype.create=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),this._create(this.baseCrudPath(t),e,n)},n.prototype.update=function(t,e,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),this._update(this.baseCrudPath(t),e,n,i)},n.prototype.delete=function(t,e,n){return void 0===n&&(n={}),this._delete(this.baseCrudPath(t),e,n)},n}(S)),I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.load=function(e){t.prototype.load.call(this,e),e.remoteIp=e.remoteIp||e.ip,this.url="string"==typeof e.url?e.url:"",this.method="string"==typeof e.method?e.method:"GET",this.status="number"==typeof e.status?e.status:200,this.auth="string"==typeof e.auth?e.auth:"guest",this.remoteIp="string"==typeof e.remoteIp?e.remoteIp:"",this.userIp="string"==typeof e.userIp?e.userIp:"",this.referer="string"==typeof e.referer?e.referer:"",this.userAgent="string"==typeof e.userAgent?e.userAgent:"",this.meta="object"==typeof e.meta&&null!==e.meta?e.meta:{};},n}(h),A=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getRequestsList=function(t,e,n){return void 0===t&&(t=1),void 0===e&&(e=30),void 0===n&&(n={}),n=Object.assign({page:t,perPage:e},n),this.client.send("/api/logs/requests",{method:"GET",params:n}).then((function(t){var e=[];if(null==t?void 0:t.items){t.items=(null==t?void 0:t.items)||[];for(var n=0,i=t.items;n<i.length;n++){var o=i[n];e.push(new I(o));}}return new w((null==t?void 0:t.page)||1,(null==t?void 0:t.perPage)||0,(null==t?void 0:t.totalItems)||0,(null==t?void 0:t.totalPages)||0,e)}))},n.prototype.getRequest=function(t,e){return void 0===e&&(e={}),this.client.send("/api/logs/requests/"+encodeURIComponent(t),{method:"GET",params:e}).then((function(t){return new I(t)}))},n.prototype.getRequestsStats=function(t){return void 0===t&&(t={}),this.client.send("/api/logs/requests/stats",{method:"GET",params:t}).then((function(t){return t}))},n}(b),_=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.clientId="",e.eventSource=null,e.subscriptions={},e}return e(n,t),n.prototype.subscribe=function(t,e){var n;return i(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:if(!t)throw new Error("subscription must be set.");return this.subscriptions[t]&&(null===(n=this.eventSource)||void 0===n||n.removeEventListener(t,this.subscriptions[t])),this.subscriptions[t]=function(t){var n,i=t;try{n=JSON.parse(null==i?void 0:i.data);}catch(t){}e(n||{});},this.eventSource?[3,1]:(this.connect(),[3,3]);case 1:return this.clientId?[4,this.submitSubscriptions()]:[3,3];case 2:i.sent(),i.label=3;case 3:return [2]}}))}))},n.prototype.unsubscribe=function(t){var e;return i(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:if(t){if(!this.subscriptions[t])return [2];null===(e=this.eventSource)||void 0===e||e.removeEventListener(t,this.subscriptions[t]),delete this.subscriptions[t];}else this.removeSubscriptionListeners(),this.subscriptions={};return this.clientId?[4,this.submitSubscriptions()]:[3,2];case 1:n.sent(),n.label=2;case 2:return Object.keys(this.subscriptions).length||this.disconnect(),[2]}}))}))},n.prototype.submitSubscriptions=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return this.addSubscriptionListeners(),[2,this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:Object.keys(this.subscriptions)},params:{$autoCancel:!1}}).then((function(){return !0}))]}))}))},n.prototype.addSubscriptionListeners=function(){if(this.eventSource)for(var t in this.removeSubscriptionListeners(),this.subscriptions)this.eventSource.addEventListener(t,this.subscriptions[t]);},n.prototype.removeSubscriptionListeners=function(){if(this.eventSource)for(var t in this.subscriptions)this.eventSource.removeEventListener(t,this.subscriptions[t]);},n.prototype.connectHandler=function(t){var e=t;this.clientId=null==e?void 0:e.lastEventId,this.submitSubscriptions();},n.prototype.connect=function(){var t=this;this.disconnect(),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.addEventListener("PB_CONNECT",(function(e){return t.connectHandler(e)}));},n.prototype.disconnect=function(){var t,e,n=this;this.removeSubscriptionListeners(),null===(t=this.eventSource)||void 0===t||t.removeEventListener("PB_CONNECT",(function(t){return n.connectHandler(t)})),null===(e=this.eventSource)||void 0===e||e.close(),this.eventSource=null,this.clientId="";},n}(b),x=function(){function t(t,e,n){void 0===t&&(t="/"),void 0===e&&(e="en-US"),this.cancelControllers={},this.baseUrl=t,this.lang=e,this.authStore=n||new m,this.admins=new C(this),this.users=new j(this),this.records=new T(this),this.collections=new E(this),this.logs=new A(this),this.settings=new g(this),this.realtime=new _(this);}return Object.defineProperty(t.prototype,"AuthStore",{get:function(){return this.authStore},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Settings",{get:function(){return this.settings},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Admins",{get:function(){return this.admins},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Users",{get:function(){return this.users},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Collections",{get:function(){return this.collections},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Records",{get:function(){return this.records},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Logs",{get:function(){return this.logs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Realtime",{get:function(){return this.realtime},enumerable:!1,configurable:!0}),t.prototype.cancelRequest=function(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this},t.prototype.cancelAllRequests=function(){for(var t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this},t.prototype.send=function(t,e){var n,r,a,u,l,c,d,h,p;return i(this,void 0,void 0,(function(){var f,v,y,m,b,g,w=this;return o(this,(function(S){return (f=Object.assign({method:"GET"},e)).body&&"FormData"!==f.body.constructor.name&&("string"!=typeof f.body&&(f.body=JSON.stringify(f.body)),void 0===(null===(n=null==f?void 0:f.headers)||void 0===n?void 0:n["Content-Type"])&&(f.headers=Object.assign({},f.headers,{"Content-Type":"application/json"}))),void 0===(null===(r=null==f?void 0:f.headers)||void 0===r?void 0:r["Accept-Language"])&&(f.headers=Object.assign({},f.headers,{"Accept-Language":this.lang})),(null===(a=this.authStore)||void 0===a?void 0:a.token)&&void 0===(null===(u=null==f?void 0:f.headers)||void 0===u?void 0:u.Authorization)&&(v="Admin",void 0!==(null===(l=this.authStore.model)||void 0===l?void 0:l.verified)&&(v="User"),f.headers=Object.assign({},f.headers,{Authorization:v+" "+this.authStore.token})),!1!==(null===(c=f.params)||void 0===c?void 0:c.$autoCancel)&&(y=(null===(d=f.params)||void 0===d?void 0:d.$cancelKey)||(f.method||"GET")+t,this.cancelRequest(y),m=new AbortController,this.cancelControllers[y]=m,f.signal=m.signal),null===(h=f.params)||void 0===h||delete h.$autoCancel,null===(p=f.params)||void 0===p||delete p.$cancelKey,b=this.buildUrl(t),void 0!==f.params&&((g=this.serializeQueryParams(f.params))&&(b+=(b.includes("?")?"&":"?")+g),delete f.params),this.beforeSend&&(f=Object.assign({},this.beforeSend(b,f))),[2,fetch(b,f).then((function(t){return i(w,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:e={},n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.json()];case 2:return e=n.sent(),[3,4];case 3:return n.sent(),[3,4];case 4:if(this.afterSend&&(e=this.afterSend(t,e)),t.status>=400)throw new s({url:t.url,status:t.status,data:e});return [2,e]}}))}))})).catch((function(t){throw new s(t)}))]}))}))},t.prototype.buildUrl=function(t){var e=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return t&&(e+=t.startsWith("/")?t.substring(1):t),e},t.prototype.serializeQueryParams=function(t){var e=[];for(var n in t)if(null!==t[n]){var i=t[n],o=encodeURIComponent(n);if(Array.isArray(i))for(var r=0,s=i;r<s.length;r++){var a=s[r];e.push(o+"="+encodeURIComponent(a));}else i instanceof Date?e.push(o+"="+encodeURIComponent(i.toISOString())):null!==typeof i&&"object"==typeof i?e.push(o+"="+encodeURIComponent(JSON.stringify(i))):e.push(o+"="+encodeURIComponent(i));}return e.join("&")},t}();
|
|
6032
|
-
|
|
6033
6035
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
6034
6036
|
|
|
6035
6037
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -6138,7 +6140,7 @@
|
|
|
6138
6140
|
const Pocketbase = props => {
|
|
6139
6141
|
const [client, setClient] = react.useState(null);
|
|
6140
6142
|
react.useEffect(() => {
|
|
6141
|
-
const client = new
|
|
6143
|
+
const client = new PocketBase__default["default"](props.serverURL);
|
|
6142
6144
|
client.admins.authViaEmail(props.credentials.username, props.credentials.password).then(() => {
|
|
6143
6145
|
setClient(client);
|
|
6144
6146
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react-dom"),require("pocketbase")):"function"==typeof define&&define.amd?define(["exports","react-dom","pocketbase"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).PocketbaseReact={},e.reactDom,e.Pocketbase)}(this,(function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(r),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/()}},r.exports),r.exports}var o=Symbol.for("react.element"),i=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),l=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),y=Symbol.iterator;var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,m={};function g(t,e,r){this.props=t,this.context=e,this.refs=m,this.updater=r||v}function O(){}function w(t,e,r){this.props=t,this.context=e,this.refs=m,this.updater=r||v}g.prototype.isReactComponent={},g.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},g.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},O.prototype=g.prototype;var S=w.prototype=new O;S.constructor=w,b(S,g.prototype),S.isPureReactComponent=!0;var P=Array.isArray,j=Object.prototype.hasOwnProperty,E={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function C(t,e,r){var n,i={},u=null,s=null;if(null!=e)for(n in void 0!==e.ref&&(s=e.ref),void 0!==e.key&&(u=""+e.key),e)j.call(e,n)&&!_.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(1===a)i.children=r;else if(a>1){for(var c=Array(a),l=0;a>l;l++)c[l]=arguments[l+2];i.children=c}if(t&&t.defaultProps)for(n in a=t.defaultProps)void 0===i[n]&&(i[n]=a[n]);return{$$typeof:o,type:t,key:u,ref:s,props:i,_owner:E.current}}function R(t){return"object"==typeof t&&null!==t&&t.$$typeof===o}var k=/\/+/g;function x(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,(function(t){return e[t]}))}(""+t.key):e.toString(36)}function A(t,e,r,n,u){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var a=!1;if(null===t)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case o:case i:a=!0}}if(a)return u=u(a=t),t=""===n?"."+x(a,0):n,P(u)?(r="",null!=t&&(r=t.replace(k,"$&/")+"/"),A(u,e,r,"",(function(t){return t}))):null!=u&&(R(u)&&(u=function(t,e){return{$$typeof:o,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}(u,r+(!u.key||a&&a.key===u.key?"":(""+u.key).replace(k,"$&/")+"/")+t)),e.push(u)),1;if(a=0,n=""===n?".":n+":",P(t))for(var c=0;t.length>c;c++){var l=n+x(s=t[c],c);a+=A(s,e,r,l,u)}else if(l=function(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=y&&t[y]||t["@@iterator"])?t:null}(t),"function"==typeof l)for(t=l.call(t),c=0;!(s=t.next()).done;)a+=A(s=s.value,e,r,l=n+x(s,c++),u);else if("object"===s)throw Error("Objects are not valid as a React child (found: "+("[object Object]"===(e=t+"")?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return a}function I(t,e,r){if(null==t)return t;var n=[],o=0;return A(t,n,"","",(function(t){return e.call(r,t,o++)})),n}function T(t){if(-1===t._status){var e=t._result;(e=e()).then((function(e){0!==t._status&&-1!==t._status||(t._status=1,t._result=e)}),(function(e){0!==t._status&&-1!==t._status||(t._status=2,t._result=e)})),-1===t._status&&(t._status=0,t._result=e)}if(1===t._status)return t._result.default;throw t._result}var D={current:null},$={transition:null},N={map:I,forEach:function(t,e,r){I(t,(function(){e.apply(this,arguments)}),r)},count:function(t){var e=0;return I(t,(function(){e++})),e},toArray:function(t){return I(t,(function(t){return t}))||[]},only:function(t){if(!R(t))throw Error("React.Children.only expected to receive a single React element child.");return t}},L={Children:N,Component:g,Fragment:u,Profiler:a,PureComponent:w,StrictMode:s,Suspense:p,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:D,ReactCurrentBatchConfig:$,ReactCurrentOwner:E},cloneElement:function(t,e,r){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=b({},t.props),i=t.key,u=t.ref,s=t._owner;if(null!=e){if(void 0!==e.ref&&(u=e.ref,s=E.current),void 0!==e.key&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(c in e)j.call(e,c)&&!_.hasOwnProperty(c)&&(n[c]=void 0===e[c]&&void 0!==a?a[c]:e[c])}var c=arguments.length-2;if(1===c)n.children=r;else if(c>1){a=Array(c);for(var l=0;c>l;l++)a[l]=arguments[l+2];n.children=a}return{$$typeof:o,type:t.type,key:i,ref:u,props:n,_owner:s}},createContext:function(t){return(t={$$typeof:l,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:c,_context:t},t.Consumer=t},createElement:C,createFactory:function(t){var e=C.bind(null,t);return e.type=t,e},createRef:function(){return{current:null}},forwardRef:function(t){return{$$typeof:f,render:t}},isValidElement:R,lazy:function(t){return{$$typeof:h,_payload:{_status:-1,_result:t},_init:T}},memo:function(t,e){return{$$typeof:d,type:t,compare:void 0===e?null:e}},startTransition:function(t){var e=$.transition;$.transition={};try{t()}finally{$.transition=e}},unstable_act:function(){throw Error("act(...) is not supported in production builds of React.")},useCallback:function(t,e){return D.current.useCallback(t,e)},useContext:function(t){return D.current.useContext(t)},useDebugValue:function(){},useDeferredValue:function(t){return D.current.useDeferredValue(t)},useEffect:function(t,e){return D.current.useEffect(t,e)},useId:function(){return D.current.useId()},useImperativeHandle:function(t,e,r){return D.current.useImperativeHandle(t,e,r)},useInsertionEffect:function(t,e){return D.current.useInsertionEffect(t,e)},useLayoutEffect:function(t,e){return D.current.useLayoutEffect(t,e)},useMemo:function(t,e){return D.current.useMemo(t,e)},useReducer:function(t,e,r){return D.current.useReducer(t,e,r)},useRef:function(t){return D.current.useRef(t)},useState:function(t){return D.current.useState(t)},useSyncExternalStore:function(t,e,r){return D.current.useSyncExternalStore(t,e,r)},useTransition:function(){return D.current.useTransition()},version:"18.0.0-fc46dba67-20220329"},U=n((function(t){t.exports=L}));const M="SET_RECORDS",F="ADD_RECORD",q="ADD_RECORDS",z="UPDATE_RECORD",V="DELETE_RECORD",G="DELETE_RECORDS",J=(t,e)=>({type:M,key:t,payload:e}),K=(t,e)=>({type:F,key:t,payload:e}),W=(t,e)=>({type:V,key:t,payload:e}),B=(t,e)=>({type:z,key:t,payload:e});var H=Object.freeze({__proto__:null,setRecords:J,addRecord:K,addRecords:(t,e)=>({type:q,key:t,payload:e}),deleteRecord:W,deleteRecords:(t,e)=>({type:G,key:t,payload:e}),updateRecord:B});function X(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Y(t){for(var e=1;arguments.length>e;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Q(Object(r),!0).forEach((function(e){X(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Z(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var tt="function"==typeof Symbol&&Symbol.observable||"@@observable",et=function(){return Math.random().toString(36).substring(7).split("").join(".")},rt={INIT:"@@redux/INIT"+et(),REPLACE:"@@redux/REPLACE"+et(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+et()}};function nt(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ot(t,e,r){var n;if("function"==typeof e&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw Error(Z(0));if("function"==typeof e&&void 0===r&&(r=e,e=void 0),void 0!==r){if("function"!=typeof r)throw Error(Z(1));return r(ot)(t,e)}if("function"!=typeof t)throw Error(Z(2));var o=t,i=e,u=[],s=u,a=!1;function c(){s===u&&(s=u.slice())}function l(){if(a)throw Error(Z(3));return i}function f(t){if("function"!=typeof t)throw Error(Z(4));if(a)throw Error(Z(5));var e=!0;return c(),s.push(t),function(){if(e){if(a)throw Error(Z(6));e=!1,c();var r=s.indexOf(t);s.splice(r,1),u=null}}}function p(t){if(!nt(t))throw Error(Z(7));if(void 0===t.type)throw Error(Z(8));if(a)throw Error(Z(9));try{a=!0,i=o(i,t)}finally{a=!1}for(var e=u=s,r=0;e.length>r;r++){(0,e[r])()}return t}function d(t){if("function"!=typeof t)throw Error(Z(10));o=t,p({type:rt.REPLACE})}function h(){var t,e=f;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw Error(Z(11));function r(){t.next&&t.next(l())}return r(),{unsubscribe:e(r)}}})[tt]=function(){return this},t}return p({type:rt.INIT}),(n={dispatch:p,subscribe:f,getState:l,replaceReducer:d})[tt]=h,n}function it(t){for(var e=Object.keys(t),r={},n=0;e.length>n;n++){var o=e[n];"function"==typeof t[o]&&(r[o]=t[o])}var i,u=Object.keys(r);try{!function(t){Object.keys(t).forEach((function(e){var r=t[e];if(void 0===r(void 0,{type:rt.INIT}))throw Error(Z(12));if(void 0===r(void 0,{type:rt.PROBE_UNKNOWN_ACTION()}))throw Error(Z(13))}))}(r)}catch(t){i=t}return function(t,e){if(void 0===t&&(t={}),i)throw i;for(var n=!1,o={},s=0;u.length>s;s++){var a=u[s],c=t[a],l=(0,r[a])(c,e);if(void 0===l)throw Error(Z(14));o[a]=l,n=n||l!==c}return(n=n||u.length!==Object.keys(t).length)?o:t}}function ut(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function st(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return function(t){return function(){var r=t.apply(void 0,arguments),n=function(){throw Error(Z(15))},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return n=ut.apply(void 0,i)(r.dispatch),Y(Y({},r),{},{dispatch:n})}}}function at(){return at=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},at.apply(this,arguments)}function ct(t,e){return[...e,t]}function lt(t,e){return[...e,...t]}function ft(t,e){return e.map((e=>e.id===t.id?t:e))}function pt(t,e){return e.filter((e=>e.id!==t.id))}function dt(t,e){return e.filter((e=>!t.includes(e)))}const ht=it({records:(t={},e)=>{var r;const n=null!=(r=t[e.key])?r:[];switch(e.type){case M:if(Array.isArray(e.payload))return at({},t,{[e.key]:e.payload});case F:return at({},t,{[e.key]:ct(e.payload,n)});case q:return at({},t,{[e.key]:lt(e.payload,n)});case V:return at({},t,{[e.key]:pt(e.payload,n)});case G:return at({},t,{[e.key]:dt(e.payload,n)});case z:return at({},t,{[e.key]:ft(e.payload,n)});default:return t}}});function yt(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;e>n;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function vt(t){return!!t&&!!t[re]}function bt(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===ne}(t)||Array.isArray(t)||!!t[ee]||!!t.constructor[ee]||Pt(t)||jt(t))}function mt(t,e,r){void 0===r&&(r=!1),0===gt(t)?(r?Object.keys:oe)(t).forEach((function(n){r&&"symbol"==typeof n||e(n,t[n],t)})):t.forEach((function(r,n){return e(n,r,t)}))}function gt(t){var e=t[re];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Pt(t)?2:jt(t)?3:0}function Ot(t,e){return 2===gt(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function wt(t,e,r){var n=gt(t);2===n?t.set(e,r):3===n?(t.delete(e),t.add(r)):t[e]=r}function St(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function Pt(t){return Qt&&t instanceof Map}function jt(t){return Yt&&t instanceof Set}function Et(t){return t.o||t.t}function _t(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=ie(t);delete e[re];for(var r=oe(e),n=0;r.length>n;n++){var o=r[n],i=e[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[o]})}return Object.create(Object.getPrototypeOf(t),e)}function Ct(t,e){return void 0===e&&(e=!1),kt(t)||vt(t)||!bt(t)||(gt(t)>1&&(t.set=t.add=t.clear=t.delete=Rt),Object.freeze(t),e&&mt(t,(function(t,e){return Ct(e,!0)}),!0)),t}function Rt(){yt(2)}function kt(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function xt(t){var e=ue[t];return e||yt(18,t),e}function At(){return Ht}function It(t,e){e&&(xt("Patches"),t.u=[],t.s=[],t.v=e)}function Tt(t){Dt(t),t.p.forEach(Nt),t.p=null}function Dt(t){t===Ht&&(Ht=t.l)}function $t(t){return Ht={p:[],l:Ht,h:t,m:!0,_:0}}function Nt(t){var e=t[re];0===e.i||1===e.i?e.j():e.O=!0}function Lt(t,e){e._=e.p.length;var r=e.p[0],n=void 0!==t&&t!==r;return e.h.g||xt("ES5").S(e,t,n),n?(r[re].P&&(Tt(e),yt(4)),bt(t)&&(t=Ut(e,t),e.l||Ft(e,t)),e.u&&xt("Patches").M(r[re].t,t,e.u,e.s)):t=Ut(e,r,[]),Tt(e),e.u&&e.v(e.u,e.s),t!==te?t:void 0}function Ut(t,e,r){if(kt(e))return e;var n=e[re];if(!n)return mt(e,(function(o,i){return Mt(t,n,e,o,i,r)}),!0),e;if(n.A!==t)return e;if(!n.P)return Ft(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=_t(n.k):n.o;mt(3===n.i?new Set(o):o,(function(e,i){return Mt(t,n,o,e,i,r)})),Ft(t,o,!1),r&&t.u&&xt("Patches").R(n,r,t.u,t.s)}return n.o}function Mt(t,e,r,n,o,i){if(vt(o)){var u=Ut(t,o,i&&e&&3!==e.i&&!Ot(e.D,n)?i.concat(n):void 0);if(wt(r,n,u),!vt(u))return;t.m=!1}if(bt(o)&&!kt(o)){if(!t.h.F&&1>t._)return;Ut(t,o),e&&e.A.l||Ft(t,o)}}function Ft(t,e,r){void 0===r&&(r=!1),t.h.F&&t.m&&Ct(e,r)}function qt(t,e){var r=t[re];return(r?Et(r):t)[e]}function zt(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Vt(t){t.P||(t.P=!0,t.l&&Vt(t.l))}function Gt(t){t.o||(t.o=_t(t.t))}function Jt(t,e,r){var n=Pt(e)?xt("MapSet").N(e,r):jt(e)?xt("MapSet").T(e,r):t.g?function(t,e){var r=Array.isArray(t),n={i:r?1:0,A:e?e.A:At(),P:!1,I:!1,D:{},l:e,t:t,k:null,o:null,j:null,C:!1},o=n,i=se;r&&(o=[n],i=ae);var u=Proxy.revocable(o,i),s=u.revoke,a=u.proxy;return n.k=a,n.j=s,a}(e,r):xt("ES5").J(e,r);return(r?r.A:At()).p.push(n),n}function Kt(t){return vt(t)||yt(22,t),function t(e){if(!bt(e))return e;var r,n=e[re],o=gt(e);if(n){if(!n.P&&(4>n.i||!xt("ES5").K(n)))return n.t;n.I=!0,r=Wt(e,o),n.I=!1}else r=Wt(e,o);return mt(r,(function(e,o){n&&function(t,e){return 2===gt(t)?t.get(e):t[e]}(n.t,e)===o||wt(r,e,t(o))})),3===o?new Set(r):r}(t)}function Wt(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return _t(t)}var Bt,Ht,Xt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Qt="undefined"!=typeof Map,Yt="undefined"!=typeof Set,Zt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,te=Xt?Symbol.for("immer-nothing"):((Bt={})["immer-nothing"]=!0,Bt),ee=Xt?Symbol.for("immer-draftable"):"__$immer_draftable",re=Xt?Symbol.for("immer-state"):"__$immer_state",ne=""+Object.prototype.constructor,oe="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,ie=Object.getOwnPropertyDescriptors||function(t){var e={};return oe(t).forEach((function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)})),e},ue={},se={get:function(t,e){if(e===re)return t;var r=Et(t);if(!Ot(r,e))return function(t,e,r){var n,o=zt(e,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(t.k):void 0}(t,r,e);var n=r[e];return t.I||!bt(n)?n:n===qt(t.t,e)?(Gt(t),t.o[e]=Jt(t.A.h,n,t)):n},has:function(t,e){return e in Et(t)},ownKeys:function(t){return Reflect.ownKeys(Et(t))},set:function(t,e,r){var n=zt(Et(t),e);if(null==n?void 0:n.set)return n.set.call(t.k,r),!0;if(!t.P){var o=qt(Et(t),e),i=null==o?void 0:o[re];if(i&&i.t===r)return t.o[e]=r,t.D[e]=!1,!0;if(St(r,o)&&(void 0!==r||Ot(t.t,e)))return!0;Gt(t),Vt(t)}return t.o[e]===r&&"number"!=typeof r&&(void 0!==r||e in t.o)||(t.o[e]=r,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==qt(t.t,e)||e in t.t?(t.D[e]=!1,Gt(t),Vt(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=Et(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:n.enumerable,value:r[e]}:n},defineProperty:function(){yt(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){yt(12)}},ae={};mt(se,(function(t,e){ae[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),ae.deleteProperty=function(t,e){return ae.set.call(this,t,e,void 0)},ae.set=function(t,e,r){return se.set.call(this,t[0],e,r,t[0])};var ce=function(){function t(t){var e=this;this.g=Zt,this.F=!0,this.produce=function(t,r,n){if("function"==typeof t&&"function"!=typeof r){var o=r;r=t;var i=e;return function(t){var e=this;void 0===t&&(t=o);for(var n=arguments.length,u=Array(n>1?n-1:0),s=1;n>s;s++)u[s-1]=arguments[s];return i.produce(t,(function(t){var n;return(n=r).call.apply(n,[e,t].concat(u))}))}}var u;if("function"!=typeof r&&yt(6),void 0!==n&&"function"!=typeof n&&yt(7),bt(t)){var s=$t(e),a=Jt(e,t,void 0),c=!0;try{u=r(a),c=!1}finally{c?Tt(s):Dt(s)}return"undefined"!=typeof Promise&&u instanceof Promise?u.then((function(t){return It(s,n),Lt(t,s)}),(function(t){throw Tt(s),t})):(It(s,n),Lt(u,s))}if(!t||"object"!=typeof t){if(void 0===(u=r(t))&&(u=t),u===te&&(u=void 0),e.F&&Ct(u,!0),n){var l=[],f=[];xt("Patches").M(t,u,l,f),n(l,f)}return u}yt(21,t)},this.produceWithPatches=function(t,r){if("function"==typeof t)return function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;n>i;i++)o[i-1]=arguments[i];return e.produceWithPatches(r,(function(e){return t.apply(void 0,[e].concat(o))}))};var n,o,i=e.produce(t,r,(function(t,e){n=t,o=e}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(t){return[t,n,o]})):[i,n,o]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){bt(t)||yt(8),vt(t)&&(t=Kt(t));var e=$t(this),r=Jt(this,t,void 0);return r[re].C=!0,Dt(e),r},e.finishDraft=function(t,e){var r=(t&&t[re]).A;return It(r,e),Lt(void 0,r)},e.setAutoFreeze=function(t){this.F=t},e.setUseProxies=function(t){t&&!Zt&&yt(20),this.g=t},e.applyPatches=function(t,e){var r;for(r=e.length-1;r>=0;r--){var n=e[r];if(0===n.path.length&&"replace"===n.op){t=n.value;break}}r>-1&&(e=e.slice(r+1));var o=xt("Patches").$;return vt(t)?o(t,e):this.produce(t,(function(t){return o(t,e)}))},t}(),le=new ce;function fe(t){return function(e){var r=e.dispatch,n=e.getState;return function(e){return function(o){return"function"==typeof o?o(r,n,t):e(o)}}}}le.produceWithPatches.bind(le),le.setAutoFreeze.bind(le),le.setUseProxies.bind(le),le.applyPatches.bind(le),le.createDraft.bind(le),le.finishDraft.bind(le);var pe=fe();pe.withExtraArgument=fe;var de,he=pe,ye=(de=function(t,e){return de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},de(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}de(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ve=function(t,e){for(var r=0,n=e.length,o=t.length;n>r;r++,o++)t[o]=e[r];return t},be=Object.defineProperty,me=Object.getOwnPropertySymbols,ge=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,we=function(t,e,r){return e in t?be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},Se="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?ut:ut.apply(null,arguments)};var Pe=function(t){function e(){for(var r=[],n=0;arguments.length>n;n++)r[n]=arguments[n];var o=t.apply(this,r)||this;return Object.setPrototypeOf(o,e.prototype),o}return ye(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],r=0;arguments.length>r;r++)t[r]=arguments[r];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,ve([void 0],t[0].concat(this)))):new(e.bind.apply(e,ve([void 0],t.concat(this))))},e}(Array);function je(){return function(t){return function(t){void 0===t&&(t={});var e=t.thunk,r=void 0===e||e;var n=new Pe;r&&(!function(t){return"boolean"==typeof t}(r)?n.push(he.withExtraArgument(r.extraArgument)):n.push(he));return n}(t)}}!function(){function t(t,e){var r=o[t];return r?r.enumerable=e:o[t]=r={configurable:!0,enumerable:e,get:function(){return se.get(this[re],t)},set:function(e){se.set(this[re],t,e)}},r}function e(t){for(var e=t.length-1;e>=0;e--){var o=t[e][re];if(!o.P)switch(o.i){case 5:n(o)&&Vt(o);break;case 4:r(o)&&Vt(o)}}}function r(t){for(var e=t.t,r=t.k,n=oe(r),o=n.length-1;o>=0;o--){var i=n[o];if(i!==re){var u=e[i];if(void 0===u&&!Ot(e,i))return!0;var s=r[i],a=s&&s[re];if(a?a.t!==u:!St(s,u))return!0}}var c=!!e[re];return n.length!==oe(e).length+(c?0:1)}function n(t){var e=t.k;if(e.length!==t.t.length)return!0;var r=Object.getOwnPropertyDescriptor(e,e.length-1);if(r&&!r.get)return!0;for(var n=0;e.length>n;n++)if(!e.hasOwnProperty(n))return!0;return!1}var o={};!function(t,e){ue[t]||(ue[t]=e)}("ES5",{J:function(e,r){var n=Array.isArray(e),o=function(e,r){if(e){for(var n=Array(r.length),o=0;r.length>o;o++)Object.defineProperty(n,""+o,t(o,!0));return n}var i=ie(r);delete i[re];for(var u=oe(i),s=0;u.length>s;s++){var a=u[s];i[a]=t(a,e||!!i[a].enumerable)}return Object.create(Object.getPrototypeOf(r),i)}(n,e),i={i:n?5:4,A:r?r.A:At(),P:!1,I:!1,D:{},l:r,t:e,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,re,{value:i,writable:!0}),o},S:function(t,r,o){o?vt(r)&&r[re].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var r=e[re];if(r){var o=r.t,i=r.k,u=r.D,s=r.i;if(4===s)mt(i,(function(e){e!==re&&(void 0!==o[e]||Ot(o,e)?u[e]||t(i[e]):(u[e]=!0,Vt(r)))})),mt(o,(function(t){void 0!==i[t]||Ot(i,t)||(u[t]=!1,Vt(r))}));else if(5===s){if(n(r)&&(Vt(r),u.length=!0),o.length>i.length)for(var a=i.length;o.length>a;a++)u[a]=!1;else for(var c=o.length;i.length>c;c++)u[c]=!0;for(var l=Math.min(i.length,o.length),f=0;l>f;f++)i.hasOwnProperty(f)||(u[f]=!0),void 0===u[f]&&t(i[f])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?r(t):n(t)}})}();var Ee="persist:",_e="persist/FLUSH",Ce="persist/REHYDRATE",Re="persist/PAUSE",ke="persist/PERSIST",xe="persist/PURGE",Ae="persist/REGISTER";function Ie(t){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(t)}function Te(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function De(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $e(t,e,r,n){var o=function(t){for(var e=1;arguments.length>e;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Te(r,!0).forEach((function(e){De(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Te(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},r);return t&&"object"===Ie(t)&&Object.keys(t).forEach((function(n){"_persist"!==n&&e[n]===r[n]&&(o[n]=t[n])})),o}function Ne(t){var e,r=t.blacklist||null,n=t.whitelist||null,o=t.transforms||[],i=t.throttle||0,u="".concat(void 0!==t.keyPrefix?t.keyPrefix:Ee).concat(t.key),s=t.storage;e=!1===t.serialize?function(t){return t}:"function"==typeof t.serialize?t.serialize:Le;var a=t.writeFailHandler||null,c={},l={},f=[],p=null,d=null;function h(){if(0===f.length)return p&&clearInterval(p),void(p=null);var t=f.shift(),r=o.reduce((function(e,r){return r.in(e,t,c)}),c[t]);if(void 0!==r)try{l[t]=e(r)}catch(t){console.error("redux-persist/createPersistoid: error serializing state",t)}else delete l[t];0===f.length&&(Object.keys(l).forEach((function(t){void 0===c[t]&&delete l[t]})),d=s.setItem(u,e(l)).catch(v))}function y(t){return(!n||-1!==n.indexOf(t)||"_persist"===t)&&(!r||-1===r.indexOf(t))}function v(t){a&&a(t)}return{update:function(t){Object.keys(t).forEach((function(e){y(e)&&c[e]!==t[e]&&-1===f.indexOf(e)&&f.push(e)})),Object.keys(c).forEach((function(e){void 0===t[e]&&y(e)&&-1===f.indexOf(e)&&void 0!==c[e]&&f.push(e)})),null===p&&(p=setInterval(h,i)),c=t},flush:function(){for(;0!==f.length;)h();return d||Promise.resolve()}}}function Le(t){return JSON.stringify(t)}function Ue(t){var e,r=t.transforms||[],n="".concat(void 0!==t.keyPrefix?t.keyPrefix:Ee).concat(t.key);return e=!1===t.deserialize?function(t){return t}:"function"==typeof t.deserialize?t.deserialize:Me,t.storage.getItem(n).then((function(t){if(t)try{var n={},o=e(t);return Object.keys(o).forEach((function(t){n[t]=r.reduceRight((function(e,r){return r.out(e,t,o)}),e(o[t]))})),n}catch(t){throw t}}))}function Me(t){return JSON.parse(t)}function Fe(t){0}function qe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ze(t){for(var e=1;arguments.length>e;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qe(r,!0).forEach((function(e){Ve(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qe(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ve(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ge(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;i.length>n;n++)0>e.indexOf(r=i[n])&&(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;i.length>n;n++)0>e.indexOf(r=i[n])&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Je(t){return function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);t.length>e;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Ke(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function We(t){for(var e=1;arguments.length>e;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ke(r,!0).forEach((function(e){Be(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ke(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Be(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var He={registry:[],bootstrapped:!1},Xe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:He,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ae:return We({},t,{registry:[].concat(Je(t.registry),[e.key])});case Ce:var r=t.registry.indexOf(e.key),n=Je(t.registry);return n.splice(r,1),We({},t,{registry:n,bootstrapped:0===n.length});default:return t}};var Qe="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},Ye=U.useState,Ze=U.useEffect,tr=U.useLayoutEffect,er=U.useDebugValue;function rr(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Qe(t,r)}catch(t){return!0}}var nr="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var r=e(),n=Ye({inst:{value:r,getSnapshot:e}}),o=n[0].inst,i=n[1];return tr((function(){o.value=r,o.getSnapshot=e,rr(o)&&i({inst:o})}),[t,r,e]),Ze((function(){return rr(o)&&i({inst:o}),t((function(){rr(o)&&i({inst:o})}))}),[t]),er(r),r},or={useSyncExternalStore:void 0!==U.useSyncExternalStore?U.useSyncExternalStore:nr},ir=n((function(t){t.exports=or}));var ur="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},sr=ir.useSyncExternalStore,ar=U.useRef,cr=U.useEffect,lr=U.useMemo,fr=U.useDebugValue,pr={useSyncExternalStoreWithSelector:function(t,e,r,n,o){var i=ar(null);if(null===i.current){var u={hasValue:!1,value:null};i.current=u}else u=i.current;i=lr((function(){function t(t){if(!a){if(a=!0,i=t,t=n(t),void 0!==o&&u.hasValue){var e=u.value;if(o(e,t))return s=e}return s=t}if(e=s,ur(i,t))return e;var r=n(t);return void 0!==o&&o(e,r)?e:(i=t,s=r)}var i,s,a=!1,c=void 0===r?null:r;return[function(){return t(e())},null===c?void 0:function(){return t(c())}]}),[e,r,n,o]);var s=sr(t,i[0],i[1]);return cr((function(){u.hasValue=!0,u.value=s}),[s]),fr(s),s}},dr=n((function(t){t.exports=pr}));let hr=function(t){t()};const yr=()=>hr,vr=U.createContext(null);function br(){return U.useContext(vr)}let mr=()=>{throw Error("uSES not initialized!")};const gr=(t,e)=>t===e;function Or(t=vr){const e=t===vr?br:()=>U.useContext(t);return function(t,r=gr){const{store:n,subscription:o,getServerState:i}=e(),u=mr(o.addNestedSub,n.getState,i||n.getState,t,r);return U.useDebugValue(u),u}}const wr=Or();
|
|
10
|
+
*/()}},r.exports),r.exports}var c=Symbol.for("react.element"),a=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),y=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,S={};function w(e,t,r){this.props=e,this.context=t,this.refs=S,this.updater=r||g}function P(){}function j(e,t,r){this.props=e,this.context=t,this.refs=S,this.updater=r||g}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},P.prototype=w.prototype;var E=j.prototype=new P;E.constructor=j,O(E,w.prototype),E.isPureReactComponent=!0;var _=Array.isArray,x=Object.prototype.hasOwnProperty,k={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function A(e,t,r){var n,o={},i=null,u=null;if(null!=t)for(n in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(i=""+t.key),t)x.call(t,n)&&!R.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(1===a)o.children=r;else if(a>1){for(var f=Array(a),s=0;a>s;s++)f[s]=arguments[s+2];o.children=f}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===o[n]&&(o[n]=a[n]);return{$$typeof:c,type:e,key:i,ref:u,props:o,_owner:k.current}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===c}var D=/\/+/g;function $(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function I(e,t,r,n,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var u=!1;if(null===e)u=!0;else switch(i){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case c:case a:u=!0}}if(u)return o=o(u=e),e=""===n?"."+$(u,0):n,_(o)?(r="",null!=e&&(r=e.replace(D,"$&/")+"/"),I(o,t,r,"",(function(e){return e}))):null!=o&&(C(o)&&(o=function(e,t){return{$$typeof:c,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,r+(!o.key||u&&u.key===o.key?"":(""+o.key).replace(D,"$&/")+"/")+e)),t.push(o)),1;if(u=0,n=""===n?".":n+":",_(e))for(var f=0;e.length>f;f++){var s=n+$(i=e[f],f);u+=I(i,t,r,s,o)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=m&&e[m]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),f=0;!(i=e.next()).done;)u+=I(i=i.value,t,r,s=n+$(i,f++),o);else if("object"===i)throw Error("Objects are not valid as a React child (found: "+("[object Object]"===(t=e+"")?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return u}function T(e,t,r){if(null==e)return e;var n=[],o=0;return I(e,n,"","",(function(e){return t.call(r,e,o++)})),n}function N(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var M={current:null},F={transition:null},L={map:T,forEach:function(e,t,r){T(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return T(e,(function(){t++})),t},toArray:function(e){return T(e,(function(e){return e}))||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},U={Children:L,Component:w,Fragment:f,Profiler:l,PureComponent:j,StrictMode:s,Suspense:b,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:M,ReactCurrentBatchConfig:F,ReactCurrentOwner:k},cloneElement:function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=O({},e.props),o=e.key,i=e.ref,u=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,u=k.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(f in t)x.call(t,f)&&!R.hasOwnProperty(f)&&(n[f]=void 0===t[f]&&void 0!==a?a[f]:t[f])}var f=arguments.length-2;if(1===f)n.children=r;else if(f>1){a=Array(f);for(var s=0;f>s;s++)a[s]=arguments[s+2];n.children=a}return{$$typeof:c,type:e.type,key:o,ref:i,props:n,_owner:u}},createContext:function(e){return(e={$$typeof:y,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:p,_context:e},e.Consumer=e},createElement:A,createFactory:function(e){var t=A.bind(null,e);return t.type=e,t},createRef:function(){return{current:null}},forwardRef:function(e){return{$$typeof:d,render:e}},isValidElement:C,lazy:function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:N}},memo:function(e,t){return{$$typeof:v,type:e,compare:void 0===t?null:t}},startTransition:function(e){var t=F.transition;F.transition={};try{e()}finally{F.transition=t}},unstable_act:function(){throw Error("act(...) is not supported in production builds of React.")},useCallback:function(e,t){return M.current.useCallback(e,t)},useContext:function(e){return M.current.useContext(e)},useDebugValue:function(){},useDeferredValue:function(e){return M.current.useDeferredValue(e)},useEffect:function(e,t){return M.current.useEffect(e,t)},useId:function(){return M.current.useId()},useImperativeHandle:function(e,t,r){return M.current.useImperativeHandle(e,t,r)},useInsertionEffect:function(e,t){return M.current.useInsertionEffect(e,t)},useLayoutEffect:function(e,t){return M.current.useLayoutEffect(e,t)},useMemo:function(e,t){return M.current.useMemo(e,t)},useReducer:function(e,t,r){return M.current.useReducer(e,t,r)},useRef:function(e){return M.current.useRef(e)},useState:function(e){return M.current.useState(e)},useSyncExternalStore:function(e,t,r){return M.current.useSyncExternalStore(e,t,r)},useTransition:function(){return M.current.useTransition()},version:"18.0.0-fc46dba67-20220329"},z=u((function(e){e.exports=U}));const V="SET_RECORDS",W="ADD_RECORD",q="ADD_RECORDS",K="UPDATE_RECORD",B="DELETE_RECORD",J="DELETE_RECORDS",H=(e,t)=>({type:V,key:e,payload:t}),X=(e,t)=>({type:W,key:e,payload:t}),G=(e,t)=>({type:B,key:e,payload:t}),Y=(e,t)=>({type:K,key:e,payload:t});var Q=Object.freeze({__proto__:null,setRecords:H,addRecord:X,addRecords:(e,t)=>({type:q,key:e,payload:t}),deleteRecord:G,deleteRecords:(e,t)=>({type:J,key:e,payload:t}),updateRecord:Y});function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function te(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach((function(t){Z(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function re(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var ne="function"==typeof Symbol&&Symbol.observable||"@@observable",oe=function(){return Math.random().toString(36).substring(7).split("").join(".")},ie={INIT:"@@redux/INIT"+oe(),REPLACE:"@@redux/REPLACE"+oe(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+oe()}};function ue(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ce(e,t,r){var n;if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw Error(re(0));if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw Error(re(1));return r(ce)(e,t)}if("function"!=typeof e)throw Error(re(2));var o=e,i=t,u=[],c=u,a=!1;function f(){c===u&&(c=u.slice())}function s(){if(a)throw Error(re(3));return i}function l(e){if("function"!=typeof e)throw Error(re(4));if(a)throw Error(re(5));var t=!0;return f(),c.push(e),function(){if(t){if(a)throw Error(re(6));t=!1,f();var r=c.indexOf(e);c.splice(r,1),u=null}}}function p(e){if(!ue(e))throw Error(re(7));if(void 0===e.type)throw Error(re(8));if(a)throw Error(re(9));try{a=!0,i=o(i,e)}finally{a=!1}for(var t=u=c,r=0;t.length>r;r++){(0,t[r])()}return e}function y(e){if("function"!=typeof e)throw Error(re(10));o=e,p({type:ie.REPLACE})}function d(){var e,t=l;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw Error(re(11));function r(){e.next&&e.next(s())}return r(),{unsubscribe:t(r)}}})[ne]=function(){return this},e}return p({type:ie.INIT}),(n={dispatch:p,subscribe:l,getState:s,replaceReducer:y})[ne]=d,n}function ae(e){for(var t=Object.keys(e),r={},n=0;t.length>n;n++){var o=t[n];"function"==typeof e[o]&&(r[o]=e[o])}var i,u=Object.keys(r);try{!function(e){Object.keys(e).forEach((function(t){var r=e[t];if(void 0===r(void 0,{type:ie.INIT}))throw Error(re(12));if(void 0===r(void 0,{type:ie.PROBE_UNKNOWN_ACTION()}))throw Error(re(13))}))}(r)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var n=!1,o={},c=0;u.length>c;c++){var a=u[c],f=e[a],s=(0,r[a])(f,t);if(void 0===s)throw Error(re(14));o[a]=s,n=n||s!==f}return(n=n||u.length!==Object.keys(e).length)?o:e}}function fe(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function se(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),n=function(){throw Error(re(15))},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return n=fe.apply(void 0,i)(r.dispatch),te(te({},r),{},{dispatch:n})}}}function le(){return le=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},le.apply(this,arguments)}function pe(e,t){return[...t,e]}function ye(e,t){return[...t,...e]}function de(e,t){return t.map((t=>t.id===e.id?e:t))}function be(e,t){return t.filter((t=>t.id!==e.id))}function ve(e,t){return t.filter((t=>!e.includes(t)))}const he=ae({records:(e={},t)=>{var r;const n=null!=(r=e[t.key])?r:[];switch(t.type){case V:if(Array.isArray(t.payload))return le({},e,{[t.key]:t.payload});case W:return le({},e,{[t.key]:pe(t.payload,n)});case q:return le({},e,{[t.key]:ye(t.payload,n)});case B:return le({},e,{[t.key]:be(t.payload,n)});case J:return le({},e,{[t.key]:ve(t.payload,n)});case K:return le({},e,{[t.key]:de(t.payload,n)});default:return e}}});function me(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ge(e){return!!e&&!!e[it]}function Oe(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===ut}(e)||Array.isArray(e)||!!e[ot]||!!e.constructor[ot]||_e(e)||xe(e))}function Se(e,t,r){void 0===r&&(r=!1),0===we(e)?(r?Object.keys:ct)(e).forEach((function(n){r&&"symbol"==typeof n||t(n,e[n],e)})):e.forEach((function(r,n){return t(n,r,e)}))}function we(e){var t=e[it];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:_e(e)?2:xe(e)?3:0}function Pe(e,t){return 2===we(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function je(e,t,r){var n=we(e);2===n?e.set(t,r):3===n?(e.delete(t),e.add(r)):e[t]=r}function Ee(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function _e(e){return et&&e instanceof Map}function xe(e){return tt&&e instanceof Set}function ke(e){return e.o||e.t}function Re(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=at(e);delete t[it];for(var r=ct(t),n=0;r.length>n;n++){var o=r[n],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Ae(e,t){return void 0===t&&(t=!1),De(e)||ge(e)||!Oe(e)||(we(e)>1&&(e.set=e.add=e.clear=e.delete=Ce),Object.freeze(e),t&&Se(e,(function(e,t){return Ae(t,!0)}),!0)),e}function Ce(){me(2)}function De(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function $e(e){var t=ft[e];return t||me(18,e),t}function Ie(){return Qe}function Te(e,t){t&&($e("Patches"),e.u=[],e.s=[],e.v=t)}function Ne(e){Me(e),e.p.forEach(Le),e.p=null}function Me(e){e===Qe&&(Qe=e.l)}function Fe(e){return Qe={p:[],l:Qe,h:e,m:!0,_:0}}function Le(e){var t=e[it];0===t.i||1===t.i?t.j():t.O=!0}function Ue(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.g||$e("ES5").S(t,e,n),n?(r[it].P&&(Ne(t),me(4)),Oe(e)&&(e=ze(t,e),t.l||We(t,e)),t.u&&$e("Patches").M(r[it].t,e,t.u,t.s)):e=ze(t,r,[]),Ne(t),t.u&&t.v(t.u,t.s),e!==nt?e:void 0}function ze(e,t,r){if(De(t))return t;var n=t[it];if(!n)return Se(t,(function(o,i){return Ve(e,n,t,o,i,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return We(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=Re(n.k):n.o;Se(3===n.i?new Set(o):o,(function(t,i){return Ve(e,n,o,t,i,r)})),We(e,o,!1),r&&e.u&&$e("Patches").R(n,r,e.u,e.s)}return n.o}function Ve(e,t,r,n,o,i){if(ge(o)){var u=ze(e,o,i&&t&&3!==t.i&&!Pe(t.D,n)?i.concat(n):void 0);if(je(r,n,u),!ge(u))return;e.m=!1}if(Oe(o)&&!De(o)){if(!e.h.F&&1>e._)return;ze(e,o),t&&t.A.l||We(e,o)}}function We(e,t,r){void 0===r&&(r=!1),e.h.F&&e.m&&Ae(t,r)}function qe(e,t){var r=e[it];return(r?ke(r):e)[t]}function Ke(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Be(e){e.P||(e.P=!0,e.l&&Be(e.l))}function Je(e){e.o||(e.o=Re(e.t))}function He(e,t,r){var n=_e(t)?$e("MapSet").N(t,r):xe(t)?$e("MapSet").T(t,r):e.g?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:Ie(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=n,i=st;r&&(o=[n],i=lt);var u=Proxy.revocable(o,i),c=u.revoke,a=u.proxy;return n.k=a,n.j=c,a}(t,r):$e("ES5").J(t,r);return(r?r.A:Ie()).p.push(n),n}function Xe(e){return ge(e)||me(22,e),function e(t){if(!Oe(t))return t;var r,n=t[it],o=we(t);if(n){if(!n.P&&(4>n.i||!$e("ES5").K(n)))return n.t;n.I=!0,r=Ge(t,o),n.I=!1}else r=Ge(t,o);return Se(r,(function(t,o){n&&function(e,t){return 2===we(e)?e.get(t):e[t]}(n.t,t)===o||je(r,t,e(o))})),3===o?new Set(r):r}(e)}function Ge(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Re(e)}var Ye,Qe,Ze="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),et="undefined"!=typeof Map,tt="undefined"!=typeof Set,rt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,nt=Ze?Symbol.for("immer-nothing"):((Ye={})["immer-nothing"]=!0,Ye),ot=Ze?Symbol.for("immer-draftable"):"__$immer_draftable",it=Ze?Symbol.for("immer-state"):"__$immer_state",ut=""+Object.prototype.constructor,ct="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,at=Object.getOwnPropertyDescriptors||function(e){var t={};return ct(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},ft={},st={get:function(e,t){if(t===it)return e;var r=ke(e);if(!Pe(r,t))return function(e,t,r){var n,o=Ke(t,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(e.k):void 0}(e,r,t);var n=r[t];return e.I||!Oe(n)?n:n===qe(e.t,t)?(Je(e),e.o[t]=He(e.A.h,n,e)):n},has:function(e,t){return t in ke(e)},ownKeys:function(e){return Reflect.ownKeys(ke(e))},set:function(e,t,r){var n=Ke(ke(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=qe(ke(e),t),i=null==o?void 0:o[it];if(i&&i.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(Ee(r,o)&&(void 0!==r||Pe(e.t,t)))return!0;Je(e),Be(e)}return e.o[t]===r&&"number"!=typeof r&&(void 0!==r||t in e.o)||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==qe(e.t,t)||t in e.t?(e.D[t]=!1,Je(e),Be(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=ke(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){me(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){me(12)}},lt={};Se(st,(function(e,t){lt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),lt.deleteProperty=function(e,t){return lt.set.call(this,e,t,void 0)},lt.set=function(e,t,r){return st.set.call(this,e[0],t,r,e[0])};var pt=function(){function e(e){var t=this;this.g=rt,this.F=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var o=r;r=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var n=arguments.length,u=Array(n>1?n-1:0),c=1;n>c;c++)u[c-1]=arguments[c];return i.produce(e,(function(e){var n;return(n=r).call.apply(n,[t,e].concat(u))}))}}var u;if("function"!=typeof r&&me(6),void 0!==n&&"function"!=typeof n&&me(7),Oe(e)){var c=Fe(t),a=He(t,e,void 0),f=!0;try{u=r(a),f=!1}finally{f?Ne(c):Me(c)}return"undefined"!=typeof Promise&&u instanceof Promise?u.then((function(e){return Te(c,n),Ue(e,c)}),(function(e){throw Ne(c),e})):(Te(c,n),Ue(u,c))}if(!e||"object"!=typeof e){if(void 0===(u=r(e))&&(u=e),u===nt&&(u=void 0),t.F&&Ae(u,!0),n){var s=[],l=[];$e("Patches").M(e,u,s,l),n(s,l)}return u}me(21,e)},this.produceWithPatches=function(e,r){if("function"==typeof e)return function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;n>i;i++)o[i-1]=arguments[i];return t.produceWithPatches(r,(function(t){return e.apply(void 0,[t].concat(o))}))};var n,o,i=t.produce(e,r,(function(e,t){n=e,o=t}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return[e,n,o]})):[i,n,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){Oe(e)||me(8),ge(e)&&(e=Xe(e));var t=Fe(this),r=He(this,e,void 0);return r[it].C=!0,Me(t),r},t.finishDraft=function(e,t){var r=(e&&e[it]).A;return Te(r,t),Ue(void 0,r)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!rt&&me(20),this.g=e},t.applyPatches=function(e,t){var r;for(r=t.length-1;r>=0;r--){var n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));var o=$e("Patches").$;return ge(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),yt=new pt;function dt(e){return function(t){var r=t.dispatch,n=t.getState;return function(t){return function(o){return"function"==typeof o?o(r,n,e):t(o)}}}}yt.produceWithPatches.bind(yt),yt.setAutoFreeze.bind(yt),yt.setUseProxies.bind(yt),yt.applyPatches.bind(yt),yt.createDraft.bind(yt),yt.finishDraft.bind(yt);var bt=dt();bt.withExtraArgument=dt;var vt,ht=bt,mt=(vt=function(e,t){return vt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},vt(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+t+" is not a constructor or null");function r(){this.constructor=e}vt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),gt=function(e,t){for(var r=0,n=t.length,o=e.length;n>r;r++,o++)e[o]=t[r];return e},Ot=Object.defineProperty,St=Object.getOwnPropertySymbols,wt=Object.prototype.hasOwnProperty,Pt=Object.prototype.propertyIsEnumerable,jt=function(e,t,r){return t in e?Ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},Et="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?fe:fe.apply(null,arguments)};var _t=function(e){function t(){for(var r=[],n=0;arguments.length>n;n++)r[n]=arguments[n];var o=e.apply(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}return mt(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],r=0;arguments.length>r;r++)t[r]=arguments[r];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,gt([void 0],e[0].concat(this)))):new(t.bind.apply(t,gt([void 0],e.concat(this))))},t}(Array);function xt(){return function(e){return function(e){void 0===e&&(e={});var t=e.thunk,r=void 0===t||t;var n=new _t;r&&(!function(e){return"boolean"==typeof e}(r)?n.push(ht.withExtraArgument(r.extraArgument)):n.push(ht));return n}(e)}}!function(){function e(e,t){var r=o[e];return r?r.enumerable=t:o[e]=r={configurable:!0,enumerable:t,get:function(){return st.get(this[it],e)},set:function(t){st.set(this[it],e,t)}},r}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][it];if(!o.P)switch(o.i){case 5:n(o)&&Be(o);break;case 4:r(o)&&Be(o)}}}function r(e){for(var t=e.t,r=e.k,n=ct(r),o=n.length-1;o>=0;o--){var i=n[o];if(i!==it){var u=t[i];if(void 0===u&&!Pe(t,i))return!0;var c=r[i],a=c&&c[it];if(a?a.t!==u:!Ee(c,u))return!0}}var f=!!t[it];return n.length!==ct(t).length+(f?0:1)}function n(e){var t=e.k;if(t.length!==e.t.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);if(r&&!r.get)return!0;for(var n=0;t.length>n;n++)if(!t.hasOwnProperty(n))return!0;return!1}var o={};!function(e,t){ft[e]||(ft[e]=t)}("ES5",{J:function(t,r){var n=Array.isArray(t),o=function(t,r){if(t){for(var n=Array(r.length),o=0;r.length>o;o++)Object.defineProperty(n,""+o,e(o,!0));return n}var i=at(r);delete i[it];for(var u=ct(i),c=0;u.length>c;c++){var a=u[c];i[a]=e(a,t||!!i[a].enumerable)}return Object.create(Object.getPrototypeOf(r),i)}(n,t),i={i:n?5:4,A:r?r.A:Ie(),P:!1,I:!1,D:{},l:r,t:t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,it,{value:i,writable:!0}),o},S:function(e,r,o){o?ge(r)&&r[it].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var r=t[it];if(r){var o=r.t,i=r.k,u=r.D,c=r.i;if(4===c)Se(i,(function(t){t!==it&&(void 0!==o[t]||Pe(o,t)?u[t]||e(i[t]):(u[t]=!0,Be(r)))})),Se(o,(function(e){void 0!==i[e]||Pe(i,e)||(u[e]=!1,Be(r))}));else if(5===c){if(n(r)&&(Be(r),u.length=!0),o.length>i.length)for(var a=i.length;o.length>a;a++)u[a]=!1;else for(var f=o.length;i.length>f;f++)u[f]=!0;for(var s=Math.min(i.length,o.length),l=0;s>l;l++)i.hasOwnProperty(l)||(u[l]=!0),void 0===u[l]&&e(i[l])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?r(e):n(e)}})}();var kt="persist:",Rt="persist/FLUSH",At="persist/REHYDRATE",Ct="persist/PAUSE",Dt="persist/PERSIST",$t="persist/PURGE",It="persist/REGISTER";function Tt(e){return Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tt(e)}function Nt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ft(e,t,r,n){var o=function(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nt(r,!0).forEach((function(t){Mt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nt(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},r);return e&&"object"===Tt(e)&&Object.keys(e).forEach((function(n){"_persist"!==n&&t[n]===r[n]&&(o[n]=e[n])})),o}function Lt(e){var t,r=e.blacklist||null,n=e.whitelist||null,o=e.transforms||[],i=e.throttle||0,u="".concat(void 0!==e.keyPrefix?e.keyPrefix:kt).concat(e.key),c=e.storage;t=!1===e.serialize?function(e){return e}:"function"==typeof e.serialize?e.serialize:Ut;var a=e.writeFailHandler||null,f={},s={},l=[],p=null,y=null;function d(){if(0===l.length)return p&&clearInterval(p),void(p=null);var e=l.shift(),r=o.reduce((function(t,r){return r.in(t,e,f)}),f[e]);if(void 0!==r)try{s[e]=t(r)}catch(e){console.error("redux-persist/createPersistoid: error serializing state",e)}else delete s[e];0===l.length&&(Object.keys(s).forEach((function(e){void 0===f[e]&&delete s[e]})),y=c.setItem(u,t(s)).catch(v))}function b(e){return(!n||-1!==n.indexOf(e)||"_persist"===e)&&(!r||-1===r.indexOf(e))}function v(e){a&&a(e)}return{update:function(e){Object.keys(e).forEach((function(t){b(t)&&f[t]!==e[t]&&-1===l.indexOf(t)&&l.push(t)})),Object.keys(f).forEach((function(t){void 0===e[t]&&b(t)&&-1===l.indexOf(t)&&void 0!==f[t]&&l.push(t)})),null===p&&(p=setInterval(d,i)),f=e},flush:function(){for(;0!==l.length;)d();return y||Promise.resolve()}}}function Ut(e){return JSON.stringify(e)}function zt(e){var t,r=e.transforms||[],n="".concat(void 0!==e.keyPrefix?e.keyPrefix:kt).concat(e.key);return t=!1===e.deserialize?function(e){return e}:"function"==typeof e.deserialize?e.deserialize:Vt,e.storage.getItem(n).then((function(e){if(e)try{var n={},o=t(e);return Object.keys(o).forEach((function(e){n[e]=r.reduceRight((function(t,r){return r.out(t,e,o)}),t(o[e]))})),n}catch(e){throw e}}))}function Vt(e){return JSON.parse(e)}function Wt(e){0}function qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kt(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qt(r,!0).forEach((function(t){Bt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qt(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Bt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jt(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;i.length>n;n++)0>t.indexOf(r=i[n])&&(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;i.length>n;n++)0>t.indexOf(r=i[n])&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ht(e){return function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);e.length>t;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Xt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gt(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xt(r,!0).forEach((function(t){Yt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xt(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Qt={registry:[],bootstrapped:!1},Zt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case It:return Gt({},e,{registry:[].concat(Ht(e.registry),[t.key])});case At:var r=e.registry.indexOf(t.key),n=Ht(e.registry);return n.splice(r,1),Gt({},e,{registry:n,bootstrapped:0===n.length});default:return e}};var er="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},tr=z.useState,rr=z.useEffect,nr=z.useLayoutEffect,or=z.useDebugValue;function ir(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!er(e,r)}catch(e){return!0}}var ur="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=tr({inst:{value:r,getSnapshot:t}}),o=n[0].inst,i=n[1];return nr((function(){o.value=r,o.getSnapshot=t,ir(o)&&i({inst:o})}),[e,r,t]),rr((function(){return ir(o)&&i({inst:o}),e((function(){ir(o)&&i({inst:o})}))}),[e]),or(r),r},cr={useSyncExternalStore:void 0!==z.useSyncExternalStore?z.useSyncExternalStore:ur},ar=u((function(e){e.exports=cr}));var fr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},sr=ar.useSyncExternalStore,lr=z.useRef,pr=z.useEffect,yr=z.useMemo,dr=z.useDebugValue,br={useSyncExternalStoreWithSelector:function(e,t,r,n,o){var i=lr(null);if(null===i.current){var u={hasValue:!1,value:null};i.current=u}else u=i.current;i=yr((function(){function e(e){if(!a){if(a=!0,i=e,e=n(e),void 0!==o&&u.hasValue){var t=u.value;if(o(t,e))return c=t}return c=e}if(t=c,fr(i,e))return t;var r=n(e);return void 0!==o&&o(t,r)?t:(i=e,c=r)}var i,c,a=!1,f=void 0===r?null:r;return[function(){return e(t())},null===f?void 0:function(){return e(f())}]}),[t,r,n,o]);var c=sr(e,i[0],i[1]);return pr((function(){u.hasValue=!0,u.value=c}),[c]),dr(c),c}},vr=u((function(e){e.exports=br}));let hr=function(e){e()};const mr=()=>hr,gr=z.createContext(null);function Or(){return z.useContext(gr)}let Sr=()=>{throw Error("uSES not initialized!")};const wr=(e,t)=>e===t;function Pr(e=gr){const t=e===gr?Or:()=>z.useContext(e);return function(e,r=wr){const{store:n,subscription:o,getServerState:i}=t(),u=Sr(o.addNestedSub,n.getState,i||n.getState,e,r);return z.useDebugValue(u),u}}const jr=Pr();
|
|
11
11
|
/** @license React v16.13.1
|
|
12
12
|
* react-is.production.min.js
|
|
13
13
|
*
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var
|
|
18
|
+
*/var Er="function"==typeof Symbol&&Symbol.for,_r=Er?Symbol.for("react.element"):60103,xr=Er?Symbol.for("react.portal"):60106,kr=Er?Symbol.for("react.fragment"):60107,Rr=Er?Symbol.for("react.strict_mode"):60108,Ar=Er?Symbol.for("react.profiler"):60114,Cr=Er?Symbol.for("react.provider"):60109,Dr=Er?Symbol.for("react.context"):60110,$r=Er?Symbol.for("react.async_mode"):60111,Ir=Er?Symbol.for("react.concurrent_mode"):60111,Tr=Er?Symbol.for("react.forward_ref"):60112,Nr=Er?Symbol.for("react.suspense"):60113,Mr=Er?Symbol.for("react.suspense_list"):60120,Fr=Er?Symbol.for("react.memo"):60115,Lr=Er?Symbol.for("react.lazy"):60116,Ur=Er?Symbol.for("react.block"):60121,zr=Er?Symbol.for("react.fundamental"):60117,Vr=Er?Symbol.for("react.responder"):60118,Wr=Er?Symbol.for("react.scope"):60119;function qr(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case _r:switch(e=e.type){case $r:case Ir:case kr:case Ar:case Rr:case Nr:return e;default:switch(e=e&&e.$$typeof){case Dr:case Tr:case Lr:case Fr:case Cr:return e;default:return t}}case xr:return t}}}function Kr(e){return qr(e)===Ir}var Br={AsyncMode:$r,ConcurrentMode:Ir,ContextConsumer:Dr,ContextProvider:Cr,Element:_r,ForwardRef:Tr,Fragment:kr,Lazy:Lr,Memo:Fr,Portal:xr,Profiler:Ar,StrictMode:Rr,Suspense:Nr,isAsyncMode:function(e){return Kr(e)||qr(e)===$r},isConcurrentMode:Kr,isContextConsumer:function(e){return qr(e)===Dr},isContextProvider:function(e){return qr(e)===Cr},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===_r},isForwardRef:function(e){return qr(e)===Tr},isFragment:function(e){return qr(e)===kr},isLazy:function(e){return qr(e)===Lr},isMemo:function(e){return qr(e)===Fr},isPortal:function(e){return qr(e)===xr},isProfiler:function(e){return qr(e)===Ar},isStrictMode:function(e){return qr(e)===Rr},isSuspense:function(e){return qr(e)===Nr},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===kr||e===Ir||e===Ar||e===Rr||e===Nr||e===Mr||"object"==typeof e&&null!==e&&(e.$$typeof===Lr||e.$$typeof===Fr||e.$$typeof===Cr||e.$$typeof===Dr||e.$$typeof===Tr||e.$$typeof===zr||e.$$typeof===Vr||e.$$typeof===Wr||e.$$typeof===Ur)},typeOf:qr},Jr=u((function(e){e.exports=Br})),Hr={};Hr[Jr.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Hr[Jr.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};
|
|
19
19
|
/**
|
|
20
20
|
* @license React
|
|
21
21
|
* react-is.production.min.js
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
* This source code is licensed under the MIT license found in the
|
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
|
27
27
|
*/
|
|
28
|
-
var Kr,Wr=Symbol.for("react.element"),Br=Symbol.for("react.portal"),Hr=Symbol.for("react.fragment"),Xr=Symbol.for("react.strict_mode"),Qr=Symbol.for("react.profiler"),Yr=Symbol.for("react.provider"),Zr=Symbol.for("react.context"),tn=Symbol.for("react.server_context"),en=Symbol.for("react.forward_ref"),rn=Symbol.for("react.suspense"),nn=Symbol.for("react.suspense_list"),on=Symbol.for("react.memo"),un=Symbol.for("react.lazy"),sn=Symbol.for("react.offscreen");function an(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case Wr:switch(t=t.type){case Hr:case Qr:case Xr:case rn:case nn:return t;default:switch(t=t&&t.$$typeof){case tn:case Zr:case en:case un:case on:case Yr:return t;default:return e}}case Br:return e}}}Kr=Symbol.for("react.module.reference");var cn={ContextConsumer:Zr,ContextProvider:Yr,Element:Wr,ForwardRef:en,Fragment:Hr,Lazy:un,Memo:on,Portal:Br,Profiler:Qr,StrictMode:Xr,Suspense:rn,SuspenseList:nn,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(t){return an(t)===Zr},isContextProvider:function(t){return an(t)===Yr},isElement:function(t){return"object"==typeof t&&null!==t&&t.$$typeof===Wr},isForwardRef:function(t){return an(t)===en},isFragment:function(t){return an(t)===Hr},isLazy:function(t){return an(t)===un},isMemo:function(t){return an(t)===on},isPortal:function(t){return an(t)===Br},isProfiler:function(t){return an(t)===Qr},isStrictMode:function(t){return an(t)===Xr},isSuspense:function(t){return an(t)===rn},isSuspenseList:function(t){return an(t)===nn},isValidElementType:function(t){return"string"==typeof t||"function"==typeof t||t===Hr||t===Qr||t===Xr||t===rn||t===nn||t===sn||"object"==typeof t&&null!==t&&(t.$$typeof===un||t.$$typeof===on||t.$$typeof===Yr||t.$$typeof===Zr||t.$$typeof===en||t.$$typeof===Kr||void 0!==t.getModuleId)},typeOf:an};n((function(t){t.exports=cn}));const ln={notify(){},get:()=>[]};function fn(t,e){let r,n=ln;function o(){u.onStateChange&&u.onStateChange()}function i(){r||(r=e?e.addNestedSub(o):t.subscribe(o),n=function(){const t=yr();let e=null,r=null;return{clear(){e=null,r=null},notify(){t((()=>{let t=e;for(;t;)t.callback(),t=t.next}))},get(){let t=[],r=e;for(;r;)t.push(r),r=r.next;return t},subscribe(t){let n=!0,o=r={callback:t,next:null,prev:r};return o.prev?o.prev.next=o:e=o,function(){n&&null!==e&&(n=!1,o.next?o.next.prev=o.prev:r=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}const u={addNestedSub:function(t){return i(),n.subscribe(t)},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:o,isSubscribed:function(){return!!r},trySubscribe:i,tryUnsubscribe:function(){r&&(r(),r=void 0,n.clear(),n=ln)},getListeners:()=>n};return u}const pn=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?U.useLayoutEffect:U.useEffect;function dn({store:t,context:e,children:r,serverState:n}){const o=U.useMemo((()=>{const e=fn(t);return{store:t,subscription:e,getServerState:n?()=>n:void 0}}),[t,n]),i=U.useMemo((()=>t.getState()),[t]);pn((()=>{const{subscription:e}=o;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),i!==t.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}}),[o,i]);return U.createElement((e||vr).Provider,{value:o},r)}mr=dr.useSyncExternalStoreWithSelector,hr=e.unstable_batchedUpdates;var hn=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype};const{hasOwnProperty:yn}=Object.prototype,{propertyIsEnumerable:vn}=Object,bn=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0}),mn=r,gn={concatArrays:!1,ignoreUndefined:!1},On=t=>{const e=[];for(const r in t)yn.call(t,r)&&e.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(t);for(const n of r)vn.call(t,n)&&e.push(n)}return e};function wn(t){return Array.isArray(t)?function(t){const e=t.slice(0,0);return On(t).forEach((r=>{bn(e,r,wn(t[r]))})),e}(t):hn(t)?function(t){const e=null===Object.getPrototypeOf(t)?Object.create(null):{};return On(t).forEach((r=>{bn(e,r,wn(t[r]))})),e}(t):t}const Sn=(t,e,r,n)=>(r.forEach((r=>{void 0===e[r]&&n.ignoreUndefined||bn(t,r,r in t&&t[r]!==Object.getPrototypeOf(t)?Pn(t[r],e[r],n):wn(e[r]))})),t);function Pn(t,e,r){return r.concatArrays&&Array.isArray(t)&&Array.isArray(e)?((t,e,r)=>{let n=t.slice(0,0),o=0;return[t,e].forEach((e=>{const i=[];for(let r=0;e.length>r;r++)yn.call(e,r)&&(i.push(r+""),bn(n,o++,e===t?e[r]:wn(e[r])));n=Sn(n,e,On(e).filter((t=>!i.includes(t))),r)})),n})(t,e,r):hn(e)&&hn(t)?Sn(t,e,On(e),r):wn(e)}const jn=function(...t){const e=Pn(wn(gn),this!==mn&&this||{},gn);let r={_:{}};for(const n of t)if(void 0!==n){if(!hn(n))throw new TypeError("`"+n+"` is not an Option Object");r=Pn(r,{_:n},e)}return r._}.bind({concatArrays:!0,ignoreUndefined:!0});function En(t,e){return new Promise(((r,n)=>{try{const n=t();null==e||e(null,n),r(n)}catch(t){null==e||e(t),n(t)}}))}function _n(t,e,r){return Promise.all(t).then((t=>{var n;const o=null!==(n=null==r?void 0:r(t))&&void 0!==n?n:null;return null==e||e(null,o),Promise.resolve(o)}),(t=>(null==e||e(t),Promise.reject(t))))}const Cn={getItem:(t,e)=>En((()=>window.localStorage.getItem(t)),e),setItem:(t,e,r)=>En((()=>window.localStorage.setItem(t,e)),r),removeItem:(t,e)=>En((()=>window.localStorage.removeItem(t)),e),mergeItem:(t,e,r)=>En((()=>function(t,e){const r=window.localStorage.getItem(t);if(r){const n=JSON.parse(r),o=JSON.parse(e),i=JSON.stringify(jn(n,o));window.localStorage.setItem(t,i)}else window.localStorage.setItem(t,e)}(t,e)),r),clear:t=>En((()=>window.localStorage.clear()),t),getAllKeys:t=>En((()=>{const t=window.localStorage.length,e=[];for(let r=0;t>r;r+=1){const t=window.localStorage.key(r)||"";e.push(t)}return e}),t),flushGetRequests:()=>{},multiGet:(t,e)=>_n(t.map((t=>Cn.getItem(t))),e,(e=>e.map(((e,r)=>[t[r],e])))),multiSet:(t,e)=>_n(t.map((t=>Cn.setItem(t[0],t[1]))),e),multiRemove:(t,e)=>_n(t.map((t=>Cn.removeItem(t))),e),multiMerge:(t,e)=>_n(t.map((t=>Cn.mergeItem(t[0],t[1]))),e)},Rn={key:"root",storage:{getItem:async(t,...e)=>"undefined"!=typeof document?localStorage.getItem(t):"undefined"!=typeof navigator&&"ReactNative"===navigator.product?await Cn.getItem(t):void 0,setItem:async(t,e,...r)=>"undefined"!=typeof document?localStorage.setItem(t,e):"undefined"!=typeof navigator&&"ReactNative"===navigator.product?await Cn.setItem(t,e):void 0,removeItem:async(t,...e)=>"undefined"!=typeof document?localStorage.removeItem(t):"undefined"!=typeof navigator&&"ReactNative"===navigator.product?await Cn.removeItem(t):void 0}},kn=it({reducer:function(t,e){var r=void 0!==t.version?t.version:-1,n=void 0===t.stateReconciler?$e:t.stateReconciler,o=t.getStoredState||Ue,i=void 0!==t.timeout?t.timeout:5e3,u=null,s=!1,a=!0,c=function(t){return t._persist.rehydrated&&u&&!a&&u.update(t),t};return function(l,f){var p=l||{},d=p._persist,h=Ge(p,["_persist"]);if(f.type===ke){var y=!1,v=function(e,r){y||(f.rehydrate(t.key,e,r),y=!0)};if(i&&setTimeout((function(){!y&&v(void 0,Error('redux-persist: persist timed out for persist key "'.concat(t.key,'"')))}),i),a=!1,u||(u=Ne(t)),d)return ze({},e(h,f),{_persist:d});if("function"!=typeof f.rehydrate||"function"!=typeof f.register)throw Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return f.register(t.key),o(t).then((function(e){var n=t.migrate||function(t,e){return Promise.resolve(t)};n(e,r).then((function(t){v(t)}),(function(t){v(void 0,t)}))}),(function(t){v(void 0,t)})),ze({},e(h,f),{_persist:{version:r,rehydrated:!1}})}if(f.type===xe)return s=!0,f.result(function(t){var e=t.storage,r="".concat(void 0!==t.keyPrefix?t.keyPrefix:Ee).concat(t.key);return e.removeItem(r,Fe)}(t)),ze({},e(h,f),{_persist:d});if(f.type===_e)return f.result(u&&u.flush()),ze({},e(h,f),{_persist:d});if(f.type===Re)a=!0;else if(f.type===Ce){if(s)return ze({},h,{_persist:ze({},d,{rehydrated:!0})});if(f.key===t.key){var b=e(h,f),m=f.payload,g=ze({},!1!==n&&void 0!==m?n(m,l,b,t):b,{_persist:ze({},d,{rehydrated:!0})});return c(g)}}if(!d)return e(l,f);var O=e(h,f);return O===h?l:c(ze({},O,{_persist:d}))}}(Rn,ht)}),xn=function(t){var e,r=je(),n=t||{},o=n.reducer,i=void 0===o?void 0:o,u=n.middleware,s=void 0===u?r():u,a=n.devTools,c=void 0===a||a,l=n.preloadedState,f=void 0===l?void 0:l,p=n.enhancers,d=void 0===p?void 0:p;if("function"==typeof i)e=i;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var r=e;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return e===r}(i))throw Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=it(i)}var h=s;"function"==typeof h&&(h=h(r));var y=st.apply(void 0,h),v=ut;c&&(v=Se(function(t,e){for(var r in e||(e={}))ge.call(e,r)&&we(t,r,e[r]);if(me)for(var n=0,o=me(e);o.length>n;n++)Oe.call(e,r=o[n])&&we(t,r,e[r]);return t}({trace:!1},"object"==typeof c&&c)));var b=[y];return Array.isArray(d)?b=ve([y],d):"function"==typeof d&&(b=d(b)),ot(e,f,v.apply(void 0,b))}({reducer:kn,middleware:[he]}),An=xn.dispatch,In=wr,Tn=function(t,e,r){var n=r||!1,o=ot(Xe,He,e&&e.enhancer?e.enhancer:void 0),i=function(t){o.dispatch({type:Ae,key:t})},u=function(e,r,i){var u={type:Ce,payload:r,err:i,key:e};t.dispatch(u),o.dispatch(u),n&&s.getState().bootstrapped&&(n(),n=!1)},s=We({},o,{purge:function(){var e=[];return t.dispatch({type:xe,result:function(t){e.push(t)}}),Promise.all(e)},flush:function(){var e=[];return t.dispatch({type:_e,result:function(t){e.push(t)}}),Promise.all(e)},pause:function(){t.dispatch({type:Re})},persist:function(){t.dispatch({type:ke,register:i,rehydrate:u})}});return e&&e.manualPersist||s.persist(),s}(xn),Dn=()=>U.useContext(Ln),$n=U.createContext(null),Nn=t=>{const e=Dn(),r=An,[n,o]=U.useState(t.collections||[]),i={subscribe:async t=>{await(null==e?void 0:e.realtime.subscribe(t,(e=>{switch(e.action){case"create":r(K(t,e.record));break;case"update":r(B(t,e.record));break;case"delete":r(W(t,e.record))}})))},unsubscribe:t=>{t?null==e||e.realtime.unsubscribe(t):null==e||e.realtime.unsubscribe()},fetch:async t=>{const n=await(null==e?void 0:e.records.getFullList(t,200));r(J(t,n))},create:async(t,r)=>{await(null==e?void 0:e.records.create(t,r))},update:async(t,r,n)=>{await(null==e?void 0:e.records.update(t,r,n))},delete:async(t,r)=>{await(null==e?void 0:e.records.delete(t,r))}};return U.useEffect((()=>(n&&n.forEach((t=>{i.fetch(t),i.subscribe(t)})),()=>i.unsubscribe())),[n]),U.createElement($n.Provider,{value:i},t.children)},Ln=U.createContext(null),Un=t=>U.createElement(Ln.Provider,{value:t.client},t.children);var Mn=function(t,e){return Mn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},Mn(t,e)};function Fn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}Mn(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var qn=function(){return qn=Object.assign||function(t){for(var e,r=1,n=arguments.length;n>r;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},qn.apply(this,arguments)};function zn(t,e,r,n){return new(r||(r=Promise))((function(o,i){function u(t){try{a(n.next(t))}catch(t){i(t)}}function s(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,s)}a((n=n.apply(t,e||[])).next())}))}function Vn(t,e){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&o[3]>i[1])){u.label=i[1];break}if(6===i[0]&&o[1]>u.label){u.label=o[1],o=i;break}if(o&&o[2]>u.label){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var Gn,Jn=function(t){function e(r){var n,o=this;return(o=t.call(this,"ClientResponseError")||this).url="",o.status=0,o.data={},o.isAbort=!1,o.originalError=null,Object.setPrototypeOf(o,e.prototype),r instanceof e||(o.originalError=r),null!==r&&"object"==typeof r&&(o.url="string"==typeof r.url?r.url:"",o.status="number"==typeof r.status?r.status:0,o.data=null!==r.data&&"object"==typeof r.data?r.data:{}),"undefined"!=typeof DOMException&&r instanceof DOMException&&(o.isAbort=!0),o.name="ClientResponseError "+o.status,o.message=(null===(n=o.data)||void 0===n?void 0:n.message)||"Something went wrong while processing your request.",o}return Fn(e,t),e.prototype.toJSON=function(){return qn({},this)},e}(Error),Kn=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Wn(t,e,r){var n=Object.assign({},r||{}),o=n.encode||Hn;if(!Kn.test(t))throw new TypeError("argument name is invalid");var i=o(e);if(i&&!Kn.test(i))throw new TypeError("argument val is invalid");var u=t+"="+i;if(null!=n.maxAge){var s=n.maxAge-0;if(isNaN(s)||!isFinite(s))throw new TypeError("option maxAge is invalid");u+="; Max-Age="+Math.floor(s)}if(n.domain){if(!Kn.test(n.domain))throw new TypeError("option domain is invalid");u+="; Domain="+n.domain}if(n.path){if(!Kn.test(n.path))throw new TypeError("option path is invalid");u+="; Path="+n.path}if(n.expires){if(!function(t){return"[object Date]"===Object.prototype.toString.call(t)||t instanceof Date}(n.expires)||isNaN(n.expires.valueOf()))throw new TypeError("option expires is invalid");u+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(u+="; HttpOnly"),n.secure&&(u+="; Secure"),n.priority)switch("string"==typeof n.priority?n.priority.toLowerCase():n.priority){case"low":u+="; Priority=Low";break;case"medium":u+="; Priority=Medium";break;case"high":u+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return u}function Bn(t){return-1!==t.indexOf("%")?decodeURIComponent(t):t}function Hn(t){return encodeURIComponent(t)}function Xn(t){if(t)try{var e=decodeURIComponent(Gn(t.split(".")[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(e)||{}}catch(t){}return{}}Gn="function"==typeof atob?atob:function(t){return Buffer.from(t,"base64").toString("binary")};var Qn=function(){function t(t){void 0===t&&(t={}),this.load(t||{})}return t.prototype.load=function(t){this.id=void 0!==t.id?t.id:"",this.created=void 0!==t.created?t.created:"",this.updated=void 0!==t.updated?t.updated:""},Object.defineProperty(t.prototype,"isNew",{get:function(){return!this.id||"00000000-0000-0000-0000-000000000000"===this.id},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new this.constructor(JSON.parse(JSON.stringify(this)))},t.prototype.export=function(){return Object.assign({},this)},t}(),Yn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e);for(var r=0,n=Object.entries(e);n.length>r;r++){var o=n[r];this[o[0]]=o[1]}this["@collectionId"]=void 0!==e["@collectionId"]?e["@collectionId"]:"",this["@collectionName"]=void 0!==e["@collectionName"]?e["@collectionName"]:"",this["@expand"]=void 0!==e["@expand"]?e["@expand"]:{}},e}(Qn),Zn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),this.email="string"==typeof e.email?e.email:"",this.verified=!!e.verified,this.lastResetSentAt="string"==typeof e.lastResetSentAt?e.lastResetSentAt:"",this.lastVerificationSentAt="string"==typeof e.lastVerificationSentAt?e.lastVerificationSentAt:"",this.profile=e.profile?new Yn(e.profile):null},e}(Qn),to=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),this.avatar="number"==typeof e.avatar?e.avatar:0,this.email="string"==typeof e.email?e.email:"",this.lastResetSentAt="string"==typeof e.lastResetSentAt?e.lastResetSentAt:""},e}(Qn),eo=function(){function t(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}return Object.defineProperty(t.prototype,"token",{get:function(){return this.baseToken},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.baseModel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isValid",{get:function(){return!function(t,e){void 0===e&&(e=0);var r=Xn(t);return!(Object.keys(r).length>0&&(!r.exp||r.exp-e>Date.now()/1e3))}(this.token)},enumerable:!1,configurable:!0}),t.prototype.save=function(t,e){this.baseToken=t||"",this.baseModel=null!==e&&"object"==typeof e?"undefined"!==(null==e?void 0:e.verified)?new Zn(e):new to(e):null,this.triggerChange()},t.prototype.clear=function(){this.baseToken="",this.baseModel=null,this.triggerChange()},t.prototype.loadFromCookie=function(t,e){void 0===e&&(e="pb_auth");var r=function(t,e){var r={};if("string"!=typeof t)return r;for(var n=Object.assign({},{}).decode||Bn,o=0;t.length>o;){var i=t.indexOf("=",o);if(-1===i)break;var u=t.indexOf(";",o);if(-1===u)u=t.length;else if(i>u){o=t.lastIndexOf(";",i-1)+1;continue}var s=t.slice(o,i).trim();if(void 0===r[s]){var a=t.slice(i+1,u).trim();34===a.charCodeAt(0)&&(a=a.slice(1,-1));try{r[s]=n(a)}catch(t){r[s]=a}}o=u+1}return r}(t||"")[e]||"",n={};try{(null===typeof(n=JSON.parse(r))||"object"!=typeof n||Array.isArray(n))&&(n={})}catch(t){}this.save(n.token||"",n.model||{})},t.prototype.exportToCookie=function(t,e){var r,n,o;void 0===e&&(e="pb_auth");var i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},u=Xn(this.token);i.expires=new Date((null==u?void 0:u.exp)?1e3*u.exp:"1970-01-01"),t=Object.assign({},i,t);var s={token:this.token,model:(null===(r=this.model)||void 0===r?void 0:r.export())||null},a=Wn(e,JSON.stringify(s),t),c="undefined"!=typeof Blob?new Blob([a]).size:a.length;return s.model&&c>4096&&(s.model={id:null===(n=null==s?void 0:s.model)||void 0===n?void 0:n.id,email:null===(o=null==s?void 0:s.model)||void 0===o?void 0:o.email},this.model instanceof Zn&&(s.model.verified=this.model.verified),a=Wn(e,JSON.stringify(s),t)),a},t.prototype.onChange=function(t){var e=this;return this._onChangeCallbacks.push(t),function(){for(var r=e._onChangeCallbacks.length-1;r>=0;r--)if(e._onChangeCallbacks[r]==t)return delete e._onChangeCallbacks[r],void e._onChangeCallbacks.splice(r,1)}},t.prototype.triggerChange=function(){for(var t=0,e=this._onChangeCallbacks;e.length>t;t++){var r=e[t];r&&r(this.token,this.model)}},t}(),ro=function(t){function e(e){void 0===e&&(e="pocketbase_auth");var r=t.call(this)||this;return r.storageFallback={},r.storageKey=e,r}return Fn(e,t),Object.defineProperty(e.prototype,"token",{get:function(){return(this._storageGet(this.storageKey)||{}).token||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){var t,e=this._storageGet(this.storageKey)||{};return null===e||"object"!=typeof e||null===e.model||"object"!=typeof e.model?null:void 0!==(null===(t=e.model)||void 0===t?void 0:t.verified)?new Zn(e.model):new to(e.model)},enumerable:!1,configurable:!0}),e.prototype.save=function(e,r){this._storageSet(this.storageKey,{token:e,model:r}),t.prototype.save.call(this,e,r)},e.prototype.clear=function(){this._storageRemove(this.storageKey),t.prototype.clear.call(this)},e.prototype._storageGet=function(t){var e;if("undefined"!=typeof window&&(null===window||void 0===window?void 0:window.localStorage)){var r=(null===(e=null===window||void 0===window?void 0:window.localStorage)||void 0===e?void 0:e.getItem(t))||"";try{return JSON.parse(r)}catch(t){return r}}return this.storageFallback[t]},e.prototype._storageSet=function(t,e){var r;if("undefined"!=typeof window&&(null===window||void 0===window?void 0:window.localStorage)){var n=e;"string"!=typeof e&&(n=JSON.stringify(e)),null===(r=null===window||void 0===window?void 0:window.localStorage)||void 0===r||r.setItem(t,n)}else this.storageFallback[t]=e},e.prototype._storageRemove=function(t){var e;"undefined"!=typeof window&&(null===(e=null===window||void 0===window?void 0:window.localStorage)||void 0===e||e.removeItem(t)),delete this.storageFallback[t]},e}(eo),no=function(t){this.client=t},oo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.getAll=function(t){return void 0===t&&(t={}),this.client.send("/api/settings",{method:"GET",params:t}).then((function(t){return t||{}}))},e.prototype.update=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.client.send("/api/settings",{method:"PATCH",params:e,body:t}).then((function(t){return t||{}}))},e.prototype.testS3=function(t){return void 0===t&&(t={}),this.client.send("/api/settings/test/s3",{method:"POST",params:t}).then((function(){return!0}))},e.prototype.testEmail=function(t,e,r){return void 0===r&&(r={}),this.client.send("/api/settings/test/email",{method:"POST",params:r,body:{email:t,template:e}}).then((function(){return!0}))},e}(no),io=function(t,e,r,n,o){this.page=t>0?t:1,this.perPage=0>e?0:e,this.totalItems=0>r?0:r,this.totalPages=0>n?0:n,this.items=o||[]},uo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype._getFullList=function(t,e,r){var n=this;void 0===e&&(e=100),void 0===r&&(r={});var o=[],i=function(u){return zn(n,void 0,void 0,(function(){return Vn(this,(function(n){return[2,this._getList(t,u,e,r).then((function(t){var e=t.items,r=t.totalItems;return o=o.concat(e),e.length&&r>o.length?i(u+1):o}))]}))}))};return i(1)},e.prototype._getList=function(t,e,r,n){var o=this;return void 0===e&&(e=1),void 0===r&&(r=30),void 0===n&&(n={}),n=Object.assign({page:e,perPage:r},n),this.client.send(t,{method:"GET",params:n}).then((function(t){var e=[];if(null==t?void 0:t.items){t.items=t.items||[];for(var r=0,n=t.items;n.length>r;r++){e.push(o.decode(n[r]))}}return new io((null==t?void 0:t.page)||1,(null==t?void 0:t.perPage)||0,(null==t?void 0:t.totalItems)||0,(null==t?void 0:t.totalPages)||0,e)}))},e.prototype._getOne=function(t,e,r){var n=this;return void 0===r&&(r={}),this.client.send(t+"/"+encodeURIComponent(e),{method:"GET",params:r}).then((function(t){return n.decode(t)}))},e.prototype._create=function(t,e,r){var n=this;return void 0===e&&(e={}),void 0===r&&(r={}),this.client.send(t,{method:"POST",params:r,body:e}).then((function(t){return n.decode(t)}))},e.prototype._update=function(t,e,r,n){var o=this;return void 0===r&&(r={}),void 0===n&&(n={}),this.client.send(t+"/"+encodeURIComponent(e),{method:"PATCH",params:n,body:r}).then((function(t){return o.decode(t)}))},e.prototype._delete=function(t,e,r){return void 0===r&&(r={}),this.client.send(t+"/"+encodeURIComponent(e),{method:"DELETE",params:r}).then((function(){return!0}))},e}(no),so=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.getFullList=function(t,e){return void 0===t&&(t=100),void 0===e&&(e={}),this._getFullList(this.baseCrudPath(),t,e)},e.prototype.getList=function(t,e,r){return void 0===t&&(t=1),void 0===e&&(e=30),void 0===r&&(r={}),this._getList(this.baseCrudPath(),t,e,r)},e.prototype.getOne=function(t,e){return void 0===e&&(e={}),this._getOne(this.baseCrudPath(),t,e)},e.prototype.create=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this._create(this.baseCrudPath(),t,e)},e.prototype.update=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),this._update(this.baseCrudPath(),t,e,r)},e.prototype.delete=function(t,e){return void 0===e&&(e={}),this._delete(this.baseCrudPath(),t,e)},e}(uo),ao=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.decode=function(t){return new to(t)},e.prototype.baseCrudPath=function(){return"/api/admins"},e.prototype.authResponse=function(t){var e=this.decode((null==t?void 0:t.admin)||{});return(null==t?void 0:t.token)&&(null==t?void 0:t.admin)&&this.client.authStore.save(t.token,e),Object.assign({},t,{token:(null==t?void 0:t.token)||"",admin:e})},e.prototype.authViaEmail=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),r=Object.assign({email:t,password:e},r),this.client.send(this.baseCrudPath()+"/auth-via-email",{method:"POST",params:n,body:r,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.refresh=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.client.send(this.baseCrudPath()+"/refresh",{method:"POST",params:e,body:t}).then(this.authResponse.bind(this))},e.prototype.requestPasswordReset=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),e=Object.assign({email:t},e),this.client.send(this.baseCrudPath()+"/request-password-reset",{method:"POST",params:r,body:e}).then((function(){return!0}))},e.prototype.confirmPasswordReset=function(t,e,r,n,o){return void 0===n&&(n={}),void 0===o&&(o={}),n=Object.assign({token:t,password:e,passwordConfirm:r},n),this.client.send(this.baseCrudPath()+"/confirm-password-reset",{method:"POST",params:o,body:n}).then(this.authResponse.bind(this))},e}(so),co=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),this.userId="string"==typeof e.userId?e.userId:"",this.provider="string"==typeof e.provider?e.provider:"",this.providerId="string"==typeof e.providerId?e.providerId:""},e}(Qn),lo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.decode=function(t){return new Zn(t)},e.prototype.baseCrudPath=function(){return"/api/users"},e.prototype.authResponse=function(t){var e=this.decode((null==t?void 0:t.user)||{});return(null==t?void 0:t.token)&&(null==t?void 0:t.user)&&this.client.authStore.save(t.token,e),Object.assign({},t,{token:(null==t?void 0:t.token)||"",user:e})},e.prototype.listAuthMethods=function(t){return void 0===t&&(t={}),this.client.send(this.baseCrudPath()+"/auth-methods",{method:"GET",params:t}).then((function(t){return Object.assign({},t,{emailPassword:!!(null==t?void 0:t.emailPassword),authProviders:Array.isArray(null==t?void 0:t.authProviders)?null==t?void 0:t.authProviders:[]})}))},e.prototype.authViaEmail=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),r=Object.assign({email:t,password:e},r),this.client.send(this.baseCrudPath()+"/auth-via-email",{method:"POST",params:n,body:r,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.authViaOAuth2=function(t,e,r,n,o,i){return void 0===o&&(o={}),void 0===i&&(i={}),o=Object.assign({provider:t,code:e,codeVerifier:r,redirectUrl:n},o),this.client.send(this.baseCrudPath()+"/auth-via-oauth2",{method:"POST",params:i,body:o,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.refresh=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.client.send(this.baseCrudPath()+"/refresh",{method:"POST",params:e,body:t}).then(this.authResponse.bind(this))},e.prototype.requestPasswordReset=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),e=Object.assign({email:t},e),this.client.send(this.baseCrudPath()+"/request-password-reset",{method:"POST",params:r,body:e}).then((function(){return!0}))},e.prototype.confirmPasswordReset=function(t,e,r,n,o){return void 0===n&&(n={}),void 0===o&&(o={}),n=Object.assign({token:t,password:e,passwordConfirm:r},n),this.client.send(this.baseCrudPath()+"/confirm-password-reset",{method:"POST",params:o,body:n}).then(this.authResponse.bind(this))},e.prototype.requestVerification=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),e=Object.assign({email:t},e),this.client.send(this.baseCrudPath()+"/request-verification",{method:"POST",params:r,body:e}).then((function(){return!0}))},e.prototype.confirmVerification=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),e=Object.assign({token:t},e),this.client.send(this.baseCrudPath()+"/confirm-verification",{method:"POST",params:r,body:e}).then(this.authResponse.bind(this))},e.prototype.requestEmailChange=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),e=Object.assign({newEmail:t},e),this.client.send(this.baseCrudPath()+"/request-email-change",{method:"POST",params:r,body:e}).then((function(){return!0}))},e.prototype.confirmEmailChange=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),r=Object.assign({token:t,password:e},r),this.client.send(this.baseCrudPath()+"/confirm-email-change",{method:"POST",params:n,body:r}).then(this.authResponse.bind(this))},e.prototype.listExternalAuths=function(t,e){return void 0===e&&(e={}),this.client.send(this.baseCrudPath()+"/"+encodeURIComponent(t)+"/external-auths",{method:"GET",params:e}).then((function(t){var e=[];if(Array.isArray(t))for(var r=0,n=t;n.length>r;r++){e.push(new co(n[r]))}return e}))},e.prototype.unlinkExternalAuth=function(t,e,r){return void 0===r&&(r={}),this.client.send(this.baseCrudPath()+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(e),{method:"DELETE",params:r}).then((function(){return!0}))},e}(so),fo=function(){function t(t){void 0===t&&(t={}),this.load(t||{})}return t.prototype.load=function(t){this.id=void 0!==t.id?t.id:"",this.name=void 0!==t.name?t.name:"",this.type=void 0!==t.type?t.type:"text",this.system=!!t.system,this.required=!!t.required,this.unique=!!t.unique,this.options="object"==typeof t.options&&null!==t.options?t.options:{}},t}(),po=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),this.name="string"==typeof e.name?e.name:"",this.system=!!e.system,this.listRule="string"==typeof e.listRule?e.listRule:null,this.viewRule="string"==typeof e.viewRule?e.viewRule:null,this.createRule="string"==typeof e.createRule?e.createRule:null,this.updateRule="string"==typeof e.updateRule?e.updateRule:null,this.deleteRule="string"==typeof e.deleteRule?e.deleteRule:null,e.schema=Array.isArray(e.schema)?e.schema:[],this.schema=[];for(var r=0,n=e.schema;n.length>r;r++){this.schema.push(new fo(n[r]))}},e}(Qn),ho=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.decode=function(t){return new po(t)},e.prototype.baseCrudPath=function(){return"/api/collections"},e.prototype.import=function(t,e,r){return void 0===e&&(e=!1),void 0===r&&(r={}),zn(this,void 0,void 0,(function(){return Vn(this,(function(n){return[2,this.client.send(this.baseCrudPath()+"/import",{method:"PUT",params:r,body:{collections:t,deleteMissing:e}}).then((function(){return!0}))]}))}))},e}(so),yo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.decode=function(t){return new Yn(t)},e.prototype.baseCrudPath=function(t){return"/api/collections/"+encodeURIComponent(t)+"/records"},e.prototype.getFileUrl=function(t,e,r){void 0===r&&(r={});var n=[];n.push(this.client.baseUrl.replace(/\/+$/gm,"")),n.push("api"),n.push("files"),n.push(t["@collectionId"]),n.push(t.id),n.push(e);var o=n.join("/");if(Object.keys(r).length){var i=new URLSearchParams(r);o+=(o.includes("?")?"&":"?")+i}return o},e}(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.getFullList=function(t,e,r){return void 0===e&&(e=100),void 0===r&&(r={}),this._getFullList(this.baseCrudPath(t),e,r)},e.prototype.getList=function(t,e,r,n){return void 0===e&&(e=1),void 0===r&&(r=30),void 0===n&&(n={}),this._getList(this.baseCrudPath(t),e,r,n)},e.prototype.getOne=function(t,e,r){return void 0===r&&(r={}),this._getOne(this.baseCrudPath(t),e,r)},e.prototype.create=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),this._create(this.baseCrudPath(t),e,r)},e.prototype.update=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this._update(this.baseCrudPath(t),e,r,n)},e.prototype.delete=function(t,e,r){return void 0===r&&(r={}),this._delete(this.baseCrudPath(t),e,r)},e}(uo)),vo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),e.remoteIp=e.remoteIp||e.ip,this.url="string"==typeof e.url?e.url:"",this.method="string"==typeof e.method?e.method:"GET",this.status="number"==typeof e.status?e.status:200,this.auth="string"==typeof e.auth?e.auth:"guest",this.remoteIp="string"==typeof e.remoteIp?e.remoteIp:"",this.userIp="string"==typeof e.userIp?e.userIp:"",this.referer="string"==typeof e.referer?e.referer:"",this.userAgent="string"==typeof e.userAgent?e.userAgent:"",this.meta="object"==typeof e.meta&&null!==e.meta?e.meta:{}},e}(Qn),bo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.getRequestsList=function(t,e,r){return void 0===t&&(t=1),void 0===e&&(e=30),void 0===r&&(r={}),r=Object.assign({page:t,perPage:e},r),this.client.send("/api/logs/requests",{method:"GET",params:r}).then((function(t){var e=[];if(null==t?void 0:t.items){t.items=(null==t?void 0:t.items)||[];for(var r=0,n=t.items;n.length>r;r++){e.push(new vo(n[r]))}}return new io((null==t?void 0:t.page)||1,(null==t?void 0:t.perPage)||0,(null==t?void 0:t.totalItems)||0,(null==t?void 0:t.totalPages)||0,e)}))},e.prototype.getRequest=function(t,e){return void 0===e&&(e={}),this.client.send("/api/logs/requests/"+encodeURIComponent(t),{method:"GET",params:e}).then((function(t){return new vo(t)}))},e.prototype.getRequestsStats=function(t){return void 0===t&&(t={}),this.client.send("/api/logs/requests/stats",{method:"GET",params:t}).then((function(t){return t}))},e}(no),mo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.clientId="",e.eventSource=null,e.subscriptions={},e}return Fn(e,t),e.prototype.subscribe=function(t,e){var r;return zn(this,void 0,void 0,(function(){return Vn(this,(function(n){switch(n.label){case 0:if(!t)throw Error("subscription must be set.");return this.subscriptions[t]&&(null===(r=this.eventSource)||void 0===r||r.removeEventListener(t,this.subscriptions[t])),this.subscriptions[t]=function(t){var r,n=t;try{r=JSON.parse(null==n?void 0:n.data)}catch(t){}e(r||{})},this.eventSource?[3,1]:(this.connect(),[3,3]);case 1:return this.clientId?[4,this.submitSubscriptions()]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},e.prototype.unsubscribe=function(t){var e;return zn(this,void 0,void 0,(function(){return Vn(this,(function(r){switch(r.label){case 0:if(t){if(!this.subscriptions[t])return[2];null===(e=this.eventSource)||void 0===e||e.removeEventListener(t,this.subscriptions[t]),delete this.subscriptions[t]}else this.removeSubscriptionListeners(),this.subscriptions={};return this.clientId?[4,this.submitSubscriptions()]:[3,2];case 1:r.sent(),r.label=2;case 2:return Object.keys(this.subscriptions).length||this.disconnect(),[2]}}))}))},e.prototype.submitSubscriptions=function(){return zn(this,void 0,void 0,(function(){return Vn(this,(function(t){return this.addSubscriptionListeners(),[2,this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:Object.keys(this.subscriptions)},params:{$autoCancel:!1}}).then((function(){return!0}))]}))}))},e.prototype.addSubscriptionListeners=function(){if(this.eventSource)for(var t in this.removeSubscriptionListeners(),this.subscriptions)this.eventSource.addEventListener(t,this.subscriptions[t])},e.prototype.removeSubscriptionListeners=function(){if(this.eventSource)for(var t in this.subscriptions)this.eventSource.removeEventListener(t,this.subscriptions[t])},e.prototype.connectHandler=function(t){this.clientId=null==t?void 0:t.lastEventId,this.submitSubscriptions()},e.prototype.connect=function(){var t=this;this.disconnect(),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.addEventListener("PB_CONNECT",(function(e){return t.connectHandler(e)}))},e.prototype.disconnect=function(){var t,e,r=this;this.removeSubscriptionListeners(),null===(t=this.eventSource)||void 0===t||t.removeEventListener("PB_CONNECT",(function(t){return r.connectHandler(t)})),null===(e=this.eventSource)||void 0===e||e.close(),this.eventSource=null,this.clientId=""},e}(no),go=function(){function t(t,e,r){void 0===t&&(t="/"),void 0===e&&(e="en-US"),this.cancelControllers={},this.baseUrl=t,this.lang=e,this.authStore=r||new ro,this.admins=new ao(this),this.users=new lo(this),this.records=new yo(this),this.collections=new ho(this),this.logs=new bo(this),this.settings=new oo(this),this.realtime=new mo(this)}return Object.defineProperty(t.prototype,"AuthStore",{get:function(){return this.authStore},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Settings",{get:function(){return this.settings},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Admins",{get:function(){return this.admins},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Users",{get:function(){return this.users},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Collections",{get:function(){return this.collections},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Records",{get:function(){return this.records},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Logs",{get:function(){return this.logs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Realtime",{get:function(){return this.realtime},enumerable:!1,configurable:!0}),t.prototype.cancelRequest=function(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this},t.prototype.cancelAllRequests=function(){for(var t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this},t.prototype.send=function(t,e){var r,n,o,i,u,s,a,c,l;return zn(this,void 0,void 0,(function(){var f,p,d,h,y,v,b=this;return Vn(this,(function(m){return(f=Object.assign({method:"GET"},e)).body&&"FormData"!==f.body.constructor.name&&("string"!=typeof f.body&&(f.body=JSON.stringify(f.body)),void 0===(null===(r=null==f?void 0:f.headers)||void 0===r?void 0:r["Content-Type"])&&(f.headers=Object.assign({},f.headers,{"Content-Type":"application/json"}))),void 0===(null===(n=null==f?void 0:f.headers)||void 0===n?void 0:n["Accept-Language"])&&(f.headers=Object.assign({},f.headers,{"Accept-Language":this.lang})),(null===(o=this.authStore)||void 0===o?void 0:o.token)&&void 0===(null===(i=null==f?void 0:f.headers)||void 0===i?void 0:i.Authorization)&&(p="Admin",void 0!==(null===(u=this.authStore.model)||void 0===u?void 0:u.verified)&&(p="User"),f.headers=Object.assign({},f.headers,{Authorization:p+" "+this.authStore.token})),!1!==(null===(s=f.params)||void 0===s?void 0:s.$autoCancel)&&(d=(null===(a=f.params)||void 0===a?void 0:a.$cancelKey)||(f.method||"GET")+t,this.cancelRequest(d),h=new AbortController,this.cancelControllers[d]=h,f.signal=h.signal),null===(c=f.params)||void 0===c||delete c.$autoCancel,null===(l=f.params)||void 0===l||delete l.$cancelKey,y=this.buildUrl(t),void 0!==f.params&&((v=this.serializeQueryParams(f.params))&&(y+=(y.includes("?")?"&":"?")+v),delete f.params),this.beforeSend&&(f=Object.assign({},this.beforeSend(y,f))),[2,fetch(y,f).then((function(t){return zn(b,void 0,void 0,(function(){var e;return Vn(this,(function(r){switch(r.label){case 0:e={},r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t.json()];case 2:return e=r.sent(),[3,4];case 3:return r.sent(),[3,4];case 4:if(this.afterSend&&(e=this.afterSend(t,e)),t.status>=400)throw new Jn({url:t.url,status:t.status,data:e});return[2,e]}}))}))})).catch((function(t){throw new Jn(t)}))]}))}))},t.prototype.buildUrl=function(t){var e=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return t&&(e+=t.startsWith("/")?t.substring(1):t),e},t.prototype.serializeQueryParams=function(t){var e=[];for(var r in t)if(null!==t[r]){var n=t[r],o=encodeURIComponent(r);if(Array.isArray(n))for(var i=0,u=n;u.length>i;i++){e.push(o+"="+encodeURIComponent(u[i]))}else e.push(n instanceof Date?o+"="+encodeURIComponent(n.toISOString()):null!==typeof n&&"object"==typeof n?o+"="+encodeURIComponent(JSON.stringify(n)):o+"="+encodeURIComponent(n))}return e.join("&")},t}();function Oo(t){return Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oo(t)}function wo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function So(t,e){for(var r=0;e.length>r;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Po(t,e){return!e||"object"!==Oo(e)&&"function"!=typeof e?Eo(t):e}function jo(t){return jo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},jo(t)}function Eo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _o(t,e){return _o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},_o(t,e)}function Co(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ro=function(t){function e(){var t,r;wo(this,e);for(var n=arguments.length,o=Array(n),i=0;n>i;i++)o[i]=arguments[i];return Co(Eo(r=Po(this,(t=jo(e)).call.apply(t,[this].concat(o)))),"state",{bootstrapped:!1}),Co(Eo(r),"_unsubscribe",void 0),Co(Eo(r),"handlePersistorState",(function(){r.props.persistor.getState().bootstrapped&&(r.props.onBeforeLift?Promise.resolve(r.props.onBeforeLift()).finally((function(){return r.setState({bootstrapped:!0})})):r.setState({bootstrapped:!0}),r._unsubscribe&&r._unsubscribe())})),r}var r,n,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_o(t,e)}(e,t),r=e,(n=[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return"function"==typeof this.props.children?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}])&&So(r.prototype,n),o&&So(r,o),e}(U.PureComponent);Co(Ro,"defaultProps",{children:null,loading:null});const ko=U.createContext(null);t.ADD_RECORD=F,t.ADD_RECORDS=q,t.ClientContext=Ln,t.ClientProvider=Un,t.ContentContext=$n,t.ContentProvider=Nn,t.DELETE_RECORD=V,t.DELETE_RECORDS=G,t.Pocketbase=t=>{const[e,r]=U.useState(null);return U.useEffect((()=>{const e=new go(t.serverURL);e.admins.authViaEmail(t.credentials.username,t.credentials.password).then((()=>{r(e)}))}),[t.serverURL]),e?U.createElement(Un,{client:e},U.createElement(dn,{store:xn},U.createElement(Ro,{persistor:Tn},U.createElement(Nn,{collections:t.initialCollections},t.children)))):null},t.PocketbaseContext=ko,t.SET_RECORDS=M,t.UPDATE_RECORD=z,t.appReducer=ht,t.persistConfig=Rn,t.persistor=Tn,t.recordsAction=H,t.store=xn,t.useAppContent=function(t,e=!1){var r;const n=null!=(r=In((e=>e.reducer.records[t])))?r:[],o=U.useContext($n);return U.useEffect((()=>{e&&(null==o||o.fetch(t))}),[t,e]),{records:n,actions:{subscribe:async()=>await(null==o?void 0:o.subscribe(t)),unsubscribe:()=>null==o?void 0:o.unsubscribe(t),refetch:async()=>await(null==o?void 0:o.fetch(t)),create:async e=>await(null==o?void 0:o.create(t,e)),update:async(e,r)=>await(null==o?void 0:o.update(t,e,r)),delete:async e=>await(null==o?void 0:o.delete(t,e))}}},t.useAppDispatch=An,t.useAppSelector=In,t.useClientContext=Dn,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
28
|
+
var Xr,Gr=Symbol.for("react.element"),Yr=Symbol.for("react.portal"),Qr=Symbol.for("react.fragment"),Zr=Symbol.for("react.strict_mode"),en=Symbol.for("react.profiler"),tn=Symbol.for("react.provider"),rn=Symbol.for("react.context"),nn=Symbol.for("react.server_context"),on=Symbol.for("react.forward_ref"),un=Symbol.for("react.suspense"),cn=Symbol.for("react.suspense_list"),an=Symbol.for("react.memo"),fn=Symbol.for("react.lazy"),sn=Symbol.for("react.offscreen");function ln(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Gr:switch(e=e.type){case Qr:case en:case Zr:case un:case cn:return e;default:switch(e=e&&e.$$typeof){case nn:case rn:case on:case fn:case an:case tn:return e;default:return t}}case Yr:return t}}}Xr=Symbol.for("react.module.reference");var pn={ContextConsumer:rn,ContextProvider:tn,Element:Gr,ForwardRef:on,Fragment:Qr,Lazy:fn,Memo:an,Portal:Yr,Profiler:en,StrictMode:Zr,Suspense:un,SuspenseList:cn,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return ln(e)===rn},isContextProvider:function(e){return ln(e)===tn},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Gr},isForwardRef:function(e){return ln(e)===on},isFragment:function(e){return ln(e)===Qr},isLazy:function(e){return ln(e)===fn},isMemo:function(e){return ln(e)===an},isPortal:function(e){return ln(e)===Yr},isProfiler:function(e){return ln(e)===en},isStrictMode:function(e){return ln(e)===Zr},isSuspense:function(e){return ln(e)===un},isSuspenseList:function(e){return ln(e)===cn},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Qr||e===en||e===Zr||e===un||e===cn||e===sn||"object"==typeof e&&null!==e&&(e.$$typeof===fn||e.$$typeof===an||e.$$typeof===tn||e.$$typeof===rn||e.$$typeof===on||e.$$typeof===Xr||void 0!==e.getModuleId)},typeOf:ln};u((function(e){e.exports=pn}));const yn={notify(){},get:()=>[]};function dn(e,t){let r,n=yn;function o(){u.onStateChange&&u.onStateChange()}function i(){r||(r=t?t.addNestedSub(o):e.subscribe(o),n=function(){const e=mr();let t=null,r=null;return{clear(){t=null,r=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],r=t;for(;r;)e.push(r),r=r.next;return e},subscribe(e){let n=!0,o=r={callback:e,next:null,prev:r};return o.prev?o.prev.next=o:t=o,function(){n&&null!==t&&(n=!1,o.next?o.next.prev=o.prev:r=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}const u={addNestedSub:function(e){return i(),n.subscribe(e)},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:o,isSubscribed:function(){return!!r},trySubscribe:i,tryUnsubscribe:function(){r&&(r(),r=void 0,n.clear(),n=yn)},getListeners:()=>n};return u}const bn=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?z.useLayoutEffect:z.useEffect;function vn({store:e,context:t,children:r,serverState:n}){const o=z.useMemo((()=>{const t=dn(e);return{store:e,subscription:t,getServerState:n?()=>n:void 0}}),[e,n]),i=z.useMemo((()=>e.getState()),[e]);bn((()=>{const{subscription:t}=o;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),i!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[o,i]);return z.createElement((t||gr).Provider,{value:o},r)}Sr=vr.useSyncExternalStoreWithSelector,hr=t.unstable_batchedUpdates;var hn=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype};const{hasOwnProperty:mn}=Object.prototype,{propertyIsEnumerable:gn}=Object,On=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),Sn=i,wn={concatArrays:!1,ignoreUndefined:!1},Pn=e=>{const t=[];for(const r in e)mn.call(e,r)&&t.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(e);for(const n of r)gn.call(e,n)&&t.push(n)}return t};function jn(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return Pn(e).forEach((r=>{On(t,r,jn(e[r]))})),t}(e):hn(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return Pn(e).forEach((r=>{On(t,r,jn(e[r]))})),t}(e):e}const En=(e,t,r,n)=>(r.forEach((r=>{void 0===t[r]&&n.ignoreUndefined||On(e,r,r in e&&e[r]!==Object.getPrototypeOf(e)?_n(e[r],t[r],n):jn(t[r]))})),e);function _n(e,t,r){return r.concatArrays&&Array.isArray(e)&&Array.isArray(t)?((e,t,r)=>{let n=e.slice(0,0),o=0;return[e,t].forEach((t=>{const i=[];for(let r=0;t.length>r;r++)mn.call(t,r)&&(i.push(r+""),On(n,o++,t===e?t[r]:jn(t[r])));n=En(n,t,Pn(t).filter((e=>!i.includes(e))),r)})),n})(e,t,r):hn(t)&&hn(e)?En(e,t,Pn(t),r):jn(t)}const xn=function(...e){const t=_n(jn(wn),this!==Sn&&this||{},wn);let r={_:{}};for(const n of e)if(void 0!==n){if(!hn(n))throw new TypeError("`"+n+"` is not an Option Object");r=_n(r,{_:n},t)}return r._}.bind({concatArrays:!0,ignoreUndefined:!0});function kn(e,t){return new Promise(((r,n)=>{try{const n=e();null==t||t(null,n),r(n)}catch(e){null==t||t(e),n(e)}}))}function Rn(e,t,r){return Promise.all(e).then((e=>{var n;const o=null!==(n=null==r?void 0:r(e))&&void 0!==n?n:null;return null==t||t(null,o),Promise.resolve(o)}),(e=>(null==t||t(e),Promise.reject(e))))}const An={getItem:(e,t)=>kn((()=>window.localStorage.getItem(e)),t),setItem:(e,t,r)=>kn((()=>window.localStorage.setItem(e,t)),r),removeItem:(e,t)=>kn((()=>window.localStorage.removeItem(e)),t),mergeItem:(e,t,r)=>kn((()=>function(e,t){const r=window.localStorage.getItem(e);if(r){const n=JSON.parse(r),o=JSON.parse(t),i=JSON.stringify(xn(n,o));window.localStorage.setItem(e,i)}else window.localStorage.setItem(e,t)}(e,t)),r),clear:e=>kn((()=>window.localStorage.clear()),e),getAllKeys:e=>kn((()=>{const e=window.localStorage.length,t=[];for(let r=0;e>r;r+=1){const e=window.localStorage.key(r)||"";t.push(e)}return t}),e),flushGetRequests:()=>{},multiGet:(e,t)=>Rn(e.map((e=>An.getItem(e))),t,(t=>t.map(((t,r)=>[e[r],t])))),multiSet:(e,t)=>Rn(e.map((e=>An.setItem(e[0],e[1]))),t),multiRemove:(e,t)=>Rn(e.map((e=>An.removeItem(e))),t),multiMerge:(e,t)=>Rn(e.map((e=>An.mergeItem(e[0],e[1]))),t)},Cn={key:"root",storage:{getItem:async(e,...t)=>"undefined"!=typeof document?localStorage.getItem(e):"undefined"!=typeof navigator&&"ReactNative"===navigator.product?await An.getItem(e):void 0,setItem:async(e,t,...r)=>"undefined"!=typeof document?localStorage.setItem(e,t):"undefined"!=typeof navigator&&"ReactNative"===navigator.product?await An.setItem(e,t):void 0,removeItem:async(e,...t)=>"undefined"!=typeof document?localStorage.removeItem(e):"undefined"!=typeof navigator&&"ReactNative"===navigator.product?await An.removeItem(e):void 0}},Dn=ae({reducer:function(e,t){var r=void 0!==e.version?e.version:-1,n=void 0===e.stateReconciler?Ft:e.stateReconciler,o=e.getStoredState||zt,i=void 0!==e.timeout?e.timeout:5e3,u=null,c=!1,a=!0,f=function(e){return e._persist.rehydrated&&u&&!a&&u.update(e),e};return function(s,l){var p=s||{},y=p._persist,d=Jt(p,["_persist"]);if(l.type===Dt){var b=!1,v=function(t,r){b||(l.rehydrate(e.key,t,r),b=!0)};if(i&&setTimeout((function(){!b&&v(void 0,Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))}),i),a=!1,u||(u=Lt(e)),y)return Kt({},t(d,l),{_persist:y});if("function"!=typeof l.rehydrate||"function"!=typeof l.register)throw Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return l.register(e.key),o(e).then((function(t){var n=e.migrate||function(e,t){return Promise.resolve(e)};n(t,r).then((function(e){v(e)}),(function(e){v(void 0,e)}))}),(function(e){v(void 0,e)})),Kt({},t(d,l),{_persist:{version:r,rehydrated:!1}})}if(l.type===$t)return c=!0,l.result(function(e){var t=e.storage,r="".concat(void 0!==e.keyPrefix?e.keyPrefix:kt).concat(e.key);return t.removeItem(r,Wt)}(e)),Kt({},t(d,l),{_persist:y});if(l.type===Rt)return l.result(u&&u.flush()),Kt({},t(d,l),{_persist:y});if(l.type===Ct)a=!0;else if(l.type===At){if(c)return Kt({},d,{_persist:Kt({},y,{rehydrated:!0})});if(l.key===e.key){var h=t(d,l),m=l.payload,g=Kt({},!1!==n&&void 0!==m?n(m,s,h,e):h,{_persist:Kt({},y,{rehydrated:!0})});return f(g)}}if(!y)return t(s,l);var O=t(d,l);return O===d?s:f(Kt({},O,{_persist:y}))}}(Cn,he)}),$n=function(e){var t,r=xt(),n=e||{},o=n.reducer,i=void 0===o?void 0:o,u=n.middleware,c=void 0===u?r():u,a=n.devTools,f=void 0===a||a,s=n.preloadedState,l=void 0===s?void 0:s,p=n.enhancers,y=void 0===p?void 0:p;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var r=t;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return t===r}(i))throw Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=ae(i)}var d=c;"function"==typeof d&&(d=d(r));var b=se.apply(void 0,d),v=fe;f&&(v=Et(function(e,t){for(var r in t||(t={}))wt.call(t,r)&&jt(e,r,t[r]);if(St)for(var n=0,o=St(t);o.length>n;n++)Pt.call(t,r=o[n])&&jt(e,r,t[r]);return e}({trace:!1},"object"==typeof f&&f)));var h=[b];return Array.isArray(y)?h=gt([b],y):"function"==typeof y&&(h=y(h)),ce(t,l,v.apply(void 0,h))}({reducer:Dn,middleware:[ht]}),In=$n.dispatch,Tn=jr,Nn=function(e,t,r){var n=r||!1,o=ce(Zt,Qt,t&&t.enhancer?t.enhancer:void 0),i=function(e){o.dispatch({type:It,key:e})},u=function(t,r,i){var u={type:At,payload:r,err:i,key:t};e.dispatch(u),o.dispatch(u),n&&c.getState().bootstrapped&&(n(),n=!1)},c=Gt({},o,{purge:function(){var t=[];return e.dispatch({type:$t,result:function(e){t.push(e)}}),Promise.all(t)},flush:function(){var t=[];return e.dispatch({type:Rt,result:function(e){t.push(e)}}),Promise.all(t)},pause:function(){e.dispatch({type:Ct})},persist:function(){e.dispatch({type:Dt,register:i,rehydrate:u})}});return t&&t.manualPersist||c.persist(),c}($n),Mn=()=>z.useContext(Un),Fn=z.createContext(null),Ln=e=>{const t=Mn(),r=In,[n,o]=z.useState(e.collections||[]),i={subscribe:async e=>{await(null==t?void 0:t.realtime.subscribe(e,(t=>{switch(t.action){case"create":r(X(e,t.record));break;case"update":r(Y(e,t.record));break;case"delete":r(G(e,t.record))}})))},unsubscribe:e=>{e?null==t||t.realtime.unsubscribe(e):null==t||t.realtime.unsubscribe()},fetch:async e=>{const n=await(null==t?void 0:t.records.getFullList(e,200));r(H(e,n))},create:async(e,r)=>{await(null==t?void 0:t.records.create(e,r))},update:async(e,r,n)=>{await(null==t?void 0:t.records.update(e,r,n))},delete:async(e,r)=>{await(null==t?void 0:t.records.delete(e,r))}};return z.useEffect((()=>(n&&n.forEach((e=>{i.fetch(e),i.subscribe(e)})),()=>i.unsubscribe())),[n]),z.createElement(Fn.Provider,{value:i},e.children)},Un=z.createContext(null),zn=e=>z.createElement(Un.Provider,{value:e.client},e.children);function Vn(e){return Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vn(e)}function Wn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qn(e,t){for(var r=0;t.length>r;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Kn(e,t){return!t||"object"!==Vn(t)&&"function"!=typeof t?Jn(e):t}function Bn(e){return Bn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Bn(e)}function Jn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hn(e,t){return Hn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Hn(e,t)}function Xn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Gn=function(e){function t(){var e,r;Wn(this,t);for(var n=arguments.length,o=Array(n),i=0;n>i;i++)o[i]=arguments[i];return Xn(Jn(r=Kn(this,(e=Bn(t)).call.apply(e,[this].concat(o)))),"state",{bootstrapped:!1}),Xn(Jn(r),"_unsubscribe",void 0),Xn(Jn(r),"handlePersistorState",(function(){r.props.persistor.getState().bootstrapped&&(r.props.onBeforeLift?Promise.resolve(r.props.onBeforeLift()).finally((function(){return r.setState({bootstrapped:!0})})):r.setState({bootstrapped:!0}),r._unsubscribe&&r._unsubscribe())})),r}var r,n,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Hn(e,t)}(t,e),r=t,(n=[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return"function"==typeof this.props.children?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}])&&qn(r.prototype,n),o&&qn(r,o),t}(z.PureComponent);Xn(Gn,"defaultProps",{children:null,loading:null});const Yn=z.createContext(null);e.ADD_RECORD=W,e.ADD_RECORDS=q,e.ClientContext=Un,e.ClientProvider=zn,e.ContentContext=Fn,e.ContentProvider=Ln,e.DELETE_RECORD=B,e.DELETE_RECORDS=J,e.Pocketbase=e=>{const[t,r]=z.useState(null);return z.useEffect((()=>{const t=new o.default(e.serverURL);t.admins.authViaEmail(e.credentials.username,e.credentials.password).then((()=>{r(t)}))}),[e.serverURL]),t?z.createElement(zn,{client:t},z.createElement(vn,{store:$n},z.createElement(Gn,{persistor:Nn},z.createElement(Ln,{collections:e.initialCollections},e.children)))):null},e.PocketbaseContext=Yn,e.SET_RECORDS=V,e.UPDATE_RECORD=K,e.appReducer=he,e.persistConfig=Cn,e.persistor=Nn,e.recordsAction=Q,e.store=$n,e.useAppContent=function(e,t=!1){var r;const n=null!=(r=Tn((t=>t.reducer.records[e])))?r:[],o=z.useContext(Fn);return z.useEffect((()=>{t&&(null==o||o.fetch(e))}),[e,t]),{records:n,actions:{subscribe:async()=>await(null==o?void 0:o.subscribe(e)),unsubscribe:()=>null==o?void 0:o.unsubscribe(e),refetch:async()=>await(null==o?void 0:o.fetch(e)),create:async t=>await(null==o?void 0:o.create(e,t)),update:async(t,r)=>await(null==o?void 0:o.update(e,t,r)),delete:async t=>await(null==o?void 0:o.delete(e,t))}}},e.useAppDispatch=In,e.useAppSelector=Tn,e.useClientContext=Mn,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import PocketBase from '
|
|
2
|
+
import PocketBase from 'pocketbase';
|
|
3
3
|
export declare const PocketbaseContext: React.Context<PocketBase | null>;
|
|
4
4
|
export declare type PocketbaseProviderProps = {
|
|
5
5
|
children: React.ReactNode;
|
package/es/context/Pocketbase.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { createContext, useEffect } from 'react';
|
|
3
|
-
import PocketBase from '
|
|
3
|
+
import PocketBase from 'pocketbase';
|
|
4
4
|
import { Provider } from 'react-redux';
|
|
5
5
|
import { PersistGate } from 'redux-persist/integration/react';
|
|
6
6
|
import * as store from '../store/store';
|
package/es/context/client.d.ts
CHANGED
package/es/context/content.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
export declare type SubscribeType = (collectionName: string) => Promise<void>;
|
|
3
|
+
export declare type UnsubscribeType = (collectionName?: string) => void;
|
|
4
|
+
export declare type FetchType = (collectionName: string) => Promise<void>;
|
|
5
|
+
export declare type CreateType = (collectionName: string, record: {}) => Promise<void>;
|
|
6
|
+
export declare type UpdateType = (collectionName: string, recordId: string, record: {}) => Promise<void>;
|
|
7
|
+
export declare type DeleteType = (collectionName: string, recordId: string) => Promise<void>;
|
|
2
8
|
interface ContentActions {
|
|
3
|
-
subscribe:
|
|
4
|
-
unsubscribe:
|
|
5
|
-
fetch:
|
|
6
|
-
create:
|
|
7
|
-
update:
|
|
8
|
-
delete:
|
|
9
|
+
subscribe: SubscribeType;
|
|
10
|
+
unsubscribe: UnsubscribeType;
|
|
11
|
+
fetch: FetchType;
|
|
12
|
+
create: CreateType;
|
|
13
|
+
update: UpdateType;
|
|
14
|
+
delete: DeleteType;
|
|
9
15
|
}
|
|
10
16
|
export declare const ContentContext: React.Context<ContentActions | null>;
|
|
11
17
|
export declare type ContentProviderProps = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useClientContext: () => import("
|
|
1
|
+
declare const useClientContext: () => import("pocketbase").default | null;
|
|
2
2
|
export { useClientContext };
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.PocketbaseContext = exports.Pocketbase = void 0;
|
|
6
6
|
var React = _interopRequireWildcard(require("react"));
|
|
7
|
-
var _pocketbase = _interopRequireDefault(require("
|
|
7
|
+
var _pocketbase = _interopRequireDefault(require("pocketbase"));
|
|
8
8
|
var _reactRedux = require("react-redux");
|
|
9
9
|
var _react2 = require("redux-persist/integration/react");
|
|
10
10
|
var store = _interopRequireWildcard(require("../store/store"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pocketbase-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Unofficial React SDK (React, React Native, Expo) for interacting with the PocketBase JS SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pocketbase",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"prepublishOnly": "npm run build"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"pocketbase": "^0.7.
|
|
48
|
+
"pocketbase": "^0.7.3"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@babel/cli": "^7.12.1",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@react-native-async-storage/async-storage": "^1.17.10",
|
|
70
70
|
"@reduxjs/toolkit": "^1.8.5",
|
|
71
|
-
"
|
|
71
|
+
"pocketbase": "^0.7.3",
|
|
72
72
|
"react-redux": "^8.0.4",
|
|
73
73
|
"redux": "^4.2.0",
|
|
74
74
|
"redux-persist": "^6.0.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { createContext, useEffect } from 'react';
|
|
3
|
-
import PocketBase from '
|
|
3
|
+
import PocketBase from 'pocketbase';
|
|
4
4
|
import { Provider } from 'react-redux';
|
|
5
5
|
import { PersistGate } from 'redux-persist/integration/react';
|
|
6
6
|
import * as store from '../store/store';
|
package/src/context/client.tsx
CHANGED
package/src/context/content.tsx
CHANGED
|
@@ -5,13 +5,20 @@ import { useClientContext } from '../hooks/useClientContext';
|
|
|
5
5
|
import { Record } from '../interfaces/Record';
|
|
6
6
|
import { recordsAction } from '../store/actions';
|
|
7
7
|
|
|
8
|
+
export type SubscribeType = (collectionName: string) => Promise<void>;
|
|
9
|
+
export type UnsubscribeType = (collectionName?: string) => void;
|
|
10
|
+
export type FetchType = (collectionName: string) => Promise<void>;
|
|
11
|
+
export type CreateType = (collectionName: string, record: {}) => Promise<void>;
|
|
12
|
+
export type UpdateType = (collectionName: string, recordId: string, record: {}) => Promise<void>;
|
|
13
|
+
export type DeleteType = (collectionName: string, recordId: string) => Promise<void>;
|
|
14
|
+
|
|
8
15
|
interface ContentActions {
|
|
9
|
-
subscribe:
|
|
10
|
-
unsubscribe:
|
|
11
|
-
fetch:
|
|
12
|
-
create:
|
|
13
|
-
update:
|
|
14
|
-
delete:
|
|
16
|
+
subscribe: SubscribeType;
|
|
17
|
+
unsubscribe: UnsubscribeType;
|
|
18
|
+
fetch: FetchType;
|
|
19
|
+
create: CreateType;
|
|
20
|
+
update: UpdateType;
|
|
21
|
+
delete: DeleteType;
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
export const ContentContext = createContext<ContentActions | null>(null);
|