@timardex/cluemart-server-shared 1.1.38 → 2.0.0

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/index.cjs CHANGED
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
8
11
  var __export = (target, all) => {
9
12
  for (var name in all)
10
13
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -27,6 +30,1467 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
30
  ));
28
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
32
 
33
+ // node_modules/react/cjs/react.production.js
34
+ var require_react_production = __commonJS({
35
+ "node_modules/react/cjs/react.production.js"(exports2) {
36
+ "use strict";
37
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
38
+ var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
39
+ var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
40
+ var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
41
+ var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
42
+ var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
43
+ var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
44
+ var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
45
+ var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
46
+ var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
47
+ var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
48
+ var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
49
+ var REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition");
50
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
51
+ function getIteratorFn(maybeIterable) {
52
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
53
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
54
+ return "function" === typeof maybeIterable ? maybeIterable : null;
55
+ }
56
+ var ReactNoopUpdateQueue = {
57
+ isMounted: function() {
58
+ return false;
59
+ },
60
+ enqueueForceUpdate: function() {
61
+ },
62
+ enqueueReplaceState: function() {
63
+ },
64
+ enqueueSetState: function() {
65
+ }
66
+ };
67
+ var assign = Object.assign;
68
+ var emptyObject = {};
69
+ function Component(props, context, updater) {
70
+ this.props = props;
71
+ this.context = context;
72
+ this.refs = emptyObject;
73
+ this.updater = updater || ReactNoopUpdateQueue;
74
+ }
75
+ Component.prototype.isReactComponent = {};
76
+ Component.prototype.setState = function(partialState, callback) {
77
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
78
+ throw Error(
79
+ "takes an object of state variables to update or a function which returns an object of state variables."
80
+ );
81
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
82
+ };
83
+ Component.prototype.forceUpdate = function(callback) {
84
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
85
+ };
86
+ function ComponentDummy() {
87
+ }
88
+ ComponentDummy.prototype = Component.prototype;
89
+ function PureComponent(props, context, updater) {
90
+ this.props = props;
91
+ this.context = context;
92
+ this.refs = emptyObject;
93
+ this.updater = updater || ReactNoopUpdateQueue;
94
+ }
95
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
96
+ pureComponentPrototype.constructor = PureComponent;
97
+ assign(pureComponentPrototype, Component.prototype);
98
+ pureComponentPrototype.isPureReactComponent = true;
99
+ var isArrayImpl = Array.isArray;
100
+ function noop() {
101
+ }
102
+ var ReactSharedInternals = { H: null, A: null, T: null, S: null };
103
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
104
+ function ReactElement(type, key, props) {
105
+ var refProp = props.ref;
106
+ return {
107
+ $$typeof: REACT_ELEMENT_TYPE,
108
+ type,
109
+ key,
110
+ ref: void 0 !== refProp ? refProp : null,
111
+ props
112
+ };
113
+ }
114
+ function cloneAndReplaceKey(oldElement, newKey) {
115
+ return ReactElement(oldElement.type, newKey, oldElement.props);
116
+ }
117
+ function isValidElement(object) {
118
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
119
+ }
120
+ function escape(key) {
121
+ var escaperLookup = { "=": "=0", ":": "=2" };
122
+ return "$" + key.replace(/[=:]/g, function(match) {
123
+ return escaperLookup[match];
124
+ });
125
+ }
126
+ var userProvidedKeyEscapeRegex = /\/+/g;
127
+ function getElementKey(element, index) {
128
+ return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
129
+ }
130
+ function resolveThenable(thenable) {
131
+ switch (thenable.status) {
132
+ case "fulfilled":
133
+ return thenable.value;
134
+ case "rejected":
135
+ throw thenable.reason;
136
+ default:
137
+ switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
138
+ function(fulfilledValue) {
139
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
140
+ },
141
+ function(error) {
142
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
143
+ }
144
+ )), thenable.status) {
145
+ case "fulfilled":
146
+ return thenable.value;
147
+ case "rejected":
148
+ throw thenable.reason;
149
+ }
150
+ }
151
+ throw thenable;
152
+ }
153
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
154
+ var type = typeof children;
155
+ if ("undefined" === type || "boolean" === type) children = null;
156
+ var invokeCallback = false;
157
+ if (null === children) invokeCallback = true;
158
+ else
159
+ switch (type) {
160
+ case "bigint":
161
+ case "string":
162
+ case "number":
163
+ invokeCallback = true;
164
+ break;
165
+ case "object":
166
+ switch (children.$$typeof) {
167
+ case REACT_ELEMENT_TYPE:
168
+ case REACT_PORTAL_TYPE:
169
+ invokeCallback = true;
170
+ break;
171
+ case REACT_LAZY_TYPE:
172
+ return invokeCallback = children._init, mapIntoArray(
173
+ invokeCallback(children._payload),
174
+ array,
175
+ escapedPrefix,
176
+ nameSoFar,
177
+ callback
178
+ );
179
+ }
180
+ }
181
+ if (invokeCallback)
182
+ return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
183
+ return c;
184
+ })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
185
+ callback,
186
+ escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
187
+ userProvidedKeyEscapeRegex,
188
+ "$&/"
189
+ ) + "/") + invokeCallback
190
+ )), array.push(callback)), 1;
191
+ invokeCallback = 0;
192
+ var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
193
+ if (isArrayImpl(children))
194
+ for (var i = 0; i < children.length; i++)
195
+ nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
196
+ nameSoFar,
197
+ array,
198
+ escapedPrefix,
199
+ type,
200
+ callback
201
+ );
202
+ else if (i = getIteratorFn(children), "function" === typeof i)
203
+ for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
204
+ nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
205
+ nameSoFar,
206
+ array,
207
+ escapedPrefix,
208
+ type,
209
+ callback
210
+ );
211
+ else if ("object" === type) {
212
+ if ("function" === typeof children.then)
213
+ return mapIntoArray(
214
+ resolveThenable(children),
215
+ array,
216
+ escapedPrefix,
217
+ nameSoFar,
218
+ callback
219
+ );
220
+ array = String(children);
221
+ throw Error(
222
+ "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
223
+ );
224
+ }
225
+ return invokeCallback;
226
+ }
227
+ function mapChildren(children, func, context) {
228
+ if (null == children) return children;
229
+ var result = [], count = 0;
230
+ mapIntoArray(children, result, "", "", function(child) {
231
+ return func.call(context, child, count++);
232
+ });
233
+ return result;
234
+ }
235
+ function lazyInitializer(payload) {
236
+ if (-1 === payload._status) {
237
+ var ctor = payload._result, thenable = ctor();
238
+ thenable.then(
239
+ function(moduleObject) {
240
+ if (0 === payload._status || -1 === payload._status)
241
+ payload._status = 1, payload._result = moduleObject, void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
242
+ },
243
+ function(error) {
244
+ if (0 === payload._status || -1 === payload._status)
245
+ payload._status = 2, payload._result = error, void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
246
+ }
247
+ );
248
+ -1 === payload._status && (payload._status = 0, payload._result = thenable);
249
+ }
250
+ if (1 === payload._status) return payload._result.default;
251
+ throw payload._result;
252
+ }
253
+ var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
254
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
255
+ var event = new window.ErrorEvent("error", {
256
+ bubbles: true,
257
+ cancelable: true,
258
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
259
+ error
260
+ });
261
+ if (!window.dispatchEvent(event)) return;
262
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
263
+ process.emit("uncaughtException", error);
264
+ return;
265
+ }
266
+ console.error(error);
267
+ };
268
+ function startTransition(scope) {
269
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
270
+ currentTransition.types = null !== prevTransition ? prevTransition.types : null;
271
+ ReactSharedInternals.T = currentTransition;
272
+ try {
273
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
274
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
275
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
276
+ } catch (error) {
277
+ reportGlobalError(error);
278
+ } finally {
279
+ null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
280
+ }
281
+ }
282
+ function addTransitionType(type) {
283
+ var transition = ReactSharedInternals.T;
284
+ if (null !== transition) {
285
+ var transitionTypes = transition.types;
286
+ null === transitionTypes ? transition.types = [type] : -1 === transitionTypes.indexOf(type) && transitionTypes.push(type);
287
+ } else startTransition(addTransitionType.bind(null, type));
288
+ }
289
+ var Children = {
290
+ map: mapChildren,
291
+ forEach: function(children, forEachFunc, forEachContext) {
292
+ mapChildren(
293
+ children,
294
+ function() {
295
+ forEachFunc.apply(this, arguments);
296
+ },
297
+ forEachContext
298
+ );
299
+ },
300
+ count: function(children) {
301
+ var n = 0;
302
+ mapChildren(children, function() {
303
+ n++;
304
+ });
305
+ return n;
306
+ },
307
+ toArray: function(children) {
308
+ return mapChildren(children, function(child) {
309
+ return child;
310
+ }) || [];
311
+ },
312
+ only: function(children) {
313
+ if (!isValidElement(children))
314
+ throw Error(
315
+ "React.Children.only expected to receive a single React element child."
316
+ );
317
+ return children;
318
+ }
319
+ };
320
+ exports2.Activity = REACT_ACTIVITY_TYPE;
321
+ exports2.Children = Children;
322
+ exports2.Component = Component;
323
+ exports2.Fragment = REACT_FRAGMENT_TYPE;
324
+ exports2.Profiler = REACT_PROFILER_TYPE;
325
+ exports2.PureComponent = PureComponent;
326
+ exports2.StrictMode = REACT_STRICT_MODE_TYPE;
327
+ exports2.Suspense = REACT_SUSPENSE_TYPE;
328
+ exports2.ViewTransition = REACT_VIEW_TRANSITION_TYPE;
329
+ exports2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
330
+ exports2.__COMPILER_RUNTIME = {
331
+ __proto__: null,
332
+ c: function(size) {
333
+ return ReactSharedInternals.H.useMemoCache(size);
334
+ }
335
+ };
336
+ exports2.addTransitionType = addTransitionType;
337
+ exports2.cache = function(fn) {
338
+ return function() {
339
+ return fn.apply(null, arguments);
340
+ };
341
+ };
342
+ exports2.cacheSignal = function() {
343
+ return null;
344
+ };
345
+ exports2.cloneElement = function(element, config, children) {
346
+ if (null === element || void 0 === element)
347
+ throw Error(
348
+ "The argument must be a React element, but you passed " + element + "."
349
+ );
350
+ var props = assign({}, element.props), key = element.key;
351
+ if (null != config)
352
+ for (propName in void 0 !== config.key && (key = "" + config.key), config)
353
+ !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
354
+ var propName = arguments.length - 2;
355
+ if (1 === propName) props.children = children;
356
+ else if (1 < propName) {
357
+ for (var childArray = Array(propName), i = 0; i < propName; i++)
358
+ childArray[i] = arguments[i + 2];
359
+ props.children = childArray;
360
+ }
361
+ return ReactElement(element.type, key, props);
362
+ };
363
+ exports2.createContext = function(defaultValue) {
364
+ defaultValue = {
365
+ $$typeof: REACT_CONTEXT_TYPE,
366
+ _currentValue: defaultValue,
367
+ _currentValue2: defaultValue,
368
+ _threadCount: 0,
369
+ Provider: null,
370
+ Consumer: null
371
+ };
372
+ defaultValue.Provider = defaultValue;
373
+ defaultValue.Consumer = {
374
+ $$typeof: REACT_CONSUMER_TYPE,
375
+ _context: defaultValue
376
+ };
377
+ return defaultValue;
378
+ };
379
+ exports2.createElement = function(type, config, children) {
380
+ var propName, props = {}, key = null;
381
+ if (null != config)
382
+ for (propName in void 0 !== config.key && (key = "" + config.key), config)
383
+ hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
384
+ var childrenLength = arguments.length - 2;
385
+ if (1 === childrenLength) props.children = children;
386
+ else if (1 < childrenLength) {
387
+ for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
388
+ childArray[i] = arguments[i + 2];
389
+ props.children = childArray;
390
+ }
391
+ if (type && type.defaultProps)
392
+ for (propName in childrenLength = type.defaultProps, childrenLength)
393
+ void 0 === props[propName] && (props[propName] = childrenLength[propName]);
394
+ return ReactElement(type, key, props);
395
+ };
396
+ exports2.createRef = function() {
397
+ return { current: null };
398
+ };
399
+ exports2.forwardRef = function(render) {
400
+ return { $$typeof: REACT_FORWARD_REF_TYPE, render };
401
+ };
402
+ exports2.isValidElement = isValidElement;
403
+ exports2.lazy = function(ctor) {
404
+ return {
405
+ $$typeof: REACT_LAZY_TYPE,
406
+ _payload: { _status: -1, _result: ctor },
407
+ _init: lazyInitializer
408
+ };
409
+ };
410
+ exports2.memo = function(type, compare) {
411
+ return {
412
+ $$typeof: REACT_MEMO_TYPE,
413
+ type,
414
+ compare: void 0 === compare ? null : compare
415
+ };
416
+ };
417
+ exports2.startTransition = startTransition;
418
+ exports2.unstable_useCacheRefresh = function() {
419
+ return ReactSharedInternals.H.useCacheRefresh();
420
+ };
421
+ exports2.use = function(usable) {
422
+ return ReactSharedInternals.H.use(usable);
423
+ };
424
+ exports2.useActionState = function(action, initialState, permalink) {
425
+ return ReactSharedInternals.H.useActionState(action, initialState, permalink);
426
+ };
427
+ exports2.useCallback = function(callback, deps) {
428
+ return ReactSharedInternals.H.useCallback(callback, deps);
429
+ };
430
+ exports2.useContext = function(Context) {
431
+ return ReactSharedInternals.H.useContext(Context);
432
+ };
433
+ exports2.useDebugValue = function() {
434
+ };
435
+ exports2.useDeferredValue = function(value, initialValue) {
436
+ return ReactSharedInternals.H.useDeferredValue(value, initialValue);
437
+ };
438
+ exports2.useEffect = function(create, deps) {
439
+ return ReactSharedInternals.H.useEffect(create, deps);
440
+ };
441
+ exports2.useEffectEvent = function(callback) {
442
+ return ReactSharedInternals.H.useEffectEvent(callback);
443
+ };
444
+ exports2.useId = function() {
445
+ return ReactSharedInternals.H.useId();
446
+ };
447
+ exports2.useImperativeHandle = function(ref, create, deps) {
448
+ return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
449
+ };
450
+ exports2.useInsertionEffect = function(create, deps) {
451
+ return ReactSharedInternals.H.useInsertionEffect(create, deps);
452
+ };
453
+ exports2.useLayoutEffect = function(create, deps) {
454
+ return ReactSharedInternals.H.useLayoutEffect(create, deps);
455
+ };
456
+ exports2.useMemo = function(create, deps) {
457
+ return ReactSharedInternals.H.useMemo(create, deps);
458
+ };
459
+ exports2.useOptimistic = function(passthrough, reducer) {
460
+ return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
461
+ };
462
+ exports2.useReducer = function(reducer, initialArg, init) {
463
+ return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
464
+ };
465
+ exports2.useRef = function(initialValue) {
466
+ return ReactSharedInternals.H.useRef(initialValue);
467
+ };
468
+ exports2.useState = function(initialState) {
469
+ return ReactSharedInternals.H.useState(initialState);
470
+ };
471
+ exports2.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
472
+ return ReactSharedInternals.H.useSyncExternalStore(
473
+ subscribe,
474
+ getSnapshot,
475
+ getServerSnapshot
476
+ );
477
+ };
478
+ exports2.useTransition = function() {
479
+ return ReactSharedInternals.H.useTransition();
480
+ };
481
+ exports2.version = "19.3.0";
482
+ }
483
+ });
484
+
485
+ // node_modules/react/cjs/react.development.js
486
+ var require_react_development = __commonJS({
487
+ "node_modules/react/cjs/react.development.js"(exports2, module2) {
488
+ "use strict";
489
+ "production" !== process.env.NODE_ENV && (function() {
490
+ function defineDeprecationWarning(methodName, info) {
491
+ Object.defineProperty(Component.prototype, methodName, {
492
+ get: function() {
493
+ console.warn(
494
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
495
+ info[0],
496
+ info[1]
497
+ );
498
+ }
499
+ });
500
+ }
501
+ function getIteratorFn(maybeIterable) {
502
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
503
+ return null;
504
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
505
+ return "function" === typeof maybeIterable ? maybeIterable : null;
506
+ }
507
+ function warnNoop(publicInstance, callerName) {
508
+ publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
509
+ var warningKey = publicInstance + "." + callerName;
510
+ didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
511
+ "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
512
+ callerName,
513
+ publicInstance
514
+ ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
515
+ }
516
+ function Component(props, context, updater) {
517
+ this.props = props;
518
+ this.context = context;
519
+ this.refs = emptyObject;
520
+ this.updater = updater || ReactNoopUpdateQueue;
521
+ }
522
+ function ComponentDummy() {
523
+ }
524
+ function PureComponent(props, context, updater) {
525
+ this.props = props;
526
+ this.context = context;
527
+ this.refs = emptyObject;
528
+ this.updater = updater || ReactNoopUpdateQueue;
529
+ }
530
+ function noop() {
531
+ }
532
+ function testStringCoercion(value) {
533
+ return "" + value;
534
+ }
535
+ function checkKeyStringCoercion(value) {
536
+ try {
537
+ testStringCoercion(value);
538
+ var JSCompiler_inline_result = false;
539
+ } catch (e) {
540
+ JSCompiler_inline_result = true;
541
+ }
542
+ if (JSCompiler_inline_result) {
543
+ JSCompiler_inline_result = console;
544
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
545
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
546
+ JSCompiler_temp_const.call(
547
+ JSCompiler_inline_result,
548
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
549
+ JSCompiler_inline_result$jscomp$0
550
+ );
551
+ return testStringCoercion(value);
552
+ }
553
+ }
554
+ function getComponentNameFromType(type) {
555
+ if (null == type) return null;
556
+ if ("function" === typeof type)
557
+ return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
558
+ if ("string" === typeof type) return type;
559
+ switch (type) {
560
+ case REACT_FRAGMENT_TYPE:
561
+ return "Fragment";
562
+ case REACT_PROFILER_TYPE:
563
+ return "Profiler";
564
+ case REACT_STRICT_MODE_TYPE:
565
+ return "StrictMode";
566
+ case REACT_SUSPENSE_TYPE:
567
+ return "Suspense";
568
+ case REACT_SUSPENSE_LIST_TYPE:
569
+ return "SuspenseList";
570
+ case REACT_ACTIVITY_TYPE:
571
+ return "Activity";
572
+ case REACT_VIEW_TRANSITION_TYPE:
573
+ return "ViewTransition";
574
+ }
575
+ if ("object" === typeof type)
576
+ switch ("number" === typeof type.tag && console.error(
577
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
578
+ ), type.$$typeof) {
579
+ case REACT_PORTAL_TYPE:
580
+ return "Portal";
581
+ case REACT_CONTEXT_TYPE:
582
+ return type.displayName || "Context";
583
+ case REACT_CONSUMER_TYPE:
584
+ return (type._context.displayName || "Context") + ".Consumer";
585
+ case REACT_FORWARD_REF_TYPE:
586
+ var innerType = type.render;
587
+ type = type.displayName;
588
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
589
+ return type;
590
+ case REACT_MEMO_TYPE:
591
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
592
+ case REACT_LAZY_TYPE:
593
+ innerType = type._payload;
594
+ type = type._init;
595
+ try {
596
+ return getComponentNameFromType(type(innerType));
597
+ } catch (x) {
598
+ }
599
+ }
600
+ return null;
601
+ }
602
+ function getTaskName(type) {
603
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
604
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
605
+ return "<...>";
606
+ try {
607
+ var name = getComponentNameFromType(type);
608
+ return name ? "<" + name + ">" : "<...>";
609
+ } catch (x) {
610
+ return "<...>";
611
+ }
612
+ }
613
+ function getOwner() {
614
+ var dispatcher = ReactSharedInternals.A;
615
+ return null === dispatcher ? null : dispatcher.getOwner();
616
+ }
617
+ function UnknownOwner() {
618
+ return Error("react-stack-top-frame");
619
+ }
620
+ function hasValidKey(config) {
621
+ if (hasOwnProperty.call(config, "key")) {
622
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
623
+ if (getter && getter.isReactWarning) return false;
624
+ }
625
+ return void 0 !== config.key;
626
+ }
627
+ function defineKeyPropWarningGetter(props, displayName) {
628
+ function warnAboutAccessingKey() {
629
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
630
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
631
+ displayName
632
+ ));
633
+ }
634
+ warnAboutAccessingKey.isReactWarning = true;
635
+ Object.defineProperty(props, "key", {
636
+ get: warnAboutAccessingKey,
637
+ configurable: true
638
+ });
639
+ }
640
+ function elementRefGetterWithDeprecationWarning() {
641
+ var componentName = getComponentNameFromType(this.type);
642
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
643
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
644
+ ));
645
+ componentName = this.props.ref;
646
+ return void 0 !== componentName ? componentName : null;
647
+ }
648
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
649
+ var refProp = props.ref;
650
+ type = {
651
+ $$typeof: REACT_ELEMENT_TYPE,
652
+ type,
653
+ key,
654
+ props,
655
+ _owner: owner
656
+ };
657
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
658
+ enumerable: false,
659
+ get: elementRefGetterWithDeprecationWarning
660
+ }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
661
+ type._store = {};
662
+ Object.defineProperty(type._store, "validated", {
663
+ configurable: false,
664
+ enumerable: false,
665
+ writable: true,
666
+ value: 0
667
+ });
668
+ Object.defineProperty(type, "_debugInfo", {
669
+ configurable: false,
670
+ enumerable: false,
671
+ writable: true,
672
+ value: null
673
+ });
674
+ Object.defineProperty(type, "_debugStack", {
675
+ configurable: false,
676
+ enumerable: false,
677
+ writable: true,
678
+ value: debugStack
679
+ });
680
+ Object.defineProperty(type, "_debugTask", {
681
+ configurable: false,
682
+ enumerable: false,
683
+ writable: true,
684
+ value: debugTask
685
+ });
686
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
687
+ return type;
688
+ }
689
+ function cloneAndReplaceKey(oldElement, newKey) {
690
+ newKey = ReactElement(
691
+ oldElement.type,
692
+ newKey,
693
+ oldElement.props,
694
+ oldElement._owner,
695
+ oldElement._debugStack,
696
+ oldElement._debugTask
697
+ );
698
+ oldElement._store && (newKey._store.validated = oldElement._store.validated);
699
+ return newKey;
700
+ }
701
+ function validateChildKeys(node) {
702
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
703
+ }
704
+ function isValidElement(object) {
705
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
706
+ }
707
+ function escape(key) {
708
+ var escaperLookup = { "=": "=0", ":": "=2" };
709
+ return "$" + key.replace(/[=:]/g, function(match) {
710
+ return escaperLookup[match];
711
+ });
712
+ }
713
+ function getElementKey(element, index) {
714
+ return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
715
+ }
716
+ function resolveThenable(thenable) {
717
+ switch (thenable.status) {
718
+ case "fulfilled":
719
+ return thenable.value;
720
+ case "rejected":
721
+ throw thenable.reason;
722
+ default:
723
+ switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
724
+ function(fulfilledValue) {
725
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
726
+ },
727
+ function(error) {
728
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
729
+ }
730
+ )), thenable.status) {
731
+ case "fulfilled":
732
+ return thenable.value;
733
+ case "rejected":
734
+ throw thenable.reason;
735
+ }
736
+ }
737
+ throw thenable;
738
+ }
739
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
740
+ var type = typeof children;
741
+ if ("undefined" === type || "boolean" === type) children = null;
742
+ var invokeCallback = false;
743
+ if (null === children) invokeCallback = true;
744
+ else
745
+ switch (type) {
746
+ case "bigint":
747
+ case "string":
748
+ case "number":
749
+ invokeCallback = true;
750
+ break;
751
+ case "object":
752
+ switch (children.$$typeof) {
753
+ case REACT_ELEMENT_TYPE:
754
+ case REACT_PORTAL_TYPE:
755
+ invokeCallback = true;
756
+ break;
757
+ case REACT_LAZY_TYPE:
758
+ return invokeCallback = children._init, mapIntoArray(
759
+ invokeCallback(children._payload),
760
+ array,
761
+ escapedPrefix,
762
+ nameSoFar,
763
+ callback
764
+ );
765
+ }
766
+ }
767
+ if (invokeCallback) {
768
+ invokeCallback = children;
769
+ callback = callback(invokeCallback);
770
+ var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
771
+ isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
772
+ return c;
773
+ })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
774
+ callback,
775
+ escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
776
+ userProvidedKeyEscapeRegex,
777
+ "$&/"
778
+ ) + "/") + childKey
779
+ ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
780
+ return 1;
781
+ }
782
+ invokeCallback = 0;
783
+ childKey = "" === nameSoFar ? "." : nameSoFar + ":";
784
+ if (isArrayImpl(children))
785
+ for (var i = 0; i < children.length; i++)
786
+ nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
787
+ nameSoFar,
788
+ array,
789
+ escapedPrefix,
790
+ type,
791
+ callback
792
+ );
793
+ else if (i = getIteratorFn(children), "function" === typeof i)
794
+ for (i === children.entries && (didWarnAboutMaps || console.warn(
795
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
796
+ ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
797
+ nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
798
+ nameSoFar,
799
+ array,
800
+ escapedPrefix,
801
+ type,
802
+ callback
803
+ );
804
+ else if ("object" === type) {
805
+ if ("function" === typeof children.then)
806
+ return mapIntoArray(
807
+ resolveThenable(children),
808
+ array,
809
+ escapedPrefix,
810
+ nameSoFar,
811
+ callback
812
+ );
813
+ array = String(children);
814
+ throw Error(
815
+ "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
816
+ );
817
+ }
818
+ return invokeCallback;
819
+ }
820
+ function mapChildren(children, func, context) {
821
+ if (null == children) return children;
822
+ var result = [], count = 0;
823
+ mapIntoArray(children, result, "", "", function(child) {
824
+ return func.call(context, child, count++);
825
+ });
826
+ return result;
827
+ }
828
+ function lazyInitializer(payload) {
829
+ if (-1 === payload._status) {
830
+ var resolveDebugValue = null, rejectDebugValue = null, ioInfo = payload._ioInfo;
831
+ null != ioInfo && (ioInfo.start = ioInfo.end = performance.now(), ioInfo.value = new Promise(function(resolve, reject) {
832
+ resolveDebugValue = resolve;
833
+ rejectDebugValue = reject;
834
+ }));
835
+ ioInfo = payload._result;
836
+ var thenable = ioInfo();
837
+ thenable.then(
838
+ function(moduleObject) {
839
+ if (0 === payload._status || -1 === payload._status) {
840
+ payload._status = 1;
841
+ payload._result = moduleObject;
842
+ var _ioInfo = payload._ioInfo;
843
+ if (null != _ioInfo) {
844
+ _ioInfo.end = performance.now();
845
+ var debugValue = null == moduleObject ? void 0 : moduleObject.default;
846
+ resolveDebugValue(debugValue);
847
+ _ioInfo.value.status = "fulfilled";
848
+ _ioInfo.value.value = debugValue;
849
+ }
850
+ void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
851
+ }
852
+ },
853
+ function(error) {
854
+ if (0 === payload._status || -1 === payload._status) {
855
+ payload._status = 2;
856
+ payload._result = error;
857
+ var _ioInfo2 = payload._ioInfo;
858
+ null != _ioInfo2 && (_ioInfo2.end = performance.now(), _ioInfo2.value.then(noop, noop), rejectDebugValue(error), _ioInfo2.value.status = "rejected", _ioInfo2.value.reason = error);
859
+ void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
860
+ }
861
+ }
862
+ );
863
+ ioInfo = payload._ioInfo;
864
+ if (null != ioInfo) {
865
+ var displayName = thenable.displayName;
866
+ "string" === typeof displayName && (ioInfo.name = displayName);
867
+ }
868
+ -1 === payload._status && (payload._status = 0, payload._result = thenable);
869
+ }
870
+ if (1 === payload._status)
871
+ return ioInfo = payload._result, void 0 === ioInfo && console.error(
872
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
873
+ ioInfo
874
+ ), "default" in ioInfo || console.error(
875
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
876
+ ioInfo
877
+ ), ioInfo.default;
878
+ throw payload._result;
879
+ }
880
+ function resolveDispatcher() {
881
+ var dispatcher = ReactSharedInternals.H;
882
+ null === dispatcher && console.error(
883
+ "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
884
+ );
885
+ return dispatcher;
886
+ }
887
+ function releaseAsyncTransition() {
888
+ ReactSharedInternals.asyncTransitions--;
889
+ }
890
+ function startTransition(scope) {
891
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
892
+ currentTransition.types = null !== prevTransition ? prevTransition.types : null;
893
+ currentTransition._updatedFibers = /* @__PURE__ */ new Set();
894
+ ReactSharedInternals.T = currentTransition;
895
+ try {
896
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
897
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
898
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
899
+ } catch (error) {
900
+ reportGlobalError(error);
901
+ } finally {
902
+ null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
903
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
904
+ )), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
905
+ "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
906
+ ), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
907
+ }
908
+ }
909
+ function addTransitionType(type) {
910
+ var transition = ReactSharedInternals.T;
911
+ if (null !== transition) {
912
+ var transitionTypes = transition.types;
913
+ null === transitionTypes ? transition.types = [type] : -1 === transitionTypes.indexOf(type) && transitionTypes.push(type);
914
+ } else
915
+ 0 === ReactSharedInternals.asyncTransitions && console.error(
916
+ "addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."
917
+ ), startTransition(addTransitionType.bind(null, type));
918
+ }
919
+ function enqueueTask(task) {
920
+ if (null === enqueueTaskImpl)
921
+ try {
922
+ var requireString = ("require" + Math.random()).slice(0, 7);
923
+ enqueueTaskImpl = (module2 && module2[requireString]).call(
924
+ module2,
925
+ "timers"
926
+ ).setImmediate;
927
+ } catch (_err) {
928
+ enqueueTaskImpl = function(callback) {
929
+ false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
930
+ "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
931
+ ));
932
+ var channel = new MessageChannel();
933
+ channel.port1.onmessage = callback;
934
+ channel.port2.postMessage(void 0);
935
+ };
936
+ }
937
+ return enqueueTaskImpl(task);
938
+ }
939
+ function aggregateErrors(errors) {
940
+ return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
941
+ }
942
+ function popActScope(prevActQueue, prevActScopeDepth) {
943
+ prevActScopeDepth !== actScopeDepth - 1 && console.error(
944
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
945
+ );
946
+ actScopeDepth = prevActScopeDepth;
947
+ }
948
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
949
+ var queue = ReactSharedInternals.actQueue;
950
+ if (null !== queue)
951
+ if (0 !== queue.length)
952
+ try {
953
+ flushActQueue(queue);
954
+ enqueueTask(function() {
955
+ return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
956
+ });
957
+ return;
958
+ } catch (error) {
959
+ ReactSharedInternals.thrownErrors.push(error);
960
+ }
961
+ else ReactSharedInternals.actQueue = null;
962
+ 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
963
+ }
964
+ function flushActQueue(queue) {
965
+ if (!isFlushing) {
966
+ isFlushing = true;
967
+ var i = 0;
968
+ try {
969
+ for (; i < queue.length; i++) {
970
+ var callback = queue[i];
971
+ do {
972
+ ReactSharedInternals.didUsePromise = false;
973
+ var continuation = callback(false);
974
+ if (null !== continuation) {
975
+ if (ReactSharedInternals.didUsePromise) {
976
+ queue[i] = callback;
977
+ queue.splice(0, i);
978
+ return;
979
+ }
980
+ callback = continuation;
981
+ } else break;
982
+ } while (1);
983
+ }
984
+ queue.length = 0;
985
+ } catch (error) {
986
+ queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
987
+ } finally {
988
+ isFlushing = false;
989
+ }
990
+ }
991
+ }
992
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
993
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
994
+ isMounted: function() {
995
+ return false;
996
+ },
997
+ enqueueForceUpdate: function(publicInstance) {
998
+ warnNoop(publicInstance, "forceUpdate");
999
+ },
1000
+ enqueueReplaceState: function(publicInstance) {
1001
+ warnNoop(publicInstance, "replaceState");
1002
+ },
1003
+ enqueueSetState: function(publicInstance) {
1004
+ warnNoop(publicInstance, "setState");
1005
+ }
1006
+ }, assign = Object.assign, emptyObject = {};
1007
+ Object.freeze(emptyObject);
1008
+ Component.prototype.isReactComponent = {};
1009
+ Component.prototype.setState = function(partialState, callback) {
1010
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
1011
+ throw Error(
1012
+ "takes an object of state variables to update or a function which returns an object of state variables."
1013
+ );
1014
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
1015
+ };
1016
+ Component.prototype.forceUpdate = function(callback) {
1017
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
1018
+ };
1019
+ var deprecatedAPIs = {
1020
+ isMounted: [
1021
+ "isMounted",
1022
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
1023
+ ],
1024
+ replaceState: [
1025
+ "replaceState",
1026
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
1027
+ ]
1028
+ };
1029
+ for (fnName in deprecatedAPIs)
1030
+ deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1031
+ ComponentDummy.prototype = Component.prototype;
1032
+ deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
1033
+ deprecatedAPIs.constructor = PureComponent;
1034
+ assign(deprecatedAPIs, Component.prototype);
1035
+ deprecatedAPIs.isPureReactComponent = true;
1036
+ var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
1037
+ H: null,
1038
+ A: null,
1039
+ T: null,
1040
+ S: null,
1041
+ actQueue: null,
1042
+ asyncTransitions: 0,
1043
+ isBatchingLegacy: false,
1044
+ didScheduleLegacyUpdate: false,
1045
+ didUsePromise: false,
1046
+ thrownErrors: [],
1047
+ getCurrentStack: null,
1048
+ recentlyCreatedOwnerStacks: 0
1049
+ }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
1050
+ return null;
1051
+ };
1052
+ deprecatedAPIs = {
1053
+ react_stack_bottom_frame: function(callStackForError) {
1054
+ return callStackForError();
1055
+ }
1056
+ };
1057
+ var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
1058
+ var didWarnAboutElementRef = {};
1059
+ var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
1060
+ deprecatedAPIs,
1061
+ UnknownOwner
1062
+ )();
1063
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1064
+ var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
1065
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
1066
+ var event = new window.ErrorEvent("error", {
1067
+ bubbles: true,
1068
+ cancelable: true,
1069
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
1070
+ error
1071
+ });
1072
+ if (!window.dispatchEvent(event)) return;
1073
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
1074
+ process.emit("uncaughtException", error);
1075
+ return;
1076
+ }
1077
+ console.error(error);
1078
+ }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
1079
+ queueMicrotask(function() {
1080
+ return queueMicrotask(callback);
1081
+ });
1082
+ } : enqueueTask;
1083
+ deprecatedAPIs = Object.freeze({
1084
+ __proto__: null,
1085
+ c: function(size) {
1086
+ return resolveDispatcher().useMemoCache(size);
1087
+ }
1088
+ });
1089
+ var fnName = {
1090
+ map: mapChildren,
1091
+ forEach: function(children, forEachFunc, forEachContext) {
1092
+ mapChildren(
1093
+ children,
1094
+ function() {
1095
+ forEachFunc.apply(this, arguments);
1096
+ },
1097
+ forEachContext
1098
+ );
1099
+ },
1100
+ count: function(children) {
1101
+ var n = 0;
1102
+ mapChildren(children, function() {
1103
+ n++;
1104
+ });
1105
+ return n;
1106
+ },
1107
+ toArray: function(children) {
1108
+ return mapChildren(children, function(child) {
1109
+ return child;
1110
+ }) || [];
1111
+ },
1112
+ only: function(children) {
1113
+ if (!isValidElement(children))
1114
+ throw Error(
1115
+ "React.Children.only expected to receive a single React element child."
1116
+ );
1117
+ return children;
1118
+ }
1119
+ };
1120
+ exports2.Activity = REACT_ACTIVITY_TYPE;
1121
+ exports2.Children = fnName;
1122
+ exports2.Component = Component;
1123
+ exports2.Fragment = REACT_FRAGMENT_TYPE;
1124
+ exports2.Profiler = REACT_PROFILER_TYPE;
1125
+ exports2.PureComponent = PureComponent;
1126
+ exports2.StrictMode = REACT_STRICT_MODE_TYPE;
1127
+ exports2.Suspense = REACT_SUSPENSE_TYPE;
1128
+ exports2.ViewTransition = REACT_VIEW_TRANSITION_TYPE;
1129
+ exports2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
1130
+ exports2.__COMPILER_RUNTIME = deprecatedAPIs;
1131
+ exports2.act = function(callback) {
1132
+ var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
1133
+ actScopeDepth++;
1134
+ var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
1135
+ try {
1136
+ var result = callback();
1137
+ } catch (error) {
1138
+ ReactSharedInternals.thrownErrors.push(error);
1139
+ }
1140
+ if (0 < ReactSharedInternals.thrownErrors.length)
1141
+ throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1142
+ if (null !== result && "object" === typeof result && "function" === typeof result.then) {
1143
+ var thenable = result;
1144
+ queueSeveralMicrotasks(function() {
1145
+ didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1146
+ "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
1147
+ ));
1148
+ });
1149
+ return {
1150
+ then: function(resolve, reject) {
1151
+ didAwaitActCall = true;
1152
+ thenable.then(
1153
+ function(returnValue) {
1154
+ popActScope(prevActQueue, prevActScopeDepth);
1155
+ if (0 === prevActScopeDepth) {
1156
+ try {
1157
+ flushActQueue(queue), enqueueTask(function() {
1158
+ return recursivelyFlushAsyncActWork(
1159
+ returnValue,
1160
+ resolve,
1161
+ reject
1162
+ );
1163
+ });
1164
+ } catch (error$0) {
1165
+ ReactSharedInternals.thrownErrors.push(error$0);
1166
+ }
1167
+ if (0 < ReactSharedInternals.thrownErrors.length) {
1168
+ var _thrownError = aggregateErrors(
1169
+ ReactSharedInternals.thrownErrors
1170
+ );
1171
+ ReactSharedInternals.thrownErrors.length = 0;
1172
+ reject(_thrownError);
1173
+ }
1174
+ } else resolve(returnValue);
1175
+ },
1176
+ function(error) {
1177
+ popActScope(prevActQueue, prevActScopeDepth);
1178
+ 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
1179
+ ReactSharedInternals.thrownErrors
1180
+ ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
1181
+ }
1182
+ );
1183
+ }
1184
+ };
1185
+ }
1186
+ var returnValue$jscomp$0 = result;
1187
+ popActScope(prevActQueue, prevActScopeDepth);
1188
+ 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
1189
+ didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1190
+ "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
1191
+ ));
1192
+ }), ReactSharedInternals.actQueue = null);
1193
+ if (0 < ReactSharedInternals.thrownErrors.length)
1194
+ throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1195
+ return {
1196
+ then: function(resolve, reject) {
1197
+ didAwaitActCall = true;
1198
+ 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
1199
+ return recursivelyFlushAsyncActWork(
1200
+ returnValue$jscomp$0,
1201
+ resolve,
1202
+ reject
1203
+ );
1204
+ })) : resolve(returnValue$jscomp$0);
1205
+ }
1206
+ };
1207
+ };
1208
+ exports2.addTransitionType = addTransitionType;
1209
+ exports2.cache = function(fn) {
1210
+ return function() {
1211
+ return fn.apply(null, arguments);
1212
+ };
1213
+ };
1214
+ exports2.cacheSignal = function() {
1215
+ return null;
1216
+ };
1217
+ exports2.captureOwnerStack = function() {
1218
+ var getCurrentStack = ReactSharedInternals.getCurrentStack;
1219
+ return null === getCurrentStack ? null : getCurrentStack();
1220
+ };
1221
+ exports2.cloneElement = function(element, config, children) {
1222
+ if (null === element || void 0 === element)
1223
+ throw Error(
1224
+ "The argument must be a React element, but you passed " + element + "."
1225
+ );
1226
+ var props = assign({}, element.props), key = element.key, owner = element._owner;
1227
+ if (null != config) {
1228
+ var JSCompiler_inline_result;
1229
+ a: {
1230
+ if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1231
+ config,
1232
+ "ref"
1233
+ ).get) && JSCompiler_inline_result.isReactWarning) {
1234
+ JSCompiler_inline_result = false;
1235
+ break a;
1236
+ }
1237
+ JSCompiler_inline_result = void 0 !== config.ref;
1238
+ }
1239
+ JSCompiler_inline_result && (owner = getOwner());
1240
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
1241
+ for (propName in config)
1242
+ !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
1243
+ }
1244
+ var propName = arguments.length - 2;
1245
+ if (1 === propName) props.children = children;
1246
+ else if (1 < propName) {
1247
+ JSCompiler_inline_result = Array(propName);
1248
+ for (var i = 0; i < propName; i++)
1249
+ JSCompiler_inline_result[i] = arguments[i + 2];
1250
+ props.children = JSCompiler_inline_result;
1251
+ }
1252
+ props = ReactElement(
1253
+ element.type,
1254
+ key,
1255
+ props,
1256
+ owner,
1257
+ element._debugStack,
1258
+ element._debugTask
1259
+ );
1260
+ for (key = 2; key < arguments.length; key++)
1261
+ validateChildKeys(arguments[key]);
1262
+ return props;
1263
+ };
1264
+ exports2.createContext = function(defaultValue) {
1265
+ defaultValue = {
1266
+ $$typeof: REACT_CONTEXT_TYPE,
1267
+ _currentValue: defaultValue,
1268
+ _currentValue2: defaultValue,
1269
+ _threadCount: 0,
1270
+ Provider: null,
1271
+ Consumer: null
1272
+ };
1273
+ defaultValue.Provider = defaultValue;
1274
+ defaultValue.Consumer = {
1275
+ $$typeof: REACT_CONSUMER_TYPE,
1276
+ _context: defaultValue
1277
+ };
1278
+ defaultValue._currentRenderer = null;
1279
+ defaultValue._currentRenderer2 = null;
1280
+ return defaultValue;
1281
+ };
1282
+ exports2.createElement = function(type, config, children) {
1283
+ for (var i = 2; i < arguments.length; i++)
1284
+ validateChildKeys(arguments[i]);
1285
+ var propName;
1286
+ i = {};
1287
+ var key = null;
1288
+ if (null != config)
1289
+ for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
1290
+ "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
1291
+ )), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
1292
+ hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
1293
+ var childrenLength = arguments.length - 2;
1294
+ if (1 === childrenLength) i.children = children;
1295
+ else if (1 < childrenLength) {
1296
+ for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
1297
+ childArray[_i] = arguments[_i + 2];
1298
+ Object.freeze && Object.freeze(childArray);
1299
+ i.children = childArray;
1300
+ }
1301
+ if (type && type.defaultProps)
1302
+ for (propName in childrenLength = type.defaultProps, childrenLength)
1303
+ void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1304
+ key && defineKeyPropWarningGetter(
1305
+ i,
1306
+ "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1307
+ );
1308
+ (propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++) ? (childArray = Error.stackTraceLimit, Error.stackTraceLimit = 10, childrenLength = Error("react-stack-top-frame"), Error.stackTraceLimit = childArray) : childrenLength = unknownOwnerDebugStack;
1309
+ return ReactElement(
1310
+ type,
1311
+ key,
1312
+ i,
1313
+ getOwner(),
1314
+ childrenLength,
1315
+ propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1316
+ );
1317
+ };
1318
+ exports2.createRef = function() {
1319
+ var refObject = { current: null };
1320
+ Object.seal(refObject);
1321
+ return refObject;
1322
+ };
1323
+ exports2.forwardRef = function(render) {
1324
+ null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
1325
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1326
+ ) : "function" !== typeof render ? console.error(
1327
+ "forwardRef requires a render function but was given %s.",
1328
+ null === render ? "null" : typeof render
1329
+ ) : 0 !== render.length && 2 !== render.length && console.error(
1330
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
1331
+ 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
1332
+ );
1333
+ null != render && null != render.defaultProps && console.error(
1334
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1335
+ );
1336
+ var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
1337
+ Object.defineProperty(elementType, "displayName", {
1338
+ enumerable: false,
1339
+ configurable: true,
1340
+ get: function() {
1341
+ return ownName;
1342
+ },
1343
+ set: function(name) {
1344
+ ownName = name;
1345
+ render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
1346
+ }
1347
+ });
1348
+ return elementType;
1349
+ };
1350
+ exports2.isValidElement = isValidElement;
1351
+ exports2.lazy = function(ctor) {
1352
+ ctor = { _status: -1, _result: ctor };
1353
+ var lazyType = {
1354
+ $$typeof: REACT_LAZY_TYPE,
1355
+ _payload: ctor,
1356
+ _init: lazyInitializer
1357
+ }, ioInfo = {
1358
+ name: "lazy",
1359
+ start: -1,
1360
+ end: -1,
1361
+ value: null,
1362
+ owner: null,
1363
+ debugStack: Error("react-stack-top-frame"),
1364
+ debugTask: console.createTask ? console.createTask("lazy()") : null
1365
+ };
1366
+ ctor._ioInfo = ioInfo;
1367
+ lazyType._debugInfo = [{ awaited: ioInfo }];
1368
+ return lazyType;
1369
+ };
1370
+ exports2.memo = function(type, compare) {
1371
+ null == type && console.error(
1372
+ "memo: The first argument must be a component. Instead received: %s",
1373
+ null === type ? "null" : typeof type
1374
+ );
1375
+ compare = {
1376
+ $$typeof: REACT_MEMO_TYPE,
1377
+ type,
1378
+ compare: void 0 === compare ? null : compare
1379
+ };
1380
+ var ownName;
1381
+ Object.defineProperty(compare, "displayName", {
1382
+ enumerable: false,
1383
+ configurable: true,
1384
+ get: function() {
1385
+ return ownName;
1386
+ },
1387
+ set: function(name) {
1388
+ ownName = name;
1389
+ type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
1390
+ }
1391
+ });
1392
+ return compare;
1393
+ };
1394
+ exports2.startTransition = startTransition;
1395
+ exports2.unstable_useCacheRefresh = function() {
1396
+ return resolveDispatcher().useCacheRefresh();
1397
+ };
1398
+ exports2.use = function(usable) {
1399
+ return resolveDispatcher().use(usable);
1400
+ };
1401
+ exports2.useActionState = function(action, initialState, permalink) {
1402
+ return resolveDispatcher().useActionState(
1403
+ action,
1404
+ initialState,
1405
+ permalink
1406
+ );
1407
+ };
1408
+ exports2.useCallback = function(callback, deps) {
1409
+ return resolveDispatcher().useCallback(callback, deps);
1410
+ };
1411
+ exports2.useContext = function(Context) {
1412
+ var dispatcher = resolveDispatcher();
1413
+ Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
1414
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1415
+ );
1416
+ return dispatcher.useContext(Context);
1417
+ };
1418
+ exports2.useDebugValue = function(value, formatterFn) {
1419
+ return resolveDispatcher().useDebugValue(value, formatterFn);
1420
+ };
1421
+ exports2.useDeferredValue = function(value, initialValue) {
1422
+ return resolveDispatcher().useDeferredValue(value, initialValue);
1423
+ };
1424
+ exports2.useEffect = function(create, deps) {
1425
+ null == create && console.warn(
1426
+ "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1427
+ );
1428
+ return resolveDispatcher().useEffect(create, deps);
1429
+ };
1430
+ exports2.useEffectEvent = function(callback) {
1431
+ return resolveDispatcher().useEffectEvent(callback);
1432
+ };
1433
+ exports2.useId = function() {
1434
+ return resolveDispatcher().useId();
1435
+ };
1436
+ exports2.useImperativeHandle = function(ref, create, deps) {
1437
+ return resolveDispatcher().useImperativeHandle(ref, create, deps);
1438
+ };
1439
+ exports2.useInsertionEffect = function(create, deps) {
1440
+ null == create && console.warn(
1441
+ "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1442
+ );
1443
+ return resolveDispatcher().useInsertionEffect(create, deps);
1444
+ };
1445
+ exports2.useLayoutEffect = function(create, deps) {
1446
+ null == create && console.warn(
1447
+ "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1448
+ );
1449
+ return resolveDispatcher().useLayoutEffect(create, deps);
1450
+ };
1451
+ exports2.useMemo = function(create, deps) {
1452
+ return resolveDispatcher().useMemo(create, deps);
1453
+ };
1454
+ exports2.useOptimistic = function(passthrough, reducer) {
1455
+ return resolveDispatcher().useOptimistic(passthrough, reducer);
1456
+ };
1457
+ exports2.useReducer = function(reducer, initialArg, init) {
1458
+ return resolveDispatcher().useReducer(reducer, initialArg, init);
1459
+ };
1460
+ exports2.useRef = function(initialValue) {
1461
+ return resolveDispatcher().useRef(initialValue);
1462
+ };
1463
+ exports2.useState = function(initialState) {
1464
+ return resolveDispatcher().useState(initialState);
1465
+ };
1466
+ exports2.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1467
+ return resolveDispatcher().useSyncExternalStore(
1468
+ subscribe,
1469
+ getSnapshot,
1470
+ getServerSnapshot
1471
+ );
1472
+ };
1473
+ exports2.useTransition = function() {
1474
+ return resolveDispatcher().useTransition();
1475
+ };
1476
+ exports2.version = "19.3.0";
1477
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1478
+ })();
1479
+ }
1480
+ });
1481
+
1482
+ // node_modules/react/index.js
1483
+ var require_react = __commonJS({
1484
+ "node_modules/react/index.js"(exports2, module2) {
1485
+ "use strict";
1486
+ if (process.env.NODE_ENV === "production") {
1487
+ module2.exports = require_react_production();
1488
+ } else {
1489
+ module2.exports = require_react_development();
1490
+ }
1491
+ }
1492
+ });
1493
+
30
1494
  // src/index.ts
31
1495
  var index_exports = {};
32
1496
  __export(index_exports, {
@@ -35,6 +1499,8 @@ __export(index_exports, {
35
1499
  AdModel: () => AdModel,
36
1500
  AffiliateModel: () => AffiliateModel,
37
1501
  AppSettingModel: () => AppSettingModel,
1502
+ BILLING_CATALOG_COLLECTION_NAME: () => BILLING_CATALOG_COLLECTION_NAME,
1503
+ BillingCatalogModel: () => BillingCatalogModel,
38
1504
  CategorySchema: () => CategorySchema,
39
1505
  ChatModel: () => ChatModel,
40
1506
  ChatReportModel: () => ChatReportModel,
@@ -70,6 +1536,7 @@ __export(index_exports, {
70
1536
  activeAffiliateCodeExists: () => activeAffiliateCodeExists,
71
1537
  awardAffiliateVendorSubscriptionRewards: () => awardAffiliateVendorSubscriptionRewards,
72
1538
  baseResourceFields: () => baseResourceFields,
1539
+ buildInitialBillingCatalogEntries: () => buildInitialBillingCatalogEntries,
73
1540
  buildLicenceExpiryPipeline: () => buildLicenceExpiryPipeline,
74
1541
  checkOwnerHasLicence: () => checkOwnerHasLicence,
75
1542
  connectToDatabase: () => connectToDatabase,
@@ -78,10 +1545,12 @@ __export(index_exports, {
78
1545
  dateTimeSchema: () => dateTimeSchema2,
79
1546
  didRemoveAnyEventDates: () => didRemoveAnyEventDates,
80
1547
  ensureUserLicenseCompliance: () => ensureUserLicenseCompliance,
1548
+ ensureUserLicenseComplianceForUser: () => ensureUserLicenseComplianceForUser,
81
1549
  eventLicences: () => eventLicences,
82
1550
  express: () => import_express.default,
83
1551
  findAffiliateByPromoCode: () => findAffiliateByPromoCode,
84
1552
  findEventOrImportedMarketById: () => findEventOrImportedMarketById,
1553
+ getBillingCatalogDefinition: () => getBillingCatalogDefinition,
85
1554
  getEventResourceInfo: () => getEventResourceInfo,
86
1555
  getHighestLicenceForCategory: () => getHighestLicenceForCategory,
87
1556
  getLicenceCategory: () => getLicenceCategory,
@@ -103,7 +1572,7 @@ __export(index_exports, {
103
1572
  locationGeoSchema: () => locationGeoSchema,
104
1573
  locationsSchema: () => locationsSchema,
105
1574
  mapVendorLicenceToSubscriptionRewardType: () => mapVendorLicenceToSubscriptionRewardType,
106
- mongoose: () => import_mongoose31.default,
1575
+ mongoose: () => import_mongoose32.default,
107
1576
  normalizeAffiliatePromoCodes: () => normalizeAffiliatePromoCodes,
108
1577
  normalizePromoCode: () => normalizePromoCode,
109
1578
  notifyUsers: () => notifyUsers,
@@ -348,6 +1817,7 @@ setVerbosity(globalThis.__DEV__ !== false ? "log" : "silent");
348
1817
 
349
1818
  // node_modules/@timardex/cluemart-shared/dist/index.mjs
350
1819
  var import_graphql2 = require("graphql");
1820
+ var import_react = __toESM(require_react(), 1);
351
1821
  var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus22) => {
352
1822
  EnumInviteStatus22["ACCEPTED"] = "Accepted";
353
1823
  EnumInviteStatus22["COMPLETED"] = "Completed";
@@ -433,8 +1903,8 @@ var EnumRelationResource = /* @__PURE__ */ ((EnumRelationResource22) => {
433
1903
  return EnumRelationResource22;
434
1904
  })(EnumRelationResource || {});
435
1905
  var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceType22) => {
436
- EnumNotificationResourceType22["APPROVED_AFFILIATE"] = "approved_affiliate";
437
1906
  EnumNotificationResourceType22["AFFILIATE_REWARD_RECEIVED"] = "affiliate_reward_received";
1907
+ EnumNotificationResourceType22["APPROVED_AFFILIATE"] = "approved_affiliate";
438
1908
  EnumNotificationResourceType22["APPROVED_EVENT"] = "approved_event";
439
1909
  EnumNotificationResourceType22["APPROVED_PARTNER"] = "approved_partner";
440
1910
  EnumNotificationResourceType22["APPROVED_SCHOOL"] = "approved_school";
@@ -462,6 +1932,7 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
462
1932
  EnumNotificationResourceType22["NEW_POST_CREATED"] = "new_post_created";
463
1933
  EnumNotificationResourceType22["REGISTERED_USER_BY_SCHOOL_CODE"] = "registered_user_by_school_code";
464
1934
  EnumNotificationResourceType22["SYSTEM_ALERT"] = "system_alert";
1935
+ EnumNotificationResourceType22["USER_COUPON_REDEEMED"] = "user_coupon_redeemed";
465
1936
  EnumNotificationResourceType22["VENDOR_APPLICATION_TO_EVENT"] = "vendor_application_to_event";
466
1937
  EnumNotificationResourceType22["VENDOR_UPDATE_RELATION_TO_EVENT"] = "vendor_update_relation_to_event";
467
1938
  return EnumNotificationResourceType22;
@@ -536,6 +2007,11 @@ var EnumSubscriptionStatus = /* @__PURE__ */ ((EnumSubscriptionStatus22) => {
536
2007
  EnumSubscriptionStatus22["TRIALING"] = "trialing";
537
2008
  return EnumSubscriptionStatus22;
538
2009
  })(EnumSubscriptionStatus || {});
2010
+ var EnumBillingPeriod = /* @__PURE__ */ ((EnumBillingPeriod22) => {
2011
+ EnumBillingPeriod22["MONTHLY_CANCEL_ANYTIME"] = "monthly_cancel_anytime";
2012
+ EnumBillingPeriod22["YEARLY_ANNUAL_BILLED"] = "yearly_annual_billed";
2013
+ return EnumBillingPeriod22;
2014
+ })(EnumBillingPeriod || {});
539
2015
  var EnumReward = /* @__PURE__ */ ((EnumReward22) => {
540
2016
  EnumReward22["MYSTERY_JOY_BOX"] = "mystery_joy_box";
541
2017
  EnumReward22["MYSTERY_SQUEEZE_BOX"] = "mystery_squeeze_box";
@@ -1818,6 +3294,80 @@ var availableCategories = assignColorToCategories([
1818
3294
  ...petProductsAndAnimalGoods,
1819
3295
  ...serviceAndExperience
1820
3296
  ]);
3297
+ var BILLING_CATALOG_KEYS = [
3298
+ "pro_vendor_monthly",
3299
+ "pro_vendor_yearly",
3300
+ "pro_plus_vendor_monthly",
3301
+ "pro_plus_vendor_yearly"
3302
+ ];
3303
+ var BILLING_CATALOG_CURRENCY = "nzd";
3304
+ var BILLING_CATALOG_DEFINITIONS = {
3305
+ pro_plus_vendor_monthly: {
3306
+ billingPeriod: "monthly_cancel_anytime",
3307
+ licenceType: "pro_plus_vendor"
3308
+ /* PRO_PLUS_VENDOR */
3309
+ },
3310
+ pro_plus_vendor_yearly: {
3311
+ billingPeriod: "yearly_annual_billed",
3312
+ licenceType: "pro_plus_vendor"
3313
+ /* PRO_PLUS_VENDOR */
3314
+ },
3315
+ pro_vendor_monthly: {
3316
+ billingPeriod: "monthly_cancel_anytime",
3317
+ licenceType: "pro_vendor"
3318
+ /* PRO_VENDOR */
3319
+ },
3320
+ pro_vendor_yearly: {
3321
+ billingPeriod: "yearly_annual_billed",
3322
+ licenceType: "pro_vendor"
3323
+ /* PRO_VENDOR */
3324
+ }
3325
+ };
3326
+ var INITIAL_BILLING_CATALOG = [
3327
+ {
3328
+ active: true,
3329
+ billingPeriod: "monthly_cancel_anytime",
3330
+ currency: BILLING_CATALOG_CURRENCY,
3331
+ key: "pro_vendor_monthly",
3332
+ licenceType: "pro_vendor",
3333
+ taxInclusive: true,
3334
+ unitAmount: 3999
3335
+ },
3336
+ {
3337
+ active: true,
3338
+ billingPeriod: "yearly_annual_billed",
3339
+ currency: BILLING_CATALOG_CURRENCY,
3340
+ key: "pro_vendor_yearly",
3341
+ licenceType: "pro_vendor",
3342
+ taxInclusive: true,
3343
+ unitAmount: 40788
3344
+ },
3345
+ {
3346
+ active: true,
3347
+ billingPeriod: "monthly_cancel_anytime",
3348
+ currency: BILLING_CATALOG_CURRENCY,
3349
+ key: "pro_plus_vendor_monthly",
3350
+ licenceType: "pro_plus_vendor",
3351
+ taxInclusive: true,
3352
+ unitAmount: 6499
3353
+ },
3354
+ {
3355
+ active: true,
3356
+ billingPeriod: "yearly_annual_billed",
3357
+ currency: BILLING_CATALOG_CURRENCY,
3358
+ key: "pro_plus_vendor_yearly",
3359
+ licenceType: "pro_plus_vendor",
3360
+ taxInclusive: true,
3361
+ unitAmount: 62388
3362
+ }
3363
+ ];
3364
+ function billingCatalogDefinitionMatches(entry) {
3365
+ const definition = BILLING_CATALOG_DEFINITIONS[entry.key];
3366
+ if (!definition) {
3367
+ return false;
3368
+ }
3369
+ return definition.billingPeriod === entry.billingPeriod && definition.licenceType === entry.licenceType;
3370
+ }
1821
3371
  var packagingTypes = [
1822
3372
  "Biodegradable",
1823
3373
  "Compostable",
@@ -2262,12 +3812,19 @@ var REDEEMED_REWARD_FIELDS_FRAGMENT = gql`
2262
3812
  `;
2263
3813
  var STRIPE_FIELDS_FRAGMENT = gql`
2264
3814
  fragment StripeSubscriptionFields on StripeSubscriptionType {
3815
+ billingPeriod
3816
+ cancelAtPeriodEnd
2265
3817
  customerId
2266
3818
  subscriptionId
2267
3819
  status
2268
3820
  currentPlan
2269
3821
  startDate
2270
3822
  endDate
3823
+ pendingPlan
3824
+ pendingBillingPeriod
3825
+ pendingChangeEffectiveAt
3826
+ priceId
3827
+ scheduleId
2271
3828
  }
2272
3829
  `;
2273
3830
  var USER_FIELDS_FRAGMENT = gql`
@@ -2544,8 +4101,11 @@ var EVENT = gql`
2544
4101
  ${SOCIAL_SHARE_RESOURCE_FIELDS_FRAGMENT}
2545
4102
  `;
2546
4103
  var GET_EVENTS = gql`
2547
- query getEvents($dateStatus: EventDateStatusEnumType) {
2548
- events(dateStatus: $dateStatus) {
4104
+ query getEvents(
4105
+ $dateStatus: EventDateStatusEnumType
4106
+ $options: PaginationOptions
4107
+ ) {
4108
+ events(dateStatus: $dateStatus, options: $options) {
2549
4109
  ...EventListItemFields
2550
4110
  }
2551
4111
  }
@@ -2847,8 +4407,8 @@ var UNREGISTERED_VENDOR = gql`
2847
4407
  ${UNREGISTERED_VENDOR_INVITATION_FRAGMENT}
2848
4408
  `;
2849
4409
  var GET_VENDORS = gql`
2850
- query getVendors {
2851
- vendors {
4410
+ query getVendors($options: PaginationOptions) {
4411
+ vendors(options: $options) {
2852
4412
  ...VendorFields
2853
4413
  }
2854
4414
  }
@@ -3085,8 +4645,8 @@ var PARTNER = gql`
3085
4645
  ${SOCIAL_SHARE_RESOURCE_FIELDS_FRAGMENT}
3086
4646
  `;
3087
4647
  var GET_PARTNERS = gql`
3088
- query getPartners {
3089
- partners {
4648
+ query getPartners($options: PaginationOptions) {
4649
+ partners(options: $options) {
3090
4650
  ...PartnerFields
3091
4651
  }
3092
4652
  }
@@ -3291,8 +4851,8 @@ var POST_FIELDS_FRAGMENT = gql`
3291
4851
  ${SOCIAL_SHARE_RESOURCE_FIELDS_FRAGMENT}
3292
4852
  `;
3293
4853
  var GET_POSTS = gql`
3294
- query getPosts {
3295
- posts {
4854
+ query getPosts($options: PaginationOptions) {
4855
+ posts(options: $options) {
3296
4856
  ...PostFields
3297
4857
  }
3298
4858
  }
@@ -3307,22 +4867,123 @@ var GET_POST = gql`
3307
4867
  ${POST_FIELDS_FRAGMENT}
3308
4868
  `;
3309
4869
  var GET_POSTS_BY_TYPE = gql`
3310
- query getPostsByType($postType: PostTypeEnum!) {
3311
- postsByType(postType: $postType) {
4870
+ query getPostsByType($postType: PostTypeEnum!, $options: PaginationOptions) {
4871
+ postsByType(postType: $postType, options: $options) {
3312
4872
  ...PostFields
3313
4873
  }
3314
4874
  }
3315
4875
  ${POST_FIELDS_FRAGMENT}
3316
4876
  `;
3317
- var GET_EVENT_BY_SLUG = gql`
3318
- query getEventBySlug($slug: String!) {
3319
- eventBySlug(slug: $slug) {
3320
- _id
4877
+ var GET_USERS = gql`
4878
+ query getUsers($options: PaginationOptions) {
4879
+ users(options: $options) {
4880
+ ...UserFields
3321
4881
  }
3322
4882
  }
4883
+ ${USER_FIELDS_FRAGMENT}
3323
4884
  `;
3324
- var GET_VENDOR_BY_SLUG = gql`
3325
- query getVendorBySlug($slug: String!) {
4885
+ var GET_USER = gql`
4886
+ query getUser($_id: ID!) {
4887
+ user(_id: $_id) {
4888
+ ...UserFields
4889
+ }
4890
+ }
4891
+ ${USER_FIELDS_FRAGMENT}
4892
+ `;
4893
+ var GET_USER_EVENTS = gql`
4894
+ query getUserEvents {
4895
+ userEvents {
4896
+ ...EventFields
4897
+ }
4898
+ }
4899
+ ${EVENT}
4900
+ `;
4901
+ var GET_USER_VENDORS = gql`
4902
+ query getUserVendors {
4903
+ userVendors {
4904
+ ...VendorFields
4905
+ }
4906
+ }
4907
+ ${VENDOR}
4908
+ `;
4909
+ var GET_USER_PARTNERS = gql`
4910
+ query getUserPartners {
4911
+ userPartners {
4912
+ ...PartnerFields
4913
+ }
4914
+ }
4915
+ ${PARTNER}
4916
+ `;
4917
+ var GET_USER_ACTIVITIES = gql`
4918
+ query getUserActivities {
4919
+ userActivities {
4920
+ favourites {
4921
+ events {
4922
+ ...EventListItemFields
4923
+ }
4924
+ partners {
4925
+ ...PartnerFields
4926
+ }
4927
+ vendors {
4928
+ ...VendorFields
4929
+ }
4930
+ }
4931
+ going {
4932
+ events {
4933
+ ...EventListItemFields
4934
+ }
4935
+ }
4936
+ interested {
4937
+ events {
4938
+ ...EventListItemFields
4939
+ }
4940
+ }
4941
+ present {
4942
+ events {
4943
+ ...EventListItemFields
4944
+ }
4945
+ }
4946
+ }
4947
+ }
4948
+ ${EVENT_LIST_ITEM}
4949
+ ${VENDOR}
4950
+ ${PARTNER}
4951
+ `;
4952
+ var GET_USER_RESOURCES = gql`
4953
+ query getUserResources($userId: ID!) {
4954
+ userResources(userId: $userId) {
4955
+ resources {
4956
+ _id
4957
+ logo
4958
+ name
4959
+ resourceType
4960
+ }
4961
+ }
4962
+ }
4963
+ `;
4964
+ var GET_USERS_BY_PROMO_CODE = gql`
4965
+ query getUsersByPromoCode($promoCode: String!, $limit: Int, $offset: Int) {
4966
+ usersByPromoCode(promoCode: $promoCode, limit: $limit, offset: $offset) {
4967
+ active
4968
+ avatar {
4969
+ ...ResourceImageFields
4970
+ }
4971
+ deletedAt
4972
+ nickName
4973
+ userId
4974
+ }
4975
+ }
4976
+ ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
4977
+ `;
4978
+ var GET_EVENT_BY_SLUG = gql`
4979
+ query getEventBySlug($slug: String!) {
4980
+ eventBySlug(slug: $slug) {
4981
+ _id
4982
+ }
4983
+ }
4984
+ `;
4985
+ var GET_VENDOR_BY_SLUG = gql`
4986
+ query getVendorBySlug($slug: String!) {
3326
4987
  vendorBySlug(slug: $slug) {
3327
4988
  _id
3328
4989
  }
@@ -3778,107 +5439,6 @@ var UPDATE_EVENT_INFO_MUTATION = gql`
3778
5439
  }
3779
5440
  ${EVENT_INFO}
3780
5441
  `;
3781
- var GET_USERS = gql`
3782
- query getUsers {
3783
- users {
3784
- ...UserFields
3785
- }
3786
- }
3787
- ${USER_FIELDS_FRAGMENT}
3788
- `;
3789
- var GET_USER = gql`
3790
- query getUser($_id: ID!) {
3791
- user(_id: $_id) {
3792
- ...UserFields
3793
- }
3794
- }
3795
- ${USER_FIELDS_FRAGMENT}
3796
- `;
3797
- var GET_USER_EVENTS = gql`
3798
- query getUserEvents {
3799
- userEvents {
3800
- ...EventFields
3801
- }
3802
- }
3803
- ${EVENT}
3804
- `;
3805
- var GET_USER_VENDORS = gql`
3806
- query getUserVendors {
3807
- userVendors {
3808
- ...VendorFields
3809
- }
3810
- }
3811
- ${VENDOR}
3812
- `;
3813
- var GET_USER_PARTNERS = gql`
3814
- query getUserPartners {
3815
- userPartners {
3816
- ...PartnerFields
3817
- }
3818
- }
3819
- ${PARTNER}
3820
- `;
3821
- var GET_USER_ACTIVITIES = gql`
3822
- query getUserActivities {
3823
- userActivities {
3824
- favourites {
3825
- events {
3826
- ...EventListItemFields
3827
- }
3828
- partners {
3829
- ...PartnerFields
3830
- }
3831
- vendors {
3832
- ...VendorFields
3833
- }
3834
- }
3835
- going {
3836
- events {
3837
- ...EventListItemFields
3838
- }
3839
- }
3840
- interested {
3841
- events {
3842
- ...EventListItemFields
3843
- }
3844
- }
3845
- present {
3846
- events {
3847
- ...EventListItemFields
3848
- }
3849
- }
3850
- }
3851
- }
3852
- ${EVENT_LIST_ITEM}
3853
- ${VENDOR}
3854
- ${PARTNER}
3855
- `;
3856
- var GET_USER_RESOURCES = gql`
3857
- query getUserResources($userId: ID!) {
3858
- userResources(userId: $userId) {
3859
- resources {
3860
- _id
3861
- logo
3862
- name
3863
- resourceType
3864
- }
3865
- }
3866
- }
3867
- `;
3868
- var GET_USERS_BY_PROMO_CODE = gql`
3869
- query getUsersByPromoCode($promoCode: String!, $limit: Int, $offset: Int) {
3870
- usersByPromoCode(promoCode: $promoCode, limit: $limit, offset: $offset) {
3871
- active
3872
- avatar {
3873
- ...ResourceImageFields
3874
- }
3875
- deletedAt
3876
- nickName
3877
- userId
3878
- }
3879
- }
3880
- ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
3881
- `;
3882
5442
  var NOTIFICATION_FRAGMENT = gql`
3883
5443
  fragment NotificationFields on Notification {
3884
5444
  _id
@@ -4301,11 +5861,8 @@ var GET_RESOURCE_ACTIVITY = gql`
4301
5861
  ${RESOURCE_ACTIVITY_FIELDS_FRAGMENT}
4302
5862
  `;
4303
5863
  var CREATE_CHECKOUT_SESSION_MUTATION = gql`
4304
- mutation createCheckoutSession(
4305
- $planId: LicencesEnumType!
4306
- $billingPeriod: BillingPeriodEnumType
4307
- ) {
4308
- createCheckoutSession(planId: $planId, billingPeriod: $billingPeriod) {
5864
+ mutation createCheckoutSession($input: CreateCheckoutSessionInputType!) {
5865
+ createCheckoutSession(input: $input) {
4309
5866
  data {
4310
5867
  sessionId
4311
5868
  checkoutUrl
@@ -4317,25 +5874,38 @@ var CREATE_CHECKOUT_SESSION_MUTATION = gql`
4317
5874
  var CANCEL_SUBSCRIPTION_MUTATION = gql`
4318
5875
  mutation cancelSubscription {
4319
5876
  cancelSubscription {
4320
- data
5877
+ data {
5878
+ billingPeriod
5879
+ cancelAtPeriodEnd
5880
+ currentPlan
5881
+ endDate
5882
+ pendingBillingPeriod
5883
+ pendingChangeEffectiveAt
5884
+ pendingPlan
5885
+ priceId
5886
+ scheduleId
5887
+ status
5888
+ subscriptionId
5889
+ }
4321
5890
  message
4322
5891
  }
4323
5892
  }
4324
5893
  `;
4325
5894
  var UPDATE_SUBSCRIPTION_PLAN_MUTATION = gql`
4326
- mutation updateSubscriptionPlan(
4327
- $newPlanId: LicencesEnumType!
4328
- $billingPeriod: BillingPeriodEnumType
4329
- ) {
4330
- updateSubscriptionPlan(
4331
- newPlanId: $newPlanId
4332
- billingPeriod: $billingPeriod
4333
- ) {
5895
+ mutation updateSubscriptionPlan($input: UpdateSubscriptionPlanInputType!) {
5896
+ updateSubscriptionPlan(input: $input) {
4334
5897
  data {
4335
- subscriptionId
4336
- status
4337
- priceId
5898
+ billingPeriod
5899
+ cancelAtPeriodEnd
4338
5900
  currentPlan
5901
+ endDate
5902
+ pendingBillingPeriod
5903
+ pendingChangeEffectiveAt
5904
+ pendingPlan
5905
+ priceId
5906
+ scheduleId
5907
+ status
5908
+ subscriptionId
4339
5909
  }
4340
5910
  message
4341
5911
  }
@@ -4351,36 +5921,20 @@ var CREATE_CUSTOMER_PORTAL = gql`
4351
5921
  }
4352
5922
  }
4353
5923
  `;
4354
- var SELECT_PACKAGE_MUTATION = gql`
4355
- mutation selectPackage(
4356
- $billingPeriod: BillingPeriodEnumType
4357
- $selectedLicence: LicencesEnumType!
4358
- $useStripe: Boolean
4359
- ) {
4360
- selectPackage(
4361
- billingPeriod: $billingPeriod
4362
- selectedLicence: $selectedLicence
4363
- useStripe: $useStripe
4364
- ) {
4365
- data {
4366
- checkoutUrl
4367
- licences {
4368
- ...LicenceFields
4369
- }
4370
- userId
4371
- }
4372
- message
4373
- }
4374
- }
4375
- ${LICENCE_FIELDS_FRAGMENT}
4376
- `;
4377
5924
  var GET_SUBSCRIPTION_STATUS = gql`
4378
5925
  query getSubscriptionStatus {
4379
5926
  getSubscriptionStatus {
4380
- subscriptionId
4381
- status
4382
- priceId
5927
+ billingPeriod
5928
+ cancelAtPeriodEnd
4383
5929
  currentPlan
5930
+ endDate
5931
+ pendingBillingPeriod
5932
+ pendingChangeEffectiveAt
5933
+ pendingPlan
5934
+ priceId
5935
+ scheduleId
5936
+ status
5937
+ subscriptionId
4384
5938
  }
4385
5939
  }
4386
5940
  `;
@@ -4407,7 +5961,6 @@ var GET_SUBSCRIPTION_PLANS = gql`
4407
5961
  }
4408
5962
  }
4409
5963
  isNewUser
4410
- isTester
4411
5964
  appliedDiscountType
4412
5965
  }
4413
5966
  }
@@ -4515,6 +6068,57 @@ var GET_APP_SETTINGS = gql`
4515
6068
  }
4516
6069
  ${APP_SETTINGS_FIELDS_FRAGMENT}
4517
6070
  `;
6071
+ var BILLING_CATALOG_FIELDS_FRAGMENT = gql`
6072
+ fragment BillingCatalogFields on BillingCatalogEntryType {
6073
+ _id
6074
+ active
6075
+ billingPeriod
6076
+ createdAt
6077
+ currency
6078
+ effectiveFrom
6079
+ key
6080
+ licenceType
6081
+ revision
6082
+ stripePriceId
6083
+ stripeProductId
6084
+ taxInclusive
6085
+ unitAmount
6086
+ updatedAt
6087
+ updatedBy
6088
+ }
6089
+ `;
6090
+ var GET_BILLING_CATALOG = gql`
6091
+ query getBillingCatalog {
6092
+ billingCatalog {
6093
+ ...BillingCatalogFields
6094
+ }
6095
+ }
6096
+ ${BILLING_CATALOG_FIELDS_FRAGMENT}
6097
+ `;
6098
+ var UPDATE_BILLING_CATALOG_PRICE_MUTATION = gql`
6099
+ mutation updateBillingCatalogPrice(
6100
+ $input: UpdateBillingCatalogPriceInputType!
6101
+ ) {
6102
+ updateBillingCatalogPrice(input: $input) {
6103
+ data {
6104
+ ...BillingCatalogFields
6105
+ }
6106
+ message
6107
+ }
6108
+ }
6109
+ ${BILLING_CATALOG_FIELDS_FRAGMENT}
6110
+ `;
6111
+ var SYNC_BILLING_CATALOG_PRICE_MUTATION = gql`
6112
+ mutation syncBillingCatalogPrice($input: SyncBillingCatalogPriceInputType!) {
6113
+ syncBillingCatalogPrice(input: $input) {
6114
+ data {
6115
+ ...BillingCatalogFields
6116
+ }
6117
+ message
6118
+ }
6119
+ }
6120
+ ${BILLING_CATALOG_FIELDS_FRAGMENT}
6121
+ `;
4518
6122
  var GAME_HISTORY_FIELDS_FRAGMENT = gql`
4519
6123
  fragment GameHistoryFields on GameHistoryType {
4520
6124
  createdAt
@@ -5353,46 +6957,220 @@ schema.index({
5353
6957
  start: 1,
5354
6958
  status: 1
5355
6959
  });
6960
+ schema.index({
6961
+ status: 1,
6962
+ targetRegion: 1,
6963
+ // eslint-disable-next-line sort-keys
6964
+ start: -1
6965
+ });
5356
6966
  var AdModel = import_mongoose.default.models.Ad || import_mongoose.default.model("Ad", schema);
5357
6967
 
5358
- // src/mongoose/chat/Chat.ts
6968
+ // src/mongoose/BillingCatalog.ts
5359
6969
  var import_mongoose2 = __toESM(require("mongoose"));
5360
6970
  var MongooseSchema2 = import_mongoose2.default.Schema;
5361
- var MessageReplyPreviewSchema = new MongooseSchema2(
6971
+ var BILLING_CATALOG_COLLECTION_NAME = "billingCatalog";
6972
+ var paidVendorLicences = [
6973
+ EnumUserLicence.PRO_VENDOR,
6974
+ EnumUserLicence.PRO_PLUS_VENDOR
6975
+ ];
6976
+ var supportedBillingPeriods = [
6977
+ EnumBillingPeriod.MONTHLY_CANCEL_ANYTIME,
6978
+ EnumBillingPeriod.YEARLY_ANNUAL_BILLED
6979
+ ];
6980
+ var unitAmountField = {
6981
+ min: 1,
6982
+ required: true,
6983
+ type: Number,
6984
+ validate: {
6985
+ message: "Billing catalogue price must be a positive integer.",
6986
+ validator: Number.isInteger
6987
+ }
6988
+ };
6989
+ var currencyField = {
6990
+ default: BILLING_CATALOG_CURRENCY,
6991
+ enum: [BILLING_CATALOG_CURRENCY],
6992
+ immutable: true,
6993
+ lowercase: true,
6994
+ required: true,
6995
+ trim: true,
6996
+ type: String
6997
+ };
6998
+ var stripePriceIdField = {
6999
+ default: null,
7000
+ required: false,
7001
+ trim: true,
7002
+ type: String
7003
+ };
7004
+ var stripeProductIdField = {
7005
+ default: null,
7006
+ required: false,
7007
+ trim: true,
7008
+ type: String
7009
+ };
7010
+ var priceHistorySchema = new MongooseSchema2(
7011
+ {
7012
+ changedAt: { required: true, type: Date },
7013
+ changedBy: {
7014
+ default: null,
7015
+ ref: "User",
7016
+ required: false,
7017
+ type: import_mongoose2.default.Schema.Types.ObjectId
7018
+ },
7019
+ currency: currencyField,
7020
+ effectiveFrom: { required: true, type: Date },
7021
+ effectiveTo: { required: true, type: Date },
7022
+ stripePriceId: stripePriceIdField,
7023
+ stripeProductId: stripeProductIdField,
7024
+ unitAmount: unitAmountField
7025
+ },
7026
+ { _id: false }
7027
+ );
7028
+ var schema2 = new MongooseSchema2(
7029
+ {
7030
+ active: { default: true, required: true, type: Boolean },
7031
+ billingPeriod: {
7032
+ enum: supportedBillingPeriods,
7033
+ immutable: true,
7034
+ required: true,
7035
+ type: String
7036
+ },
7037
+ currency: currencyField,
7038
+ effectiveFrom: { default: Date.now, required: true, type: Date },
7039
+ key: {
7040
+ enum: BILLING_CATALOG_KEYS,
7041
+ immutable: true,
7042
+ required: true,
7043
+ type: String,
7044
+ unique: true
7045
+ },
7046
+ licenceType: {
7047
+ enum: paidVendorLicences,
7048
+ immutable: true,
7049
+ required: true,
7050
+ type: String
7051
+ },
7052
+ priceHistory: {
7053
+ default: [],
7054
+ required: true,
7055
+ type: [priceHistorySchema]
7056
+ },
7057
+ revision: {
7058
+ default: 1,
7059
+ min: 1,
7060
+ required: true,
7061
+ type: Number,
7062
+ validate: {
7063
+ message: "Billing catalogue revision must be a positive integer.",
7064
+ validator: Number.isInteger
7065
+ }
7066
+ },
7067
+ stripePriceId: stripePriceIdField,
7068
+ stripeProductId: stripeProductIdField,
7069
+ taxInclusive: {
7070
+ default: true,
7071
+ immutable: true,
7072
+ required: true,
7073
+ type: Boolean,
7074
+ validate: {
7075
+ message: "Billing catalogue prices must include GST.",
7076
+ validator: (value) => value === true
7077
+ }
7078
+ },
7079
+ unitAmount: unitAmountField,
7080
+ updatedBy: {
7081
+ default: null,
7082
+ ref: "User",
7083
+ required: false,
7084
+ type: import_mongoose2.default.Schema.Types.ObjectId
7085
+ }
7086
+ },
7087
+ {
7088
+ collection: BILLING_CATALOG_COLLECTION_NAME,
7089
+ strict: true,
7090
+ timestamps: true
7091
+ }
7092
+ );
7093
+ schema2.pre("validate", function validateDefinition() {
7094
+ if (!billingCatalogDefinitionMatches(this)) {
7095
+ this.invalidate(
7096
+ "key",
7097
+ "Billing catalogue key does not match its licence and billing period."
7098
+ );
7099
+ }
7100
+ });
7101
+ schema2.index({ billingPeriod: 1, licenceType: 1 }, { unique: true });
7102
+ schema2.index({ active: 1, licenceType: 1 });
7103
+ schema2.index(
7104
+ { stripePriceId: 1 },
7105
+ {
7106
+ partialFilterExpression: { stripePriceId: { $type: "string" } },
7107
+ unique: true
7108
+ }
7109
+ );
7110
+ var BillingCatalogModel = import_mongoose2.default.models.BillingCatalogEntry || import_mongoose2.default.model(
7111
+ "BillingCatalogEntry",
7112
+ schema2,
7113
+ BILLING_CATALOG_COLLECTION_NAME
7114
+ );
7115
+ function buildInitialBillingCatalogEntries(now = /* @__PURE__ */ new Date()) {
7116
+ return INITIAL_BILLING_CATALOG.map((entry) => ({
7117
+ active: entry.active,
7118
+ billingPeriod: entry.billingPeriod,
7119
+ currency: entry.currency,
7120
+ effectiveFrom: new Date(now.getTime()),
7121
+ key: entry.key,
7122
+ licenceType: entry.licenceType,
7123
+ priceHistory: [],
7124
+ revision: 1,
7125
+ stripePriceId: null,
7126
+ stripeProductId: null,
7127
+ taxInclusive: entry.taxInclusive,
7128
+ unitAmount: entry.unitAmount,
7129
+ updatedBy: null
7130
+ }));
7131
+ }
7132
+ function getBillingCatalogDefinition(key) {
7133
+ return BILLING_CATALOG_DEFINITIONS[key];
7134
+ }
7135
+
7136
+ // src/mongoose/chat/Chat.ts
7137
+ var import_mongoose3 = __toESM(require("mongoose"));
7138
+ var MongooseSchema3 = import_mongoose3.default.Schema;
7139
+ var MessageReplyPreviewSchema = new MongooseSchema3(
5362
7140
  {
5363
7141
  contentPreview: { required: true, type: String },
5364
7142
  senderId: {
5365
7143
  ref: "User",
5366
7144
  required: true,
5367
- type: import_mongoose2.default.Schema.Types.ObjectId
7145
+ type: import_mongoose3.default.Schema.Types.ObjectId
5368
7146
  },
5369
7147
  senderName: { required: true, type: String }
5370
7148
  },
5371
7149
  { _id: false }
5372
7150
  );
5373
- var MessageReactionSchema = new MongooseSchema2(
7151
+ var MessageReactionSchema = new MongooseSchema3(
5374
7152
  {
5375
7153
  createdAt: { required: true, type: Date },
5376
7154
  userId: {
5377
7155
  ref: "User",
5378
7156
  required: true,
5379
- type: import_mongoose2.default.Schema.Types.ObjectId
7157
+ type: import_mongoose3.default.Schema.Types.ObjectId
5380
7158
  }
5381
7159
  },
5382
7160
  { _id: false }
5383
7161
  );
5384
- var MessageSeenSchema = new MongooseSchema2(
7162
+ var MessageSeenSchema = new MongooseSchema3(
5385
7163
  {
5386
7164
  seenAt: { required: true, type: Date },
5387
7165
  userId: {
5388
7166
  ref: "User",
5389
7167
  required: true,
5390
- type: import_mongoose2.default.Schema.Types.ObjectId
7168
+ type: import_mongoose3.default.Schema.Types.ObjectId
5391
7169
  }
5392
7170
  },
5393
7171
  { _id: false }
5394
7172
  );
5395
- var MessageSchema = new MongooseSchema2(
7173
+ var MessageSchema = new MongooseSchema3(
5396
7174
  {
5397
7175
  content: { required: true, type: String },
5398
7176
  likedBy: { default: [], required: false, type: [MessageReactionSchema] },
@@ -5403,18 +7181,18 @@ var MessageSchema = new MongooseSchema2(
5403
7181
  replyToMessageId: {
5404
7182
  ref: "Chat.messages",
5405
7183
  required: false,
5406
- type: import_mongoose2.default.Schema.Types.ObjectId
7184
+ type: import_mongoose3.default.Schema.Types.ObjectId
5407
7185
  },
5408
7186
  seenBy: { default: [], required: false, type: [MessageSeenSchema] },
5409
7187
  senderId: {
5410
7188
  ref: "User",
5411
7189
  required: true,
5412
- type: import_mongoose2.default.Schema.Types.ObjectId
7190
+ type: import_mongoose3.default.Schema.Types.ObjectId
5413
7191
  }
5414
7192
  },
5415
7193
  { timestamps: true }
5416
7194
  );
5417
- var ParticipantSchema = new MongooseSchema2(
7195
+ var ParticipantSchema = new MongooseSchema3(
5418
7196
  {
5419
7197
  active: { default: true, required: true, type: Boolean },
5420
7198
  userAvatar: { required: false, type: String },
@@ -5422,14 +7200,14 @@ var ParticipantSchema = new MongooseSchema2(
5422
7200
  userId: {
5423
7201
  ref: "User",
5424
7202
  required: true,
5425
- type: import_mongoose2.default.Schema.Types.ObjectId
7203
+ type: import_mongoose3.default.Schema.Types.ObjectId
5426
7204
  },
5427
7205
  userName: { required: true, type: String }
5428
7206
  },
5429
7207
  { _id: false }
5430
7208
  // Prevents Mongoose from creating an additional _id field for subdocuments
5431
7209
  );
5432
- var ChatSchema = new MongooseSchema2(
7210
+ var ChatSchema = new MongooseSchema3(
5433
7211
  {
5434
7212
  active: { default: true, required: true, type: Boolean },
5435
7213
  chatDescription: { required: false, type: String },
@@ -5453,12 +7231,12 @@ ChatSchema.index({
5453
7231
  "participants.userId": 1,
5454
7232
  updatedAt: -1
5455
7233
  });
5456
- var ChatModel = import_mongoose2.default.models.Chat || import_mongoose2.default.model("Chat", ChatSchema);
7234
+ var ChatModel = import_mongoose3.default.models.Chat || import_mongoose3.default.model("Chat", ChatSchema);
5457
7235
 
5458
7236
  // src/mongoose/chat/ChatReport.ts
5459
- var import_mongoose3 = __toESM(require("mongoose"));
5460
- var MongooseSchema3 = import_mongoose3.default.Schema;
5461
- var ReasonSchema = new MongooseSchema3(
7237
+ var import_mongoose4 = __toESM(require("mongoose"));
7238
+ var MongooseSchema4 = import_mongoose4.default.Schema;
7239
+ var ReasonSchema = new MongooseSchema4(
5462
7240
  {
5463
7241
  details: { default: null, required: false, type: String },
5464
7242
  reasonType: {
@@ -5469,23 +7247,23 @@ var ReasonSchema = new MongooseSchema3(
5469
7247
  },
5470
7248
  { _id: false }
5471
7249
  );
5472
- var ChatReportSchema = new MongooseSchema3(
7250
+ var ChatReportSchema = new MongooseSchema4(
5473
7251
  {
5474
7252
  chatId: {
5475
7253
  ref: "Chat",
5476
7254
  required: true,
5477
- type: import_mongoose3.default.Schema.Types.ObjectId
7255
+ type: import_mongoose4.default.Schema.Types.ObjectId
5478
7256
  },
5479
7257
  reason: { required: true, type: ReasonSchema },
5480
7258
  reportedUserId: {
5481
7259
  ref: "User",
5482
7260
  required: true,
5483
- type: import_mongoose3.default.Schema.Types.ObjectId
7261
+ type: import_mongoose4.default.Schema.Types.ObjectId
5484
7262
  },
5485
7263
  reporterUserId: {
5486
7264
  ref: "User",
5487
7265
  required: true,
5488
- type: import_mongoose3.default.Schema.Types.ObjectId
7266
+ type: import_mongoose4.default.Schema.Types.ObjectId
5489
7267
  },
5490
7268
  resolved: { default: false, required: true, type: Boolean }
5491
7269
  },
@@ -5493,18 +7271,18 @@ var ChatReportSchema = new MongooseSchema3(
5493
7271
  );
5494
7272
  ChatReportSchema.index({ chatId: 1, reportedUserId: 1 });
5495
7273
  ChatReportSchema.index({ createdAt: -1, reporterUserId: 1 });
5496
- var ChatReportModel = import_mongoose3.default.models.ChatReport || import_mongoose3.default.model("ChatReport", ChatReportSchema);
7274
+ var ChatReportModel = import_mongoose4.default.models.ChatReport || import_mongoose4.default.model("ChatReport", ChatReportSchema);
5497
7275
 
5498
7276
  // src/mongoose/global.ts
5499
- var import_mongoose6 = __toESM(require("mongoose"));
7277
+ var import_mongoose7 = __toESM(require("mongoose"));
5500
7278
 
5501
7279
  // src/mongoose/Relation.ts
5502
- var import_mongoose5 = __toESM(require("mongoose"));
7280
+ var import_mongoose6 = __toESM(require("mongoose"));
5503
7281
 
5504
7282
  // src/mongoose/event/EventInfo.ts
5505
- var import_mongoose4 = __toESM(require("mongoose"));
5506
- var MongooseSchema4 = import_mongoose4.default.Schema;
5507
- var StallTypeSchema = new MongooseSchema4(
7283
+ var import_mongoose5 = __toESM(require("mongoose"));
7284
+ var MongooseSchema5 = import_mongoose5.default.Schema;
7285
+ var StallTypeSchema = new MongooseSchema5(
5508
7286
  {
5509
7287
  label: { required: false, type: String },
5510
7288
  price: { required: false, type: Number },
@@ -5515,7 +7293,7 @@ var StallTypeSchema = new MongooseSchema4(
5515
7293
  // Prevents Mongoose from creating an additional _id field for subdocuments
5516
7294
  }
5517
7295
  );
5518
- var dateTimeSchema = new MongooseSchema4(
7296
+ var dateTimeSchema = new MongooseSchema5(
5519
7297
  {
5520
7298
  dateStatus: {
5521
7299
  enum: Object.values(EnumEventDateStatus),
@@ -5531,7 +7309,7 @@ var dateTimeSchema = new MongooseSchema4(
5531
7309
  { _id: false }
5532
7310
  // Prevents Mongoose from creating an additional _id field for subdocuments
5533
7311
  );
5534
- var paymentInfoSchema = new MongooseSchema4(
7312
+ var paymentInfoSchema = new MongooseSchema5(
5535
7313
  {
5536
7314
  accountHolderName: { required: false, type: String },
5537
7315
  accountNumber: { required: false, type: String },
@@ -5545,7 +7323,7 @@ var paymentInfoSchema = new MongooseSchema4(
5545
7323
  { _id: false }
5546
7324
  // Prevents Mongoose from creating an additional _id field
5547
7325
  );
5548
- var requirementsSchema = new MongooseSchema4(
7326
+ var requirementsSchema = new MongooseSchema5(
5549
7327
  {
5550
7328
  category: { required: true, type: String },
5551
7329
  label: { required: true, type: String },
@@ -5556,7 +7334,7 @@ var requirementsSchema = new MongooseSchema4(
5556
7334
  // Prevents Mongoose from creating an additional _id field for
5557
7335
  }
5558
7336
  );
5559
- var refundPolicySchema = new MongooseSchema4(
7337
+ var refundPolicySchema = new MongooseSchema5(
5560
7338
  {
5561
7339
  category: { required: true, type: String },
5562
7340
  label: { required: true, type: String },
@@ -5564,7 +7342,7 @@ var refundPolicySchema = new MongooseSchema4(
5564
7342
  },
5565
7343
  { _id: false }
5566
7344
  );
5567
- var schema2 = new MongooseSchema4(
7345
+ var schema3 = new MongooseSchema5(
5568
7346
  {
5569
7347
  active: { default: true, type: Boolean },
5570
7348
  applicationDeadlineHours: { required: true, type: Number },
@@ -5572,7 +7350,7 @@ var schema2 = new MongooseSchema4(
5572
7350
  eventId: {
5573
7351
  ref: "Event",
5574
7352
  required: true,
5575
- type: import_mongoose4.default.Schema.Types.ObjectId
7353
+ type: import_mongoose5.default.Schema.Types.ObjectId
5576
7354
  },
5577
7355
  packInTime: { required: true, type: Number },
5578
7356
  paymentDueHours: { required: true, type: Number },
@@ -5582,11 +7360,12 @@ var schema2 = new MongooseSchema4(
5582
7360
  },
5583
7361
  { timestamps: true }
5584
7362
  );
5585
- var EventInfoModel = import_mongoose4.default.models.EventInfo || import_mongoose4.default.model("EventInfo", schema2);
7363
+ schema3.index({ eventId: 1 });
7364
+ var EventInfoModel = import_mongoose5.default.models.EventInfo || import_mongoose5.default.model("EventInfo", schema3);
5586
7365
 
5587
7366
  // src/mongoose/Relation.ts
5588
- var MongooseSchema5 = import_mongoose5.default.Schema;
5589
- var relationDateTimeSchema = new MongooseSchema5(
7367
+ var MongooseSchema6 = import_mongoose6.default.Schema;
7368
+ var relationDateTimeSchema = new MongooseSchema6(
5590
7369
  {
5591
7370
  dateStatus: {
5592
7371
  enum: Object.values(EnumEventDateStatus),
@@ -5601,7 +7380,7 @@ var relationDateTimeSchema = new MongooseSchema5(
5601
7380
  },
5602
7381
  { _id: false }
5603
7382
  );
5604
- var relationDatesSchema = new MongooseSchema5(
7383
+ var relationDatesSchema = new MongooseSchema6(
5605
7384
  {
5606
7385
  dateTime: {
5607
7386
  required: true,
@@ -5620,19 +7399,19 @@ var relationDatesSchema = new MongooseSchema5(
5620
7399
  },
5621
7400
  { _id: false }
5622
7401
  );
5623
- var RelationTypeSchema = new MongooseSchema5(
7402
+ var RelationTypeSchema = new MongooseSchema6(
5624
7403
  {
5625
7404
  active: { default: true, required: true, type: Boolean },
5626
7405
  chatId: {
5627
7406
  ref: "Chat",
5628
7407
  required: true,
5629
- type: import_mongoose5.default.Schema.Types.ObjectId
7408
+ type: import_mongoose6.default.Schema.Types.ObjectId
5630
7409
  },
5631
7410
  deletedAt: { default: null, required: false, type: Date },
5632
7411
  eventId: {
5633
7412
  ref: "Event",
5634
7413
  required: true,
5635
- type: import_mongoose5.default.Schema.Types.ObjectId
7414
+ type: import_mongoose6.default.Schema.Types.ObjectId
5636
7415
  },
5637
7416
  lastUpdateBy: {
5638
7417
  enum: Object.values(EnumResourceType),
@@ -5648,7 +7427,7 @@ var RelationTypeSchema = new MongooseSchema5(
5648
7427
  vendorId: {
5649
7428
  ref: "Vendor",
5650
7429
  required: true,
5651
- type: import_mongoose5.default.Schema.Types.ObjectId
7430
+ type: import_mongoose6.default.Schema.Types.ObjectId
5652
7431
  }
5653
7432
  },
5654
7433
  { timestamps: true }
@@ -5660,23 +7439,23 @@ RelationTypeSchema.index({
5660
7439
  "relationDates.status": 1,
5661
7440
  vendorId: 1
5662
7441
  });
5663
- var RelationModel = import_mongoose5.default.models.Relation || import_mongoose5.default.model("Relation", RelationTypeSchema);
7442
+ var RelationModel = import_mongoose6.default.models.Relation || import_mongoose6.default.model("Relation", RelationTypeSchema);
5664
7443
 
5665
7444
  // src/mongoose/global.ts
5666
- var MongooseSchema6 = import_mongoose6.default.Schema;
5667
- var OwnerTypeSchema = new MongooseSchema6(
7445
+ var MongooseSchema7 = import_mongoose7.default.Schema;
7446
+ var OwnerTypeSchema = new MongooseSchema7(
5668
7447
  {
5669
7448
  email: { required: true, type: String },
5670
7449
  userId: {
5671
7450
  ref: "User",
5672
7451
  required: true,
5673
- type: import_mongoose6.default.Schema.Types.ObjectId
7452
+ type: import_mongoose7.default.Schema.Types.ObjectId
5674
7453
  }
5675
7454
  },
5676
7455
  { _id: false }
5677
7456
  // Prevents Mongoose from creating an additional _id field for subdocuments
5678
7457
  );
5679
- var SocialMediaTypeSchema = new MongooseSchema6(
7458
+ var SocialMediaTypeSchema = new MongooseSchema7(
5680
7459
  {
5681
7460
  link: { required: true, type: String },
5682
7461
  name: { required: true, type: String }
@@ -5684,7 +7463,7 @@ var SocialMediaTypeSchema = new MongooseSchema6(
5684
7463
  { _id: false }
5685
7464
  // Prevents Mongoose from creating an additional _id field
5686
7465
  );
5687
- var ResourceImageTypeSchema = new MongooseSchema6(
7466
+ var ResourceImageTypeSchema = new MongooseSchema7(
5688
7467
  {
5689
7468
  active: { default: true, required: true, type: Boolean },
5690
7469
  source: { required: false, type: String },
@@ -5693,7 +7472,7 @@ var ResourceImageTypeSchema = new MongooseSchema6(
5693
7472
  { _id: false }
5694
7473
  // Prevents Mongoose from creating an additional _id field for subdocuments
5695
7474
  );
5696
- var SubCategorySchema = new MongooseSchema6(
7475
+ var SubCategorySchema = new MongooseSchema7(
5697
7476
  {
5698
7477
  id: { required: false, type: String },
5699
7478
  items: [
@@ -5707,7 +7486,7 @@ var SubCategorySchema = new MongooseSchema6(
5707
7486
  { _id: false }
5708
7487
  // Prevents Mongoose from creating an additional _id field for subdocuments
5709
7488
  );
5710
- var CategorySchema = new MongooseSchema6(
7489
+ var CategorySchema = new MongooseSchema7(
5711
7490
  {
5712
7491
  id: { required: true, type: String },
5713
7492
  name: { required: true, type: String },
@@ -5716,7 +7495,7 @@ var CategorySchema = new MongooseSchema6(
5716
7495
  { _id: false }
5717
7496
  // Prevents Mongoose from creating an additional _id field for subdocuments
5718
7497
  );
5719
- var PosterUsageTypeSchema = new MongooseSchema6(
7498
+ var PosterUsageTypeSchema = new MongooseSchema7(
5720
7499
  {
5721
7500
  count: { default: 0, required: false, type: Number },
5722
7501
  month: { required: false, type: String }
@@ -5724,7 +7503,7 @@ var PosterUsageTypeSchema = new MongooseSchema6(
5724
7503
  { _id: false }
5725
7504
  // Prevents Mongoose from creating an additional _id field for subdocuments
5726
7505
  );
5727
- var userLicenseSchema = new MongooseSchema6(
7506
+ var userLicenseSchema = new MongooseSchema7(
5728
7507
  {
5729
7508
  expiryDate: { required: true, type: Date },
5730
7509
  issuedDate: { required: true, type: Date },
@@ -5741,7 +7520,7 @@ var userLicenseSchema = new MongooseSchema6(
5741
7520
  },
5742
7521
  { _id: false, timestamps: false }
5743
7522
  );
5744
- var ContactDetailsSchema = new MongooseSchema6(
7523
+ var ContactDetailsSchema = new MongooseSchema7(
5745
7524
  {
5746
7525
  email: { required: false, type: String },
5747
7526
  landlinePhone: { required: false, type: String },
@@ -5750,7 +7529,7 @@ var ContactDetailsSchema = new MongooseSchema6(
5750
7529
  { _id: false }
5751
7530
  // Prevents Mongoose from creating an additional _id field for subdocuments
5752
7531
  );
5753
- var termsAgreementSchema = new MongooseSchema6(
7532
+ var termsAgreementSchema = new MongooseSchema7(
5754
7533
  {
5755
7534
  appBuildNumber: { required: true, type: String },
5756
7535
  appId: { required: true, type: String },
@@ -5767,7 +7546,7 @@ var termsAgreementSchema = new MongooseSchema6(
5767
7546
  },
5768
7547
  { _id: false }
5769
7548
  );
5770
- var resourceRelationsSchema = new MongooseSchema6(
7549
+ var resourceRelationsSchema = new MongooseSchema7(
5771
7550
  {
5772
7551
  relationDates: {
5773
7552
  default: [],
@@ -5777,12 +7556,12 @@ var resourceRelationsSchema = new MongooseSchema6(
5777
7556
  relationId: {
5778
7557
  ref: "Relation",
5779
7558
  required: false,
5780
- type: import_mongoose6.default.Schema.Types.ObjectId
7559
+ type: import_mongoose7.default.Schema.Types.ObjectId
5781
7560
  }
5782
7561
  },
5783
7562
  { _id: false }
5784
7563
  );
5785
- var dateTimeSchema2 = new MongooseSchema6(
7564
+ var dateTimeSchema2 = new MongooseSchema7(
5786
7565
  {
5787
7566
  dateStatus: {
5788
7567
  enum: Object.values(EnumEventDateStatus),
@@ -5797,7 +7576,7 @@ var dateTimeSchema2 = new MongooseSchema6(
5797
7576
  { _id: false }
5798
7577
  // Prevents Mongoose from creating an additional _id field for subdocuments
5799
7578
  );
5800
- var locationGeoSchema = new MongooseSchema6(
7579
+ var locationGeoSchema = new MongooseSchema7(
5801
7580
  {
5802
7581
  coordinates: { required: true, type: [Number] },
5803
7582
  // [longitude, latitude]
@@ -5806,7 +7585,7 @@ var locationGeoSchema = new MongooseSchema6(
5806
7585
  { _id: false }
5807
7586
  // Prevents Mongoose from creating an additional _id field for subdocuments
5808
7587
  );
5809
- var locationsSchema = new MongooseSchema6(
7588
+ var locationsSchema = new MongooseSchema7(
5810
7589
  {
5811
7590
  city: { required: true, type: String },
5812
7591
  country: { required: true, type: String },
@@ -5822,13 +7601,13 @@ var locationsSchema = new MongooseSchema6(
5822
7601
  { _id: false }
5823
7602
  // Prevents Mongoose from creating an additional _id field for subdocuments
5824
7603
  );
5825
- var relatedPostSchema = new MongooseSchema6(
7604
+ var relatedPostSchema = new MongooseSchema7(
5826
7605
  {
5827
7606
  postActive: { default: true, required: true, type: Boolean },
5828
7607
  postId: {
5829
7608
  ref: "Post",
5830
7609
  required: true,
5831
- type: import_mongoose6.default.Schema.Types.ObjectId
7610
+ type: import_mongoose7.default.Schema.Types.ObjectId
5832
7611
  },
5833
7612
  postSlug: { required: true, type: String },
5834
7613
  postType: {
@@ -5840,7 +7619,7 @@ var relatedPostSchema = new MongooseSchema6(
5840
7619
  { _id: false }
5841
7620
  // Prevents Mongoose from creating an additional _id field for subdocuments
5842
7621
  );
5843
- var socialShareResourceSchema = new MongooseSchema6(
7622
+ var socialShareResourceSchema = new MongooseSchema7(
5844
7623
  {
5845
7624
  qrCode: { required: true, type: ResourceImageTypeSchema },
5846
7625
  socialImage: { required: true, type: ResourceImageTypeSchema }
@@ -5853,7 +7632,7 @@ var baseResourceFields = {
5853
7632
  adIds: {
5854
7633
  ref: "Ad",
5855
7634
  required: false,
5856
- type: [import_mongoose6.default.Schema.Types.ObjectId]
7635
+ type: [import_mongoose7.default.Schema.Types.ObjectId]
5857
7636
  },
5858
7637
  approvedAt: { default: null, required: false, type: Date },
5859
7638
  contactDetails: { required: false, type: ContactDetailsSchema },
@@ -5883,9 +7662,64 @@ var baseResourceFields = {
5883
7662
  };
5884
7663
 
5885
7664
  // src/mongoose/GoogleImportedMarket.ts
5886
- var import_mongoose7 = __toESM(require("mongoose"));
5887
- var MongooseSchema7 = import_mongoose7.default.Schema;
5888
- var addressComponentSchema = new MongooseSchema7(
7665
+ var import_mongoose8 = __toESM(require("mongoose"));
7666
+
7667
+ // src/mongoose/searchNamePlugin.ts
7668
+ function deriveSearchName(name) {
7669
+ return typeof name === "string" ? name.trim().toLowerCase() : "";
7670
+ }
7671
+ function searchNamePlugin(schema20) {
7672
+ schema20.add({ searchName: { default: "", required: false, type: String } });
7673
+ schema20.index({ searchName: 1 });
7674
+ schema20.pre("save", function syncSearchNameOnSave(next) {
7675
+ const doc = this;
7676
+ doc.searchName = deriveSearchName(doc.name);
7677
+ next();
7678
+ });
7679
+ schema20.pre("insertMany", function syncSearchNameOnInsertMany(next, docs) {
7680
+ const list = Array.isArray(docs) ? docs : [docs];
7681
+ for (const doc of list) {
7682
+ if (doc && typeof doc.name === "string") {
7683
+ doc.searchName = deriveSearchName(doc.name);
7684
+ }
7685
+ }
7686
+ next();
7687
+ });
7688
+ schema20.pre("bulkWrite", function syncSearchNameOnBulkWrite(next, ops) {
7689
+ for (const op of ops) {
7690
+ const doc = op.insertOne?.document ?? op.replaceOne?.replacement;
7691
+ if (doc && typeof doc.name === "string") {
7692
+ doc.searchName = deriveSearchName(doc.name);
7693
+ }
7694
+ const $set = op.updateOne?.update?.$set;
7695
+ if ($set && typeof $set.name === "string") {
7696
+ $set.searchName = deriveSearchName($set.name);
7697
+ }
7698
+ }
7699
+ next();
7700
+ });
7701
+ const syncSearchNameOnUpdate = function(next) {
7702
+ const update = this.getUpdate();
7703
+ if (update && typeof update === "object" && "$set" in update) {
7704
+ const $set = update.$set;
7705
+ if ($set && typeof $set.name === "string") {
7706
+ this.setUpdate({
7707
+ ...update,
7708
+ $set: { ...$set, searchName: deriveSearchName($set.name) }
7709
+ });
7710
+ }
7711
+ }
7712
+ next();
7713
+ };
7714
+ schema20.pre(
7715
+ ["findOneAndUpdate", "updateOne", "updateMany"],
7716
+ syncSearchNameOnUpdate
7717
+ );
7718
+ }
7719
+
7720
+ // src/mongoose/GoogleImportedMarket.ts
7721
+ var MongooseSchema8 = import_mongoose8.default.Schema;
7722
+ var addressComponentSchema = new MongooseSchema8(
5889
7723
  {
5890
7724
  longName: { required: false, type: String },
5891
7725
  shortName: { required: false, type: String },
@@ -5893,7 +7727,7 @@ var addressComponentSchema = new MongooseSchema7(
5893
7727
  },
5894
7728
  { _id: false }
5895
7729
  );
5896
- var schema3 = new MongooseSchema7(
7730
+ var schema4 = new MongooseSchema8(
5897
7731
  {
5898
7732
  active: { default: false, required: true, type: Boolean },
5899
7733
  address: { required: true, type: String },
@@ -5905,7 +7739,7 @@ var schema3 = new MongooseSchema7(
5905
7739
  claimedByUserId: {
5906
7740
  ref: "User",
5907
7741
  required: false,
5908
- type: import_mongoose7.default.Schema.Types.ObjectId
7742
+ type: import_mongoose8.default.Schema.Types.ObjectId
5909
7743
  },
5910
7744
  cover: {
5911
7745
  required: false,
@@ -5917,7 +7751,7 @@ var schema3 = new MongooseSchema7(
5917
7751
  eventId: {
5918
7752
  ref: "Event",
5919
7753
  required: false,
5920
- type: import_mongoose7.default.Schema.Types.ObjectId
7754
+ type: import_mongoose8.default.Schema.Types.ObjectId
5921
7755
  },
5922
7756
  eventType: {
5923
7757
  enum: Object.values(EnumEventType),
@@ -5956,18 +7790,20 @@ var schema3 = new MongooseSchema7(
5956
7790
  },
5957
7791
  { timestamps: true }
5958
7792
  );
5959
- schema3.index({ "location.geo": "2dsphere" });
5960
- schema3.index({ name: 1 });
5961
- schema3.index({ region: 1 });
5962
- schema3.index({ deletedAt: 1 });
5963
- schema3.index({ "dateTime.dateStatus": 1 });
5964
- schema3.index({ slug: 1 });
5965
- var GoogleImportedMarketModel = import_mongoose7.default.models.GoogleImportedMarket || import_mongoose7.default.model("GoogleImportedMarket", schema3);
7793
+ schema4.index({ "location.geo": "2dsphere" });
7794
+ schema4.index({ name: 1 });
7795
+ schema4.index({ region: 1 });
7796
+ schema4.index({ deletedAt: 1 });
7797
+ schema4.index({ "dateTime.dateStatus": 1 });
7798
+ schema4.index({ slug: 1 });
7799
+ schema4.index({ name: "text", description: "text" });
7800
+ schema4.plugin(searchNamePlugin);
7801
+ var GoogleImportedMarketModel = import_mongoose8.default.models.GoogleImportedMarket || import_mongoose8.default.model("GoogleImportedMarket", schema4);
5966
7802
 
5967
7803
  // src/mongoose/Notification.ts
5968
- var import_mongoose8 = __toESM(require("mongoose"));
5969
- var MongooseSchema8 = import_mongoose8.default.Schema;
5970
- var schema4 = new MongooseSchema8(
7804
+ var import_mongoose9 = __toESM(require("mongoose"));
7805
+ var MongooseSchema9 = import_mongoose9.default.Schema;
7806
+ var schema5 = new MongooseSchema9(
5971
7807
  {
5972
7808
  data: {
5973
7809
  resourceId: { required: true, type: String },
@@ -5990,16 +7826,16 @@ var schema4 = new MongooseSchema8(
5990
7826
  userId: {
5991
7827
  ref: "User",
5992
7828
  required: true,
5993
- type: import_mongoose8.default.Schema.Types.ObjectId
7829
+ type: import_mongoose9.default.Schema.Types.ObjectId
5994
7830
  }
5995
7831
  },
5996
7832
  { timestamps: true }
5997
7833
  );
5998
- schema4.index({ isRead: 1, userId: 1 });
5999
- schema4.index({ createdAt: -1, userId: 1 });
6000
- var NotificationModel = import_mongoose8.default.models.Notification || import_mongoose8.default.model("Notification", schema4);
7834
+ schema5.index({ isRead: 1, userId: 1 });
7835
+ schema5.index({ createdAt: -1, userId: 1 });
7836
+ var NotificationModel = import_mongoose9.default.models.Notification || import_mongoose9.default.model("Notification", schema5);
6001
7837
 
6002
- // node_modules/@timardex/cluemart-shared/dist/chunk-7IB7QPVH.mjs
7838
+ // node_modules/@timardex/cluemart-shared/dist/chunk-P4NLBWEJ.mjs
6003
7839
  var EnumInviteStatus2 = /* @__PURE__ */ ((EnumInviteStatus22) => {
6004
7840
  EnumInviteStatus22["ACCEPTED"] = "Accepted";
6005
7841
  EnumInviteStatus22["COMPLETED"] = "Completed";
@@ -6077,9 +7913,9 @@ var EnumSubscriptionStatus2 = /* @__PURE__ */ ((EnumSubscriptionStatus22) => {
6077
7913
  })(EnumSubscriptionStatus2 || {});
6078
7914
 
6079
7915
  // src/mongoose/PushToken.ts
6080
- var import_mongoose9 = __toESM(require("mongoose"));
6081
- var MongooseSchema9 = import_mongoose9.default.Schema;
6082
- var schema5 = new MongooseSchema9(
7916
+ var import_mongoose10 = __toESM(require("mongoose"));
7917
+ var MongooseSchema10 = import_mongoose10.default.Schema;
7918
+ var schema6 = new MongooseSchema10(
6083
7919
  {
6084
7920
  platform: {
6085
7921
  enum: Object.values(EnumOSPlatform2),
@@ -6090,17 +7926,17 @@ var schema5 = new MongooseSchema9(
6090
7926
  userId: {
6091
7927
  ref: "User",
6092
7928
  required: true,
6093
- type: import_mongoose9.default.Schema.Types.ObjectId
7929
+ type: import_mongoose10.default.Schema.Types.ObjectId
6094
7930
  }
6095
7931
  },
6096
7932
  { timestamps: true }
6097
7933
  );
6098
- var PushTokenModel = import_mongoose9.default.models.PushToken || import_mongoose9.default.model("PushToken", schema5);
7934
+ var PushTokenModel = import_mongoose10.default.models.PushToken || import_mongoose10.default.model("PushToken", schema6);
6099
7935
 
6100
7936
  // src/mongoose/ResourceActivity.ts
6101
- var import_mongoose10 = __toESM(require("mongoose"));
6102
- var MongooseSchema10 = import_mongoose10.default.Schema;
6103
- var ActivitySchema = new MongooseSchema10(
7937
+ var import_mongoose11 = __toESM(require("mongoose"));
7938
+ var MongooseSchema11 = import_mongoose11.default.Schema;
7939
+ var ActivitySchema = new MongooseSchema11(
6104
7940
  {
6105
7941
  activityType: {
6106
7942
  enum: Object.values(EnumActivity),
@@ -6128,7 +7964,7 @@ var ActivitySchema = new MongooseSchema10(
6128
7964
  },
6129
7965
  { _id: false }
6130
7966
  );
6131
- var schema6 = new MongooseSchema10(
7967
+ var schema7 = new MongooseSchema11(
6132
7968
  {
6133
7969
  activity: { default: [], type: [ActivitySchema] },
6134
7970
  resourceId: { required: true, type: String },
@@ -6140,46 +7976,55 @@ var schema6 = new MongooseSchema10(
6140
7976
  },
6141
7977
  { timestamps: true }
6142
7978
  );
6143
- schema6.index({ resourceId: 1, resourceType: 1 }, { unique: true });
6144
- schema6.index({ "views.location": "2dsphere" });
6145
- var ResourceActivityModel = import_mongoose10.default.models.ResourceActivity || import_mongoose10.default.model("ResourceActivity", schema6);
7979
+ schema7.index({ resourceId: 1, resourceType: 1 }, { unique: true });
7980
+ schema7.index({ "views.location": "2dsphere" });
7981
+ var ResourceActivityModel = import_mongoose11.default.models.ResourceActivity || import_mongoose11.default.model("ResourceActivity", schema7);
6146
7982
 
6147
7983
  // src/mongoose/User.ts
6148
- var import_mongoose11 = __toESM(require("mongoose"));
6149
- var MongooseSchema11 = import_mongoose11.default.Schema;
6150
- var userActivityEventSchema = new MongooseSchema11(
7984
+ var import_mongoose12 = __toESM(require("mongoose"));
7985
+ var MongooseSchema12 = import_mongoose12.default.Schema;
7986
+ var userActivityEventSchema = new MongooseSchema12(
6151
7987
  {
6152
7988
  dateTime: dateTimeSchema2,
6153
7989
  resourceId: {
6154
7990
  ref: "Event",
6155
7991
  required: false,
6156
- type: import_mongoose11.default.Schema.Types.ObjectId
7992
+ type: import_mongoose12.default.Schema.Types.ObjectId
6157
7993
  }
6158
7994
  },
6159
7995
  { _id: false }
6160
7996
  );
6161
- var userActivityFavouritesSchema = new MongooseSchema11(
7997
+ var userActivityFavouritesSchema = new MongooseSchema12(
6162
7998
  {
6163
7999
  events: {
6164
8000
  ref: "Event",
6165
8001
  required: false,
6166
- type: [import_mongoose11.default.Schema.Types.ObjectId]
8002
+ type: [import_mongoose12.default.Schema.Types.ObjectId]
6167
8003
  },
6168
8004
  partners: {
6169
8005
  ref: "Partner",
6170
8006
  required: false,
6171
- type: [import_mongoose11.default.Schema.Types.ObjectId]
8007
+ type: [import_mongoose12.default.Schema.Types.ObjectId]
6172
8008
  },
6173
8009
  vendors: {
6174
8010
  ref: "Vendor",
6175
8011
  required: false,
6176
- type: [import_mongoose11.default.Schema.Types.ObjectId]
8012
+ type: [import_mongoose12.default.Schema.Types.ObjectId]
6177
8013
  }
6178
8014
  },
6179
8015
  { _id: false }
6180
8016
  );
6181
- var stripeSchema = new MongooseSchema11(
8017
+ var stripeSchema = new MongooseSchema12(
6182
8018
  {
8019
+ billingPeriod: {
8020
+ enum: Object.values(EnumBillingPeriod),
8021
+ required: false,
8022
+ type: String
8023
+ },
8024
+ cancelAtPeriodEnd: {
8025
+ required: false,
8026
+ type: Boolean
8027
+ },
6183
8028
  currentPlan: {
6184
8029
  enum: Object.values(EnumUserLicence),
6185
8030
  required: false,
@@ -6193,6 +8038,28 @@ var stripeSchema = new MongooseSchema11(
6193
8038
  required: false,
6194
8039
  type: Date
6195
8040
  },
8041
+ pendingBillingPeriod: {
8042
+ enum: Object.values(EnumBillingPeriod),
8043
+ required: false,
8044
+ type: String
8045
+ },
8046
+ pendingChangeEffectiveAt: {
8047
+ required: false,
8048
+ type: Date
8049
+ },
8050
+ pendingPlan: {
8051
+ enum: Object.values(EnumUserLicence),
8052
+ required: false,
8053
+ type: String
8054
+ },
8055
+ priceId: {
8056
+ required: false,
8057
+ type: String
8058
+ },
8059
+ scheduleId: {
8060
+ required: false,
8061
+ type: String
8062
+ },
6196
8063
  startDate: {
6197
8064
  required: false,
6198
8065
  type: Date
@@ -6205,11 +8072,19 @@ var stripeSchema = new MongooseSchema11(
6205
8072
  subscriptionId: {
6206
8073
  required: false,
6207
8074
  type: String
8075
+ },
8076
+ subscriptionMutationLockExpiresAt: {
8077
+ required: false,
8078
+ type: Date
8079
+ },
8080
+ subscriptionMutationLockId: {
8081
+ required: false,
8082
+ type: String
6208
8083
  }
6209
8084
  },
6210
8085
  { _id: false }
6211
8086
  );
6212
- var redeemedRewardSchema = new MongooseSchema11(
8087
+ var redeemedRewardSchema = new MongooseSchema12(
6213
8088
  {
6214
8089
  name: {
6215
8090
  enum: Object.values(EnumReward),
@@ -6221,13 +8096,13 @@ var redeemedRewardSchema = new MongooseSchema11(
6221
8096
  },
6222
8097
  { _id: false }
6223
8098
  );
6224
- var schema7 = new MongooseSchema11(
8099
+ var schema8 = new MongooseSchema12(
6225
8100
  {
6226
8101
  active: { default: false, required: true, type: Boolean },
6227
8102
  affiliate: {
6228
8103
  ref: "Affiliate",
6229
8104
  required: false,
6230
- type: import_mongoose11.default.Schema.Types.ObjectId
8105
+ type: import_mongoose12.default.Schema.Types.ObjectId
6231
8106
  },
6232
8107
  avatar: {
6233
8108
  required: false,
@@ -6236,7 +8111,7 @@ var schema7 = new MongooseSchema11(
6236
8111
  coupon: {
6237
8112
  ref: "Coupon",
6238
8113
  required: false,
6239
- type: import_mongoose11.default.Schema.Types.ObjectId
8114
+ type: import_mongoose12.default.Schema.Types.ObjectId
6240
8115
  },
6241
8116
  deletedAt: { default: null, required: false, type: Date },
6242
8117
  email: { required: true, type: String },
@@ -6248,13 +8123,13 @@ var schema7 = new MongooseSchema11(
6248
8123
  events: {
6249
8124
  ref: "Event",
6250
8125
  required: false,
6251
- type: [import_mongoose11.default.Schema.Types.ObjectId]
8126
+ type: [import_mongoose12.default.Schema.Types.ObjectId]
6252
8127
  },
6253
8128
  firstName: { required: true, type: String },
6254
8129
  game: {
6255
8130
  ref: "Game",
6256
8131
  required: false,
6257
- type: import_mongoose11.default.Schema.Types.ObjectId
8132
+ type: import_mongoose12.default.Schema.Types.ObjectId
6258
8133
  },
6259
8134
  interests: {
6260
8135
  enum: Object.values(EnumResourceType),
@@ -6276,7 +8151,7 @@ var schema7 = new MongooseSchema11(
6276
8151
  partner: {
6277
8152
  ref: "Partner",
6278
8153
  required: false,
6279
- type: import_mongoose11.default.Schema.Types.ObjectId
8154
+ type: import_mongoose12.default.Schema.Types.ObjectId
6280
8155
  },
6281
8156
  password: { required: true, type: String },
6282
8157
  platform: {
@@ -6309,7 +8184,7 @@ var schema7 = new MongooseSchema11(
6309
8184
  school: {
6310
8185
  ref: "School",
6311
8186
  required: false,
6312
- type: import_mongoose11.default.Schema.Types.ObjectId
8187
+ type: import_mongoose12.default.Schema.Types.ObjectId
6313
8188
  },
6314
8189
  stripe: {
6315
8190
  required: false,
@@ -6334,19 +8209,20 @@ var schema7 = new MongooseSchema11(
6334
8209
  vendor: {
6335
8210
  ref: "Vendor",
6336
8211
  required: false,
6337
- type: import_mongoose11.default.Schema.Types.ObjectId
8212
+ type: import_mongoose12.default.Schema.Types.ObjectId
6338
8213
  }
6339
8214
  },
6340
8215
  { strict: false, timestamps: true }
6341
8216
  );
6342
- schema7.index({ "licences.expiryDate": 1 });
6343
- schema7.index({ "licences.licenceType": 1 });
6344
- var UserModel = import_mongoose11.default.models.User || import_mongoose11.default.model("User", schema7);
8217
+ schema8.index({ "licences.expiryDate": 1 });
8218
+ schema8.index({ "licences.licenceType": 1 });
8219
+ schema8.index({ promoCodes: 1, active: 1, deletedAt: 1 });
8220
+ var UserModel = import_mongoose12.default.models.User || import_mongoose12.default.model("User", schema8);
6345
8221
 
6346
8222
  // src/mongoose/VerificationToken.ts
6347
- var import_mongoose12 = __toESM(require("mongoose"));
6348
- var MongooseSchema12 = import_mongoose12.default.Schema;
6349
- var schema8 = new MongooseSchema12(
8223
+ var import_mongoose13 = __toESM(require("mongoose"));
8224
+ var MongooseSchema13 = import_mongoose13.default.Schema;
8225
+ var schema9 = new MongooseSchema13(
6350
8226
  {
6351
8227
  createdAt: {
6352
8228
  default: Date.now,
@@ -6361,12 +8237,12 @@ var schema8 = new MongooseSchema12(
6361
8237
  },
6362
8238
  { timestamps: true }
6363
8239
  );
6364
- var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
8240
+ var VerificationTokenModel = import_mongoose13.default.models.VerificationToken || import_mongoose13.default.model("VerificationToken", schema9);
6365
8241
 
6366
8242
  // src/mongoose/vendor/Vendor.ts
6367
- var import_mongoose13 = __toESM(require("mongoose"));
6368
- var MongooseSchema13 = import_mongoose13.default.Schema;
6369
- var vendorProductTypeSchema = new MongooseSchema13(
8243
+ var import_mongoose14 = __toESM(require("mongoose"));
8244
+ var MongooseSchema14 = import_mongoose14.default.Schema;
8245
+ var vendorProductTypeSchema = new MongooseSchema14(
6370
8246
  {
6371
8247
  description: { required: false, type: String },
6372
8248
  name: { required: true, type: String },
@@ -6377,14 +8253,14 @@ var vendorProductTypeSchema = new MongooseSchema13(
6377
8253
  },
6378
8254
  { timestamps: true }
6379
8255
  );
6380
- var productWrapperSchema = new MongooseSchema13(
8256
+ var productWrapperSchema = new MongooseSchema14(
6381
8257
  {
6382
8258
  active: { default: false, required: false, type: Boolean },
6383
8259
  productsList: { required: false, type: [vendorProductTypeSchema] }
6384
8260
  },
6385
8261
  { _id: false }
6386
8262
  );
6387
- var calendarSchema = new MongooseSchema13(
8263
+ var calendarSchema = new MongooseSchema14(
6388
8264
  {
6389
8265
  dateTime: {
6390
8266
  dateStatus: {
@@ -6405,14 +8281,14 @@ var calendarSchema = new MongooseSchema13(
6405
8281
  },
6406
8282
  { _id: false }
6407
8283
  );
6408
- var calendarWrapperSchema = new MongooseSchema13(
8284
+ var calendarWrapperSchema = new MongooseSchema14(
6409
8285
  {
6410
8286
  active: { default: false, required: true, type: Boolean },
6411
8287
  calendarData: { required: false, type: [calendarSchema] }
6412
8288
  },
6413
8289
  { _id: false }
6414
8290
  );
6415
- var schema9 = new MongooseSchema13(
8291
+ var schema10 = new MongooseSchema14(
6416
8292
  {
6417
8293
  ...baseResourceFields,
6418
8294
  // Importing base resource fields from global.ts
@@ -6426,6 +8302,7 @@ var schema9 = new MongooseSchema13(
6426
8302
  type: calendarWrapperSchema
6427
8303
  },
6428
8304
  categories: { required: true, type: [CategorySchema] },
8305
+ categoriesNames: { default: [], required: false, type: [String] },
6429
8306
  claimed: { default: true, required: false, type: Boolean },
6430
8307
  foodTruck: { required: true, type: Boolean },
6431
8308
  products: { required: false, type: productWrapperSchema },
@@ -6438,12 +8315,12 @@ var schema9 = new MongooseSchema13(
6438
8315
  unregisteredVendorId: {
6439
8316
  ref: "UnregisteredVendor",
6440
8317
  required: false,
6441
- type: import_mongoose13.default.Schema.Types.ObjectId
8318
+ type: import_mongoose14.default.Schema.Types.ObjectId
6442
8319
  },
6443
8320
  vendorInfoId: {
6444
8321
  ref: "VendorInfo",
6445
8322
  required: false,
6446
- type: import_mongoose13.default.Schema.Types.ObjectId
8323
+ type: import_mongoose14.default.Schema.Types.ObjectId
6447
8324
  },
6448
8325
  vendorType: {
6449
8326
  enum: Object.values(EnumVendorType),
@@ -6453,24 +8330,31 @@ var schema9 = new MongooseSchema13(
6453
8330
  },
6454
8331
  { timestamps: true }
6455
8332
  );
6456
- schema9.index({ name: 1 });
6457
- schema9.index({ description: 1 });
6458
- schema9.index({ region: 1 });
6459
- schema9.index({ "categories.name": 1 });
6460
- schema9.index({ slug: 1 });
6461
- var VendorModel = import_mongoose13.default.models.Vendor || import_mongoose13.default.model("Vendor", schema9);
8333
+ schema10.index({ name: 1 });
8334
+ schema10.index({ description: 1 });
8335
+ schema10.index({ region: 1 });
8336
+ schema10.index({ "categories.name": 1 });
8337
+ schema10.index({ slug: 1 });
8338
+ schema10.index({
8339
+ name: "text",
8340
+ description: "text",
8341
+ categoriesNames: "text"
8342
+ });
8343
+ schema10.index({ "owner.userId": 1, deletedAt: 1 });
8344
+ schema10.plugin(searchNamePlugin);
8345
+ var VendorModel = import_mongoose14.default.models.Vendor || import_mongoose14.default.model("Vendor", schema10);
6462
8346
 
6463
8347
  // src/mongoose/vendor/VendorInfo.ts
6464
- var import_mongoose14 = __toESM(require("mongoose"));
6465
- var MongooseSchema14 = import_mongoose14.default.Schema;
6466
- var AttributesSchema = new MongooseSchema14(
8348
+ var import_mongoose15 = __toESM(require("mongoose"));
8349
+ var MongooseSchema15 = import_mongoose15.default.Schema;
8350
+ var AttributesSchema = new MongooseSchema15(
6467
8351
  {
6468
8352
  details: { required: false, type: String },
6469
8353
  isRequired: { default: false, required: true, type: Boolean }
6470
8354
  },
6471
8355
  { _id: false }
6472
8356
  );
6473
- var schema10 = new MongooseSchema14(
8357
+ var schema11 = new MongooseSchema15(
6474
8358
  {
6475
8359
  active: { default: true, type: Boolean },
6476
8360
  compliance: {
@@ -6505,28 +8389,29 @@ var schema10 = new MongooseSchema14(
6505
8389
  vendorId: {
6506
8390
  ref: "Vendor",
6507
8391
  required: true,
6508
- type: import_mongoose14.default.Schema.Types.ObjectId
8392
+ type: import_mongoose15.default.Schema.Types.ObjectId
6509
8393
  }
6510
8394
  },
6511
8395
  { timestamps: true }
6512
8396
  );
6513
- var VendorInfoModel = import_mongoose14.default.models.VendorInfo || import_mongoose14.default.model("VendorInfo", schema10);
8397
+ schema11.index({ vendorId: 1 });
8398
+ var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
6514
8399
 
6515
8400
  // src/mongoose/vendor/UnregisteredVendor.ts
6516
- var import_mongoose15 = __toESM(require("mongoose"));
6517
- var MongooseSchema15 = import_mongoose15.default.Schema;
6518
- var invitationSchema = new MongooseSchema15(
8401
+ var import_mongoose16 = __toESM(require("mongoose"));
8402
+ var MongooseSchema16 = import_mongoose16.default.Schema;
8403
+ var invitationSchema = new MongooseSchema16(
6519
8404
  {
6520
8405
  dateTime: { required: true, type: [dateTimeSchema2] },
6521
8406
  inviterId: {
6522
8407
  ref: "Event",
6523
8408
  required: true,
6524
- type: import_mongoose15.default.Schema.Types.ObjectId
8409
+ type: import_mongoose16.default.Schema.Types.ObjectId
6525
8410
  }
6526
8411
  },
6527
8412
  { _id: false }
6528
8413
  );
6529
- var schema11 = new MongooseSchema15(
8414
+ var schema12 = new MongooseSchema16(
6530
8415
  {
6531
8416
  active: { default: true, required: true, type: Boolean },
6532
8417
  categoryIds: { required: true, type: [String] },
@@ -6535,7 +8420,7 @@ var schema11 = new MongooseSchema15(
6535
8420
  claimedByUserId: {
6536
8421
  ref: "User",
6537
8422
  required: false,
6538
- type: import_mongoose15.default.Schema.Types.ObjectId
8423
+ type: import_mongoose16.default.Schema.Types.ObjectId
6539
8424
  },
6540
8425
  claimInitiatedAt: { default: null, required: false, type: Date },
6541
8426
  claimToken: { default: null, required: false, type: String },
@@ -6548,14 +8433,14 @@ var schema11 = new MongooseSchema15(
6548
8433
  },
6549
8434
  { timestamps: true }
6550
8435
  );
6551
- schema11.index({ name: 1 });
6552
- schema11.index({ email: 1 });
6553
- var UnregisteredVendorModel = import_mongoose15.default.models.UnregisteredVendor || import_mongoose15.default.model("UnregisteredVendor", schema11);
8436
+ schema12.index({ name: 1 });
8437
+ schema12.index({ email: 1 });
8438
+ var UnregisteredVendorModel = import_mongoose16.default.models.UnregisteredVendor || import_mongoose16.default.model("UnregisteredVendor", schema12);
6554
8439
 
6555
8440
  // src/mongoose/event/Event.ts
6556
- var import_mongoose16 = __toESM(require("mongoose"));
6557
- var MongooseSchema16 = import_mongoose16.default.Schema;
6558
- var schema12 = new MongooseSchema16(
8441
+ var import_mongoose17 = __toESM(require("mongoose"));
8442
+ var MongooseSchema17 = import_mongoose17.default.Schema;
8443
+ var schema13 = new MongooseSchema17(
6559
8444
  {
6560
8445
  ...baseResourceFields,
6561
8446
  // Importing base resource fields from global.ts
@@ -6564,7 +8449,7 @@ var schema12 = new MongooseSchema16(
6564
8449
  eventInfoId: {
6565
8450
  ref: "EventInfo",
6566
8451
  required: false,
6567
- type: import_mongoose16.default.Schema.Types.ObjectId
8452
+ type: import_mongoose17.default.Schema.Types.ObjectId
6568
8453
  },
6569
8454
  eventType: {
6570
8455
  enum: Object.values(EnumEventType),
@@ -6593,20 +8478,23 @@ var schema12 = new MongooseSchema16(
6593
8478
  },
6594
8479
  { timestamps: true }
6595
8480
  );
6596
- schema12.index({ name: 1 });
6597
- schema12.index({ description: 1 });
6598
- schema12.index({ region: 1 });
6599
- schema12.index({ "location.geo": "2dsphere" });
6600
- schema12.index({ tags: 1 });
6601
- schema12.index({ deletedAt: 1 });
6602
- schema12.index({ "dateTime.dateStatus": 1 });
6603
- schema12.index({ slug: 1 });
6604
- var EventModel = import_mongoose16.default.models.Event || import_mongoose16.default.model("Event", schema12);
8481
+ schema13.index({ name: 1 });
8482
+ schema13.index({ description: 1 });
8483
+ schema13.index({ region: 1 });
8484
+ schema13.index({ "location.geo": "2dsphere" });
8485
+ schema13.index({ tags: 1 });
8486
+ schema13.index({ deletedAt: 1 });
8487
+ schema13.index({ "dateTime.dateStatus": 1 });
8488
+ schema13.index({ slug: 1 });
8489
+ schema13.index({ name: "text", description: "text", tags: "text" });
8490
+ schema13.index({ "owner.userId": 1, deletedAt: 1 });
8491
+ schema13.plugin(searchNamePlugin);
8492
+ var EventModel = import_mongoose17.default.models.Event || import_mongoose17.default.model("Event", schema13);
6605
8493
 
6606
8494
  // src/mongoose/Partner.ts
6607
- var import_mongoose17 = __toESM(require("mongoose"));
6608
- var MongooseSchema17 = import_mongoose17.default.Schema;
6609
- var schema13 = new MongooseSchema17(
8495
+ var import_mongoose18 = __toESM(require("mongoose"));
8496
+ var MongooseSchema18 = import_mongoose18.default.Schema;
8497
+ var schema14 = new MongooseSchema18(
6610
8498
  {
6611
8499
  ...baseResourceFields,
6612
8500
  location: {
@@ -6622,19 +8510,22 @@ var schema13 = new MongooseSchema17(
6622
8510
  },
6623
8511
  { timestamps: true }
6624
8512
  );
6625
- schema13.index({ name: 1 });
6626
- schema13.index({ description: 1 });
6627
- schema13.index({ region: 1 });
6628
- schema13.index({ "location.geo": "2dsphere" });
6629
- schema13.index({ slug: 1 });
6630
- var PartnerModel = import_mongoose17.default.models.Partner || import_mongoose17.default.model("Partner", schema13);
8513
+ schema14.index({ name: 1 });
8514
+ schema14.index({ description: 1 });
8515
+ schema14.index({ region: 1 });
8516
+ schema14.index({ "location.geo": "2dsphere" });
8517
+ schema14.index({ slug: 1 });
8518
+ schema14.index({ name: "text", description: "text" });
8519
+ schema14.index({ "owner.userId": 1, deletedAt: 1 });
8520
+ schema14.plugin(searchNamePlugin);
8521
+ var PartnerModel = import_mongoose18.default.models.Partner || import_mongoose18.default.model("Partner", schema14);
6631
8522
 
6632
8523
  // src/mongoose/Post.ts
6633
- var import_mongoose18 = __toESM(require("mongoose"));
6634
- var MongooseSchema18 = import_mongoose18.default.Schema;
6635
- var contentSchema = new MongooseSchema18(
8524
+ var import_mongoose19 = __toESM(require("mongoose"));
8525
+ var MongooseSchema19 = import_mongoose19.default.Schema;
8526
+ var contentSchema = new MongooseSchema19(
6636
8527
  {
6637
- contentData: import_mongoose18.Schema.Types.Mixed,
8528
+ contentData: import_mongoose19.Schema.Types.Mixed,
6638
8529
  contentOrder: { required: true, type: Number },
6639
8530
  contentType: {
6640
8531
  enum: Object.values(EnumPostContentType),
@@ -6644,7 +8535,7 @@ var contentSchema = new MongooseSchema18(
6644
8535
  },
6645
8536
  { _id: false }
6646
8537
  );
6647
- var resourceSchema = new MongooseSchema18(
8538
+ var resourceSchema = new MongooseSchema19(
6648
8539
  {
6649
8540
  resourceId: { required: true, type: String },
6650
8541
  resourceRegion: { required: true, type: String },
@@ -6657,7 +8548,7 @@ var resourceSchema = new MongooseSchema18(
6657
8548
  },
6658
8549
  { _id: false }
6659
8550
  );
6660
- var schema14 = new MongooseSchema18(
8551
+ var schema15 = new MongooseSchema19(
6661
8552
  {
6662
8553
  active: { default: false, required: true, type: Boolean },
6663
8554
  approvedAt: { default: null, required: false, type: Date },
@@ -6688,16 +8579,16 @@ var schema14 = new MongooseSchema18(
6688
8579
  },
6689
8580
  { timestamps: true }
6690
8581
  );
6691
- schema14.index({ title: 1 });
6692
- schema14.index({ tags: 1 });
6693
- schema14.index({ postType: 1, slug: 1 }, { unique: true });
6694
- var PostModel = import_mongoose18.default.models.Post || import_mongoose18.default.model("Post", schema14);
8582
+ schema15.index({ title: 1 });
8583
+ schema15.index({ tags: 1 });
8584
+ schema15.index({ postType: 1, slug: 1 }, { unique: true });
8585
+ var PostModel = import_mongoose19.default.models.Post || import_mongoose19.default.model("Post", schema15);
6695
8586
 
6696
8587
  // src/mongoose/AppSetting.ts
6697
- var import_mongoose19 = __toESM(require("mongoose"));
6698
- var MongooseSchema19 = import_mongoose19.default.Schema;
8588
+ var import_mongoose20 = __toESM(require("mongoose"));
8589
+ var MongooseSchema20 = import_mongoose20.default.Schema;
6699
8590
  var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
6700
- var AppSettingSchema = new MongooseSchema19(
8591
+ var AppSettingSchema = new MongooseSchema20(
6701
8592
  {
6702
8593
  activeSchoolsStudentCountTotal: {
6703
8594
  default: 0,
@@ -6728,18 +8619,18 @@ var AppSettingSchema = new MongooseSchema19(
6728
8619
  },
6729
8620
  { timestamps: true }
6730
8621
  );
6731
- var AppSettingModel = import_mongoose19.default.models.AppSetting || import_mongoose19.default.model("AppSetting", AppSettingSchema);
8622
+ var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
6732
8623
 
6733
8624
  // src/mongoose/game/Game.ts
6734
- var import_mongoose23 = __toESM(require("mongoose"));
8625
+ var import_mongoose24 = __toESM(require("mongoose"));
6735
8626
 
6736
8627
  // src/mongoose/game/DailyClue.ts
6737
- var import_mongoose21 = __toESM(require("mongoose"));
8628
+ var import_mongoose22 = __toESM(require("mongoose"));
6738
8629
 
6739
8630
  // src/mongoose/game/utils.ts
6740
- var import_mongoose20 = __toESM(require("mongoose"));
6741
- var MongooseSchema20 = import_mongoose20.default.Schema;
6742
- var schemaGameDate = new MongooseSchema20(
8631
+ var import_mongoose21 = __toESM(require("mongoose"));
8632
+ var MongooseSchema21 = import_mongoose21.default.Schema;
8633
+ var schemaGameDate = new MongooseSchema21(
6743
8634
  {
6744
8635
  endDate: { required: true, type: Date },
6745
8636
  startDate: { required: true, type: Date }
@@ -6748,8 +8639,8 @@ var schemaGameDate = new MongooseSchema20(
6748
8639
  );
6749
8640
 
6750
8641
  // src/mongoose/game/DailyClue.ts
6751
- var MongooseSchema21 = import_mongoose21.default.Schema;
6752
- var schemaLetters = new MongooseSchema21(
8642
+ var MongooseSchema22 = import_mongoose22.default.Schema;
8643
+ var schemaLetters = new MongooseSchema22(
6753
8644
  {
6754
8645
  collected: { required: false, type: [String] },
6755
8646
  solutionShuffled: { required: true, type: [String] }
@@ -6757,14 +8648,14 @@ var schemaLetters = new MongooseSchema21(
6757
8648
  },
6758
8649
  { _id: false }
6759
8650
  );
6760
- var schemaDailyClueBaseGame = new MongooseSchema21(
8651
+ var schemaDailyClueBaseGame = new MongooseSchema22(
6761
8652
  {
6762
8653
  gameDate: { required: true, type: schemaGameDate },
6763
8654
  gameSolution: { required: true, type: String }
6764
8655
  },
6765
8656
  { _id: false }
6766
8657
  );
6767
- var schemaDailyClueGameData = new MongooseSchema21(
8658
+ var schemaDailyClueGameData = new MongooseSchema22(
6768
8659
  {
6769
8660
  gameFields: { required: true, type: schemaDailyClueBaseGame },
6770
8661
  lastFoundDate: { default: null, required: false, type: Date },
@@ -6779,9 +8670,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
6779
8670
  );
6780
8671
 
6781
8672
  // src/mongoose/game/PuzzleGame.ts
6782
- var import_mongoose22 = __toESM(require("mongoose"));
6783
- var MongooseSchema22 = import_mongoose22.default.Schema;
6784
- var schemaPuzzleAnswer = new MongooseSchema22(
8673
+ var import_mongoose23 = __toESM(require("mongoose"));
8674
+ var MongooseSchema23 = import_mongoose23.default.Schema;
8675
+ var schemaPuzzleAnswer = new MongooseSchema23(
6785
8676
  {
6786
8677
  answer: { required: true, type: String },
6787
8678
  answerId: { required: true, type: String },
@@ -6789,7 +8680,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
6789
8680
  },
6790
8681
  { _id: false }
6791
8682
  );
6792
- var schemaPuzzleQuestion = new MongooseSchema22(
8683
+ var schemaPuzzleQuestion = new MongooseSchema23(
6793
8684
  {
6794
8685
  answers: { required: true, type: [schemaPuzzleAnswer] },
6795
8686
  question: { required: true, type: String },
@@ -6797,20 +8688,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
6797
8688
  },
6798
8689
  { _id: false }
6799
8690
  );
6800
- var schemaPuzzleBaseGame = new MongooseSchema22(
8691
+ var schemaPuzzleBaseGame = new MongooseSchema23(
6801
8692
  {
6802
8693
  questions: { required: true, type: [schemaPuzzleQuestion] }
6803
8694
  },
6804
8695
  { _id: false }
6805
8696
  );
6806
- var schemaPuzzleAnsweredQuestion = new MongooseSchema22(
8697
+ var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
6807
8698
  {
6808
8699
  questionId: { required: true, type: String },
6809
8700
  selectedAnswerId: { required: true, type: String }
6810
8701
  },
6811
8702
  { _id: false }
6812
8703
  );
6813
- var schemaPuzzleGameData = new MongooseSchema22(
8704
+ var schemaPuzzleGameData = new MongooseSchema23(
6814
8705
  {
6815
8706
  answeredQuestions: {
6816
8707
  default: null,
@@ -6825,19 +8716,19 @@ var schemaPuzzleGameData = new MongooseSchema22(
6825
8716
  );
6826
8717
 
6827
8718
  // src/mongoose/game/Game.ts
6828
- var MongooseSchema23 = import_mongoose23.default.Schema;
8719
+ var MongooseSchema24 = import_mongoose24.default.Schema;
6829
8720
  var gameDataSchemas = {
6830
8721
  [EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
6831
8722
  [EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
6832
8723
  [EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
6833
8724
  };
6834
8725
  var gameDataDefinition = Object.fromEntries(
6835
- Object.entries(gameDataSchemas).map(([key, schema19]) => [
8726
+ Object.entries(gameDataSchemas).map(([key, schema20]) => [
6836
8727
  key,
6837
- { default: null, required: false, type: schema19 }
8728
+ { default: null, required: false, type: schema20 }
6838
8729
  ])
6839
8730
  );
6840
- var gameHistorySchema = new MongooseSchema23(
8731
+ var gameHistorySchema = new MongooseSchema24(
6841
8732
  {
6842
8733
  createdAt: { required: true, type: Date },
6843
8734
  gameDate: { required: true, type: schemaGameDate },
@@ -6857,7 +8748,7 @@ var gameHistorySchema = new MongooseSchema23(
6857
8748
  },
6858
8749
  { _id: false }
6859
8750
  );
6860
- var gameTypeSchema = new MongooseSchema23(
8751
+ var gameTypeSchema = new MongooseSchema24(
6861
8752
  {
6862
8753
  active: { default: true, required: true, type: Boolean },
6863
8754
  gameData: gameDataDefinition,
@@ -6872,7 +8763,7 @@ var gameTypeSchema = new MongooseSchema23(
6872
8763
  },
6873
8764
  { timestamps: true }
6874
8765
  );
6875
- var schema15 = new MongooseSchema23(
8766
+ var schema16 = new MongooseSchema24(
6876
8767
  {
6877
8768
  active: { default: false, required: true, type: Boolean },
6878
8769
  deletedAt: { default: null, required: false, type: Date },
@@ -6885,12 +8776,12 @@ var schema15 = new MongooseSchema23(
6885
8776
  },
6886
8777
  { timestamps: true }
6887
8778
  );
6888
- var GameModel = import_mongoose23.default.models.Game || import_mongoose23.default.model("Game", schema15);
8779
+ var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
6889
8780
 
6890
8781
  // src/mongoose/School.ts
6891
- var import_mongoose24 = __toESM(require("mongoose"));
6892
- var MongooseSchema24 = import_mongoose24.default.Schema;
6893
- var campaignsSchema = new MongooseSchema24(
8782
+ var import_mongoose25 = __toESM(require("mongoose"));
8783
+ var MongooseSchema25 = import_mongoose25.default.Schema;
8784
+ var campaignsSchema = new MongooseSchema25(
6894
8785
  {
6895
8786
  endDate: { required: true, type: Date },
6896
8787
  name: { required: true, type: String },
@@ -6898,7 +8789,7 @@ var campaignsSchema = new MongooseSchema24(
6898
8789
  },
6899
8790
  { _id: false }
6900
8791
  );
6901
- var schema16 = new MongooseSchema24(
8792
+ var schema17 = new MongooseSchema25(
6902
8793
  {
6903
8794
  // New schools are active by default
6904
8795
  active: { default: false, required: true, type: Boolean },
@@ -6925,19 +8816,19 @@ var schema16 = new MongooseSchema24(
6925
8816
  },
6926
8817
  { timestamps: true }
6927
8818
  );
6928
- schema16.index(
8819
+ schema17.index(
6929
8820
  { schoolCode: 1 },
6930
8821
  {
6931
8822
  partialFilterExpression: { active: true, deletedAt: null },
6932
8823
  unique: true
6933
8824
  }
6934
8825
  );
6935
- var SchoolModel = import_mongoose24.default.models.School || import_mongoose24.default.model("School", schema16);
8826
+ var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
6936
8827
 
6937
8828
  // src/mongoose/Affiliate.ts
6938
- var import_mongoose25 = __toESM(require("mongoose"));
6939
- var MongooseSchema25 = import_mongoose25.default.Schema;
6940
- var affiliateRewardSchema = new MongooseSchema25(
8829
+ var import_mongoose26 = __toESM(require("mongoose"));
8830
+ var MongooseSchema26 = import_mongoose26.default.Schema;
8831
+ var affiliateRewardSchema = new MongooseSchema26(
6941
8832
  {
6942
8833
  createdAt: { required: true, type: Date },
6943
8834
  redeemedAt: { default: null, required: false, type: Date },
@@ -6951,13 +8842,13 @@ var affiliateRewardSchema = new MongooseSchema25(
6951
8842
  },
6952
8843
  { _id: false }
6953
8844
  );
6954
- var affiliateResourceSchema = new MongooseSchema25(
8845
+ var affiliateResourceSchema = new MongooseSchema26(
6955
8846
  {
6956
8847
  resourceActive: { default: true, required: true, type: Boolean },
6957
8848
  resourceDeletedAt: { default: null, required: false, type: Date },
6958
8849
  resourceId: {
6959
8850
  required: true,
6960
- type: import_mongoose25.default.Schema.Types.ObjectId
8851
+ type: import_mongoose26.default.Schema.Types.ObjectId
6961
8852
  },
6962
8853
  resourceName: { required: true, type: String },
6963
8854
  resourceOwner: {
@@ -6977,20 +8868,20 @@ var affiliateResourceSchema = new MongooseSchema25(
6977
8868
  },
6978
8869
  { _id: false }
6979
8870
  );
6980
- var affiliateContactDetailsSchema = new MongooseSchema25(
8871
+ var affiliateContactDetailsSchema = new MongooseSchema26(
6981
8872
  {
6982
8873
  mobilePhone: { required: true, type: String }
6983
8874
  },
6984
8875
  { _id: false }
6985
8876
  );
6986
- var affiliateBankAccountDetailsSchema = new MongooseSchema25(
8877
+ var affiliateBankAccountDetailsSchema = new MongooseSchema26(
6987
8878
  {
6988
8879
  accountHolderName: { required: true, type: String },
6989
8880
  accountNumber: { required: true, type: String }
6990
8881
  },
6991
8882
  { _id: false }
6992
8883
  );
6993
- var affiliateDetailsSchema = new MongooseSchema25(
8884
+ var affiliateDetailsSchema = new MongooseSchema26(
6994
8885
  {
6995
8886
  bankAccountDetails: {
6996
8887
  required: true,
@@ -7012,7 +8903,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
7012
8903
  },
7013
8904
  { _id: false }
7014
8905
  );
7015
- var redeemHistorySchema = new MongooseSchema25(
8906
+ var redeemHistorySchema = new MongooseSchema26(
7016
8907
  {
7017
8908
  paidAt: { default: null, required: false, type: Date },
7018
8909
  redeemedAt: { required: true, type: Date },
@@ -7020,7 +8911,7 @@ var redeemHistorySchema = new MongooseSchema25(
7020
8911
  },
7021
8912
  { _id: false }
7022
8913
  );
7023
- var schema17 = new MongooseSchema25(
8914
+ var schema18 = new MongooseSchema26(
7024
8915
  {
7025
8916
  active: { default: false, required: true, type: Boolean },
7026
8917
  affiliateBonusRewards: {
@@ -7050,19 +8941,19 @@ var schema17 = new MongooseSchema25(
7050
8941
  },
7051
8942
  { timestamps: true }
7052
8943
  );
7053
- schema17.index(
8944
+ schema18.index(
7054
8945
  { affiliateCode: 1 },
7055
8946
  {
7056
8947
  partialFilterExpression: { active: true, deletedAt: null },
7057
8948
  unique: true
7058
8949
  }
7059
8950
  );
7060
- var AffiliateModel = import_mongoose25.default.models.Affiliate || import_mongoose25.default.model("Affiliate", schema17);
8951
+ var AffiliateModel = import_mongoose26.default.models.Affiliate || import_mongoose26.default.model("Affiliate", schema18);
7061
8952
 
7062
8953
  // src/mongoose/Coupon.ts
7063
- var import_mongoose26 = __toESM(require("mongoose"));
7064
- var MongooseSchema26 = import_mongoose26.default.Schema;
7065
- var couponOptionSchema = new MongooseSchema26(
8954
+ var import_mongoose27 = __toESM(require("mongoose"));
8955
+ var MongooseSchema27 = import_mongoose27.default.Schema;
8956
+ var couponOptionSchema = new MongooseSchema27(
7066
8957
  {
7067
8958
  buy: { required: false, type: Number },
7068
8959
  get: { required: false, type: Number },
@@ -7077,29 +8968,29 @@ var couponOptionSchema = new MongooseSchema26(
7077
8968
  },
7078
8969
  { _id: false }
7079
8970
  );
7080
- var couponVendorProductSchema = new MongooseSchema26(
8971
+ var couponVendorProductSchema = new MongooseSchema27(
7081
8972
  {
7082
8973
  couponId: {
7083
8974
  required: true,
7084
- type: import_mongoose26.default.Schema.Types.ObjectId
8975
+ type: import_mongoose27.default.Schema.Types.ObjectId
7085
8976
  },
7086
8977
  productId: {
7087
8978
  required: true,
7088
- type: import_mongoose26.default.Schema.Types.ObjectId
8979
+ type: import_mongoose27.default.Schema.Types.ObjectId
7089
8980
  },
7090
8981
  vendorCouponId: {
7091
8982
  required: false,
7092
- type: import_mongoose26.default.Schema.Types.ObjectId
8983
+ type: import_mongoose27.default.Schema.Types.ObjectId
7093
8984
  },
7094
8985
  vendorId: {
7095
8986
  ref: "Vendor",
7096
8987
  required: true,
7097
- type: import_mongoose26.default.Schema.Types.ObjectId
8988
+ type: import_mongoose27.default.Schema.Types.ObjectId
7098
8989
  }
7099
8990
  },
7100
8991
  { _id: false }
7101
8992
  );
7102
- var couponCodeSchema = new MongooseSchema26(
8993
+ var couponCodeSchema = new MongooseSchema27(
7103
8994
  {
7104
8995
  code: { required: true, type: String },
7105
8996
  qrCode: { required: true, type: ResourceImageTypeSchema },
@@ -7107,7 +8998,7 @@ var couponCodeSchema = new MongooseSchema26(
7107
8998
  },
7108
8999
  { _id: false }
7109
9000
  );
7110
- var couponParticipantUserSchema = new MongooseSchema26(
9001
+ var couponParticipantUserSchema = new MongooseSchema27(
7111
9002
  {
7112
9003
  couponCollectedCount: { default: 0, required: true, type: Number },
7113
9004
  couponCycleRedeemed: { default: false, required: true, type: Boolean },
@@ -7116,12 +9007,12 @@ var couponParticipantUserSchema = new MongooseSchema26(
7116
9007
  userId: {
7117
9008
  ref: "User",
7118
9009
  required: true,
7119
- type: import_mongoose26.default.Schema.Types.ObjectId
9010
+ type: import_mongoose27.default.Schema.Types.ObjectId
7120
9011
  }
7121
9012
  },
7122
9013
  { timestamps: true }
7123
9014
  );
7124
- var couponDataSchema = new MongooseSchema26(
9015
+ var couponDataSchema = new MongooseSchema27(
7125
9016
  {
7126
9017
  active: { default: true, required: true, type: Boolean },
7127
9018
  couponCode: { required: false, type: couponCodeSchema },
@@ -7148,7 +9039,7 @@ var couponDataSchema = new MongooseSchema26(
7148
9039
  },
7149
9040
  { timestamps: true }
7150
9041
  );
7151
- var schema18 = new MongooseSchema26(
9042
+ var schema19 = new MongooseSchema27(
7152
9043
  {
7153
9044
  active: { default: true, required: true, type: Boolean },
7154
9045
  couponData: { default: [], required: false, type: [couponDataSchema] },
@@ -7160,7 +9051,9 @@ var schema18 = new MongooseSchema26(
7160
9051
  },
7161
9052
  { timestamps: true }
7162
9053
  );
7163
- var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.default.model("Coupon", schema18);
9054
+ schema19.index({ active: 1, deletedAt: 1, "owner.userId": 1 });
9055
+ schema19.index({ "couponData.participantUsers.userId": 1 });
9056
+ var CouponModel = import_mongoose27.default.models.Coupon || import_mongoose27.default.model("Coupon", schema19);
7164
9057
 
7165
9058
  // src/service/promoCode/constants.ts
7166
9059
  var ACTIVE_NOT_DELETED_FILTER = {
@@ -7177,7 +9070,7 @@ async function activeAffiliateCodeExists(affiliateCode) {
7177
9070
  return existing !== null;
7178
9071
  }
7179
9072
 
7180
- // node_modules/@timardex/cluemart-shared/dist/chunk-2UNNIQIK.mjs
9073
+ // node_modules/@timardex/cluemart-shared/dist/chunk-YRO6KEZG.mjs
7181
9074
  var import_dayjs3 = __toESM(require("dayjs"), 1);
7182
9075
  var import_customParseFormat2 = __toESM(require("dayjs/plugin/customParseFormat.js"), 1);
7183
9076
  var import_isSameOrAfter2 = __toESM(require("dayjs/plugin/isSameOrAfter.js"), 1);
@@ -7250,7 +9143,7 @@ var SHARE_RESOURCE_LABEL2 = {
7250
9143
  school: "School"
7251
9144
  };
7252
9145
 
7253
- // node_modules/@timardex/cluemart-shared/dist/chunk-364EX22V.mjs
9146
+ // node_modules/@timardex/cluemart-shared/dist/chunk-JJQL6LZE.mjs
7254
9147
  var PROMO_CODE_PREFIX2 = "CM-";
7255
9148
  var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
7256
9149
  var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
@@ -7362,7 +9255,7 @@ var gameScreenIdentifierList2 = [
7362
9255
  }
7363
9256
  ];
7364
9257
 
7365
- // node_modules/@timardex/cluemart-shared/dist/chunk-RCARDOVS.mjs
9258
+ // node_modules/@timardex/cluemart-shared/dist/chunk-L3SNS6OJ.mjs
7366
9259
  var import_dayjs4 = __toESM(require("dayjs"), 1);
7367
9260
  var statusOptions2 = [
7368
9261
  ...Object.values(EnumInviteStatus2).map((status) => ({
@@ -8799,7 +10692,7 @@ function normalizeAffiliatePromoCodes(promoCodes) {
8799
10692
  }
8800
10693
 
8801
10694
  // src/service/database.ts
8802
- var import_mongoose30 = __toESM(require("mongoose"));
10695
+ var import_mongoose31 = __toESM(require("mongoose"));
8803
10696
  var connectToDatabase = async ({
8804
10697
  appName,
8805
10698
  dbName,
@@ -8812,7 +10705,7 @@ var connectToDatabase = async ({
8812
10705
  // Fallback to MongoDB Atlas connection string
8813
10706
  `mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
8814
10707
  );
8815
- await import_mongoose30.default.connect(mongoUri);
10708
+ await import_mongoose31.default.connect(mongoUri);
8816
10709
  const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
8817
10710
  console.log(
8818
10711
  `${connectionType} connected from server/src/service/database.ts`
@@ -8825,7 +10718,7 @@ var connectToDatabase = async ({
8825
10718
 
8826
10719
  // src/types/index.ts
8827
10720
  var import_express = __toESM(require("express"));
8828
- var import_mongoose31 = __toESM(require("mongoose"));
10721
+ var import_mongoose32 = __toESM(require("mongoose"));
8829
10722
  var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
8830
10723
  EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
8831
10724
  EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
@@ -8915,15 +10808,15 @@ async function updateAdStatuses() {
8915
10808
  }
8916
10809
 
8917
10810
  // src/service/objectIdToString.ts
8918
- var import_mongoose33 = __toESM(require("mongoose"));
10811
+ var import_mongoose34 = __toESM(require("mongoose"));
8919
10812
  function isValidObjectId(value) {
8920
- return import_mongoose33.default.Types.ObjectId.isValid(value);
10813
+ return import_mongoose34.default.Types.ObjectId.isValid(value);
8921
10814
  }
8922
10815
  function convertObjectIdsToStrings(obj) {
8923
10816
  if (obj === null || obj === void 0) {
8924
10817
  return obj;
8925
10818
  }
8926
- if (obj instanceof import_mongoose33.default.Types.ObjectId) {
10819
+ if (obj instanceof import_mongoose34.default.Types.ObjectId) {
8927
10820
  return obj.toString();
8928
10821
  }
8929
10822
  if (obj instanceof Date) {
@@ -9478,20 +11371,24 @@ var buildLicenceReplacePipeline = ({
9478
11371
  async function replaceUserLicenceWithObject({
9479
11372
  userId,
9480
11373
  licenceObject,
9481
- protectHigherLicence = true
11374
+ protectHigherLicence = true,
11375
+ refreshExistingLicence = false
9482
11376
  }) {
9483
11377
  const user = await UserModel.findById(userId, { licences: 1 }).lean();
9484
11378
  if (!user) throw new import_graphql3.GraphQLError("User not found");
9485
- if (user.licences?.some((l) => l.licenceType === licenceObject.licenceType)) {
11379
+ const existingLicence = user.licences?.find(
11380
+ (licence) => licence.licenceType === licenceObject.licenceType
11381
+ );
11382
+ if (existingLicence && !refreshExistingLicence) {
9486
11383
  return;
9487
11384
  }
11385
+ const category = getLicenceCategory(licenceObject.licenceType);
9488
11386
  const updatedLicenceObject = {
9489
11387
  ...licenceObject,
9490
- prevLicenceType: user.licences?.find(
9491
- (l) => getLicenceCategory(l.licenceType) === getLicenceCategory(licenceObject.licenceType)
11388
+ prevLicenceType: existingLicence && refreshExistingLicence ? existingLicence.prevLicenceType : user.licences?.find(
11389
+ (licence) => licence.licenceType && getLicenceCategory(licence.licenceType) === category
9492
11390
  )?.licenceType
9493
11391
  };
9494
- const category = getLicenceCategory(updatedLicenceObject.licenceType);
9495
11392
  if (protectHigherLicence) {
9496
11393
  const highestLicence = getHighestLicenceForCategory(
9497
11394
  user.licences,
@@ -9605,6 +11502,17 @@ var vendorLicences = [
9605
11502
  EnumUserLicence.PRO_VENDOR,
9606
11503
  EnumUserLicence.PRO_PLUS_VENDOR
9607
11504
  ];
11505
+ function isProtectedByCurrentStripeSubscription(user, licenceType, now) {
11506
+ const stripe = user.stripe;
11507
+ if (!stripe?.subscriptionId || stripe.currentPlan !== licenceType || stripe.status !== EnumSubscriptionStatus.ACTIVE && stripe.status !== EnumSubscriptionStatus.TRIALING) {
11508
+ return false;
11509
+ }
11510
+ if (stripe.cancelAtPeriodEnd !== true || !stripe.endDate) {
11511
+ return true;
11512
+ }
11513
+ const paidThrough = (0, import_dayjs8.default)(stripe.endDate);
11514
+ return !paidThrough.isValid() || paidThrough.isAfter(now);
11515
+ }
9608
11516
  async function handleVendorLicenceCompliance(user, now) {
9609
11517
  if (!user.licences || !user.vendor) {
9610
11518
  return;
@@ -9618,12 +11526,20 @@ async function handleVendorLicenceCompliance(user, now) {
9618
11526
  const proLicences = vendorLicencesOfUser.filter(
9619
11527
  (licence) => licence.licenceType !== EnumUserLicence.STANDARD_VENDOR
9620
11528
  );
9621
- const expiredProLicence = proLicences.some(
11529
+ const expiredProLicences = proLicences.filter(
9622
11530
  (licence) => !(0, import_dayjs8.default)(licence.expiryDate).isAfter(now)
9623
11531
  );
9624
- const hasValidProLicence = hasValidLicence(proLicences, vendorLicences, now);
11532
+ const stripeProtectedLicenceTypes = new Set(
11533
+ expiredProLicences.filter(
11534
+ (licence) => isProtectedByCurrentStripeSubscription(user, licence.licenceType, now)
11535
+ ).map((licence) => licence.licenceType)
11536
+ );
11537
+ const expiredProLicence = expiredProLicences.some(
11538
+ (licence) => !stripeProtectedLicenceTypes.has(licence.licenceType)
11539
+ );
11540
+ const hasValidProLicence = stripeProtectedLicenceTypes.size > 0 || hasValidLicence(proLicences, vendorLicences, now);
9625
11541
  const hasExpiredVendorLicence = vendorLicencesOfUser.some(
9626
- (licence) => !(0, import_dayjs8.default)(licence.expiryDate).isAfter(now)
11542
+ (licence) => !(0, import_dayjs8.default)(licence.expiryDate).isAfter(now) && !stripeProtectedLicenceTypes.has(licence.licenceType)
9627
11543
  );
9628
11544
  if (!hasExpiredVendorLicence) {
9629
11545
  return;
@@ -9637,7 +11553,10 @@ async function handleVendorLicenceCompliance(user, now) {
9637
11553
  "owner.userId": user._id
9638
11554
  }).lean().exec();
9639
11555
  }
9640
- await syncUserLicencesAfterExpiry(user._id, vendorLicences, now, "downgrade");
11556
+ const licencesToSync = vendorLicences.filter(
11557
+ (licenceType) => !stripeProtectedLicenceTypes.has(licenceType)
11558
+ );
11559
+ await syncUserLicencesAfterExpiry(user._id, licencesToSync, now, "downgrade");
9641
11560
  if (!expiredProLicence || !vendor || hasValidProLicence) {
9642
11561
  return;
9643
11562
  }
@@ -9726,6 +11645,13 @@ async function processUserCompliance(user, now) {
9726
11645
  }
9727
11646
 
9728
11647
  // src/service/license/compliance/ensureUserLicenseCompliance.ts
11648
+ async function ensureUserLicenseComplianceForUser(userId, now = (0, import_dayjs10.default)()) {
11649
+ const user = await UserModel.findById(userId);
11650
+ if (!user) {
11651
+ return;
11652
+ }
11653
+ await processUserCompliance(user, now);
11654
+ }
9729
11655
  async function ensureUserLicenseCompliance() {
9730
11656
  const now = (0, import_dayjs10.default)();
9731
11657
  console.log(`\u{1F50D} Checking license compliance at ${now.format()}`);
@@ -9977,7 +11903,7 @@ async function sendLicenseReminder(user, licence) {
9977
11903
  await sendPushNotifications(payload);
9978
11904
  console.log(`\u2705 Sent 7-day reminder to user ${userId} for ${licenceName}`);
9979
11905
  }
9980
- async function processLicenseReminder(user, licence, now) {
11906
+ async function processLicenseReminder(licence, now) {
9981
11907
  if ((0, import_dayjs11.default)(licence.expiryDate).isBefore(now)) {
9982
11908
  return false;
9983
11909
  }
@@ -10009,7 +11935,7 @@ async function processUserLicenseReminders(user, now) {
10009
11935
  const licenceChecks = await Promise.all(
10010
11936
  validLicences.map(async (licence) => {
10011
11937
  try {
10012
- const shouldSend = await processLicenseReminder(user, licence, now);
11938
+ const shouldSend = await processLicenseReminder(licence, now);
10013
11939
  return { licence, shouldSend };
10014
11940
  } catch (err) {
10015
11941
  console.error(
@@ -10076,6 +12002,8 @@ async function remindUsersAboutLicenseExpiration() {
10076
12002
  AdModel,
10077
12003
  AffiliateModel,
10078
12004
  AppSettingModel,
12005
+ BILLING_CATALOG_COLLECTION_NAME,
12006
+ BillingCatalogModel,
10079
12007
  CategorySchema,
10080
12008
  ChatModel,
10081
12009
  ChatReportModel,
@@ -10111,6 +12039,7 @@ async function remindUsersAboutLicenseExpiration() {
10111
12039
  activeAffiliateCodeExists,
10112
12040
  awardAffiliateVendorSubscriptionRewards,
10113
12041
  baseResourceFields,
12042
+ buildInitialBillingCatalogEntries,
10114
12043
  buildLicenceExpiryPipeline,
10115
12044
  checkOwnerHasLicence,
10116
12045
  connectToDatabase,
@@ -10119,10 +12048,12 @@ async function remindUsersAboutLicenseExpiration() {
10119
12048
  dateTimeSchema,
10120
12049
  didRemoveAnyEventDates,
10121
12050
  ensureUserLicenseCompliance,
12051
+ ensureUserLicenseComplianceForUser,
10122
12052
  eventLicences,
10123
12053
  express,
10124
12054
  findAffiliateByPromoCode,
10125
12055
  findEventOrImportedMarketById,
12056
+ getBillingCatalogDefinition,
10126
12057
  getEventResourceInfo,
10127
12058
  getHighestLicenceForCategory,
10128
12059
  getLicenceCategory,
@@ -10178,4 +12109,28 @@ async function remindUsersAboutLicenseExpiration() {
10178
12109
  vendorOwnerHasProLicence,
10179
12110
  vendorProductTypeSchema
10180
12111
  });
12112
+ /*! Bundled license information:
12113
+
12114
+ react/cjs/react.production.js:
12115
+ (**
12116
+ * @license React
12117
+ * react.production.js
12118
+ *
12119
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
12120
+ *
12121
+ * This source code is licensed under the MIT license found in the
12122
+ * LICENSE file in the root directory of this source tree.
12123
+ *)
12124
+
12125
+ react/cjs/react.development.js:
12126
+ (**
12127
+ * @license React
12128
+ * react.development.js
12129
+ *
12130
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
12131
+ *
12132
+ * This source code is licensed under the MIT license found in the
12133
+ * LICENSE file in the root directory of this source tree.
12134
+ *)
12135
+ */
10181
12136
  //# sourceMappingURL=index.cjs.map