@campphillip/widgets 3.1.0 → 3.1.2
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/banners.widget.js +6 -0
- package/dist/board-events.widget.js +6 -0
- package/dist/campphillip.js +4734 -0
- package/dist/categories.widget.js +6 -0
- package/dist/events.widget.js +6 -0
- package/dist/rates.widget.js +6 -0
- package/dist/react.js +6945 -0
- package/dist/style.css +1 -0
- package/package.json +24 -13
- package/dist/banners/banners.widget.js +0 -502
- package/dist/events/board-events.widget.js +0 -502
- package/dist/events/events.widget.css +0 -1
- package/dist/events/events.widget.js +0 -502
|
@@ -0,0 +1,4734 @@
|
|
|
1
|
+
import { j as m, S as le, P as Cr, a as yn, r as I } from "./react.js";
|
|
2
|
+
var j = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3
|
+
function Pr(t) {
|
|
4
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
5
|
+
}
|
|
6
|
+
/*
|
|
7
|
+
object-assign
|
|
8
|
+
(c) Sindre Sorhus
|
|
9
|
+
@license MIT
|
|
10
|
+
*/
|
|
11
|
+
var Nt = Object.getOwnPropertySymbols, bn = Object.prototype.hasOwnProperty, wn = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
function _n(t) {
|
|
13
|
+
if (t == null)
|
|
14
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
15
|
+
return Object(t);
|
|
16
|
+
}
|
|
17
|
+
function On() {
|
|
18
|
+
try {
|
|
19
|
+
if (!Object.assign)
|
|
20
|
+
return !1;
|
|
21
|
+
var t = new String("abc");
|
|
22
|
+
if (t[5] = "de", Object.getOwnPropertyNames(t)[0] === "5")
|
|
23
|
+
return !1;
|
|
24
|
+
for (var e = {}, r = 0; r < 10; r++)
|
|
25
|
+
e["_" + String.fromCharCode(r)] = r;
|
|
26
|
+
var n = Object.getOwnPropertyNames(e).map(function(i) {
|
|
27
|
+
return e[i];
|
|
28
|
+
});
|
|
29
|
+
if (n.join("") !== "0123456789")
|
|
30
|
+
return !1;
|
|
31
|
+
var a = {};
|
|
32
|
+
return "abcdefghijklmnopqrst".split("").forEach(function(i) {
|
|
33
|
+
a[i] = i;
|
|
34
|
+
}), Object.keys(Object.assign({}, a)).join("") === "abcdefghijklmnopqrst";
|
|
35
|
+
} catch {
|
|
36
|
+
return !1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
var D = On() ? Object.assign : function(t, e) {
|
|
40
|
+
for (var r, n = _n(t), a, i = 1; i < arguments.length; i++) {
|
|
41
|
+
r = Object(arguments[i]);
|
|
42
|
+
for (var o in r)
|
|
43
|
+
bn.call(r, o) && (n[o] = r[o]);
|
|
44
|
+
if (Nt) {
|
|
45
|
+
a = Nt(r);
|
|
46
|
+
for (var s = 0; s < a.length; s++)
|
|
47
|
+
wn.call(r, a[s]) && (n[a[s]] = r[a[s]]);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return n;
|
|
51
|
+
}, Oe = {}, vt = {}, z = {}, Ue = {};
|
|
52
|
+
Object.defineProperty(Ue, "__esModule", { value: !0 });
|
|
53
|
+
function En(t) {
|
|
54
|
+
return typeof t == "function";
|
|
55
|
+
}
|
|
56
|
+
Ue.isFunction = En;
|
|
57
|
+
var ke = {}, Ee = {};
|
|
58
|
+
Object.defineProperty(Ee, "__esModule", { value: !0 });
|
|
59
|
+
var Ve = !1;
|
|
60
|
+
Ee.config = {
|
|
61
|
+
Promise: void 0,
|
|
62
|
+
set useDeprecatedSynchronousErrorHandling(t) {
|
|
63
|
+
if (t) {
|
|
64
|
+
var e = new Error();
|
|
65
|
+
console.warn(`DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at:
|
|
66
|
+
` + e.stack);
|
|
67
|
+
} else
|
|
68
|
+
Ve && console.log("RxJS: Back to a better error behavior. Thank you. <3");
|
|
69
|
+
Ve = t;
|
|
70
|
+
},
|
|
71
|
+
get useDeprecatedSynchronousErrorHandling() {
|
|
72
|
+
return Ve;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var Ne = {};
|
|
76
|
+
Object.defineProperty(Ne, "__esModule", { value: !0 });
|
|
77
|
+
function Sn(t) {
|
|
78
|
+
setTimeout(function() {
|
|
79
|
+
throw t;
|
|
80
|
+
}, 0);
|
|
81
|
+
}
|
|
82
|
+
Ne.hostReportError = Sn;
|
|
83
|
+
Object.defineProperty(ke, "__esModule", { value: !0 });
|
|
84
|
+
var xn = Ee, Cn = Ne;
|
|
85
|
+
ke.empty = {
|
|
86
|
+
closed: !0,
|
|
87
|
+
next: function(t) {
|
|
88
|
+
},
|
|
89
|
+
error: function(t) {
|
|
90
|
+
if (xn.config.useDeprecatedSynchronousErrorHandling)
|
|
91
|
+
throw t;
|
|
92
|
+
Cn.hostReportError(t);
|
|
93
|
+
},
|
|
94
|
+
complete: function() {
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
var mt = {}, gt = {};
|
|
98
|
+
Object.defineProperty(gt, "__esModule", { value: !0 });
|
|
99
|
+
gt.isArray = function() {
|
|
100
|
+
return Array.isArray || function(t) {
|
|
101
|
+
return t && typeof t.length == "number";
|
|
102
|
+
};
|
|
103
|
+
}();
|
|
104
|
+
var yt = {};
|
|
105
|
+
Object.defineProperty(yt, "__esModule", { value: !0 });
|
|
106
|
+
function Pn(t) {
|
|
107
|
+
return t !== null && typeof t == "object";
|
|
108
|
+
}
|
|
109
|
+
yt.isObject = Pn;
|
|
110
|
+
var bt = {};
|
|
111
|
+
Object.defineProperty(bt, "__esModule", { value: !0 });
|
|
112
|
+
var Tn = function() {
|
|
113
|
+
function t(e) {
|
|
114
|
+
return Error.call(this), this.message = e ? e.length + ` errors occurred during unsubscription:
|
|
115
|
+
` + e.map(function(r, n) {
|
|
116
|
+
return n + 1 + ") " + r.toString();
|
|
117
|
+
}).join(`
|
|
118
|
+
`) : "", this.name = "UnsubscriptionError", this.errors = e, this;
|
|
119
|
+
}
|
|
120
|
+
return t.prototype = Object.create(Error.prototype), t;
|
|
121
|
+
}();
|
|
122
|
+
bt.UnsubscriptionError = Tn;
|
|
123
|
+
Object.defineProperty(mt, "__esModule", { value: !0 });
|
|
124
|
+
var jn = gt, Dn = yt, qn = Ue, Ae = bt, Mn = function() {
|
|
125
|
+
function t(e) {
|
|
126
|
+
this.closed = !1, this._parentOrParents = null, this._subscriptions = null, e && (this._ctorUnsubscribe = !0, this._unsubscribe = e);
|
|
127
|
+
}
|
|
128
|
+
return t.prototype.unsubscribe = function() {
|
|
129
|
+
var e;
|
|
130
|
+
if (!this.closed) {
|
|
131
|
+
var r = this, n = r._parentOrParents, a = r._ctorUnsubscribe, i = r._unsubscribe, o = r._subscriptions;
|
|
132
|
+
if (this.closed = !0, this._parentOrParents = null, this._subscriptions = null, n instanceof t)
|
|
133
|
+
n.remove(this);
|
|
134
|
+
else if (n !== null)
|
|
135
|
+
for (var s = 0; s < n.length; ++s) {
|
|
136
|
+
var u = n[s];
|
|
137
|
+
u.remove(this);
|
|
138
|
+
}
|
|
139
|
+
if (qn.isFunction(i)) {
|
|
140
|
+
a && (this._unsubscribe = void 0);
|
|
141
|
+
try {
|
|
142
|
+
i.call(this);
|
|
143
|
+
} catch (d) {
|
|
144
|
+
e = d instanceof Ae.UnsubscriptionError ? Ht(d.errors) : [d];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (jn.isArray(o))
|
|
148
|
+
for (var s = -1, c = o.length; ++s < c; ) {
|
|
149
|
+
var g = o[s];
|
|
150
|
+
if (Dn.isObject(g))
|
|
151
|
+
try {
|
|
152
|
+
g.unsubscribe();
|
|
153
|
+
} catch (p) {
|
|
154
|
+
e = e || [], p instanceof Ae.UnsubscriptionError ? e = e.concat(Ht(p.errors)) : e.push(p);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (e)
|
|
158
|
+
throw new Ae.UnsubscriptionError(e);
|
|
159
|
+
}
|
|
160
|
+
}, t.prototype.add = function(e) {
|
|
161
|
+
var r = e;
|
|
162
|
+
if (!e)
|
|
163
|
+
return t.EMPTY;
|
|
164
|
+
switch (typeof e) {
|
|
165
|
+
case "function":
|
|
166
|
+
r = new t(e);
|
|
167
|
+
case "object":
|
|
168
|
+
if (r === this || r.closed || typeof r.unsubscribe != "function")
|
|
169
|
+
return r;
|
|
170
|
+
if (this.closed)
|
|
171
|
+
return r.unsubscribe(), r;
|
|
172
|
+
if (!(r instanceof t)) {
|
|
173
|
+
var n = r;
|
|
174
|
+
r = new t(), r._subscriptions = [n];
|
|
175
|
+
}
|
|
176
|
+
break;
|
|
177
|
+
default:
|
|
178
|
+
throw new Error("unrecognized teardown " + e + " added to Subscription.");
|
|
179
|
+
}
|
|
180
|
+
var a = r._parentOrParents;
|
|
181
|
+
if (a === null)
|
|
182
|
+
r._parentOrParents = this;
|
|
183
|
+
else if (a instanceof t) {
|
|
184
|
+
if (a === this)
|
|
185
|
+
return r;
|
|
186
|
+
r._parentOrParents = [a, this];
|
|
187
|
+
} else if (a.indexOf(this) === -1)
|
|
188
|
+
a.push(this);
|
|
189
|
+
else
|
|
190
|
+
return r;
|
|
191
|
+
var i = this._subscriptions;
|
|
192
|
+
return i === null ? this._subscriptions = [r] : i.push(r), r;
|
|
193
|
+
}, t.prototype.remove = function(e) {
|
|
194
|
+
var r = this._subscriptions;
|
|
195
|
+
if (r) {
|
|
196
|
+
var n = r.indexOf(e);
|
|
197
|
+
n !== -1 && r.splice(n, 1);
|
|
198
|
+
}
|
|
199
|
+
}, t.EMPTY = function(e) {
|
|
200
|
+
return e.closed = !0, e;
|
|
201
|
+
}(new t()), t;
|
|
202
|
+
}();
|
|
203
|
+
mt.Subscription = Mn;
|
|
204
|
+
function Ht(t) {
|
|
205
|
+
return t.reduce(function(e, r) {
|
|
206
|
+
return e.concat(r instanceof Ae.UnsubscriptionError ? r.errors : r);
|
|
207
|
+
}, []);
|
|
208
|
+
}
|
|
209
|
+
var wt = {};
|
|
210
|
+
(function(t) {
|
|
211
|
+
Object.defineProperty(t, "__esModule", { value: !0 }), t.rxSubscriber = function() {
|
|
212
|
+
return typeof Symbol == "function" ? Symbol("rxSubscriber") : "@@rxSubscriber_" + Math.random();
|
|
213
|
+
}(), t.$$rxSubscriber = t.rxSubscriber;
|
|
214
|
+
})(wt);
|
|
215
|
+
var Tr = j && j.__extends || function() {
|
|
216
|
+
var t = function(e, r) {
|
|
217
|
+
return t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
|
218
|
+
n.__proto__ = a;
|
|
219
|
+
} || function(n, a) {
|
|
220
|
+
for (var i in a)
|
|
221
|
+
a.hasOwnProperty(i) && (n[i] = a[i]);
|
|
222
|
+
}, t(e, r);
|
|
223
|
+
};
|
|
224
|
+
return function(e, r) {
|
|
225
|
+
t(e, r);
|
|
226
|
+
function n() {
|
|
227
|
+
this.constructor = e;
|
|
228
|
+
}
|
|
229
|
+
e.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n());
|
|
230
|
+
};
|
|
231
|
+
}();
|
|
232
|
+
Object.defineProperty(z, "__esModule", { value: !0 });
|
|
233
|
+
var Wt = Ue, ot = ke, An = mt, Rn = wt, se = Ee, Te = Ne, jr = function(t) {
|
|
234
|
+
Tr(e, t);
|
|
235
|
+
function e(r, n, a) {
|
|
236
|
+
var i = t.call(this) || this;
|
|
237
|
+
switch (i.syncErrorValue = null, i.syncErrorThrown = !1, i.syncErrorThrowable = !1, i.isStopped = !1, arguments.length) {
|
|
238
|
+
case 0:
|
|
239
|
+
i.destination = ot.empty;
|
|
240
|
+
break;
|
|
241
|
+
case 1:
|
|
242
|
+
if (!r) {
|
|
243
|
+
i.destination = ot.empty;
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
if (typeof r == "object") {
|
|
247
|
+
r instanceof e ? (i.syncErrorThrowable = r.syncErrorThrowable, i.destination = r, r.add(i)) : (i.syncErrorThrowable = !0, i.destination = new st(i, r));
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
default:
|
|
251
|
+
i.syncErrorThrowable = !0, i.destination = new st(i, r, n, a);
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
return i;
|
|
255
|
+
}
|
|
256
|
+
return e.prototype[Rn.rxSubscriber] = function() {
|
|
257
|
+
return this;
|
|
258
|
+
}, e.create = function(r, n, a) {
|
|
259
|
+
var i = new e(r, n, a);
|
|
260
|
+
return i.syncErrorThrowable = !1, i;
|
|
261
|
+
}, e.prototype.next = function(r) {
|
|
262
|
+
this.isStopped || this._next(r);
|
|
263
|
+
}, e.prototype.error = function(r) {
|
|
264
|
+
this.isStopped || (this.isStopped = !0, this._error(r));
|
|
265
|
+
}, e.prototype.complete = function() {
|
|
266
|
+
this.isStopped || (this.isStopped = !0, this._complete());
|
|
267
|
+
}, e.prototype.unsubscribe = function() {
|
|
268
|
+
this.closed || (this.isStopped = !0, t.prototype.unsubscribe.call(this));
|
|
269
|
+
}, e.prototype._next = function(r) {
|
|
270
|
+
this.destination.next(r);
|
|
271
|
+
}, e.prototype._error = function(r) {
|
|
272
|
+
this.destination.error(r), this.unsubscribe();
|
|
273
|
+
}, e.prototype._complete = function() {
|
|
274
|
+
this.destination.complete(), this.unsubscribe();
|
|
275
|
+
}, e.prototype._unsubscribeAndRecycle = function() {
|
|
276
|
+
var r = this._parentOrParents;
|
|
277
|
+
return this._parentOrParents = null, this.unsubscribe(), this.closed = !1, this.isStopped = !1, this._parentOrParents = r, this;
|
|
278
|
+
}, e;
|
|
279
|
+
}(An.Subscription);
|
|
280
|
+
z.Subscriber = jr;
|
|
281
|
+
var st = function(t) {
|
|
282
|
+
Tr(e, t);
|
|
283
|
+
function e(r, n, a, i) {
|
|
284
|
+
var o = t.call(this) || this;
|
|
285
|
+
o._parentSubscriber = r;
|
|
286
|
+
var s, u = o;
|
|
287
|
+
return Wt.isFunction(n) ? s = n : n && (s = n.next, a = n.error, i = n.complete, n !== ot.empty && (u = Object.create(n), Wt.isFunction(u.unsubscribe) && o.add(u.unsubscribe.bind(u)), u.unsubscribe = o.unsubscribe.bind(o))), o._context = u, o._next = s, o._error = a, o._complete = i, o;
|
|
288
|
+
}
|
|
289
|
+
return e.prototype.next = function(r) {
|
|
290
|
+
if (!this.isStopped && this._next) {
|
|
291
|
+
var n = this._parentSubscriber;
|
|
292
|
+
!se.config.useDeprecatedSynchronousErrorHandling || !n.syncErrorThrowable ? this.__tryOrUnsub(this._next, r) : this.__tryOrSetError(n, this._next, r) && this.unsubscribe();
|
|
293
|
+
}
|
|
294
|
+
}, e.prototype.error = function(r) {
|
|
295
|
+
if (!this.isStopped) {
|
|
296
|
+
var n = this._parentSubscriber, a = se.config.useDeprecatedSynchronousErrorHandling;
|
|
297
|
+
if (this._error)
|
|
298
|
+
!a || !n.syncErrorThrowable ? (this.__tryOrUnsub(this._error, r), this.unsubscribe()) : (this.__tryOrSetError(n, this._error, r), this.unsubscribe());
|
|
299
|
+
else if (n.syncErrorThrowable)
|
|
300
|
+
a ? (n.syncErrorValue = r, n.syncErrorThrown = !0) : Te.hostReportError(r), this.unsubscribe();
|
|
301
|
+
else {
|
|
302
|
+
if (this.unsubscribe(), a)
|
|
303
|
+
throw r;
|
|
304
|
+
Te.hostReportError(r);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}, e.prototype.complete = function() {
|
|
308
|
+
var r = this;
|
|
309
|
+
if (!this.isStopped) {
|
|
310
|
+
var n = this._parentSubscriber;
|
|
311
|
+
if (this._complete) {
|
|
312
|
+
var a = function() {
|
|
313
|
+
return r._complete.call(r._context);
|
|
314
|
+
};
|
|
315
|
+
!se.config.useDeprecatedSynchronousErrorHandling || !n.syncErrorThrowable ? (this.__tryOrUnsub(a), this.unsubscribe()) : (this.__tryOrSetError(n, a), this.unsubscribe());
|
|
316
|
+
} else
|
|
317
|
+
this.unsubscribe();
|
|
318
|
+
}
|
|
319
|
+
}, e.prototype.__tryOrUnsub = function(r, n) {
|
|
320
|
+
try {
|
|
321
|
+
r.call(this._context, n);
|
|
322
|
+
} catch (a) {
|
|
323
|
+
if (this.unsubscribe(), se.config.useDeprecatedSynchronousErrorHandling)
|
|
324
|
+
throw a;
|
|
325
|
+
Te.hostReportError(a);
|
|
326
|
+
}
|
|
327
|
+
}, e.prototype.__tryOrSetError = function(r, n, a) {
|
|
328
|
+
if (!se.config.useDeprecatedSynchronousErrorHandling)
|
|
329
|
+
throw new Error("bad call");
|
|
330
|
+
try {
|
|
331
|
+
n.call(this._context, a);
|
|
332
|
+
} catch (i) {
|
|
333
|
+
return se.config.useDeprecatedSynchronousErrorHandling ? (r.syncErrorValue = i, r.syncErrorThrown = !0, !0) : (Te.hostReportError(i), !0);
|
|
334
|
+
}
|
|
335
|
+
return !1;
|
|
336
|
+
}, e.prototype._unsubscribe = function() {
|
|
337
|
+
var r = this._parentSubscriber;
|
|
338
|
+
this._context = null, this._parentSubscriber = null, r.unsubscribe();
|
|
339
|
+
}, e;
|
|
340
|
+
}(jr);
|
|
341
|
+
z.SafeSubscriber = st;
|
|
342
|
+
var In = j && j.__extends || function() {
|
|
343
|
+
var t = function(e, r) {
|
|
344
|
+
return t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
|
345
|
+
n.__proto__ = a;
|
|
346
|
+
} || function(n, a) {
|
|
347
|
+
for (var i in a)
|
|
348
|
+
a.hasOwnProperty(i) && (n[i] = a[i]);
|
|
349
|
+
}, t(e, r);
|
|
350
|
+
};
|
|
351
|
+
return function(e, r) {
|
|
352
|
+
t(e, r);
|
|
353
|
+
function n() {
|
|
354
|
+
this.constructor = e;
|
|
355
|
+
}
|
|
356
|
+
e.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n());
|
|
357
|
+
};
|
|
358
|
+
}();
|
|
359
|
+
Object.defineProperty(vt, "__esModule", { value: !0 });
|
|
360
|
+
var $n = z;
|
|
361
|
+
function Un(t, e) {
|
|
362
|
+
return function(n) {
|
|
363
|
+
return n.lift(new kn(t, e));
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
vt.filter = Un;
|
|
367
|
+
var kn = function() {
|
|
368
|
+
function t(e, r) {
|
|
369
|
+
this.predicate = e, this.thisArg = r;
|
|
370
|
+
}
|
|
371
|
+
return t.prototype.call = function(e, r) {
|
|
372
|
+
return r.subscribe(new Nn(e, this.predicate, this.thisArg));
|
|
373
|
+
}, t;
|
|
374
|
+
}(), Nn = function(t) {
|
|
375
|
+
In(e, t);
|
|
376
|
+
function e(r, n, a) {
|
|
377
|
+
var i = t.call(this, r) || this;
|
|
378
|
+
return i.predicate = n, i.thisArg = a, i.count = 0, i;
|
|
379
|
+
}
|
|
380
|
+
return e.prototype._next = function(r) {
|
|
381
|
+
var n;
|
|
382
|
+
try {
|
|
383
|
+
n = this.predicate.call(this.thisArg, r, this.count++);
|
|
384
|
+
} catch (a) {
|
|
385
|
+
this.destination.error(a);
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
n && this.destination.next(r);
|
|
389
|
+
}, e;
|
|
390
|
+
}($n.Subscriber);
|
|
391
|
+
Oe.filter = vt.filter;
|
|
392
|
+
var Se = {}, He = {}, Hn = j && j.__extends || function() {
|
|
393
|
+
var t = function(e, r) {
|
|
394
|
+
return t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
|
395
|
+
n.__proto__ = a;
|
|
396
|
+
} || function(n, a) {
|
|
397
|
+
for (var i in a)
|
|
398
|
+
a.hasOwnProperty(i) && (n[i] = a[i]);
|
|
399
|
+
}, t(e, r);
|
|
400
|
+
};
|
|
401
|
+
return function(e, r) {
|
|
402
|
+
t(e, r);
|
|
403
|
+
function n() {
|
|
404
|
+
this.constructor = e;
|
|
405
|
+
}
|
|
406
|
+
e.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n());
|
|
407
|
+
};
|
|
408
|
+
}();
|
|
409
|
+
Object.defineProperty(He, "__esModule", { value: !0 });
|
|
410
|
+
var Wn = z;
|
|
411
|
+
function Ln(t, e) {
|
|
412
|
+
return function(n) {
|
|
413
|
+
if (typeof t != "function")
|
|
414
|
+
throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");
|
|
415
|
+
return n.lift(new Dr(t, e));
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
He.map = Ln;
|
|
419
|
+
var Dr = function() {
|
|
420
|
+
function t(e, r) {
|
|
421
|
+
this.project = e, this.thisArg = r;
|
|
422
|
+
}
|
|
423
|
+
return t.prototype.call = function(e, r) {
|
|
424
|
+
return r.subscribe(new Fn(e, this.project, this.thisArg));
|
|
425
|
+
}, t;
|
|
426
|
+
}();
|
|
427
|
+
He.MapOperator = Dr;
|
|
428
|
+
var Fn = function(t) {
|
|
429
|
+
Hn(e, t);
|
|
430
|
+
function e(r, n, a) {
|
|
431
|
+
var i = t.call(this, r) || this;
|
|
432
|
+
return i.project = n, i.count = 0, i.thisArg = a || i, i;
|
|
433
|
+
}
|
|
434
|
+
return e.prototype._next = function(r) {
|
|
435
|
+
var n;
|
|
436
|
+
try {
|
|
437
|
+
n = this.project.call(this.thisArg, r, this.count++);
|
|
438
|
+
} catch (a) {
|
|
439
|
+
this.destination.error(a);
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
this.destination.next(n);
|
|
443
|
+
}, e;
|
|
444
|
+
}(Wn.Subscriber);
|
|
445
|
+
Se.map = He.map;
|
|
446
|
+
var Bn = function(t) {
|
|
447
|
+
var e = typeof t;
|
|
448
|
+
return t !== null && (e === "object" || e === "function");
|
|
449
|
+
}, Yn = Bn, ut = Object.prototype.hasOwnProperty, Xn = Object.prototype.propertyIsEnumerable;
|
|
450
|
+
function zn(t) {
|
|
451
|
+
if (t == null)
|
|
452
|
+
throw new TypeError("Sources cannot be null or undefined");
|
|
453
|
+
return Object(t);
|
|
454
|
+
}
|
|
455
|
+
function Lt(t, e, r) {
|
|
456
|
+
var n = e[r];
|
|
457
|
+
if (n != null) {
|
|
458
|
+
if (ut.call(t, r) && (t[r] === void 0 || t[r] === null))
|
|
459
|
+
throw new TypeError("Cannot convert undefined or null to object (" + r + ")");
|
|
460
|
+
!ut.call(t, r) || !Yn(n) ? t[r] = n : t[r] = qr(Object(t[r]), e[r]);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
function qr(t, e) {
|
|
464
|
+
if (t === e)
|
|
465
|
+
return t;
|
|
466
|
+
e = Object(e);
|
|
467
|
+
for (var r in e)
|
|
468
|
+
ut.call(e, r) && Lt(t, e, r);
|
|
469
|
+
if (Object.getOwnPropertySymbols)
|
|
470
|
+
for (var n = Object.getOwnPropertySymbols(e), a = 0; a < n.length; a++)
|
|
471
|
+
Xn.call(e, n[a]) && Lt(t, e, n[a]);
|
|
472
|
+
return t;
|
|
473
|
+
}
|
|
474
|
+
var Vn = function(e) {
|
|
475
|
+
e = zn(e);
|
|
476
|
+
for (var r = 1; r < arguments.length; r++)
|
|
477
|
+
qr(e, arguments[r]);
|
|
478
|
+
return e;
|
|
479
|
+
}, Mr = function(e) {
|
|
480
|
+
if (typeof e == "string" || Array.isArray(e))
|
|
481
|
+
return {
|
|
482
|
+
id: e
|
|
483
|
+
};
|
|
484
|
+
if (e && e.query)
|
|
485
|
+
return "params" in e ? {
|
|
486
|
+
query: e.query,
|
|
487
|
+
params: e.params
|
|
488
|
+
} : {
|
|
489
|
+
query: e.query
|
|
490
|
+
};
|
|
491
|
+
var r = ["* Document ID (<docId>)", "* Array of document IDs", "* Object containing `query`"].join(`
|
|
492
|
+
`);
|
|
493
|
+
throw new Error(`Unknown selection - must be one of:
|
|
494
|
+
|
|
495
|
+
`.concat(r));
|
|
496
|
+
}, te = {};
|
|
497
|
+
(function(t) {
|
|
498
|
+
function e(a) {
|
|
499
|
+
"@babel/helpers - typeof";
|
|
500
|
+
return e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
|
|
501
|
+
return typeof i;
|
|
502
|
+
} : function(i) {
|
|
503
|
+
return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
|
|
504
|
+
}, e(a);
|
|
505
|
+
}
|
|
506
|
+
var r = ["image", "file"], n = ["before", "after", "replace"];
|
|
507
|
+
t.dataset = function(a) {
|
|
508
|
+
if (!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(a))
|
|
509
|
+
throw new Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters");
|
|
510
|
+
}, t.projectId = function(a) {
|
|
511
|
+
if (!/^[-a-z0-9]+$/i.test(a))
|
|
512
|
+
throw new Error("`projectId` can only contain only a-z, 0-9 and dashes");
|
|
513
|
+
}, t.validateAssetType = function(a) {
|
|
514
|
+
if (r.indexOf(a) === -1)
|
|
515
|
+
throw new Error("Invalid asset type: ".concat(a, ". Must be one of ").concat(r.join(", ")));
|
|
516
|
+
}, t.validateObject = function(a, i) {
|
|
517
|
+
if (i === null || e(i) !== "object" || Array.isArray(i))
|
|
518
|
+
throw new Error("".concat(a, "() takes an object of properties"));
|
|
519
|
+
}, t.requireDocumentId = function(a, i) {
|
|
520
|
+
if (!i._id)
|
|
521
|
+
throw new Error("".concat(a, '() requires that the document contains an ID ("_id" property)'));
|
|
522
|
+
t.validateDocumentId(a, i._id);
|
|
523
|
+
}, t.validateDocumentId = function(a, i) {
|
|
524
|
+
if (typeof i != "string" || !/^[a-z0-9_.-]+$/i.test(i))
|
|
525
|
+
throw new Error("".concat(a, '(): "').concat(i, '" is not a valid document ID'));
|
|
526
|
+
}, t.validateInsert = function(a, i, o) {
|
|
527
|
+
var s = "insert(at, selector, items)";
|
|
528
|
+
if (n.indexOf(a) === -1) {
|
|
529
|
+
var u = n.map(function(c) {
|
|
530
|
+
return '"'.concat(c, '"');
|
|
531
|
+
}).join(", ");
|
|
532
|
+
throw new Error("".concat(s, ' takes an "at"-argument which is one of: ').concat(u));
|
|
533
|
+
}
|
|
534
|
+
if (typeof i != "string")
|
|
535
|
+
throw new Error("".concat(s, ' takes a "selector"-argument which must be a string'));
|
|
536
|
+
if (!Array.isArray(o))
|
|
537
|
+
throw new Error("".concat(s, ' takes an "items"-argument which must be an array'));
|
|
538
|
+
}, t.hasDataset = function(a) {
|
|
539
|
+
if (!a.gradientMode && !a.dataset)
|
|
540
|
+
throw new Error("`dataset` must be provided to perform queries");
|
|
541
|
+
return a.dataset || "";
|
|
542
|
+
}, t.requestTag = function(a) {
|
|
543
|
+
if (typeof a != "string" || !/^[a-z0-9._-]{1,75}$/i.test(a))
|
|
544
|
+
throw new Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");
|
|
545
|
+
return a;
|
|
546
|
+
};
|
|
547
|
+
})(te);
|
|
548
|
+
function Ge(t, e, r) {
|
|
549
|
+
return e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
550
|
+
}
|
|
551
|
+
var Gn = Vn, Z = D, Qn = Mr, Ar = te, je = Ar.validateObject, Jn = Ar.validateInsert;
|
|
552
|
+
function ct(t) {
|
|
553
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
|
|
554
|
+
this.selection = t, this.operations = Z({}, e), this.client = r;
|
|
555
|
+
}
|
|
556
|
+
Z(ct.prototype, {
|
|
557
|
+
clone: function() {
|
|
558
|
+
return new ct(this.selection, Z({}, this.operations), this.client);
|
|
559
|
+
},
|
|
560
|
+
merge: function(e) {
|
|
561
|
+
je("merge", e);
|
|
562
|
+
var r = new Error().stack.toString().split(`
|
|
563
|
+
`).filter(function(n) {
|
|
564
|
+
return n.trim();
|
|
565
|
+
}).slice(2);
|
|
566
|
+
return console.warn(`The "merge" patch has been deprecated and will be removed in the future
|
|
567
|
+
`.concat(r.join(`
|
|
568
|
+
`))), this._assign("merge", Gn(this.operations.merge || {}, e));
|
|
569
|
+
},
|
|
570
|
+
set: function(e) {
|
|
571
|
+
return this._assign("set", e);
|
|
572
|
+
},
|
|
573
|
+
diffMatchPatch: function(e) {
|
|
574
|
+
return je("diffMatchPatch", e), this._assign("diffMatchPatch", e);
|
|
575
|
+
},
|
|
576
|
+
unset: function(e) {
|
|
577
|
+
if (!Array.isArray(e))
|
|
578
|
+
throw new Error("unset(attrs) takes an array of attributes to unset, non-array given");
|
|
579
|
+
return this.operations = Z({}, this.operations, {
|
|
580
|
+
unset: e
|
|
581
|
+
}), this;
|
|
582
|
+
},
|
|
583
|
+
setIfMissing: function(e) {
|
|
584
|
+
return this._assign("setIfMissing", e);
|
|
585
|
+
},
|
|
586
|
+
replace: function(e) {
|
|
587
|
+
return je("replace", e), this._set("set", {
|
|
588
|
+
$: e
|
|
589
|
+
});
|
|
590
|
+
},
|
|
591
|
+
inc: function(e) {
|
|
592
|
+
return this._assign("inc", e);
|
|
593
|
+
},
|
|
594
|
+
dec: function(e) {
|
|
595
|
+
return this._assign("dec", e);
|
|
596
|
+
},
|
|
597
|
+
insert: function(e, r, n) {
|
|
598
|
+
var a;
|
|
599
|
+
return Jn(e, r, n), this._assign("insert", (a = {}, Ge(a, e, r), Ge(a, "items", n), a));
|
|
600
|
+
},
|
|
601
|
+
append: function(e, r) {
|
|
602
|
+
return this.insert("after", "".concat(e, "[-1]"), r);
|
|
603
|
+
},
|
|
604
|
+
prepend: function(e, r) {
|
|
605
|
+
return this.insert("before", "".concat(e, "[0]"), r);
|
|
606
|
+
},
|
|
607
|
+
splice: function(e, r, n, a) {
|
|
608
|
+
var i = typeof n > "u" || n === -1, o = r < 0 ? r - 1 : r, s = i ? -1 : Math.max(0, r + n), u = o < 0 && s >= 0 ? "" : s, c = "".concat(e, "[").concat(o, ":").concat(u, "]");
|
|
609
|
+
return this.insert("replace", c, a || []);
|
|
610
|
+
},
|
|
611
|
+
ifRevisionId: function(e) {
|
|
612
|
+
return this.operations.ifRevisionID = e, this;
|
|
613
|
+
},
|
|
614
|
+
serialize: function() {
|
|
615
|
+
return Z(Qn(this.selection), this.operations);
|
|
616
|
+
},
|
|
617
|
+
toJSON: function() {
|
|
618
|
+
return this.serialize();
|
|
619
|
+
},
|
|
620
|
+
commit: function() {
|
|
621
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
622
|
+
if (!this.client)
|
|
623
|
+
throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");
|
|
624
|
+
var r = typeof this.selection == "string", n = Z({
|
|
625
|
+
returnFirst: r,
|
|
626
|
+
returnDocuments: !0
|
|
627
|
+
}, e);
|
|
628
|
+
return this.client.mutate({
|
|
629
|
+
patch: this.serialize()
|
|
630
|
+
}, n);
|
|
631
|
+
},
|
|
632
|
+
reset: function() {
|
|
633
|
+
return this.operations = {}, this;
|
|
634
|
+
},
|
|
635
|
+
_set: function(e, r) {
|
|
636
|
+
return this._assign(e, r, !1);
|
|
637
|
+
},
|
|
638
|
+
_assign: function(e, r) {
|
|
639
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
|
|
640
|
+
return je(e, r), this.operations = Z({}, this.operations, Ge({}, e, Z({}, n && this.operations[e] || {}, r))), this;
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
var _t = ct;
|
|
644
|
+
function Ft(t, e, r) {
|
|
645
|
+
return e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
646
|
+
}
|
|
647
|
+
var Qe = D, ue = te, Je = _t, Kn = {
|
|
648
|
+
returnDocuments: !1
|
|
649
|
+
};
|
|
650
|
+
function ft() {
|
|
651
|
+
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 ? arguments[1] : void 0, r = arguments.length > 2 ? arguments[2] : void 0;
|
|
652
|
+
this.trxId = r, this.operations = t, this.client = e;
|
|
653
|
+
}
|
|
654
|
+
Qe(ft.prototype, {
|
|
655
|
+
clone: function() {
|
|
656
|
+
return new ft(this.operations.slice(0), this.client, this.trxId);
|
|
657
|
+
},
|
|
658
|
+
create: function(e) {
|
|
659
|
+
return ue.validateObject("create", e), this._add({
|
|
660
|
+
create: e
|
|
661
|
+
});
|
|
662
|
+
},
|
|
663
|
+
createIfNotExists: function(e) {
|
|
664
|
+
var r = "createIfNotExists";
|
|
665
|
+
return ue.validateObject(r, e), ue.requireDocumentId(r, e), this._add(Ft({}, r, e));
|
|
666
|
+
},
|
|
667
|
+
createOrReplace: function(e) {
|
|
668
|
+
var r = "createOrReplace";
|
|
669
|
+
return ue.validateObject(r, e), ue.requireDocumentId(r, e), this._add(Ft({}, r, e));
|
|
670
|
+
},
|
|
671
|
+
delete: function(e) {
|
|
672
|
+
return ue.validateDocumentId("delete", e), this._add({
|
|
673
|
+
delete: {
|
|
674
|
+
id: e
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
},
|
|
678
|
+
patch: function(e, r) {
|
|
679
|
+
var n = typeof r == "function", a = e instanceof Je;
|
|
680
|
+
if (a)
|
|
681
|
+
return this._add({
|
|
682
|
+
patch: e.serialize()
|
|
683
|
+
});
|
|
684
|
+
if (n) {
|
|
685
|
+
var i = r(new Je(e, {}, this.client));
|
|
686
|
+
if (!(i instanceof Je))
|
|
687
|
+
throw new Error("function passed to `patch()` must return the patch");
|
|
688
|
+
return this._add({
|
|
689
|
+
patch: i.serialize()
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
return this._add({
|
|
693
|
+
patch: Qe({
|
|
694
|
+
id: e
|
|
695
|
+
}, r)
|
|
696
|
+
});
|
|
697
|
+
},
|
|
698
|
+
transactionId: function(e) {
|
|
699
|
+
return e ? (this.trxId = e, this) : this.trxId;
|
|
700
|
+
},
|
|
701
|
+
serialize: function() {
|
|
702
|
+
return this.operations.slice();
|
|
703
|
+
},
|
|
704
|
+
toJSON: function() {
|
|
705
|
+
return this.serialize();
|
|
706
|
+
},
|
|
707
|
+
commit: function(e) {
|
|
708
|
+
if (!this.client)
|
|
709
|
+
throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");
|
|
710
|
+
return this.client.mutate(this.serialize(), Qe({
|
|
711
|
+
transactionId: this.trxId
|
|
712
|
+
}, Kn, e || {}));
|
|
713
|
+
},
|
|
714
|
+
reset: function() {
|
|
715
|
+
return this.operations = [], this;
|
|
716
|
+
},
|
|
717
|
+
_add: function(e) {
|
|
718
|
+
return this.operations.push(e), this;
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
var Rr = ft, Zn = ["tag"];
|
|
722
|
+
function ea(t, e) {
|
|
723
|
+
if (t == null)
|
|
724
|
+
return {};
|
|
725
|
+
var r = ta(t, e), n, a;
|
|
726
|
+
if (Object.getOwnPropertySymbols) {
|
|
727
|
+
var i = Object.getOwnPropertySymbols(t);
|
|
728
|
+
for (a = 0; a < i.length; a++)
|
|
729
|
+
n = i[a], !(e.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(t, n) && (r[n] = t[n]);
|
|
730
|
+
}
|
|
731
|
+
return r;
|
|
732
|
+
}
|
|
733
|
+
function ta(t, e) {
|
|
734
|
+
if (t == null)
|
|
735
|
+
return {};
|
|
736
|
+
var r = {}, n = Object.keys(t), a, i;
|
|
737
|
+
for (i = 0; i < n.length; i++)
|
|
738
|
+
a = n[i], !(e.indexOf(a) >= 0) && (r[a] = t[a]);
|
|
739
|
+
return r;
|
|
740
|
+
}
|
|
741
|
+
var ce = encodeURIComponent, Ir = function(t) {
|
|
742
|
+
var e = t.query, r = t.params, n = r === void 0 ? {} : r, a = t.options, i = a === void 0 ? {} : a, o = i.tag, s = ea(i, Zn), u = "query=".concat(ce(e)), c = o ? "?tag=".concat(ce(o), "&").concat(u) : "?".concat(u), g = Object.keys(n).reduce(function(d, p) {
|
|
743
|
+
return "".concat(d, "&").concat(ce("$".concat(p)), "=").concat(ce(JSON.stringify(n[p])));
|
|
744
|
+
}, c);
|
|
745
|
+
return Object.keys(s).reduce(function(d, p) {
|
|
746
|
+
return i[p] ? "".concat(d, "&").concat(ce(p), "=").concat(ce(i[p])) : d;
|
|
747
|
+
}, g);
|
|
748
|
+
}, We = {}, Ot = {};
|
|
749
|
+
Object.defineProperty(Ot, "__esModule", { value: !0 });
|
|
750
|
+
var ra = z;
|
|
751
|
+
function na(t) {
|
|
752
|
+
for (; t; ) {
|
|
753
|
+
var e = t, r = e.closed, n = e.destination, a = e.isStopped;
|
|
754
|
+
if (r || a)
|
|
755
|
+
return !1;
|
|
756
|
+
n && n instanceof ra.Subscriber ? t = n : t = null;
|
|
757
|
+
}
|
|
758
|
+
return !0;
|
|
759
|
+
}
|
|
760
|
+
Ot.canReportError = na;
|
|
761
|
+
var Et = {};
|
|
762
|
+
Object.defineProperty(Et, "__esModule", { value: !0 });
|
|
763
|
+
var Ke = z, Bt = wt, aa = ke;
|
|
764
|
+
function ia(t, e, r) {
|
|
765
|
+
if (t) {
|
|
766
|
+
if (t instanceof Ke.Subscriber)
|
|
767
|
+
return t;
|
|
768
|
+
if (t[Bt.rxSubscriber])
|
|
769
|
+
return t[Bt.rxSubscriber]();
|
|
770
|
+
}
|
|
771
|
+
return !t && !e && !r ? new Ke.Subscriber(aa.empty) : new Ke.Subscriber(t, e, r);
|
|
772
|
+
}
|
|
773
|
+
Et.toSubscriber = ia;
|
|
774
|
+
var St = {};
|
|
775
|
+
Object.defineProperty(St, "__esModule", { value: !0 });
|
|
776
|
+
St.observable = function() {
|
|
777
|
+
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
778
|
+
}();
|
|
779
|
+
var xe = {}, xt = {};
|
|
780
|
+
Object.defineProperty(xt, "__esModule", { value: !0 });
|
|
781
|
+
function oa(t) {
|
|
782
|
+
return t;
|
|
783
|
+
}
|
|
784
|
+
xt.identity = oa;
|
|
785
|
+
Object.defineProperty(xe, "__esModule", { value: !0 });
|
|
786
|
+
var sa = xt;
|
|
787
|
+
function ua() {
|
|
788
|
+
for (var t = [], e = 0; e < arguments.length; e++)
|
|
789
|
+
t[e] = arguments[e];
|
|
790
|
+
return $r(t);
|
|
791
|
+
}
|
|
792
|
+
xe.pipe = ua;
|
|
793
|
+
function $r(t) {
|
|
794
|
+
return t.length === 0 ? sa.identity : t.length === 1 ? t[0] : function(r) {
|
|
795
|
+
return t.reduce(function(n, a) {
|
|
796
|
+
return a(n);
|
|
797
|
+
}, r);
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
xe.pipeFromArray = $r;
|
|
801
|
+
Object.defineProperty(We, "__esModule", { value: !0 });
|
|
802
|
+
var ca = Ot, fa = Et, la = St, da = xe, Re = Ee, ha = function() {
|
|
803
|
+
function t(e) {
|
|
804
|
+
this._isScalar = !1, e && (this._subscribe = e);
|
|
805
|
+
}
|
|
806
|
+
return t.prototype.lift = function(e) {
|
|
807
|
+
var r = new t();
|
|
808
|
+
return r.source = this, r.operator = e, r;
|
|
809
|
+
}, t.prototype.subscribe = function(e, r, n) {
|
|
810
|
+
var a = this.operator, i = fa.toSubscriber(e, r, n);
|
|
811
|
+
if (a ? i.add(a.call(i, this.source)) : i.add(this.source || Re.config.useDeprecatedSynchronousErrorHandling && !i.syncErrorThrowable ? this._subscribe(i) : this._trySubscribe(i)), Re.config.useDeprecatedSynchronousErrorHandling && i.syncErrorThrowable && (i.syncErrorThrowable = !1, i.syncErrorThrown))
|
|
812
|
+
throw i.syncErrorValue;
|
|
813
|
+
return i;
|
|
814
|
+
}, t.prototype._trySubscribe = function(e) {
|
|
815
|
+
try {
|
|
816
|
+
return this._subscribe(e);
|
|
817
|
+
} catch (r) {
|
|
818
|
+
Re.config.useDeprecatedSynchronousErrorHandling && (e.syncErrorThrown = !0, e.syncErrorValue = r), ca.canReportError(e) ? e.error(r) : console.warn(r);
|
|
819
|
+
}
|
|
820
|
+
}, t.prototype.forEach = function(e, r) {
|
|
821
|
+
var n = this;
|
|
822
|
+
return r = Yt(r), new r(function(a, i) {
|
|
823
|
+
var o;
|
|
824
|
+
o = n.subscribe(function(s) {
|
|
825
|
+
try {
|
|
826
|
+
e(s);
|
|
827
|
+
} catch (u) {
|
|
828
|
+
i(u), o && o.unsubscribe();
|
|
829
|
+
}
|
|
830
|
+
}, i, a);
|
|
831
|
+
});
|
|
832
|
+
}, t.prototype._subscribe = function(e) {
|
|
833
|
+
var r = this.source;
|
|
834
|
+
return r && r.subscribe(e);
|
|
835
|
+
}, t.prototype[la.observable] = function() {
|
|
836
|
+
return this;
|
|
837
|
+
}, t.prototype.pipe = function() {
|
|
838
|
+
for (var e = [], r = 0; r < arguments.length; r++)
|
|
839
|
+
e[r] = arguments[r];
|
|
840
|
+
return e.length === 0 ? this : da.pipeFromArray(e)(this);
|
|
841
|
+
}, t.prototype.toPromise = function(e) {
|
|
842
|
+
var r = this;
|
|
843
|
+
return e = Yt(e), new e(function(n, a) {
|
|
844
|
+
var i;
|
|
845
|
+
r.subscribe(function(o) {
|
|
846
|
+
return i = o;
|
|
847
|
+
}, function(o) {
|
|
848
|
+
return a(o);
|
|
849
|
+
}, function() {
|
|
850
|
+
return n(i);
|
|
851
|
+
});
|
|
852
|
+
});
|
|
853
|
+
}, t.create = function(e) {
|
|
854
|
+
return new t(e);
|
|
855
|
+
}, t;
|
|
856
|
+
}();
|
|
857
|
+
We.Observable = ha;
|
|
858
|
+
function Yt(t) {
|
|
859
|
+
if (t || (t = Re.config.Promise || Promise), !t)
|
|
860
|
+
throw new Error("no Promise impl found");
|
|
861
|
+
return t;
|
|
862
|
+
}
|
|
863
|
+
var Ur = {}, Ct = {}, Pt = {}, pa = j && j.__extends || function() {
|
|
864
|
+
var t = function(e, r) {
|
|
865
|
+
return t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
|
866
|
+
n.__proto__ = a;
|
|
867
|
+
} || function(n, a) {
|
|
868
|
+
for (var i in a)
|
|
869
|
+
a.hasOwnProperty(i) && (n[i] = a[i]);
|
|
870
|
+
}, t(e, r);
|
|
871
|
+
};
|
|
872
|
+
return function(e, r) {
|
|
873
|
+
t(e, r);
|
|
874
|
+
function n() {
|
|
875
|
+
this.constructor = e;
|
|
876
|
+
}
|
|
877
|
+
e.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n());
|
|
878
|
+
};
|
|
879
|
+
}();
|
|
880
|
+
Object.defineProperty(Pt, "__esModule", { value: !0 });
|
|
881
|
+
var va = z;
|
|
882
|
+
function ma(t, e) {
|
|
883
|
+
var r = !1;
|
|
884
|
+
return arguments.length >= 2 && (r = !0), function(a) {
|
|
885
|
+
return a.lift(new ga(t, e, r));
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
Pt.scan = ma;
|
|
889
|
+
var ga = function() {
|
|
890
|
+
function t(e, r, n) {
|
|
891
|
+
n === void 0 && (n = !1), this.accumulator = e, this.seed = r, this.hasSeed = n;
|
|
892
|
+
}
|
|
893
|
+
return t.prototype.call = function(e, r) {
|
|
894
|
+
return r.subscribe(new ya(e, this.accumulator, this.seed, this.hasSeed));
|
|
895
|
+
}, t;
|
|
896
|
+
}(), ya = function(t) {
|
|
897
|
+
pa(e, t);
|
|
898
|
+
function e(r, n, a, i) {
|
|
899
|
+
var o = t.call(this, r) || this;
|
|
900
|
+
return o.accumulator = n, o._seed = a, o.hasSeed = i, o.index = 0, o;
|
|
901
|
+
}
|
|
902
|
+
return Object.defineProperty(e.prototype, "seed", {
|
|
903
|
+
get: function() {
|
|
904
|
+
return this._seed;
|
|
905
|
+
},
|
|
906
|
+
set: function(r) {
|
|
907
|
+
this.hasSeed = !0, this._seed = r;
|
|
908
|
+
},
|
|
909
|
+
enumerable: !0,
|
|
910
|
+
configurable: !0
|
|
911
|
+
}), e.prototype._next = function(r) {
|
|
912
|
+
if (!this.hasSeed)
|
|
913
|
+
this.seed = r, this.destination.next(r);
|
|
914
|
+
else
|
|
915
|
+
return this._tryNext(r);
|
|
916
|
+
}, e.prototype._tryNext = function(r) {
|
|
917
|
+
var n = this.index++, a;
|
|
918
|
+
try {
|
|
919
|
+
a = this.accumulator(this.seed, r, n);
|
|
920
|
+
} catch (i) {
|
|
921
|
+
this.destination.error(i);
|
|
922
|
+
}
|
|
923
|
+
this.seed = a, this.destination.next(a);
|
|
924
|
+
}, e;
|
|
925
|
+
}(va.Subscriber), Tt = {}, jt = {};
|
|
926
|
+
Object.defineProperty(jt, "__esModule", { value: !0 });
|
|
927
|
+
var ba = function() {
|
|
928
|
+
function t() {
|
|
929
|
+
return Error.call(this), this.message = "argument out of range", this.name = "ArgumentOutOfRangeError", this;
|
|
930
|
+
}
|
|
931
|
+
return t.prototype = Object.create(Error.prototype), t;
|
|
932
|
+
}();
|
|
933
|
+
jt.ArgumentOutOfRangeError = ba;
|
|
934
|
+
var kr = {};
|
|
935
|
+
(function(t) {
|
|
936
|
+
Object.defineProperty(t, "__esModule", { value: !0 });
|
|
937
|
+
var e = We;
|
|
938
|
+
t.EMPTY = new e.Observable(function(a) {
|
|
939
|
+
return a.complete();
|
|
940
|
+
});
|
|
941
|
+
function r(a) {
|
|
942
|
+
return a ? n(a) : t.EMPTY;
|
|
943
|
+
}
|
|
944
|
+
t.empty = r;
|
|
945
|
+
function n(a) {
|
|
946
|
+
return new e.Observable(function(i) {
|
|
947
|
+
return a.schedule(function() {
|
|
948
|
+
return i.complete();
|
|
949
|
+
});
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
})(kr);
|
|
953
|
+
var wa = j && j.__extends || function() {
|
|
954
|
+
var t = function(e, r) {
|
|
955
|
+
return t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
|
956
|
+
n.__proto__ = a;
|
|
957
|
+
} || function(n, a) {
|
|
958
|
+
for (var i in a)
|
|
959
|
+
a.hasOwnProperty(i) && (n[i] = a[i]);
|
|
960
|
+
}, t(e, r);
|
|
961
|
+
};
|
|
962
|
+
return function(e, r) {
|
|
963
|
+
t(e, r);
|
|
964
|
+
function n() {
|
|
965
|
+
this.constructor = e;
|
|
966
|
+
}
|
|
967
|
+
e.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n());
|
|
968
|
+
};
|
|
969
|
+
}();
|
|
970
|
+
Object.defineProperty(Tt, "__esModule", { value: !0 });
|
|
971
|
+
var _a = z, Oa = jt, Ea = kr;
|
|
972
|
+
function Sa(t) {
|
|
973
|
+
return function(r) {
|
|
974
|
+
return t === 0 ? Ea.empty() : r.lift(new xa(t));
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
Tt.takeLast = Sa;
|
|
978
|
+
var xa = function() {
|
|
979
|
+
function t(e) {
|
|
980
|
+
if (this.total = e, this.total < 0)
|
|
981
|
+
throw new Oa.ArgumentOutOfRangeError();
|
|
982
|
+
}
|
|
983
|
+
return t.prototype.call = function(e, r) {
|
|
984
|
+
return r.subscribe(new Ca(e, this.total));
|
|
985
|
+
}, t;
|
|
986
|
+
}(), Ca = function(t) {
|
|
987
|
+
wa(e, t);
|
|
988
|
+
function e(r, n) {
|
|
989
|
+
var a = t.call(this, r) || this;
|
|
990
|
+
return a.total = n, a.ring = new Array(), a.count = 0, a;
|
|
991
|
+
}
|
|
992
|
+
return e.prototype._next = function(r) {
|
|
993
|
+
var n = this.ring, a = this.total, i = this.count++;
|
|
994
|
+
if (n.length < a)
|
|
995
|
+
n.push(r);
|
|
996
|
+
else {
|
|
997
|
+
var o = i % a;
|
|
998
|
+
n[o] = r;
|
|
999
|
+
}
|
|
1000
|
+
}, e.prototype._complete = function() {
|
|
1001
|
+
var r = this.destination, n = this.count;
|
|
1002
|
+
if (n > 0)
|
|
1003
|
+
for (var a = this.count >= this.total ? this.total : this.count, i = this.ring, o = 0; o < a; o++) {
|
|
1004
|
+
var s = n++ % a;
|
|
1005
|
+
r.next(i[s]);
|
|
1006
|
+
}
|
|
1007
|
+
r.complete();
|
|
1008
|
+
}, e;
|
|
1009
|
+
}(_a.Subscriber), Dt = {}, Pa = j && j.__extends || function() {
|
|
1010
|
+
var t = function(e, r) {
|
|
1011
|
+
return t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
|
1012
|
+
n.__proto__ = a;
|
|
1013
|
+
} || function(n, a) {
|
|
1014
|
+
for (var i in a)
|
|
1015
|
+
a.hasOwnProperty(i) && (n[i] = a[i]);
|
|
1016
|
+
}, t(e, r);
|
|
1017
|
+
};
|
|
1018
|
+
return function(e, r) {
|
|
1019
|
+
t(e, r);
|
|
1020
|
+
function n() {
|
|
1021
|
+
this.constructor = e;
|
|
1022
|
+
}
|
|
1023
|
+
e.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n());
|
|
1024
|
+
};
|
|
1025
|
+
}();
|
|
1026
|
+
Object.defineProperty(Dt, "__esModule", { value: !0 });
|
|
1027
|
+
var Ta = z;
|
|
1028
|
+
function ja(t) {
|
|
1029
|
+
return t === void 0 && (t = null), function(e) {
|
|
1030
|
+
return e.lift(new Da(t));
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
Dt.defaultIfEmpty = ja;
|
|
1034
|
+
var Da = function() {
|
|
1035
|
+
function t(e) {
|
|
1036
|
+
this.defaultValue = e;
|
|
1037
|
+
}
|
|
1038
|
+
return t.prototype.call = function(e, r) {
|
|
1039
|
+
return r.subscribe(new qa(e, this.defaultValue));
|
|
1040
|
+
}, t;
|
|
1041
|
+
}(), qa = function(t) {
|
|
1042
|
+
Pa(e, t);
|
|
1043
|
+
function e(r, n) {
|
|
1044
|
+
var a = t.call(this, r) || this;
|
|
1045
|
+
return a.defaultValue = n, a.isEmpty = !0, a;
|
|
1046
|
+
}
|
|
1047
|
+
return e.prototype._next = function(r) {
|
|
1048
|
+
this.isEmpty = !1, this.destination.next(r);
|
|
1049
|
+
}, e.prototype._complete = function() {
|
|
1050
|
+
this.isEmpty && this.destination.next(this.defaultValue), this.destination.complete();
|
|
1051
|
+
}, e;
|
|
1052
|
+
}(Ta.Subscriber);
|
|
1053
|
+
Object.defineProperty(Ct, "__esModule", { value: !0 });
|
|
1054
|
+
var Xt = Pt, zt = Tt, Ma = Dt, Vt = xe;
|
|
1055
|
+
function Aa(t, e) {
|
|
1056
|
+
return arguments.length >= 2 ? function(n) {
|
|
1057
|
+
return Vt.pipe(Xt.scan(t, e), zt.takeLast(1), Ma.defaultIfEmpty(e))(n);
|
|
1058
|
+
} : function(n) {
|
|
1059
|
+
return Vt.pipe(Xt.scan(function(a, i, o) {
|
|
1060
|
+
return t(a, i, o + 1);
|
|
1061
|
+
}), zt.takeLast(1))(n);
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
Ct.reduce = Aa;
|
|
1065
|
+
Ur.reduce = Ct.reduce;
|
|
1066
|
+
var Ra = We, Nr = Ra.Observable, Ia = D, $a = Se, Ua = $a.map, ka = Oe, Na = ka.filter, Ha = Ur, Wa = Ha.reduce;
|
|
1067
|
+
function J() {
|
|
1068
|
+
Nr.apply(this, arguments);
|
|
1069
|
+
}
|
|
1070
|
+
J.prototype = Object.create(Ia(/* @__PURE__ */ Object.create(null), Nr.prototype));
|
|
1071
|
+
Object.defineProperty(J.prototype, "constructor", {
|
|
1072
|
+
value: J,
|
|
1073
|
+
enumerable: !1,
|
|
1074
|
+
writable: !0,
|
|
1075
|
+
configurable: !0
|
|
1076
|
+
});
|
|
1077
|
+
J.prototype.lift = function(e) {
|
|
1078
|
+
var r = new J();
|
|
1079
|
+
return r.source = this, r.operator = e, r;
|
|
1080
|
+
};
|
|
1081
|
+
function qt(t, e) {
|
|
1082
|
+
var r = !1;
|
|
1083
|
+
return function() {
|
|
1084
|
+
return r || (r = !0, console.warn(new Error("Calling observable.".concat(t, "(...) is deprecated. Please use observable.pipe(").concat(t, "(...)) instead")))), this.pipe(e.apply(this, arguments));
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
J.prototype.map = qt("map", Ua);
|
|
1088
|
+
J.prototype.filter = qt("filter", Na);
|
|
1089
|
+
J.prototype.reduce = qt("filter", Wa);
|
|
1090
|
+
var La = J, Hr = La, Wr = { exports: {} };
|
|
1091
|
+
(function(t) {
|
|
1092
|
+
(function(e, r) {
|
|
1093
|
+
if (t.exports)
|
|
1094
|
+
t.exports = r();
|
|
1095
|
+
else {
|
|
1096
|
+
if (j.EventSource && !j._eventSourceImportPrefix)
|
|
1097
|
+
return;
|
|
1098
|
+
var n = (e._eventSourceImportPrefix || "") + "EventSource";
|
|
1099
|
+
e[n] = r();
|
|
1100
|
+
}
|
|
1101
|
+
})(typeof self > "u" ? j : self, function() {
|
|
1102
|
+
var e = function(i, o) {
|
|
1103
|
+
if (!i || typeof i != "string")
|
|
1104
|
+
throw new SyntaxError("Not enough arguments");
|
|
1105
|
+
this.URL = i, this.setOptions(o);
|
|
1106
|
+
var s = this;
|
|
1107
|
+
setTimeout(function() {
|
|
1108
|
+
s.poll();
|
|
1109
|
+
}, 0);
|
|
1110
|
+
};
|
|
1111
|
+
if (e.prototype = {
|
|
1112
|
+
CONNECTING: 0,
|
|
1113
|
+
OPEN: 1,
|
|
1114
|
+
CLOSED: 2,
|
|
1115
|
+
defaultOptions: {
|
|
1116
|
+
loggingEnabled: !1,
|
|
1117
|
+
loggingPrefix: "eventsource",
|
|
1118
|
+
interval: 500,
|
|
1119
|
+
// milliseconds
|
|
1120
|
+
bufferSizeLimit: 256 * 1024,
|
|
1121
|
+
// bytes
|
|
1122
|
+
silentTimeout: 3e5,
|
|
1123
|
+
// milliseconds
|
|
1124
|
+
getArgs: {
|
|
1125
|
+
evs_buffer_size_limit: 256 * 1024
|
|
1126
|
+
},
|
|
1127
|
+
xhrHeaders: {
|
|
1128
|
+
Accept: "text/event-stream",
|
|
1129
|
+
"Cache-Control": "no-cache",
|
|
1130
|
+
"X-Requested-With": "XMLHttpRequest"
|
|
1131
|
+
}
|
|
1132
|
+
},
|
|
1133
|
+
setOptions: function(i) {
|
|
1134
|
+
var o = this.defaultOptions, s;
|
|
1135
|
+
for (s in o)
|
|
1136
|
+
o.hasOwnProperty(s) && (this[s] = o[s]);
|
|
1137
|
+
for (s in i)
|
|
1138
|
+
s in o && i.hasOwnProperty(s) && (this[s] = i[s]);
|
|
1139
|
+
this.getArgs && this.bufferSizeLimit && (this.getArgs.evs_buffer_size_limit = this.bufferSizeLimit), (typeof console > "u" || typeof console.log > "u") && (this.loggingEnabled = !1);
|
|
1140
|
+
},
|
|
1141
|
+
log: function(i) {
|
|
1142
|
+
this.loggingEnabled && console.log("[" + this.loggingPrefix + "]:" + i);
|
|
1143
|
+
},
|
|
1144
|
+
poll: function() {
|
|
1145
|
+
try {
|
|
1146
|
+
if (this.readyState == this.CLOSED)
|
|
1147
|
+
return;
|
|
1148
|
+
this.cleanup(), this.readyState = this.CONNECTING, this.cursor = 0, this.cache = "", this._xhr = new this.XHR(this), this.resetNoActivityTimer();
|
|
1149
|
+
} catch (i) {
|
|
1150
|
+
this.log("There were errors inside the pool try-catch"), this.dispatchEvent("error", { type: "error", data: i.message });
|
|
1151
|
+
}
|
|
1152
|
+
},
|
|
1153
|
+
pollAgain: function(i) {
|
|
1154
|
+
var o = this;
|
|
1155
|
+
o.readyState = o.CONNECTING, o.dispatchEvent("error", {
|
|
1156
|
+
type: "error",
|
|
1157
|
+
data: "Reconnecting "
|
|
1158
|
+
}), this._pollTimer = setTimeout(function() {
|
|
1159
|
+
o.poll();
|
|
1160
|
+
}, i || 0);
|
|
1161
|
+
},
|
|
1162
|
+
cleanup: function() {
|
|
1163
|
+
this.log("evs cleaning up"), this._pollTimer && (clearInterval(this._pollTimer), this._pollTimer = null), this._noActivityTimer && (clearInterval(this._noActivityTimer), this._noActivityTimer = null), this._xhr && (this._xhr.abort(), this._xhr = null);
|
|
1164
|
+
},
|
|
1165
|
+
resetNoActivityTimer: function() {
|
|
1166
|
+
if (this.silentTimeout) {
|
|
1167
|
+
this._noActivityTimer && clearInterval(this._noActivityTimer);
|
|
1168
|
+
var i = this;
|
|
1169
|
+
this._noActivityTimer = setTimeout(function() {
|
|
1170
|
+
i.log("Timeout! silentTImeout:" + i.silentTimeout), i.pollAgain();
|
|
1171
|
+
}, this.silentTimeout);
|
|
1172
|
+
}
|
|
1173
|
+
},
|
|
1174
|
+
close: function() {
|
|
1175
|
+
this.readyState = this.CLOSED, this.log("Closing connection. readyState: " + this.readyState), this.cleanup();
|
|
1176
|
+
},
|
|
1177
|
+
_onxhrdata: function() {
|
|
1178
|
+
var i = this._xhr;
|
|
1179
|
+
if (i.isReady() && !i.hasError()) {
|
|
1180
|
+
this.resetNoActivityTimer(), this.readyState == this.CONNECTING && (this.readyState = this.OPEN, this.dispatchEvent("open", { type: "open" }));
|
|
1181
|
+
var o = i.getBuffer();
|
|
1182
|
+
o.length > this.bufferSizeLimit && (this.log("buffer.length > this.bufferSizeLimit"), this.pollAgain()), this.cursor == 0 && o.length > 0 && o.substring(0, 1) == "\uFEFF" && (this.cursor = 1);
|
|
1183
|
+
var s = this.lastMessageIndex(o);
|
|
1184
|
+
if (s[0] >= this.cursor) {
|
|
1185
|
+
var u = s[1], c = o.substring(this.cursor, u);
|
|
1186
|
+
this.parseStream(c), this.cursor = u;
|
|
1187
|
+
}
|
|
1188
|
+
i.isDone() && (this.log("request.isDone(). reopening the connection"), this.pollAgain(this.interval));
|
|
1189
|
+
} else
|
|
1190
|
+
this.readyState !== this.CLOSED && (this.log("this.readyState !== this.CLOSED"), this.pollAgain(this.interval));
|
|
1191
|
+
},
|
|
1192
|
+
parseStream: function(i) {
|
|
1193
|
+
i = this.cache + this.normalizeToLF(i);
|
|
1194
|
+
var o = i.split(`
|
|
1195
|
+
|
|
1196
|
+
`), s, u, c, g, d, p;
|
|
1197
|
+
for (s = 0; s < o.length - 1; s++) {
|
|
1198
|
+
c = "message", g = [];
|
|
1199
|
+
var x = o[s].split(`
|
|
1200
|
+
`);
|
|
1201
|
+
for (u = 0; u < x.length; u++)
|
|
1202
|
+
d = this.trimWhiteSpace(x[u]), d.indexOf("event") == 0 ? c = d.replace(/event:?\s*/, "") : d.indexOf("retry") == 0 ? (p = parseInt(d.replace(/retry:?\s*/, ""), 10), isNaN(p) || (this.interval = p)) : d.indexOf("data") == 0 ? g.push(d.replace(/data:?\s*/, "")) : d.indexOf("id:") == 0 ? this.lastEventId = d.replace(/id:?\s*/, "") : d.indexOf("id") == 0 && (this.lastEventId = null);
|
|
1203
|
+
if (g.length && this.readyState != this.CLOSED) {
|
|
1204
|
+
var C = new n(
|
|
1205
|
+
c,
|
|
1206
|
+
g.join(`
|
|
1207
|
+
`),
|
|
1208
|
+
typeof window < "u" && typeof window.location < "u" ? window.location.origin : null,
|
|
1209
|
+
this.lastEventId
|
|
1210
|
+
);
|
|
1211
|
+
this.dispatchEvent(c, C);
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
this.cache = o[o.length - 1];
|
|
1215
|
+
},
|
|
1216
|
+
dispatchEvent: function(i, o) {
|
|
1217
|
+
var s = this["_" + i + "Handlers"];
|
|
1218
|
+
if (s)
|
|
1219
|
+
for (var u = 0; u < s.length; u++)
|
|
1220
|
+
s[u].call(this, o);
|
|
1221
|
+
this["on" + i] && this["on" + i].call(this, o);
|
|
1222
|
+
},
|
|
1223
|
+
addEventListener: function(i, o) {
|
|
1224
|
+
this["_" + i + "Handlers"] || (this["_" + i + "Handlers"] = []), this["_" + i + "Handlers"].push(o);
|
|
1225
|
+
},
|
|
1226
|
+
removeEventListener: function(i, o) {
|
|
1227
|
+
var s = this["_" + i + "Handlers"];
|
|
1228
|
+
if (s) {
|
|
1229
|
+
for (var u = s.length - 1; u >= 0; --u)
|
|
1230
|
+
if (s[u] === o) {
|
|
1231
|
+
s.splice(u, 1);
|
|
1232
|
+
break;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
},
|
|
1236
|
+
_pollTimer: null,
|
|
1237
|
+
_noactivityTimer: null,
|
|
1238
|
+
_xhr: null,
|
|
1239
|
+
lastEventId: null,
|
|
1240
|
+
cache: "",
|
|
1241
|
+
cursor: 0,
|
|
1242
|
+
onerror: null,
|
|
1243
|
+
onmessage: null,
|
|
1244
|
+
onopen: null,
|
|
1245
|
+
readyState: 0,
|
|
1246
|
+
// ===================================================================
|
|
1247
|
+
// helpers functions
|
|
1248
|
+
// those are attached to prototype to ease reuse and testing...
|
|
1249
|
+
urlWithParams: function(i, o) {
|
|
1250
|
+
var s = [];
|
|
1251
|
+
if (o) {
|
|
1252
|
+
var u, c, g = encodeURIComponent;
|
|
1253
|
+
for (u in o)
|
|
1254
|
+
o.hasOwnProperty(u) && (c = g(u) + "=" + g(o[u]), s.push(c));
|
|
1255
|
+
}
|
|
1256
|
+
return s.length > 0 ? i.indexOf("?") == -1 ? i + "?" + s.join("&") : i + "&" + s.join("&") : i;
|
|
1257
|
+
},
|
|
1258
|
+
lastMessageIndex: function(i) {
|
|
1259
|
+
var o = i.lastIndexOf(`
|
|
1260
|
+
|
|
1261
|
+
`), s = i.lastIndexOf("\r\r"), u = i.lastIndexOf(`\r
|
|
1262
|
+
\r
|
|
1263
|
+
`);
|
|
1264
|
+
return u > Math.max(o, s) ? [u, u + 4] : [Math.max(o, s), Math.max(o, s) + 2];
|
|
1265
|
+
},
|
|
1266
|
+
trimWhiteSpace: function(i) {
|
|
1267
|
+
var o = /^(\s|\u00A0)+|(\s|\u00A0)+$/g;
|
|
1268
|
+
return i.replace(o, "");
|
|
1269
|
+
},
|
|
1270
|
+
normalizeToLF: function(i) {
|
|
1271
|
+
return i.replace(/\r\n|\r/g, `
|
|
1272
|
+
`);
|
|
1273
|
+
}
|
|
1274
|
+
}, a()) {
|
|
1275
|
+
e.isPolyfill = "IE_8-9";
|
|
1276
|
+
var r = e.prototype.defaultOptions;
|
|
1277
|
+
r.xhrHeaders = null, r.getArgs.evs_preamble = 2048 + 8, e.prototype.XHR = function(i) {
|
|
1278
|
+
var o = new XDomainRequest();
|
|
1279
|
+
this._request = o, o.onprogress = function() {
|
|
1280
|
+
o._ready = !0, i._onxhrdata();
|
|
1281
|
+
}, o.onload = function() {
|
|
1282
|
+
this._loaded = !0, i._onxhrdata();
|
|
1283
|
+
}, o.onerror = function() {
|
|
1284
|
+
this._failed = !0, i.readyState = i.CLOSED, i.dispatchEvent("error", {
|
|
1285
|
+
type: "error",
|
|
1286
|
+
data: "XDomainRequest error"
|
|
1287
|
+
});
|
|
1288
|
+
}, o.ontimeout = function() {
|
|
1289
|
+
this._failed = !0, i.readyState = i.CLOSED, i.dispatchEvent("error", {
|
|
1290
|
+
type: "error",
|
|
1291
|
+
data: "XDomainRequest timed out"
|
|
1292
|
+
});
|
|
1293
|
+
};
|
|
1294
|
+
var s = {};
|
|
1295
|
+
if (i.getArgs) {
|
|
1296
|
+
var u = i.getArgs;
|
|
1297
|
+
for (var c in u)
|
|
1298
|
+
u.hasOwnProperty(c) && (s[c] = u[c]);
|
|
1299
|
+
i.lastEventId && (s.evs_last_event_id = i.lastEventId);
|
|
1300
|
+
}
|
|
1301
|
+
o.open("GET", i.urlWithParams(i.URL, s)), o.send();
|
|
1302
|
+
}, e.prototype.XHR.prototype = {
|
|
1303
|
+
useXDomainRequest: !0,
|
|
1304
|
+
_request: null,
|
|
1305
|
+
_ready: !1,
|
|
1306
|
+
// true when progress events are dispatched
|
|
1307
|
+
_loaded: !1,
|
|
1308
|
+
// true when request has been loaded
|
|
1309
|
+
_failed: !1,
|
|
1310
|
+
// true if when request is in error
|
|
1311
|
+
isReady: function() {
|
|
1312
|
+
return this._request._ready;
|
|
1313
|
+
},
|
|
1314
|
+
isDone: function() {
|
|
1315
|
+
return this._request._loaded;
|
|
1316
|
+
},
|
|
1317
|
+
hasError: function() {
|
|
1318
|
+
return this._request._failed;
|
|
1319
|
+
},
|
|
1320
|
+
getBuffer: function() {
|
|
1321
|
+
var i = "";
|
|
1322
|
+
try {
|
|
1323
|
+
i = this._request.responseText || "";
|
|
1324
|
+
} catch {
|
|
1325
|
+
}
|
|
1326
|
+
return i;
|
|
1327
|
+
},
|
|
1328
|
+
abort: function() {
|
|
1329
|
+
this._request && this._request.abort();
|
|
1330
|
+
}
|
|
1331
|
+
};
|
|
1332
|
+
} else
|
|
1333
|
+
e.isPolyfill = "XHR", e.prototype.XHR = function(i) {
|
|
1334
|
+
var o = new XMLHttpRequest();
|
|
1335
|
+
this._request = o, i._xhr = this, o.onreadystatechange = function() {
|
|
1336
|
+
o.readyState > 1 && i.readyState != i.CLOSED && (o.status == 200 || o.status >= 300 && o.status < 400 ? i._onxhrdata() : (o._failed = !0, i.readyState = i.CLOSED, i.dispatchEvent("error", {
|
|
1337
|
+
type: "error",
|
|
1338
|
+
data: "The server responded with " + o.status
|
|
1339
|
+
}), i.close()));
|
|
1340
|
+
}, o.onprogress = function() {
|
|
1341
|
+
}, o.open("GET", i.urlWithParams(i.URL, i.getArgs), !0);
|
|
1342
|
+
var s = i.xhrHeaders;
|
|
1343
|
+
for (var u in s)
|
|
1344
|
+
s.hasOwnProperty(u) && o.setRequestHeader(u, s[u]);
|
|
1345
|
+
i.lastEventId && o.setRequestHeader("Last-Event-Id", i.lastEventId), o.send();
|
|
1346
|
+
}, e.prototype.XHR.prototype = {
|
|
1347
|
+
useXDomainRequest: !1,
|
|
1348
|
+
_request: null,
|
|
1349
|
+
_failed: !1,
|
|
1350
|
+
// true if we have had errors...
|
|
1351
|
+
isReady: function() {
|
|
1352
|
+
return this._request.readyState >= 2;
|
|
1353
|
+
},
|
|
1354
|
+
isDone: function() {
|
|
1355
|
+
return this._request.readyState == 4;
|
|
1356
|
+
},
|
|
1357
|
+
hasError: function() {
|
|
1358
|
+
return this._failed || this._request.status >= 400;
|
|
1359
|
+
},
|
|
1360
|
+
getBuffer: function() {
|
|
1361
|
+
var i = "";
|
|
1362
|
+
try {
|
|
1363
|
+
i = this._request.responseText || "";
|
|
1364
|
+
} catch {
|
|
1365
|
+
}
|
|
1366
|
+
return i;
|
|
1367
|
+
},
|
|
1368
|
+
abort: function() {
|
|
1369
|
+
this._request && this._request.abort();
|
|
1370
|
+
}
|
|
1371
|
+
};
|
|
1372
|
+
function n(i, o, s, u) {
|
|
1373
|
+
this.bubbles = !1, this.cancelBubble = !1, this.cancelable = !1, this.data = o || null, this.origin = s || "", this.lastEventId = u || "", this.type = i || "message";
|
|
1374
|
+
}
|
|
1375
|
+
function a() {
|
|
1376
|
+
return !!(typeof window < "u" && window.XDomainRequest && window.XMLHttpRequest && new XMLHttpRequest().responseType === void 0);
|
|
1377
|
+
}
|
|
1378
|
+
return e;
|
|
1379
|
+
});
|
|
1380
|
+
})(Wr);
|
|
1381
|
+
var Fa = Wr.exports, Ba = Fa, Ya = typeof window > "u" || !window.EventSource ? (
|
|
1382
|
+
// Use polyfill in non-browser/legacy environments
|
|
1383
|
+
Ba.EventSource
|
|
1384
|
+
) : (
|
|
1385
|
+
// Use native EventSource when we can
|
|
1386
|
+
window.EventSource
|
|
1387
|
+
), Xa = "https://docs.sanity.io/help/", Mt = function(e) {
|
|
1388
|
+
return Xa + e;
|
|
1389
|
+
}, za = function(t, e) {
|
|
1390
|
+
return e.reduce(function(r, n) {
|
|
1391
|
+
return typeof t[n] > "u" || (r[n] = t[n]), r;
|
|
1392
|
+
}, {});
|
|
1393
|
+
}, Lr = function(t) {
|
|
1394
|
+
var e = !1, r;
|
|
1395
|
+
return function() {
|
|
1396
|
+
return e || (r = t.apply(void 0, arguments), e = !0), r;
|
|
1397
|
+
};
|
|
1398
|
+
}, Va = function(t, e) {
|
|
1399
|
+
return Object.keys(e).concat(Object.keys(t)).reduce(function(r, n) {
|
|
1400
|
+
return r[n] = typeof t[n] > "u" ? e[n] : t[n], r;
|
|
1401
|
+
}, {});
|
|
1402
|
+
};
|
|
1403
|
+
function Gt(t, e) {
|
|
1404
|
+
var r = Object.keys(t);
|
|
1405
|
+
if (Object.getOwnPropertySymbols) {
|
|
1406
|
+
var n = Object.getOwnPropertySymbols(t);
|
|
1407
|
+
e && (n = n.filter(function(a) {
|
|
1408
|
+
return Object.getOwnPropertyDescriptor(t, a).enumerable;
|
|
1409
|
+
})), r.push.apply(r, n);
|
|
1410
|
+
}
|
|
1411
|
+
return r;
|
|
1412
|
+
}
|
|
1413
|
+
function Qt(t) {
|
|
1414
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
1415
|
+
var r = arguments[e] != null ? arguments[e] : {};
|
|
1416
|
+
e % 2 ? Gt(Object(r), !0).forEach(function(n) {
|
|
1417
|
+
Ga(t, n, r[n]);
|
|
1418
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : Gt(Object(r)).forEach(function(n) {
|
|
1419
|
+
Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(r, n));
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
return t;
|
|
1423
|
+
}
|
|
1424
|
+
function Ga(t, e, r) {
|
|
1425
|
+
return e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1426
|
+
}
|
|
1427
|
+
var Qa = D, Jt = Hr, Ja = Ya, Ka = Mt, Za = za, ei = Lr, ti = Va, ri = Ir, ni = 16e3 - 1200, ai = ["Using token with listeners is not supported in browsers. ", "For more info, see ".concat(Ka("js-client-listener-tokens-browser"), ".")], ii = ei(function() {
|
|
1428
|
+
return console.warn(ai.join(" "));
|
|
1429
|
+
}), Fr = !!(typeof window < "u" && window.EventSource), Kt = Fr ? window.EventSource : Ja, oi = ["includePreviousRevision", "includeResult", "visibility", "effectFormat", "tag"], si = {
|
|
1430
|
+
includeResult: !0
|
|
1431
|
+
}, ui = function(e, r) {
|
|
1432
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = this.clientConfig, i = a.url, o = a.token, s = a.withCredentials, u = a.requestTagPrefix, c = n.tag && u ? [u, n.tag].join(".") : n.tag, g = Qt(Qt({}, ti(n, si)), {}, {
|
|
1433
|
+
tag: c
|
|
1434
|
+
}), d = Za(g, oi), p = ri({
|
|
1435
|
+
query: e,
|
|
1436
|
+
params: r,
|
|
1437
|
+
options: d,
|
|
1438
|
+
tag: c
|
|
1439
|
+
}), x = "".concat(i).concat(this.getDataUrl("listen", p));
|
|
1440
|
+
if (x.length > ni)
|
|
1441
|
+
return new Jt(function(b) {
|
|
1442
|
+
return b.error(new Error("Query too large for listener"));
|
|
1443
|
+
});
|
|
1444
|
+
var C = g.events ? g.events : ["mutation"], E = C.indexOf("reconnect") !== -1;
|
|
1445
|
+
o && Fr && ii();
|
|
1446
|
+
var O = {};
|
|
1447
|
+
return (o || s) && (O.withCredentials = !0), o && (O.headers = {
|
|
1448
|
+
Authorization: "Bearer ".concat(o)
|
|
1449
|
+
}), new Jt(function(b) {
|
|
1450
|
+
var _ = l(), T, $ = !1;
|
|
1451
|
+
function F() {
|
|
1452
|
+
$ || (R(), !$ && _.readyState === Kt.CLOSED && (q(), clearTimeout(T), T = setTimeout(h, 100)));
|
|
1453
|
+
}
|
|
1454
|
+
function V(f) {
|
|
1455
|
+
b.error(ci(f));
|
|
1456
|
+
}
|
|
1457
|
+
function ie(f) {
|
|
1458
|
+
var w = Br(f);
|
|
1459
|
+
return w instanceof Error ? b.error(w) : b.next(w);
|
|
1460
|
+
}
|
|
1461
|
+
function oe(f) {
|
|
1462
|
+
$ = !0, q(), b.complete();
|
|
1463
|
+
}
|
|
1464
|
+
function q() {
|
|
1465
|
+
_.removeEventListener("error", F, !1), _.removeEventListener("channelError", V, !1), _.removeEventListener("disconnect", oe, !1), C.forEach(function(f) {
|
|
1466
|
+
return _.removeEventListener(f, ie, !1);
|
|
1467
|
+
}), _.close();
|
|
1468
|
+
}
|
|
1469
|
+
function R() {
|
|
1470
|
+
E && b.next({
|
|
1471
|
+
type: "reconnect"
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
1474
|
+
function l() {
|
|
1475
|
+
var f = new Kt(x, O);
|
|
1476
|
+
return f.addEventListener("error", F, !1), f.addEventListener("channelError", V, !1), f.addEventListener("disconnect", oe, !1), C.forEach(function(w) {
|
|
1477
|
+
return f.addEventListener(w, ie, !1);
|
|
1478
|
+
}), f;
|
|
1479
|
+
}
|
|
1480
|
+
function h() {
|
|
1481
|
+
_ = l();
|
|
1482
|
+
}
|
|
1483
|
+
function v() {
|
|
1484
|
+
$ = !0, q();
|
|
1485
|
+
}
|
|
1486
|
+
return v;
|
|
1487
|
+
});
|
|
1488
|
+
};
|
|
1489
|
+
function Br(t) {
|
|
1490
|
+
try {
|
|
1491
|
+
var e = t.data && JSON.parse(t.data) || {};
|
|
1492
|
+
return Qa({
|
|
1493
|
+
type: t.type
|
|
1494
|
+
}, e);
|
|
1495
|
+
} catch (r) {
|
|
1496
|
+
return r;
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
function ci(t) {
|
|
1500
|
+
if (t instanceof Error)
|
|
1501
|
+
return t;
|
|
1502
|
+
var e = Br(t);
|
|
1503
|
+
return e instanceof Error ? e : new Error(fi(e));
|
|
1504
|
+
}
|
|
1505
|
+
function fi(t) {
|
|
1506
|
+
return t.error ? t.error.description ? t.error.description : typeof t.error == "string" ? t.error : JSON.stringify(t.error, null, 2) : t.message || "Unknown listener error";
|
|
1507
|
+
}
|
|
1508
|
+
function Zt(t, e, r) {
|
|
1509
|
+
return e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1510
|
+
}
|
|
1511
|
+
var li = D, di = Oe, Ze = di.filter, hi = Se, me = hi.map, et = te, pi = Mr, vi = Ir, er = Rr, tr = _t, mi = ui, gi = function(e, r) {
|
|
1512
|
+
var n = typeof e > "u" ? r : e;
|
|
1513
|
+
return e === !1 ? void 0 : n;
|
|
1514
|
+
}, yi = function() {
|
|
1515
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1516
|
+
return {
|
|
1517
|
+
returnIds: !0,
|
|
1518
|
+
returnDocuments: gi(e.returnDocuments, !0),
|
|
1519
|
+
visibility: e.visibility || "sync"
|
|
1520
|
+
};
|
|
1521
|
+
}, tt = function(e) {
|
|
1522
|
+
return e.type === "response";
|
|
1523
|
+
}, bi = function(e) {
|
|
1524
|
+
return e.body;
|
|
1525
|
+
}, wi = function(e, r) {
|
|
1526
|
+
return e.reduce(function(n, a) {
|
|
1527
|
+
return n[r(a)] = a, n;
|
|
1528
|
+
}, /* @__PURE__ */ Object.create(null));
|
|
1529
|
+
}, De = function(e) {
|
|
1530
|
+
return e.toPromise();
|
|
1531
|
+
}, _i = 11264, Oi = {
|
|
1532
|
+
listen: mi,
|
|
1533
|
+
getDataUrl: function(e, r) {
|
|
1534
|
+
var n = this.clientConfig, a = n.gradientMode ? n.namespace : et.hasDataset(n), i = "/".concat(e, "/").concat(a), o = r ? "".concat(i, "/").concat(r) : i;
|
|
1535
|
+
return (this.clientConfig.gradientMode ? o : "/data".concat(o)).replace(/\/($|\?)/, "$1");
|
|
1536
|
+
},
|
|
1537
|
+
fetch: function(e, r) {
|
|
1538
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = n.filterResponse === !1 ? function(o) {
|
|
1539
|
+
return o;
|
|
1540
|
+
} : function(o) {
|
|
1541
|
+
return o.result;
|
|
1542
|
+
}, i = this._dataRequest("query", {
|
|
1543
|
+
query: e,
|
|
1544
|
+
params: r
|
|
1545
|
+
}, n).pipe(me(a));
|
|
1546
|
+
return this.isPromiseAPI() ? De(i) : i;
|
|
1547
|
+
},
|
|
1548
|
+
getDocument: function(e) {
|
|
1549
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = {
|
|
1550
|
+
uri: this.getDataUrl("doc", e),
|
|
1551
|
+
json: !0,
|
|
1552
|
+
tag: r.tag
|
|
1553
|
+
}, a = this._requestObservable(n).pipe(Ze(tt), me(function(i) {
|
|
1554
|
+
return i.body.documents && i.body.documents[0];
|
|
1555
|
+
}));
|
|
1556
|
+
return this.isPromiseAPI() ? De(a) : a;
|
|
1557
|
+
},
|
|
1558
|
+
getDocuments: function(e) {
|
|
1559
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = {
|
|
1560
|
+
uri: this.getDataUrl("doc", e.join(",")),
|
|
1561
|
+
json: !0,
|
|
1562
|
+
tag: r.tag
|
|
1563
|
+
}, a = this._requestObservable(n).pipe(Ze(tt), me(function(i) {
|
|
1564
|
+
var o = wi(i.body.documents || [], function(s) {
|
|
1565
|
+
return s._id;
|
|
1566
|
+
});
|
|
1567
|
+
return e.map(function(s) {
|
|
1568
|
+
return o[s] || null;
|
|
1569
|
+
});
|
|
1570
|
+
}));
|
|
1571
|
+
return this.isPromiseAPI() ? De(a) : a;
|
|
1572
|
+
},
|
|
1573
|
+
create: function(e, r) {
|
|
1574
|
+
return this._create(e, "create", r);
|
|
1575
|
+
},
|
|
1576
|
+
createIfNotExists: function(e, r) {
|
|
1577
|
+
return et.requireDocumentId("createIfNotExists", e), this._create(e, "createIfNotExists", r);
|
|
1578
|
+
},
|
|
1579
|
+
createOrReplace: function(e, r) {
|
|
1580
|
+
return et.requireDocumentId("createOrReplace", e), this._create(e, "createOrReplace", r);
|
|
1581
|
+
},
|
|
1582
|
+
patch: function(e, r) {
|
|
1583
|
+
return new tr(e, r, this);
|
|
1584
|
+
},
|
|
1585
|
+
delete: function(e, r) {
|
|
1586
|
+
return this.dataRequest("mutate", {
|
|
1587
|
+
mutations: [{
|
|
1588
|
+
delete: pi(e)
|
|
1589
|
+
}]
|
|
1590
|
+
}, r);
|
|
1591
|
+
},
|
|
1592
|
+
mutate: function(e, r) {
|
|
1593
|
+
var n = e instanceof tr || e instanceof er ? e.serialize() : e, a = Array.isArray(n) ? n : [n], i = r && r.transactionId;
|
|
1594
|
+
return this.dataRequest("mutate", {
|
|
1595
|
+
mutations: a,
|
|
1596
|
+
transactionId: i
|
|
1597
|
+
}, r);
|
|
1598
|
+
},
|
|
1599
|
+
transaction: function(e) {
|
|
1600
|
+
return new er(e, this);
|
|
1601
|
+
},
|
|
1602
|
+
dataRequest: function(e, r) {
|
|
1603
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = this._dataRequest(e, r, n);
|
|
1604
|
+
return this.isPromiseAPI() ? De(a) : a;
|
|
1605
|
+
},
|
|
1606
|
+
_dataRequest: function(e, r) {
|
|
1607
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = e === "mutate", i = e === "query", o = !a && vi(r), s = !a && o.length < _i, u = s ? o : "", c = n.returnFirst, g = n.timeout, d = n.token, p = n.tag, x = this.getDataUrl(e, u), C = {
|
|
1608
|
+
method: s ? "GET" : "POST",
|
|
1609
|
+
uri: x,
|
|
1610
|
+
json: !0,
|
|
1611
|
+
body: s ? void 0 : r,
|
|
1612
|
+
query: a && yi(n),
|
|
1613
|
+
timeout: g,
|
|
1614
|
+
token: d,
|
|
1615
|
+
tag: p,
|
|
1616
|
+
canUseCdn: i
|
|
1617
|
+
};
|
|
1618
|
+
return this._requestObservable(C).pipe(Ze(tt), me(bi), me(function(E) {
|
|
1619
|
+
if (!a)
|
|
1620
|
+
return E;
|
|
1621
|
+
var O = E.results || [];
|
|
1622
|
+
if (n.returnDocuments)
|
|
1623
|
+
return c ? O[0] && O[0].document : O.map(function(T) {
|
|
1624
|
+
return T.document;
|
|
1625
|
+
});
|
|
1626
|
+
var b = c ? "documentId" : "documentIds", _ = c ? O[0] && O[0].id : O.map(function(T) {
|
|
1627
|
+
return T.id;
|
|
1628
|
+
});
|
|
1629
|
+
return Zt({
|
|
1630
|
+
transactionId: E.transactionId,
|
|
1631
|
+
results: O
|
|
1632
|
+
}, b, _);
|
|
1633
|
+
}));
|
|
1634
|
+
},
|
|
1635
|
+
_create: function(e, r) {
|
|
1636
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = Zt({}, r, e), i = li({
|
|
1637
|
+
returnFirst: !0,
|
|
1638
|
+
returnDocuments: !0
|
|
1639
|
+
}, n);
|
|
1640
|
+
return this.dataRequest("mutate", {
|
|
1641
|
+
mutations: [a]
|
|
1642
|
+
}, i);
|
|
1643
|
+
}
|
|
1644
|
+
}, Ei = D, Si = te;
|
|
1645
|
+
function Yr(t) {
|
|
1646
|
+
this.request = t.request.bind(t);
|
|
1647
|
+
}
|
|
1648
|
+
Ei(Yr.prototype, {
|
|
1649
|
+
create: function(e, r) {
|
|
1650
|
+
return this._modify("PUT", e, r);
|
|
1651
|
+
},
|
|
1652
|
+
edit: function(e, r) {
|
|
1653
|
+
return this._modify("PATCH", e, r);
|
|
1654
|
+
},
|
|
1655
|
+
delete: function(e) {
|
|
1656
|
+
return this._modify("DELETE", e);
|
|
1657
|
+
},
|
|
1658
|
+
list: function() {
|
|
1659
|
+
return this.request({
|
|
1660
|
+
uri: "/datasets"
|
|
1661
|
+
});
|
|
1662
|
+
},
|
|
1663
|
+
_modify: function(e, r, n) {
|
|
1664
|
+
return Si.dataset(r), this.request({
|
|
1665
|
+
method: e,
|
|
1666
|
+
uri: "/datasets/".concat(r),
|
|
1667
|
+
body: n
|
|
1668
|
+
});
|
|
1669
|
+
}
|
|
1670
|
+
});
|
|
1671
|
+
var xi = Yr, Ci = D;
|
|
1672
|
+
function Xr(t) {
|
|
1673
|
+
this.client = t;
|
|
1674
|
+
}
|
|
1675
|
+
Ci(Xr.prototype, {
|
|
1676
|
+
list: function() {
|
|
1677
|
+
return this.client.request({
|
|
1678
|
+
uri: "/projects"
|
|
1679
|
+
});
|
|
1680
|
+
},
|
|
1681
|
+
getById: function(e) {
|
|
1682
|
+
return this.client.request({
|
|
1683
|
+
uri: "/projects/".concat(e)
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1686
|
+
});
|
|
1687
|
+
var Pi = Xr, Ti = function(t) {
|
|
1688
|
+
var e = [];
|
|
1689
|
+
for (var r in t)
|
|
1690
|
+
t.hasOwnProperty(r) && e.push("".concat(encodeURIComponent(r), "=").concat(encodeURIComponent(t[r])));
|
|
1691
|
+
return e.length > 0 ? "?".concat(e.join("&")) : "";
|
|
1692
|
+
};
|
|
1693
|
+
function ji(t, e) {
|
|
1694
|
+
return Ai(t) || Mi(t, e) || qi(t, e) || Di();
|
|
1695
|
+
}
|
|
1696
|
+
function Di() {
|
|
1697
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1698
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1699
|
+
}
|
|
1700
|
+
function qi(t, e) {
|
|
1701
|
+
if (t) {
|
|
1702
|
+
if (typeof t == "string")
|
|
1703
|
+
return rr(t, e);
|
|
1704
|
+
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
1705
|
+
if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set")
|
|
1706
|
+
return Array.from(t);
|
|
1707
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))
|
|
1708
|
+
return rr(t, e);
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
function rr(t, e) {
|
|
1712
|
+
(e == null || e > t.length) && (e = t.length);
|
|
1713
|
+
for (var r = 0, n = new Array(e); r < e; r++)
|
|
1714
|
+
n[r] = t[r];
|
|
1715
|
+
return n;
|
|
1716
|
+
}
|
|
1717
|
+
function Mi(t, e) {
|
|
1718
|
+
var r = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
1719
|
+
if (r != null) {
|
|
1720
|
+
var n = [], a = !0, i = !1, o, s;
|
|
1721
|
+
try {
|
|
1722
|
+
for (r = r.call(t); !(a = (o = r.next()).done) && (n.push(o.value), !(e && n.length === e)); a = !0)
|
|
1723
|
+
;
|
|
1724
|
+
} catch (u) {
|
|
1725
|
+
i = !0, s = u;
|
|
1726
|
+
} finally {
|
|
1727
|
+
try {
|
|
1728
|
+
!a && r.return != null && r.return();
|
|
1729
|
+
} finally {
|
|
1730
|
+
if (i)
|
|
1731
|
+
throw s;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
return n;
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
function Ai(t) {
|
|
1738
|
+
if (Array.isArray(t))
|
|
1739
|
+
return t;
|
|
1740
|
+
}
|
|
1741
|
+
var zr = D, Ri = Se, Ii = Ri.map, $i = Oe, Ui = $i.filter, ki = Ti, qe = te;
|
|
1742
|
+
function Vr(t) {
|
|
1743
|
+
this.client = t;
|
|
1744
|
+
}
|
|
1745
|
+
function Ni(t) {
|
|
1746
|
+
var e = t.document;
|
|
1747
|
+
return Object.defineProperty(e, "document", {
|
|
1748
|
+
enumerable: !1,
|
|
1749
|
+
get: function() {
|
|
1750
|
+
return console.warn("The promise returned from client.asset.upload(...) now resolves with the asset document"), e;
|
|
1751
|
+
}
|
|
1752
|
+
}), e;
|
|
1753
|
+
}
|
|
1754
|
+
function Hi(t, e) {
|
|
1755
|
+
return typeof window > "u" || !(e instanceof window.File) ? t : zr({
|
|
1756
|
+
filename: t.preserveFilename === !1 ? void 0 : e.name,
|
|
1757
|
+
contentType: e.type
|
|
1758
|
+
}, t);
|
|
1759
|
+
}
|
|
1760
|
+
zr(Vr.prototype, {
|
|
1761
|
+
/**
|
|
1762
|
+
* Upload an asset
|
|
1763
|
+
*
|
|
1764
|
+
* @param {String} assetType `image` or `file`
|
|
1765
|
+
* @param {File|Blob|Buffer|ReadableStream} body File to upload
|
|
1766
|
+
* @param {Object} opts Options for the upload
|
|
1767
|
+
* @param {Boolean} opts.preserveFilename Whether or not to preserve the original filename (default: true)
|
|
1768
|
+
* @param {String} opts.filename Filename for this file (optional)
|
|
1769
|
+
* @param {Number} opts.timeout Milliseconds to wait before timing the request out (default: 0)
|
|
1770
|
+
* @param {String} opts.contentType Mime type of the file
|
|
1771
|
+
* @param {Array} opts.extract Array of metadata parts to extract from image.
|
|
1772
|
+
* Possible values: `location`, `exif`, `image`, `palette`
|
|
1773
|
+
* @param {String} opts.label Label
|
|
1774
|
+
* @param {String} opts.title Title
|
|
1775
|
+
* @param {String} opts.description Description
|
|
1776
|
+
* @param {String} opts.creditLine The credit to person(s) and/or organization(s) required by the supplier of the image to be used when published
|
|
1777
|
+
* @param {Object} opts.source Source data (when the asset is from an external service)
|
|
1778
|
+
* @param {String} opts.source.id The (u)id of the asset within the source, i.e. 'i-f323r1E'
|
|
1779
|
+
* Required if source is defined
|
|
1780
|
+
* @param {String} opts.source.name The name of the source, i.e. 'unsplash'
|
|
1781
|
+
* Required if source is defined
|
|
1782
|
+
* @param {String} opts.source.url A url to where to find the asset, or get more info about it in the source
|
|
1783
|
+
* Optional
|
|
1784
|
+
* @return {Promise} Resolves with the created asset document
|
|
1785
|
+
*/
|
|
1786
|
+
upload: function(e, r) {
|
|
1787
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
1788
|
+
qe.validateAssetType(e);
|
|
1789
|
+
var a = n.extract || void 0;
|
|
1790
|
+
a && !a.length && (a = ["none"]);
|
|
1791
|
+
var i = qe.hasDataset(this.client.clientConfig), o = e === "image" ? "images" : "files", s = Hi(n, r), u = s.tag, c = s.label, g = s.title, d = s.description, p = s.creditLine, x = s.filename, C = s.source, E = {
|
|
1792
|
+
label: c,
|
|
1793
|
+
title: g,
|
|
1794
|
+
description: d,
|
|
1795
|
+
filename: x,
|
|
1796
|
+
meta: a,
|
|
1797
|
+
creditLine: p
|
|
1798
|
+
};
|
|
1799
|
+
C && (E.sourceId = C.id, E.sourceName = C.name, E.sourceUrl = C.url);
|
|
1800
|
+
var O = this.client._requestObservable({
|
|
1801
|
+
tag: u,
|
|
1802
|
+
method: "POST",
|
|
1803
|
+
timeout: s.timeout || 0,
|
|
1804
|
+
uri: "/assets/".concat(o, "/").concat(i),
|
|
1805
|
+
headers: s.contentType ? {
|
|
1806
|
+
"Content-Type": s.contentType
|
|
1807
|
+
} : {},
|
|
1808
|
+
query: E,
|
|
1809
|
+
body: r
|
|
1810
|
+
});
|
|
1811
|
+
return this.client.isPromiseAPI() ? O.pipe(Ui(function(b) {
|
|
1812
|
+
return b.type === "response";
|
|
1813
|
+
}), Ii(function(b) {
|
|
1814
|
+
return Ni(b.body);
|
|
1815
|
+
})).toPromise() : O;
|
|
1816
|
+
},
|
|
1817
|
+
delete: function(e, r) {
|
|
1818
|
+
console.warn("client.assets.delete() is deprecated, please use client.delete(<document-id>)");
|
|
1819
|
+
var n = r || "";
|
|
1820
|
+
return /^(image|file)-/.test(n) ? e._id && (n = e._id) : n = "".concat(e, "-").concat(n), qe.hasDataset(this.client.clientConfig), this.client.delete(n);
|
|
1821
|
+
},
|
|
1822
|
+
getImageUrl: function(e, r) {
|
|
1823
|
+
var n = e._ref || e;
|
|
1824
|
+
if (typeof n != "string")
|
|
1825
|
+
throw new Error("getImageUrl() needs either an object with a _ref, or a string with an asset document ID");
|
|
1826
|
+
if (!/^image-[A-Za-z0-9_]+-\d+x\d+-[a-z]{1,5}$/.test(n))
|
|
1827
|
+
throw new Error('Unsupported asset ID "'.concat(n, '". URL generation only works for auto-generated IDs.'));
|
|
1828
|
+
var a = n.split("-"), i = ji(a, 4), o = i[1], s = i[2], u = i[3];
|
|
1829
|
+
qe.hasDataset(this.client.clientConfig);
|
|
1830
|
+
var c = this.client.clientConfig, g = c.projectId, d = c.dataset, p = r ? ki(r) : "";
|
|
1831
|
+
return "https://cdn.sanity.io/images/".concat(g, "/").concat(d, "/").concat(o, "-").concat(s, ".").concat(u).concat(p);
|
|
1832
|
+
}
|
|
1833
|
+
});
|
|
1834
|
+
var Wi = Vr, Li = D;
|
|
1835
|
+
function Gr(t) {
|
|
1836
|
+
this.client = t;
|
|
1837
|
+
}
|
|
1838
|
+
Li(Gr.prototype, {
|
|
1839
|
+
getById: function(e) {
|
|
1840
|
+
return this.client.request({
|
|
1841
|
+
uri: "/users/".concat(e)
|
|
1842
|
+
});
|
|
1843
|
+
}
|
|
1844
|
+
});
|
|
1845
|
+
var Fi = Gr, Bi = D;
|
|
1846
|
+
function Qr(t) {
|
|
1847
|
+
this.client = t;
|
|
1848
|
+
}
|
|
1849
|
+
Bi(Qr.prototype, {
|
|
1850
|
+
getLoginProviders: function() {
|
|
1851
|
+
return this.client.request({
|
|
1852
|
+
uri: "/auth/providers"
|
|
1853
|
+
});
|
|
1854
|
+
},
|
|
1855
|
+
logout: function() {
|
|
1856
|
+
return this.client.request({
|
|
1857
|
+
uri: "/auth/logout",
|
|
1858
|
+
method: "POST"
|
|
1859
|
+
});
|
|
1860
|
+
}
|
|
1861
|
+
});
|
|
1862
|
+
var Yi = Qr, Xi = function() {
|
|
1863
|
+
var e = [];
|
|
1864
|
+
return {
|
|
1865
|
+
subscribe: r,
|
|
1866
|
+
publish: n
|
|
1867
|
+
};
|
|
1868
|
+
function r(a) {
|
|
1869
|
+
return e.push(a), function() {
|
|
1870
|
+
var o = e.indexOf(a);
|
|
1871
|
+
o > -1 && e.splice(o, 1);
|
|
1872
|
+
};
|
|
1873
|
+
}
|
|
1874
|
+
function n() {
|
|
1875
|
+
for (var a = 0; a < e.length; a++)
|
|
1876
|
+
e[a].apply(null, arguments);
|
|
1877
|
+
}
|
|
1878
|
+
}, zi = function(t) {
|
|
1879
|
+
var e = function(n, a) {
|
|
1880
|
+
for (var i = arguments.length, o = Array(i > 2 ? i - 2 : 0), s = 2; s < i; s++)
|
|
1881
|
+
o[s - 2] = arguments[s];
|
|
1882
|
+
for (var u = n === "onError", c = a, g = 0; g < t[n].length; g++) {
|
|
1883
|
+
var d = t[n][g];
|
|
1884
|
+
if (c = d.apply(void 0, [c].concat(o)), u && !c)
|
|
1885
|
+
break;
|
|
1886
|
+
}
|
|
1887
|
+
return c;
|
|
1888
|
+
};
|
|
1889
|
+
return e;
|
|
1890
|
+
}, Vi = function(e, r) {
|
|
1891
|
+
if (r = r.split(":")[0], e = +e, !e)
|
|
1892
|
+
return !1;
|
|
1893
|
+
switch (r) {
|
|
1894
|
+
case "http":
|
|
1895
|
+
case "ws":
|
|
1896
|
+
return e !== 80;
|
|
1897
|
+
case "https":
|
|
1898
|
+
case "wss":
|
|
1899
|
+
return e !== 443;
|
|
1900
|
+
case "ftp":
|
|
1901
|
+
return e !== 21;
|
|
1902
|
+
case "gopher":
|
|
1903
|
+
return e !== 70;
|
|
1904
|
+
case "file":
|
|
1905
|
+
return !1;
|
|
1906
|
+
}
|
|
1907
|
+
return e !== 0;
|
|
1908
|
+
}, At = {}, Gi = Object.prototype.hasOwnProperty, Qi;
|
|
1909
|
+
function nr(t) {
|
|
1910
|
+
try {
|
|
1911
|
+
return decodeURIComponent(t.replace(/\+/g, " "));
|
|
1912
|
+
} catch {
|
|
1913
|
+
return null;
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
function ar(t) {
|
|
1917
|
+
try {
|
|
1918
|
+
return encodeURIComponent(t);
|
|
1919
|
+
} catch {
|
|
1920
|
+
return null;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
function Ji(t) {
|
|
1924
|
+
for (var e = /([^=?#&]+)=?([^&]*)/g, r = {}, n; n = e.exec(t); ) {
|
|
1925
|
+
var a = nr(n[1]), i = nr(n[2]);
|
|
1926
|
+
a === null || i === null || a in r || (r[a] = i);
|
|
1927
|
+
}
|
|
1928
|
+
return r;
|
|
1929
|
+
}
|
|
1930
|
+
function Ki(t, e) {
|
|
1931
|
+
e = e || "";
|
|
1932
|
+
var r = [], n, a;
|
|
1933
|
+
typeof e != "string" && (e = "?");
|
|
1934
|
+
for (a in t)
|
|
1935
|
+
if (Gi.call(t, a)) {
|
|
1936
|
+
if (n = t[a], !n && (n === null || n === Qi || isNaN(n)) && (n = ""), a = ar(a), n = ar(n), a === null || n === null)
|
|
1937
|
+
continue;
|
|
1938
|
+
r.push(a + "=" + n);
|
|
1939
|
+
}
|
|
1940
|
+
return r.length ? e + r.join("&") : "";
|
|
1941
|
+
}
|
|
1942
|
+
At.stringify = Ki;
|
|
1943
|
+
At.parse = Ji;
|
|
1944
|
+
var Jr = Vi, Le = At, Zi = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, eo = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, to = /^[a-zA-Z]:/, ro = "[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]", no = new RegExp("^" + ro + "+");
|
|
1945
|
+
function Rt(t) {
|
|
1946
|
+
return (t || "").toString().replace(no, "");
|
|
1947
|
+
}
|
|
1948
|
+
var lt = [
|
|
1949
|
+
["#", "hash"],
|
|
1950
|
+
// Extract from the back.
|
|
1951
|
+
["?", "query"],
|
|
1952
|
+
// Extract from the back.
|
|
1953
|
+
function(e, r) {
|
|
1954
|
+
return Q(r.protocol) ? e.replace(/\\/g, "/") : e;
|
|
1955
|
+
},
|
|
1956
|
+
["/", "pathname"],
|
|
1957
|
+
// Extract from the back.
|
|
1958
|
+
["@", "auth", 1],
|
|
1959
|
+
// Extract from the front.
|
|
1960
|
+
[NaN, "host", void 0, 1, 1],
|
|
1961
|
+
// Set left over value.
|
|
1962
|
+
[/:(\d+)$/, "port", void 0, 1],
|
|
1963
|
+
// RegExp the back.
|
|
1964
|
+
[NaN, "hostname", void 0, 1, 1]
|
|
1965
|
+
// Set left over.
|
|
1966
|
+
], ir = { hash: 1, query: 1 };
|
|
1967
|
+
function Kr(t) {
|
|
1968
|
+
var e;
|
|
1969
|
+
typeof window < "u" ? e = window : typeof j < "u" ? e = j : typeof self < "u" ? e = self : e = {};
|
|
1970
|
+
var r = e.location || {};
|
|
1971
|
+
t = t || r;
|
|
1972
|
+
var n = {}, a = typeof t, i;
|
|
1973
|
+
if (t.protocol === "blob:")
|
|
1974
|
+
n = new X(unescape(t.pathname), {});
|
|
1975
|
+
else if (a === "string") {
|
|
1976
|
+
n = new X(t, {});
|
|
1977
|
+
for (i in ir)
|
|
1978
|
+
delete n[i];
|
|
1979
|
+
} else if (a === "object") {
|
|
1980
|
+
for (i in t)
|
|
1981
|
+
i in ir || (n[i] = t[i]);
|
|
1982
|
+
n.slashes === void 0 && (n.slashes = Zi.test(t.href));
|
|
1983
|
+
}
|
|
1984
|
+
return n;
|
|
1985
|
+
}
|
|
1986
|
+
function Q(t) {
|
|
1987
|
+
return t === "file:" || t === "ftp:" || t === "http:" || t === "https:" || t === "ws:" || t === "wss:";
|
|
1988
|
+
}
|
|
1989
|
+
function Zr(t, e) {
|
|
1990
|
+
t = Rt(t), e = e || {};
|
|
1991
|
+
var r = eo.exec(t), n = r[1] ? r[1].toLowerCase() : "", a = !!r[2], i = !!r[3], o = 0, s;
|
|
1992
|
+
return a ? i ? (s = r[2] + r[3] + r[4], o = r[2].length + r[3].length) : (s = r[2] + r[4], o = r[2].length) : i ? (s = r[3] + r[4], o = r[3].length) : s = r[4], n === "file:" ? o >= 2 && (s = s.slice(2)) : Q(n) ? s = r[4] : n ? a && (s = s.slice(2)) : o >= 2 && Q(e.protocol) && (s = r[4]), {
|
|
1993
|
+
protocol: n,
|
|
1994
|
+
slashes: a || Q(n),
|
|
1995
|
+
slashesCount: o,
|
|
1996
|
+
rest: s
|
|
1997
|
+
};
|
|
1998
|
+
}
|
|
1999
|
+
function ao(t, e) {
|
|
2000
|
+
if (t === "")
|
|
2001
|
+
return e;
|
|
2002
|
+
for (var r = (e || "/").split("/").slice(0, -1).concat(t.split("/")), n = r.length, a = r[n - 1], i = !1, o = 0; n--; )
|
|
2003
|
+
r[n] === "." ? r.splice(n, 1) : r[n] === ".." ? (r.splice(n, 1), o++) : o && (n === 0 && (i = !0), r.splice(n, 1), o--);
|
|
2004
|
+
return i && r.unshift(""), (a === "." || a === "..") && r.push(""), r.join("/");
|
|
2005
|
+
}
|
|
2006
|
+
function X(t, e, r) {
|
|
2007
|
+
if (t = Rt(t), !(this instanceof X))
|
|
2008
|
+
return new X(t, e, r);
|
|
2009
|
+
var n, a, i, o, s, u, c = lt.slice(), g = typeof e, d = this, p = 0;
|
|
2010
|
+
for (g !== "object" && g !== "string" && (r = e, e = null), r && typeof r != "function" && (r = Le.parse), e = Kr(e), a = Zr(t || "", e), n = !a.protocol && !a.slashes, d.slashes = a.slashes || n && e.slashes, d.protocol = a.protocol || e.protocol || "", t = a.rest, (a.protocol === "file:" && (a.slashesCount !== 2 || to.test(t)) || !a.slashes && (a.protocol || a.slashesCount < 2 || !Q(d.protocol))) && (c[3] = [/(.*)/, "pathname"]); p < c.length; p++) {
|
|
2011
|
+
if (o = c[p], typeof o == "function") {
|
|
2012
|
+
t = o(t, d);
|
|
2013
|
+
continue;
|
|
2014
|
+
}
|
|
2015
|
+
i = o[0], u = o[1], i !== i ? d[u] = t : typeof i == "string" ? ~(s = t.indexOf(i)) && (typeof o[2] == "number" ? (d[u] = t.slice(0, s), t = t.slice(s + o[2])) : (d[u] = t.slice(s), t = t.slice(0, s))) : (s = i.exec(t)) && (d[u] = s[1], t = t.slice(0, s.index)), d[u] = d[u] || n && o[3] && e[u] || "", o[4] && (d[u] = d[u].toLowerCase());
|
|
2016
|
+
}
|
|
2017
|
+
r && (d.query = r(d.query)), n && e.slashes && d.pathname.charAt(0) !== "/" && (d.pathname !== "" || e.pathname !== "") && (d.pathname = ao(d.pathname, e.pathname)), d.pathname.charAt(0) !== "/" && Q(d.protocol) && (d.pathname = "/" + d.pathname), Jr(d.port, d.protocol) || (d.host = d.hostname, d.port = ""), d.username = d.password = "", d.auth && (o = d.auth.split(":"), d.username = o[0], d.password = o[1] || ""), d.origin = d.protocol !== "file:" && Q(d.protocol) && d.host ? d.protocol + "//" + d.host : "null", d.href = d.toString();
|
|
2018
|
+
}
|
|
2019
|
+
function io(t, e, r) {
|
|
2020
|
+
var n = this;
|
|
2021
|
+
switch (t) {
|
|
2022
|
+
case "query":
|
|
2023
|
+
typeof e == "string" && e.length && (e = (r || Le.parse)(e)), n[t] = e;
|
|
2024
|
+
break;
|
|
2025
|
+
case "port":
|
|
2026
|
+
n[t] = e, Jr(e, n.protocol) ? e && (n.host = n.hostname + ":" + e) : (n.host = n.hostname, n[t] = "");
|
|
2027
|
+
break;
|
|
2028
|
+
case "hostname":
|
|
2029
|
+
n[t] = e, n.port && (e += ":" + n.port), n.host = e;
|
|
2030
|
+
break;
|
|
2031
|
+
case "host":
|
|
2032
|
+
n[t] = e, /:\d+$/.test(e) ? (e = e.split(":"), n.port = e.pop(), n.hostname = e.join(":")) : (n.hostname = e, n.port = "");
|
|
2033
|
+
break;
|
|
2034
|
+
case "protocol":
|
|
2035
|
+
n.protocol = e.toLowerCase(), n.slashes = !r;
|
|
2036
|
+
break;
|
|
2037
|
+
case "pathname":
|
|
2038
|
+
case "hash":
|
|
2039
|
+
if (e) {
|
|
2040
|
+
var a = t === "pathname" ? "/" : "#";
|
|
2041
|
+
n[t] = e.charAt(0) !== a ? a + e : e;
|
|
2042
|
+
} else
|
|
2043
|
+
n[t] = e;
|
|
2044
|
+
break;
|
|
2045
|
+
case "username":
|
|
2046
|
+
case "password":
|
|
2047
|
+
n[t] = encodeURIComponent(e);
|
|
2048
|
+
break;
|
|
2049
|
+
case "auth":
|
|
2050
|
+
var i = e.split(":");
|
|
2051
|
+
n.username = i[0], n.password = i.length === 2 ? i[1] : "";
|
|
2052
|
+
}
|
|
2053
|
+
for (var o = 0; o < lt.length; o++) {
|
|
2054
|
+
var s = lt[o];
|
|
2055
|
+
s[4] && (n[s[1]] = n[s[1]].toLowerCase());
|
|
2056
|
+
}
|
|
2057
|
+
return n.auth = n.password ? n.username + ":" + n.password : n.username, n.origin = n.protocol !== "file:" && Q(n.protocol) && n.host ? n.protocol + "//" + n.host : "null", n.href = n.toString(), n;
|
|
2058
|
+
}
|
|
2059
|
+
function oo(t) {
|
|
2060
|
+
(!t || typeof t != "function") && (t = Le.stringify);
|
|
2061
|
+
var e, r = this, n = r.protocol;
|
|
2062
|
+
n && n.charAt(n.length - 1) !== ":" && (n += ":");
|
|
2063
|
+
var a = n + (r.protocol && r.slashes || Q(r.protocol) ? "//" : "");
|
|
2064
|
+
return r.username ? (a += r.username, r.password && (a += ":" + r.password), a += "@") : r.password && (a += ":" + r.password, a += "@"), a += r.host + r.pathname, e = typeof r.query == "object" ? t(r.query) : r.query, e && (a += e.charAt(0) !== "?" ? "?" + e : e), r.hash && (a += r.hash), a;
|
|
2065
|
+
}
|
|
2066
|
+
X.prototype = { set: io, toString: oo };
|
|
2067
|
+
X.extractProtocol = Zr;
|
|
2068
|
+
X.location = Kr;
|
|
2069
|
+
X.trimLeft = Rt;
|
|
2070
|
+
X.qs = Le;
|
|
2071
|
+
var so = X, rt = D, uo = so, co = typeof navigator > "u" ? !1 : navigator.product === "ReactNative", fo = Object.prototype.hasOwnProperty, dt = { timeout: co ? 6e4 : 12e4 }, lo = function(t) {
|
|
2072
|
+
var e = typeof t == "string" ? rt({ url: t }, dt) : rt({}, dt, t), r = uo(
|
|
2073
|
+
e.url,
|
|
2074
|
+
{},
|
|
2075
|
+
// Don't use current browser location
|
|
2076
|
+
!0
|
|
2077
|
+
// Parse query strings
|
|
2078
|
+
);
|
|
2079
|
+
return e.timeout = en(e.timeout), e.query && (r.query = rt({}, r.query, po(e.query))), e.method = e.body && !e.method ? "POST" : (e.method || "GET").toUpperCase(), e.url = r.toString(ho), e;
|
|
2080
|
+
};
|
|
2081
|
+
function ho(t) {
|
|
2082
|
+
var e = [];
|
|
2083
|
+
for (var r in t)
|
|
2084
|
+
fo.call(t, r) && n(r, t[r]);
|
|
2085
|
+
return e.length ? e.join("&") : "";
|
|
2086
|
+
function n(a, i) {
|
|
2087
|
+
Array.isArray(i) ? i.forEach(function(o) {
|
|
2088
|
+
return n(a, o);
|
|
2089
|
+
}) : e.push([a, i].map(encodeURIComponent).join("="));
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
function en(t) {
|
|
2093
|
+
if (t === !1 || t === 0)
|
|
2094
|
+
return !1;
|
|
2095
|
+
if (t.connect || t.socket)
|
|
2096
|
+
return t;
|
|
2097
|
+
var e = Number(t);
|
|
2098
|
+
return isNaN(e) ? en(dt.timeout) : { connect: e, socket: e };
|
|
2099
|
+
}
|
|
2100
|
+
function po(t) {
|
|
2101
|
+
var e = {};
|
|
2102
|
+
for (var r in t)
|
|
2103
|
+
t[r] !== void 0 && (e[r] = t[r]);
|
|
2104
|
+
return e;
|
|
2105
|
+
}
|
|
2106
|
+
var vo = /^https?:\/\//i, mo = function(t) {
|
|
2107
|
+
if (!vo.test(t.url))
|
|
2108
|
+
throw new Error('"' + t.url + '" is not a valid URL');
|
|
2109
|
+
}, or = /^(?:(?:(?:([^:\/#\?]+:)?(?:(?:\/\/)((?:((?:[^:@\/#\?]+)(?:\:(?:[^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((?:\/?(?:[^\/\?#]+\/+)*)(?:[^\?#]*)))?(\?[^#]+)?)(#.*)?/, go = {
|
|
2110
|
+
regex: or,
|
|
2111
|
+
parse: function(t) {
|
|
2112
|
+
var e = or.exec(t);
|
|
2113
|
+
return e ? {
|
|
2114
|
+
protocol: (e[1] || "").toLowerCase() || void 0,
|
|
2115
|
+
hostname: (e[5] || "").toLowerCase() || void 0,
|
|
2116
|
+
port: e[6] || void 0
|
|
2117
|
+
} : {};
|
|
2118
|
+
}
|
|
2119
|
+
}, sr = go, yo = function(t, e, r) {
|
|
2120
|
+
if (t === e)
|
|
2121
|
+
return !0;
|
|
2122
|
+
var n = sr.parse(t, !1, !0), a = sr.parse(e, !1, !0), i = n.port | 0 || (n.protocol === "https" ? 443 : 80), o = a.port | 0 || (a.protocol === "https" ? 443 : 80), s = {
|
|
2123
|
+
proto: n.protocol === a.protocol,
|
|
2124
|
+
hostname: n.hostname === a.hostname,
|
|
2125
|
+
port: i === o
|
|
2126
|
+
};
|
|
2127
|
+
return s.proto && s.hostname && (s.port || r);
|
|
2128
|
+
}, nt = function(t) {
|
|
2129
|
+
return t.replace(/^\s+|\s+$/g, "");
|
|
2130
|
+
}, bo = function(t) {
|
|
2131
|
+
return Object.prototype.toString.call(t) === "[object Array]";
|
|
2132
|
+
}, wo = function(t) {
|
|
2133
|
+
if (!t)
|
|
2134
|
+
return {};
|
|
2135
|
+
for (var e = {}, r = nt(t).split(`
|
|
2136
|
+
`), n = 0; n < r.length; n++) {
|
|
2137
|
+
var a = r[n], i = a.indexOf(":"), o = nt(a.slice(0, i)).toLowerCase(), s = nt(a.slice(i + 1));
|
|
2138
|
+
typeof e[o] > "u" ? e[o] = s : bo(e[o]) ? e[o].push(s) : e[o] = [e[o], s];
|
|
2139
|
+
}
|
|
2140
|
+
return e;
|
|
2141
|
+
};
|
|
2142
|
+
function he() {
|
|
2143
|
+
this.readyState = 0;
|
|
2144
|
+
}
|
|
2145
|
+
he.prototype.open = function(t, e) {
|
|
2146
|
+
this._method = t, this._url = e, this._resHeaders = "", this.readyState = 1, this.onreadystatechange();
|
|
2147
|
+
};
|
|
2148
|
+
he.prototype.abort = function() {
|
|
2149
|
+
this._controller && this._controller.abort();
|
|
2150
|
+
};
|
|
2151
|
+
he.prototype.getAllResponseHeaders = function() {
|
|
2152
|
+
return this._resHeaders;
|
|
2153
|
+
};
|
|
2154
|
+
he.prototype.setRequestHeader = function(t, e) {
|
|
2155
|
+
this._headers = this._headers || {}, this._headers[t] = e;
|
|
2156
|
+
};
|
|
2157
|
+
he.prototype.send = function(t) {
|
|
2158
|
+
var e = this, r = this._controller = typeof AbortController == "function" && new AbortController(), n = this.responseType !== "arraybuffer", a = {
|
|
2159
|
+
method: this._method,
|
|
2160
|
+
headers: this._headers,
|
|
2161
|
+
signal: r && r.signal,
|
|
2162
|
+
body: t
|
|
2163
|
+
// Some environments (like CloudFlare workers) don't support credentials in
|
|
2164
|
+
// RequestInitDict, and there doesn't seem to be any easy way to check for it,
|
|
2165
|
+
// so for now let's just make do with a window check :/
|
|
2166
|
+
};
|
|
2167
|
+
typeof window < "u" && (a.credentials = this.withCredentials ? "include" : "omit"), fetch(this._url, a).then(function(i) {
|
|
2168
|
+
return i.headers.forEach(function(o, s) {
|
|
2169
|
+
e._resHeaders += s + ": " + o + `\r
|
|
2170
|
+
`;
|
|
2171
|
+
}), e.status = i.status, e.statusText = i.statusText, e.readyState = 3, n ? i.text() : i.arrayBuffer();
|
|
2172
|
+
}).then(function(i) {
|
|
2173
|
+
n ? e.responseText = i : e.response = i, e.readyState = 4, e.onreadystatechange();
|
|
2174
|
+
}).catch(function(i) {
|
|
2175
|
+
if (i.name === "AbortError") {
|
|
2176
|
+
e.onabort();
|
|
2177
|
+
return;
|
|
2178
|
+
}
|
|
2179
|
+
e.onerror(i);
|
|
2180
|
+
});
|
|
2181
|
+
};
|
|
2182
|
+
var _o = he, Oo = yo, Eo = wo, ur = _o, So = function() {
|
|
2183
|
+
}, ee = typeof window > "u" ? void 0 : window, cr = ee ? "xhr" : "fetch", Fe = typeof XMLHttpRequest == "function" ? XMLHttpRequest : So, xo = "withCredentials" in new Fe(), Co = typeof XDomainRequest > "u" ? void 0 : XDomainRequest, tn = xo ? Fe : Co;
|
|
2184
|
+
ee || (Fe = ur, tn = ur);
|
|
2185
|
+
var Po = function(t, e) {
|
|
2186
|
+
var r = t.options, n = t.applyMiddleware("finalizeOptions", r), a = {}, i = ee && ee.location && !Oo(ee.location.href, n.url), o = t.applyMiddleware("interceptRequest", void 0, {
|
|
2187
|
+
adapter: cr,
|
|
2188
|
+
context: t
|
|
2189
|
+
});
|
|
2190
|
+
if (o) {
|
|
2191
|
+
var s = setTimeout(e, 0, null, o), u = function() {
|
|
2192
|
+
return clearTimeout(s);
|
|
2193
|
+
};
|
|
2194
|
+
return { abort: u };
|
|
2195
|
+
}
|
|
2196
|
+
var c = i ? new tn() : new Fe(), g = ee && ee.XDomainRequest && c instanceof ee.XDomainRequest, d = n.headers, p = n.timeout, x = !1, C = !1, E = !1;
|
|
2197
|
+
c.onerror = V, c.ontimeout = V, c.onabort = function() {
|
|
2198
|
+
x = !0;
|
|
2199
|
+
}, c.onprogress = function() {
|
|
2200
|
+
};
|
|
2201
|
+
var O = g ? "onload" : "onreadystatechange";
|
|
2202
|
+
if (c[O] = function() {
|
|
2203
|
+
$(), !(x || c.readyState !== 4 && !g) && c.status !== 0 && oe();
|
|
2204
|
+
}, c.open(
|
|
2205
|
+
n.method,
|
|
2206
|
+
n.url,
|
|
2207
|
+
!0
|
|
2208
|
+
// Always async
|
|
2209
|
+
), c.withCredentials = !!n.withCredentials, d && c.setRequestHeader)
|
|
2210
|
+
for (var b in d)
|
|
2211
|
+
d.hasOwnProperty(b) && c.setRequestHeader(b, d[b]);
|
|
2212
|
+
else if (d && g)
|
|
2213
|
+
throw new Error("Headers cannot be set on an XDomainRequest object");
|
|
2214
|
+
return n.rawBody && (c.responseType = "arraybuffer"), t.applyMiddleware("onRequest", { options: n, adapter: cr, request: c, context: t }), c.send(n.body || null), p && (a.connect = setTimeout(function() {
|
|
2215
|
+
return T("ETIMEDOUT");
|
|
2216
|
+
}, p.connect)), { abort: _ };
|
|
2217
|
+
function _() {
|
|
2218
|
+
x = !0, c && c.abort();
|
|
2219
|
+
}
|
|
2220
|
+
function T(q) {
|
|
2221
|
+
E = !0, c.abort();
|
|
2222
|
+
var R = new Error(q === "ESOCKETTIMEDOUT" ? "Socket timed out on request to " + n.url : "Connection timed out on request to " + n.url);
|
|
2223
|
+
R.code = q, t.channels.error.publish(R);
|
|
2224
|
+
}
|
|
2225
|
+
function $() {
|
|
2226
|
+
p && (F(), a.socket = setTimeout(function() {
|
|
2227
|
+
return T("ESOCKETTIMEDOUT");
|
|
2228
|
+
}, p.socket));
|
|
2229
|
+
}
|
|
2230
|
+
function F() {
|
|
2231
|
+
(x || c.readyState >= 2 && a.connect) && clearTimeout(a.connect), a.socket && clearTimeout(a.socket);
|
|
2232
|
+
}
|
|
2233
|
+
function V(q) {
|
|
2234
|
+
if (!C) {
|
|
2235
|
+
F(), C = !0, c = null;
|
|
2236
|
+
var R = q || new Error("Network error while attempting to reach " + n.url);
|
|
2237
|
+
R.isNetworkError = !0, R.request = n, e(R);
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
function ie() {
|
|
2241
|
+
var q = c.status, R = c.statusText;
|
|
2242
|
+
if (g && q === void 0)
|
|
2243
|
+
q = 200;
|
|
2244
|
+
else {
|
|
2245
|
+
if (q > 12e3 && q < 12156)
|
|
2246
|
+
return V();
|
|
2247
|
+
q = c.status === 1223 ? 204 : c.status, R = c.status === 1223 ? "No Content" : R;
|
|
2248
|
+
}
|
|
2249
|
+
return {
|
|
2250
|
+
body: c.response || c.responseText,
|
|
2251
|
+
url: n.url,
|
|
2252
|
+
method: n.method,
|
|
2253
|
+
headers: g ? {} : Eo(c.getAllResponseHeaders()),
|
|
2254
|
+
statusCode: q,
|
|
2255
|
+
statusMessage: R
|
|
2256
|
+
};
|
|
2257
|
+
}
|
|
2258
|
+
function oe() {
|
|
2259
|
+
if (!(x || C || E)) {
|
|
2260
|
+
if (c.status === 0) {
|
|
2261
|
+
V(new Error("Unknown XHR error"));
|
|
2262
|
+
return;
|
|
2263
|
+
}
|
|
2264
|
+
F(), C = !0, e(null, ie());
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
}, To = Po, jo = Xi, Do = zi, qo = lo, Mo = mo, Ao = To, Ro = ["request", "response", "progress", "error", "abort"], fr = ["processOptions", "validateOptions", "interceptRequest", "finalizeOptions", "onRequest", "onResponse", "onError", "onReturn", "onHeaders"], Io = function t() {
|
|
2268
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ao, n = [], a = fr.reduce(function(o, s) {
|
|
2269
|
+
return o[s] = o[s] || [], o;
|
|
2270
|
+
}, {
|
|
2271
|
+
processOptions: [qo],
|
|
2272
|
+
validateOptions: [Mo]
|
|
2273
|
+
});
|
|
2274
|
+
function i(o) {
|
|
2275
|
+
var s = Ro.reduce(function(E, O) {
|
|
2276
|
+
return E[O] = jo(), E;
|
|
2277
|
+
}, {}), u = Do(a), c = u("processOptions", o);
|
|
2278
|
+
u("validateOptions", c);
|
|
2279
|
+
var g = {
|
|
2280
|
+
options: c,
|
|
2281
|
+
channels: s,
|
|
2282
|
+
applyMiddleware: u
|
|
2283
|
+
// We need to hold a reference to the current, ongoing request,
|
|
2284
|
+
// in order to allow cancellation. In the case of the retry middleware,
|
|
2285
|
+
// a new request might be triggered
|
|
2286
|
+
}, d = null, p = s.request.subscribe(function(E) {
|
|
2287
|
+
d = r(E, function(O, b) {
|
|
2288
|
+
return C(O, b, E);
|
|
2289
|
+
});
|
|
2290
|
+
});
|
|
2291
|
+
s.abort.subscribe(function() {
|
|
2292
|
+
p(), d && d.abort();
|
|
2293
|
+
});
|
|
2294
|
+
var x = u("onReturn", s, g);
|
|
2295
|
+
return x === s && s.request.publish(g), x;
|
|
2296
|
+
function C(E, O, b) {
|
|
2297
|
+
var _ = E, T = O;
|
|
2298
|
+
if (!_)
|
|
2299
|
+
try {
|
|
2300
|
+
T = u("onResponse", O, b);
|
|
2301
|
+
} catch ($) {
|
|
2302
|
+
T = null, _ = $;
|
|
2303
|
+
}
|
|
2304
|
+
_ = _ && u("onError", _, b), _ ? s.error.publish(_) : T && s.response.publish(T);
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
return i.use = function(s) {
|
|
2308
|
+
if (!s)
|
|
2309
|
+
throw new Error("Tried to add middleware that resolved to falsey value");
|
|
2310
|
+
if (typeof s == "function")
|
|
2311
|
+
throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");
|
|
2312
|
+
if (s.onReturn && a.onReturn.length > 0)
|
|
2313
|
+
throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");
|
|
2314
|
+
return fr.forEach(function(u) {
|
|
2315
|
+
s[u] && a[u].push(s[u]);
|
|
2316
|
+
}), n.push(s), i;
|
|
2317
|
+
}, i.clone = function() {
|
|
2318
|
+
return t(n);
|
|
2319
|
+
}, e.forEach(i.use), i;
|
|
2320
|
+
}, $o = Io, _e = { exports: {} };
|
|
2321
|
+
typeof window < "u" ? _e.exports = window : typeof j < "u" ? _e.exports = j : typeof self < "u" ? _e.exports = self : _e.exports = {};
|
|
2322
|
+
var Uo = _e.exports, ko = Uo, lr = D, No = function() {
|
|
2323
|
+
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = t.implementation || ko.Observable;
|
|
2324
|
+
if (!e)
|
|
2325
|
+
throw new Error("`Observable` is not available in global scope, and no implementation was passed");
|
|
2326
|
+
return {
|
|
2327
|
+
onReturn: function(n, a) {
|
|
2328
|
+
return new e(function(i) {
|
|
2329
|
+
return n.error.subscribe(function(o) {
|
|
2330
|
+
return i.error(o);
|
|
2331
|
+
}), n.progress.subscribe(function(o) {
|
|
2332
|
+
return i.next(lr({ type: "progress" }, o));
|
|
2333
|
+
}), n.response.subscribe(function(o) {
|
|
2334
|
+
i.next(lr({ type: "response" }, o)), i.complete();
|
|
2335
|
+
}), n.request.publish(a), function() {
|
|
2336
|
+
return n.abort.publish();
|
|
2337
|
+
};
|
|
2338
|
+
});
|
|
2339
|
+
}
|
|
2340
|
+
};
|
|
2341
|
+
};
|
|
2342
|
+
/*!
|
|
2343
|
+
* isobject <https://github.com/jonschlinkert/isobject>
|
|
2344
|
+
*
|
|
2345
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2346
|
+
* Released under the MIT License.
|
|
2347
|
+
*/
|
|
2348
|
+
var Ho = function(e) {
|
|
2349
|
+
return e != null && typeof e == "object" && Array.isArray(e) === !1;
|
|
2350
|
+
};
|
|
2351
|
+
/*!
|
|
2352
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
2353
|
+
*
|
|
2354
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2355
|
+
* Released under the MIT License.
|
|
2356
|
+
*/
|
|
2357
|
+
var Wo = Ho;
|
|
2358
|
+
function dr(t) {
|
|
2359
|
+
return Wo(t) === !0 && Object.prototype.toString.call(t) === "[object Object]";
|
|
2360
|
+
}
|
|
2361
|
+
var Lo = function(e) {
|
|
2362
|
+
var r, n;
|
|
2363
|
+
return !(dr(e) === !1 || (r = e.constructor, typeof r != "function") || (n = r.prototype, dr(n) === !1) || n.hasOwnProperty("isPrototypeOf") === !1);
|
|
2364
|
+
}, Fo = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
2365
|
+
return typeof t;
|
|
2366
|
+
} : function(t) {
|
|
2367
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2368
|
+
}, hr = D, Bo = Lo, Yo = ["boolean", "string", "number"], Xo = function(e) {
|
|
2369
|
+
return !!e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
|
|
2370
|
+
}, zo = function() {
|
|
2371
|
+
return {
|
|
2372
|
+
processOptions: function(e) {
|
|
2373
|
+
var r = e.body;
|
|
2374
|
+
if (!r)
|
|
2375
|
+
return e;
|
|
2376
|
+
var n = typeof r.pipe == "function", a = !n && !Xo(r) && (Yo.indexOf(typeof r > "u" ? "undefined" : Fo(r)) !== -1 || Array.isArray(r) || Bo(r));
|
|
2377
|
+
return a ? hr({}, e, {
|
|
2378
|
+
body: JSON.stringify(e.body),
|
|
2379
|
+
headers: hr({}, e.headers, {
|
|
2380
|
+
"Content-Type": "application/json"
|
|
2381
|
+
})
|
|
2382
|
+
}) : e;
|
|
2383
|
+
}
|
|
2384
|
+
};
|
|
2385
|
+
}, at = D, Vo = function(t) {
|
|
2386
|
+
return {
|
|
2387
|
+
onResponse: function(r) {
|
|
2388
|
+
var n = r.headers["content-type"] || "", a = t && t.force || n.indexOf("application/json") !== -1;
|
|
2389
|
+
return !r.body || !n || !a ? r : at({}, r, { body: Go(r.body) });
|
|
2390
|
+
},
|
|
2391
|
+
processOptions: function(r) {
|
|
2392
|
+
return at({}, r, {
|
|
2393
|
+
headers: at({ Accept: "application/json" }, r.headers)
|
|
2394
|
+
});
|
|
2395
|
+
}
|
|
2396
|
+
};
|
|
2397
|
+
};
|
|
2398
|
+
function Go(t) {
|
|
2399
|
+
try {
|
|
2400
|
+
return JSON.parse(t);
|
|
2401
|
+
} catch (e) {
|
|
2402
|
+
throw e.message = "Failed to parsed response body as JSON: " + e.message, e;
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
var Qo = function() {
|
|
2406
|
+
return {
|
|
2407
|
+
onRequest: function(e) {
|
|
2408
|
+
if (e.adapter !== "xhr")
|
|
2409
|
+
return;
|
|
2410
|
+
var r = e.request, n = e.context;
|
|
2411
|
+
"upload" in r && "onprogress" in r.upload && (r.upload.onprogress = a("upload")), "onprogress" in r && (r.onprogress = a("download"));
|
|
2412
|
+
function a(i) {
|
|
2413
|
+
return function(o) {
|
|
2414
|
+
var s = o.lengthComputable ? o.loaded / o.total * 100 : -1;
|
|
2415
|
+
n.channels.progress.publish({
|
|
2416
|
+
stage: i,
|
|
2417
|
+
percent: s,
|
|
2418
|
+
total: o.total,
|
|
2419
|
+
loaded: o.loaded,
|
|
2420
|
+
lengthComputable: o.lengthComputable
|
|
2421
|
+
});
|
|
2422
|
+
};
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
};
|
|
2426
|
+
}, Jo = Qo, It = {}, ht = { exports: {} };
|
|
2427
|
+
(function(t, e) {
|
|
2428
|
+
var r = typeof Reflect < "u" ? Reflect.construct : void 0, n = Object.defineProperty, a = Error.captureStackTrace;
|
|
2429
|
+
a === void 0 && (a = function(c) {
|
|
2430
|
+
var g = new Error();
|
|
2431
|
+
n(c, "stack", {
|
|
2432
|
+
configurable: !0,
|
|
2433
|
+
get: function() {
|
|
2434
|
+
var p = g.stack;
|
|
2435
|
+
return n(this, "stack", {
|
|
2436
|
+
configurable: !0,
|
|
2437
|
+
value: p,
|
|
2438
|
+
writable: !0
|
|
2439
|
+
}), p;
|
|
2440
|
+
},
|
|
2441
|
+
set: function(p) {
|
|
2442
|
+
n(c, "stack", {
|
|
2443
|
+
configurable: !0,
|
|
2444
|
+
value: p,
|
|
2445
|
+
writable: !0
|
|
2446
|
+
});
|
|
2447
|
+
}
|
|
2448
|
+
});
|
|
2449
|
+
});
|
|
2450
|
+
function i(u) {
|
|
2451
|
+
u !== void 0 && n(this, "message", {
|
|
2452
|
+
configurable: !0,
|
|
2453
|
+
value: u,
|
|
2454
|
+
writable: !0
|
|
2455
|
+
});
|
|
2456
|
+
var c = this.constructor.name;
|
|
2457
|
+
c !== void 0 && c !== this.name && n(this, "name", {
|
|
2458
|
+
configurable: !0,
|
|
2459
|
+
value: c,
|
|
2460
|
+
writable: !0
|
|
2461
|
+
}), a(this, this.constructor);
|
|
2462
|
+
}
|
|
2463
|
+
i.prototype = Object.create(Error.prototype, {
|
|
2464
|
+
// See: https://github.com/JsCommunity/make-error/issues/4
|
|
2465
|
+
constructor: {
|
|
2466
|
+
configurable: !0,
|
|
2467
|
+
value: i,
|
|
2468
|
+
writable: !0
|
|
2469
|
+
}
|
|
2470
|
+
});
|
|
2471
|
+
var o = function() {
|
|
2472
|
+
function u(g, d) {
|
|
2473
|
+
return n(g, "name", {
|
|
2474
|
+
configurable: !0,
|
|
2475
|
+
value: d
|
|
2476
|
+
});
|
|
2477
|
+
}
|
|
2478
|
+
try {
|
|
2479
|
+
var c = function() {
|
|
2480
|
+
};
|
|
2481
|
+
if (u(c, "foo"), c.name === "foo")
|
|
2482
|
+
return u;
|
|
2483
|
+
} catch {
|
|
2484
|
+
}
|
|
2485
|
+
}();
|
|
2486
|
+
function s(u, c) {
|
|
2487
|
+
if (c == null || c === Error)
|
|
2488
|
+
c = i;
|
|
2489
|
+
else if (typeof c != "function")
|
|
2490
|
+
throw new TypeError("super_ should be a function");
|
|
2491
|
+
var g;
|
|
2492
|
+
if (typeof u == "string")
|
|
2493
|
+
g = u, u = r !== void 0 ? function() {
|
|
2494
|
+
return r(c, arguments, this.constructor);
|
|
2495
|
+
} : function() {
|
|
2496
|
+
c.apply(this, arguments);
|
|
2497
|
+
}, o !== void 0 && (o(u, g), g = void 0);
|
|
2498
|
+
else if (typeof u != "function")
|
|
2499
|
+
throw new TypeError("constructor should be either a string or a function");
|
|
2500
|
+
u.super_ = u.super = c;
|
|
2501
|
+
var d = {
|
|
2502
|
+
constructor: {
|
|
2503
|
+
configurable: !0,
|
|
2504
|
+
value: u,
|
|
2505
|
+
writable: !0
|
|
2506
|
+
}
|
|
2507
|
+
};
|
|
2508
|
+
return g !== void 0 && (d.name = {
|
|
2509
|
+
configurable: !0,
|
|
2510
|
+
value: g,
|
|
2511
|
+
writable: !0
|
|
2512
|
+
}), u.prototype = Object.create(c.prototype, d), u;
|
|
2513
|
+
}
|
|
2514
|
+
e = t.exports = s, e.BaseError = i;
|
|
2515
|
+
})(ht, ht.exports);
|
|
2516
|
+
var Ko = ht.exports, rn = Ko, nn = D;
|
|
2517
|
+
function $t(t) {
|
|
2518
|
+
var e = an(t);
|
|
2519
|
+
$t.super.call(this, e.message), nn(this, e);
|
|
2520
|
+
}
|
|
2521
|
+
function Ut(t) {
|
|
2522
|
+
var e = an(t);
|
|
2523
|
+
Ut.super.call(this, e.message), nn(this, e);
|
|
2524
|
+
}
|
|
2525
|
+
function an(t) {
|
|
2526
|
+
var e = t.body, r = {
|
|
2527
|
+
response: t,
|
|
2528
|
+
statusCode: t.statusCode,
|
|
2529
|
+
responseBody: es(e, t)
|
|
2530
|
+
};
|
|
2531
|
+
return e.error && e.message ? (r.message = "".concat(e.error, " - ").concat(e.message), r) : e.error && e.error.description ? (r.message = e.error.description, r.details = e.error, r) : (r.message = e.error || e.message || Zo(t), r);
|
|
2532
|
+
}
|
|
2533
|
+
function Zo(t) {
|
|
2534
|
+
var e = t.statusMessage ? " ".concat(t.statusMessage) : "";
|
|
2535
|
+
return "".concat(t.method, "-request to ").concat(t.url, " resulted in HTTP ").concat(t.statusCode).concat(e);
|
|
2536
|
+
}
|
|
2537
|
+
function es(t, e) {
|
|
2538
|
+
var r = (e.headers["content-type"] || "").toLowerCase(), n = r.indexOf("application/json") !== -1;
|
|
2539
|
+
return n ? JSON.stringify(t, null, 2) : t;
|
|
2540
|
+
}
|
|
2541
|
+
rn($t);
|
|
2542
|
+
rn(Ut);
|
|
2543
|
+
It.ClientError = $t;
|
|
2544
|
+
It.ServerError = Ut;
|
|
2545
|
+
var ts = [], rs = $o, ns = D, as = No, is = zo, os = Vo, ss = Jo, us = Hr, on = It, sn = on.ClientError, un = on.ServerError, cs = {
|
|
2546
|
+
onResponse: function(e) {
|
|
2547
|
+
if (e.statusCode >= 500)
|
|
2548
|
+
throw new un(e);
|
|
2549
|
+
if (e.statusCode >= 400)
|
|
2550
|
+
throw new sn(e);
|
|
2551
|
+
return e;
|
|
2552
|
+
}
|
|
2553
|
+
}, fs = {
|
|
2554
|
+
onResponse: function(e) {
|
|
2555
|
+
var r = e.headers["x-sanity-warning"], n = Array.isArray(r) ? r : [r];
|
|
2556
|
+
return n.filter(Boolean).forEach(function(a) {
|
|
2557
|
+
return console.warn(a);
|
|
2558
|
+
}), e;
|
|
2559
|
+
}
|
|
2560
|
+
}, ls = ts, ds = ls.concat([fs, is(), os(), ss(), cs, as({
|
|
2561
|
+
implementation: us
|
|
2562
|
+
})]), cn = rs(ds);
|
|
2563
|
+
function Be(t) {
|
|
2564
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : cn;
|
|
2565
|
+
return e(ns({
|
|
2566
|
+
maxRedirects: 0
|
|
2567
|
+
}, t));
|
|
2568
|
+
}
|
|
2569
|
+
Be.defaultRequester = cn;
|
|
2570
|
+
Be.ClientError = sn;
|
|
2571
|
+
Be.ServerError = un;
|
|
2572
|
+
var hs = Be, pr = D, ps = "X-Sanity-Project-ID", vs = function(t) {
|
|
2573
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = {}, n = e.token || t.token;
|
|
2574
|
+
n && (r.Authorization = "Bearer ".concat(n)), !e.useGlobalApi && !t.useProjectHostname && t.projectId && (r[ps] = t.projectId);
|
|
2575
|
+
var a = !!(typeof e.withCredentials > "u" ? t.token || t.withCredentials : e.withCredentials), i = typeof e.timeout > "u" ? t.timeout : e.timeout;
|
|
2576
|
+
return pr({}, e, {
|
|
2577
|
+
headers: pr({}, r, e.headers || {}),
|
|
2578
|
+
timeout: typeof i > "u" ? 5 * 60 * 1e3 : i,
|
|
2579
|
+
proxy: e.proxy || t.proxy,
|
|
2580
|
+
json: !0,
|
|
2581
|
+
withCredentials: a
|
|
2582
|
+
});
|
|
2583
|
+
}, fn = {}, Ce = {}, Ye = Mt, ms = Lr, Xe = function(e) {
|
|
2584
|
+
return (
|
|
2585
|
+
// eslint-disable-next-line no-console
|
|
2586
|
+
ms(function() {
|
|
2587
|
+
for (var r, n = arguments.length, a = new Array(n), i = 0; i < n; i++)
|
|
2588
|
+
a[i] = arguments[i];
|
|
2589
|
+
return (r = console).warn.apply(r, [e.join(" ")].concat(a));
|
|
2590
|
+
})
|
|
2591
|
+
);
|
|
2592
|
+
};
|
|
2593
|
+
Ce.printCdnWarning = Xe(["You are not using the Sanity CDN. That means your data is always fresh, but the CDN is faster and", "cheaper. Think about it! For more info, see ".concat(Ye("js-client-cdn-configuration"), "."), "To hide this warning, please set the `useCdn` option to either `true` or `false` when creating", "the client."]);
|
|
2594
|
+
Ce.printBrowserTokenWarning = Xe(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.", "See ".concat(Ye("js-client-browser-token"), " for more information and how to hide this warning.")]);
|
|
2595
|
+
Ce.printCdnTokenWarning = Xe(["You have set `useCdn` to `true` while also specifying a token. This is usually not what you", "want. The CDN cannot be used with an authorization token, since private data cannot be cached.", "See ".concat(Ye("js-client-usecdn-token"), " for more information.")]);
|
|
2596
|
+
Ce.printNoApiVersionSpecifiedWarning = Xe(["Using the Sanity client without specifying an API version is deprecated.", "See ".concat(Ye("js-client-api-version"))]);
|
|
2597
|
+
(function(t) {
|
|
2598
|
+
var e = Mt, r = D, n = te, a = Ce, i = "apicdn.sanity.io", o = {
|
|
2599
|
+
apiHost: "https://api.sanity.io",
|
|
2600
|
+
apiVersion: "1",
|
|
2601
|
+
useProjectHostname: !0,
|
|
2602
|
+
gradientMode: !1,
|
|
2603
|
+
isPromiseAPI: !0
|
|
2604
|
+
}, s = ["localhost", "127.0.0.1", "0.0.0.0"], u = function(g) {
|
|
2605
|
+
return s.indexOf(g) !== -1;
|
|
2606
|
+
};
|
|
2607
|
+
t.defaultConfig = o, t.initConfig = function(c, g) {
|
|
2608
|
+
var d = r({}, g, c);
|
|
2609
|
+
d.apiVersion || a.printNoApiVersionSpecifiedWarning();
|
|
2610
|
+
var p = r({}, o, d), x = p.gradientMode, C = !x && p.useProjectHostname;
|
|
2611
|
+
if (typeof Promise > "u") {
|
|
2612
|
+
var E = e("js-client-promise-polyfill");
|
|
2613
|
+
throw new Error("No native Promise-implementation found, polyfill needed - see ".concat(E));
|
|
2614
|
+
}
|
|
2615
|
+
if (x && !p.namespace)
|
|
2616
|
+
throw new Error("Configuration must contain `namespace` when running in gradient mode");
|
|
2617
|
+
if (C && !p.projectId)
|
|
2618
|
+
throw new Error("Configuration must contain `projectId`");
|
|
2619
|
+
var O = typeof window < "u" && window.location && window.location.hostname, b = O && u(window.location.hostname);
|
|
2620
|
+
if (O && b && p.token && p.ignoreBrowserTokenWarning !== !0 ? a.printBrowserTokenWarning() : (!O || b) && p.useCdn && p.token ? a.printCdnTokenWarning() : typeof p.useCdn > "u" && a.printCdnWarning(), C && n.projectId(p.projectId), !x && p.dataset && n.dataset(p.dataset, p.gradientMode), "requestTagPrefix" in p && (p.requestTagPrefix = p.requestTagPrefix ? n.requestTag(p.requestTagPrefix).replace(/\.+$/, "") : void 0), p.apiVersion = "".concat(p.apiVersion).replace(/^v/, ""), p.isDefaultApi = p.apiHost === o.apiHost, p.useCdn = !!p.useCdn && !p.token && !p.withCredentials, t.validateApiVersion(p.apiVersion), p.gradientMode)
|
|
2621
|
+
p.url = p.apiHost, p.cdnUrl = p.apiHost;
|
|
2622
|
+
else {
|
|
2623
|
+
var _ = p.apiHost.split("://", 2), T = _[0], $ = _[1], F = p.isDefaultApi ? i : $;
|
|
2624
|
+
p.useProjectHostname ? (p.url = "".concat(T, "://").concat(p.projectId, ".").concat($, "/v").concat(p.apiVersion), p.cdnUrl = "".concat(T, "://").concat(p.projectId, ".").concat(F, "/v").concat(p.apiVersion)) : (p.url = "".concat(p.apiHost, "/v").concat(p.apiVersion), p.cdnUrl = p.url);
|
|
2625
|
+
}
|
|
2626
|
+
return p;
|
|
2627
|
+
}, t.validateApiVersion = function(g) {
|
|
2628
|
+
if (!(g === "1" || g === "X")) {
|
|
2629
|
+
var d = new Date(g), p = /^\d{4}-\d{2}-\d{2}$/.test(g) && d instanceof Date && d.getTime() > 0;
|
|
2630
|
+
if (!p)
|
|
2631
|
+
throw new Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`");
|
|
2632
|
+
}
|
|
2633
|
+
};
|
|
2634
|
+
})(fn);
|
|
2635
|
+
function vr(t, e) {
|
|
2636
|
+
var r = Object.keys(t);
|
|
2637
|
+
if (Object.getOwnPropertySymbols) {
|
|
2638
|
+
var n = Object.getOwnPropertySymbols(t);
|
|
2639
|
+
e && (n = n.filter(function(a) {
|
|
2640
|
+
return Object.getOwnPropertyDescriptor(t, a).enumerable;
|
|
2641
|
+
})), r.push.apply(r, n);
|
|
2642
|
+
}
|
|
2643
|
+
return r;
|
|
2644
|
+
}
|
|
2645
|
+
function gs(t) {
|
|
2646
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
2647
|
+
var r = arguments[e] != null ? arguments[e] : {};
|
|
2648
|
+
e % 2 ? vr(Object(r), !0).forEach(function(n) {
|
|
2649
|
+
ys(t, n, r[n]);
|
|
2650
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : vr(Object(r)).forEach(function(n) {
|
|
2651
|
+
Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(r, n));
|
|
2652
|
+
});
|
|
2653
|
+
}
|
|
2654
|
+
return t;
|
|
2655
|
+
}
|
|
2656
|
+
function ys(t, e, r) {
|
|
2657
|
+
return e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
2658
|
+
}
|
|
2659
|
+
var de = D, bs = Oe, ws = bs.filter, _s = Se, Os = _s.map, Es = _t, Ss = Rr, xs = Oi, Cs = xi, Ps = Pi, Ts = Wi, js = Fi, Ds = Yi, ze = hs, qs = vs, ln = fn, Ms = ln.defaultConfig, As = ln.initConfig, Rs = te, Is = function(e) {
|
|
2660
|
+
return e.toPromise();
|
|
2661
|
+
};
|
|
2662
|
+
function W() {
|
|
2663
|
+
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ms;
|
|
2664
|
+
if (!(this instanceof W))
|
|
2665
|
+
return new W(t);
|
|
2666
|
+
if (this.config(t), this.assets = new Ts(this), this.datasets = new Cs(this), this.projects = new Ps(this), this.users = new js(this), this.auth = new Ds(this), this.clientConfig.isPromiseAPI) {
|
|
2667
|
+
var e = de({}, this.clientConfig, {
|
|
2668
|
+
isPromiseAPI: !1
|
|
2669
|
+
});
|
|
2670
|
+
this.observable = new W(e);
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
de(W.prototype, xs);
|
|
2674
|
+
de(W.prototype, {
|
|
2675
|
+
clone: function() {
|
|
2676
|
+
return new W(this.config());
|
|
2677
|
+
},
|
|
2678
|
+
config: function(e) {
|
|
2679
|
+
if (typeof e > "u")
|
|
2680
|
+
return de({}, this.clientConfig);
|
|
2681
|
+
if (this.observable) {
|
|
2682
|
+
var r = de({}, e, {
|
|
2683
|
+
isPromiseAPI: !1
|
|
2684
|
+
});
|
|
2685
|
+
this.observable.config(r);
|
|
2686
|
+
}
|
|
2687
|
+
return this.clientConfig = As(e, this.clientConfig || {}), this;
|
|
2688
|
+
},
|
|
2689
|
+
withConfig: function(e) {
|
|
2690
|
+
return this.clone().config(e);
|
|
2691
|
+
},
|
|
2692
|
+
getUrl: function(e) {
|
|
2693
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = r ? this.clientConfig.cdnUrl : this.clientConfig.url;
|
|
2694
|
+
return "".concat(n, "/").concat(e.replace(/^\//, ""));
|
|
2695
|
+
},
|
|
2696
|
+
isPromiseAPI: function() {
|
|
2697
|
+
return this.clientConfig.isPromiseAPI;
|
|
2698
|
+
},
|
|
2699
|
+
_requestObservable: function(e) {
|
|
2700
|
+
var r = e.url || e.uri, n = typeof e.canUseCdn > "u" ? ["GET", "HEAD"].indexOf(e.method || "GET") >= 0 && r.indexOf("/data/") === 0 : e.canUseCdn, a = this.clientConfig.useCdn && n, i = e.tag && this.clientConfig.requestTagPrefix ? [this.clientConfig.requestTagPrefix, e.tag].join(".") : e.tag || this.clientConfig.requestTagPrefix;
|
|
2701
|
+
i && (e.query = gs({
|
|
2702
|
+
tag: Rs.requestTag(i)
|
|
2703
|
+
}, e.query));
|
|
2704
|
+
var o = qs(this.clientConfig, de({}, e, {
|
|
2705
|
+
url: this.getUrl(r, a)
|
|
2706
|
+
}));
|
|
2707
|
+
return ze(o, this.clientConfig.requester);
|
|
2708
|
+
},
|
|
2709
|
+
request: function(e) {
|
|
2710
|
+
var r = this._requestObservable(e).pipe(ws(function(n) {
|
|
2711
|
+
return n.type === "response";
|
|
2712
|
+
}), Os(function(n) {
|
|
2713
|
+
return n.body;
|
|
2714
|
+
}));
|
|
2715
|
+
return this.isPromiseAPI() ? Is(r) : r;
|
|
2716
|
+
}
|
|
2717
|
+
});
|
|
2718
|
+
W.Patch = Es;
|
|
2719
|
+
W.Transaction = Ss;
|
|
2720
|
+
W.ClientError = ze.ClientError;
|
|
2721
|
+
W.ServerError = ze.ServerError;
|
|
2722
|
+
W.requester = ze.defaultRequester;
|
|
2723
|
+
var $s = W;
|
|
2724
|
+
const Us = /* @__PURE__ */ Pr($s);
|
|
2725
|
+
var dn = { exports: {} };
|
|
2726
|
+
(function(t, e) {
|
|
2727
|
+
(function(r, n) {
|
|
2728
|
+
t.exports = n();
|
|
2729
|
+
})(j, function() {
|
|
2730
|
+
function r() {
|
|
2731
|
+
return r = Object.assign || function(l) {
|
|
2732
|
+
for (var h = 1; h < arguments.length; h++) {
|
|
2733
|
+
var v = arguments[h];
|
|
2734
|
+
for (var f in v)
|
|
2735
|
+
Object.prototype.hasOwnProperty.call(v, f) && (l[f] = v[f]);
|
|
2736
|
+
}
|
|
2737
|
+
return l;
|
|
2738
|
+
}, r.apply(this, arguments);
|
|
2739
|
+
}
|
|
2740
|
+
function n(l, h) {
|
|
2741
|
+
if (l) {
|
|
2742
|
+
if (typeof l == "string")
|
|
2743
|
+
return a(l, h);
|
|
2744
|
+
var v = Object.prototype.toString.call(l).slice(8, -1);
|
|
2745
|
+
if (v === "Object" && l.constructor && (v = l.constructor.name), v === "Map" || v === "Set")
|
|
2746
|
+
return Array.from(l);
|
|
2747
|
+
if (v === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v))
|
|
2748
|
+
return a(l, h);
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
function a(l, h) {
|
|
2752
|
+
(h == null || h > l.length) && (h = l.length);
|
|
2753
|
+
for (var v = 0, f = new Array(h); v < h; v++)
|
|
2754
|
+
f[v] = l[v];
|
|
2755
|
+
return f;
|
|
2756
|
+
}
|
|
2757
|
+
function i(l, h) {
|
|
2758
|
+
var v = typeof Symbol < "u" && l[Symbol.iterator] || l["@@iterator"];
|
|
2759
|
+
if (v)
|
|
2760
|
+
return (v = v.call(l)).next.bind(v);
|
|
2761
|
+
if (Array.isArray(l) || (v = n(l)) || h && l && typeof l.length == "number") {
|
|
2762
|
+
v && (l = v);
|
|
2763
|
+
var f = 0;
|
|
2764
|
+
return function() {
|
|
2765
|
+
return f >= l.length ? {
|
|
2766
|
+
done: !0
|
|
2767
|
+
} : {
|
|
2768
|
+
done: !1,
|
|
2769
|
+
value: l[f++]
|
|
2770
|
+
};
|
|
2771
|
+
};
|
|
2772
|
+
}
|
|
2773
|
+
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2774
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
2775
|
+
}
|
|
2776
|
+
var o = "image-Tb9Ew8CXIwaY6R1kjMvI0uRR-2000x3000-jpg";
|
|
2777
|
+
function s(l) {
|
|
2778
|
+
var h = l.split("-"), v = h[1], f = h[2], w = h[3];
|
|
2779
|
+
if (!v || !f || !w)
|
|
2780
|
+
throw new Error("Malformed asset _ref '" + l + `'. Expected an id like "` + o + '".');
|
|
2781
|
+
var y = f.split("x"), P = y[0], A = y[1], L = +P, U = +A, k = isFinite(L) && isFinite(U);
|
|
2782
|
+
if (!k)
|
|
2783
|
+
throw new Error("Malformed asset _ref '" + l + `'. Expected an id like "` + o + '".');
|
|
2784
|
+
return {
|
|
2785
|
+
id: v,
|
|
2786
|
+
width: L,
|
|
2787
|
+
height: U,
|
|
2788
|
+
format: w
|
|
2789
|
+
};
|
|
2790
|
+
}
|
|
2791
|
+
var u = function(h) {
|
|
2792
|
+
var v = h;
|
|
2793
|
+
return v ? typeof v._ref == "string" : !1;
|
|
2794
|
+
}, c = function(h) {
|
|
2795
|
+
var v = h;
|
|
2796
|
+
return v ? typeof v._id == "string" : !1;
|
|
2797
|
+
}, g = function(h) {
|
|
2798
|
+
var v = h;
|
|
2799
|
+
return v && v.asset ? typeof v.asset.url == "string" : !1;
|
|
2800
|
+
};
|
|
2801
|
+
function d(l) {
|
|
2802
|
+
if (!l)
|
|
2803
|
+
return null;
|
|
2804
|
+
var h;
|
|
2805
|
+
if (typeof l == "string" && p(l))
|
|
2806
|
+
h = {
|
|
2807
|
+
asset: {
|
|
2808
|
+
_ref: x(l)
|
|
2809
|
+
}
|
|
2810
|
+
};
|
|
2811
|
+
else if (typeof l == "string")
|
|
2812
|
+
h = {
|
|
2813
|
+
asset: {
|
|
2814
|
+
_ref: l
|
|
2815
|
+
}
|
|
2816
|
+
};
|
|
2817
|
+
else if (u(l))
|
|
2818
|
+
h = {
|
|
2819
|
+
asset: l
|
|
2820
|
+
};
|
|
2821
|
+
else if (c(l))
|
|
2822
|
+
h = {
|
|
2823
|
+
asset: {
|
|
2824
|
+
_ref: l._id || ""
|
|
2825
|
+
}
|
|
2826
|
+
};
|
|
2827
|
+
else if (g(l))
|
|
2828
|
+
h = {
|
|
2829
|
+
asset: {
|
|
2830
|
+
_ref: x(l.asset.url)
|
|
2831
|
+
}
|
|
2832
|
+
};
|
|
2833
|
+
else if (typeof l.asset == "object")
|
|
2834
|
+
h = r({}, l);
|
|
2835
|
+
else
|
|
2836
|
+
return null;
|
|
2837
|
+
var v = l;
|
|
2838
|
+
return v.crop && (h.crop = v.crop), v.hotspot && (h.hotspot = v.hotspot), C(h);
|
|
2839
|
+
}
|
|
2840
|
+
function p(l) {
|
|
2841
|
+
return /^https?:\/\//.test("" + l);
|
|
2842
|
+
}
|
|
2843
|
+
function x(l) {
|
|
2844
|
+
var h = l.split("/").slice(-1);
|
|
2845
|
+
return ("image-" + h[0]).replace(/\.([a-z]+)$/, "-$1");
|
|
2846
|
+
}
|
|
2847
|
+
function C(l) {
|
|
2848
|
+
if (l.crop && l.hotspot)
|
|
2849
|
+
return l;
|
|
2850
|
+
var h = r({}, l);
|
|
2851
|
+
return h.crop || (h.crop = {
|
|
2852
|
+
left: 0,
|
|
2853
|
+
top: 0,
|
|
2854
|
+
bottom: 0,
|
|
2855
|
+
right: 0
|
|
2856
|
+
}), h.hotspot || (h.hotspot = {
|
|
2857
|
+
x: 0.5,
|
|
2858
|
+
y: 0.5,
|
|
2859
|
+
height: 1,
|
|
2860
|
+
width: 1
|
|
2861
|
+
}), h;
|
|
2862
|
+
}
|
|
2863
|
+
var E = [["width", "w"], ["height", "h"], ["format", "fm"], ["download", "dl"], ["blur", "blur"], ["sharpen", "sharp"], ["invert", "invert"], ["orientation", "or"], ["minHeight", "min-h"], ["maxHeight", "max-h"], ["minWidth", "min-w"], ["maxWidth", "max-w"], ["quality", "q"], ["fit", "fit"], ["crop", "crop"], ["saturation", "sat"], ["auto", "auto"], ["dpr", "dpr"], ["pad", "pad"]];
|
|
2864
|
+
function O(l) {
|
|
2865
|
+
var h = r({}, l || {}), v = h.source;
|
|
2866
|
+
delete h.source;
|
|
2867
|
+
var f = d(v);
|
|
2868
|
+
if (!f)
|
|
2869
|
+
throw new Error("Unable to resolve image URL from source (" + JSON.stringify(v) + ")");
|
|
2870
|
+
var w = f.asset._ref || f.asset._id || "", y = s(w), P = Math.round(f.crop.left * y.width), A = Math.round(f.crop.top * y.height), L = {
|
|
2871
|
+
left: P,
|
|
2872
|
+
top: A,
|
|
2873
|
+
width: Math.round(y.width - f.crop.right * y.width - P),
|
|
2874
|
+
height: Math.round(y.height - f.crop.bottom * y.height - A)
|
|
2875
|
+
}, U = f.hotspot.height * y.height / 2, k = f.hotspot.width * y.width / 2, G = f.hotspot.x * y.width, re = f.hotspot.y * y.height, B = {
|
|
2876
|
+
left: G - k,
|
|
2877
|
+
top: re - U,
|
|
2878
|
+
right: G + k,
|
|
2879
|
+
bottom: re + U
|
|
2880
|
+
};
|
|
2881
|
+
return h.rect || h.focalPoint || h.ignoreImageParams || h.crop || (h = r({}, h, _({
|
|
2882
|
+
crop: L,
|
|
2883
|
+
hotspot: B
|
|
2884
|
+
}, h))), b(r({}, h, {
|
|
2885
|
+
asset: y
|
|
2886
|
+
}));
|
|
2887
|
+
}
|
|
2888
|
+
function b(l) {
|
|
2889
|
+
var h = (l.baseUrl || "https://cdn.sanity.io").replace(/\/+$/, ""), v = l.asset.id + "-" + l.asset.width + "x" + l.asset.height + "." + l.asset.format, f = h + "/images/" + l.projectId + "/" + l.dataset + "/" + v, w = [];
|
|
2890
|
+
if (l.rect) {
|
|
2891
|
+
var y = l.rect, P = y.left, A = y.top, L = y.width, U = y.height, k = P !== 0 || A !== 0 || U !== l.asset.height || L !== l.asset.width;
|
|
2892
|
+
k && w.push("rect=" + P + "," + A + "," + L + "," + U);
|
|
2893
|
+
}
|
|
2894
|
+
l.bg && w.push("bg=" + l.bg), l.focalPoint && (w.push("fp-x=" + l.focalPoint.x), w.push("fp-y=" + l.focalPoint.y));
|
|
2895
|
+
var G = [l.flipHorizontal && "h", l.flipVertical && "v"].filter(Boolean).join("");
|
|
2896
|
+
return G && w.push("flip=" + G), E.forEach(function(re) {
|
|
2897
|
+
var B = re[0], ne = re[1];
|
|
2898
|
+
typeof l[B] < "u" ? w.push(ne + "=" + encodeURIComponent(l[B])) : typeof l[ne] < "u" && w.push(ne + "=" + encodeURIComponent(l[ne]));
|
|
2899
|
+
}), w.length === 0 ? f : f + "?" + w.join("&");
|
|
2900
|
+
}
|
|
2901
|
+
function _(l, h) {
|
|
2902
|
+
var v, f = h.width, w = h.height;
|
|
2903
|
+
if (!(f && w))
|
|
2904
|
+
return {
|
|
2905
|
+
width: f,
|
|
2906
|
+
height: w,
|
|
2907
|
+
rect: l.crop
|
|
2908
|
+
};
|
|
2909
|
+
var y = l.crop, P = l.hotspot, A = f / w, L = y.width / y.height;
|
|
2910
|
+
if (L > A) {
|
|
2911
|
+
var U = Math.round(y.height), k = Math.round(U * A), G = Math.max(0, Math.round(y.top)), re = Math.round((P.right - P.left) / 2 + P.left), B = Math.max(0, Math.round(re - k / 2));
|
|
2912
|
+
B < y.left ? B = y.left : B + k > y.left + y.width && (B = y.left + y.width - k), v = {
|
|
2913
|
+
left: B,
|
|
2914
|
+
top: G,
|
|
2915
|
+
width: k,
|
|
2916
|
+
height: U
|
|
2917
|
+
};
|
|
2918
|
+
} else {
|
|
2919
|
+
var ne = y.width, Pe = Math.round(ne / A), mn = Math.max(0, Math.round(y.left)), gn = Math.round((P.bottom - P.top) / 2 + P.top), ve = Math.max(0, Math.round(gn - Pe / 2));
|
|
2920
|
+
ve < y.top ? ve = y.top : ve + Pe > y.top + y.height && (ve = y.top + y.height - Pe), v = {
|
|
2921
|
+
left: mn,
|
|
2922
|
+
top: ve,
|
|
2923
|
+
width: ne,
|
|
2924
|
+
height: Pe
|
|
2925
|
+
};
|
|
2926
|
+
}
|
|
2927
|
+
return {
|
|
2928
|
+
width: f,
|
|
2929
|
+
height: w,
|
|
2930
|
+
rect: v
|
|
2931
|
+
};
|
|
2932
|
+
}
|
|
2933
|
+
var T = ["clip", "crop", "fill", "fillmax", "max", "scale", "min"], $ = ["top", "bottom", "left", "right", "center", "focalpoint", "entropy"], F = ["format"];
|
|
2934
|
+
function V(l) {
|
|
2935
|
+
return l && "config" in l ? typeof l.config == "function" : !1;
|
|
2936
|
+
}
|
|
2937
|
+
function ie(l) {
|
|
2938
|
+
return l && "clientConfig" in l ? typeof l.clientConfig == "object" : !1;
|
|
2939
|
+
}
|
|
2940
|
+
function oe(l) {
|
|
2941
|
+
for (var h = E, v = i(h), f; !(f = v()).done; ) {
|
|
2942
|
+
var w = f.value, y = w[0], P = w[1];
|
|
2943
|
+
if (l === y || l === P)
|
|
2944
|
+
return y;
|
|
2945
|
+
}
|
|
2946
|
+
return l;
|
|
2947
|
+
}
|
|
2948
|
+
function q(l) {
|
|
2949
|
+
if (V(l)) {
|
|
2950
|
+
var h = l.config(), v = h.apiHost, f = h.projectId, w = h.dataset, y = v || "https://api.sanity.io";
|
|
2951
|
+
return new R(null, {
|
|
2952
|
+
baseUrl: y.replace(/^https:\/\/api\./, "https://cdn."),
|
|
2953
|
+
projectId: f,
|
|
2954
|
+
dataset: w
|
|
2955
|
+
});
|
|
2956
|
+
}
|
|
2957
|
+
var P = l;
|
|
2958
|
+
if (ie(P)) {
|
|
2959
|
+
var A = P.clientConfig, L = A.apiHost, U = A.projectId, k = A.dataset, G = L || "https://api.sanity.io";
|
|
2960
|
+
return new R(null, {
|
|
2961
|
+
baseUrl: G.replace(/^https:\/\/api\./, "https://cdn."),
|
|
2962
|
+
projectId: U,
|
|
2963
|
+
dataset: k
|
|
2964
|
+
});
|
|
2965
|
+
}
|
|
2966
|
+
return new R(null, l);
|
|
2967
|
+
}
|
|
2968
|
+
var R = /* @__PURE__ */ function() {
|
|
2969
|
+
function l(v, f) {
|
|
2970
|
+
this.options = void 0, this.options = v ? r({}, v.options || {}, f || {}) : r({}, f || {});
|
|
2971
|
+
}
|
|
2972
|
+
var h = l.prototype;
|
|
2973
|
+
return h.withOptions = function(f) {
|
|
2974
|
+
var w = f.baseUrl || this.options.baseUrl, y = {
|
|
2975
|
+
baseUrl: w
|
|
2976
|
+
};
|
|
2977
|
+
for (var P in f)
|
|
2978
|
+
if (f.hasOwnProperty(P)) {
|
|
2979
|
+
var A = oe(P);
|
|
2980
|
+
y[A] = f[P];
|
|
2981
|
+
}
|
|
2982
|
+
return new l(this, r({
|
|
2983
|
+
baseUrl: w
|
|
2984
|
+
}, y));
|
|
2985
|
+
}, h.image = function(f) {
|
|
2986
|
+
return this.withOptions({
|
|
2987
|
+
source: f
|
|
2988
|
+
});
|
|
2989
|
+
}, h.dataset = function(f) {
|
|
2990
|
+
return this.withOptions({
|
|
2991
|
+
dataset: f
|
|
2992
|
+
});
|
|
2993
|
+
}, h.projectId = function(f) {
|
|
2994
|
+
return this.withOptions({
|
|
2995
|
+
projectId: f
|
|
2996
|
+
});
|
|
2997
|
+
}, h.bg = function(f) {
|
|
2998
|
+
return this.withOptions({
|
|
2999
|
+
bg: f
|
|
3000
|
+
});
|
|
3001
|
+
}, h.dpr = function(f) {
|
|
3002
|
+
return this.withOptions(f && f !== 1 ? {
|
|
3003
|
+
dpr: f
|
|
3004
|
+
} : {});
|
|
3005
|
+
}, h.width = function(f) {
|
|
3006
|
+
return this.withOptions({
|
|
3007
|
+
width: f
|
|
3008
|
+
});
|
|
3009
|
+
}, h.height = function(f) {
|
|
3010
|
+
return this.withOptions({
|
|
3011
|
+
height: f
|
|
3012
|
+
});
|
|
3013
|
+
}, h.focalPoint = function(f, w) {
|
|
3014
|
+
return this.withOptions({
|
|
3015
|
+
focalPoint: {
|
|
3016
|
+
x: f,
|
|
3017
|
+
y: w
|
|
3018
|
+
}
|
|
3019
|
+
});
|
|
3020
|
+
}, h.maxWidth = function(f) {
|
|
3021
|
+
return this.withOptions({
|
|
3022
|
+
maxWidth: f
|
|
3023
|
+
});
|
|
3024
|
+
}, h.minWidth = function(f) {
|
|
3025
|
+
return this.withOptions({
|
|
3026
|
+
minWidth: f
|
|
3027
|
+
});
|
|
3028
|
+
}, h.maxHeight = function(f) {
|
|
3029
|
+
return this.withOptions({
|
|
3030
|
+
maxHeight: f
|
|
3031
|
+
});
|
|
3032
|
+
}, h.minHeight = function(f) {
|
|
3033
|
+
return this.withOptions({
|
|
3034
|
+
minHeight: f
|
|
3035
|
+
});
|
|
3036
|
+
}, h.size = function(f, w) {
|
|
3037
|
+
return this.withOptions({
|
|
3038
|
+
width: f,
|
|
3039
|
+
height: w
|
|
3040
|
+
});
|
|
3041
|
+
}, h.blur = function(f) {
|
|
3042
|
+
return this.withOptions({
|
|
3043
|
+
blur: f
|
|
3044
|
+
});
|
|
3045
|
+
}, h.sharpen = function(f) {
|
|
3046
|
+
return this.withOptions({
|
|
3047
|
+
sharpen: f
|
|
3048
|
+
});
|
|
3049
|
+
}, h.rect = function(f, w, y, P) {
|
|
3050
|
+
return this.withOptions({
|
|
3051
|
+
rect: {
|
|
3052
|
+
left: f,
|
|
3053
|
+
top: w,
|
|
3054
|
+
width: y,
|
|
3055
|
+
height: P
|
|
3056
|
+
}
|
|
3057
|
+
});
|
|
3058
|
+
}, h.format = function(f) {
|
|
3059
|
+
return this.withOptions({
|
|
3060
|
+
format: f
|
|
3061
|
+
});
|
|
3062
|
+
}, h.invert = function(f) {
|
|
3063
|
+
return this.withOptions({
|
|
3064
|
+
invert: f
|
|
3065
|
+
});
|
|
3066
|
+
}, h.orientation = function(f) {
|
|
3067
|
+
return this.withOptions({
|
|
3068
|
+
orientation: f
|
|
3069
|
+
});
|
|
3070
|
+
}, h.quality = function(f) {
|
|
3071
|
+
return this.withOptions({
|
|
3072
|
+
quality: f
|
|
3073
|
+
});
|
|
3074
|
+
}, h.forceDownload = function(f) {
|
|
3075
|
+
return this.withOptions({
|
|
3076
|
+
download: f
|
|
3077
|
+
});
|
|
3078
|
+
}, h.flipHorizontal = function() {
|
|
3079
|
+
return this.withOptions({
|
|
3080
|
+
flipHorizontal: !0
|
|
3081
|
+
});
|
|
3082
|
+
}, h.flipVertical = function() {
|
|
3083
|
+
return this.withOptions({
|
|
3084
|
+
flipVertical: !0
|
|
3085
|
+
});
|
|
3086
|
+
}, h.ignoreImageParams = function() {
|
|
3087
|
+
return this.withOptions({
|
|
3088
|
+
ignoreImageParams: !0
|
|
3089
|
+
});
|
|
3090
|
+
}, h.fit = function(f) {
|
|
3091
|
+
if (T.indexOf(f) === -1)
|
|
3092
|
+
throw new Error('Invalid fit mode "' + f + '"');
|
|
3093
|
+
return this.withOptions({
|
|
3094
|
+
fit: f
|
|
3095
|
+
});
|
|
3096
|
+
}, h.crop = function(f) {
|
|
3097
|
+
if ($.indexOf(f) === -1)
|
|
3098
|
+
throw new Error('Invalid crop mode "' + f + '"');
|
|
3099
|
+
return this.withOptions({
|
|
3100
|
+
crop: f
|
|
3101
|
+
});
|
|
3102
|
+
}, h.saturation = function(f) {
|
|
3103
|
+
return this.withOptions({
|
|
3104
|
+
saturation: f
|
|
3105
|
+
});
|
|
3106
|
+
}, h.auto = function(f) {
|
|
3107
|
+
if (F.indexOf(f) === -1)
|
|
3108
|
+
throw new Error('Invalid auto mode "' + f + '"');
|
|
3109
|
+
return this.withOptions({
|
|
3110
|
+
auto: f
|
|
3111
|
+
});
|
|
3112
|
+
}, h.pad = function(f) {
|
|
3113
|
+
return this.withOptions({
|
|
3114
|
+
pad: f
|
|
3115
|
+
});
|
|
3116
|
+
}, h.url = function() {
|
|
3117
|
+
return O(this.options);
|
|
3118
|
+
}, h.toString = function() {
|
|
3119
|
+
return this.url();
|
|
3120
|
+
}, l;
|
|
3121
|
+
}();
|
|
3122
|
+
return q;
|
|
3123
|
+
});
|
|
3124
|
+
})(dn);
|
|
3125
|
+
var ks = dn.exports;
|
|
3126
|
+
const Ns = /* @__PURE__ */ Pr(ks), pe = Us({
|
|
3127
|
+
projectId: "m5ik5me8",
|
|
3128
|
+
dataset: "production",
|
|
3129
|
+
apiVersion: "2021-10-26",
|
|
3130
|
+
// use current UTC date - see "specifying API version"!
|
|
3131
|
+
token: "",
|
|
3132
|
+
// or leave blank for unauthenticated usage
|
|
3133
|
+
useCdn: !0
|
|
3134
|
+
// `false` if you want to ensure fresh data
|
|
3135
|
+
}), Hs = Ns(pe), kt = (t) => Hs.image(t), Ws = async () => {
|
|
3136
|
+
const t = "*[_type == 'banner']";
|
|
3137
|
+
return await pe.fetch(t);
|
|
3138
|
+
}, Ls = async () => {
|
|
3139
|
+
const t = `*[_type == 'event'] | order(startDate asc)
|
|
3140
|
+
{
|
|
3141
|
+
name,
|
|
3142
|
+
image,
|
|
3143
|
+
startDate,
|
|
3144
|
+
endDate,
|
|
3145
|
+
shortDescription,
|
|
3146
|
+
buttons
|
|
3147
|
+
}`;
|
|
3148
|
+
return await pe.fetch(t);
|
|
3149
|
+
}, Fs = async () => {
|
|
3150
|
+
const t = `*[_type == 'board-event'] | order(startDate asc)
|
|
3151
|
+
{
|
|
3152
|
+
name,
|
|
3153
|
+
image,
|
|
3154
|
+
startDate,
|
|
3155
|
+
endDate,
|
|
3156
|
+
shortDescription,
|
|
3157
|
+
buttons
|
|
3158
|
+
}`;
|
|
3159
|
+
return await pe.fetch(t);
|
|
3160
|
+
}, Bs = async () => {
|
|
3161
|
+
const t = "*[_type == 'category']|order(orderRank)";
|
|
3162
|
+
return pe.fetch(t);
|
|
3163
|
+
}, Ys = async () => {
|
|
3164
|
+
const t = "*[_type == 'rateCategory']|order(orderRank)";
|
|
3165
|
+
return pe.fetch(t);
|
|
3166
|
+
}, Xs = "_banner_1d1ur_1", mr = {
|
|
3167
|
+
banner: Xs
|
|
3168
|
+
}, zs = {
|
|
3169
|
+
marks: {
|
|
3170
|
+
color: ({ value: t, children: e }) => /* @__PURE__ */ m.jsx(
|
|
3171
|
+
"span",
|
|
3172
|
+
{
|
|
3173
|
+
style: {
|
|
3174
|
+
color: t.hex
|
|
3175
|
+
},
|
|
3176
|
+
children: e
|
|
3177
|
+
}
|
|
3178
|
+
)
|
|
3179
|
+
}
|
|
3180
|
+
}, Vs = ({ image: t, text: e, url: r, loading: n }) => {
|
|
3181
|
+
const a = () => {
|
|
3182
|
+
r && (window.location.href = r);
|
|
3183
|
+
};
|
|
3184
|
+
return n ? /* @__PURE__ */ m.jsx(m.Fragment, { children: /* @__PURE__ */ m.jsx("div", { className: mr.banner, style: { display: "block" }, children: /* @__PURE__ */ m.jsx(le, { height: "100%", width: "100%" }) }) }) : /* @__PURE__ */ m.jsx(
|
|
3185
|
+
"span",
|
|
3186
|
+
{
|
|
3187
|
+
onClick: a,
|
|
3188
|
+
style: {
|
|
3189
|
+
cursor: r ? "pointer" : "",
|
|
3190
|
+
backgroundImage: `linear-gradient(
|
|
3191
|
+
rgba(0, 0, 0, 0.2),
|
|
3192
|
+
rgba(0, 0, 0, 0.2)
|
|
3193
|
+
), url("${kt(t).width(1440).url()}")`
|
|
3194
|
+
},
|
|
3195
|
+
className: mr.banner,
|
|
3196
|
+
children: /* @__PURE__ */ m.jsx(Cr, { value: e, components: zs })
|
|
3197
|
+
}
|
|
3198
|
+
);
|
|
3199
|
+
}, Gs = "_bannerContainer_79bac_1", Qs = "_bannerApp_79bac_8", gr = {
|
|
3200
|
+
bannerContainer: Gs,
|
|
3201
|
+
bannerApp: Qs
|
|
3202
|
+
}, Js = ({ children: t }) => /* @__PURE__ */ m.jsx("div", { className: gr.bannerContainer, children: /* @__PURE__ */ m.jsx("div", { className: gr.bannerApp, children: t }) });
|
|
3203
|
+
function H(t) {
|
|
3204
|
+
if (t === null || t === !0 || t === !1)
|
|
3205
|
+
return NaN;
|
|
3206
|
+
var e = Number(t);
|
|
3207
|
+
return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e);
|
|
3208
|
+
}
|
|
3209
|
+
function M(t, e) {
|
|
3210
|
+
if (e.length < t)
|
|
3211
|
+
throw new TypeError(t + " argument" + (t > 1 ? "s" : "") + " required, but only " + e.length + " present");
|
|
3212
|
+
}
|
|
3213
|
+
function N(t) {
|
|
3214
|
+
M(1, arguments);
|
|
3215
|
+
var e = Object.prototype.toString.call(t);
|
|
3216
|
+
return t instanceof Date || typeof t == "object" && e === "[object Date]" ? new Date(t.getTime()) : typeof t == "number" || e === "[object Number]" ? new Date(t) : ((typeof t == "string" || e === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
|
|
3217
|
+
}
|
|
3218
|
+
function Ks(t, e) {
|
|
3219
|
+
M(2, arguments);
|
|
3220
|
+
var r = N(t).getTime(), n = H(e);
|
|
3221
|
+
return new Date(r + n);
|
|
3222
|
+
}
|
|
3223
|
+
function Zs(t) {
|
|
3224
|
+
var e = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()));
|
|
3225
|
+
return e.setUTCFullYear(t.getFullYear()), t.getTime() - e.getTime();
|
|
3226
|
+
}
|
|
3227
|
+
function yr(t) {
|
|
3228
|
+
M(1, arguments);
|
|
3229
|
+
var e = N(t);
|
|
3230
|
+
return e.setHours(0, 0, 0, 0), e;
|
|
3231
|
+
}
|
|
3232
|
+
function eu(t, e) {
|
|
3233
|
+
M(2, arguments);
|
|
3234
|
+
var r = yr(t), n = yr(e);
|
|
3235
|
+
return r.getTime() === n.getTime();
|
|
3236
|
+
}
|
|
3237
|
+
function tu(t) {
|
|
3238
|
+
return M(1, arguments), t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
3239
|
+
}
|
|
3240
|
+
function ru(t) {
|
|
3241
|
+
if (M(1, arguments), !tu(t) && typeof t != "number")
|
|
3242
|
+
return !1;
|
|
3243
|
+
var e = N(t);
|
|
3244
|
+
return !isNaN(Number(e));
|
|
3245
|
+
}
|
|
3246
|
+
var nu = {
|
|
3247
|
+
lessThanXSeconds: {
|
|
3248
|
+
one: "less than a second",
|
|
3249
|
+
other: "less than {{count}} seconds"
|
|
3250
|
+
},
|
|
3251
|
+
xSeconds: {
|
|
3252
|
+
one: "1 second",
|
|
3253
|
+
other: "{{count}} seconds"
|
|
3254
|
+
},
|
|
3255
|
+
halfAMinute: "half a minute",
|
|
3256
|
+
lessThanXMinutes: {
|
|
3257
|
+
one: "less than a minute",
|
|
3258
|
+
other: "less than {{count}} minutes"
|
|
3259
|
+
},
|
|
3260
|
+
xMinutes: {
|
|
3261
|
+
one: "1 minute",
|
|
3262
|
+
other: "{{count}} minutes"
|
|
3263
|
+
},
|
|
3264
|
+
aboutXHours: {
|
|
3265
|
+
one: "about 1 hour",
|
|
3266
|
+
other: "about {{count}} hours"
|
|
3267
|
+
},
|
|
3268
|
+
xHours: {
|
|
3269
|
+
one: "1 hour",
|
|
3270
|
+
other: "{{count}} hours"
|
|
3271
|
+
},
|
|
3272
|
+
xDays: {
|
|
3273
|
+
one: "1 day",
|
|
3274
|
+
other: "{{count}} days"
|
|
3275
|
+
},
|
|
3276
|
+
aboutXWeeks: {
|
|
3277
|
+
one: "about 1 week",
|
|
3278
|
+
other: "about {{count}} weeks"
|
|
3279
|
+
},
|
|
3280
|
+
xWeeks: {
|
|
3281
|
+
one: "1 week",
|
|
3282
|
+
other: "{{count}} weeks"
|
|
3283
|
+
},
|
|
3284
|
+
aboutXMonths: {
|
|
3285
|
+
one: "about 1 month",
|
|
3286
|
+
other: "about {{count}} months"
|
|
3287
|
+
},
|
|
3288
|
+
xMonths: {
|
|
3289
|
+
one: "1 month",
|
|
3290
|
+
other: "{{count}} months"
|
|
3291
|
+
},
|
|
3292
|
+
aboutXYears: {
|
|
3293
|
+
one: "about 1 year",
|
|
3294
|
+
other: "about {{count}} years"
|
|
3295
|
+
},
|
|
3296
|
+
xYears: {
|
|
3297
|
+
one: "1 year",
|
|
3298
|
+
other: "{{count}} years"
|
|
3299
|
+
},
|
|
3300
|
+
overXYears: {
|
|
3301
|
+
one: "over 1 year",
|
|
3302
|
+
other: "over {{count}} years"
|
|
3303
|
+
},
|
|
3304
|
+
almostXYears: {
|
|
3305
|
+
one: "almost 1 year",
|
|
3306
|
+
other: "almost {{count}} years"
|
|
3307
|
+
}
|
|
3308
|
+
}, au = function(t, e, r) {
|
|
3309
|
+
var n, a = nu[t];
|
|
3310
|
+
return typeof a == "string" ? n = a : e === 1 ? n = a.one : n = a.other.replace("{{count}}", e.toString()), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + n : n + " ago" : n;
|
|
3311
|
+
};
|
|
3312
|
+
const iu = au;
|
|
3313
|
+
function it(t) {
|
|
3314
|
+
return function() {
|
|
3315
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = e.width ? String(e.width) : t.defaultWidth, n = t.formats[r] || t.formats[t.defaultWidth];
|
|
3316
|
+
return n;
|
|
3317
|
+
};
|
|
3318
|
+
}
|
|
3319
|
+
var ou = {
|
|
3320
|
+
full: "EEEE, MMMM do, y",
|
|
3321
|
+
long: "MMMM do, y",
|
|
3322
|
+
medium: "MMM d, y",
|
|
3323
|
+
short: "MM/dd/yyyy"
|
|
3324
|
+
}, su = {
|
|
3325
|
+
full: "h:mm:ss a zzzz",
|
|
3326
|
+
long: "h:mm:ss a z",
|
|
3327
|
+
medium: "h:mm:ss a",
|
|
3328
|
+
short: "h:mm a"
|
|
3329
|
+
}, uu = {
|
|
3330
|
+
full: "{{date}} 'at' {{time}}",
|
|
3331
|
+
long: "{{date}} 'at' {{time}}",
|
|
3332
|
+
medium: "{{date}}, {{time}}",
|
|
3333
|
+
short: "{{date}}, {{time}}"
|
|
3334
|
+
}, cu = {
|
|
3335
|
+
date: it({
|
|
3336
|
+
formats: ou,
|
|
3337
|
+
defaultWidth: "full"
|
|
3338
|
+
}),
|
|
3339
|
+
time: it({
|
|
3340
|
+
formats: su,
|
|
3341
|
+
defaultWidth: "full"
|
|
3342
|
+
}),
|
|
3343
|
+
dateTime: it({
|
|
3344
|
+
formats: uu,
|
|
3345
|
+
defaultWidth: "full"
|
|
3346
|
+
})
|
|
3347
|
+
};
|
|
3348
|
+
const fu = cu;
|
|
3349
|
+
var lu = {
|
|
3350
|
+
lastWeek: "'last' eeee 'at' p",
|
|
3351
|
+
yesterday: "'yesterday at' p",
|
|
3352
|
+
today: "'today at' p",
|
|
3353
|
+
tomorrow: "'tomorrow at' p",
|
|
3354
|
+
nextWeek: "eeee 'at' p",
|
|
3355
|
+
other: "P"
|
|
3356
|
+
}, du = function(t, e, r, n) {
|
|
3357
|
+
return lu[t];
|
|
3358
|
+
};
|
|
3359
|
+
const hu = du;
|
|
3360
|
+
function ge(t) {
|
|
3361
|
+
return function(e, r) {
|
|
3362
|
+
var n = r || {}, a = n.context ? String(n.context) : "standalone", i;
|
|
3363
|
+
if (a === "formatting" && t.formattingValues) {
|
|
3364
|
+
var o = t.defaultFormattingWidth || t.defaultWidth, s = n.width ? String(n.width) : o;
|
|
3365
|
+
i = t.formattingValues[s] || t.formattingValues[o];
|
|
3366
|
+
} else {
|
|
3367
|
+
var u = t.defaultWidth, c = n.width ? String(n.width) : t.defaultWidth;
|
|
3368
|
+
i = t.values[c] || t.values[u];
|
|
3369
|
+
}
|
|
3370
|
+
var g = t.argumentCallback ? t.argumentCallback(e) : e;
|
|
3371
|
+
return i[g];
|
|
3372
|
+
};
|
|
3373
|
+
}
|
|
3374
|
+
var pu = {
|
|
3375
|
+
narrow: ["B", "A"],
|
|
3376
|
+
abbreviated: ["BC", "AD"],
|
|
3377
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
3378
|
+
}, vu = {
|
|
3379
|
+
narrow: ["1", "2", "3", "4"],
|
|
3380
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
3381
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
3382
|
+
}, mu = {
|
|
3383
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
3384
|
+
abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
3385
|
+
wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
|
|
3386
|
+
}, gu = {
|
|
3387
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
3388
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
3389
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
3390
|
+
wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
|
3391
|
+
}, yu = {
|
|
3392
|
+
narrow: {
|
|
3393
|
+
am: "a",
|
|
3394
|
+
pm: "p",
|
|
3395
|
+
midnight: "mi",
|
|
3396
|
+
noon: "n",
|
|
3397
|
+
morning: "morning",
|
|
3398
|
+
afternoon: "afternoon",
|
|
3399
|
+
evening: "evening",
|
|
3400
|
+
night: "night"
|
|
3401
|
+
},
|
|
3402
|
+
abbreviated: {
|
|
3403
|
+
am: "AM",
|
|
3404
|
+
pm: "PM",
|
|
3405
|
+
midnight: "midnight",
|
|
3406
|
+
noon: "noon",
|
|
3407
|
+
morning: "morning",
|
|
3408
|
+
afternoon: "afternoon",
|
|
3409
|
+
evening: "evening",
|
|
3410
|
+
night: "night"
|
|
3411
|
+
},
|
|
3412
|
+
wide: {
|
|
3413
|
+
am: "a.m.",
|
|
3414
|
+
pm: "p.m.",
|
|
3415
|
+
midnight: "midnight",
|
|
3416
|
+
noon: "noon",
|
|
3417
|
+
morning: "morning",
|
|
3418
|
+
afternoon: "afternoon",
|
|
3419
|
+
evening: "evening",
|
|
3420
|
+
night: "night"
|
|
3421
|
+
}
|
|
3422
|
+
}, bu = {
|
|
3423
|
+
narrow: {
|
|
3424
|
+
am: "a",
|
|
3425
|
+
pm: "p",
|
|
3426
|
+
midnight: "mi",
|
|
3427
|
+
noon: "n",
|
|
3428
|
+
morning: "in the morning",
|
|
3429
|
+
afternoon: "in the afternoon",
|
|
3430
|
+
evening: "in the evening",
|
|
3431
|
+
night: "at night"
|
|
3432
|
+
},
|
|
3433
|
+
abbreviated: {
|
|
3434
|
+
am: "AM",
|
|
3435
|
+
pm: "PM",
|
|
3436
|
+
midnight: "midnight",
|
|
3437
|
+
noon: "noon",
|
|
3438
|
+
morning: "in the morning",
|
|
3439
|
+
afternoon: "in the afternoon",
|
|
3440
|
+
evening: "in the evening",
|
|
3441
|
+
night: "at night"
|
|
3442
|
+
},
|
|
3443
|
+
wide: {
|
|
3444
|
+
am: "a.m.",
|
|
3445
|
+
pm: "p.m.",
|
|
3446
|
+
midnight: "midnight",
|
|
3447
|
+
noon: "noon",
|
|
3448
|
+
morning: "in the morning",
|
|
3449
|
+
afternoon: "in the afternoon",
|
|
3450
|
+
evening: "in the evening",
|
|
3451
|
+
night: "at night"
|
|
3452
|
+
}
|
|
3453
|
+
}, wu = function(t, e) {
|
|
3454
|
+
var r = Number(t), n = r % 100;
|
|
3455
|
+
if (n > 20 || n < 10)
|
|
3456
|
+
switch (n % 10) {
|
|
3457
|
+
case 1:
|
|
3458
|
+
return r + "st";
|
|
3459
|
+
case 2:
|
|
3460
|
+
return r + "nd";
|
|
3461
|
+
case 3:
|
|
3462
|
+
return r + "rd";
|
|
3463
|
+
}
|
|
3464
|
+
return r + "th";
|
|
3465
|
+
}, _u = {
|
|
3466
|
+
ordinalNumber: wu,
|
|
3467
|
+
era: ge({
|
|
3468
|
+
values: pu,
|
|
3469
|
+
defaultWidth: "wide"
|
|
3470
|
+
}),
|
|
3471
|
+
quarter: ge({
|
|
3472
|
+
values: vu,
|
|
3473
|
+
defaultWidth: "wide",
|
|
3474
|
+
argumentCallback: function(t) {
|
|
3475
|
+
return t - 1;
|
|
3476
|
+
}
|
|
3477
|
+
}),
|
|
3478
|
+
month: ge({
|
|
3479
|
+
values: mu,
|
|
3480
|
+
defaultWidth: "wide"
|
|
3481
|
+
}),
|
|
3482
|
+
day: ge({
|
|
3483
|
+
values: gu,
|
|
3484
|
+
defaultWidth: "wide"
|
|
3485
|
+
}),
|
|
3486
|
+
dayPeriod: ge({
|
|
3487
|
+
values: yu,
|
|
3488
|
+
defaultWidth: "wide",
|
|
3489
|
+
formattingValues: bu,
|
|
3490
|
+
defaultFormattingWidth: "wide"
|
|
3491
|
+
})
|
|
3492
|
+
};
|
|
3493
|
+
const Ou = _u;
|
|
3494
|
+
function ye(t) {
|
|
3495
|
+
return function(e) {
|
|
3496
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = r.width, a = n && t.matchPatterns[n] || t.matchPatterns[t.defaultMatchWidth], i = e.match(a);
|
|
3497
|
+
if (!i)
|
|
3498
|
+
return null;
|
|
3499
|
+
var o = i[0], s = n && t.parsePatterns[n] || t.parsePatterns[t.defaultParseWidth], u = Array.isArray(s) ? Su(s, function(d) {
|
|
3500
|
+
return d.test(o);
|
|
3501
|
+
}) : Eu(s, function(d) {
|
|
3502
|
+
return d.test(o);
|
|
3503
|
+
}), c;
|
|
3504
|
+
c = t.valueCallback ? t.valueCallback(u) : u, c = r.valueCallback ? r.valueCallback(c) : c;
|
|
3505
|
+
var g = e.slice(o.length);
|
|
3506
|
+
return {
|
|
3507
|
+
value: c,
|
|
3508
|
+
rest: g
|
|
3509
|
+
};
|
|
3510
|
+
};
|
|
3511
|
+
}
|
|
3512
|
+
function Eu(t, e) {
|
|
3513
|
+
for (var r in t)
|
|
3514
|
+
if (t.hasOwnProperty(r) && e(t[r]))
|
|
3515
|
+
return r;
|
|
3516
|
+
}
|
|
3517
|
+
function Su(t, e) {
|
|
3518
|
+
for (var r = 0; r < t.length; r++)
|
|
3519
|
+
if (e(t[r]))
|
|
3520
|
+
return r;
|
|
3521
|
+
}
|
|
3522
|
+
function xu(t) {
|
|
3523
|
+
return function(e) {
|
|
3524
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = e.match(t.matchPattern);
|
|
3525
|
+
if (!n)
|
|
3526
|
+
return null;
|
|
3527
|
+
var a = n[0], i = e.match(t.parsePattern);
|
|
3528
|
+
if (!i)
|
|
3529
|
+
return null;
|
|
3530
|
+
var o = t.valueCallback ? t.valueCallback(i[0]) : i[0];
|
|
3531
|
+
o = r.valueCallback ? r.valueCallback(o) : o;
|
|
3532
|
+
var s = e.slice(a.length);
|
|
3533
|
+
return {
|
|
3534
|
+
value: o,
|
|
3535
|
+
rest: s
|
|
3536
|
+
};
|
|
3537
|
+
};
|
|
3538
|
+
}
|
|
3539
|
+
var Cu = /^(\d+)(th|st|nd|rd)?/i, Pu = /\d+/i, Tu = {
|
|
3540
|
+
narrow: /^(b|a)/i,
|
|
3541
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
3542
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
3543
|
+
}, ju = {
|
|
3544
|
+
any: [/^b/i, /^(a|c)/i]
|
|
3545
|
+
}, Du = {
|
|
3546
|
+
narrow: /^[1234]/i,
|
|
3547
|
+
abbreviated: /^q[1234]/i,
|
|
3548
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
3549
|
+
}, qu = {
|
|
3550
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
3551
|
+
}, Mu = {
|
|
3552
|
+
narrow: /^[jfmasond]/i,
|
|
3553
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
3554
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
3555
|
+
}, Au = {
|
|
3556
|
+
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
|
|
3557
|
+
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
|
|
3558
|
+
}, Ru = {
|
|
3559
|
+
narrow: /^[smtwf]/i,
|
|
3560
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
3561
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
3562
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
3563
|
+
}, Iu = {
|
|
3564
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
3565
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
3566
|
+
}, $u = {
|
|
3567
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
3568
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
3569
|
+
}, Uu = {
|
|
3570
|
+
any: {
|
|
3571
|
+
am: /^a/i,
|
|
3572
|
+
pm: /^p/i,
|
|
3573
|
+
midnight: /^mi/i,
|
|
3574
|
+
noon: /^no/i,
|
|
3575
|
+
morning: /morning/i,
|
|
3576
|
+
afternoon: /afternoon/i,
|
|
3577
|
+
evening: /evening/i,
|
|
3578
|
+
night: /night/i
|
|
3579
|
+
}
|
|
3580
|
+
}, ku = {
|
|
3581
|
+
ordinalNumber: xu({
|
|
3582
|
+
matchPattern: Cu,
|
|
3583
|
+
parsePattern: Pu,
|
|
3584
|
+
valueCallback: function(t) {
|
|
3585
|
+
return parseInt(t, 10);
|
|
3586
|
+
}
|
|
3587
|
+
}),
|
|
3588
|
+
era: ye({
|
|
3589
|
+
matchPatterns: Tu,
|
|
3590
|
+
defaultMatchWidth: "wide",
|
|
3591
|
+
parsePatterns: ju,
|
|
3592
|
+
defaultParseWidth: "any"
|
|
3593
|
+
}),
|
|
3594
|
+
quarter: ye({
|
|
3595
|
+
matchPatterns: Du,
|
|
3596
|
+
defaultMatchWidth: "wide",
|
|
3597
|
+
parsePatterns: qu,
|
|
3598
|
+
defaultParseWidth: "any",
|
|
3599
|
+
valueCallback: function(t) {
|
|
3600
|
+
return t + 1;
|
|
3601
|
+
}
|
|
3602
|
+
}),
|
|
3603
|
+
month: ye({
|
|
3604
|
+
matchPatterns: Mu,
|
|
3605
|
+
defaultMatchWidth: "wide",
|
|
3606
|
+
parsePatterns: Au,
|
|
3607
|
+
defaultParseWidth: "any"
|
|
3608
|
+
}),
|
|
3609
|
+
day: ye({
|
|
3610
|
+
matchPatterns: Ru,
|
|
3611
|
+
defaultMatchWidth: "wide",
|
|
3612
|
+
parsePatterns: Iu,
|
|
3613
|
+
defaultParseWidth: "any"
|
|
3614
|
+
}),
|
|
3615
|
+
dayPeriod: ye({
|
|
3616
|
+
matchPatterns: $u,
|
|
3617
|
+
defaultMatchWidth: "any",
|
|
3618
|
+
parsePatterns: Uu,
|
|
3619
|
+
defaultParseWidth: "any"
|
|
3620
|
+
})
|
|
3621
|
+
};
|
|
3622
|
+
const Nu = ku;
|
|
3623
|
+
var Hu = {
|
|
3624
|
+
code: "en-US",
|
|
3625
|
+
formatDistance: iu,
|
|
3626
|
+
formatLong: fu,
|
|
3627
|
+
formatRelative: hu,
|
|
3628
|
+
localize: Ou,
|
|
3629
|
+
match: Nu,
|
|
3630
|
+
options: {
|
|
3631
|
+
weekStartsOn: 0,
|
|
3632
|
+
firstWeekContainsDate: 1
|
|
3633
|
+
}
|
|
3634
|
+
};
|
|
3635
|
+
const Wu = Hu;
|
|
3636
|
+
function Lu(t, e) {
|
|
3637
|
+
M(2, arguments);
|
|
3638
|
+
var r = H(e);
|
|
3639
|
+
return Ks(t, -r);
|
|
3640
|
+
}
|
|
3641
|
+
var Fu = 864e5;
|
|
3642
|
+
function Bu(t) {
|
|
3643
|
+
M(1, arguments);
|
|
3644
|
+
var e = N(t), r = e.getTime();
|
|
3645
|
+
e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
|
|
3646
|
+
var n = e.getTime(), a = r - n;
|
|
3647
|
+
return Math.floor(a / Fu) + 1;
|
|
3648
|
+
}
|
|
3649
|
+
function Ie(t) {
|
|
3650
|
+
M(1, arguments);
|
|
3651
|
+
var e = 1, r = N(t), n = r.getUTCDay(), a = (n < e ? 7 : 0) + n - e;
|
|
3652
|
+
return r.setUTCDate(r.getUTCDate() - a), r.setUTCHours(0, 0, 0, 0), r;
|
|
3653
|
+
}
|
|
3654
|
+
function hn(t) {
|
|
3655
|
+
M(1, arguments);
|
|
3656
|
+
var e = N(t), r = e.getUTCFullYear(), n = /* @__PURE__ */ new Date(0);
|
|
3657
|
+
n.setUTCFullYear(r + 1, 0, 4), n.setUTCHours(0, 0, 0, 0);
|
|
3658
|
+
var a = Ie(n), i = /* @__PURE__ */ new Date(0);
|
|
3659
|
+
i.setUTCFullYear(r, 0, 4), i.setUTCHours(0, 0, 0, 0);
|
|
3660
|
+
var o = Ie(i);
|
|
3661
|
+
return e.getTime() >= a.getTime() ? r + 1 : e.getTime() >= o.getTime() ? r : r - 1;
|
|
3662
|
+
}
|
|
3663
|
+
function Yu(t) {
|
|
3664
|
+
M(1, arguments);
|
|
3665
|
+
var e = hn(t), r = /* @__PURE__ */ new Date(0);
|
|
3666
|
+
r.setUTCFullYear(e, 0, 4), r.setUTCHours(0, 0, 0, 0);
|
|
3667
|
+
var n = Ie(r);
|
|
3668
|
+
return n;
|
|
3669
|
+
}
|
|
3670
|
+
var Xu = 6048e5;
|
|
3671
|
+
function zu(t) {
|
|
3672
|
+
M(1, arguments);
|
|
3673
|
+
var e = N(t), r = Ie(e).getTime() - Yu(e).getTime();
|
|
3674
|
+
return Math.round(r / Xu) + 1;
|
|
3675
|
+
}
|
|
3676
|
+
function $e(t, e) {
|
|
3677
|
+
M(1, arguments);
|
|
3678
|
+
var r = e || {}, n = r.locale, a = n && n.options && n.options.weekStartsOn, i = a == null ? 0 : H(a), o = r.weekStartsOn == null ? i : H(r.weekStartsOn);
|
|
3679
|
+
if (!(o >= 0 && o <= 6))
|
|
3680
|
+
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
3681
|
+
var s = N(t), u = s.getUTCDay(), c = (u < o ? 7 : 0) + u - o;
|
|
3682
|
+
return s.setUTCDate(s.getUTCDate() - c), s.setUTCHours(0, 0, 0, 0), s;
|
|
3683
|
+
}
|
|
3684
|
+
function pn(t, e) {
|
|
3685
|
+
M(1, arguments);
|
|
3686
|
+
var r = N(t), n = r.getUTCFullYear(), a = e || {}, i = a.locale, o = i && i.options && i.options.firstWeekContainsDate, s = o == null ? 1 : H(o), u = a.firstWeekContainsDate == null ? s : H(a.firstWeekContainsDate);
|
|
3687
|
+
if (!(u >= 1 && u <= 7))
|
|
3688
|
+
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
3689
|
+
var c = /* @__PURE__ */ new Date(0);
|
|
3690
|
+
c.setUTCFullYear(n + 1, 0, u), c.setUTCHours(0, 0, 0, 0);
|
|
3691
|
+
var g = $e(c, e), d = /* @__PURE__ */ new Date(0);
|
|
3692
|
+
d.setUTCFullYear(n, 0, u), d.setUTCHours(0, 0, 0, 0);
|
|
3693
|
+
var p = $e(d, e);
|
|
3694
|
+
return r.getTime() >= g.getTime() ? n + 1 : r.getTime() >= p.getTime() ? n : n - 1;
|
|
3695
|
+
}
|
|
3696
|
+
function Vu(t, e) {
|
|
3697
|
+
M(1, arguments);
|
|
3698
|
+
var r = e || {}, n = r.locale, a = n && n.options && n.options.firstWeekContainsDate, i = a == null ? 1 : H(a), o = r.firstWeekContainsDate == null ? i : H(r.firstWeekContainsDate), s = pn(t, e), u = /* @__PURE__ */ new Date(0);
|
|
3699
|
+
u.setUTCFullYear(s, 0, o), u.setUTCHours(0, 0, 0, 0);
|
|
3700
|
+
var c = $e(u, e);
|
|
3701
|
+
return c;
|
|
3702
|
+
}
|
|
3703
|
+
var Gu = 6048e5;
|
|
3704
|
+
function Qu(t, e) {
|
|
3705
|
+
M(1, arguments);
|
|
3706
|
+
var r = N(t), n = $e(r, e).getTime() - Vu(r, e).getTime();
|
|
3707
|
+
return Math.round(n / Gu) + 1;
|
|
3708
|
+
}
|
|
3709
|
+
function S(t, e) {
|
|
3710
|
+
for (var r = t < 0 ? "-" : "", n = Math.abs(t).toString(); n.length < e; )
|
|
3711
|
+
n = "0" + n;
|
|
3712
|
+
return r + n;
|
|
3713
|
+
}
|
|
3714
|
+
var Ju = {
|
|
3715
|
+
// Year
|
|
3716
|
+
y: function(t, e) {
|
|
3717
|
+
var r = t.getUTCFullYear(), n = r > 0 ? r : 1 - r;
|
|
3718
|
+
return S(e === "yy" ? n % 100 : n, e.length);
|
|
3719
|
+
},
|
|
3720
|
+
// Month
|
|
3721
|
+
M: function(t, e) {
|
|
3722
|
+
var r = t.getUTCMonth();
|
|
3723
|
+
return e === "M" ? String(r + 1) : S(r + 1, 2);
|
|
3724
|
+
},
|
|
3725
|
+
// Day of the month
|
|
3726
|
+
d: function(t, e) {
|
|
3727
|
+
return S(t.getUTCDate(), e.length);
|
|
3728
|
+
},
|
|
3729
|
+
// AM or PM
|
|
3730
|
+
a: function(t, e) {
|
|
3731
|
+
var r = t.getUTCHours() / 12 >= 1 ? "pm" : "am";
|
|
3732
|
+
switch (e) {
|
|
3733
|
+
case "a":
|
|
3734
|
+
case "aa":
|
|
3735
|
+
return r.toUpperCase();
|
|
3736
|
+
case "aaa":
|
|
3737
|
+
return r;
|
|
3738
|
+
case "aaaaa":
|
|
3739
|
+
return r[0];
|
|
3740
|
+
case "aaaa":
|
|
3741
|
+
default:
|
|
3742
|
+
return r === "am" ? "a.m." : "p.m.";
|
|
3743
|
+
}
|
|
3744
|
+
},
|
|
3745
|
+
// Hour [1-12]
|
|
3746
|
+
h: function(t, e) {
|
|
3747
|
+
return S(t.getUTCHours() % 12 || 12, e.length);
|
|
3748
|
+
},
|
|
3749
|
+
// Hour [0-23]
|
|
3750
|
+
H: function(t, e) {
|
|
3751
|
+
return S(t.getUTCHours(), e.length);
|
|
3752
|
+
},
|
|
3753
|
+
// Minute
|
|
3754
|
+
m: function(t, e) {
|
|
3755
|
+
return S(t.getUTCMinutes(), e.length);
|
|
3756
|
+
},
|
|
3757
|
+
// Second
|
|
3758
|
+
s: function(t, e) {
|
|
3759
|
+
return S(t.getUTCSeconds(), e.length);
|
|
3760
|
+
},
|
|
3761
|
+
// Fraction of second
|
|
3762
|
+
S: function(t, e) {
|
|
3763
|
+
var r = e.length, n = t.getUTCMilliseconds(), a = Math.floor(n * Math.pow(10, r - 3));
|
|
3764
|
+
return S(a, e.length);
|
|
3765
|
+
}
|
|
3766
|
+
};
|
|
3767
|
+
const K = Ju;
|
|
3768
|
+
var fe = {
|
|
3769
|
+
am: "am",
|
|
3770
|
+
pm: "pm",
|
|
3771
|
+
midnight: "midnight",
|
|
3772
|
+
noon: "noon",
|
|
3773
|
+
morning: "morning",
|
|
3774
|
+
afternoon: "afternoon",
|
|
3775
|
+
evening: "evening",
|
|
3776
|
+
night: "night"
|
|
3777
|
+
}, Ku = {
|
|
3778
|
+
// Era
|
|
3779
|
+
G: function(t, e, r) {
|
|
3780
|
+
var n = t.getUTCFullYear() > 0 ? 1 : 0;
|
|
3781
|
+
switch (e) {
|
|
3782
|
+
case "G":
|
|
3783
|
+
case "GG":
|
|
3784
|
+
case "GGG":
|
|
3785
|
+
return r.era(n, {
|
|
3786
|
+
width: "abbreviated"
|
|
3787
|
+
});
|
|
3788
|
+
case "GGGGG":
|
|
3789
|
+
return r.era(n, {
|
|
3790
|
+
width: "narrow"
|
|
3791
|
+
});
|
|
3792
|
+
case "GGGG":
|
|
3793
|
+
default:
|
|
3794
|
+
return r.era(n, {
|
|
3795
|
+
width: "wide"
|
|
3796
|
+
});
|
|
3797
|
+
}
|
|
3798
|
+
},
|
|
3799
|
+
// Year
|
|
3800
|
+
y: function(t, e, r) {
|
|
3801
|
+
if (e === "yo") {
|
|
3802
|
+
var n = t.getUTCFullYear(), a = n > 0 ? n : 1 - n;
|
|
3803
|
+
return r.ordinalNumber(a, {
|
|
3804
|
+
unit: "year"
|
|
3805
|
+
});
|
|
3806
|
+
}
|
|
3807
|
+
return K.y(t, e);
|
|
3808
|
+
},
|
|
3809
|
+
// Local week-numbering year
|
|
3810
|
+
Y: function(t, e, r, n) {
|
|
3811
|
+
var a = pn(t, n), i = a > 0 ? a : 1 - a;
|
|
3812
|
+
if (e === "YY") {
|
|
3813
|
+
var o = i % 100;
|
|
3814
|
+
return S(o, 2);
|
|
3815
|
+
}
|
|
3816
|
+
return e === "Yo" ? r.ordinalNumber(i, {
|
|
3817
|
+
unit: "year"
|
|
3818
|
+
}) : S(i, e.length);
|
|
3819
|
+
},
|
|
3820
|
+
// ISO week-numbering year
|
|
3821
|
+
R: function(t, e) {
|
|
3822
|
+
var r = hn(t);
|
|
3823
|
+
return S(r, e.length);
|
|
3824
|
+
},
|
|
3825
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
3826
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
3827
|
+
// | Year | `y` | `u` |
|
|
3828
|
+
// |------|-----|-----|
|
|
3829
|
+
// | AC 1 | 1 | 1 |
|
|
3830
|
+
// | BC 1 | 1 | 0 |
|
|
3831
|
+
// | BC 2 | 2 | -1 |
|
|
3832
|
+
// Also `yy` always returns the last two digits of a year,
|
|
3833
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
3834
|
+
u: function(t, e) {
|
|
3835
|
+
var r = t.getUTCFullYear();
|
|
3836
|
+
return S(r, e.length);
|
|
3837
|
+
},
|
|
3838
|
+
// Quarter
|
|
3839
|
+
Q: function(t, e, r) {
|
|
3840
|
+
var n = Math.ceil((t.getUTCMonth() + 1) / 3);
|
|
3841
|
+
switch (e) {
|
|
3842
|
+
case "Q":
|
|
3843
|
+
return String(n);
|
|
3844
|
+
case "QQ":
|
|
3845
|
+
return S(n, 2);
|
|
3846
|
+
case "Qo":
|
|
3847
|
+
return r.ordinalNumber(n, {
|
|
3848
|
+
unit: "quarter"
|
|
3849
|
+
});
|
|
3850
|
+
case "QQQ":
|
|
3851
|
+
return r.quarter(n, {
|
|
3852
|
+
width: "abbreviated",
|
|
3853
|
+
context: "formatting"
|
|
3854
|
+
});
|
|
3855
|
+
case "QQQQQ":
|
|
3856
|
+
return r.quarter(n, {
|
|
3857
|
+
width: "narrow",
|
|
3858
|
+
context: "formatting"
|
|
3859
|
+
});
|
|
3860
|
+
case "QQQQ":
|
|
3861
|
+
default:
|
|
3862
|
+
return r.quarter(n, {
|
|
3863
|
+
width: "wide",
|
|
3864
|
+
context: "formatting"
|
|
3865
|
+
});
|
|
3866
|
+
}
|
|
3867
|
+
},
|
|
3868
|
+
// Stand-alone quarter
|
|
3869
|
+
q: function(t, e, r) {
|
|
3870
|
+
var n = Math.ceil((t.getUTCMonth() + 1) / 3);
|
|
3871
|
+
switch (e) {
|
|
3872
|
+
case "q":
|
|
3873
|
+
return String(n);
|
|
3874
|
+
case "qq":
|
|
3875
|
+
return S(n, 2);
|
|
3876
|
+
case "qo":
|
|
3877
|
+
return r.ordinalNumber(n, {
|
|
3878
|
+
unit: "quarter"
|
|
3879
|
+
});
|
|
3880
|
+
case "qqq":
|
|
3881
|
+
return r.quarter(n, {
|
|
3882
|
+
width: "abbreviated",
|
|
3883
|
+
context: "standalone"
|
|
3884
|
+
});
|
|
3885
|
+
case "qqqqq":
|
|
3886
|
+
return r.quarter(n, {
|
|
3887
|
+
width: "narrow",
|
|
3888
|
+
context: "standalone"
|
|
3889
|
+
});
|
|
3890
|
+
case "qqqq":
|
|
3891
|
+
default:
|
|
3892
|
+
return r.quarter(n, {
|
|
3893
|
+
width: "wide",
|
|
3894
|
+
context: "standalone"
|
|
3895
|
+
});
|
|
3896
|
+
}
|
|
3897
|
+
},
|
|
3898
|
+
// Month
|
|
3899
|
+
M: function(t, e, r) {
|
|
3900
|
+
var n = t.getUTCMonth();
|
|
3901
|
+
switch (e) {
|
|
3902
|
+
case "M":
|
|
3903
|
+
case "MM":
|
|
3904
|
+
return K.M(t, e);
|
|
3905
|
+
case "Mo":
|
|
3906
|
+
return r.ordinalNumber(n + 1, {
|
|
3907
|
+
unit: "month"
|
|
3908
|
+
});
|
|
3909
|
+
case "MMM":
|
|
3910
|
+
return r.month(n, {
|
|
3911
|
+
width: "abbreviated",
|
|
3912
|
+
context: "formatting"
|
|
3913
|
+
});
|
|
3914
|
+
case "MMMMM":
|
|
3915
|
+
return r.month(n, {
|
|
3916
|
+
width: "narrow",
|
|
3917
|
+
context: "formatting"
|
|
3918
|
+
});
|
|
3919
|
+
case "MMMM":
|
|
3920
|
+
default:
|
|
3921
|
+
return r.month(n, {
|
|
3922
|
+
width: "wide",
|
|
3923
|
+
context: "formatting"
|
|
3924
|
+
});
|
|
3925
|
+
}
|
|
3926
|
+
},
|
|
3927
|
+
// Stand-alone month
|
|
3928
|
+
L: function(t, e, r) {
|
|
3929
|
+
var n = t.getUTCMonth();
|
|
3930
|
+
switch (e) {
|
|
3931
|
+
case "L":
|
|
3932
|
+
return String(n + 1);
|
|
3933
|
+
case "LL":
|
|
3934
|
+
return S(n + 1, 2);
|
|
3935
|
+
case "Lo":
|
|
3936
|
+
return r.ordinalNumber(n + 1, {
|
|
3937
|
+
unit: "month"
|
|
3938
|
+
});
|
|
3939
|
+
case "LLL":
|
|
3940
|
+
return r.month(n, {
|
|
3941
|
+
width: "abbreviated",
|
|
3942
|
+
context: "standalone"
|
|
3943
|
+
});
|
|
3944
|
+
case "LLLLL":
|
|
3945
|
+
return r.month(n, {
|
|
3946
|
+
width: "narrow",
|
|
3947
|
+
context: "standalone"
|
|
3948
|
+
});
|
|
3949
|
+
case "LLLL":
|
|
3950
|
+
default:
|
|
3951
|
+
return r.month(n, {
|
|
3952
|
+
width: "wide",
|
|
3953
|
+
context: "standalone"
|
|
3954
|
+
});
|
|
3955
|
+
}
|
|
3956
|
+
},
|
|
3957
|
+
// Local week of year
|
|
3958
|
+
w: function(t, e, r, n) {
|
|
3959
|
+
var a = Qu(t, n);
|
|
3960
|
+
return e === "wo" ? r.ordinalNumber(a, {
|
|
3961
|
+
unit: "week"
|
|
3962
|
+
}) : S(a, e.length);
|
|
3963
|
+
},
|
|
3964
|
+
// ISO week of year
|
|
3965
|
+
I: function(t, e, r) {
|
|
3966
|
+
var n = zu(t);
|
|
3967
|
+
return e === "Io" ? r.ordinalNumber(n, {
|
|
3968
|
+
unit: "week"
|
|
3969
|
+
}) : S(n, e.length);
|
|
3970
|
+
},
|
|
3971
|
+
// Day of the month
|
|
3972
|
+
d: function(t, e, r) {
|
|
3973
|
+
return e === "do" ? r.ordinalNumber(t.getUTCDate(), {
|
|
3974
|
+
unit: "date"
|
|
3975
|
+
}) : K.d(t, e);
|
|
3976
|
+
},
|
|
3977
|
+
// Day of year
|
|
3978
|
+
D: function(t, e, r) {
|
|
3979
|
+
var n = Bu(t);
|
|
3980
|
+
return e === "Do" ? r.ordinalNumber(n, {
|
|
3981
|
+
unit: "dayOfYear"
|
|
3982
|
+
}) : S(n, e.length);
|
|
3983
|
+
},
|
|
3984
|
+
// Day of week
|
|
3985
|
+
E: function(t, e, r) {
|
|
3986
|
+
var n = t.getUTCDay();
|
|
3987
|
+
switch (e) {
|
|
3988
|
+
case "E":
|
|
3989
|
+
case "EE":
|
|
3990
|
+
case "EEE":
|
|
3991
|
+
return r.day(n, {
|
|
3992
|
+
width: "abbreviated",
|
|
3993
|
+
context: "formatting"
|
|
3994
|
+
});
|
|
3995
|
+
case "EEEEE":
|
|
3996
|
+
return r.day(n, {
|
|
3997
|
+
width: "narrow",
|
|
3998
|
+
context: "formatting"
|
|
3999
|
+
});
|
|
4000
|
+
case "EEEEEE":
|
|
4001
|
+
return r.day(n, {
|
|
4002
|
+
width: "short",
|
|
4003
|
+
context: "formatting"
|
|
4004
|
+
});
|
|
4005
|
+
case "EEEE":
|
|
4006
|
+
default:
|
|
4007
|
+
return r.day(n, {
|
|
4008
|
+
width: "wide",
|
|
4009
|
+
context: "formatting"
|
|
4010
|
+
});
|
|
4011
|
+
}
|
|
4012
|
+
},
|
|
4013
|
+
// Local day of week
|
|
4014
|
+
e: function(t, e, r, n) {
|
|
4015
|
+
var a = t.getUTCDay(), i = (a - n.weekStartsOn + 8) % 7 || 7;
|
|
4016
|
+
switch (e) {
|
|
4017
|
+
case "e":
|
|
4018
|
+
return String(i);
|
|
4019
|
+
case "ee":
|
|
4020
|
+
return S(i, 2);
|
|
4021
|
+
case "eo":
|
|
4022
|
+
return r.ordinalNumber(i, {
|
|
4023
|
+
unit: "day"
|
|
4024
|
+
});
|
|
4025
|
+
case "eee":
|
|
4026
|
+
return r.day(a, {
|
|
4027
|
+
width: "abbreviated",
|
|
4028
|
+
context: "formatting"
|
|
4029
|
+
});
|
|
4030
|
+
case "eeeee":
|
|
4031
|
+
return r.day(a, {
|
|
4032
|
+
width: "narrow",
|
|
4033
|
+
context: "formatting"
|
|
4034
|
+
});
|
|
4035
|
+
case "eeeeee":
|
|
4036
|
+
return r.day(a, {
|
|
4037
|
+
width: "short",
|
|
4038
|
+
context: "formatting"
|
|
4039
|
+
});
|
|
4040
|
+
case "eeee":
|
|
4041
|
+
default:
|
|
4042
|
+
return r.day(a, {
|
|
4043
|
+
width: "wide",
|
|
4044
|
+
context: "formatting"
|
|
4045
|
+
});
|
|
4046
|
+
}
|
|
4047
|
+
},
|
|
4048
|
+
// Stand-alone local day of week
|
|
4049
|
+
c: function(t, e, r, n) {
|
|
4050
|
+
var a = t.getUTCDay(), i = (a - n.weekStartsOn + 8) % 7 || 7;
|
|
4051
|
+
switch (e) {
|
|
4052
|
+
case "c":
|
|
4053
|
+
return String(i);
|
|
4054
|
+
case "cc":
|
|
4055
|
+
return S(i, e.length);
|
|
4056
|
+
case "co":
|
|
4057
|
+
return r.ordinalNumber(i, {
|
|
4058
|
+
unit: "day"
|
|
4059
|
+
});
|
|
4060
|
+
case "ccc":
|
|
4061
|
+
return r.day(a, {
|
|
4062
|
+
width: "abbreviated",
|
|
4063
|
+
context: "standalone"
|
|
4064
|
+
});
|
|
4065
|
+
case "ccccc":
|
|
4066
|
+
return r.day(a, {
|
|
4067
|
+
width: "narrow",
|
|
4068
|
+
context: "standalone"
|
|
4069
|
+
});
|
|
4070
|
+
case "cccccc":
|
|
4071
|
+
return r.day(a, {
|
|
4072
|
+
width: "short",
|
|
4073
|
+
context: "standalone"
|
|
4074
|
+
});
|
|
4075
|
+
case "cccc":
|
|
4076
|
+
default:
|
|
4077
|
+
return r.day(a, {
|
|
4078
|
+
width: "wide",
|
|
4079
|
+
context: "standalone"
|
|
4080
|
+
});
|
|
4081
|
+
}
|
|
4082
|
+
},
|
|
4083
|
+
// ISO day of week
|
|
4084
|
+
i: function(t, e, r) {
|
|
4085
|
+
var n = t.getUTCDay(), a = n === 0 ? 7 : n;
|
|
4086
|
+
switch (e) {
|
|
4087
|
+
case "i":
|
|
4088
|
+
return String(a);
|
|
4089
|
+
case "ii":
|
|
4090
|
+
return S(a, e.length);
|
|
4091
|
+
case "io":
|
|
4092
|
+
return r.ordinalNumber(a, {
|
|
4093
|
+
unit: "day"
|
|
4094
|
+
});
|
|
4095
|
+
case "iii":
|
|
4096
|
+
return r.day(n, {
|
|
4097
|
+
width: "abbreviated",
|
|
4098
|
+
context: "formatting"
|
|
4099
|
+
});
|
|
4100
|
+
case "iiiii":
|
|
4101
|
+
return r.day(n, {
|
|
4102
|
+
width: "narrow",
|
|
4103
|
+
context: "formatting"
|
|
4104
|
+
});
|
|
4105
|
+
case "iiiiii":
|
|
4106
|
+
return r.day(n, {
|
|
4107
|
+
width: "short",
|
|
4108
|
+
context: "formatting"
|
|
4109
|
+
});
|
|
4110
|
+
case "iiii":
|
|
4111
|
+
default:
|
|
4112
|
+
return r.day(n, {
|
|
4113
|
+
width: "wide",
|
|
4114
|
+
context: "formatting"
|
|
4115
|
+
});
|
|
4116
|
+
}
|
|
4117
|
+
},
|
|
4118
|
+
// AM or PM
|
|
4119
|
+
a: function(t, e, r) {
|
|
4120
|
+
var n = t.getUTCHours(), a = n / 12 >= 1 ? "pm" : "am";
|
|
4121
|
+
switch (e) {
|
|
4122
|
+
case "a":
|
|
4123
|
+
case "aa":
|
|
4124
|
+
return r.dayPeriod(a, {
|
|
4125
|
+
width: "abbreviated",
|
|
4126
|
+
context: "formatting"
|
|
4127
|
+
});
|
|
4128
|
+
case "aaa":
|
|
4129
|
+
return r.dayPeriod(a, {
|
|
4130
|
+
width: "abbreviated",
|
|
4131
|
+
context: "formatting"
|
|
4132
|
+
}).toLowerCase();
|
|
4133
|
+
case "aaaaa":
|
|
4134
|
+
return r.dayPeriod(a, {
|
|
4135
|
+
width: "narrow",
|
|
4136
|
+
context: "formatting"
|
|
4137
|
+
});
|
|
4138
|
+
case "aaaa":
|
|
4139
|
+
default:
|
|
4140
|
+
return r.dayPeriod(a, {
|
|
4141
|
+
width: "wide",
|
|
4142
|
+
context: "formatting"
|
|
4143
|
+
});
|
|
4144
|
+
}
|
|
4145
|
+
},
|
|
4146
|
+
// AM, PM, midnight, noon
|
|
4147
|
+
b: function(t, e, r) {
|
|
4148
|
+
var n = t.getUTCHours(), a;
|
|
4149
|
+
switch (n === 12 ? a = fe.noon : n === 0 ? a = fe.midnight : a = n / 12 >= 1 ? "pm" : "am", e) {
|
|
4150
|
+
case "b":
|
|
4151
|
+
case "bb":
|
|
4152
|
+
return r.dayPeriod(a, {
|
|
4153
|
+
width: "abbreviated",
|
|
4154
|
+
context: "formatting"
|
|
4155
|
+
});
|
|
4156
|
+
case "bbb":
|
|
4157
|
+
return r.dayPeriod(a, {
|
|
4158
|
+
width: "abbreviated",
|
|
4159
|
+
context: "formatting"
|
|
4160
|
+
}).toLowerCase();
|
|
4161
|
+
case "bbbbb":
|
|
4162
|
+
return r.dayPeriod(a, {
|
|
4163
|
+
width: "narrow",
|
|
4164
|
+
context: "formatting"
|
|
4165
|
+
});
|
|
4166
|
+
case "bbbb":
|
|
4167
|
+
default:
|
|
4168
|
+
return r.dayPeriod(a, {
|
|
4169
|
+
width: "wide",
|
|
4170
|
+
context: "formatting"
|
|
4171
|
+
});
|
|
4172
|
+
}
|
|
4173
|
+
},
|
|
4174
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
4175
|
+
B: function(t, e, r) {
|
|
4176
|
+
var n = t.getUTCHours(), a;
|
|
4177
|
+
switch (n >= 17 ? a = fe.evening : n >= 12 ? a = fe.afternoon : n >= 4 ? a = fe.morning : a = fe.night, e) {
|
|
4178
|
+
case "B":
|
|
4179
|
+
case "BB":
|
|
4180
|
+
case "BBB":
|
|
4181
|
+
return r.dayPeriod(a, {
|
|
4182
|
+
width: "abbreviated",
|
|
4183
|
+
context: "formatting"
|
|
4184
|
+
});
|
|
4185
|
+
case "BBBBB":
|
|
4186
|
+
return r.dayPeriod(a, {
|
|
4187
|
+
width: "narrow",
|
|
4188
|
+
context: "formatting"
|
|
4189
|
+
});
|
|
4190
|
+
case "BBBB":
|
|
4191
|
+
default:
|
|
4192
|
+
return r.dayPeriod(a, {
|
|
4193
|
+
width: "wide",
|
|
4194
|
+
context: "formatting"
|
|
4195
|
+
});
|
|
4196
|
+
}
|
|
4197
|
+
},
|
|
4198
|
+
// Hour [1-12]
|
|
4199
|
+
h: function(t, e, r) {
|
|
4200
|
+
if (e === "ho") {
|
|
4201
|
+
var n = t.getUTCHours() % 12;
|
|
4202
|
+
return n === 0 && (n = 12), r.ordinalNumber(n, {
|
|
4203
|
+
unit: "hour"
|
|
4204
|
+
});
|
|
4205
|
+
}
|
|
4206
|
+
return K.h(t, e);
|
|
4207
|
+
},
|
|
4208
|
+
// Hour [0-23]
|
|
4209
|
+
H: function(t, e, r) {
|
|
4210
|
+
return e === "Ho" ? r.ordinalNumber(t.getUTCHours(), {
|
|
4211
|
+
unit: "hour"
|
|
4212
|
+
}) : K.H(t, e);
|
|
4213
|
+
},
|
|
4214
|
+
// Hour [0-11]
|
|
4215
|
+
K: function(t, e, r) {
|
|
4216
|
+
var n = t.getUTCHours() % 12;
|
|
4217
|
+
return e === "Ko" ? r.ordinalNumber(n, {
|
|
4218
|
+
unit: "hour"
|
|
4219
|
+
}) : S(n, e.length);
|
|
4220
|
+
},
|
|
4221
|
+
// Hour [1-24]
|
|
4222
|
+
k: function(t, e, r) {
|
|
4223
|
+
var n = t.getUTCHours();
|
|
4224
|
+
return n === 0 && (n = 24), e === "ko" ? r.ordinalNumber(n, {
|
|
4225
|
+
unit: "hour"
|
|
4226
|
+
}) : S(n, e.length);
|
|
4227
|
+
},
|
|
4228
|
+
// Minute
|
|
4229
|
+
m: function(t, e, r) {
|
|
4230
|
+
return e === "mo" ? r.ordinalNumber(t.getUTCMinutes(), {
|
|
4231
|
+
unit: "minute"
|
|
4232
|
+
}) : K.m(t, e);
|
|
4233
|
+
},
|
|
4234
|
+
// Second
|
|
4235
|
+
s: function(t, e, r) {
|
|
4236
|
+
return e === "so" ? r.ordinalNumber(t.getUTCSeconds(), {
|
|
4237
|
+
unit: "second"
|
|
4238
|
+
}) : K.s(t, e);
|
|
4239
|
+
},
|
|
4240
|
+
// Fraction of second
|
|
4241
|
+
S: function(t, e) {
|
|
4242
|
+
return K.S(t, e);
|
|
4243
|
+
},
|
|
4244
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
4245
|
+
X: function(t, e, r, n) {
|
|
4246
|
+
var a = n._originalDate || t, i = a.getTimezoneOffset();
|
|
4247
|
+
if (i === 0)
|
|
4248
|
+
return "Z";
|
|
4249
|
+
switch (e) {
|
|
4250
|
+
case "X":
|
|
4251
|
+
return wr(i);
|
|
4252
|
+
case "XXXX":
|
|
4253
|
+
case "XX":
|
|
4254
|
+
return ae(i);
|
|
4255
|
+
case "XXXXX":
|
|
4256
|
+
case "XXX":
|
|
4257
|
+
default:
|
|
4258
|
+
return ae(i, ":");
|
|
4259
|
+
}
|
|
4260
|
+
},
|
|
4261
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
4262
|
+
x: function(t, e, r, n) {
|
|
4263
|
+
var a = n._originalDate || t, i = a.getTimezoneOffset();
|
|
4264
|
+
switch (e) {
|
|
4265
|
+
case "x":
|
|
4266
|
+
return wr(i);
|
|
4267
|
+
case "xxxx":
|
|
4268
|
+
case "xx":
|
|
4269
|
+
return ae(i);
|
|
4270
|
+
case "xxxxx":
|
|
4271
|
+
case "xxx":
|
|
4272
|
+
default:
|
|
4273
|
+
return ae(i, ":");
|
|
4274
|
+
}
|
|
4275
|
+
},
|
|
4276
|
+
// Timezone (GMT)
|
|
4277
|
+
O: function(t, e, r, n) {
|
|
4278
|
+
var a = n._originalDate || t, i = a.getTimezoneOffset();
|
|
4279
|
+
switch (e) {
|
|
4280
|
+
case "O":
|
|
4281
|
+
case "OO":
|
|
4282
|
+
case "OOO":
|
|
4283
|
+
return "GMT" + br(i, ":");
|
|
4284
|
+
case "OOOO":
|
|
4285
|
+
default:
|
|
4286
|
+
return "GMT" + ae(i, ":");
|
|
4287
|
+
}
|
|
4288
|
+
},
|
|
4289
|
+
// Timezone (specific non-location)
|
|
4290
|
+
z: function(t, e, r, n) {
|
|
4291
|
+
var a = n._originalDate || t, i = a.getTimezoneOffset();
|
|
4292
|
+
switch (e) {
|
|
4293
|
+
case "z":
|
|
4294
|
+
case "zz":
|
|
4295
|
+
case "zzz":
|
|
4296
|
+
return "GMT" + br(i, ":");
|
|
4297
|
+
case "zzzz":
|
|
4298
|
+
default:
|
|
4299
|
+
return "GMT" + ae(i, ":");
|
|
4300
|
+
}
|
|
4301
|
+
},
|
|
4302
|
+
// Seconds timestamp
|
|
4303
|
+
t: function(t, e, r, n) {
|
|
4304
|
+
var a = n._originalDate || t, i = Math.floor(a.getTime() / 1e3);
|
|
4305
|
+
return S(i, e.length);
|
|
4306
|
+
},
|
|
4307
|
+
// Milliseconds timestamp
|
|
4308
|
+
T: function(t, e, r, n) {
|
|
4309
|
+
var a = n._originalDate || t, i = a.getTime();
|
|
4310
|
+
return S(i, e.length);
|
|
4311
|
+
}
|
|
4312
|
+
};
|
|
4313
|
+
function br(t, e) {
|
|
4314
|
+
var r = t > 0 ? "-" : "+", n = Math.abs(t), a = Math.floor(n / 60), i = n % 60;
|
|
4315
|
+
if (i === 0)
|
|
4316
|
+
return r + String(a);
|
|
4317
|
+
var o = e || "";
|
|
4318
|
+
return r + String(a) + o + S(i, 2);
|
|
4319
|
+
}
|
|
4320
|
+
function wr(t, e) {
|
|
4321
|
+
if (t % 60 === 0) {
|
|
4322
|
+
var r = t > 0 ? "-" : "+";
|
|
4323
|
+
return r + S(Math.abs(t) / 60, 2);
|
|
4324
|
+
}
|
|
4325
|
+
return ae(t, e);
|
|
4326
|
+
}
|
|
4327
|
+
function ae(t, e) {
|
|
4328
|
+
var r = e || "", n = t > 0 ? "-" : "+", a = Math.abs(t), i = S(Math.floor(a / 60), 2), o = S(a % 60, 2);
|
|
4329
|
+
return n + i + r + o;
|
|
4330
|
+
}
|
|
4331
|
+
const Zu = Ku;
|
|
4332
|
+
function _r(t, e) {
|
|
4333
|
+
switch (t) {
|
|
4334
|
+
case "P":
|
|
4335
|
+
return e.date({
|
|
4336
|
+
width: "short"
|
|
4337
|
+
});
|
|
4338
|
+
case "PP":
|
|
4339
|
+
return e.date({
|
|
4340
|
+
width: "medium"
|
|
4341
|
+
});
|
|
4342
|
+
case "PPP":
|
|
4343
|
+
return e.date({
|
|
4344
|
+
width: "long"
|
|
4345
|
+
});
|
|
4346
|
+
case "PPPP":
|
|
4347
|
+
default:
|
|
4348
|
+
return e.date({
|
|
4349
|
+
width: "full"
|
|
4350
|
+
});
|
|
4351
|
+
}
|
|
4352
|
+
}
|
|
4353
|
+
function vn(t, e) {
|
|
4354
|
+
switch (t) {
|
|
4355
|
+
case "p":
|
|
4356
|
+
return e.time({
|
|
4357
|
+
width: "short"
|
|
4358
|
+
});
|
|
4359
|
+
case "pp":
|
|
4360
|
+
return e.time({
|
|
4361
|
+
width: "medium"
|
|
4362
|
+
});
|
|
4363
|
+
case "ppp":
|
|
4364
|
+
return e.time({
|
|
4365
|
+
width: "long"
|
|
4366
|
+
});
|
|
4367
|
+
case "pppp":
|
|
4368
|
+
default:
|
|
4369
|
+
return e.time({
|
|
4370
|
+
width: "full"
|
|
4371
|
+
});
|
|
4372
|
+
}
|
|
4373
|
+
}
|
|
4374
|
+
function ec(t, e) {
|
|
4375
|
+
var r = t.match(/(P+)(p+)?/) || [], n = r[1], a = r[2];
|
|
4376
|
+
if (!a)
|
|
4377
|
+
return _r(t, e);
|
|
4378
|
+
var i;
|
|
4379
|
+
switch (n) {
|
|
4380
|
+
case "P":
|
|
4381
|
+
i = e.dateTime({
|
|
4382
|
+
width: "short"
|
|
4383
|
+
});
|
|
4384
|
+
break;
|
|
4385
|
+
case "PP":
|
|
4386
|
+
i = e.dateTime({
|
|
4387
|
+
width: "medium"
|
|
4388
|
+
});
|
|
4389
|
+
break;
|
|
4390
|
+
case "PPP":
|
|
4391
|
+
i = e.dateTime({
|
|
4392
|
+
width: "long"
|
|
4393
|
+
});
|
|
4394
|
+
break;
|
|
4395
|
+
case "PPPP":
|
|
4396
|
+
default:
|
|
4397
|
+
i = e.dateTime({
|
|
4398
|
+
width: "full"
|
|
4399
|
+
});
|
|
4400
|
+
break;
|
|
4401
|
+
}
|
|
4402
|
+
return i.replace("{{date}}", _r(n, e)).replace("{{time}}", vn(a, e));
|
|
4403
|
+
}
|
|
4404
|
+
var tc = {
|
|
4405
|
+
p: vn,
|
|
4406
|
+
P: ec
|
|
4407
|
+
};
|
|
4408
|
+
const rc = tc;
|
|
4409
|
+
var nc = ["D", "DD"], ac = ["YY", "YYYY"];
|
|
4410
|
+
function ic(t) {
|
|
4411
|
+
return nc.indexOf(t) !== -1;
|
|
4412
|
+
}
|
|
4413
|
+
function oc(t) {
|
|
4414
|
+
return ac.indexOf(t) !== -1;
|
|
4415
|
+
}
|
|
4416
|
+
function Or(t, e, r) {
|
|
4417
|
+
if (t === "YYYY")
|
|
4418
|
+
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e, "`) for formatting years to the input `").concat(r, "`; see: https://git.io/fxCyr"));
|
|
4419
|
+
if (t === "YY")
|
|
4420
|
+
throw new RangeError("Use `yy` instead of `YY` (in `".concat(e, "`) for formatting years to the input `").concat(r, "`; see: https://git.io/fxCyr"));
|
|
4421
|
+
if (t === "D")
|
|
4422
|
+
throw new RangeError("Use `d` instead of `D` (in `".concat(e, "`) for formatting days of the month to the input `").concat(r, "`; see: https://git.io/fxCyr"));
|
|
4423
|
+
if (t === "DD")
|
|
4424
|
+
throw new RangeError("Use `dd` instead of `DD` (in `".concat(e, "`) for formatting days of the month to the input `").concat(r, "`; see: https://git.io/fxCyr"));
|
|
4425
|
+
}
|
|
4426
|
+
var sc = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, uc = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, cc = /^'([^]*?)'?$/, fc = /''/g, lc = /[a-zA-Z]/;
|
|
4427
|
+
function be(t, e, r) {
|
|
4428
|
+
M(2, arguments);
|
|
4429
|
+
var n = String(e), a = r || {}, i = a.locale || Wu, o = i.options && i.options.firstWeekContainsDate, s = o == null ? 1 : H(o), u = a.firstWeekContainsDate == null ? s : H(a.firstWeekContainsDate);
|
|
4430
|
+
if (!(u >= 1 && u <= 7))
|
|
4431
|
+
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
4432
|
+
var c = i.options && i.options.weekStartsOn, g = c == null ? 0 : H(c), d = a.weekStartsOn == null ? g : H(a.weekStartsOn);
|
|
4433
|
+
if (!(d >= 0 && d <= 6))
|
|
4434
|
+
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
4435
|
+
if (!i.localize)
|
|
4436
|
+
throw new RangeError("locale must contain localize property");
|
|
4437
|
+
if (!i.formatLong)
|
|
4438
|
+
throw new RangeError("locale must contain formatLong property");
|
|
4439
|
+
var p = N(t);
|
|
4440
|
+
if (!ru(p))
|
|
4441
|
+
throw new RangeError("Invalid time value");
|
|
4442
|
+
var x = Zs(p), C = Lu(p, x), E = {
|
|
4443
|
+
firstWeekContainsDate: u,
|
|
4444
|
+
weekStartsOn: d,
|
|
4445
|
+
locale: i,
|
|
4446
|
+
_originalDate: p
|
|
4447
|
+
}, O = n.match(uc).map(function(b) {
|
|
4448
|
+
var _ = b[0];
|
|
4449
|
+
if (_ === "p" || _ === "P") {
|
|
4450
|
+
var T = rc[_];
|
|
4451
|
+
return T(b, i.formatLong, E);
|
|
4452
|
+
}
|
|
4453
|
+
return b;
|
|
4454
|
+
}).join("").match(sc).map(function(b) {
|
|
4455
|
+
if (b === "''")
|
|
4456
|
+
return "'";
|
|
4457
|
+
var _ = b[0];
|
|
4458
|
+
if (_ === "'")
|
|
4459
|
+
return dc(b);
|
|
4460
|
+
var T = Zu[_];
|
|
4461
|
+
if (T)
|
|
4462
|
+
return !a.useAdditionalWeekYearTokens && oc(b) && Or(b, e, t), !a.useAdditionalDayOfYearTokens && ic(b) && Or(b, e, t), T(C, b, i.localize, E);
|
|
4463
|
+
if (_.match(lc))
|
|
4464
|
+
throw new RangeError("Format string contains an unescaped latin alphabet character `" + _ + "`");
|
|
4465
|
+
return b;
|
|
4466
|
+
}).join("");
|
|
4467
|
+
return O;
|
|
4468
|
+
}
|
|
4469
|
+
function dc(t) {
|
|
4470
|
+
return t.match(cc)[1].replace(fc, "'");
|
|
4471
|
+
}
|
|
4472
|
+
function hc(t, e) {
|
|
4473
|
+
M(2, arguments);
|
|
4474
|
+
var r = N(t), n = N(e);
|
|
4475
|
+
return r.getFullYear() === n.getFullYear() && r.getMonth() === n.getMonth();
|
|
4476
|
+
}
|
|
4477
|
+
const pc = "_eventCard_1qrgl_1", vc = "_eventCardBody_1qrgl_12", mc = "_image_1qrgl_27", gc = "_eventCardTitle_1qrgl_33", yc = "_eventCardDate_1qrgl_40", bc = "_eventCardDescription_1qrgl_45", wc = "_eventButtons_1qrgl_53", _c = "_eventButton_1qrgl_53", Y = {
|
|
4478
|
+
eventCard: pc,
|
|
4479
|
+
eventCardBody: vc,
|
|
4480
|
+
image: mc,
|
|
4481
|
+
eventCardTitle: gc,
|
|
4482
|
+
eventCardDate: yc,
|
|
4483
|
+
eventCardDescription: bc,
|
|
4484
|
+
eventButtons: wc,
|
|
4485
|
+
eventButton: _c
|
|
4486
|
+
}, Oc = ({
|
|
4487
|
+
name: t,
|
|
4488
|
+
image: e,
|
|
4489
|
+
startDate: r,
|
|
4490
|
+
endDate: n,
|
|
4491
|
+
shortDescription: a,
|
|
4492
|
+
buttons: i,
|
|
4493
|
+
loading: o,
|
|
4494
|
+
containerStyle: s
|
|
4495
|
+
}) => {
|
|
4496
|
+
const u = Ec(r, n);
|
|
4497
|
+
return /* @__PURE__ */ m.jsx(yn, { baseColor: "#dcdcdc", children: /* @__PURE__ */ m.jsxs("div", { className: Y.eventCard, style: { ...s }, children: [
|
|
4498
|
+
e ? /* @__PURE__ */ m.jsx(
|
|
4499
|
+
"img",
|
|
4500
|
+
{
|
|
4501
|
+
src: kt(e).height(400).url(),
|
|
4502
|
+
className: Y.image,
|
|
4503
|
+
crossOrigin: "anonymous",
|
|
4504
|
+
alt: ""
|
|
4505
|
+
}
|
|
4506
|
+
) : /* @__PURE__ */ m.jsx("div", { className: Y.image, children: /* @__PURE__ */ m.jsx(le, { height: 400 }) }),
|
|
4507
|
+
/* @__PURE__ */ m.jsxs("div", { className: Y.eventCardBody, children: [
|
|
4508
|
+
/* @__PURE__ */ m.jsxs("div", { children: [
|
|
4509
|
+
/* @__PURE__ */ m.jsx("h3", { className: Y.eventCardTitle, children: t || /* @__PURE__ */ m.jsx(le, {}) }),
|
|
4510
|
+
/* @__PURE__ */ m.jsx("div", { className: Y.eventCardDate, children: u || /* @__PURE__ */ m.jsx(le, {}) })
|
|
4511
|
+
] }),
|
|
4512
|
+
/* @__PURE__ */ m.jsx("div", { className: Y.eventCardDescription, children: a ? /* @__PURE__ */ m.jsx(Cr, { value: a }) : /* @__PURE__ */ m.jsx(le, { count: 7 }) }),
|
|
4513
|
+
/* @__PURE__ */ m.jsx("div", { className: Y.eventButtons, children: i ? i.map(({ url: c, text: g, _key: d }) => /* @__PURE__ */ m.jsx(
|
|
4514
|
+
"a",
|
|
4515
|
+
{
|
|
4516
|
+
href: c,
|
|
4517
|
+
className: Y.eventButton,
|
|
4518
|
+
children: /* @__PURE__ */ m.jsx("div", { children: g })
|
|
4519
|
+
},
|
|
4520
|
+
d
|
|
4521
|
+
)) : o && /* @__PURE__ */ m.jsx(le, { className: Y.eventButton }) })
|
|
4522
|
+
] })
|
|
4523
|
+
] }) });
|
|
4524
|
+
};
|
|
4525
|
+
function Ec(t, e) {
|
|
4526
|
+
if (!t || !e)
|
|
4527
|
+
return null;
|
|
4528
|
+
const r = new Date(t), n = new Date(e);
|
|
4529
|
+
return eu(r, n) ? be(r, "MMMM d") : hc(r, n) ? be(r, "MMMM d") + " – " + be(n, "d") : be(r, "MMMM d") + " – " + be(n, "MMMM d");
|
|
4530
|
+
}
|
|
4531
|
+
const Sc = () => /* @__PURE__ */ m.jsxs(
|
|
4532
|
+
"svg",
|
|
4533
|
+
{
|
|
4534
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4535
|
+
width: "24",
|
|
4536
|
+
height: "24",
|
|
4537
|
+
viewBox: "0 0 24 24",
|
|
4538
|
+
fill: "none",
|
|
4539
|
+
stroke: "currentColor",
|
|
4540
|
+
strokeWidth: "2",
|
|
4541
|
+
strokeLinecap: "round",
|
|
4542
|
+
strokeLinejoin: "round",
|
|
4543
|
+
className: "feather feather-calendar",
|
|
4544
|
+
children: [
|
|
4545
|
+
/* @__PURE__ */ m.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
4546
|
+
/* @__PURE__ */ m.jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
|
|
4547
|
+
/* @__PURE__ */ m.jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
|
|
4548
|
+
/* @__PURE__ */ m.jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
|
|
4549
|
+
]
|
|
4550
|
+
}
|
|
4551
|
+
), xc = "_campEventsApp_6gd1t_1", Cc = "_eventsHeader_6gd1t_14", Pc = "_calendarButton_6gd1t_30", Tc = "_eventsContainer_6gd1t_50", Me = {
|
|
4552
|
+
campEventsApp: xc,
|
|
4553
|
+
eventsHeader: Cc,
|
|
4554
|
+
calendarButton: Pc,
|
|
4555
|
+
eventsContainer: Tc
|
|
4556
|
+
}, jc = ({
|
|
4557
|
+
events: t,
|
|
4558
|
+
loading: e,
|
|
4559
|
+
title: r = "What's going on at Camp?",
|
|
4560
|
+
showCalendar: n = !0
|
|
4561
|
+
}) => /* @__PURE__ */ m.jsxs("div", { className: Me.campEventsApp, children: [
|
|
4562
|
+
/* @__PURE__ */ m.jsxs("div", { className: Me.eventsHeader, children: [
|
|
4563
|
+
/* @__PURE__ */ m.jsx("h1", { children: r }),
|
|
4564
|
+
n && /* @__PURE__ */ m.jsxs("a", { className: Me.calendarButton, href: "/calendar", children: [
|
|
4565
|
+
"Check out our calendar",
|
|
4566
|
+
/* @__PURE__ */ m.jsx(Sc, {})
|
|
4567
|
+
] })
|
|
4568
|
+
] }),
|
|
4569
|
+
/* @__PURE__ */ m.jsx("div", { className: Me.eventsContainer, children: t.map((a, i) => /* @__PURE__ */ I.createElement(Oc, { ...a, key: i, loading: e })) })
|
|
4570
|
+
] }), Dc = "_contentButton_2dk7a_1", qc = "_overlay_2dk7a_40", Mc = "_buttonTitle_2dk7a_56", Ac = "_buttonSubtitle_2dk7a_57", Rc = "_contentButtonsHeader_2dk7a_73", we = {
|
|
4571
|
+
contentButton: Dc,
|
|
4572
|
+
"category-image": "_category-image_2dk7a_25",
|
|
4573
|
+
overlay: qc,
|
|
4574
|
+
buttonTitle: Mc,
|
|
4575
|
+
buttonSubtitle: Ac,
|
|
4576
|
+
contentButtonsHeader: Rc
|
|
4577
|
+
}, Ic = ({
|
|
4578
|
+
title: t,
|
|
4579
|
+
subtitle: e,
|
|
4580
|
+
url: r,
|
|
4581
|
+
imageUrl: n
|
|
4582
|
+
}) => /* @__PURE__ */ m.jsxs("a", { href: r, className: we.contentButton, children: [
|
|
4583
|
+
/* @__PURE__ */ m.jsx(
|
|
4584
|
+
"img",
|
|
4585
|
+
{
|
|
4586
|
+
src: n,
|
|
4587
|
+
alt: t,
|
|
4588
|
+
className: we["category-image"]
|
|
4589
|
+
}
|
|
4590
|
+
),
|
|
4591
|
+
/* @__PURE__ */ m.jsxs("div", { className: we.overlay, children: [
|
|
4592
|
+
/* @__PURE__ */ m.jsx("div", { className: we.buttonTitle, children: t }),
|
|
4593
|
+
/* @__PURE__ */ m.jsx("div", { className: we.buttonSubtitle, children: e })
|
|
4594
|
+
] })
|
|
4595
|
+
] }), $c = "_categoryContainer_1yxkk_1", Uc = "_categoryContainerHeader_1yxkk_25", kc = {
|
|
4596
|
+
categoryContainer: $c,
|
|
4597
|
+
categoryContainerHeader: Uc
|
|
4598
|
+
}, Nc = ({ categories: t }) => /* @__PURE__ */ m.jsx("div", { children: /* @__PURE__ */ m.jsx("div", { className: kc.categoryContainer, children: t.length > 0 && t.map((e) => /* @__PURE__ */ m.jsx(
|
|
4599
|
+
Ic,
|
|
4600
|
+
{
|
|
4601
|
+
title: e.title,
|
|
4602
|
+
subtitle: e.subtitle,
|
|
4603
|
+
url: e.url,
|
|
4604
|
+
imageUrl: e.imageUrl
|
|
4605
|
+
},
|
|
4606
|
+
e.title
|
|
4607
|
+
)) }) }), Hc = (t) => t.map((e) => ({
|
|
4608
|
+
...e,
|
|
4609
|
+
imageUrl: kt(e.image).width(800).url()
|
|
4610
|
+
})), Wc = "_description_z94kn_1", Lc = {
|
|
4611
|
+
description: Wc
|
|
4612
|
+
}, Fc = ({ rateDescription: t }) => {
|
|
4613
|
+
const { title: e, text: r } = t || {};
|
|
4614
|
+
return /* @__PURE__ */ m.jsxs("div", { className: Lc.description, children: [
|
|
4615
|
+
e && /* @__PURE__ */ m.jsx("h4", { children: e }),
|
|
4616
|
+
r && /* @__PURE__ */ m.jsx("span", { children: r })
|
|
4617
|
+
] });
|
|
4618
|
+
}, pt = ({
|
|
4619
|
+
name: t,
|
|
4620
|
+
detail: e,
|
|
4621
|
+
value: r,
|
|
4622
|
+
className: n
|
|
4623
|
+
}) => /* @__PURE__ */ m.jsxs("tr", { className: n, children: [
|
|
4624
|
+
/* @__PURE__ */ m.jsx("td", { children: t }),
|
|
4625
|
+
e && /* @__PURE__ */ m.jsx("td", { children: e }),
|
|
4626
|
+
/* @__PURE__ */ m.jsx("td", { children: r })
|
|
4627
|
+
] }), Er = {
|
|
4628
|
+
"group-title": "_group-title_12ylh_1",
|
|
4629
|
+
"rate-group-child": "_rate-group-child_12ylh_5"
|
|
4630
|
+
}, Bc = ({ rateGroup: t }) => /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
|
|
4631
|
+
/* @__PURE__ */ m.jsx(pt, { name: t.name, className: Er["group-title"] }),
|
|
4632
|
+
t.childRates.map((e) => /* @__PURE__ */ m.jsx(
|
|
4633
|
+
pt,
|
|
4634
|
+
{
|
|
4635
|
+
name: e.name,
|
|
4636
|
+
value: e.cost,
|
|
4637
|
+
className: Er["rate-group-child"]
|
|
4638
|
+
},
|
|
4639
|
+
e.name
|
|
4640
|
+
))
|
|
4641
|
+
] }), Sr = {
|
|
4642
|
+
"rate-table": "_rate-table_6wuu7_1",
|
|
4643
|
+
"background-darker": "_background-darker_6wuu7_15",
|
|
4644
|
+
"group-title": "_group-title_6wuu7_33"
|
|
4645
|
+
}, Yc = (t) => {
|
|
4646
|
+
const { rateTable: e } = t, r = e.some((i) => i._type === "rateGroup"), n = e.some((i) => i._type === "rate" && i.detail), a = e.map((i) => {
|
|
4647
|
+
if (i._type === "rate")
|
|
4648
|
+
return n && (i = {
|
|
4649
|
+
detail: i.detail ?? " ",
|
|
4650
|
+
...i
|
|
4651
|
+
}), /* @__PURE__ */ m.jsx(
|
|
4652
|
+
pt,
|
|
4653
|
+
{
|
|
4654
|
+
name: i.name,
|
|
4655
|
+
detail: i.detail,
|
|
4656
|
+
value: i.cost,
|
|
4657
|
+
className: r ? Sr["group-title"] : ""
|
|
4658
|
+
},
|
|
4659
|
+
i.name
|
|
4660
|
+
);
|
|
4661
|
+
if (i._type === "rateGroup")
|
|
4662
|
+
return /* @__PURE__ */ m.jsx(Bc, { rateGroup: i }, i.name);
|
|
4663
|
+
});
|
|
4664
|
+
return /* @__PURE__ */ m.jsx("table", { className: Sr["rate-table"], children: /* @__PURE__ */ m.jsx("tbody", { children: a }) });
|
|
4665
|
+
}, xr = {
|
|
4666
|
+
"rate-card": "_rate-card_i5ys9_1",
|
|
4667
|
+
"rate-card-heading": "_rate-card-heading_i5ys9_13"
|
|
4668
|
+
}, Xc = (t) => {
|
|
4669
|
+
const { heading: e, rates: r } = t, n = r.reduce((a, i) => {
|
|
4670
|
+
if (i._type === "rateDescription")
|
|
4671
|
+
return [...a, i];
|
|
4672
|
+
{
|
|
4673
|
+
const o = a[a.length - 1];
|
|
4674
|
+
return Array.isArray(o) ? (o.push(i), a) : [...a, [i]];
|
|
4675
|
+
}
|
|
4676
|
+
}, []);
|
|
4677
|
+
return /* @__PURE__ */ m.jsxs("div", { className: xr["rate-card"], children: [
|
|
4678
|
+
/* @__PURE__ */ m.jsx("div", { className: xr["rate-card-heading"], children: /* @__PURE__ */ m.jsx("h3", { children: e }) }),
|
|
4679
|
+
n.map((a, i) => Array.isArray(a) ? /* @__PURE__ */ m.jsx(Yc, { rateTable: a }, i) : /* @__PURE__ */ m.jsx(Fc, { rateDescription: a }, i))
|
|
4680
|
+
] });
|
|
4681
|
+
}, Gc = ({ type: t }) => {
|
|
4682
|
+
const [e, r] = I.useState([
|
|
4683
|
+
null,
|
|
4684
|
+
null,
|
|
4685
|
+
null
|
|
4686
|
+
]), [n, a] = I.useState(!0);
|
|
4687
|
+
return I.useEffect(() => {
|
|
4688
|
+
async function i() {
|
|
4689
|
+
(t === "events" ? Ls : Fs)().then((s) => r(s)).catch((s) => console.log(s)).finally(() => a(!1));
|
|
4690
|
+
}
|
|
4691
|
+
i();
|
|
4692
|
+
}, [t]), /* @__PURE__ */ m.jsx(
|
|
4693
|
+
jc,
|
|
4694
|
+
{
|
|
4695
|
+
events: e,
|
|
4696
|
+
loading: n,
|
|
4697
|
+
showCalendar: t === "events",
|
|
4698
|
+
title: t === "events" ? "What's going on at Camp?" : "Upcoming Board Events"
|
|
4699
|
+
}
|
|
4700
|
+
);
|
|
4701
|
+
}, Qc = () => {
|
|
4702
|
+
const [t, e] = I.useState([]), [r, n] = I.useState(!0);
|
|
4703
|
+
return I.useEffect(() => {
|
|
4704
|
+
Ws().then((a) => e(a)).catch((a) => console.log(a)).finally(() => n(!1));
|
|
4705
|
+
}, []), /* @__PURE__ */ m.jsx(Js, { children: t.map((a) => /* @__PURE__ */ I.createElement(Vs, { ...a, loading: r, key: a._id })) });
|
|
4706
|
+
}, Jc = () => {
|
|
4707
|
+
const [t, e] = I.useState([]), [r, n] = I.useState(!0);
|
|
4708
|
+
return I.useEffect(() => {
|
|
4709
|
+
Bs().then(
|
|
4710
|
+
(a) => e(Hc(a))
|
|
4711
|
+
).catch((a) => console.log(a)).finally(() => n(!1));
|
|
4712
|
+
}, []), /* @__PURE__ */ m.jsx(Nc, { categories: t });
|
|
4713
|
+
}, zc = {
|
|
4714
|
+
"rates-container": "_rates-container_123ct_1"
|
|
4715
|
+
}, Kc = () => {
|
|
4716
|
+
const [t, e] = I.useState([]), [r, n] = I.useState(!0);
|
|
4717
|
+
return I.useEffect(() => {
|
|
4718
|
+
Ys().then((a) => e(a)).catch((a) => console.log(a)).finally(() => n(!1));
|
|
4719
|
+
}, []), /* @__PURE__ */ m.jsx("div", { className: zc["rates-container"], children: t.map((a) => /* @__PURE__ */ m.jsx(
|
|
4720
|
+
Xc,
|
|
4721
|
+
{
|
|
4722
|
+
heading: a.name,
|
|
4723
|
+
rates: a.rates
|
|
4724
|
+
},
|
|
4725
|
+
a.name
|
|
4726
|
+
)) });
|
|
4727
|
+
};
|
|
4728
|
+
export {
|
|
4729
|
+
Qc as B,
|
|
4730
|
+
Jc as C,
|
|
4731
|
+
Gc as E,
|
|
4732
|
+
Kc as R,
|
|
4733
|
+
Pr as g
|
|
4734
|
+
};
|