@noxickon/onyx 0.0.3 → 0.0.4-dev.3
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/chunks/Button-D-v4l8ZE.js +20 -0
- package/dist/chunks/{Button-BV4_pmoH.js → Button-bARrxYyo.js} +120 -121
- package/dist/chunks/Input-CLi1H63d.js +1 -0
- package/dist/chunks/{Input-BraK4lDE.js → Input-dfvmdIHi.js} +38 -38
- package/dist/chunks/errorHelper--G-SWQzN.js +18 -0
- package/dist/chunks/errorHelper-DaP_XxEx.js +1 -0
- package/dist/chunks/formatTimestamp-CMxOnPo1.js +12 -0
- package/dist/chunks/formatTimestamp-TTsNcy7u.js +1 -0
- package/dist/chunks/{index-DnVdNmco.js → useAuth-DDRXztKj.js} +240 -178
- package/dist/chunks/{index-DGjVEo0G.js → useAuth-DPnpY3XC.js} +18 -9
- package/dist/chunks/{useForm-BAbY8X4X.js → useForm-D4co95Vn.js} +785 -801
- package/dist/chunks/useForm-DUviJ7xS.js +18 -0
- package/dist/chunks/useQuery-BvCyJMae.js +2065 -0
- package/dist/chunks/useQuery-DTNHO7so.js +3 -0
- package/dist/context/context.cjs.js +1 -1
- package/dist/context/context.es.js +1 -1
- package/dist/context.d.ts +1 -0
- package/dist/hooks/hooks.cjs.js +6 -6
- package/dist/hooks/hooks.es.js +117 -118
- package/dist/index.css +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/layout/layout.cjs.js +1 -1
- package/dist/layout/layout.es.js +1 -1
- package/dist/onyx.cjs.js +1 -1
- package/dist/onyx.es.js +425 -386
- package/dist/pages/pages.cjs.js +9 -3
- package/dist/pages/pages.es.js +35 -25
- package/dist/utils/utils.cjs.js +1 -0
- package/dist/utils/utils.es.js +8 -0
- package/dist/utils.d.ts +29 -0
- package/package.json +31 -26
- package/dist/chunks/Button-CU-zvMVL.js +0 -20
- package/dist/chunks/Input-C5dK8VSu.js +0 -1
- package/dist/chunks/index-Dgwp7JKP.js +0 -601
- package/dist/chunks/index-rUH_mzKt.js +0 -2
- package/dist/chunks/useAuth-BwjRd05B.js +0 -10
- package/dist/chunks/useAuth-CR3bAGqp.js +0 -61
- package/dist/chunks/useForm-cxgyAiOs.js +0 -26
- package/dist/chunks/useQuery--6GP2-dN.js +0 -2
- package/dist/chunks/useQuery-mFRa2XuW.js +0 -1481
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-CITbqOLs.js"),f=require("react"),x=require("./Button-CU-zvMVL.js"),S=require("./isObject-BDHKUJKN.js"),I=({children:l,className:r,disabled:s=!1,htmlFor:t,required:n=!1})=>e.jsxRuntimeExports.jsxs("label",{id:`${t}-label`,className:x.twMerge("block text-sm font-medium text-neutral-300",s&&"cursor-not-allowed text-neutral-500",r),htmlFor:t,children:[l,n&&e.jsxRuntimeExports.jsx("span",{className:"ml-1 text-rose-400",children:"*"})]}),y=({children:l,className:r,disabled:s=!1,id:t})=>e.jsxRuntimeExports.jsx("p",{id:t,className:x.twMerge("text-xs text-neutral-400",s&&"text-neutral-500",r),children:l}),j=({children:l,className:r,icon:s="mdiAlertCircleOutline",id:t})=>l?e.jsxRuntimeExports.jsxs("div",{id:t,className:x.twMerge("flex max-w-full items-center gap-1 text-xs text-rose-400",r),role:"alert",children:[s?e.jsxRuntimeExports.jsx(x.OxIcon,{className:"flex-shrink-0",icon:s,size:.8}):null,e.jsxRuntimeExports.jsx("p",{className:"min-w-0 break-words",children:l})]}):null,C=({children:l,className:r,fullWidth:s=!1,noValidate:t=!0,...n})=>e.jsxRuntimeExports.jsx("form",{className:x.twMerge(s&&"w-full",r),noValidate:t,...n,children:l}),G=({className:l,description:r,disabled:s=!1,error:t=!1,errorMessage:n,icon:a="",iconPosition:c="left",id:L,label:h,name:v,onChange:m,placeholder:$="Input placeholder...",readOnly:M=!1,required:E=!1,showMaxLength:k=!1,type:q="text",value:i,...g})=>{const z=f.useId(),[A,R]=f.useState(typeof i=="string"?i.length:0),d=L||z,w=`${d}-input`,O=`${d}-description`,p=`${d}-error`,b=g.maxLength,N=t&&typeof n=="string",B=t&&S.isObject(n);f.useEffect(()=>{typeof i=="string"&&R(i.length)},[i]);const D=u=>{const o=u.target.value.length;R(o),m==null||m(u)},F=e.jsxRuntimeExports.jsxs("div",{className:"relative flex w-full items-center",children:[a!==""&&c==="left"?e.jsxRuntimeExports.jsx("div",{className:"absolute left-3 flex items-center",children:e.jsxRuntimeExports.jsx(x.OxIcon,{icon:a,size:.8})}):null,e.jsxRuntimeExports.jsx("input",{id:w,"aria-describedby":[r?O:"",N?p:""].filter(Boolean).join(" ")||void 0,"aria-invalid":t,"aria-required":E,className:x.twMerge("flex h-10 w-full rounded-lg bg-transparent px-2 py-2 text-sm text-white","default-outset-focus","placeholder:text-muted-foreground placeholder:text-neutral-500","default-disabled",a&&(c==="left"?"pl-10":"pr-10"),t?"default-error-border":"default-border",l),disabled:s,name:v,placeholder:$,readOnly:M,type:q,value:i,onChange:D,...g}),a!==""&&c==="right"?e.jsxRuntimeExports.jsx("div",{className:"absolute right-3 flex items-center",children:e.jsxRuntimeExports.jsx(x.OxIcon,{icon:a,size:.8})}):null]});return e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-col gap-1",children:[h?e.jsxRuntimeExports.jsx(I,{disabled:s,htmlFor:w,required:E,children:h}):null,F,k&&typeof b=="number"?e.jsxRuntimeExports.jsxs("div",{className:"pointer-events-none mt-1 text-right text-xs text-neutral-400",children:[A,"/",b]}):null,r?e.jsxRuntimeExports.jsx(y,{id:O,disabled:s,children:r}):null,N?e.jsxRuntimeExports.jsx(j,{id:p,children:n}):null,B&&Array.isArray(n)?e.jsxRuntimeExports.jsx("div",{className:"mt-1 space-y-1",children:n.map((u,o)=>e.jsxRuntimeExports.jsx(j,{id:`${p}-${o}`,children:u},o))}):null]})};exports.OxDescription=y;exports.OxErrorMessage=j;exports.OxForm=C;exports.OxInput=G;exports.OxLabel=I;
|
|
@@ -1,601 +0,0 @@
|
|
|
1
|
-
import { g as te } from "./_commonjsHelpers-C6fGbg64.js";
|
|
2
|
-
import re from "react";
|
|
3
|
-
function ne(t, e) {
|
|
4
|
-
for (var r = 0; r < e.length; r++) {
|
|
5
|
-
const n = e[r];
|
|
6
|
-
if (typeof n != "string" && !Array.isArray(n)) {
|
|
7
|
-
for (const o in n)
|
|
8
|
-
if (o !== "default" && !(o in t)) {
|
|
9
|
-
const i = Object.getOwnPropertyDescriptor(n, o);
|
|
10
|
-
i && Object.defineProperty(t, o, i.get ? i : {
|
|
11
|
-
enumerable: !0,
|
|
12
|
-
get: () => n[o]
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
|
|
18
|
-
}
|
|
19
|
-
var N = function(t, e) {
|
|
20
|
-
return N = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
|
|
21
|
-
r.__proto__ = n;
|
|
22
|
-
} || function(r, n) {
|
|
23
|
-
for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (r[o] = n[o]);
|
|
24
|
-
}, N(t, e);
|
|
25
|
-
};
|
|
26
|
-
function $(t, e) {
|
|
27
|
-
if (typeof e != "function" && e !== null)
|
|
28
|
-
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
29
|
-
N(t, e);
|
|
30
|
-
function r() {
|
|
31
|
-
this.constructor = t;
|
|
32
|
-
}
|
|
33
|
-
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
34
|
-
}
|
|
35
|
-
var w = function() {
|
|
36
|
-
return w = Object.assign || function(e) {
|
|
37
|
-
for (var r, n = 1, o = arguments.length; n < o; n++) {
|
|
38
|
-
r = arguments[n];
|
|
39
|
-
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
40
|
-
}
|
|
41
|
-
return e;
|
|
42
|
-
}, w.apply(this, arguments);
|
|
43
|
-
};
|
|
44
|
-
function Te(t, e) {
|
|
45
|
-
var r = {};
|
|
46
|
-
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
|
|
47
|
-
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
48
|
-
for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
|
|
49
|
-
e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (r[n[o]] = t[n[o]]);
|
|
50
|
-
return r;
|
|
51
|
-
}
|
|
52
|
-
function v(t, e, r) {
|
|
53
|
-
if (r || arguments.length === 2) for (var n = 0, o = e.length, i; n < o; n++)
|
|
54
|
-
(i || !(n in e)) && (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]);
|
|
55
|
-
return t.concat(i || Array.prototype.slice.call(e));
|
|
56
|
-
}
|
|
57
|
-
var S = "Invariant Violation", T = Object.setPrototypeOf, oe = T === void 0 ? function(t, e) {
|
|
58
|
-
return t.__proto__ = e, t;
|
|
59
|
-
} : T, B = (
|
|
60
|
-
/** @class */
|
|
61
|
-
function(t) {
|
|
62
|
-
$(e, t);
|
|
63
|
-
function e(r) {
|
|
64
|
-
r === void 0 && (r = S);
|
|
65
|
-
var n = t.call(this, typeof r == "number" ? S + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
|
|
66
|
-
return n.framesToPop = 1, n.name = S, oe(n, e.prototype), n;
|
|
67
|
-
}
|
|
68
|
-
return e;
|
|
69
|
-
}(Error)
|
|
70
|
-
);
|
|
71
|
-
function p(t, e) {
|
|
72
|
-
if (!t)
|
|
73
|
-
throw new B(e);
|
|
74
|
-
}
|
|
75
|
-
var J = ["debug", "log", "warn", "error", "silent"], ie = J.indexOf("log");
|
|
76
|
-
function E(t) {
|
|
77
|
-
return function() {
|
|
78
|
-
if (J.indexOf(t) >= ie) {
|
|
79
|
-
var e = console[t] || console.log;
|
|
80
|
-
return e.apply(console, arguments);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
(function(t) {
|
|
85
|
-
t.debug = E("debug"), t.log = E("log"), t.warn = E("warn"), t.error = E("error");
|
|
86
|
-
})(p || (p = {}));
|
|
87
|
-
var Y = "3.13.8";
|
|
88
|
-
function c(t) {
|
|
89
|
-
try {
|
|
90
|
-
return t();
|
|
91
|
-
} catch {
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
const A = c(function() {
|
|
95
|
-
return globalThis;
|
|
96
|
-
}) || c(function() {
|
|
97
|
-
return window;
|
|
98
|
-
}) || c(function() {
|
|
99
|
-
return self;
|
|
100
|
-
}) || c(function() {
|
|
101
|
-
return global;
|
|
102
|
-
}) || // We don't expect the Function constructor ever to be invoked at runtime, as
|
|
103
|
-
// long as at least one of globalThis, window, self, or global is defined, so
|
|
104
|
-
// we are under no obligation to make it easy for static analysis tools to
|
|
105
|
-
// detect syntactic usage of the Function constructor. If you think you can
|
|
106
|
-
// improve your static analysis to detect this obfuscation, think again. This
|
|
107
|
-
// is an arms race you cannot win, at least not in JavaScript.
|
|
108
|
-
c(function() {
|
|
109
|
-
return c.constructor("return this")();
|
|
110
|
-
});
|
|
111
|
-
var L = /* @__PURE__ */ new Map();
|
|
112
|
-
function se(t) {
|
|
113
|
-
var e = L.get(t) || 1;
|
|
114
|
-
return L.set(t, e + 1), "".concat(t, ":").concat(e, ":").concat(Math.random().toString(36).slice(2));
|
|
115
|
-
}
|
|
116
|
-
function ae(t, e) {
|
|
117
|
-
var r = se("stringifyForDisplay");
|
|
118
|
-
return JSON.stringify(t, function(n, o) {
|
|
119
|
-
return o === void 0 ? r : o;
|
|
120
|
-
}, e).split(JSON.stringify(r)).join("<undefined>");
|
|
121
|
-
}
|
|
122
|
-
function O(t) {
|
|
123
|
-
return function(e) {
|
|
124
|
-
for (var r = [], n = 1; n < arguments.length; n++)
|
|
125
|
-
r[n - 1] = arguments[n];
|
|
126
|
-
if (typeof e == "number") {
|
|
127
|
-
var o = e;
|
|
128
|
-
e = C(o), e || (e = M(o, r), r = []);
|
|
129
|
-
}
|
|
130
|
-
t.apply(void 0, [e].concat(r));
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
var d = Object.assign(function(e, r) {
|
|
134
|
-
for (var n = [], o = 2; o < arguments.length; o++)
|
|
135
|
-
n[o - 2] = arguments[o];
|
|
136
|
-
e || p(e, C(r, n) || M(r, n));
|
|
137
|
-
}, {
|
|
138
|
-
debug: O(p.debug),
|
|
139
|
-
log: O(p.log),
|
|
140
|
-
warn: O(p.warn),
|
|
141
|
-
error: O(p.error)
|
|
142
|
-
});
|
|
143
|
-
function Le(t) {
|
|
144
|
-
for (var e = [], r = 1; r < arguments.length; r++)
|
|
145
|
-
e[r - 1] = arguments[r];
|
|
146
|
-
return new B(C(t, e) || M(t, e));
|
|
147
|
-
}
|
|
148
|
-
var P = Symbol.for("ApolloErrorMessageHandler_" + Y);
|
|
149
|
-
function X(t) {
|
|
150
|
-
if (typeof t == "string")
|
|
151
|
-
return t;
|
|
152
|
-
try {
|
|
153
|
-
return ae(t, 2).slice(0, 1e3);
|
|
154
|
-
} catch {
|
|
155
|
-
return "<non-serializable>";
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
function C(t, e) {
|
|
159
|
-
if (e === void 0 && (e = []), !!t)
|
|
160
|
-
return A[P] && A[P](t, e.map(X));
|
|
161
|
-
}
|
|
162
|
-
function M(t, e) {
|
|
163
|
-
if (e === void 0 && (e = []), !!t)
|
|
164
|
-
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
165
|
-
version: Y,
|
|
166
|
-
message: t,
|
|
167
|
-
args: e.map(X)
|
|
168
|
-
})));
|
|
169
|
-
}
|
|
170
|
-
var le = c(function() {
|
|
171
|
-
return navigator.product;
|
|
172
|
-
}) == "ReactNative", ue = typeof Symbol == "function" && typeof Symbol.for == "function", ce = typeof c(function() {
|
|
173
|
-
return window.document.createElement;
|
|
174
|
-
}) == "function", fe = (
|
|
175
|
-
// Following advice found in this comment from @domenic (maintainer of jsdom):
|
|
176
|
-
// https://github.com/jsdom/jsdom/issues/1537#issuecomment-229405327
|
|
177
|
-
//
|
|
178
|
-
// Since we control the version of Jest and jsdom used when running Apollo
|
|
179
|
-
// Client tests, and that version is recent enought to include " jsdom/x.y.z"
|
|
180
|
-
// at the end of the user agent string, I believe this case is all we need to
|
|
181
|
-
// check. Testing for "Node.js" was recommended for backwards compatibility
|
|
182
|
-
// with older version of jsdom, but we don't have that problem.
|
|
183
|
-
c(function() {
|
|
184
|
-
return navigator.userAgent.indexOf("jsdom") >= 0;
|
|
185
|
-
}) || !1
|
|
186
|
-
), Pe = (ce || le) && !fe;
|
|
187
|
-
function he(t) {
|
|
188
|
-
return t !== null && typeof t == "object";
|
|
189
|
-
}
|
|
190
|
-
function pe() {
|
|
191
|
-
}
|
|
192
|
-
class D {
|
|
193
|
-
constructor(e = 1 / 0, r = pe) {
|
|
194
|
-
this.max = e, this.dispose = r, this.map = /* @__PURE__ */ new Map(), this.newest = null, this.oldest = null;
|
|
195
|
-
}
|
|
196
|
-
has(e) {
|
|
197
|
-
return this.map.has(e);
|
|
198
|
-
}
|
|
199
|
-
get(e) {
|
|
200
|
-
const r = this.getNode(e);
|
|
201
|
-
return r && r.value;
|
|
202
|
-
}
|
|
203
|
-
get size() {
|
|
204
|
-
return this.map.size;
|
|
205
|
-
}
|
|
206
|
-
getNode(e) {
|
|
207
|
-
const r = this.map.get(e);
|
|
208
|
-
if (r && r !== this.newest) {
|
|
209
|
-
const { older: n, newer: o } = r;
|
|
210
|
-
o && (o.older = n), n && (n.newer = o), r.older = this.newest, r.older.newer = r, r.newer = null, this.newest = r, r === this.oldest && (this.oldest = o);
|
|
211
|
-
}
|
|
212
|
-
return r;
|
|
213
|
-
}
|
|
214
|
-
set(e, r) {
|
|
215
|
-
let n = this.getNode(e);
|
|
216
|
-
return n ? n.value = r : (n = {
|
|
217
|
-
key: e,
|
|
218
|
-
value: r,
|
|
219
|
-
newer: null,
|
|
220
|
-
older: this.newest
|
|
221
|
-
}, this.newest && (this.newest.newer = n), this.newest = n, this.oldest = this.oldest || n, this.map.set(e, n), n.value);
|
|
222
|
-
}
|
|
223
|
-
clean() {
|
|
224
|
-
for (; this.oldest && this.map.size > this.max; )
|
|
225
|
-
this.delete(this.oldest.key);
|
|
226
|
-
}
|
|
227
|
-
delete(e) {
|
|
228
|
-
const r = this.map.get(e);
|
|
229
|
-
return r ? (r === this.newest && (this.newest = r.older), r === this.oldest && (this.oldest = r.newer), r.newer && (r.newer.older = r.older), r.older && (r.older.newer = r.newer), this.map.delete(e), this.dispose(r.value, e), !0) : !1;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
function z() {
|
|
233
|
-
}
|
|
234
|
-
const de = z, ge = typeof WeakRef < "u" ? WeakRef : function(t) {
|
|
235
|
-
return { deref: () => t };
|
|
236
|
-
}, ve = typeof WeakMap < "u" ? WeakMap : Map, ye = typeof FinalizationRegistry < "u" ? FinalizationRegistry : function() {
|
|
237
|
-
return {
|
|
238
|
-
register: z,
|
|
239
|
-
unregister: z
|
|
240
|
-
};
|
|
241
|
-
}, we = 10024;
|
|
242
|
-
class U {
|
|
243
|
-
constructor(e = 1 / 0, r = de) {
|
|
244
|
-
this.max = e, this.dispose = r, this.map = new ve(), this.newest = null, this.oldest = null, this.unfinalizedNodes = /* @__PURE__ */ new Set(), this.finalizationScheduled = !1, this.size = 0, this.finalize = () => {
|
|
245
|
-
const n = this.unfinalizedNodes.values();
|
|
246
|
-
for (let o = 0; o < we; o++) {
|
|
247
|
-
const i = n.next().value;
|
|
248
|
-
if (!i)
|
|
249
|
-
break;
|
|
250
|
-
this.unfinalizedNodes.delete(i);
|
|
251
|
-
const s = i.key;
|
|
252
|
-
delete i.key, i.keyRef = new ge(s), this.registry.register(s, i, i);
|
|
253
|
-
}
|
|
254
|
-
this.unfinalizedNodes.size > 0 ? queueMicrotask(this.finalize) : this.finalizationScheduled = !1;
|
|
255
|
-
}, this.registry = new ye(this.deleteNode.bind(this));
|
|
256
|
-
}
|
|
257
|
-
has(e) {
|
|
258
|
-
return this.map.has(e);
|
|
259
|
-
}
|
|
260
|
-
get(e) {
|
|
261
|
-
const r = this.getNode(e);
|
|
262
|
-
return r && r.value;
|
|
263
|
-
}
|
|
264
|
-
getNode(e) {
|
|
265
|
-
const r = this.map.get(e);
|
|
266
|
-
if (r && r !== this.newest) {
|
|
267
|
-
const { older: n, newer: o } = r;
|
|
268
|
-
o && (o.older = n), n && (n.newer = o), r.older = this.newest, r.older.newer = r, r.newer = null, this.newest = r, r === this.oldest && (this.oldest = o);
|
|
269
|
-
}
|
|
270
|
-
return r;
|
|
271
|
-
}
|
|
272
|
-
set(e, r) {
|
|
273
|
-
let n = this.getNode(e);
|
|
274
|
-
return n ? n.value = r : (n = {
|
|
275
|
-
key: e,
|
|
276
|
-
value: r,
|
|
277
|
-
newer: null,
|
|
278
|
-
older: this.newest
|
|
279
|
-
}, this.newest && (this.newest.newer = n), this.newest = n, this.oldest = this.oldest || n, this.scheduleFinalization(n), this.map.set(e, n), this.size++, n.value);
|
|
280
|
-
}
|
|
281
|
-
clean() {
|
|
282
|
-
for (; this.oldest && this.size > this.max; )
|
|
283
|
-
this.deleteNode(this.oldest);
|
|
284
|
-
}
|
|
285
|
-
deleteNode(e) {
|
|
286
|
-
e === this.newest && (this.newest = e.older), e === this.oldest && (this.oldest = e.newer), e.newer && (e.newer.older = e.older), e.older && (e.older.newer = e.newer), this.size--;
|
|
287
|
-
const r = e.key || e.keyRef && e.keyRef.deref();
|
|
288
|
-
this.dispose(e.value, r), e.keyRef ? this.registry.unregister(e) : this.unfinalizedNodes.delete(e), r && this.map.delete(r);
|
|
289
|
-
}
|
|
290
|
-
delete(e) {
|
|
291
|
-
const r = this.map.get(e);
|
|
292
|
-
return r ? (this.deleteNode(r), !0) : !1;
|
|
293
|
-
}
|
|
294
|
-
scheduleFinalization(e) {
|
|
295
|
-
this.unfinalizedNodes.add(e), this.finalizationScheduled || (this.finalizationScheduled = !0, queueMicrotask(this.finalize));
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
var j = /* @__PURE__ */ new WeakSet();
|
|
299
|
-
function Z(t) {
|
|
300
|
-
t.size <= (t.max || -1) || j.has(t) || (j.add(t), setTimeout(function() {
|
|
301
|
-
t.clean(), j.delete(t);
|
|
302
|
-
}, 100));
|
|
303
|
-
}
|
|
304
|
-
var be = function(t, e) {
|
|
305
|
-
var r = new U(t, e);
|
|
306
|
-
return r.set = function(n, o) {
|
|
307
|
-
var i = U.prototype.set.call(this, n, o);
|
|
308
|
-
return Z(this), i;
|
|
309
|
-
}, r;
|
|
310
|
-
}, De = function(t, e) {
|
|
311
|
-
var r = new D(t, e);
|
|
312
|
-
return r.set = function(n, o) {
|
|
313
|
-
var i = D.prototype.set.call(this, n, o);
|
|
314
|
-
return Z(this), i;
|
|
315
|
-
}, r;
|
|
316
|
-
}, _e = Symbol.for("apollo.cacheSize"), Ee = w({}, A[_e]), Oe = {};
|
|
317
|
-
function me(t, e) {
|
|
318
|
-
Oe[t] = e;
|
|
319
|
-
}
|
|
320
|
-
function F() {
|
|
321
|
-
for (var t = [], e = 0; e < arguments.length; e++)
|
|
322
|
-
t[e] = arguments[e];
|
|
323
|
-
var r = /* @__PURE__ */ Object.create(null);
|
|
324
|
-
return t.forEach(function(n) {
|
|
325
|
-
n && Object.keys(n).forEach(function(o) {
|
|
326
|
-
var i = n[o];
|
|
327
|
-
i !== void 0 && (r[o] = i);
|
|
328
|
-
});
|
|
329
|
-
}), r;
|
|
330
|
-
}
|
|
331
|
-
function Ue(t, e) {
|
|
332
|
-
return F(t, e, e.variables && {
|
|
333
|
-
variables: F(w(w({}, t && t.variables), e.variables))
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
function Fe(t) {
|
|
337
|
-
return t.hasOwnProperty("graphQLErrors");
|
|
338
|
-
}
|
|
339
|
-
var Se = function(t) {
|
|
340
|
-
var e = v(v(v([], t.graphQLErrors, !0), t.clientErrors, !0), t.protocolErrors, !0);
|
|
341
|
-
return t.networkError && e.push(t.networkError), e.map(function(r) {
|
|
342
|
-
return he(r) && r.message || "Error message not found.";
|
|
343
|
-
}).join(`
|
|
344
|
-
`);
|
|
345
|
-
}, We = (
|
|
346
|
-
/** @class */
|
|
347
|
-
function(t) {
|
|
348
|
-
$(e, t);
|
|
349
|
-
function e(r) {
|
|
350
|
-
var n = r.graphQLErrors, o = r.protocolErrors, i = r.clientErrors, s = r.networkError, a = r.errorMessage, u = r.extraInfo, l = t.call(this, a) || this;
|
|
351
|
-
return l.name = "ApolloError", l.graphQLErrors = n || [], l.protocolErrors = o || [], l.clientErrors = i || [], l.networkError = s || null, l.message = a || Se(l), l.extraInfo = u, l.cause = v(v(v([
|
|
352
|
-
s
|
|
353
|
-
], n || [], !0), o || [], !0), i || [], !0).find(function(b) {
|
|
354
|
-
return !!b;
|
|
355
|
-
}) || null, l.__proto__ = e.prototype, l;
|
|
356
|
-
}
|
|
357
|
-
return e;
|
|
358
|
-
}(Error)
|
|
359
|
-
);
|
|
360
|
-
const { toString: W, hasOwnProperty: je } = Object.prototype, q = Function.prototype.toString, x = /* @__PURE__ */ new Map();
|
|
361
|
-
function qe(t, e) {
|
|
362
|
-
try {
|
|
363
|
-
return R(t, e);
|
|
364
|
-
} finally {
|
|
365
|
-
x.clear();
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
function R(t, e) {
|
|
369
|
-
if (t === e)
|
|
370
|
-
return !0;
|
|
371
|
-
const r = W.call(t), n = W.call(e);
|
|
372
|
-
if (r !== n)
|
|
373
|
-
return !1;
|
|
374
|
-
switch (r) {
|
|
375
|
-
case "[object Array]":
|
|
376
|
-
if (t.length !== e.length)
|
|
377
|
-
return !1;
|
|
378
|
-
// Fall through to object case...
|
|
379
|
-
case "[object Object]": {
|
|
380
|
-
if (K(t, e))
|
|
381
|
-
return !0;
|
|
382
|
-
const o = Q(t), i = Q(e), s = o.length;
|
|
383
|
-
if (s !== i.length)
|
|
384
|
-
return !1;
|
|
385
|
-
for (let a = 0; a < s; ++a)
|
|
386
|
-
if (!je.call(e, o[a]))
|
|
387
|
-
return !1;
|
|
388
|
-
for (let a = 0; a < s; ++a) {
|
|
389
|
-
const u = o[a];
|
|
390
|
-
if (!R(t[u], e[u]))
|
|
391
|
-
return !1;
|
|
392
|
-
}
|
|
393
|
-
return !0;
|
|
394
|
-
}
|
|
395
|
-
case "[object Error]":
|
|
396
|
-
return t.name === e.name && t.message === e.message;
|
|
397
|
-
case "[object Number]":
|
|
398
|
-
if (t !== t)
|
|
399
|
-
return e !== e;
|
|
400
|
-
// Fall through to shared +a === +b case...
|
|
401
|
-
case "[object Boolean]":
|
|
402
|
-
case "[object Date]":
|
|
403
|
-
return +t == +e;
|
|
404
|
-
case "[object RegExp]":
|
|
405
|
-
case "[object String]":
|
|
406
|
-
return t == `${e}`;
|
|
407
|
-
case "[object Map]":
|
|
408
|
-
case "[object Set]": {
|
|
409
|
-
if (t.size !== e.size)
|
|
410
|
-
return !1;
|
|
411
|
-
if (K(t, e))
|
|
412
|
-
return !0;
|
|
413
|
-
const o = t.entries(), i = r === "[object Map]";
|
|
414
|
-
for (; ; ) {
|
|
415
|
-
const s = o.next();
|
|
416
|
-
if (s.done)
|
|
417
|
-
break;
|
|
418
|
-
const [a, u] = s.value;
|
|
419
|
-
if (!e.has(a) || i && !R(u, e.get(a)))
|
|
420
|
-
return !1;
|
|
421
|
-
}
|
|
422
|
-
return !0;
|
|
423
|
-
}
|
|
424
|
-
case "[object Uint16Array]":
|
|
425
|
-
case "[object Uint8Array]":
|
|
426
|
-
// Buffer, in Node.js.
|
|
427
|
-
case "[object Uint32Array]":
|
|
428
|
-
case "[object Int32Array]":
|
|
429
|
-
case "[object Int8Array]":
|
|
430
|
-
case "[object Int16Array]":
|
|
431
|
-
case "[object ArrayBuffer]":
|
|
432
|
-
t = new Uint8Array(t), e = new Uint8Array(e);
|
|
433
|
-
// Fall through...
|
|
434
|
-
case "[object DataView]": {
|
|
435
|
-
let o = t.byteLength;
|
|
436
|
-
if (o === e.byteLength)
|
|
437
|
-
for (; o-- && t[o] === e[o]; )
|
|
438
|
-
;
|
|
439
|
-
return o === -1;
|
|
440
|
-
}
|
|
441
|
-
case "[object AsyncFunction]":
|
|
442
|
-
case "[object GeneratorFunction]":
|
|
443
|
-
case "[object AsyncGeneratorFunction]":
|
|
444
|
-
case "[object Function]": {
|
|
445
|
-
const o = q.call(t);
|
|
446
|
-
return o !== q.call(e) ? !1 : !Ae(o, Ne);
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
return !1;
|
|
450
|
-
}
|
|
451
|
-
function Q(t) {
|
|
452
|
-
return Object.keys(t).filter(ke, t);
|
|
453
|
-
}
|
|
454
|
-
function ke(t) {
|
|
455
|
-
return this[t] !== void 0;
|
|
456
|
-
}
|
|
457
|
-
const Ne = "{ [native code] }";
|
|
458
|
-
function Ae(t, e) {
|
|
459
|
-
const r = t.length - e.length;
|
|
460
|
-
return r >= 0 && t.indexOf(e, r) === r;
|
|
461
|
-
}
|
|
462
|
-
function K(t, e) {
|
|
463
|
-
let r = x.get(t);
|
|
464
|
-
if (r) {
|
|
465
|
-
if (r.has(e))
|
|
466
|
-
return !0;
|
|
467
|
-
} else
|
|
468
|
-
x.set(t, r = /* @__PURE__ */ new Set());
|
|
469
|
-
return r.add(e), !1;
|
|
470
|
-
}
|
|
471
|
-
var k = { exports: {} }, G;
|
|
472
|
-
function ze() {
|
|
473
|
-
return G || (G = 1, function(t) {
|
|
474
|
-
t.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = void 0, t.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = void 0, t.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = void 0, Object.assign(t.exports, re);
|
|
475
|
-
}(k)), k.exports;
|
|
476
|
-
}
|
|
477
|
-
var y = ze();
|
|
478
|
-
const xe = /* @__PURE__ */ te(y), Re = /* @__PURE__ */ ne({
|
|
479
|
-
__proto__: null,
|
|
480
|
-
default: xe
|
|
481
|
-
}, [y]);
|
|
482
|
-
var H = ue ? Symbol.for("__APOLLO_CONTEXT__") : "__APOLLO_CONTEXT__";
|
|
483
|
-
function Ce() {
|
|
484
|
-
d("createContext" in Re, 54);
|
|
485
|
-
var t = y.createContext[H];
|
|
486
|
-
return t || (Object.defineProperty(y.createContext, H, {
|
|
487
|
-
value: t = y.createContext({}),
|
|
488
|
-
enumerable: !1,
|
|
489
|
-
writable: !1,
|
|
490
|
-
configurable: !0
|
|
491
|
-
}), t.displayName = "ApolloContext"), t;
|
|
492
|
-
}
|
|
493
|
-
function Qe(t) {
|
|
494
|
-
var e = y.useContext(Ce()), r = t || e.client;
|
|
495
|
-
return d(!!r, 58), r;
|
|
496
|
-
}
|
|
497
|
-
var f;
|
|
498
|
-
(function(t) {
|
|
499
|
-
t[t.Query = 0] = "Query", t[t.Mutation = 1] = "Mutation", t[t.Subscription = 2] = "Subscription";
|
|
500
|
-
})(f || (f = {}));
|
|
501
|
-
var g;
|
|
502
|
-
function V(t) {
|
|
503
|
-
var e;
|
|
504
|
-
switch (t) {
|
|
505
|
-
case f.Query:
|
|
506
|
-
e = "Query";
|
|
507
|
-
break;
|
|
508
|
-
case f.Mutation:
|
|
509
|
-
e = "Mutation";
|
|
510
|
-
break;
|
|
511
|
-
case f.Subscription:
|
|
512
|
-
e = "Subscription";
|
|
513
|
-
break;
|
|
514
|
-
}
|
|
515
|
-
return e;
|
|
516
|
-
}
|
|
517
|
-
function ee(t) {
|
|
518
|
-
g || (g = new be(
|
|
519
|
-
Ee.parser || 1e3
|
|
520
|
-
/* defaultCacheSizes.parser */
|
|
521
|
-
));
|
|
522
|
-
var e = g.get(t);
|
|
523
|
-
if (e)
|
|
524
|
-
return e;
|
|
525
|
-
var r, n, o;
|
|
526
|
-
d(!!t && !!t.kind, 70, t);
|
|
527
|
-
for (var i = [], s = [], a = [], u = [], l = 0, b = t.definitions; l < b.length; l++) {
|
|
528
|
-
var h = b[l];
|
|
529
|
-
if (h.kind === "FragmentDefinition") {
|
|
530
|
-
i.push(h);
|
|
531
|
-
continue;
|
|
532
|
-
}
|
|
533
|
-
if (h.kind === "OperationDefinition")
|
|
534
|
-
switch (h.operation) {
|
|
535
|
-
case "query":
|
|
536
|
-
s.push(h);
|
|
537
|
-
break;
|
|
538
|
-
case "mutation":
|
|
539
|
-
a.push(h);
|
|
540
|
-
break;
|
|
541
|
-
case "subscription":
|
|
542
|
-
u.push(h);
|
|
543
|
-
break;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
d(!i.length || s.length || a.length || u.length, 71), d(
|
|
547
|
-
s.length + a.length + u.length <= 1,
|
|
548
|
-
72,
|
|
549
|
-
t,
|
|
550
|
-
s.length,
|
|
551
|
-
u.length,
|
|
552
|
-
a.length
|
|
553
|
-
), n = s.length ? f.Query : f.Mutation, !s.length && !a.length && (n = f.Subscription);
|
|
554
|
-
var m = s.length ? s : a.length ? a : u;
|
|
555
|
-
d(m.length === 1, 73, t, m.length);
|
|
556
|
-
var _ = m[0];
|
|
557
|
-
r = _.variableDefinitions || [], _.name && _.name.kind === "Name" ? o = _.name.value : o = "data";
|
|
558
|
-
var I = { name: o, type: n, variables: r };
|
|
559
|
-
return g.set(t, I), I;
|
|
560
|
-
}
|
|
561
|
-
ee.resetCache = function() {
|
|
562
|
-
g = void 0;
|
|
563
|
-
};
|
|
564
|
-
globalThis.__DEV__ !== !1 && me("parser", function() {
|
|
565
|
-
return g ? g.size : 0;
|
|
566
|
-
});
|
|
567
|
-
function Ke(t, e) {
|
|
568
|
-
var r = ee(t), n = V(e), o = V(r.type);
|
|
569
|
-
d(
|
|
570
|
-
r.type === e,
|
|
571
|
-
74,
|
|
572
|
-
n,
|
|
573
|
-
n,
|
|
574
|
-
o
|
|
575
|
-
);
|
|
576
|
-
}
|
|
577
|
-
export {
|
|
578
|
-
De as A,
|
|
579
|
-
f as D,
|
|
580
|
-
Re as R,
|
|
581
|
-
w as _,
|
|
582
|
-
he as a,
|
|
583
|
-
ue as b,
|
|
584
|
-
Ee as c,
|
|
585
|
-
Te as d,
|
|
586
|
-
qe as e,
|
|
587
|
-
$ as f,
|
|
588
|
-
F as g,
|
|
589
|
-
Fe as h,
|
|
590
|
-
d as i,
|
|
591
|
-
We as j,
|
|
592
|
-
y as k,
|
|
593
|
-
Pe as l,
|
|
594
|
-
Ce as m,
|
|
595
|
-
Le as n,
|
|
596
|
-
Ue as o,
|
|
597
|
-
ce as p,
|
|
598
|
-
me as r,
|
|
599
|
-
Qe as u,
|
|
600
|
-
Ke as v
|
|
601
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const se=require("./_commonjsHelpers-DwGv2jUC.js"),ae=require("react");function le(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const o in n)if(o!=="default"&&!(o in t)){const i=Object.getOwnPropertyDescriptor(n,o);i&&Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>n[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var N=function(t,e){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},N(t,e)};function z(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");N(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},exports.__assign.apply(this,arguments)};function ce(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r}function y(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}var E="Invariant Violation",D=Object.setPrototypeOf,ue=D===void 0?function(t,e){return t.__proto__=e,t}:D,V=function(t){z(e,t);function e(r){r===void 0&&(r=E);var n=t.call(this,typeof r=="number"?E+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=E,ue(n,e.prototype),n}return e}(Error);function p(t,e){if(!t)throw new V(e)}var $=["debug","log","warn","error","silent"],fe=$.indexOf("log");function _(t){return function(){if($.indexOf(t)>=fe){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=_("debug"),t.log=_("log"),t.warn=_("warn"),t.error=_("error")})(p||(p={}));var B="3.13.8";function u(t){try{return t()}catch{}}const j=u(function(){return globalThis})||u(function(){return window})||u(function(){return self})||u(function(){return global})||u(function(){return u.constructor("return this")()});var I=new Map;function he(t){var e=I.get(t)||1;return I.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function pe(t,e){var r=he("stringifyForDisplay");return JSON.stringify(t,function(n,o){return o===void 0?r:o},e).split(JSON.stringify(r)).join("<undefined>")}function b(t){return function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(typeof e=="number"){var o=e;e=R(o),e||(e=M(o,r),r=[])}t.apply(void 0,[e].concat(r))}}var f=Object.assign(function(e,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];e||p(e,R(r,n)||M(r,n))},{debug:b(p.debug),log:b(p.log),warn:b(p.warn),error:b(p.error)});function de(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return new V(R(t,e)||M(t,e))}var L=Symbol.for("ApolloErrorMessageHandler_"+B);function J(t){if(typeof t=="string")return t;try{return pe(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function R(t,e){if(e===void 0&&(e=[]),!!t)return j[L]&&j[L](t,e.map(J))}function M(t,e){if(e===void 0&&(e=[]),!!t)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:B,message:t,args:e.map(J)})))}var ge=u(function(){return navigator.product})=="ReactNative",Y=typeof Symbol=="function"&&typeof Symbol.for=="function",X=typeof u(function(){return window.document.createElement})=="function",ye=u(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,ve=(X||ge)&&!ye;function Z(t){return t!==null&&typeof t=="object"}function we(){}class U{constructor(e=1/0,r=we){this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const r=this.getNode(e);return r&&r.value}get size(){return this.map.size}getNode(e){const r=this.map.get(e);if(r&&r!==this.newest){const{older:n,newer:o}=r;o&&(o.older=n),n&&(n.newer=o),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=o)}return r}set(e,r){let n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1}}function k(){}const _e=k,be=typeof WeakRef<"u"?WeakRef:function(t){return{deref:()=>t}},me=typeof WeakMap<"u"?WeakMap:Map,Ee=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:k,unregister:k}},Oe=10024;class P{constructor(e=1/0,r=_e){this.max=e,this.dispose=r,this.map=new me,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const n=this.unfinalizedNodes.values();for(let o=0;o<Oe;o++){const i=n.next().value;if(!i)break;this.unfinalizedNodes.delete(i);const s=i.key;delete i.key,i.keyRef=new be(s),this.registry.register(s,i,i)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new Ee(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const r=this.getNode(e);return r&&r.value}getNode(e){const r=this.map.get(e);if(r&&r!==this.newest){const{older:n,newer:o}=r;o&&(o.older=n),n&&(n.newer=o),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=o)}return r}set(e,r){let n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(e,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const r=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,r),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),r&&this.map.delete(r)}delete(e){const r=this.map.get(e);return r?(this.deleteNode(r),!0):!1}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var O=new WeakSet;function ee(t){t.size<=(t.max||-1)||O.has(t)||(O.add(t),setTimeout(function(){t.clean(),O.delete(t)},100))}var Se=function(t,e){var r=new P(t,e);return r.set=function(n,o){var i=P.prototype.set.call(this,n,o);return ee(this),i},r},Ne=function(t,e){var r=new U(t,e);return r.set=function(n,o){var i=U.prototype.set.call(this,n,o);return ee(this),i},r},je=Symbol.for("apollo.cacheSize"),te=exports.__assign({},j[je]),ke={};function re(t,e){ke[t]=e}function A(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(n){n&&Object.keys(n).forEach(function(o){var i=n[o];i!==void 0&&(r[o]=i)})}),r}function Ae(t,e){return A(t,e,e.variables&&{variables:A(exports.__assign(exports.__assign({},t&&t.variables),e.variables))})}function Ce(t){return t.hasOwnProperty("graphQLErrors")}var xe=function(t){var e=y(y(y([],t.graphQLErrors,!0),t.clientErrors,!0),t.protocolErrors,!0);return t.networkError&&e.push(t.networkError),e.map(function(r){return Z(r)&&r.message||"Error message not found."}).join(`
|
|
2
|
-
`)},ze=function(t){z(e,t);function e(r){var n=r.graphQLErrors,o=r.protocolErrors,i=r.clientErrors,s=r.networkError,a=r.errorMessage,c=r.extraInfo,l=t.call(this,a)||this;return l.name="ApolloError",l.graphQLErrors=n||[],l.protocolErrors=o||[],l.clientErrors=i||[],l.networkError=s||null,l.message=a||xe(l),l.extraInfo=c,l.cause=y(y(y([s],n||[],!0),o||[],!0),i||[],!0).find(function(v){return!!v})||null,l.__proto__=e.prototype,l}return e}(Error);const{toString:F,hasOwnProperty:Re}=Object.prototype,q=Function.prototype.toString,C=new Map;function Me(t,e){try{return x(t,e)}finally{C.clear()}}function x(t,e){if(t===e)return!0;const r=F.call(t),n=F.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Q(t,e))return!0;const o=W(t),i=W(e),s=o.length;if(s!==i.length)return!1;for(let a=0;a<s;++a)if(!Re.call(e,o[a]))return!1;for(let a=0;a<s;++a){const c=o[a];if(!x(t[c],e[c]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(Q(t,e))return!0;const o=t.entries(),i=r==="[object Map]";for(;;){const s=o.next();if(s.done)break;const[a,c]=s.value;if(!e.has(a)||i&&!x(c,e.get(a)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let o=t.byteLength;if(o===e.byteLength)for(;o--&&t[o]===e[o];);return o===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const o=q.call(t);return o!==q.call(e)?!1:!Ie(o,De)}}return!1}function W(t){return Object.keys(t).filter(Te,t)}function Te(t){return this[t]!==void 0}const De="{ [native code] }";function Ie(t,e){const r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function Q(t,e){let r=C.get(t);if(r){if(r.has(e))return!0}else C.set(t,r=new Set);return r.add(e),!1}var S={exports:{}},G;function Le(){return G||(G=1,function(t){t.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,t.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,t.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(t.exports,ae)}(S)),S.exports}var g=Le();const Ue=se.getDefaultExportFromCjs(g),ne=le({__proto__:null,default:Ue},[g]);var H=Y?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function oe(){f("createContext"in ne,54);var t=g.createContext[H];return t||(Object.defineProperty(g.createContext,H,{value:t=g.createContext({}),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}function Pe(t){var e=g.useContext(oe()),r=t||e.client;return f(!!r,58),r}exports.DocumentType=void 0;(function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation",t[t.Subscription=2]="Subscription"})(exports.DocumentType||(exports.DocumentType={}));var d;function K(t){var e;switch(t){case exports.DocumentType.Query:e="Query";break;case exports.DocumentType.Mutation:e="Mutation";break;case exports.DocumentType.Subscription:e="Subscription";break}return e}function ie(t){d||(d=new Se(te.parser||1e3));var e=d.get(t);if(e)return e;var r,n,o;f(!!t&&!!t.kind,70,t);for(var i=[],s=[],a=[],c=[],l=0,v=t.definitions;l<v.length;l++){var h=v[l];if(h.kind==="FragmentDefinition"){i.push(h);continue}if(h.kind==="OperationDefinition")switch(h.operation){case"query":s.push(h);break;case"mutation":a.push(h);break;case"subscription":c.push(h);break}}f(!i.length||s.length||a.length||c.length,71),f(s.length+a.length+c.length<=1,72,t,s.length,c.length,a.length),n=s.length?exports.DocumentType.Query:exports.DocumentType.Mutation,!s.length&&!a.length&&(n=exports.DocumentType.Subscription);var m=s.length?s:a.length?a:c;f(m.length===1,73,t,m.length);var w=m[0];r=w.variableDefinitions||[],w.name&&w.name.kind==="Name"?o=w.name.value:o="data";var T={name:o,type:n,variables:r};return d.set(t,T),T}ie.resetCache=function(){d=void 0};globalThis.__DEV__!==!1&&re("parser",function(){return d?d.size:0});function Fe(t,e){var r=ie(t),n=K(e),o=K(r.type);f(r.type===e,74,n,n,o)}exports.ApolloError=ze;exports.AutoCleanedStrongCache=Ne;exports.React=ne;exports.__extends=z;exports.__rest=ce;exports.cacheSizes=te;exports.canUseDOM=X;exports.canUseLayoutEffect=ve;exports.canUseSymbol=Y;exports.compact=A;exports.equal=Me;exports.getApolloContext=oe;exports.invariant=f;exports.isApolloError=Ce;exports.isNonNullObject=Z;exports.mergeOptions=Ae;exports.newInvariantError=de;exports.registerGlobalCache=re;exports.rehacktExports=g;exports.useApolloClient=Pe;exports.verifyDocumentType=Fe;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";const f=require("./jsx-runtime-CITbqOLs.js"),m=require("./index-DGjVEo0G.js"),A=require("./useQuery--6GP2-dN.js"),s=require("react"),n=s.createContext({user:null,loading:!1,error:null,isLoggedIn:!1,isAdmin:!1,refreshUser:async()=>Promise.resolve()}),g=m.gql`
|
|
2
|
-
query getCurrentUser {
|
|
3
|
-
me {
|
|
4
|
-
id
|
|
5
|
-
username
|
|
6
|
-
email
|
|
7
|
-
role
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
`;function P({adminRole:r="admin",children:o,getCurrentUserQuery:u=g,options:i={},pollInterval:c=5*60*1e3}){const{data:t,error:l,loading:x,refetch:h}=A.useQuery(u,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",errorPolicy:"all",pollInterval:c,...i}),e=(t==null?void 0:t.me)||null,a=!!e,d=(e==null?void 0:e.role)===r;return f.jsxRuntimeExports.jsx(n.Provider,{value:{user:e,loading:x,error:l??null,isLoggedIn:a,isAdmin:d,refreshUser:h},children:o})}function y(){const r=s.useContext(n);if(!r)throw new Error("useOxAuth must be used within an AuthProvider");return r}exports.OxAuthContext=n;exports.OxAuthProvider=P;exports.useOxAuth=y;
|