docs-i18n 0.7.4 → 0.7.5
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/admin/dist/server/assets/chunk-CNvmzFzq.js +35 -0
- package/admin/dist/server/assets/{init-AJSQ7K_l.js → init-DJr2glb3.js} +5 -38
- package/admin/dist/server/assets/{jobs-CwDb0Zyp.js → jobs-FXffC7LH.js} +2 -2
- package/admin/dist/server/assets/{misc-CqYhnW23.js → misc-y6t3-UOP.js} +3 -3
- package/admin/dist/server/assets/{models-D9Sd95EX.js → models-YNa3F3nn.js} +1 -1
- package/admin/dist/server/assets/react-dom-BryASgrS.js +2159 -0
- package/admin/dist/server/assets/redirect-BHRifpCK.js +51 -0
- package/admin/dist/server/assets/router-CAX08MEI.js +897 -0
- package/admin/dist/server/assets/routes-Bk6XCM2I.js +2139 -0
- package/admin/dist/server/assets/routes-CMOVc2RM.js +2132 -0
- package/admin/dist/server/assets/{status-D48jcwYI.js → status-CM7Azp4n.js} +2 -2
- package/admin/dist/server/server.js +15789 -4447
- package/admin/vite.config.ts +13 -0
- package/package.json +1 -1
- package/admin/dist/server/assets/router-D00bP5CU.js +0 -67
- package/admin/dist/server/assets/routes-C2UFxDWZ.js +0 -24
- package/admin/dist/server/assets/routes-vEKXnl0r.js +0 -1574
- /package/admin/dist/server/assets/{_tanstack-start-manifest_v-sC90W3ET.js → _tanstack-start-manifest_v-mK4S3Lga.js} +0 -0
- /package/admin/dist/server/assets/{createServerRpc-CMjjCE8A.js → createServerRpc-C3JHS5ky.js} +0 -0
- /package/admin/dist/server/assets/{start-BrsoKfWS.js → start-3avuCbOL.js} +0 -0
|
@@ -0,0 +1,2159 @@
|
|
|
1
|
+
import { i as __toESM, t as __commonJSMin } from "./chunk-CNvmzFzq.js";
|
|
2
|
+
//#region ../../node_modules/.bun/react@19.2.4/node_modules/react/cjs/react.production.js
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react.production.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var require_react_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
14
|
+
function getIteratorFn(maybeIterable) {
|
|
15
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
16
|
+
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
17
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
18
|
+
}
|
|
19
|
+
var ReactNoopUpdateQueue = {
|
|
20
|
+
isMounted: function() {
|
|
21
|
+
return !1;
|
|
22
|
+
},
|
|
23
|
+
enqueueForceUpdate: function() {},
|
|
24
|
+
enqueueReplaceState: function() {},
|
|
25
|
+
enqueueSetState: function() {}
|
|
26
|
+
}, assign = Object.assign, emptyObject = {};
|
|
27
|
+
function Component(props, context, updater) {
|
|
28
|
+
this.props = props;
|
|
29
|
+
this.context = context;
|
|
30
|
+
this.refs = emptyObject;
|
|
31
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
32
|
+
}
|
|
33
|
+
Component.prototype.isReactComponent = {};
|
|
34
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
35
|
+
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState) throw Error("takes an object of state variables to update or a function which returns an object of state variables.");
|
|
36
|
+
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
37
|
+
};
|
|
38
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
39
|
+
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
40
|
+
};
|
|
41
|
+
function ComponentDummy() {}
|
|
42
|
+
ComponentDummy.prototype = Component.prototype;
|
|
43
|
+
function PureComponent(props, context, updater) {
|
|
44
|
+
this.props = props;
|
|
45
|
+
this.context = context;
|
|
46
|
+
this.refs = emptyObject;
|
|
47
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
48
|
+
}
|
|
49
|
+
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
50
|
+
pureComponentPrototype.constructor = PureComponent;
|
|
51
|
+
assign(pureComponentPrototype, Component.prototype);
|
|
52
|
+
pureComponentPrototype.isPureReactComponent = !0;
|
|
53
|
+
var isArrayImpl = Array.isArray;
|
|
54
|
+
function noop() {}
|
|
55
|
+
var ReactSharedInternals = {
|
|
56
|
+
H: null,
|
|
57
|
+
A: null,
|
|
58
|
+
T: null,
|
|
59
|
+
S: null
|
|
60
|
+
}, hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
61
|
+
function ReactElement(type, key, props) {
|
|
62
|
+
var refProp = props.ref;
|
|
63
|
+
return {
|
|
64
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
65
|
+
type,
|
|
66
|
+
key,
|
|
67
|
+
ref: void 0 !== refProp ? refProp : null,
|
|
68
|
+
props
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
72
|
+
return ReactElement(oldElement.type, newKey, oldElement.props);
|
|
73
|
+
}
|
|
74
|
+
function isValidElement(object) {
|
|
75
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
76
|
+
}
|
|
77
|
+
function escape(key) {
|
|
78
|
+
var escaperLookup = {
|
|
79
|
+
"=": "=0",
|
|
80
|
+
":": "=2"
|
|
81
|
+
};
|
|
82
|
+
return "$" + key.replace(/[=:]/g, function(match) {
|
|
83
|
+
return escaperLookup[match];
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
87
|
+
function getElementKey(element, index) {
|
|
88
|
+
return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
|
|
89
|
+
}
|
|
90
|
+
function resolveThenable(thenable) {
|
|
91
|
+
switch (thenable.status) {
|
|
92
|
+
case "fulfilled": return thenable.value;
|
|
93
|
+
case "rejected": throw thenable.reason;
|
|
94
|
+
default: switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(function(fulfilledValue) {
|
|
95
|
+
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
|
96
|
+
}, function(error) {
|
|
97
|
+
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
98
|
+
})), thenable.status) {
|
|
99
|
+
case "fulfilled": return thenable.value;
|
|
100
|
+
case "rejected": throw thenable.reason;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
throw thenable;
|
|
104
|
+
}
|
|
105
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
106
|
+
var type = typeof children;
|
|
107
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
|
108
|
+
var invokeCallback = !1;
|
|
109
|
+
if (null === children) invokeCallback = !0;
|
|
110
|
+
else switch (type) {
|
|
111
|
+
case "bigint":
|
|
112
|
+
case "string":
|
|
113
|
+
case "number":
|
|
114
|
+
invokeCallback = !0;
|
|
115
|
+
break;
|
|
116
|
+
case "object": switch (children.$$typeof) {
|
|
117
|
+
case REACT_ELEMENT_TYPE:
|
|
118
|
+
case REACT_PORTAL_TYPE:
|
|
119
|
+
invokeCallback = !0;
|
|
120
|
+
break;
|
|
121
|
+
case REACT_LAZY_TYPE: return invokeCallback = children._init, mapIntoArray(invokeCallback(children._payload), array, escapedPrefix, nameSoFar, callback);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (invokeCallback) 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) {
|
|
125
|
+
return c;
|
|
126
|
+
})) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(callback, escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(userProvidedKeyEscapeRegex, "$&/") + "/") + invokeCallback)), array.push(callback)), 1;
|
|
127
|
+
invokeCallback = 0;
|
|
128
|
+
var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
|
|
129
|
+
if (isArrayImpl(children)) for (var i = 0; i < children.length; i++) nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(nameSoFar, array, escapedPrefix, type, callback);
|
|
130
|
+
else if (i = getIteratorFn(children), "function" === typeof i) for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done;) nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(nameSoFar, array, escapedPrefix, type, callback);
|
|
131
|
+
else if ("object" === type) {
|
|
132
|
+
if ("function" === typeof children.then) return mapIntoArray(resolveThenable(children), array, escapedPrefix, nameSoFar, callback);
|
|
133
|
+
array = String(children);
|
|
134
|
+
throw Error("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.");
|
|
135
|
+
}
|
|
136
|
+
return invokeCallback;
|
|
137
|
+
}
|
|
138
|
+
function mapChildren(children, func, context) {
|
|
139
|
+
if (null == children) return children;
|
|
140
|
+
var result = [], count = 0;
|
|
141
|
+
mapIntoArray(children, result, "", "", function(child) {
|
|
142
|
+
return func.call(context, child, count++);
|
|
143
|
+
});
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
function lazyInitializer(payload) {
|
|
147
|
+
if (-1 === payload._status) {
|
|
148
|
+
var ctor = payload._result;
|
|
149
|
+
ctor = ctor();
|
|
150
|
+
ctor.then(function(moduleObject) {
|
|
151
|
+
if (0 === payload._status || -1 === payload._status) payload._status = 1, payload._result = moduleObject;
|
|
152
|
+
}, function(error) {
|
|
153
|
+
if (0 === payload._status || -1 === payload._status) payload._status = 2, payload._result = error;
|
|
154
|
+
});
|
|
155
|
+
-1 === payload._status && (payload._status = 0, payload._result = ctor);
|
|
156
|
+
}
|
|
157
|
+
if (1 === payload._status) return payload._result.default;
|
|
158
|
+
throw payload._result;
|
|
159
|
+
}
|
|
160
|
+
var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
|
161
|
+
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
|
162
|
+
var event = new window.ErrorEvent("error", {
|
|
163
|
+
bubbles: !0,
|
|
164
|
+
cancelable: !0,
|
|
165
|
+
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
|
166
|
+
error
|
|
167
|
+
});
|
|
168
|
+
if (!window.dispatchEvent(event)) return;
|
|
169
|
+
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
|
170
|
+
process.emit("uncaughtException", error);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
console.error(error);
|
|
174
|
+
}, Children = {
|
|
175
|
+
map: mapChildren,
|
|
176
|
+
forEach: function(children, forEachFunc, forEachContext) {
|
|
177
|
+
mapChildren(children, function() {
|
|
178
|
+
forEachFunc.apply(this, arguments);
|
|
179
|
+
}, forEachContext);
|
|
180
|
+
},
|
|
181
|
+
count: function(children) {
|
|
182
|
+
var n = 0;
|
|
183
|
+
mapChildren(children, function() {
|
|
184
|
+
n++;
|
|
185
|
+
});
|
|
186
|
+
return n;
|
|
187
|
+
},
|
|
188
|
+
toArray: function(children) {
|
|
189
|
+
return mapChildren(children, function(child) {
|
|
190
|
+
return child;
|
|
191
|
+
}) || [];
|
|
192
|
+
},
|
|
193
|
+
only: function(children) {
|
|
194
|
+
if (!isValidElement(children)) throw Error("React.Children.only expected to receive a single React element child.");
|
|
195
|
+
return children;
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
exports.Activity = REACT_ACTIVITY_TYPE;
|
|
199
|
+
exports.Children = Children;
|
|
200
|
+
exports.Component = Component;
|
|
201
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
202
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
203
|
+
exports.PureComponent = PureComponent;
|
|
204
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
205
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
206
|
+
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
207
|
+
exports.__COMPILER_RUNTIME = {
|
|
208
|
+
__proto__: null,
|
|
209
|
+
c: function(size) {
|
|
210
|
+
return ReactSharedInternals.H.useMemoCache(size);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
exports.cache = function(fn) {
|
|
214
|
+
return function() {
|
|
215
|
+
return fn.apply(null, arguments);
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
exports.cacheSignal = function() {
|
|
219
|
+
return null;
|
|
220
|
+
};
|
|
221
|
+
exports.cloneElement = function(element, config, children) {
|
|
222
|
+
if (null === element || void 0 === element) throw Error("The argument must be a React element, but you passed " + element + ".");
|
|
223
|
+
var props = assign({}, element.props), key = element.key;
|
|
224
|
+
if (null != config) for (propName in void 0 !== config.key && (key = "" + config.key), config) !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
|
225
|
+
var propName = arguments.length - 2;
|
|
226
|
+
if (1 === propName) props.children = children;
|
|
227
|
+
else if (1 < propName) {
|
|
228
|
+
for (var childArray = Array(propName), i = 0; i < propName; i++) childArray[i] = arguments[i + 2];
|
|
229
|
+
props.children = childArray;
|
|
230
|
+
}
|
|
231
|
+
return ReactElement(element.type, key, props);
|
|
232
|
+
};
|
|
233
|
+
exports.createContext = function(defaultValue) {
|
|
234
|
+
defaultValue = {
|
|
235
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
236
|
+
_currentValue: defaultValue,
|
|
237
|
+
_currentValue2: defaultValue,
|
|
238
|
+
_threadCount: 0,
|
|
239
|
+
Provider: null,
|
|
240
|
+
Consumer: null
|
|
241
|
+
};
|
|
242
|
+
defaultValue.Provider = defaultValue;
|
|
243
|
+
defaultValue.Consumer = {
|
|
244
|
+
$$typeof: REACT_CONSUMER_TYPE,
|
|
245
|
+
_context: defaultValue
|
|
246
|
+
};
|
|
247
|
+
return defaultValue;
|
|
248
|
+
};
|
|
249
|
+
exports.createElement = function(type, config, children) {
|
|
250
|
+
var propName, props = {}, key = null;
|
|
251
|
+
if (null != config) for (propName in void 0 !== config.key && (key = "" + config.key), config) hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
|
|
252
|
+
var childrenLength = arguments.length - 2;
|
|
253
|
+
if (1 === childrenLength) props.children = children;
|
|
254
|
+
else if (1 < childrenLength) {
|
|
255
|
+
for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++) childArray[i] = arguments[i + 2];
|
|
256
|
+
props.children = childArray;
|
|
257
|
+
}
|
|
258
|
+
if (type && type.defaultProps) for (propName in childrenLength = type.defaultProps, childrenLength) void 0 === props[propName] && (props[propName] = childrenLength[propName]);
|
|
259
|
+
return ReactElement(type, key, props);
|
|
260
|
+
};
|
|
261
|
+
exports.createRef = function() {
|
|
262
|
+
return { current: null };
|
|
263
|
+
};
|
|
264
|
+
exports.forwardRef = function(render) {
|
|
265
|
+
return {
|
|
266
|
+
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
267
|
+
render
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
exports.isValidElement = isValidElement;
|
|
271
|
+
exports.lazy = function(ctor) {
|
|
272
|
+
return {
|
|
273
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
274
|
+
_payload: {
|
|
275
|
+
_status: -1,
|
|
276
|
+
_result: ctor
|
|
277
|
+
},
|
|
278
|
+
_init: lazyInitializer
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
exports.memo = function(type, compare) {
|
|
282
|
+
return {
|
|
283
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
284
|
+
type,
|
|
285
|
+
compare: void 0 === compare ? null : compare
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
exports.startTransition = function(scope) {
|
|
289
|
+
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
290
|
+
ReactSharedInternals.T = currentTransition;
|
|
291
|
+
try {
|
|
292
|
+
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
293
|
+
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
|
294
|
+
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
|
|
295
|
+
} catch (error) {
|
|
296
|
+
reportGlobalError(error);
|
|
297
|
+
} finally {
|
|
298
|
+
null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
exports.unstable_useCacheRefresh = function() {
|
|
302
|
+
return ReactSharedInternals.H.useCacheRefresh();
|
|
303
|
+
};
|
|
304
|
+
exports.use = function(usable) {
|
|
305
|
+
return ReactSharedInternals.H.use(usable);
|
|
306
|
+
};
|
|
307
|
+
exports.useActionState = function(action, initialState, permalink) {
|
|
308
|
+
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
|
|
309
|
+
};
|
|
310
|
+
exports.useCallback = function(callback, deps) {
|
|
311
|
+
return ReactSharedInternals.H.useCallback(callback, deps);
|
|
312
|
+
};
|
|
313
|
+
exports.useContext = function(Context) {
|
|
314
|
+
return ReactSharedInternals.H.useContext(Context);
|
|
315
|
+
};
|
|
316
|
+
exports.useDebugValue = function() {};
|
|
317
|
+
exports.useDeferredValue = function(value, initialValue) {
|
|
318
|
+
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
|
|
319
|
+
};
|
|
320
|
+
exports.useEffect = function(create, deps) {
|
|
321
|
+
return ReactSharedInternals.H.useEffect(create, deps);
|
|
322
|
+
};
|
|
323
|
+
exports.useEffectEvent = function(callback) {
|
|
324
|
+
return ReactSharedInternals.H.useEffectEvent(callback);
|
|
325
|
+
};
|
|
326
|
+
exports.useId = function() {
|
|
327
|
+
return ReactSharedInternals.H.useId();
|
|
328
|
+
};
|
|
329
|
+
exports.useImperativeHandle = function(ref, create, deps) {
|
|
330
|
+
return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
|
|
331
|
+
};
|
|
332
|
+
exports.useInsertionEffect = function(create, deps) {
|
|
333
|
+
return ReactSharedInternals.H.useInsertionEffect(create, deps);
|
|
334
|
+
};
|
|
335
|
+
exports.useLayoutEffect = function(create, deps) {
|
|
336
|
+
return ReactSharedInternals.H.useLayoutEffect(create, deps);
|
|
337
|
+
};
|
|
338
|
+
exports.useMemo = function(create, deps) {
|
|
339
|
+
return ReactSharedInternals.H.useMemo(create, deps);
|
|
340
|
+
};
|
|
341
|
+
exports.useOptimistic = function(passthrough, reducer) {
|
|
342
|
+
return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
|
|
343
|
+
};
|
|
344
|
+
exports.useReducer = function(reducer, initialArg, init) {
|
|
345
|
+
return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
|
|
346
|
+
};
|
|
347
|
+
exports.useRef = function(initialValue) {
|
|
348
|
+
return ReactSharedInternals.H.useRef(initialValue);
|
|
349
|
+
};
|
|
350
|
+
exports.useState = function(initialState) {
|
|
351
|
+
return ReactSharedInternals.H.useState(initialState);
|
|
352
|
+
};
|
|
353
|
+
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
|
354
|
+
return ReactSharedInternals.H.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
355
|
+
};
|
|
356
|
+
exports.useTransition = function() {
|
|
357
|
+
return ReactSharedInternals.H.useTransition();
|
|
358
|
+
};
|
|
359
|
+
exports.version = "19.2.4";
|
|
360
|
+
}));
|
|
361
|
+
//#endregion
|
|
362
|
+
//#region ../../node_modules/.bun/react@19.2.4/node_modules/react/index.js
|
|
363
|
+
var require_react = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
364
|
+
module.exports = require_react_production();
|
|
365
|
+
}));
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/utils.js
|
|
368
|
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
369
|
+
/**
|
|
370
|
+
* React.use if available (React 19+), undefined otherwise.
|
|
371
|
+
* Use dynamic lookup to avoid Webpack compilation errors with React 18.
|
|
372
|
+
*/
|
|
373
|
+
var reactUse = import_react.use;
|
|
374
|
+
var useLayoutEffect = typeof window !== "undefined" ? import_react.useLayoutEffect : import_react.useEffect;
|
|
375
|
+
/**
|
|
376
|
+
* Taken from https://www.developerway.com/posts/implementing-advanced-use-previous-hook#part3
|
|
377
|
+
*/
|
|
378
|
+
function usePrevious(value) {
|
|
379
|
+
const ref = import_react.useRef({
|
|
380
|
+
value,
|
|
381
|
+
prev: null
|
|
382
|
+
});
|
|
383
|
+
const current = ref.current.value;
|
|
384
|
+
if (value !== current) ref.current = {
|
|
385
|
+
value,
|
|
386
|
+
prev: current
|
|
387
|
+
};
|
|
388
|
+
return ref.current.prev;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* React hook to wrap `IntersectionObserver`.
|
|
392
|
+
*
|
|
393
|
+
* This hook will create an `IntersectionObserver` and observe the ref passed to it.
|
|
394
|
+
*
|
|
395
|
+
* When the intersection changes, the callback will be called with the `IntersectionObserverEntry`.
|
|
396
|
+
*
|
|
397
|
+
* @param ref - The ref to observe
|
|
398
|
+
* @param intersectionObserverOptions - The options to pass to the IntersectionObserver
|
|
399
|
+
* @param options - The options to pass to the hook
|
|
400
|
+
* @param callback - The callback to call when the intersection changes
|
|
401
|
+
* @returns The IntersectionObserver instance
|
|
402
|
+
* @example
|
|
403
|
+
* ```tsx
|
|
404
|
+
* const MyComponent = () => {
|
|
405
|
+
* const ref = React.useRef<HTMLDivElement>(null)
|
|
406
|
+
* useIntersectionObserver(
|
|
407
|
+
* ref,
|
|
408
|
+
* (entry) => { doSomething(entry) },
|
|
409
|
+
* { rootMargin: '10px' },
|
|
410
|
+
* { disabled: false }
|
|
411
|
+
* )
|
|
412
|
+
* return <div ref={ref} />
|
|
413
|
+
* ```
|
|
414
|
+
*/
|
|
415
|
+
function useIntersectionObserver(ref, callback, intersectionObserverOptions = {}, options = {}) {
|
|
416
|
+
import_react.useEffect(() => {
|
|
417
|
+
if (!ref.current || options.disabled || typeof IntersectionObserver !== "function") return;
|
|
418
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
419
|
+
callback(entry);
|
|
420
|
+
}, intersectionObserverOptions);
|
|
421
|
+
observer.observe(ref.current);
|
|
422
|
+
return () => {
|
|
423
|
+
observer.disconnect();
|
|
424
|
+
};
|
|
425
|
+
}, [
|
|
426
|
+
callback,
|
|
427
|
+
intersectionObserverOptions,
|
|
428
|
+
options.disabled,
|
|
429
|
+
ref
|
|
430
|
+
]);
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* React hook to take a `React.ForwardedRef` and returns a `ref` that can be used on a DOM element.
|
|
434
|
+
*
|
|
435
|
+
* @param ref - The forwarded ref
|
|
436
|
+
* @returns The inner ref returned by `useRef`
|
|
437
|
+
* @example
|
|
438
|
+
* ```tsx
|
|
439
|
+
* const MyComponent = React.forwardRef((props, ref) => {
|
|
440
|
+
* const innerRef = useForwardedRef(ref)
|
|
441
|
+
* return <div ref={innerRef} />
|
|
442
|
+
* })
|
|
443
|
+
* ```
|
|
444
|
+
*/
|
|
445
|
+
function useForwardedRef(ref) {
|
|
446
|
+
const innerRef = import_react.useRef(null);
|
|
447
|
+
import_react.useImperativeHandle(ref, () => innerRef.current, []);
|
|
448
|
+
return innerRef;
|
|
449
|
+
}
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region ../../node_modules/.bun/@tanstack+router-core@1.168.2/node_modules/@tanstack/router-core/dist/esm/utils.js
|
|
452
|
+
/**
|
|
453
|
+
* Return the last element of an array.
|
|
454
|
+
* Intended for non-empty arrays used within router internals.
|
|
455
|
+
*/
|
|
456
|
+
function last(arr) {
|
|
457
|
+
return arr[arr.length - 1];
|
|
458
|
+
}
|
|
459
|
+
function isFunction(d) {
|
|
460
|
+
return typeof d === "function";
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Apply a value-or-updater to a previous value.
|
|
464
|
+
* Accepts either a literal value or a function of the previous value.
|
|
465
|
+
*/
|
|
466
|
+
function functionalUpdate(updater, previous) {
|
|
467
|
+
if (isFunction(updater)) return updater(previous);
|
|
468
|
+
return updater;
|
|
469
|
+
}
|
|
470
|
+
var createNull = () => Object.create(null);
|
|
471
|
+
var nullReplaceEqualDeep = (prev, next) => replaceEqualDeep(prev, next, createNull);
|
|
472
|
+
/**
|
|
473
|
+
* This function returns `prev` if `_next` is deeply equal.
|
|
474
|
+
* If not, it will replace any deeply equal children of `b` with those of `a`.
|
|
475
|
+
* This can be used for structural sharing between immutable JSON values for example.
|
|
476
|
+
* Do not use this with signals
|
|
477
|
+
*/
|
|
478
|
+
function replaceEqualDeep(prev, _next, _makeObj = () => ({}), _depth = 0) {
|
|
479
|
+
return _next;
|
|
480
|
+
}
|
|
481
|
+
function isPlainObject(o) {
|
|
482
|
+
if (!hasObjectPrototype(o)) return false;
|
|
483
|
+
const ctor = o.constructor;
|
|
484
|
+
if (typeof ctor === "undefined") return true;
|
|
485
|
+
const prot = ctor.prototype;
|
|
486
|
+
if (!hasObjectPrototype(prot)) return false;
|
|
487
|
+
if (!prot.hasOwnProperty("isPrototypeOf")) return false;
|
|
488
|
+
return true;
|
|
489
|
+
}
|
|
490
|
+
function hasObjectPrototype(o) {
|
|
491
|
+
return Object.prototype.toString.call(o) === "[object Object]";
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Perform a deep equality check with options for partial comparison and
|
|
495
|
+
* ignoring `undefined` values. Optimized for router state comparisons.
|
|
496
|
+
*/
|
|
497
|
+
function deepEqual(a, b, opts) {
|
|
498
|
+
if (a === b) return true;
|
|
499
|
+
if (typeof a !== typeof b) return false;
|
|
500
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
501
|
+
if (a.length !== b.length) return false;
|
|
502
|
+
for (let i = 0, l = a.length; i < l; i++) if (!deepEqual(a[i], b[i], opts)) return false;
|
|
503
|
+
return true;
|
|
504
|
+
}
|
|
505
|
+
if (isPlainObject(a) && isPlainObject(b)) {
|
|
506
|
+
const ignoreUndefined = opts?.ignoreUndefined ?? true;
|
|
507
|
+
if (opts?.partial) {
|
|
508
|
+
for (const k in b) if (!ignoreUndefined || b[k] !== void 0) {
|
|
509
|
+
if (!deepEqual(a[k], b[k], opts)) return false;
|
|
510
|
+
}
|
|
511
|
+
return true;
|
|
512
|
+
}
|
|
513
|
+
let aCount = 0;
|
|
514
|
+
if (!ignoreUndefined) aCount = Object.keys(a).length;
|
|
515
|
+
else for (const k in a) if (a[k] !== void 0) aCount++;
|
|
516
|
+
let bCount = 0;
|
|
517
|
+
for (const k in b) if (!ignoreUndefined || b[k] !== void 0) {
|
|
518
|
+
bCount++;
|
|
519
|
+
if (bCount > aCount || !deepEqual(a[k], b[k], opts)) return false;
|
|
520
|
+
}
|
|
521
|
+
return aCount === bCount;
|
|
522
|
+
}
|
|
523
|
+
return false;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Create a promise with exposed resolve/reject and status fields.
|
|
527
|
+
* Useful for coordinating async router lifecycle operations.
|
|
528
|
+
*/
|
|
529
|
+
function createControlledPromise(onResolve) {
|
|
530
|
+
let resolveLoadPromise;
|
|
531
|
+
let rejectLoadPromise;
|
|
532
|
+
const controlledPromise = new Promise((resolve, reject) => {
|
|
533
|
+
resolveLoadPromise = resolve;
|
|
534
|
+
rejectLoadPromise = reject;
|
|
535
|
+
});
|
|
536
|
+
controlledPromise.status = "pending";
|
|
537
|
+
controlledPromise.resolve = (value) => {
|
|
538
|
+
controlledPromise.status = "resolved";
|
|
539
|
+
controlledPromise.value = value;
|
|
540
|
+
resolveLoadPromise(value);
|
|
541
|
+
onResolve?.(value);
|
|
542
|
+
};
|
|
543
|
+
controlledPromise.reject = (e) => {
|
|
544
|
+
controlledPromise.status = "rejected";
|
|
545
|
+
rejectLoadPromise(e);
|
|
546
|
+
};
|
|
547
|
+
return controlledPromise;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Heuristically detect dynamic import "module not found" errors
|
|
551
|
+
* across major browsers for lazy route component handling.
|
|
552
|
+
*/
|
|
553
|
+
function isModuleNotFoundError(error) {
|
|
554
|
+
if (typeof error?.message !== "string") return false;
|
|
555
|
+
return error.message.startsWith("Failed to fetch dynamically imported module") || error.message.startsWith("error loading dynamically imported module") || error.message.startsWith("Importing a module script failed");
|
|
556
|
+
}
|
|
557
|
+
function isPromise(value) {
|
|
558
|
+
return Boolean(value && typeof value === "object" && typeof value.then === "function");
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Remove control characters that can cause open redirect vulnerabilities.
|
|
562
|
+
* Characters like \r (CR) and \n (LF) can trick URL parsers into interpreting
|
|
563
|
+
* paths like "/\r/evil.com" as "http://evil.com".
|
|
564
|
+
*/
|
|
565
|
+
function sanitizePathSegment(segment) {
|
|
566
|
+
return segment.replace(/[\x00-\x1f\x7f]/g, "");
|
|
567
|
+
}
|
|
568
|
+
function decodeSegment(segment) {
|
|
569
|
+
let decoded;
|
|
570
|
+
try {
|
|
571
|
+
decoded = decodeURI(segment);
|
|
572
|
+
} catch {
|
|
573
|
+
decoded = segment.replaceAll(/%[0-9A-F]{2}/gi, (match) => {
|
|
574
|
+
try {
|
|
575
|
+
return decodeURI(match);
|
|
576
|
+
} catch {
|
|
577
|
+
return match;
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
return sanitizePathSegment(decoded);
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Default list of URL protocols to allow in links, redirects, and navigation.
|
|
585
|
+
* Any absolute URL protocol not in this list is treated as dangerous by default.
|
|
586
|
+
*/
|
|
587
|
+
var DEFAULT_PROTOCOL_ALLOWLIST = [
|
|
588
|
+
"http:",
|
|
589
|
+
"https:",
|
|
590
|
+
"mailto:",
|
|
591
|
+
"tel:"
|
|
592
|
+
];
|
|
593
|
+
/**
|
|
594
|
+
* Check if a URL string uses a protocol that is not in the allowlist.
|
|
595
|
+
* Returns true for blocked protocols like javascript:, blob:, data:, etc.
|
|
596
|
+
*
|
|
597
|
+
* The URL constructor correctly normalizes:
|
|
598
|
+
* - Mixed case (JavaScript: → javascript:)
|
|
599
|
+
* - Whitespace/control characters (java\nscript: → javascript:)
|
|
600
|
+
* - Leading whitespace
|
|
601
|
+
*
|
|
602
|
+
* For relative URLs (no protocol), returns false (safe).
|
|
603
|
+
*
|
|
604
|
+
* @param url - The URL string to check
|
|
605
|
+
* @param allowlist - Set of protocols to allow
|
|
606
|
+
* @returns true if the URL uses a protocol that is not allowed
|
|
607
|
+
*/
|
|
608
|
+
function isDangerousProtocol(url, allowlist) {
|
|
609
|
+
if (!url) return false;
|
|
610
|
+
try {
|
|
611
|
+
const parsed = new URL(url);
|
|
612
|
+
return !allowlist.has(parsed.protocol);
|
|
613
|
+
} catch {
|
|
614
|
+
return false;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
var HTML_ESCAPE_LOOKUP = {
|
|
618
|
+
"&": "\\u0026",
|
|
619
|
+
">": "\\u003e",
|
|
620
|
+
"<": "\\u003c",
|
|
621
|
+
"\u2028": "\\u2028",
|
|
622
|
+
"\u2029": "\\u2029"
|
|
623
|
+
};
|
|
624
|
+
var HTML_ESCAPE_REGEX = /[&><\u2028\u2029]/g;
|
|
625
|
+
/**
|
|
626
|
+
* Escape HTML special characters in a string to prevent XSS attacks
|
|
627
|
+
* when embedding strings in script tags during SSR.
|
|
628
|
+
*
|
|
629
|
+
* This is essential for preventing XSS vulnerabilities when user-controlled
|
|
630
|
+
* content is embedded in inline scripts.
|
|
631
|
+
*/
|
|
632
|
+
function escapeHtml(str) {
|
|
633
|
+
return str.replace(HTML_ESCAPE_REGEX, (match) => HTML_ESCAPE_LOOKUP[match]);
|
|
634
|
+
}
|
|
635
|
+
function decodePath(path) {
|
|
636
|
+
if (!path) return {
|
|
637
|
+
path,
|
|
638
|
+
handledProtocolRelativeURL: false
|
|
639
|
+
};
|
|
640
|
+
if (!/[%\\\x00-\x1f\x7f]/.test(path) && !path.startsWith("//")) return {
|
|
641
|
+
path,
|
|
642
|
+
handledProtocolRelativeURL: false
|
|
643
|
+
};
|
|
644
|
+
const re = /%25|%5C/gi;
|
|
645
|
+
let cursor = 0;
|
|
646
|
+
let result = "";
|
|
647
|
+
let match;
|
|
648
|
+
while (null !== (match = re.exec(path))) {
|
|
649
|
+
result += decodeSegment(path.slice(cursor, match.index)) + match[0];
|
|
650
|
+
cursor = re.lastIndex;
|
|
651
|
+
}
|
|
652
|
+
result = result + decodeSegment(cursor ? path.slice(cursor) : path);
|
|
653
|
+
let handledProtocolRelativeURL = false;
|
|
654
|
+
if (result.startsWith("//")) {
|
|
655
|
+
handledProtocolRelativeURL = true;
|
|
656
|
+
result = "/" + result.replace(/^\/+/, "");
|
|
657
|
+
}
|
|
658
|
+
return {
|
|
659
|
+
path: result,
|
|
660
|
+
handledProtocolRelativeURL
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Encodes a path the same way `new URL()` would, but without the overhead of full URL parsing.
|
|
665
|
+
*
|
|
666
|
+
* This function encodes:
|
|
667
|
+
* - Whitespace characters (spaces → %20, tabs → %09, etc.)
|
|
668
|
+
* - Non-ASCII/Unicode characters (emojis, accented characters, etc.)
|
|
669
|
+
*
|
|
670
|
+
* It preserves:
|
|
671
|
+
* - Already percent-encoded sequences (won't double-encode %2F, %25, etc.)
|
|
672
|
+
* - ASCII special characters valid in URL paths (@, $, &, +, etc.)
|
|
673
|
+
* - Forward slashes as path separators
|
|
674
|
+
*
|
|
675
|
+
* Used to generate proper href values for SSR without constructing URL objects.
|
|
676
|
+
*
|
|
677
|
+
* @example
|
|
678
|
+
* encodePathLikeUrl('/path/file name.pdf') // '/path/file%20name.pdf'
|
|
679
|
+
* encodePathLikeUrl('/path/日本語') // '/path/%E6%97%A5%E6%9C%AC%E8%AA%9E'
|
|
680
|
+
* encodePathLikeUrl('/path/already%20encoded') // '/path/already%20encoded' (preserved)
|
|
681
|
+
*/
|
|
682
|
+
function encodePathLikeUrl(path) {
|
|
683
|
+
if (!/\s|[^\u0000-\u007F]/.test(path)) return path;
|
|
684
|
+
return path.replace(/\s|[^\u0000-\u007F]/gu, encodeURIComponent);
|
|
685
|
+
}
|
|
686
|
+
function arraysEqual(a, b) {
|
|
687
|
+
if (a === b) return true;
|
|
688
|
+
if (a.length !== b.length) return false;
|
|
689
|
+
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
|
|
690
|
+
return true;
|
|
691
|
+
}
|
|
692
|
+
//#endregion
|
|
693
|
+
//#region ../../node_modules/.bun/@tanstack+router-core@1.168.2/node_modules/@tanstack/router-core/dist/esm/invariant.js
|
|
694
|
+
function invariant() {
|
|
695
|
+
throw new Error("Invariant failed");
|
|
696
|
+
}
|
|
697
|
+
//#endregion
|
|
698
|
+
//#region ../../node_modules/.bun/@tanstack+router-core@1.168.2/node_modules/@tanstack/router-core/dist/esm/lru-cache.js
|
|
699
|
+
function createLRUCache(max) {
|
|
700
|
+
const cache = /* @__PURE__ */ new Map();
|
|
701
|
+
let oldest;
|
|
702
|
+
let newest;
|
|
703
|
+
const touch = (entry) => {
|
|
704
|
+
if (!entry.next) return;
|
|
705
|
+
if (!entry.prev) {
|
|
706
|
+
entry.next.prev = void 0;
|
|
707
|
+
oldest = entry.next;
|
|
708
|
+
entry.next = void 0;
|
|
709
|
+
if (newest) {
|
|
710
|
+
entry.prev = newest;
|
|
711
|
+
newest.next = entry;
|
|
712
|
+
}
|
|
713
|
+
} else {
|
|
714
|
+
entry.prev.next = entry.next;
|
|
715
|
+
entry.next.prev = entry.prev;
|
|
716
|
+
entry.next = void 0;
|
|
717
|
+
if (newest) {
|
|
718
|
+
newest.next = entry;
|
|
719
|
+
entry.prev = newest;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
newest = entry;
|
|
723
|
+
};
|
|
724
|
+
return {
|
|
725
|
+
get(key) {
|
|
726
|
+
const entry = cache.get(key);
|
|
727
|
+
if (!entry) return void 0;
|
|
728
|
+
touch(entry);
|
|
729
|
+
return entry.value;
|
|
730
|
+
},
|
|
731
|
+
set(key, value) {
|
|
732
|
+
if (cache.size >= max && oldest) {
|
|
733
|
+
const toDelete = oldest;
|
|
734
|
+
cache.delete(toDelete.key);
|
|
735
|
+
if (toDelete.next) {
|
|
736
|
+
oldest = toDelete.next;
|
|
737
|
+
toDelete.next.prev = void 0;
|
|
738
|
+
}
|
|
739
|
+
if (toDelete === newest) newest = void 0;
|
|
740
|
+
}
|
|
741
|
+
const existing = cache.get(key);
|
|
742
|
+
if (existing) {
|
|
743
|
+
existing.value = value;
|
|
744
|
+
touch(existing);
|
|
745
|
+
} else {
|
|
746
|
+
const entry = {
|
|
747
|
+
key,
|
|
748
|
+
value,
|
|
749
|
+
prev: newest
|
|
750
|
+
};
|
|
751
|
+
if (newest) newest.next = entry;
|
|
752
|
+
newest = entry;
|
|
753
|
+
if (!oldest) oldest = entry;
|
|
754
|
+
cache.set(key, entry);
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
clear() {
|
|
758
|
+
cache.clear();
|
|
759
|
+
oldest = void 0;
|
|
760
|
+
newest = void 0;
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
//#endregion
|
|
765
|
+
//#region ../../node_modules/.bun/@tanstack+router-core@1.168.2/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.js
|
|
766
|
+
var SEGMENT_TYPE_INDEX = 4;
|
|
767
|
+
var SEGMENT_TYPE_PATHLESS = 5;
|
|
768
|
+
function getOpenAndCloseBraces(part) {
|
|
769
|
+
const openBrace = part.indexOf("{");
|
|
770
|
+
if (openBrace === -1) return null;
|
|
771
|
+
const closeBrace = part.indexOf("}", openBrace);
|
|
772
|
+
if (closeBrace === -1) return null;
|
|
773
|
+
if (openBrace + 1 >= part.length) return null;
|
|
774
|
+
return [openBrace, closeBrace];
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Populates the `output` array with the parsed representation of the given `segment` string.
|
|
778
|
+
*
|
|
779
|
+
* Usage:
|
|
780
|
+
* ```ts
|
|
781
|
+
* let output
|
|
782
|
+
* let cursor = 0
|
|
783
|
+
* while (cursor < path.length) {
|
|
784
|
+
* output = parseSegment(path, cursor, output)
|
|
785
|
+
* const end = output[5]
|
|
786
|
+
* cursor = end + 1
|
|
787
|
+
* ```
|
|
788
|
+
*
|
|
789
|
+
* `output` is stored outside to avoid allocations during repeated calls. It doesn't need to be typed
|
|
790
|
+
* or initialized, it will be done automatically.
|
|
791
|
+
*/
|
|
792
|
+
function parseSegment(path, start, output = new Uint16Array(6)) {
|
|
793
|
+
const next = path.indexOf("/", start);
|
|
794
|
+
const end = next === -1 ? path.length : next;
|
|
795
|
+
const part = path.substring(start, end);
|
|
796
|
+
if (!part || !part.includes("$")) {
|
|
797
|
+
output[0] = 0;
|
|
798
|
+
output[1] = start;
|
|
799
|
+
output[2] = start;
|
|
800
|
+
output[3] = end;
|
|
801
|
+
output[4] = end;
|
|
802
|
+
output[5] = end;
|
|
803
|
+
return output;
|
|
804
|
+
}
|
|
805
|
+
if (part === "$") {
|
|
806
|
+
const total = path.length;
|
|
807
|
+
output[0] = 2;
|
|
808
|
+
output[1] = start;
|
|
809
|
+
output[2] = start;
|
|
810
|
+
output[3] = total;
|
|
811
|
+
output[4] = total;
|
|
812
|
+
output[5] = total;
|
|
813
|
+
return output;
|
|
814
|
+
}
|
|
815
|
+
if (part.charCodeAt(0) === 36) {
|
|
816
|
+
output[0] = 1;
|
|
817
|
+
output[1] = start;
|
|
818
|
+
output[2] = start + 1;
|
|
819
|
+
output[3] = end;
|
|
820
|
+
output[4] = end;
|
|
821
|
+
output[5] = end;
|
|
822
|
+
return output;
|
|
823
|
+
}
|
|
824
|
+
const braces = getOpenAndCloseBraces(part);
|
|
825
|
+
if (braces) {
|
|
826
|
+
const [openBrace, closeBrace] = braces;
|
|
827
|
+
const firstChar = part.charCodeAt(openBrace + 1);
|
|
828
|
+
if (firstChar === 45) {
|
|
829
|
+
if (openBrace + 2 < part.length && part.charCodeAt(openBrace + 2) === 36) {
|
|
830
|
+
const paramStart = openBrace + 3;
|
|
831
|
+
const paramEnd = closeBrace;
|
|
832
|
+
if (paramStart < paramEnd) {
|
|
833
|
+
output[0] = 3;
|
|
834
|
+
output[1] = start + openBrace;
|
|
835
|
+
output[2] = start + paramStart;
|
|
836
|
+
output[3] = start + paramEnd;
|
|
837
|
+
output[4] = start + closeBrace + 1;
|
|
838
|
+
output[5] = end;
|
|
839
|
+
return output;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
} else if (firstChar === 36) {
|
|
843
|
+
const dollarPos = openBrace + 1;
|
|
844
|
+
const afterDollar = openBrace + 2;
|
|
845
|
+
if (afterDollar === closeBrace) {
|
|
846
|
+
output[0] = 2;
|
|
847
|
+
output[1] = start + openBrace;
|
|
848
|
+
output[2] = start + dollarPos;
|
|
849
|
+
output[3] = start + afterDollar;
|
|
850
|
+
output[4] = start + closeBrace + 1;
|
|
851
|
+
output[5] = path.length;
|
|
852
|
+
return output;
|
|
853
|
+
}
|
|
854
|
+
output[0] = 1;
|
|
855
|
+
output[1] = start + openBrace;
|
|
856
|
+
output[2] = start + afterDollar;
|
|
857
|
+
output[3] = start + closeBrace;
|
|
858
|
+
output[4] = start + closeBrace + 1;
|
|
859
|
+
output[5] = end;
|
|
860
|
+
return output;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
output[0] = 0;
|
|
864
|
+
output[1] = start;
|
|
865
|
+
output[2] = start;
|
|
866
|
+
output[3] = end;
|
|
867
|
+
output[4] = end;
|
|
868
|
+
output[5] = end;
|
|
869
|
+
return output;
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Recursively parses the segments of the given route tree and populates a segment trie.
|
|
873
|
+
*
|
|
874
|
+
* @param data A reusable Uint16Array for parsing segments. (non important, we're just avoiding allocations)
|
|
875
|
+
* @param route The current route to parse.
|
|
876
|
+
* @param start The starting index for parsing within the route's full path.
|
|
877
|
+
* @param node The current segment node in the trie to populate.
|
|
878
|
+
* @param onRoute Callback invoked for each route processed.
|
|
879
|
+
*/
|
|
880
|
+
function parseSegments(defaultCaseSensitive, data, route, start, node, depth, onRoute) {
|
|
881
|
+
onRoute?.(route);
|
|
882
|
+
let cursor = start;
|
|
883
|
+
{
|
|
884
|
+
const path = route.fullPath ?? route.from;
|
|
885
|
+
const length = path.length;
|
|
886
|
+
const caseSensitive = route.options?.caseSensitive ?? defaultCaseSensitive;
|
|
887
|
+
const skipOnParamError = !!(route.options?.params?.parse && route.options?.skipRouteOnParseError?.params);
|
|
888
|
+
while (cursor < length) {
|
|
889
|
+
const segment = parseSegment(path, cursor, data);
|
|
890
|
+
let nextNode;
|
|
891
|
+
const start = cursor;
|
|
892
|
+
const end = segment[5];
|
|
893
|
+
cursor = end + 1;
|
|
894
|
+
depth++;
|
|
895
|
+
switch (segment[0]) {
|
|
896
|
+
case 0: {
|
|
897
|
+
const value = path.substring(segment[2], segment[3]);
|
|
898
|
+
if (caseSensitive) {
|
|
899
|
+
const existingNode = node.static?.get(value);
|
|
900
|
+
if (existingNode) nextNode = existingNode;
|
|
901
|
+
else {
|
|
902
|
+
node.static ??= /* @__PURE__ */ new Map();
|
|
903
|
+
const next = createStaticNode(route.fullPath ?? route.from);
|
|
904
|
+
next.parent = node;
|
|
905
|
+
next.depth = depth;
|
|
906
|
+
nextNode = next;
|
|
907
|
+
node.static.set(value, next);
|
|
908
|
+
}
|
|
909
|
+
} else {
|
|
910
|
+
const name = value.toLowerCase();
|
|
911
|
+
const existingNode = node.staticInsensitive?.get(name);
|
|
912
|
+
if (existingNode) nextNode = existingNode;
|
|
913
|
+
else {
|
|
914
|
+
node.staticInsensitive ??= /* @__PURE__ */ new Map();
|
|
915
|
+
const next = createStaticNode(route.fullPath ?? route.from);
|
|
916
|
+
next.parent = node;
|
|
917
|
+
next.depth = depth;
|
|
918
|
+
nextNode = next;
|
|
919
|
+
node.staticInsensitive.set(name, next);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
break;
|
|
923
|
+
}
|
|
924
|
+
case 1: {
|
|
925
|
+
const prefix_raw = path.substring(start, segment[1]);
|
|
926
|
+
const suffix_raw = path.substring(segment[4], end);
|
|
927
|
+
const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);
|
|
928
|
+
const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();
|
|
929
|
+
const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();
|
|
930
|
+
const existingNode = !skipOnParamError && node.dynamic?.find((s) => !s.skipOnParamError && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);
|
|
931
|
+
if (existingNode) nextNode = existingNode;
|
|
932
|
+
else {
|
|
933
|
+
const next = createDynamicNode(1, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);
|
|
934
|
+
nextNode = next;
|
|
935
|
+
next.depth = depth;
|
|
936
|
+
next.parent = node;
|
|
937
|
+
node.dynamic ??= [];
|
|
938
|
+
node.dynamic.push(next);
|
|
939
|
+
}
|
|
940
|
+
break;
|
|
941
|
+
}
|
|
942
|
+
case 3: {
|
|
943
|
+
const prefix_raw = path.substring(start, segment[1]);
|
|
944
|
+
const suffix_raw = path.substring(segment[4], end);
|
|
945
|
+
const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);
|
|
946
|
+
const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();
|
|
947
|
+
const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();
|
|
948
|
+
const existingNode = !skipOnParamError && node.optional?.find((s) => !s.skipOnParamError && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);
|
|
949
|
+
if (existingNode) nextNode = existingNode;
|
|
950
|
+
else {
|
|
951
|
+
const next = createDynamicNode(3, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);
|
|
952
|
+
nextNode = next;
|
|
953
|
+
next.parent = node;
|
|
954
|
+
next.depth = depth;
|
|
955
|
+
node.optional ??= [];
|
|
956
|
+
node.optional.push(next);
|
|
957
|
+
}
|
|
958
|
+
break;
|
|
959
|
+
}
|
|
960
|
+
case 2: {
|
|
961
|
+
const prefix_raw = path.substring(start, segment[1]);
|
|
962
|
+
const suffix_raw = path.substring(segment[4], end);
|
|
963
|
+
const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);
|
|
964
|
+
const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();
|
|
965
|
+
const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();
|
|
966
|
+
const next = createDynamicNode(2, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);
|
|
967
|
+
nextNode = next;
|
|
968
|
+
next.parent = node;
|
|
969
|
+
next.depth = depth;
|
|
970
|
+
node.wildcard ??= [];
|
|
971
|
+
node.wildcard.push(next);
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
node = nextNode;
|
|
975
|
+
}
|
|
976
|
+
if (skipOnParamError && route.children && !route.isRoot && route.id && route.id.charCodeAt(route.id.lastIndexOf("/") + 1) === 95) {
|
|
977
|
+
const pathlessNode = createStaticNode(route.fullPath ?? route.from);
|
|
978
|
+
pathlessNode.kind = SEGMENT_TYPE_PATHLESS;
|
|
979
|
+
pathlessNode.parent = node;
|
|
980
|
+
depth++;
|
|
981
|
+
pathlessNode.depth = depth;
|
|
982
|
+
node.pathless ??= [];
|
|
983
|
+
node.pathless.push(pathlessNode);
|
|
984
|
+
node = pathlessNode;
|
|
985
|
+
}
|
|
986
|
+
const isLeaf = (route.path || !route.children) && !route.isRoot;
|
|
987
|
+
if (isLeaf && path.endsWith("/")) {
|
|
988
|
+
const indexNode = createStaticNode(route.fullPath ?? route.from);
|
|
989
|
+
indexNode.kind = SEGMENT_TYPE_INDEX;
|
|
990
|
+
indexNode.parent = node;
|
|
991
|
+
depth++;
|
|
992
|
+
indexNode.depth = depth;
|
|
993
|
+
node.index = indexNode;
|
|
994
|
+
node = indexNode;
|
|
995
|
+
}
|
|
996
|
+
node.parse = route.options?.params?.parse ?? null;
|
|
997
|
+
node.skipOnParamError = skipOnParamError;
|
|
998
|
+
node.parsingPriority = route.options?.skipRouteOnParseError?.priority ?? 0;
|
|
999
|
+
if (isLeaf && !node.route) {
|
|
1000
|
+
node.route = route;
|
|
1001
|
+
node.fullPath = route.fullPath ?? route.from;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
if (route.children) for (const child of route.children) parseSegments(defaultCaseSensitive, data, child, cursor, node, depth, onRoute);
|
|
1005
|
+
}
|
|
1006
|
+
function sortDynamic(a, b) {
|
|
1007
|
+
if (a.skipOnParamError && !b.skipOnParamError) return -1;
|
|
1008
|
+
if (!a.skipOnParamError && b.skipOnParamError) return 1;
|
|
1009
|
+
if (a.skipOnParamError && b.skipOnParamError && (a.parsingPriority || b.parsingPriority)) return b.parsingPriority - a.parsingPriority;
|
|
1010
|
+
if (a.prefix && b.prefix && a.prefix !== b.prefix) {
|
|
1011
|
+
if (a.prefix.startsWith(b.prefix)) return -1;
|
|
1012
|
+
if (b.prefix.startsWith(a.prefix)) return 1;
|
|
1013
|
+
}
|
|
1014
|
+
if (a.suffix && b.suffix && a.suffix !== b.suffix) {
|
|
1015
|
+
if (a.suffix.endsWith(b.suffix)) return -1;
|
|
1016
|
+
if (b.suffix.endsWith(a.suffix)) return 1;
|
|
1017
|
+
}
|
|
1018
|
+
if (a.prefix && !b.prefix) return -1;
|
|
1019
|
+
if (!a.prefix && b.prefix) return 1;
|
|
1020
|
+
if (a.suffix && !b.suffix) return -1;
|
|
1021
|
+
if (!a.suffix && b.suffix) return 1;
|
|
1022
|
+
if (a.caseSensitive && !b.caseSensitive) return -1;
|
|
1023
|
+
if (!a.caseSensitive && b.caseSensitive) return 1;
|
|
1024
|
+
return 0;
|
|
1025
|
+
}
|
|
1026
|
+
function sortTreeNodes(node) {
|
|
1027
|
+
if (node.pathless) for (const child of node.pathless) sortTreeNodes(child);
|
|
1028
|
+
if (node.static) for (const child of node.static.values()) sortTreeNodes(child);
|
|
1029
|
+
if (node.staticInsensitive) for (const child of node.staticInsensitive.values()) sortTreeNodes(child);
|
|
1030
|
+
if (node.dynamic?.length) {
|
|
1031
|
+
node.dynamic.sort(sortDynamic);
|
|
1032
|
+
for (const child of node.dynamic) sortTreeNodes(child);
|
|
1033
|
+
}
|
|
1034
|
+
if (node.optional?.length) {
|
|
1035
|
+
node.optional.sort(sortDynamic);
|
|
1036
|
+
for (const child of node.optional) sortTreeNodes(child);
|
|
1037
|
+
}
|
|
1038
|
+
if (node.wildcard?.length) {
|
|
1039
|
+
node.wildcard.sort(sortDynamic);
|
|
1040
|
+
for (const child of node.wildcard) sortTreeNodes(child);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
function createStaticNode(fullPath) {
|
|
1044
|
+
return {
|
|
1045
|
+
kind: 0,
|
|
1046
|
+
depth: 0,
|
|
1047
|
+
pathless: null,
|
|
1048
|
+
index: null,
|
|
1049
|
+
static: null,
|
|
1050
|
+
staticInsensitive: null,
|
|
1051
|
+
dynamic: null,
|
|
1052
|
+
optional: null,
|
|
1053
|
+
wildcard: null,
|
|
1054
|
+
route: null,
|
|
1055
|
+
fullPath,
|
|
1056
|
+
parent: null,
|
|
1057
|
+
parse: null,
|
|
1058
|
+
skipOnParamError: false,
|
|
1059
|
+
parsingPriority: 0
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Keys must be declared in the same order as in `SegmentNode` type,
|
|
1064
|
+
* to ensure they are represented as the same object class in the engine.
|
|
1065
|
+
*/
|
|
1066
|
+
function createDynamicNode(kind, fullPath, caseSensitive, prefix, suffix) {
|
|
1067
|
+
return {
|
|
1068
|
+
kind,
|
|
1069
|
+
depth: 0,
|
|
1070
|
+
pathless: null,
|
|
1071
|
+
index: null,
|
|
1072
|
+
static: null,
|
|
1073
|
+
staticInsensitive: null,
|
|
1074
|
+
dynamic: null,
|
|
1075
|
+
optional: null,
|
|
1076
|
+
wildcard: null,
|
|
1077
|
+
route: null,
|
|
1078
|
+
fullPath,
|
|
1079
|
+
parent: null,
|
|
1080
|
+
parse: null,
|
|
1081
|
+
skipOnParamError: false,
|
|
1082
|
+
parsingPriority: 0,
|
|
1083
|
+
caseSensitive,
|
|
1084
|
+
prefix,
|
|
1085
|
+
suffix
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
function processRouteMasks(routeList, processedTree) {
|
|
1089
|
+
const segmentTree = createStaticNode("/");
|
|
1090
|
+
const data = new Uint16Array(6);
|
|
1091
|
+
for (const route of routeList) parseSegments(false, data, route, 1, segmentTree, 0);
|
|
1092
|
+
sortTreeNodes(segmentTree);
|
|
1093
|
+
processedTree.masksTree = segmentTree;
|
|
1094
|
+
processedTree.flatCache = createLRUCache(1e3);
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* Take an arbitrary list of routes, create a tree from them (if it hasn't been created already), and match a path against it.
|
|
1098
|
+
*/
|
|
1099
|
+
function findFlatMatch(path, processedTree) {
|
|
1100
|
+
path ||= "/";
|
|
1101
|
+
const cached = processedTree.flatCache.get(path);
|
|
1102
|
+
if (cached) return cached;
|
|
1103
|
+
const result = findMatch(path, processedTree.masksTree);
|
|
1104
|
+
processedTree.flatCache.set(path, result);
|
|
1105
|
+
return result;
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree
|
|
1109
|
+
*/
|
|
1110
|
+
function findSingleMatch(from, caseSensitive, fuzzy, path, processedTree) {
|
|
1111
|
+
from ||= "/";
|
|
1112
|
+
path ||= "/";
|
|
1113
|
+
const key = caseSensitive ? `case\0${from}` : from;
|
|
1114
|
+
let tree = processedTree.singleCache.get(key);
|
|
1115
|
+
if (!tree) {
|
|
1116
|
+
tree = createStaticNode("/");
|
|
1117
|
+
parseSegments(caseSensitive, new Uint16Array(6), { from }, 1, tree, 0);
|
|
1118
|
+
processedTree.singleCache.set(key, tree);
|
|
1119
|
+
}
|
|
1120
|
+
return findMatch(path, tree, fuzzy);
|
|
1121
|
+
}
|
|
1122
|
+
function findRouteMatch(path, processedTree, fuzzy = false) {
|
|
1123
|
+
const key = fuzzy ? path : `nofuzz\0${path}`;
|
|
1124
|
+
const cached = processedTree.matchCache.get(key);
|
|
1125
|
+
if (cached !== void 0) return cached;
|
|
1126
|
+
path ||= "/";
|
|
1127
|
+
let result;
|
|
1128
|
+
try {
|
|
1129
|
+
result = findMatch(path, processedTree.segmentTree, fuzzy);
|
|
1130
|
+
} catch (err) {
|
|
1131
|
+
if (err instanceof URIError) result = null;
|
|
1132
|
+
else throw err;
|
|
1133
|
+
}
|
|
1134
|
+
if (result) result.branch = buildRouteBranch(result.route);
|
|
1135
|
+
processedTree.matchCache.set(key, result);
|
|
1136
|
+
return result;
|
|
1137
|
+
}
|
|
1138
|
+
/** Trim trailing slashes (except preserving root '/'). */
|
|
1139
|
+
function trimPathRight$1(path) {
|
|
1140
|
+
return path === "/" ? path : path.replace(/\/{1,}$/, "");
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Processes a route tree into a segment trie for efficient path matching.
|
|
1144
|
+
* Also builds lookup maps for routes by ID and by trimmed full path.
|
|
1145
|
+
*/
|
|
1146
|
+
function processRouteTree(routeTree, caseSensitive = false, initRoute) {
|
|
1147
|
+
const segmentTree = createStaticNode(routeTree.fullPath);
|
|
1148
|
+
const data = new Uint16Array(6);
|
|
1149
|
+
const routesById = {};
|
|
1150
|
+
const routesByPath = {};
|
|
1151
|
+
let index = 0;
|
|
1152
|
+
parseSegments(caseSensitive, data, routeTree, 1, segmentTree, 0, (route) => {
|
|
1153
|
+
initRoute?.(route, index);
|
|
1154
|
+
if (route.id in routesById) invariant();
|
|
1155
|
+
routesById[route.id] = route;
|
|
1156
|
+
if (index !== 0 && route.path) {
|
|
1157
|
+
const trimmedFullPath = trimPathRight$1(route.fullPath);
|
|
1158
|
+
if (!routesByPath[trimmedFullPath] || route.fullPath.endsWith("/")) routesByPath[trimmedFullPath] = route;
|
|
1159
|
+
}
|
|
1160
|
+
index++;
|
|
1161
|
+
});
|
|
1162
|
+
sortTreeNodes(segmentTree);
|
|
1163
|
+
return {
|
|
1164
|
+
processedTree: {
|
|
1165
|
+
segmentTree,
|
|
1166
|
+
singleCache: createLRUCache(1e3),
|
|
1167
|
+
matchCache: createLRUCache(1e3),
|
|
1168
|
+
flatCache: null,
|
|
1169
|
+
masksTree: null
|
|
1170
|
+
},
|
|
1171
|
+
routesById,
|
|
1172
|
+
routesByPath
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
function findMatch(path, segmentTree, fuzzy = false) {
|
|
1176
|
+
const parts = path.split("/");
|
|
1177
|
+
const leaf = getNodeMatch(path, parts, segmentTree, fuzzy);
|
|
1178
|
+
if (!leaf) return null;
|
|
1179
|
+
const [rawParams] = extractParams(path, parts, leaf);
|
|
1180
|
+
return {
|
|
1181
|
+
route: leaf.node.route,
|
|
1182
|
+
rawParams,
|
|
1183
|
+
parsedParams: leaf.parsedParams
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
/**
|
|
1187
|
+
* This function is "resumable":
|
|
1188
|
+
* - the `leaf` input can contain `extract` and `rawParams` properties from a previous `extractParams` call
|
|
1189
|
+
* - the returned `state` can be passed back as `extract` in a future call to continue extracting params from where we left off
|
|
1190
|
+
*
|
|
1191
|
+
* Inputs are *not* mutated.
|
|
1192
|
+
*/
|
|
1193
|
+
function extractParams(path, parts, leaf) {
|
|
1194
|
+
const list = buildBranch(leaf.node);
|
|
1195
|
+
let nodeParts = null;
|
|
1196
|
+
const rawParams = Object.create(null);
|
|
1197
|
+
/** which segment of the path we're currently processing */
|
|
1198
|
+
let partIndex = leaf.extract?.part ?? 0;
|
|
1199
|
+
/** which node of the route tree branch we're currently processing */
|
|
1200
|
+
let nodeIndex = leaf.extract?.node ?? 0;
|
|
1201
|
+
/** index of the 1st character of the segment we're processing in the path string */
|
|
1202
|
+
let pathIndex = leaf.extract?.path ?? 0;
|
|
1203
|
+
/** which fullPath segment we're currently processing */
|
|
1204
|
+
let segmentCount = leaf.extract?.segment ?? 0;
|
|
1205
|
+
for (; nodeIndex < list.length; partIndex++, nodeIndex++, pathIndex++, segmentCount++) {
|
|
1206
|
+
const node = list[nodeIndex];
|
|
1207
|
+
if (node.kind === SEGMENT_TYPE_INDEX) break;
|
|
1208
|
+
if (node.kind === SEGMENT_TYPE_PATHLESS) {
|
|
1209
|
+
segmentCount--;
|
|
1210
|
+
partIndex--;
|
|
1211
|
+
pathIndex--;
|
|
1212
|
+
continue;
|
|
1213
|
+
}
|
|
1214
|
+
const part = parts[partIndex];
|
|
1215
|
+
const currentPathIndex = pathIndex;
|
|
1216
|
+
if (part) pathIndex += part.length;
|
|
1217
|
+
if (node.kind === 1) {
|
|
1218
|
+
nodeParts ??= leaf.node.fullPath.split("/");
|
|
1219
|
+
const nodePart = nodeParts[segmentCount];
|
|
1220
|
+
const preLength = node.prefix?.length ?? 0;
|
|
1221
|
+
if (nodePart.charCodeAt(preLength) === 123) {
|
|
1222
|
+
const sufLength = node.suffix?.length ?? 0;
|
|
1223
|
+
const name = nodePart.substring(preLength + 2, nodePart.length - sufLength - 1);
|
|
1224
|
+
const value = part.substring(preLength, part.length - sufLength);
|
|
1225
|
+
rawParams[name] = decodeURIComponent(value);
|
|
1226
|
+
} else {
|
|
1227
|
+
const name = nodePart.substring(1);
|
|
1228
|
+
rawParams[name] = decodeURIComponent(part);
|
|
1229
|
+
}
|
|
1230
|
+
} else if (node.kind === 3) {
|
|
1231
|
+
if (leaf.skipped & 1 << nodeIndex) {
|
|
1232
|
+
partIndex--;
|
|
1233
|
+
pathIndex = currentPathIndex - 1;
|
|
1234
|
+
continue;
|
|
1235
|
+
}
|
|
1236
|
+
nodeParts ??= leaf.node.fullPath.split("/");
|
|
1237
|
+
const nodePart = nodeParts[segmentCount];
|
|
1238
|
+
const preLength = node.prefix?.length ?? 0;
|
|
1239
|
+
const sufLength = node.suffix?.length ?? 0;
|
|
1240
|
+
const name = nodePart.substring(preLength + 3, nodePart.length - sufLength - 1);
|
|
1241
|
+
const value = node.suffix || node.prefix ? part.substring(preLength, part.length - sufLength) : part;
|
|
1242
|
+
if (value) rawParams[name] = decodeURIComponent(value);
|
|
1243
|
+
} else if (node.kind === 2) {
|
|
1244
|
+
const n = node;
|
|
1245
|
+
const value = path.substring(currentPathIndex + (n.prefix?.length ?? 0), path.length - (n.suffix?.length ?? 0));
|
|
1246
|
+
const splat = decodeURIComponent(value);
|
|
1247
|
+
rawParams["*"] = splat;
|
|
1248
|
+
rawParams._splat = splat;
|
|
1249
|
+
break;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
if (leaf.rawParams) Object.assign(rawParams, leaf.rawParams);
|
|
1253
|
+
return [rawParams, {
|
|
1254
|
+
part: partIndex,
|
|
1255
|
+
node: nodeIndex,
|
|
1256
|
+
path: pathIndex,
|
|
1257
|
+
segment: segmentCount
|
|
1258
|
+
}];
|
|
1259
|
+
}
|
|
1260
|
+
function buildRouteBranch(route) {
|
|
1261
|
+
const list = [route];
|
|
1262
|
+
while (route.parentRoute) {
|
|
1263
|
+
route = route.parentRoute;
|
|
1264
|
+
list.push(route);
|
|
1265
|
+
}
|
|
1266
|
+
list.reverse();
|
|
1267
|
+
return list;
|
|
1268
|
+
}
|
|
1269
|
+
function buildBranch(node) {
|
|
1270
|
+
const list = Array(node.depth + 1);
|
|
1271
|
+
do {
|
|
1272
|
+
list[node.depth] = node;
|
|
1273
|
+
node = node.parent;
|
|
1274
|
+
} while (node);
|
|
1275
|
+
return list;
|
|
1276
|
+
}
|
|
1277
|
+
function getNodeMatch(path, parts, segmentTree, fuzzy) {
|
|
1278
|
+
if (path === "/" && segmentTree.index) return {
|
|
1279
|
+
node: segmentTree.index,
|
|
1280
|
+
skipped: 0
|
|
1281
|
+
};
|
|
1282
|
+
const trailingSlash = !last(parts);
|
|
1283
|
+
const pathIsIndex = trailingSlash && path !== "/";
|
|
1284
|
+
const partsLength = parts.length - (trailingSlash ? 1 : 0);
|
|
1285
|
+
const stack = [{
|
|
1286
|
+
node: segmentTree,
|
|
1287
|
+
index: 1,
|
|
1288
|
+
skipped: 0,
|
|
1289
|
+
depth: 1,
|
|
1290
|
+
statics: 1,
|
|
1291
|
+
dynamics: 0,
|
|
1292
|
+
optionals: 0
|
|
1293
|
+
}];
|
|
1294
|
+
let wildcardMatch = null;
|
|
1295
|
+
let bestFuzzy = null;
|
|
1296
|
+
let bestMatch = null;
|
|
1297
|
+
while (stack.length) {
|
|
1298
|
+
const frame = stack.pop();
|
|
1299
|
+
const { node, index, skipped, depth, statics, dynamics, optionals } = frame;
|
|
1300
|
+
let { extract, rawParams, parsedParams } = frame;
|
|
1301
|
+
if (node.skipOnParamError) {
|
|
1302
|
+
if (!validateMatchParams(path, parts, frame)) continue;
|
|
1303
|
+
rawParams = frame.rawParams;
|
|
1304
|
+
extract = frame.extract;
|
|
1305
|
+
parsedParams = frame.parsedParams;
|
|
1306
|
+
}
|
|
1307
|
+
if (fuzzy && node.route && node.kind !== SEGMENT_TYPE_INDEX && isFrameMoreSpecific(bestFuzzy, frame)) bestFuzzy = frame;
|
|
1308
|
+
const isBeyondPath = index === partsLength;
|
|
1309
|
+
if (isBeyondPath) {
|
|
1310
|
+
if (node.route && !pathIsIndex && isFrameMoreSpecific(bestMatch, frame)) bestMatch = frame;
|
|
1311
|
+
if (!node.optional && !node.wildcard && !node.index && !node.pathless) continue;
|
|
1312
|
+
}
|
|
1313
|
+
const part = isBeyondPath ? void 0 : parts[index];
|
|
1314
|
+
let lowerPart;
|
|
1315
|
+
if (isBeyondPath && node.index) {
|
|
1316
|
+
const indexFrame = {
|
|
1317
|
+
node: node.index,
|
|
1318
|
+
index,
|
|
1319
|
+
skipped,
|
|
1320
|
+
depth: depth + 1,
|
|
1321
|
+
statics,
|
|
1322
|
+
dynamics,
|
|
1323
|
+
optionals,
|
|
1324
|
+
extract,
|
|
1325
|
+
rawParams,
|
|
1326
|
+
parsedParams
|
|
1327
|
+
};
|
|
1328
|
+
let indexValid = true;
|
|
1329
|
+
if (node.index.skipOnParamError) {
|
|
1330
|
+
if (!validateMatchParams(path, parts, indexFrame)) indexValid = false;
|
|
1331
|
+
}
|
|
1332
|
+
if (indexValid) {
|
|
1333
|
+
if (statics === partsLength && !dynamics && !optionals && !skipped) return indexFrame;
|
|
1334
|
+
if (isFrameMoreSpecific(bestMatch, indexFrame)) bestMatch = indexFrame;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
if (node.wildcard && isFrameMoreSpecific(wildcardMatch, frame)) for (const segment of node.wildcard) {
|
|
1338
|
+
const { prefix, suffix } = segment;
|
|
1339
|
+
if (prefix) {
|
|
1340
|
+
if (isBeyondPath) continue;
|
|
1341
|
+
if (!(segment.caseSensitive ? part : lowerPart ??= part.toLowerCase()).startsWith(prefix)) continue;
|
|
1342
|
+
}
|
|
1343
|
+
if (suffix) {
|
|
1344
|
+
if (isBeyondPath) continue;
|
|
1345
|
+
const end = parts.slice(index).join("/").slice(-suffix.length);
|
|
1346
|
+
if ((segment.caseSensitive ? end : end.toLowerCase()) !== suffix) continue;
|
|
1347
|
+
}
|
|
1348
|
+
const frame = {
|
|
1349
|
+
node: segment,
|
|
1350
|
+
index: partsLength,
|
|
1351
|
+
skipped,
|
|
1352
|
+
depth,
|
|
1353
|
+
statics,
|
|
1354
|
+
dynamics,
|
|
1355
|
+
optionals,
|
|
1356
|
+
extract,
|
|
1357
|
+
rawParams,
|
|
1358
|
+
parsedParams
|
|
1359
|
+
};
|
|
1360
|
+
if (segment.skipOnParamError) {
|
|
1361
|
+
if (!validateMatchParams(path, parts, frame)) continue;
|
|
1362
|
+
}
|
|
1363
|
+
wildcardMatch = frame;
|
|
1364
|
+
break;
|
|
1365
|
+
}
|
|
1366
|
+
if (node.optional) {
|
|
1367
|
+
const nextSkipped = skipped | 1 << depth;
|
|
1368
|
+
const nextDepth = depth + 1;
|
|
1369
|
+
for (let i = node.optional.length - 1; i >= 0; i--) {
|
|
1370
|
+
const segment = node.optional[i];
|
|
1371
|
+
stack.push({
|
|
1372
|
+
node: segment,
|
|
1373
|
+
index,
|
|
1374
|
+
skipped: nextSkipped,
|
|
1375
|
+
depth: nextDepth,
|
|
1376
|
+
statics,
|
|
1377
|
+
dynamics,
|
|
1378
|
+
optionals,
|
|
1379
|
+
extract,
|
|
1380
|
+
rawParams,
|
|
1381
|
+
parsedParams
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1384
|
+
if (!isBeyondPath) for (let i = node.optional.length - 1; i >= 0; i--) {
|
|
1385
|
+
const segment = node.optional[i];
|
|
1386
|
+
const { prefix, suffix } = segment;
|
|
1387
|
+
if (prefix || suffix) {
|
|
1388
|
+
const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();
|
|
1389
|
+
if (prefix && !casePart.startsWith(prefix)) continue;
|
|
1390
|
+
if (suffix && !casePart.endsWith(suffix)) continue;
|
|
1391
|
+
}
|
|
1392
|
+
stack.push({
|
|
1393
|
+
node: segment,
|
|
1394
|
+
index: index + 1,
|
|
1395
|
+
skipped,
|
|
1396
|
+
depth: nextDepth,
|
|
1397
|
+
statics,
|
|
1398
|
+
dynamics,
|
|
1399
|
+
optionals: optionals + 1,
|
|
1400
|
+
extract,
|
|
1401
|
+
rawParams,
|
|
1402
|
+
parsedParams
|
|
1403
|
+
});
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
if (!isBeyondPath && node.dynamic && part) for (let i = node.dynamic.length - 1; i >= 0; i--) {
|
|
1407
|
+
const segment = node.dynamic[i];
|
|
1408
|
+
const { prefix, suffix } = segment;
|
|
1409
|
+
if (prefix || suffix) {
|
|
1410
|
+
const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();
|
|
1411
|
+
if (prefix && !casePart.startsWith(prefix)) continue;
|
|
1412
|
+
if (suffix && !casePart.endsWith(suffix)) continue;
|
|
1413
|
+
}
|
|
1414
|
+
stack.push({
|
|
1415
|
+
node: segment,
|
|
1416
|
+
index: index + 1,
|
|
1417
|
+
skipped,
|
|
1418
|
+
depth: depth + 1,
|
|
1419
|
+
statics,
|
|
1420
|
+
dynamics: dynamics + 1,
|
|
1421
|
+
optionals,
|
|
1422
|
+
extract,
|
|
1423
|
+
rawParams,
|
|
1424
|
+
parsedParams
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
if (!isBeyondPath && node.staticInsensitive) {
|
|
1428
|
+
const match = node.staticInsensitive.get(lowerPart ??= part.toLowerCase());
|
|
1429
|
+
if (match) stack.push({
|
|
1430
|
+
node: match,
|
|
1431
|
+
index: index + 1,
|
|
1432
|
+
skipped,
|
|
1433
|
+
depth: depth + 1,
|
|
1434
|
+
statics: statics + 1,
|
|
1435
|
+
dynamics,
|
|
1436
|
+
optionals,
|
|
1437
|
+
extract,
|
|
1438
|
+
rawParams,
|
|
1439
|
+
parsedParams
|
|
1440
|
+
});
|
|
1441
|
+
}
|
|
1442
|
+
if (!isBeyondPath && node.static) {
|
|
1443
|
+
const match = node.static.get(part);
|
|
1444
|
+
if (match) stack.push({
|
|
1445
|
+
node: match,
|
|
1446
|
+
index: index + 1,
|
|
1447
|
+
skipped,
|
|
1448
|
+
depth: depth + 1,
|
|
1449
|
+
statics: statics + 1,
|
|
1450
|
+
dynamics,
|
|
1451
|
+
optionals,
|
|
1452
|
+
extract,
|
|
1453
|
+
rawParams,
|
|
1454
|
+
parsedParams
|
|
1455
|
+
});
|
|
1456
|
+
}
|
|
1457
|
+
if (node.pathless) {
|
|
1458
|
+
const nextDepth = depth + 1;
|
|
1459
|
+
for (let i = node.pathless.length - 1; i >= 0; i--) {
|
|
1460
|
+
const segment = node.pathless[i];
|
|
1461
|
+
stack.push({
|
|
1462
|
+
node: segment,
|
|
1463
|
+
index,
|
|
1464
|
+
skipped,
|
|
1465
|
+
depth: nextDepth,
|
|
1466
|
+
statics,
|
|
1467
|
+
dynamics,
|
|
1468
|
+
optionals,
|
|
1469
|
+
extract,
|
|
1470
|
+
rawParams,
|
|
1471
|
+
parsedParams
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
if (bestMatch && wildcardMatch) return isFrameMoreSpecific(wildcardMatch, bestMatch) ? bestMatch : wildcardMatch;
|
|
1477
|
+
if (bestMatch) return bestMatch;
|
|
1478
|
+
if (wildcardMatch) return wildcardMatch;
|
|
1479
|
+
if (fuzzy && bestFuzzy) {
|
|
1480
|
+
let sliceIndex = bestFuzzy.index;
|
|
1481
|
+
for (let i = 0; i < bestFuzzy.index; i++) sliceIndex += parts[i].length;
|
|
1482
|
+
const splat = sliceIndex === path.length ? "/" : path.slice(sliceIndex);
|
|
1483
|
+
bestFuzzy.rawParams ??= Object.create(null);
|
|
1484
|
+
bestFuzzy.rawParams["**"] = decodeURIComponent(splat);
|
|
1485
|
+
return bestFuzzy;
|
|
1486
|
+
}
|
|
1487
|
+
return null;
|
|
1488
|
+
}
|
|
1489
|
+
function validateMatchParams(path, parts, frame) {
|
|
1490
|
+
try {
|
|
1491
|
+
const [rawParams, state] = extractParams(path, parts, frame);
|
|
1492
|
+
frame.rawParams = rawParams;
|
|
1493
|
+
frame.extract = state;
|
|
1494
|
+
const parsed = frame.node.parse(rawParams);
|
|
1495
|
+
frame.parsedParams = Object.assign(Object.create(null), frame.parsedParams, parsed);
|
|
1496
|
+
return true;
|
|
1497
|
+
} catch {
|
|
1498
|
+
return null;
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
function isFrameMoreSpecific(prev, next) {
|
|
1502
|
+
if (!prev) return true;
|
|
1503
|
+
return next.statics > prev.statics || next.statics === prev.statics && (next.dynamics > prev.dynamics || next.dynamics === prev.dynamics && (next.optionals > prev.optionals || next.optionals === prev.optionals && ((next.node.kind === SEGMENT_TYPE_INDEX) > (prev.node.kind === SEGMENT_TYPE_INDEX) || next.node.kind === SEGMENT_TYPE_INDEX === (prev.node.kind === SEGMENT_TYPE_INDEX) && next.depth > prev.depth)));
|
|
1504
|
+
}
|
|
1505
|
+
//#endregion
|
|
1506
|
+
//#region ../../node_modules/.bun/@tanstack+router-core@1.168.2/node_modules/@tanstack/router-core/dist/esm/path.js
|
|
1507
|
+
/** Join path segments, cleaning duplicate slashes between parts. */
|
|
1508
|
+
function joinPaths(paths) {
|
|
1509
|
+
return cleanPath(paths.filter((val) => {
|
|
1510
|
+
return val !== void 0;
|
|
1511
|
+
}).join("/"));
|
|
1512
|
+
}
|
|
1513
|
+
/** Remove repeated slashes from a path string. */
|
|
1514
|
+
function cleanPath(path) {
|
|
1515
|
+
return path.replace(/\/{2,}/g, "/");
|
|
1516
|
+
}
|
|
1517
|
+
/** Trim leading slashes (except preserving root '/'). */
|
|
1518
|
+
function trimPathLeft(path) {
|
|
1519
|
+
return path === "/" ? path : path.replace(/^\/{1,}/, "");
|
|
1520
|
+
}
|
|
1521
|
+
/** Trim trailing slashes (except preserving root '/'). */
|
|
1522
|
+
function trimPathRight(path) {
|
|
1523
|
+
const len = path.length;
|
|
1524
|
+
return len > 1 && path[len - 1] === "/" ? path.replace(/\/{1,}$/, "") : path;
|
|
1525
|
+
}
|
|
1526
|
+
/** Trim both leading and trailing slashes. */
|
|
1527
|
+
function trimPath(path) {
|
|
1528
|
+
return trimPathRight(trimPathLeft(path));
|
|
1529
|
+
}
|
|
1530
|
+
/** Remove a trailing slash from value when appropriate for comparisons. */
|
|
1531
|
+
function removeTrailingSlash(value, basepath) {
|
|
1532
|
+
if (value?.endsWith("/") && value !== "/" && value !== `${basepath}/`) return value.slice(0, -1);
|
|
1533
|
+
return value;
|
|
1534
|
+
}
|
|
1535
|
+
/**
|
|
1536
|
+
* Compare two pathnames for exact equality after normalizing trailing slashes
|
|
1537
|
+
* relative to the provided `basepath`.
|
|
1538
|
+
*/
|
|
1539
|
+
function exactPathTest(pathName1, pathName2, basepath) {
|
|
1540
|
+
return removeTrailingSlash(pathName1, basepath) === removeTrailingSlash(pathName2, basepath);
|
|
1541
|
+
}
|
|
1542
|
+
/**
|
|
1543
|
+
* Resolve a destination path against a base, honoring trailing-slash policy
|
|
1544
|
+
* and supporting relative segments (`.`/`..`) and absolute `to` values.
|
|
1545
|
+
*/
|
|
1546
|
+
function resolvePath({ base, to, trailingSlash = "never", cache }) {
|
|
1547
|
+
const isAbsolute = to.startsWith("/");
|
|
1548
|
+
const isBase = !isAbsolute && to === ".";
|
|
1549
|
+
let key;
|
|
1550
|
+
if (cache) {
|
|
1551
|
+
key = isAbsolute ? to : isBase ? base : base + "\0" + to;
|
|
1552
|
+
const cached = cache.get(key);
|
|
1553
|
+
if (cached) return cached;
|
|
1554
|
+
}
|
|
1555
|
+
let baseSegments;
|
|
1556
|
+
if (isBase) baseSegments = base.split("/");
|
|
1557
|
+
else if (isAbsolute) baseSegments = to.split("/");
|
|
1558
|
+
else {
|
|
1559
|
+
baseSegments = base.split("/");
|
|
1560
|
+
while (baseSegments.length > 1 && last(baseSegments) === "") baseSegments.pop();
|
|
1561
|
+
const toSegments = to.split("/");
|
|
1562
|
+
for (let index = 0, length = toSegments.length; index < length; index++) {
|
|
1563
|
+
const value = toSegments[index];
|
|
1564
|
+
if (value === "") {
|
|
1565
|
+
if (!index) baseSegments = [value];
|
|
1566
|
+
else if (index === length - 1) baseSegments.push(value);
|
|
1567
|
+
} else if (value === "..") baseSegments.pop();
|
|
1568
|
+
else if (value === ".") {} else baseSegments.push(value);
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
if (baseSegments.length > 1) {
|
|
1572
|
+
if (last(baseSegments) === "") {
|
|
1573
|
+
if (trailingSlash === "never") baseSegments.pop();
|
|
1574
|
+
} else if (trailingSlash === "always") baseSegments.push("");
|
|
1575
|
+
}
|
|
1576
|
+
let segment;
|
|
1577
|
+
let joined = "";
|
|
1578
|
+
for (let i = 0; i < baseSegments.length; i++) {
|
|
1579
|
+
if (i > 0) joined += "/";
|
|
1580
|
+
const part = baseSegments[i];
|
|
1581
|
+
if (!part) continue;
|
|
1582
|
+
segment = parseSegment(part, 0, segment);
|
|
1583
|
+
const kind = segment[0];
|
|
1584
|
+
if (kind === 0) {
|
|
1585
|
+
joined += part;
|
|
1586
|
+
continue;
|
|
1587
|
+
}
|
|
1588
|
+
const end = segment[5];
|
|
1589
|
+
const prefix = part.substring(0, segment[1]);
|
|
1590
|
+
const suffix = part.substring(segment[4], end);
|
|
1591
|
+
const value = part.substring(segment[2], segment[3]);
|
|
1592
|
+
if (kind === 1) joined += prefix || suffix ? `${prefix}{$${value}}${suffix}` : `$${value}`;
|
|
1593
|
+
else if (kind === 2) joined += prefix || suffix ? `${prefix}{$}${suffix}` : "$";
|
|
1594
|
+
else joined += `${prefix}{-$${value}}${suffix}`;
|
|
1595
|
+
}
|
|
1596
|
+
joined = cleanPath(joined);
|
|
1597
|
+
const result = joined || "/";
|
|
1598
|
+
if (key && cache) cache.set(key, result);
|
|
1599
|
+
return result;
|
|
1600
|
+
}
|
|
1601
|
+
/**
|
|
1602
|
+
* Create a pre-compiled decode config from allowed characters.
|
|
1603
|
+
* This should be called once at router initialization.
|
|
1604
|
+
*/
|
|
1605
|
+
function compileDecodeCharMap(pathParamsAllowedCharacters) {
|
|
1606
|
+
const charMap = new Map(pathParamsAllowedCharacters.map((char) => [encodeURIComponent(char), char]));
|
|
1607
|
+
const pattern = Array.from(charMap.keys()).map((key) => key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
1608
|
+
const regex = new RegExp(pattern, "g");
|
|
1609
|
+
return (encoded) => encoded.replace(regex, (match) => charMap.get(match) ?? match);
|
|
1610
|
+
}
|
|
1611
|
+
function encodeParam(key, params, decoder) {
|
|
1612
|
+
const value = params[key];
|
|
1613
|
+
if (typeof value !== "string") return value;
|
|
1614
|
+
if (key === "_splat") {
|
|
1615
|
+
if (/^[a-zA-Z0-9\-._~!/]*$/.test(value)) return value;
|
|
1616
|
+
return value.split("/").map((segment) => encodePathParam(segment, decoder)).join("/");
|
|
1617
|
+
} else return encodePathParam(value, decoder);
|
|
1618
|
+
}
|
|
1619
|
+
/**
|
|
1620
|
+
* Interpolate params and wildcards into a route path template.
|
|
1621
|
+
*
|
|
1622
|
+
* - Encodes params safely (configurable allowed characters)
|
|
1623
|
+
* - Supports `{-$optional}` segments, `{prefix{$id}suffix}` and `{$}` wildcards
|
|
1624
|
+
*/
|
|
1625
|
+
function interpolatePath({ path, params, decoder, ...rest }) {
|
|
1626
|
+
let isMissingParams = false;
|
|
1627
|
+
const usedParams = Object.create(null);
|
|
1628
|
+
if (!path || path === "/") return {
|
|
1629
|
+
interpolatedPath: "/",
|
|
1630
|
+
usedParams,
|
|
1631
|
+
isMissingParams
|
|
1632
|
+
};
|
|
1633
|
+
if (!path.includes("$")) return {
|
|
1634
|
+
interpolatedPath: path,
|
|
1635
|
+
usedParams,
|
|
1636
|
+
isMissingParams
|
|
1637
|
+
};
|
|
1638
|
+
if (path.indexOf("{") === -1) {
|
|
1639
|
+
const length = path.length;
|
|
1640
|
+
let cursor = 0;
|
|
1641
|
+
let joined = "";
|
|
1642
|
+
while (cursor < length) {
|
|
1643
|
+
while (cursor < length && path.charCodeAt(cursor) === 47) cursor++;
|
|
1644
|
+
if (cursor >= length) break;
|
|
1645
|
+
const start = cursor;
|
|
1646
|
+
let end = path.indexOf("/", cursor);
|
|
1647
|
+
if (end === -1) end = length;
|
|
1648
|
+
cursor = end;
|
|
1649
|
+
const part = path.substring(start, end);
|
|
1650
|
+
if (!part) continue;
|
|
1651
|
+
if (part.charCodeAt(0) === 36) if (part.length === 1) {
|
|
1652
|
+
const splat = params._splat;
|
|
1653
|
+
usedParams._splat = splat;
|
|
1654
|
+
usedParams["*"] = splat;
|
|
1655
|
+
if (!splat) {
|
|
1656
|
+
isMissingParams = true;
|
|
1657
|
+
continue;
|
|
1658
|
+
}
|
|
1659
|
+
const value = encodeParam("_splat", params, decoder);
|
|
1660
|
+
joined += "/" + value;
|
|
1661
|
+
} else {
|
|
1662
|
+
const key = part.substring(1);
|
|
1663
|
+
if (!isMissingParams && !(key in params)) isMissingParams = true;
|
|
1664
|
+
usedParams[key] = params[key];
|
|
1665
|
+
const value = encodeParam(key, params, decoder) ?? "undefined";
|
|
1666
|
+
joined += "/" + value;
|
|
1667
|
+
}
|
|
1668
|
+
else joined += "/" + part;
|
|
1669
|
+
}
|
|
1670
|
+
if (path.endsWith("/")) joined += "/";
|
|
1671
|
+
return {
|
|
1672
|
+
usedParams,
|
|
1673
|
+
interpolatedPath: joined || "/",
|
|
1674
|
+
isMissingParams
|
|
1675
|
+
};
|
|
1676
|
+
}
|
|
1677
|
+
const length = path.length;
|
|
1678
|
+
let cursor = 0;
|
|
1679
|
+
let segment;
|
|
1680
|
+
let joined = "";
|
|
1681
|
+
while (cursor < length) {
|
|
1682
|
+
const start = cursor;
|
|
1683
|
+
segment = parseSegment(path, start, segment);
|
|
1684
|
+
const end = segment[5];
|
|
1685
|
+
cursor = end + 1;
|
|
1686
|
+
if (start === end) continue;
|
|
1687
|
+
const kind = segment[0];
|
|
1688
|
+
if (kind === 0) {
|
|
1689
|
+
joined += "/" + path.substring(start, end);
|
|
1690
|
+
continue;
|
|
1691
|
+
}
|
|
1692
|
+
if (kind === 2) {
|
|
1693
|
+
const splat = params._splat;
|
|
1694
|
+
usedParams._splat = splat;
|
|
1695
|
+
usedParams["*"] = splat;
|
|
1696
|
+
const prefix = path.substring(start, segment[1]);
|
|
1697
|
+
const suffix = path.substring(segment[4], end);
|
|
1698
|
+
if (!splat) {
|
|
1699
|
+
isMissingParams = true;
|
|
1700
|
+
if (prefix || suffix) joined += "/" + prefix + suffix;
|
|
1701
|
+
continue;
|
|
1702
|
+
}
|
|
1703
|
+
const value = encodeParam("_splat", params, decoder);
|
|
1704
|
+
joined += "/" + prefix + value + suffix;
|
|
1705
|
+
continue;
|
|
1706
|
+
}
|
|
1707
|
+
if (kind === 1) {
|
|
1708
|
+
const key = path.substring(segment[2], segment[3]);
|
|
1709
|
+
if (!isMissingParams && !(key in params)) isMissingParams = true;
|
|
1710
|
+
usedParams[key] = params[key];
|
|
1711
|
+
const prefix = path.substring(start, segment[1]);
|
|
1712
|
+
const suffix = path.substring(segment[4], end);
|
|
1713
|
+
const value = encodeParam(key, params, decoder) ?? "undefined";
|
|
1714
|
+
joined += "/" + prefix + value + suffix;
|
|
1715
|
+
continue;
|
|
1716
|
+
}
|
|
1717
|
+
if (kind === 3) {
|
|
1718
|
+
const key = path.substring(segment[2], segment[3]);
|
|
1719
|
+
const valueRaw = params[key];
|
|
1720
|
+
if (valueRaw == null) continue;
|
|
1721
|
+
usedParams[key] = valueRaw;
|
|
1722
|
+
const prefix = path.substring(start, segment[1]);
|
|
1723
|
+
const suffix = path.substring(segment[4], end);
|
|
1724
|
+
const value = encodeParam(key, params, decoder) ?? "";
|
|
1725
|
+
joined += "/" + prefix + value + suffix;
|
|
1726
|
+
continue;
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
if (path.endsWith("/")) joined += "/";
|
|
1730
|
+
return {
|
|
1731
|
+
usedParams,
|
|
1732
|
+
interpolatedPath: joined || "/",
|
|
1733
|
+
isMissingParams
|
|
1734
|
+
};
|
|
1735
|
+
}
|
|
1736
|
+
function encodePathParam(value, decoder) {
|
|
1737
|
+
const encoded = encodeURIComponent(value);
|
|
1738
|
+
return decoder?.(encoded) ?? encoded;
|
|
1739
|
+
}
|
|
1740
|
+
//#endregion
|
|
1741
|
+
//#region ../../node_modules/.bun/@tanstack+router-core@1.168.2/node_modules/@tanstack/router-core/dist/esm/not-found.js
|
|
1742
|
+
/** Determine if a value is a TanStack Router not-found error. */
|
|
1743
|
+
function isNotFound(obj) {
|
|
1744
|
+
return !!obj?.isNotFound;
|
|
1745
|
+
}
|
|
1746
|
+
//#endregion
|
|
1747
|
+
//#region ../../node_modules/.bun/@tanstack+router-core@1.168.2/node_modules/@tanstack/router-core/dist/esm/root.js
|
|
1748
|
+
/** Stable identifier used for the root route in a route tree. */
|
|
1749
|
+
var rootRouteId = "__root__";
|
|
1750
|
+
//#endregion
|
|
1751
|
+
//#region ../../node_modules/.bun/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js
|
|
1752
|
+
/**
|
|
1753
|
+
* @license React
|
|
1754
|
+
* react-jsx-runtime.production.js
|
|
1755
|
+
*
|
|
1756
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1757
|
+
*
|
|
1758
|
+
* This source code is licensed under the MIT license found in the
|
|
1759
|
+
* LICENSE file in the root directory of this source tree.
|
|
1760
|
+
*/
|
|
1761
|
+
var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1762
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
1763
|
+
function jsxProd(type, config, maybeKey) {
|
|
1764
|
+
var key = null;
|
|
1765
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
1766
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
1767
|
+
if ("key" in config) {
|
|
1768
|
+
maybeKey = {};
|
|
1769
|
+
for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
|
|
1770
|
+
} else maybeKey = config;
|
|
1771
|
+
config = maybeKey.ref;
|
|
1772
|
+
return {
|
|
1773
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
1774
|
+
type,
|
|
1775
|
+
key,
|
|
1776
|
+
ref: void 0 !== config ? config : null,
|
|
1777
|
+
props: maybeKey
|
|
1778
|
+
};
|
|
1779
|
+
}
|
|
1780
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1781
|
+
exports.jsx = jsxProd;
|
|
1782
|
+
exports.jsxs = jsxProd;
|
|
1783
|
+
}));
|
|
1784
|
+
//#endregion
|
|
1785
|
+
//#region ../../node_modules/.bun/react@19.2.4/node_modules/react/jsx-runtime.js
|
|
1786
|
+
var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1787
|
+
module.exports = require_react_jsx_runtime_production();
|
|
1788
|
+
}));
|
|
1789
|
+
//#endregion
|
|
1790
|
+
//#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/ClientOnly.js
|
|
1791
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
1792
|
+
/**
|
|
1793
|
+
* Render the children only after the JS has loaded client-side. Use an optional
|
|
1794
|
+
* fallback component if the JS is not yet loaded.
|
|
1795
|
+
*
|
|
1796
|
+
* @example
|
|
1797
|
+
* Render a Chart component if JS loads, renders a simple FakeChart
|
|
1798
|
+
* component server-side or if there is no JS. The FakeChart can have only the
|
|
1799
|
+
* UI without the behavior or be a loading spinner or skeleton.
|
|
1800
|
+
*
|
|
1801
|
+
* ```tsx
|
|
1802
|
+
* return (
|
|
1803
|
+
* <ClientOnly fallback={<FakeChart />}>
|
|
1804
|
+
* <Chart />
|
|
1805
|
+
* </ClientOnly>
|
|
1806
|
+
* )
|
|
1807
|
+
* ```
|
|
1808
|
+
*/
|
|
1809
|
+
function ClientOnly({ children, fallback = null }) {
|
|
1810
|
+
return useHydrated() ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: fallback });
|
|
1811
|
+
}
|
|
1812
|
+
/**
|
|
1813
|
+
* Return a boolean indicating if the JS has been hydrated already.
|
|
1814
|
+
* When doing Server-Side Rendering, the result will always be false.
|
|
1815
|
+
* When doing Client-Side Rendering, the result will always be false on the
|
|
1816
|
+
* first render and true from then on. Even if a new component renders it will
|
|
1817
|
+
* always start with true.
|
|
1818
|
+
*
|
|
1819
|
+
* @example
|
|
1820
|
+
* ```tsx
|
|
1821
|
+
* // Disable a button that needs JS to work.
|
|
1822
|
+
* let hydrated = useHydrated()
|
|
1823
|
+
* return (
|
|
1824
|
+
* <button type="button" disabled={!hydrated} onClick={doSomethingCustom}>
|
|
1825
|
+
* Click me
|
|
1826
|
+
* </button>
|
|
1827
|
+
* )
|
|
1828
|
+
* ```
|
|
1829
|
+
* @returns True if the JS has been hydrated already, false otherwise.
|
|
1830
|
+
*/
|
|
1831
|
+
function useHydrated() {
|
|
1832
|
+
return import_react.useSyncExternalStore(subscribe, () => true, () => false);
|
|
1833
|
+
}
|
|
1834
|
+
function subscribe() {
|
|
1835
|
+
return () => {};
|
|
1836
|
+
}
|
|
1837
|
+
//#endregion
|
|
1838
|
+
//#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/routerContext.js
|
|
1839
|
+
var routerContext = import_react.createContext(null);
|
|
1840
|
+
//#endregion
|
|
1841
|
+
//#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/useRouter.js
|
|
1842
|
+
/**
|
|
1843
|
+
* Access the current TanStack Router instance from React context.
|
|
1844
|
+
* Must be used within a `RouterProvider`.
|
|
1845
|
+
*
|
|
1846
|
+
* Options:
|
|
1847
|
+
* - `warn`: Log a warning if no router context is found (default: true).
|
|
1848
|
+
*
|
|
1849
|
+
* @returns The registered router instance.
|
|
1850
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook
|
|
1851
|
+
*/
|
|
1852
|
+
function useRouter(opts) {
|
|
1853
|
+
return import_react.useContext(routerContext);
|
|
1854
|
+
}
|
|
1855
|
+
//#endregion
|
|
1856
|
+
//#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/matchContext.js
|
|
1857
|
+
var matchContext = import_react.createContext(void 0);
|
|
1858
|
+
var dummyMatchContext = import_react.createContext(void 0);
|
|
1859
|
+
//#endregion
|
|
1860
|
+
//#region ../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
|
|
1861
|
+
/**
|
|
1862
|
+
* @license React
|
|
1863
|
+
* use-sync-external-store-shim.production.js
|
|
1864
|
+
*
|
|
1865
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1866
|
+
*
|
|
1867
|
+
* This source code is licensed under the MIT license found in the
|
|
1868
|
+
* LICENSE file in the root directory of this source tree.
|
|
1869
|
+
*/
|
|
1870
|
+
var require_use_sync_external_store_shim_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1871
|
+
var React = require_react();
|
|
1872
|
+
function is(x, y) {
|
|
1873
|
+
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
1874
|
+
}
|
|
1875
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is, useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue;
|
|
1876
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
1877
|
+
var value = getSnapshot(), _useState = useState({ inst: {
|
|
1878
|
+
value,
|
|
1879
|
+
getSnapshot
|
|
1880
|
+
} }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
1881
|
+
useLayoutEffect(function() {
|
|
1882
|
+
inst.value = value;
|
|
1883
|
+
inst.getSnapshot = getSnapshot;
|
|
1884
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
1885
|
+
}, [
|
|
1886
|
+
subscribe,
|
|
1887
|
+
value,
|
|
1888
|
+
getSnapshot
|
|
1889
|
+
]);
|
|
1890
|
+
useEffect(function() {
|
|
1891
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
1892
|
+
return subscribe(function() {
|
|
1893
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
1894
|
+
});
|
|
1895
|
+
}, [subscribe]);
|
|
1896
|
+
useDebugValue(value);
|
|
1897
|
+
return value;
|
|
1898
|
+
}
|
|
1899
|
+
function checkIfSnapshotChanged(inst) {
|
|
1900
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
1901
|
+
inst = inst.value;
|
|
1902
|
+
try {
|
|
1903
|
+
var nextValue = latestGetSnapshot();
|
|
1904
|
+
return !objectIs(inst, nextValue);
|
|
1905
|
+
} catch (error) {
|
|
1906
|
+
return !0;
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
1910
|
+
return getSnapshot();
|
|
1911
|
+
}
|
|
1912
|
+
var shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
1913
|
+
exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
1914
|
+
}));
|
|
1915
|
+
//#endregion
|
|
1916
|
+
//#region ../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/shim/index.js
|
|
1917
|
+
var require_shim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1918
|
+
module.exports = require_use_sync_external_store_shim_production();
|
|
1919
|
+
}));
|
|
1920
|
+
//#endregion
|
|
1921
|
+
//#region ../../node_modules/.bun/use-sync-external-store@1.6.0+b1ab299f0a400331/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js
|
|
1922
|
+
/**
|
|
1923
|
+
* @license React
|
|
1924
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
1925
|
+
*
|
|
1926
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1927
|
+
*
|
|
1928
|
+
* This source code is licensed under the MIT license found in the
|
|
1929
|
+
* LICENSE file in the root directory of this source tree.
|
|
1930
|
+
*/
|
|
1931
|
+
var require_with_selector_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1932
|
+
var React = require_react(), shim = require_shim();
|
|
1933
|
+
function is(x, y) {
|
|
1934
|
+
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
1935
|
+
}
|
|
1936
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim.useSyncExternalStore, useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue;
|
|
1937
|
+
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
1938
|
+
var instRef = useRef(null);
|
|
1939
|
+
if (null === instRef.current) {
|
|
1940
|
+
var inst = {
|
|
1941
|
+
hasValue: !1,
|
|
1942
|
+
value: null
|
|
1943
|
+
};
|
|
1944
|
+
instRef.current = inst;
|
|
1945
|
+
} else inst = instRef.current;
|
|
1946
|
+
instRef = useMemo(function() {
|
|
1947
|
+
function memoizedSelector(nextSnapshot) {
|
|
1948
|
+
if (!hasMemo) {
|
|
1949
|
+
hasMemo = !0;
|
|
1950
|
+
memoizedSnapshot = nextSnapshot;
|
|
1951
|
+
nextSnapshot = selector(nextSnapshot);
|
|
1952
|
+
if (void 0 !== isEqual && inst.hasValue) {
|
|
1953
|
+
var currentSelection = inst.value;
|
|
1954
|
+
if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection;
|
|
1955
|
+
}
|
|
1956
|
+
return memoizedSelection = nextSnapshot;
|
|
1957
|
+
}
|
|
1958
|
+
currentSelection = memoizedSelection;
|
|
1959
|
+
if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
|
|
1960
|
+
var nextSelection = selector(nextSnapshot);
|
|
1961
|
+
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection;
|
|
1962
|
+
memoizedSnapshot = nextSnapshot;
|
|
1963
|
+
return memoizedSelection = nextSelection;
|
|
1964
|
+
}
|
|
1965
|
+
var hasMemo = !1, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
1966
|
+
return [function() {
|
|
1967
|
+
return memoizedSelector(getSnapshot());
|
|
1968
|
+
}, null === maybeGetServerSnapshot ? void 0 : function() {
|
|
1969
|
+
return memoizedSelector(maybeGetServerSnapshot());
|
|
1970
|
+
}];
|
|
1971
|
+
}, [
|
|
1972
|
+
getSnapshot,
|
|
1973
|
+
getServerSnapshot,
|
|
1974
|
+
selector,
|
|
1975
|
+
isEqual
|
|
1976
|
+
]);
|
|
1977
|
+
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
1978
|
+
useEffect(function() {
|
|
1979
|
+
inst.hasValue = !0;
|
|
1980
|
+
inst.value = value;
|
|
1981
|
+
}, [value]);
|
|
1982
|
+
useDebugValue(value);
|
|
1983
|
+
return value;
|
|
1984
|
+
};
|
|
1985
|
+
}));
|
|
1986
|
+
//#endregion
|
|
1987
|
+
//#region ../../node_modules/.bun/@tanstack+react-store@0.9.2+bf16f8eded5e12ee/node_modules/@tanstack/react-store/dist/esm/useStore.js
|
|
1988
|
+
var import_with_selector = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1989
|
+
module.exports = require_with_selector_production();
|
|
1990
|
+
})))();
|
|
1991
|
+
function defaultCompare(a, b) {
|
|
1992
|
+
return a === b;
|
|
1993
|
+
}
|
|
1994
|
+
function useStore(atom, selector, compare = defaultCompare) {
|
|
1995
|
+
const subscribe = (0, import_react.useCallback)((handleStoreChange) => {
|
|
1996
|
+
if (!atom) return () => {};
|
|
1997
|
+
const { unsubscribe } = atom.subscribe(handleStoreChange);
|
|
1998
|
+
return unsubscribe;
|
|
1999
|
+
}, [atom]);
|
|
2000
|
+
const boundGetSnapshot = (0, import_react.useCallback)(() => atom?.get(), [atom]);
|
|
2001
|
+
return (0, import_with_selector.useSyncExternalStoreWithSelector)(subscribe, boundGetSnapshot, boundGetSnapshot, selector, compare);
|
|
2002
|
+
}
|
|
2003
|
+
//#endregion
|
|
2004
|
+
//#region ../../node_modules/.bun/react-dom@19.2.4+b1ab299f0a400331/node_modules/react-dom/cjs/react-dom.production.js
|
|
2005
|
+
/**
|
|
2006
|
+
* @license React
|
|
2007
|
+
* react-dom.production.js
|
|
2008
|
+
*
|
|
2009
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2010
|
+
*
|
|
2011
|
+
* This source code is licensed under the MIT license found in the
|
|
2012
|
+
* LICENSE file in the root directory of this source tree.
|
|
2013
|
+
*/
|
|
2014
|
+
var require_react_dom_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2015
|
+
var React = require_react();
|
|
2016
|
+
function formatProdErrorMessage(code) {
|
|
2017
|
+
var url = "https://react.dev/errors/" + code;
|
|
2018
|
+
if (1 < arguments.length) {
|
|
2019
|
+
url += "?args[]=" + encodeURIComponent(arguments[1]);
|
|
2020
|
+
for (var i = 2; i < arguments.length; i++) url += "&args[]=" + encodeURIComponent(arguments[i]);
|
|
2021
|
+
}
|
|
2022
|
+
return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
|
|
2023
|
+
}
|
|
2024
|
+
function noop() {}
|
|
2025
|
+
var Internals = {
|
|
2026
|
+
d: {
|
|
2027
|
+
f: noop,
|
|
2028
|
+
r: function() {
|
|
2029
|
+
throw Error(formatProdErrorMessage(522));
|
|
2030
|
+
},
|
|
2031
|
+
D: noop,
|
|
2032
|
+
C: noop,
|
|
2033
|
+
L: noop,
|
|
2034
|
+
m: noop,
|
|
2035
|
+
X: noop,
|
|
2036
|
+
S: noop,
|
|
2037
|
+
M: noop
|
|
2038
|
+
},
|
|
2039
|
+
p: 0,
|
|
2040
|
+
findDOMNode: null
|
|
2041
|
+
}, REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
2042
|
+
function createPortal$1(children, containerInfo, implementation) {
|
|
2043
|
+
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
|
2044
|
+
return {
|
|
2045
|
+
$$typeof: REACT_PORTAL_TYPE,
|
|
2046
|
+
key: null == key ? null : "" + key,
|
|
2047
|
+
children,
|
|
2048
|
+
containerInfo,
|
|
2049
|
+
implementation
|
|
2050
|
+
};
|
|
2051
|
+
}
|
|
2052
|
+
var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
2053
|
+
function getCrossOriginStringAs(as, input) {
|
|
2054
|
+
if ("font" === as) return "";
|
|
2055
|
+
if ("string" === typeof input) return "use-credentials" === input ? input : "";
|
|
2056
|
+
}
|
|
2057
|
+
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
|
2058
|
+
exports.createPortal = function(children, container) {
|
|
2059
|
+
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
|
2060
|
+
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType) throw Error(formatProdErrorMessage(299));
|
|
2061
|
+
return createPortal$1(children, container, null, key);
|
|
2062
|
+
};
|
|
2063
|
+
exports.flushSync = function(fn) {
|
|
2064
|
+
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
|
2065
|
+
try {
|
|
2066
|
+
if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
|
|
2067
|
+
} finally {
|
|
2068
|
+
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
|
|
2069
|
+
}
|
|
2070
|
+
};
|
|
2071
|
+
exports.preconnect = function(href, options) {
|
|
2072
|
+
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
|
2073
|
+
};
|
|
2074
|
+
exports.prefetchDNS = function(href) {
|
|
2075
|
+
"string" === typeof href && Internals.d.D(href);
|
|
2076
|
+
};
|
|
2077
|
+
exports.preinit = function(href, options) {
|
|
2078
|
+
if ("string" === typeof href && options && "string" === typeof options.as) {
|
|
2079
|
+
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
|
2080
|
+
"style" === as ? Internals.d.S(href, "string" === typeof options.precedence ? options.precedence : void 0, {
|
|
2081
|
+
crossOrigin,
|
|
2082
|
+
integrity,
|
|
2083
|
+
fetchPriority
|
|
2084
|
+
}) : "script" === as && Internals.d.X(href, {
|
|
2085
|
+
crossOrigin,
|
|
2086
|
+
integrity,
|
|
2087
|
+
fetchPriority,
|
|
2088
|
+
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
2089
|
+
});
|
|
2090
|
+
}
|
|
2091
|
+
};
|
|
2092
|
+
exports.preinitModule = function(href, options) {
|
|
2093
|
+
if ("string" === typeof href) if ("object" === typeof options && null !== options) {
|
|
2094
|
+
if (null == options.as || "script" === options.as) {
|
|
2095
|
+
var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
|
|
2096
|
+
Internals.d.M(href, {
|
|
2097
|
+
crossOrigin,
|
|
2098
|
+
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
2099
|
+
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
2100
|
+
});
|
|
2101
|
+
}
|
|
2102
|
+
} else options ?? Internals.d.M(href);
|
|
2103
|
+
};
|
|
2104
|
+
exports.preload = function(href, options) {
|
|
2105
|
+
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
|
2106
|
+
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
|
|
2107
|
+
Internals.d.L(href, as, {
|
|
2108
|
+
crossOrigin,
|
|
2109
|
+
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
2110
|
+
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
|
2111
|
+
type: "string" === typeof options.type ? options.type : void 0,
|
|
2112
|
+
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
|
2113
|
+
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
|
2114
|
+
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
|
2115
|
+
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
|
2116
|
+
media: "string" === typeof options.media ? options.media : void 0
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
2119
|
+
};
|
|
2120
|
+
exports.preloadModule = function(href, options) {
|
|
2121
|
+
if ("string" === typeof href) if (options) {
|
|
2122
|
+
var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
|
|
2123
|
+
Internals.d.m(href, {
|
|
2124
|
+
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
|
2125
|
+
crossOrigin,
|
|
2126
|
+
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
|
2127
|
+
});
|
|
2128
|
+
} else Internals.d.m(href);
|
|
2129
|
+
};
|
|
2130
|
+
exports.requestFormReset = function(form) {
|
|
2131
|
+
Internals.d.r(form);
|
|
2132
|
+
};
|
|
2133
|
+
exports.unstable_batchedUpdates = function(fn, a) {
|
|
2134
|
+
return fn(a);
|
|
2135
|
+
};
|
|
2136
|
+
exports.useFormState = function(action, initialState, permalink) {
|
|
2137
|
+
return ReactSharedInternals.H.useFormState(action, initialState, permalink);
|
|
2138
|
+
};
|
|
2139
|
+
exports.useFormStatus = function() {
|
|
2140
|
+
return ReactSharedInternals.H.useHostTransitionStatus();
|
|
2141
|
+
};
|
|
2142
|
+
exports.version = "19.2.4";
|
|
2143
|
+
}));
|
|
2144
|
+
//#endregion
|
|
2145
|
+
//#region ../../node_modules/.bun/react-dom@19.2.4+b1ab299f0a400331/node_modules/react-dom/index.js
|
|
2146
|
+
var require_react_dom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2147
|
+
function checkDCE() {
|
|
2148
|
+
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") return;
|
|
2149
|
+
try {
|
|
2150
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
|
2151
|
+
} catch (err) {
|
|
2152
|
+
console.error(err);
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
checkDCE();
|
|
2156
|
+
module.exports = require_react_dom_production();
|
|
2157
|
+
}));
|
|
2158
|
+
//#endregion
|
|
2159
|
+
export { arraysEqual as A, last as B, findRouteMatch as C, createLRUCache as D, processRouteTree as E, escapeHtml as F, useIntersectionObserver as G, replaceEqualDeep as H, functionalUpdate as I, require_react as J, useLayoutEffect as K, isDangerousProtocol as L, decodePath as M, deepEqual as N, invariant as O, encodePathLikeUrl as P, isModuleNotFoundError as R, findFlatMatch as S, processRouteMasks as T, reactUse as U, nullReplaceEqualDeep as V, useForwardedRef as W, removeTrailingSlash as _, useRouter as a, trimPathLeft as b, useHydrated as c, isNotFound as d, cleanPath as f, joinPaths as g, interpolatePath as h, matchContext as i, createControlledPromise as j, DEFAULT_PROTOCOL_ALLOWLIST as k, require_jsx_runtime as l, exactPathTest as m, useStore as n, routerContext as o, compileDecodeCharMap as p, usePrevious as q, dummyMatchContext as r, ClientOnly as s, require_react_dom as t, rootRouteId as u, resolvePath as v, findSingleMatch as w, trimPathRight as x, trimPath as y, isPromise as z };
|