@bgskinner2/ts-utils 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -14
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -48
- package/dist/index.d.ts +54 -48
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +10 -2
package/dist/index.d.cts
CHANGED
|
@@ -739,6 +739,58 @@ declare const isRecordOf: <V>(value: unknown, typeGuard: TTypeGuard<V>) => value
|
|
|
739
739
|
* @returns A type guard function that returns `true` if all `requiredKeys` are found and defined.
|
|
740
740
|
*/
|
|
741
741
|
declare const hasDefinedKeys: <T extends object>(requiredKeys: (keyof T)[]) => ((value: unknown) => value is T);
|
|
742
|
+
/**
|
|
743
|
+
* ## 🧩 isShape — Recursive Structural Type Guard Factory
|
|
744
|
+
*
|
|
745
|
+
* Creates a **high-fidelity type guard** that validates whether an unknown object
|
|
746
|
+
* conforms to a specific structural "contract" defined by a schema of guards.
|
|
747
|
+
*
|
|
748
|
+
* ---
|
|
749
|
+
*
|
|
750
|
+
* ### ⚙️ Core Purpose
|
|
751
|
+
* - 🔹 **Eliminate `as` casting**: Moves from speculative assertions to deterministic verification.
|
|
752
|
+
* - 🔹 **Recursive Validation**: Safely audits nested object trees by composing guards.
|
|
753
|
+
* - 🔹 **Compile-Time Synchronization**: Using `[K in keyof T]` ensures the schema
|
|
754
|
+
* stays in sync with the interface. If the interface changes, the guard will fail to compile.
|
|
755
|
+
*
|
|
756
|
+
* ---
|
|
757
|
+
*
|
|
758
|
+
* ### 📘 Example Usage
|
|
759
|
+
* ```ts
|
|
760
|
+
* interface UserProfile {
|
|
761
|
+
* id: string;
|
|
762
|
+
* settings: { theme: 'dark' | 'light' };
|
|
763
|
+
* }
|
|
764
|
+
*
|
|
765
|
+
* // Define the contract once
|
|
766
|
+
* const isUserProfile = isShape<UserProfile>({
|
|
767
|
+
* id: isString,
|
|
768
|
+
* settings: isShape({
|
|
769
|
+
* theme: isInArray(['dark', 'light'] as const)
|
|
770
|
+
* })
|
|
771
|
+
* });
|
|
772
|
+
*
|
|
773
|
+
* const rawData: unknown = await fetchApi();
|
|
774
|
+
*
|
|
775
|
+
* if (isUserProfile(rawData)) {
|
|
776
|
+
* // ✅ rawData is now fully narrowed, including nested properties.
|
|
777
|
+
* console.log(rawData.settings.theme);
|
|
778
|
+
* }
|
|
779
|
+
* ```
|
|
780
|
+
*
|
|
781
|
+
* ---
|
|
782
|
+
*
|
|
783
|
+
* ### 📌 Notes
|
|
784
|
+
* - **Exorcises Ghost Objects**: Unlike `{} as T`, this verifies every required key.
|
|
785
|
+
* - **Optional Support**: If a key is missing in the value but allowed in the schema,
|
|
786
|
+
* the individual property guard must handle the `undefined` case.
|
|
787
|
+
* - **Zero Casts**: Internally leverages `isKeyInObject` for type-safe property discovery.
|
|
788
|
+
*
|
|
789
|
+
* @typeParam T - The target interface or object type to validate.
|
|
790
|
+
* @param schema - A mapping of keys from `T` to their corresponding `TTypeGuard`.
|
|
791
|
+
* @returns A type guard function that narrows `unknown` to `T`.
|
|
792
|
+
*/
|
|
793
|
+
declare const isShape: <T extends object>(schema: { [K in keyof T]: TTypeGuard<T[K]>; }) => TTypeGuard<T>;
|
|
742
794
|
|
|
743
795
|
/**
|
|
744
796
|
* Checks if a value is a **Buffer-like object**.
|
|
@@ -1056,6 +1108,7 @@ declare const CollectionTypeGuards: {
|
|
|
1056
1108
|
readonly isKeyOfArray: <T extends readonly (string | number | symbol)[]>(keys: T) => TTypeGuard<T[number]>;
|
|
1057
1109
|
readonly isInArray: <T>(target: readonly T[]) => TTypeGuard<T | undefined>;
|
|
1058
1110
|
readonly hasKeys: <T extends object>(requiredKeys: (keyof T)[]) => ((value: unknown) => value is T);
|
|
1111
|
+
readonly isShape: <T extends object>(schema: { [K in keyof T]: TTypeGuard<T[K]>; }) => TTypeGuard<T>;
|
|
1059
1112
|
};
|
|
1060
1113
|
|
|
1061
1114
|
/**
|
|
@@ -2324,52 +2377,5 @@ declare const ReactProcessorUtils: {
|
|
|
2324
2377
|
readonly extractDOMProps: typeof extractDOMProps;
|
|
2325
2378
|
readonly filterChildrenByDisplayName: typeof filterChildrenByDisplayName;
|
|
2326
2379
|
};
|
|
2327
|
-
/**
|
|
2328
|
-
* =============================================================================
|
|
2329
|
-
* Processors Folder / Module
|
|
2330
|
-
* =============================================================================
|
|
2331
|
-
*
|
|
2332
|
-
* ## Role / Purpose
|
|
2333
|
-
*
|
|
2334
|
-
* **Role:**
|
|
2335
|
-
* The `processors/` folder contains reusable functions that process, transform,
|
|
2336
|
-
* or handle data in a meaningful way. These functions are generally stateless,
|
|
2337
|
-
* deterministic, and focused on specific operations or domains.
|
|
2338
|
-
*
|
|
2339
|
-
* - Responsible for handling transformations, computations, and controlled
|
|
2340
|
-
* side-effects (e.g., network calls, React ref handling, HTML processing).
|
|
2341
|
-
* - Exists to provide a centralized, organized toolbox of utility functions
|
|
2342
|
-
* that can be reused across the application.
|
|
2343
|
-
*
|
|
2344
|
-
* ---
|
|
2345
|
-
*
|
|
2346
|
-
* ## Guidelines
|
|
2347
|
-
*
|
|
2348
|
-
* **✅ What goes here:**
|
|
2349
|
-
* - Pure utility functions that transform or process data
|
|
2350
|
-
* - Async helpers and network-related utilities (fetch, retry, delay)
|
|
2351
|
-
* - Domain-specific processors: HTML, strings, URLs, React refs, time/durations
|
|
2352
|
-
* - Example: `function makeStringKebabCase(str: string): string {...}`
|
|
2353
|
-
* - Example: `function extractFirstImageSrc(html: string): string | null {...}`
|
|
2354
|
-
* - Example: `async function fetchJson<T>(url: string): Promise<T> {...}`
|
|
2355
|
-
*
|
|
2356
|
-
* **🚫 What does NOT go here:**
|
|
2357
|
-
* - Runtime assertion functions or validators
|
|
2358
|
-
* - Type guards or type-refinement functions
|
|
2359
|
-
* - Generic array/object helpers (use `common/` instead)
|
|
2360
|
-
*
|
|
2361
|
-
* ---
|
|
2362
|
-
*
|
|
2363
|
-
* ## Benefits
|
|
2364
|
-
*
|
|
2365
|
-
* - Groups all data-processing utilities in one place for discoverability
|
|
2366
|
-
* - Encourages consistent patterns for transformations and side-effect handling
|
|
2367
|
-
* - Improves maintainability by separating processors from guards, assertions,
|
|
2368
|
-
* and generic helpers
|
|
2369
|
-
* - Makes it easier to scale and add new processors without polluting unrelated
|
|
2370
|
-
* folders
|
|
2371
|
-
* - Optional link: Related folders include `guards/`, `common/`, and `transformers/`
|
|
2372
|
-
*
|
|
2373
|
-
*/
|
|
2374
2380
|
|
|
2375
|
-
export { ArrayUtils, AssertionUtils, CollectionTypeGuards, ColorUtils, ComputationUtils, CoreTypeGuards, DebugUtils, DomUtils, FormatTypeGuards, LinkUtils, ObjectUtils, ProcessorUtils, ReactProcessorUtils, ReactTypeGuards, RenamedArrayMethods, RenamedObjectMethods, TransformersUtils, arrayFilter, arrayFilterNonNullable, arrayFlat, arrayFlatMap, arrayForEach, arrayIncludes, arrayMap, arrayReduce, assertIsAbsoluteUrl, assertIsArray, assertIsBigInt, assertIsBoolean, assertIsBufferLikeObject, assertIsCamelCase, assertIsDefined, assertIsFunction, assertIsInteger, assertIsInternalUrl, assertIsJSONArrayString, assertIsJSONObjectString, assertIsJsonString, assertIsMap, assertIsNil, assertIsNonEmptyString, assertIsNull, assertIsNumber, assertIsRGBTuple, assertIsSet, assertIsString, assertIsSymbol, assertIsUndefined, assertIsWeakMap, assertIsWeakSet, assertObject, capitalizeArray, capitalizeString, capitalizedKeys, contrastTextColor, delay, extractDOMProps, extractRelativePath, fetchJson, filterChildrenByDisplayName, generateKeyMap, getCallerLocation, getKeyboardAction, getLuminance, handleInternalHashScroll, hasChildren, hasDefinedKeys, hasNameMetadata, hasOnClick, hexToHSL, hexToNormalizedRGB, hexToRGB, hexToRGBShorthand, highlight, interpolateColor, isAbsoluteUrl, isArray, isArrayOf, isBigInt, isBoolean, isBufferLikeObject, isCamelCase, isComponentType, isDOMEntry, isDOMPropKey, isDarkColor, isDefined, isElementLike, isElementOfType, isEmail, isForwardRef, isFragment, isFunction, isHTMLString, isHexByteString, isInArray, isInstanceOf, isInteger, isInternalUrl, isJSONArrayString, isJSONObjectString, isJsonString, isKebabCase, isKeyInObject, isKeyOfArray, isKeyOfObject, isLumGreaterThan, isLumLessThan, isMap, isNil, isNonEmptyString, isNull, isNumber, isObject, isPhoneNumber, isPrimitive, isPromise, isPropValid, isRGBTuple, isReactElement, isReactPortal, isRecordOf, isRef, isRefObject, isSet, isSnakeCase, isString, isSymbol, isUndefined, isValidReactNode, isWeakMap, isWeakSet, lazyProxy, logDev, mergeCssVars, mergeEventHandlerClicks, mergeRefs, normalizeImageSrc, normalizeUrl, objectEntries, objectFromEntries, objectGet, objectHas, objectKeys, objectSet, objectValues, preloadImages, retry, serialize, stripHash, toCamelCase, toKebabCase, toKeyByField, toSnakeCase, validateRGB };
|
|
2381
|
+
export { ArrayUtils, AssertionUtils, CollectionTypeGuards, ColorUtils, ComputationUtils, CoreTypeGuards, DebugUtils, DomUtils, FormatTypeGuards, LinkUtils, ObjectUtils, ProcessorUtils, ReactProcessorUtils, ReactTypeGuards, RenamedArrayMethods, RenamedObjectMethods, TransformersUtils, arrayFilter, arrayFilterNonNullable, arrayFlat, arrayFlatMap, arrayForEach, arrayIncludes, arrayMap, arrayReduce, assertIsAbsoluteUrl, assertIsArray, assertIsBigInt, assertIsBoolean, assertIsBufferLikeObject, assertIsCamelCase, assertIsDefined, assertIsFunction, assertIsInteger, assertIsInternalUrl, assertIsJSONArrayString, assertIsJSONObjectString, assertIsJsonString, assertIsMap, assertIsNil, assertIsNonEmptyString, assertIsNull, assertIsNumber, assertIsRGBTuple, assertIsSet, assertIsString, assertIsSymbol, assertIsUndefined, assertIsWeakMap, assertIsWeakSet, assertObject, capitalizeArray, capitalizeString, capitalizedKeys, contrastTextColor, delay, extractDOMProps, extractRelativePath, fetchJson, filterChildrenByDisplayName, generateKeyMap, getCallerLocation, getKeyboardAction, getLuminance, handleInternalHashScroll, hasChildren, hasDefinedKeys, hasNameMetadata, hasOnClick, hexToHSL, hexToNormalizedRGB, hexToRGB, hexToRGBShorthand, highlight, interpolateColor, isAbsoluteUrl, isArray, isArrayOf, isBigInt, isBoolean, isBufferLikeObject, isCamelCase, isComponentType, isDOMEntry, isDOMPropKey, isDarkColor, isDefined, isElementLike, isElementOfType, isEmail, isForwardRef, isFragment, isFunction, isHTMLString, isHexByteString, isInArray, isInstanceOf, isInteger, isInternalUrl, isJSONArrayString, isJSONObjectString, isJsonString, isKebabCase, isKeyInObject, isKeyOfArray, isKeyOfObject, isLumGreaterThan, isLumLessThan, isMap, isNil, isNonEmptyString, isNull, isNumber, isObject, isPhoneNumber, isPrimitive, isPromise, isPropValid, isRGBTuple, isReactElement, isReactPortal, isRecordOf, isRef, isRefObject, isSet, isShape, isSnakeCase, isString, isSymbol, isUndefined, isValidReactNode, isWeakMap, isWeakSet, lazyProxy, logDev, mergeCssVars, mergeEventHandlerClicks, mergeRefs, normalizeImageSrc, normalizeUrl, objectEntries, objectFromEntries, objectGet, objectHas, objectKeys, objectSet, objectValues, preloadImages, retry, serialize, stripHash, toCamelCase, toKebabCase, toKeyByField, toSnakeCase, validateRGB };
|
package/dist/index.d.ts
CHANGED
|
@@ -739,6 +739,58 @@ declare const isRecordOf: <V>(value: unknown, typeGuard: TTypeGuard<V>) => value
|
|
|
739
739
|
* @returns A type guard function that returns `true` if all `requiredKeys` are found and defined.
|
|
740
740
|
*/
|
|
741
741
|
declare const hasDefinedKeys: <T extends object>(requiredKeys: (keyof T)[]) => ((value: unknown) => value is T);
|
|
742
|
+
/**
|
|
743
|
+
* ## 🧩 isShape — Recursive Structural Type Guard Factory
|
|
744
|
+
*
|
|
745
|
+
* Creates a **high-fidelity type guard** that validates whether an unknown object
|
|
746
|
+
* conforms to a specific structural "contract" defined by a schema of guards.
|
|
747
|
+
*
|
|
748
|
+
* ---
|
|
749
|
+
*
|
|
750
|
+
* ### ⚙️ Core Purpose
|
|
751
|
+
* - 🔹 **Eliminate `as` casting**: Moves from speculative assertions to deterministic verification.
|
|
752
|
+
* - 🔹 **Recursive Validation**: Safely audits nested object trees by composing guards.
|
|
753
|
+
* - 🔹 **Compile-Time Synchronization**: Using `[K in keyof T]` ensures the schema
|
|
754
|
+
* stays in sync with the interface. If the interface changes, the guard will fail to compile.
|
|
755
|
+
*
|
|
756
|
+
* ---
|
|
757
|
+
*
|
|
758
|
+
* ### 📘 Example Usage
|
|
759
|
+
* ```ts
|
|
760
|
+
* interface UserProfile {
|
|
761
|
+
* id: string;
|
|
762
|
+
* settings: { theme: 'dark' | 'light' };
|
|
763
|
+
* }
|
|
764
|
+
*
|
|
765
|
+
* // Define the contract once
|
|
766
|
+
* const isUserProfile = isShape<UserProfile>({
|
|
767
|
+
* id: isString,
|
|
768
|
+
* settings: isShape({
|
|
769
|
+
* theme: isInArray(['dark', 'light'] as const)
|
|
770
|
+
* })
|
|
771
|
+
* });
|
|
772
|
+
*
|
|
773
|
+
* const rawData: unknown = await fetchApi();
|
|
774
|
+
*
|
|
775
|
+
* if (isUserProfile(rawData)) {
|
|
776
|
+
* // ✅ rawData is now fully narrowed, including nested properties.
|
|
777
|
+
* console.log(rawData.settings.theme);
|
|
778
|
+
* }
|
|
779
|
+
* ```
|
|
780
|
+
*
|
|
781
|
+
* ---
|
|
782
|
+
*
|
|
783
|
+
* ### 📌 Notes
|
|
784
|
+
* - **Exorcises Ghost Objects**: Unlike `{} as T`, this verifies every required key.
|
|
785
|
+
* - **Optional Support**: If a key is missing in the value but allowed in the schema,
|
|
786
|
+
* the individual property guard must handle the `undefined` case.
|
|
787
|
+
* - **Zero Casts**: Internally leverages `isKeyInObject` for type-safe property discovery.
|
|
788
|
+
*
|
|
789
|
+
* @typeParam T - The target interface or object type to validate.
|
|
790
|
+
* @param schema - A mapping of keys from `T` to their corresponding `TTypeGuard`.
|
|
791
|
+
* @returns A type guard function that narrows `unknown` to `T`.
|
|
792
|
+
*/
|
|
793
|
+
declare const isShape: <T extends object>(schema: { [K in keyof T]: TTypeGuard<T[K]>; }) => TTypeGuard<T>;
|
|
742
794
|
|
|
743
795
|
/**
|
|
744
796
|
* Checks if a value is a **Buffer-like object**.
|
|
@@ -1056,6 +1108,7 @@ declare const CollectionTypeGuards: {
|
|
|
1056
1108
|
readonly isKeyOfArray: <T extends readonly (string | number | symbol)[]>(keys: T) => TTypeGuard<T[number]>;
|
|
1057
1109
|
readonly isInArray: <T>(target: readonly T[]) => TTypeGuard<T | undefined>;
|
|
1058
1110
|
readonly hasKeys: <T extends object>(requiredKeys: (keyof T)[]) => ((value: unknown) => value is T);
|
|
1111
|
+
readonly isShape: <T extends object>(schema: { [K in keyof T]: TTypeGuard<T[K]>; }) => TTypeGuard<T>;
|
|
1059
1112
|
};
|
|
1060
1113
|
|
|
1061
1114
|
/**
|
|
@@ -2324,52 +2377,5 @@ declare const ReactProcessorUtils: {
|
|
|
2324
2377
|
readonly extractDOMProps: typeof extractDOMProps;
|
|
2325
2378
|
readonly filterChildrenByDisplayName: typeof filterChildrenByDisplayName;
|
|
2326
2379
|
};
|
|
2327
|
-
/**
|
|
2328
|
-
* =============================================================================
|
|
2329
|
-
* Processors Folder / Module
|
|
2330
|
-
* =============================================================================
|
|
2331
|
-
*
|
|
2332
|
-
* ## Role / Purpose
|
|
2333
|
-
*
|
|
2334
|
-
* **Role:**
|
|
2335
|
-
* The `processors/` folder contains reusable functions that process, transform,
|
|
2336
|
-
* or handle data in a meaningful way. These functions are generally stateless,
|
|
2337
|
-
* deterministic, and focused on specific operations or domains.
|
|
2338
|
-
*
|
|
2339
|
-
* - Responsible for handling transformations, computations, and controlled
|
|
2340
|
-
* side-effects (e.g., network calls, React ref handling, HTML processing).
|
|
2341
|
-
* - Exists to provide a centralized, organized toolbox of utility functions
|
|
2342
|
-
* that can be reused across the application.
|
|
2343
|
-
*
|
|
2344
|
-
* ---
|
|
2345
|
-
*
|
|
2346
|
-
* ## Guidelines
|
|
2347
|
-
*
|
|
2348
|
-
* **✅ What goes here:**
|
|
2349
|
-
* - Pure utility functions that transform or process data
|
|
2350
|
-
* - Async helpers and network-related utilities (fetch, retry, delay)
|
|
2351
|
-
* - Domain-specific processors: HTML, strings, URLs, React refs, time/durations
|
|
2352
|
-
* - Example: `function makeStringKebabCase(str: string): string {...}`
|
|
2353
|
-
* - Example: `function extractFirstImageSrc(html: string): string | null {...}`
|
|
2354
|
-
* - Example: `async function fetchJson<T>(url: string): Promise<T> {...}`
|
|
2355
|
-
*
|
|
2356
|
-
* **🚫 What does NOT go here:**
|
|
2357
|
-
* - Runtime assertion functions or validators
|
|
2358
|
-
* - Type guards or type-refinement functions
|
|
2359
|
-
* - Generic array/object helpers (use `common/` instead)
|
|
2360
|
-
*
|
|
2361
|
-
* ---
|
|
2362
|
-
*
|
|
2363
|
-
* ## Benefits
|
|
2364
|
-
*
|
|
2365
|
-
* - Groups all data-processing utilities in one place for discoverability
|
|
2366
|
-
* - Encourages consistent patterns for transformations and side-effect handling
|
|
2367
|
-
* - Improves maintainability by separating processors from guards, assertions,
|
|
2368
|
-
* and generic helpers
|
|
2369
|
-
* - Makes it easier to scale and add new processors without polluting unrelated
|
|
2370
|
-
* folders
|
|
2371
|
-
* - Optional link: Related folders include `guards/`, `common/`, and `transformers/`
|
|
2372
|
-
*
|
|
2373
|
-
*/
|
|
2374
2380
|
|
|
2375
|
-
export { ArrayUtils, AssertionUtils, CollectionTypeGuards, ColorUtils, ComputationUtils, CoreTypeGuards, DebugUtils, DomUtils, FormatTypeGuards, LinkUtils, ObjectUtils, ProcessorUtils, ReactProcessorUtils, ReactTypeGuards, RenamedArrayMethods, RenamedObjectMethods, TransformersUtils, arrayFilter, arrayFilterNonNullable, arrayFlat, arrayFlatMap, arrayForEach, arrayIncludes, arrayMap, arrayReduce, assertIsAbsoluteUrl, assertIsArray, assertIsBigInt, assertIsBoolean, assertIsBufferLikeObject, assertIsCamelCase, assertIsDefined, assertIsFunction, assertIsInteger, assertIsInternalUrl, assertIsJSONArrayString, assertIsJSONObjectString, assertIsJsonString, assertIsMap, assertIsNil, assertIsNonEmptyString, assertIsNull, assertIsNumber, assertIsRGBTuple, assertIsSet, assertIsString, assertIsSymbol, assertIsUndefined, assertIsWeakMap, assertIsWeakSet, assertObject, capitalizeArray, capitalizeString, capitalizedKeys, contrastTextColor, delay, extractDOMProps, extractRelativePath, fetchJson, filterChildrenByDisplayName, generateKeyMap, getCallerLocation, getKeyboardAction, getLuminance, handleInternalHashScroll, hasChildren, hasDefinedKeys, hasNameMetadata, hasOnClick, hexToHSL, hexToNormalizedRGB, hexToRGB, hexToRGBShorthand, highlight, interpolateColor, isAbsoluteUrl, isArray, isArrayOf, isBigInt, isBoolean, isBufferLikeObject, isCamelCase, isComponentType, isDOMEntry, isDOMPropKey, isDarkColor, isDefined, isElementLike, isElementOfType, isEmail, isForwardRef, isFragment, isFunction, isHTMLString, isHexByteString, isInArray, isInstanceOf, isInteger, isInternalUrl, isJSONArrayString, isJSONObjectString, isJsonString, isKebabCase, isKeyInObject, isKeyOfArray, isKeyOfObject, isLumGreaterThan, isLumLessThan, isMap, isNil, isNonEmptyString, isNull, isNumber, isObject, isPhoneNumber, isPrimitive, isPromise, isPropValid, isRGBTuple, isReactElement, isReactPortal, isRecordOf, isRef, isRefObject, isSet, isSnakeCase, isString, isSymbol, isUndefined, isValidReactNode, isWeakMap, isWeakSet, lazyProxy, logDev, mergeCssVars, mergeEventHandlerClicks, mergeRefs, normalizeImageSrc, normalizeUrl, objectEntries, objectFromEntries, objectGet, objectHas, objectKeys, objectSet, objectValues, preloadImages, retry, serialize, stripHash, toCamelCase, toKebabCase, toKeyByField, toSnakeCase, validateRGB };
|
|
2381
|
+
export { ArrayUtils, AssertionUtils, CollectionTypeGuards, ColorUtils, ComputationUtils, CoreTypeGuards, DebugUtils, DomUtils, FormatTypeGuards, LinkUtils, ObjectUtils, ProcessorUtils, ReactProcessorUtils, ReactTypeGuards, RenamedArrayMethods, RenamedObjectMethods, TransformersUtils, arrayFilter, arrayFilterNonNullable, arrayFlat, arrayFlatMap, arrayForEach, arrayIncludes, arrayMap, arrayReduce, assertIsAbsoluteUrl, assertIsArray, assertIsBigInt, assertIsBoolean, assertIsBufferLikeObject, assertIsCamelCase, assertIsDefined, assertIsFunction, assertIsInteger, assertIsInternalUrl, assertIsJSONArrayString, assertIsJSONObjectString, assertIsJsonString, assertIsMap, assertIsNil, assertIsNonEmptyString, assertIsNull, assertIsNumber, assertIsRGBTuple, assertIsSet, assertIsString, assertIsSymbol, assertIsUndefined, assertIsWeakMap, assertIsWeakSet, assertObject, capitalizeArray, capitalizeString, capitalizedKeys, contrastTextColor, delay, extractDOMProps, extractRelativePath, fetchJson, filterChildrenByDisplayName, generateKeyMap, getCallerLocation, getKeyboardAction, getLuminance, handleInternalHashScroll, hasChildren, hasDefinedKeys, hasNameMetadata, hasOnClick, hexToHSL, hexToNormalizedRGB, hexToRGB, hexToRGBShorthand, highlight, interpolateColor, isAbsoluteUrl, isArray, isArrayOf, isBigInt, isBoolean, isBufferLikeObject, isCamelCase, isComponentType, isDOMEntry, isDOMPropKey, isDarkColor, isDefined, isElementLike, isElementOfType, isEmail, isForwardRef, isFragment, isFunction, isHTMLString, isHexByteString, isInArray, isInstanceOf, isInteger, isInternalUrl, isJSONArrayString, isJSONObjectString, isJsonString, isKebabCase, isKeyInObject, isKeyOfArray, isKeyOfObject, isLumGreaterThan, isLumLessThan, isMap, isNil, isNonEmptyString, isNull, isNumber, isObject, isPhoneNumber, isPrimitive, isPromise, isPropValid, isRGBTuple, isReactElement, isReactPortal, isRecordOf, isRef, isRefObject, isSet, isShape, isSnakeCase, isString, isSymbol, isUndefined, isValidReactNode, isWeakMap, isWeakSet, lazyProxy, logDev, mergeCssVars, mergeEventHandlerClicks, mergeRefs, normalizeImageSrc, normalizeUrl, objectEntries, objectFromEntries, objectGet, objectHas, objectKeys, objectSet, objectValues, preloadImages, retry, serialize, stripHash, toCamelCase, toKebabCase, toKeyByField, toSnakeCase, validateRGB };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
function z(e,t){let r={};for(let[n,o]of Object.entries(t)){let s=e[o];typeof s=="function"&&(r[n]=s.bind(e))}return r}var h=class e{static includes(t,r){return t.includes(r)}static createFixedLengthArray(t,r){if(t.length!==r)throw new Error(`Array must have exactly ${r} elements`);return t}static readAllItems(t){return[...t]}static map(t,r){return t.map(r)}static forEachUnion(t,r){(Array.isArray(t[0])?[].concat(...t):t).forEach(r)}static forEach(t,r){t.forEach(r)}static reduce(t,r,n){return t.reduce(r,n)}static flat(t){return t.reduce((r,n)=>r.concat(n),[])}static flatMap(t,r){return t.reduce((n,o,s)=>{let i=r(o,s);return n.concat(i)},[])}static filter(t,r){return t.filter(r)}static filterNonNullable(t){return e.filter(t,r=>r!=null)}},ht=z(h,{arrayIncludes:"includes",arrayMap:"map",arrayFilter:"filter",arrayFlat:"flat",arrayReduce:"reduce",arrayForEach:"forEach",arrayFlatMap:"flatMap",arrayFilterNonNullable:"filterNonNullable"}),{arrayMap:gr,arrayFilter:br,arrayIncludes:xr,arrayReduce:hr,arrayFlat:Sr,arrayFlatMap:kr,arrayForEach:Rr,arrayFilterNonNullable:wr}=ht;var y=class{static keys(t){return Object.keys(t)}static entries(t){return t?Object.entries(t):[]}static fromEntries(t){return Object.fromEntries(t)}static values(t){return Object.values(t)}static has(t,r){if(!r)return!1;let n=r.split("."),o=t;for(let s of n){if(o==null||typeof o!="object"||!(s in o))return!1;o=o[s]}return!0}static get(t,r){if(!r)return;let n=r.split("."),o=t;for(let s of n){if(o==null||typeof o!="object"||!(s in o))return;o=o[s]}return o}static set(t,r,n){if(!r)return;let o=r.split("."),s=t;for(let i=0;i<o.length-1;i++){let a=o[i];if(typeof s!="object"||s===null)return;let c=s;(!(a in c)||typeof c[a]!="object"||c[a]===null)&&(c[a]={}),s=c[a]}typeof s=="object"&&s!==null&&(s[o[o.length-1]]=n)}},St=z(y,{objectKeys:"keys",objectEntries:"entries",objectFromEntries:"fromEntries",objectValues:"values",objectHas:"has",objectGet:"get",objectSet:"set"}),{objectKeys:Cr,objectEntries:Er,objectFromEntries:Pr,objectValues:Nr,objectHas:Ir,objectGet:jr,objectSet:Gr}=St;var k=e=>typeof e=="number"&&!Number.isNaN(e)&&Number.isFinite(e),Te=e=>Number.isInteger(e),p=e=>typeof e=="string",x=e=>typeof e=="string"&&e.length>0&&e.trim().length>0,M=e=>typeof e=="boolean",S=e=>typeof e=="bigint",K=e=>typeof e=="symbol",H=e=>p(e)||k(e)||M(e)||S(e);var Br=Object.freeze(["div","span","a","p","ul","li"]),ye=Object.freeze(["b","i","p","ul","li","a","span","div","br","strong","em","u","code","pre","blockquote"]),ge={allowedKeys:["arrowleft","arrowright","arrowup","arrowdown","backspace","delete","tab"],clearKeys:["backspace","delete"],copyShortcut:{key:"c",modifiers:["ctrl","meta"]},pasteShortcut:{key:"v",modifiers:["ctrl","meta"]}};var be=Object.freeze(["log","warn","error","info","debug","table"]),f={isoRegex:/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,camelCase:/^[a-z]+(?:[A-Z][a-z0-9]*)*$/,kebabCase:/^[a-z0-9]+(?:-[a-z0-9]+)*$/,snakeCase:/^[a-z0-9]+(?:_[a-z0-9]+)*$/,hexString:/^[0-9a-fA-F]+$/,hexColor:/^[0-9A-Fa-f]{6}$/,letterSeparator:/[^A-Za-z]+/g,camelCaseBoundary:/(?:^\w|[A-Z]|\b\w)/g,kebabCaseBoundary:/([a-z0-9])([A-Z])/g,whitespace:/\s+/g,wordBoundarySplitter:/[^A-Za-z0-9]+/g,USPhoneNumber:/^(?:\+1\s?)?(?:\(\d{3}\)|\d{3})[-.\s]?\d{3}[-.\s]?\d{4}$/,EUPhoneNumber:/^\+?\d{1,4}[\s.-]?\d{2,4}([\s.-]?\d{2,4}){1,3}$/,genericPhoneNumber:/^\+?(\d[\d\s-().]{6,}\d)$/,genericEmail:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,emailRegex:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/,imageSrcRegex:/<img[^>]+src="([^">]+)"/i,singleAlphabetChar:/^[a-zA-Z]$/,htmlDetection:new RegExp(`<\\/?(${ye.join("|")})\\b[^>]*>|&[a-z]+;`,"i"),stackTracePrefix:/^\s*at\s+/},ne={reset:"\x1B[0m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",bold:"\x1B[1m",underline:"\x1B[4m"};var kt={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0,autoFocus:!0,defaultValue:!0,defaultChecked:!0,innerHTML:!0,suppressContentEditableWarning:!0,suppressHydrationWarning:!0,valueLink:!0},Rt={action:!0,formAction:!0,onCaptured:!0,precedence:!0,blocking:!0},wt={autoFocus:!0,readOnly:!0,noValidate:!0,spellCheck:!0,tabIndex:!0,autoComplete:!0,autoCorrect:!0,autoCapitalize:!0},At={popover:!0,popoverTarget:!0,popoverTargetAction:!0,inert:!0,loading:!0,fetchpriority:!0,fetchPriority:!0,enterKeyHint:!0,shadowRoot:!0,disablePictureInPicture:!0,playsInline:!0},Ot={paintOrder:!0,vectorEffect:!0,imageRendering:!0,shapeRendering:!0,textAnchor:!0,ariaHasPopup:!0,ariaLabel:!0,ariaLabelledBy:!0,alignmentBaseline:!0,baselineShift:!0,dominantBaseline:!0},Ct={about:!0,datatype:!0,inlist:!0,prefix:!0,property:!0,resource:!0,typeof:!0,vocab:!0,itemProp:!0,itemScope:!0,itemType:!0,itemID:!0,itemRef:!0},Et={autoCapitalize:!0,autoCorrect:!0,autoSave:!0,color:!0,incremental:!0,results:!0,security:!0,unselectable:!0,on:!0,option:!0,fallback:!0},Pt={abbr:!0,accept:!0,acceptCharset:!0,accessKey:!0,action:!0,allow:!0,allowFullScreen:!0,allowPaymentRequest:!0,alt:!0,async:!0,autoComplete:!0,autoFocus:!0,autoPlay:!0,capture:!0,cellPadding:!0,cellSpacing:!0,challenge:!0,charSet:!0,checked:!0,cite:!0,classID:!0,className:!0,cols:!0,colSpan:!0,content:!0,contentEditable:!0,contextMenu:!0,controls:!0,controlsList:!0,coords:!0,crossOrigin:!0,data:!0,dateTime:!0,decoding:!0,default:!0,defer:!0,dir:!0,disabled:!0,disablePictureInPicture:!0,disableRemotePlayback:!0,download:!0,draggable:!0,encType:!0,enterKeyHint:!0,form:!0,formAction:!0,formEncType:!0,formMethod:!0,formNoValidate:!0,formTarget:!0,frameBorder:!0,headers:!0,height:!0,hidden:!0,high:!0,href:!0,hrefLang:!0,htmlFor:!0,httpEquiv:!0,id:!0,inputMode:!0,integrity:!0,is:!0,keyParams:!0,keyType:!0,kind:!0,label:!0,lang:!0,list:!0,loading:!0,loop:!0,low:!0,marginHeight:!0,marginWidth:!0,max:!0,maxLength:!0,media:!0,mediaGroup:!0,method:!0,min:!0,minLength:!0,multiple:!0,muted:!0,name:!0,nonce:!0,noValidate:!0,open:!0,optimum:!0,pattern:!0,placeholder:!0,playsInline:!0,poster:!0,preload:!0,profile:!0,radioGroup:!0,readOnly:!0,referrerPolicy:!0,rel:!0,required:!0,reversed:!0,role:!0,rows:!0,rowSpan:!0,sandbox:!0,scope:!0,scoped:!0,scrolling:!0,seamless:!0,selected:!0,shape:!0,size:!0,sizes:!0,slot:!0,span:!0,spellCheck:!0,src:!0,srcDoc:!0,srcLang:!0,srcSet:!0,start:!0,step:!0,style:!0,summary:!0,tabIndex:!0,target:!0,title:!0,translate:!0,type:!0,useMap:!0,value:!0,width:!0,wmode:!0,wrap:!0},Nt={alignmentBaseline:!0,baselineShift:!0,clip:!0,clipPath:!0,clipRule:!0,color:!0,colorInterpolation:!0,colorInterpolationFilters:!0,colorProfile:!0,colorRendering:!0,cursor:!0,direction:!0,display:!0,dominantBaseline:!0,enableBackground:!0,fill:!0,fillOpacity:!0,fillRule:!0,filter:!0,floodColor:!0,floodOpacity:!0,imageRendering:!0,lightingColor:!0,markerEnd:!0,markerMid:!0,markerStart:!0,mask:!0,opacity:!0,overflow:!0,paintOrder:!0,pointerEvents:!0,shapeRendering:!0,stopColor:!0,stopOpacity:!0,stroke:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeLinecap:!0,strokeLinejoin:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,textAnchor:!0,textDecoration:!0,textRendering:!0,unicodeBidi:!0,vectorEffect:!0,visibility:!0,wordSpacing:!0,writingMode:!0},It={cx:!0,cy:!0,d:!0,dx:!0,dy:!0,fr:!0,fx:!0,fy:!0,height:!0,points:!0,r:!0,rx:!0,ry:!0,transform:!0,version:!0,viewBox:!0,width:!0,x:!0,x1:!0,x2:!0,y:!0,y1:!0,y2:!0,z:!0},jt={accumulate:!0,additive:!0,allowReorder:!0,amplitude:!0,attributeName:!0,attributeType:!0,autoReverse:!0,begin:!0,bias:!0,by:!0,calcMode:!0,decelerate:!0,diffuseConstant:!0,divisor:!0,dur:!0,edgeMode:!0,elevation:!0,end:!0,exponent:!0,externalResourcesRequired:!0,filterRes:!0,filterUnits:!0,from:!0,in:!0,in2:!0,intercept:!0,k:!0,k1:!0,k2:!0,k3:!0,k4:!0,kernelMatrix:!0,kernelUnitLength:!0,keyPoints:!0,keySplines:!0,keyTimes:!0,limitingConeAngle:!0,mode:!0,numOctaves:!0,operator:!0,order:!0,orient:!0,orientation:!0,origin:!0,pathLength:!0,primitiveUnits:!0,repeatCount:!0,repeatDur:!0,restart:!0,result:!0,rotate:!0,scale:!0,seed:!0,slope:!0,spacing:!0,specularConstant:!0,specularExponent:!0,speed:!0,spreadMethod:!0,startOffset:!0,stdDeviation:!0,stitchTiles:!0,surfaceScale:!0,targetX:!0,targetY:!0,to:!0,values:!0,xChannelSelector:!0,yChannelSelector:!0,zoomAndPan:!0},Gt={accentHeight:!0,alphabetic:!0,arabicForm:!0,ascent:!0,bbox:!0,capHeight:!0,descent:!0,fontFamily:!0,fontSize:!0,fontSizeAdjust:!0,fontStretch:!0,fontStyle:!0,fontVariant:!0,fontWeight:!0,format:!0,g1:!0,g2:!0,glyphName:!0,glyphOrientationHorizontal:!0,glyphOrientationVertical:!0,glyphRef:!0,hanging:!0,horizAdvX:!0,horizOriginX:!0,ideographic:!0,kerning:!0,lengthAdjust:!0,letterSpacing:!0,local:!0,mathematical:!0,overlinePosition:!0,overlineThickness:!0,panose1:!0,refX:!0,refY:!0,renderingIntent:!0,strikethroughPosition:!0,strikethroughThickness:!0,string:!0,systemLanguage:!0,tableValues:!0,textLength:!0,u1:!0,u2:!0,underlinePosition:!0,underlineThickness:!0,unicode:!0,unicodeRange:!0,unitsPerEm:!0,vAlphabetic:!0,vHanging:!0,vIdeographic:!0,vMathematical:!0,values:!0,vertAdvY:!0,vertOriginX:!0,vertOriginY:!0,widths:!0,xHeight:!0},Mt={clipPathUnits:!0,contentScriptType:!0,contentStyleType:!0,gradientTransform:!0,gradientUnits:!0,markerHeight:!0,markerUnits:!0,markerWidth:!0,maskContentUnits:!0,maskUnits:!0,offset:!0,patternContentUnits:!0,patternTransform:!0,patternUnits:!0,preserveAlpha:!0,preserveAspectRatio:!0,requiredExtensions:!0,requiredFeatures:!0,viewTarget:!0,xlinkActuate:!0,xlinkArcrole:!0,xlinkHref:!0,xlinkRole:!0,xlinkShow:!0,xlinkTitle:!0,xlinkType:!0,xmlBase:!0,xmlns:!0,xmlnsXlink:!0,xmlLang:!0,xmlSpace:!0},Kt={for:!0,class:!0,autofocus:!0},oe={...Et,...Ct,...Ot,...At,...wt,...Rt,...kt,...Kt,...Mt,...Gt,...jt,...It,...Nt,...Pt},vr=Object.keys(oe);var B=e=>e===null,C=e=>typeof e>"u",R=e=>e!=null,A=e=>e==null,b=e=>typeof e=="function",l=e=>!B(e)&&!O(e)&&typeof e=="object",O=e=>Array.isArray(e),xe=e=>e instanceof Map,he=e=>e instanceof Set,Se=e=>e instanceof WeakMap,ke=e=>e instanceof WeakSet;function Re(e,t){return e instanceof t}var V=e=>typeof e=="string"&&f.camelCase.test(e),we=e=>typeof e=="string"&&f.snakeCase.test(e),Ae=e=>typeof e=="string"&&f.kebabCase.test(e),L=e=>{if(!x(e))return!1;try{return Array.isArray(JSON.parse(e))}catch{return!1}},U=e=>{if(!x(e))return!1;try{let t=JSON.parse(e);return typeof t=="object"&&t!==null&&!Array.isArray(t)}catch{return!1}},Oe=e=>p(e)&&f.htmlDetection.test(e),Ce=e=>t=>!(!x(t)||t.length%2!==0||!f.hexString.test(t)||!C(e)&&t.length!==e),W=e=>L(e)||U(e);var P=e=>{if(!x(e))return!1;try{return new URL(e),!0}catch{return!1}},N=e=>{if(typeof window>"u"||typeof location>"u"||!x(e))return!1;if(e.startsWith("/"))return!0;try{return new URL(e,location.origin).hostname===location.hostname}catch{return!1}};var Ee=e=>{let t=new Set(e);return r=>!C(r)&&t.has(r)},Pe=e=>t=>(p(t)||k(t)||K(t))&&t in e,m=e=>t=>l(t)&&e in t,J=e=>t=>(p(t)||k(t)||K(t)||M(t))&&e.includes(t),I=(e,t)=>Array.isArray(t)&&t.every(e),Ne=(e,t)=>l(e)&&y.values(e).every(t),Ie=e=>t=>!t||!l(t)?!1:e.every(r=>m(r)(t)&&R(t[r]));var q=e=>{if(!l(e))return!1;let t="type"in e&&e.type==="Buffer",r="data"in e&&I(k,e.data);return t&&r},X=e=>O(e)&&e.length===3&&e.every(t=>k(t)&&t>=0&&t<=255),je=e=>x(e)?[f.USPhoneNumber,f.EUPhoneNumber,f.genericPhoneNumber].some(t=>t.test(e)):!1,Ge=e=>p(e)&&f.emailRegex.test(e);var g={isString:p,isNumber:k,isBoolean:M,isBigInt:S,isNil:A,isDefined:R,isInteger:Te,isNonEmptyString:x,isSymbol:K,isPrimitive:H,isNull:B,isFunction:b,isObject:l,isArray:O,isMap:xe,isSet:he,isWeakMap:Se,isWeakSet:ke,isUndefined:C,isInstanceOf:Re},pn={isEmail:Ge,isPhone:je,isUrlAbsolute:P,isUrlInternal:N,isJsonString:W,isHTMLString:Oe,isCamelCase:V,isSnakeCase:we,isKebabCase:Ae,isHexByteString:Ce,isJSONObjectString:U,isJSONArrayString:L,isRGBTuple:X,isBufferLikeObject:q},mn={isArrayOf:I,isRecordOf:Ne,isKeyOfObject:Pe,isKeyInObject:m,isKeyOfArray:J,isInArray:Ee,hasKeys:Ie};var Me=e=>{let t=Object.create(null);return r=>{if(r in t)return t[r];let n=e(r);return t[r]=n,n}};var Bt=y.keys(oe).join("|"),Lt=new RegExp(`^((${Bt})|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$`),se=Me(e=>Lt.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91),ie=e=>p(e)&&se(e),Z=e=>p(e[0])&&ie(e[0]);var Ut=(e,t)=>m("$$typeof")(e)&&e.$$typeof===t,Y=e=>R(e)&&(b(e)||l(e)&&"current"in e),Q=e=>!B(e)&&l(e)&&"current"in e,Ke=e=>!!e&&m("then")(e)&&b(e.then),ee=e=>l(e)&&m("containerInfo")(e),Be=e=>l(e)&&m("children")(e)&&R(e.children),Le=e=>b(e)||m("prototype")(e)&&l(e.prototype)&&m("render")(e.prototype)&&b(e.prototype.render),Ue=e=>Ut(e,Symbol.for("react.forward_ref"));import{isValidElement as ae,Fragment as Dt}from"react";var ue=e=>A(e)||H(e)||ae(e)||ee(e)||I(ue,e),D=e=>ae(e),De=e=>ae(e)&&e.type===Dt,ve=e=>D(e)&&!A(e.props)&&m("onClick")(e.props)&&b(e.props.onClick),ce=e=>l(e)&&m("type")(e)&&m("props")(e)&&l(e.props)&&(p(e.type)||b(e.type)),_e=(e,t)=>ce(e)&&t.includes(e.type),$e=e=>b(e)&&(l(e)||b(e))&&(m("displayName")(e)||m("name")(e)||m("type")(e));var Un={isRef:Y,isRefObject:Q,isPromise:Ke,isReactPortal:ee,hasChildren:Be,isComponentType:Le,isForwardRef:Ue,isValidReactNode:ue,isReactElement:D,isFragment:De,hasOnClick:ve,isElementLike:ce,isElementOfType:_e,hasNameMetadata:$e,isDOMPropKey:ie,isDOMEntry:Z,isPropValid:se};var Fe=(e,t,r)=>{if(!t(e))throw new Error(r??"Validation failed for value")},d=(e,t)=>(r,n)=>Fe(r,e,n),vt=d(g.isNumber,"isNumber"),_t=d(g.isInteger,"isInteger"),$t=d(g.isString,"isString"),Ft=d(g.isNonEmptyString,"isNonEmptyString"),zt=d(g.isBoolean,"isBoolean"),Ht=d(g.isBigInt,"isBigInt"),Vt=d(g.isSymbol,"isSymbol"),Wt=d(g.isNull,"isNull"),Jt=d(g.isUndefined,"isUndefined"),qt=d(g.isDefined,"isDefined"),Xt=d(g.isNil,"isNil"),Zt=d(g.isFunction,"isFunction"),Yt=d(g.isObject,"isObject"),Qt=d(g.isArray,"isArray"),er=d(g.isMap,"isMap"),tr=d(g.isSet,"isSet"),rr=d(g.isWeakMap,"isWeakMap"),nr=d(g.isWeakSet,"isWeakSet"),or=d(V,"isCamelCase"),sr=d(q,"isBufferLikeObject"),ir=d(L,"isJSONArrayString"),ar=d(U,"isJSONObjectString"),ur=d(W,"isJsonString"),cr=d(P,"isAbsoluteUrl"),lr=d(N,"isInternalUrl"),le=d(X,"isRGBTuple"),_n={assertValue:Fe,makeAssert:d,assertIsNumber:vt,assertIsInteger:_t,assertIsString:$t,assertIsNonEmptyString:Ft,assertIsBoolean:zt,assertIsBigInt:Ht,assertIsSymbol:Vt,assertIsNull:Wt,assertIsUndefined:Jt,assertIsDefined:qt,assertIsNil:Xt,assertIsFunction:Zt,assertObject:Yt,assertIsArray:Qt,assertIsMap:er,assertIsSet:tr,assertIsWeakMap:rr,assertIsWeakSet:nr,assertIsCamelCase:or,assertIsBufferLikeObject:sr,assertIsJSONArrayString:ir,assertIsJSONObjectString:ar,assertIsJsonString:ur,assertIsAbsoluteUrl:cr,assertIsInternalUrl:lr,assertIsRGBTuple:le};var te=e=>e[0].toUpperCase()+e.slice(1),ze=e=>A(e)||!x(e)?"":e.replace(f.letterSeparator," ").replace(f.camelCaseBoundary,(r,n)=>n===0?r.toLowerCase():r.toUpperCase()).replace(f.whitespace,""),He=e=>A(e)||!x(e)?"":e.replace(f.wordBoundarySplitter," ").replace(f.kebabCaseBoundary,"$1 $2").trim().split(f.whitespace).join("-").toLowerCase(),Ve=e=>A(e)||!x(e)?"":e.replace(f.wordBoundarySplitter," ").replace(f.kebabCaseBoundary,"$1 $2").trim().split(f.whitespace).join("_").toLowerCase();var We=e=>{let{keys:t,prefix:r,suffix:n}=e,o=h.map(t,s=>{let i=r?`${r}${s.charAt(0).toUpperCase()+s.slice(1)}${n}`:`${s.charAt(0).toLowerCase()+s.slice(1)}${n}`;return[s,i]});return y.fromEntries(o)},Je=(e,t)=>y.fromEntries(h.map(e,r=>{let n=r[t],{[t]:o,...s}=r;return[n,s]})),pe=e=>h.map(e,te),qe=e=>pe(y.keys(e).map(String).filter(t=>/^[A-Za-z]/.test(t)));var Zn={capitalizedKeys:qe,capitalizeArray:pe,toKeyByField:Je,generateKeyMap:We,toSnakeCase:Ve,toKebabCase:He,toCamelCase:ze,capitalizeString:te};function E(e,t="yellow"){return`${ne[t]}${e}${ne.reset}`}var pr={log:e=>E(e,"yellow"),info:e=>E(e,"cyan"),error:e=>E(e,"red"),debug:e=>E(e,"magenta"),warn:e=>E(e,"yellow"),table:e=>e},me=e=>{if(C(e))return"";if(p(e))return e;try{return JSON.stringify(e,(t,r)=>S(r)?r.toString():r,2)}catch{return String(e)}},Xe=e=>{let{preferredIndex:t=3,fallbackIndex:r=2,topParent:n=!1,stripPathPrefix:o=process.cwd()}=e,s=new Error().stack;if(!s)return"unknown";let i=s.split(`
|
|
2
|
-
`).slice(1).map(c=>c.replace(f.stackTracePrefix,"").trim()).filter(Boolean),a=n?[...i].reverse().find(c=>!c.includes("node_modules"))??i.at(-1):i[t]??i[r]??i.at(-1);return o?a?.replace(o,"")??"unknown":a??"unknown"},mr=(e,...t)=>{let r=process.env.NODE_ENV!=="production",{enabled:n=!0,overrideDev:o=!1}=e;if(!n||!r&&!o)return;let s="log",i=t[0];if(p(i)&&J(be)(i)&&(s=i),s==="table"){let u=h.map(t.slice(1),T=>T&&l(T)&&"current"in T?T.current.map(G=>({key:G.key,duration:G.end!=null&&G.start!=null?`${(G.end-G.start).toFixed(2)}ms`:"in progress"})):T);console.table(u.flat());return}let a=pr[s],c=t.map(u=>{let T=l(u)?me(u):String(u);return a?a(T):T});(console[s]??console.log)(...c)};var v=class{};v.highlight=E,v.serialize=me,v.getCallerLocation=Xe;function Ze(e,t={}){let r=(u,T)=>u.key.toLowerCase()!==T.key?!1:T.modifiers.some(w=>w==="ctrl"?u.ctrlKey:w==="meta"?u.metaKey:w==="alt"?u.altKey:w==="shift"?u.shiftKey:!1),n={...ge,...t},o=e.key.toLowerCase(),s=r(e,n.copyShortcut),i=r(e,n.pasteShortcut),a=n.clearKeys.includes(o),c=n.allowedKeys.includes(o);return{isPaste:i,isCopy:s,isClear:a,isAllowedKey:c,shouldBlockTyping:!c&&!s&&!i}}var _=new Map,dr=200;async function Ye(e,t={}){if(typeof window>"u")return;let{fetchPriority:r="low"}=t,o=(O(e)?e:[e]).filter(s=>!_.has(s)).map(s=>new Promise(i=>{let a=new Image;a.fetchPriority=r,a.src=s;let c=()=>{if(_.size>=dr){let u=_.keys().next().value;u&&_.delete(u)}_.set(s,!0),i()};a.complete?c():m("decode")(a)&&b(a.decode)?a.decode().then(c).catch(c):(a.onload=c,a.onerror=c)}));o.length!==0&&await Promise.all(o)}function Qe(e){return e?p(e)?e:(m("default")(e),m("default")(e)&&e.default&&l(e.default)&&m("src")(e.default)?e.default.src:l(e)&&m("src")(e)&&p(e.src)?e.src:""):""}var po={getKeyboardAction:Ze,preloadImages:Ye,normalizeImageSrc:Qe};var et=class{static toNum(t){return S(t)?Number(t):t}static round(t,r=0){let n=Math.pow(10,r);return Math.round(t*n)/n}static clamp(t,r,n){return Math.max(r,Math.min(n,t))}static getPercentage(t,r,n=0){if(r===0||r===0n)return 0;if(S(t)||S(r)){let o=BigInt(10**(n+2));return Number(BigInt(t)*100n*o/BigInt(r))/Number(o)}return this.round(t/r*100,n)}static computeMean(t){if(!t.length)return 0;let r=t.map(n=>this.toNum(n));return r.reduce((n,o)=>n+o,0)/r.length}static isAnomaly(t,r,n,o=2){return n===0?!1:Math.abs(t-r)>n*o}static computeRatio(t,r,n=2){return this.getPercentage(t,r,n)}static welfordUpdate(t,r){if(!t)return{welford:{count:1,mean:r,squaredDeviationSum:0},stdDev:0};let{count:n,mean:o,squaredDeviationSum:s}=t,i=n+1,a=r-o,c=o+a/i,u=s+a*(r-c),T=i>1?u/(i-1):0,w=Math.sqrt(T);return{welford:{count:i,mean:c,squaredDeviationSum:u},stdDev:w}}static computeDelta(t,r){if(S(t)&&S(r)){let n=t-r,o=n<0n?-n:n;return{netDelta:n,absDelta:o}}if(k(t)&&k(r)){let n=t-r,o=Math.abs(n);return{netDelta:n,absDelta:o}}throw new Error("Incompatible types: current and past must both be number or both be bigint.")}static computePercentageChange(t,r,n=1n){if(r===0||r===0n)return 0;if(S(t)||S(r)){let o=BigInt(t),s=BigInt(r);return Number((o-s)*(100n*n)/s)/Number(n)}return(t-r)/r*100}};var $=e=>{let t=e.startsWith("#")?e.slice(1):e;if(!f.hexColor.test(t))throw new Error(`Invalid hex color: "${e}"`);let r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),o=parseInt(t.slice(4,6),16);return[r,n,o]},F=e=>p(e)?$(e):(le(e),e),re=e=>{let[t,r,n]=F(e),o=s=>{let i=s/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*o(t)+.7152*o(r)+.0722*o(n)},de=(e,t)=>re(F(e))<t,tt=e=>de(e,.179),fe=(e,t)=>re(F(e))>t,rt=(e,t)=>{let{mode:r="tailwind",threshold:n=.179}=t??{},o=fe(e,n);return r==="css"?o?"#000000":"#ffffff":o?"text-black":"text-white"},nt=e=>{let t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,r=e.replace(t,(o,s,i,a)=>s+s+i+i+a+a),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return n?[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]:null},ot=(e,t,r)=>{let n={r:Math.round(e.r+(t.r-e.r)*r),g:Math.round(e.g+(t.g-e.g)*r),b:Math.round(e.b+(t.b-e.b)*r)};return`rgb(${n.r}, ${n.g}, ${n.b})`};function st(e){let[t,r,n]=$(e).map(T=>T/255),o=Math.max(t,r,n),s=Math.min(t,r,n),i=(o+s)/2,a=0,c=0,u=o-s;return u!==0&&(c=i>.5?u/(2-o-s):u/(o+s),o===t?a=((r-n)/u+(r<n?6:0))*60:o===r?a=((n-t)/u+2)*60:o===n&&(a=((t-r)/u+4)*60)),{h:a,s:c,l:i}}var it=e=>{let[t,r,n]=$(e);return[t/255,r/255,n/255]};var So={hexToNormalizedRGB:it,hexToHSL:st,interpolateColor:ot,hexToRGBShorthand:nt,contrastTextColor:rt,isLumGreaterThan:fe,isDarkColor:tt,isLumLessThan:de,getLuminance:re,validateRGB:F,hexToRGB:$};function at(e){if(!R(e))return"";if(p(e))return e;if(e instanceof URL)return e.toString();if(l(e)&&(m("pathname")(e)||m("query")(e))){let{pathname:t="",query:r,hash:n=""}=e,o="";if(l(r)){let a=new URLSearchParams;y.entries(r).forEach(([u,T])=>{R(T)&&(O(T)?h.forEach(T,w=>a.append(u,String(w))):a.append(u,String(T)))});let c=a.toString();c&&(o=`?${c}`)}let s=t||"",i=n&&!n.startsWith("#")?`#${n}`:n||"";return`${s}${o}${i}`}return""}var ut=e=>{if(!N(e))return"/";let t=e.trim();return t?t.startsWith("/")?t:P(t)?new URL(t).pathname||"/":`/${t}`:"/"},ct=e=>{if(!e)return"";if(!e.includes("#"))return e;try{let t=typeof window<"u"?window.location.origin:"http://localhost",r=new URL(e,t);return typeof window<"u"&&r.origin===window.location.origin?`${r.pathname}${r.search}`:`${r.origin}${r.pathname}${r.search}`}catch{return e.split("#")[0]}},lt=({event:e,href:t,behavior:r="smooth",block:n="start"})=>{if(typeof window>"u"||!t.startsWith("#")||/iPad|iPhone|iPod/.test(navigator.userAgent))return!1;let s=t.replace(/^#/,""),i=document.getElementById(s);return i?(e?.preventDefault(),i.scrollIntoView({behavior:r,block:n}),!0):!1};var j=class{};j.normalize=at,j.extractRelativePath=ut,j.stripHash=ct,j.handleHashScroll=lt;async function pt(e){let t=await fetch(e);if(!t.ok)throw new Error(`\u274C Failed to fetch ${e}: ${t.status} ${t.statusText}`);try{return await t.json()}catch(r){throw new Error(`\u274C Failed to parse JSON from ${e}: ${r.message}`)}}var mt=e=>new Promise(t=>setTimeout(t,e));async function dt(e,t=5,r=500){let n;function o(s){return l(s)&&R(s)&&("code"in s||"message"in s)}for(let s=0;s<=t;s++)try{let i=await e();return s>0&&console.log({},`[Retry] Success on attempt ${s+1}`),i}catch(i){n=i;let a=!1;if(o(i)){let u=i.message??"";a=(i.code??"")==="BAD_DATA"||u.includes("Too Many Requests")}if(!a||s===t){console.error(`[Retry] Failed on attempt ${s+1}:`,i);let u;throw i instanceof Error?u=i:l(i)&&m("message")(i)&&p(i.message)?u=new Error(i.message):u=new Error(String(i||"Retry failed")),u}let c=r*2**s+Math.random()*200;console.warn(`[Retry] Rate limited on attempt ${s+1}, retrying in ${Math.round(c)}ms...`),await new Promise(u=>setTimeout(u,c))}throw console.error("[Retry] All retry attempts exhausted"),n||new Error("Retry attempts exhausted")}import{Children as fr}from"react";var ft=(...e)=>{let t=h.filter(e,Y);return r=>{for(let n of t)b(n)?n(r):Q(n)&&(n.current=r)}};function Tt(e){let t=new Map,r=new Set(y.keys(e));return new Proxy(e,{get(n,o,s){if(!p(o)||!r.has(o))return Reflect.get(n,o,s);if(t.has(o))return t.get(o);let i=n[o];if(b(i)){let a=i();return t.set(o,a),a}return i}})}function yt(e,t){return{...y.fromEntries(y.entries(e).filter(([n,o])=>o!==void 0&&o!=="").map(([n,o])=>[n,o.toString()])),...t}}function gt(e,t){return r=>{e?.(r),r.defaultPrevented||t?.(r)}}function bt(e){let t=y.entries(e),r=h.filter(t,Z);return y.fromEntries(r)}function xt(e,t){return fr.toArray(e).filter(r=>D(r)?r.type?.displayName===t:!1)}var Bo={fetchJson:pt,delay:mt,retry:dt},Lo={mergeRefs:ft,lazyProxy:Tt,mergeCssVars:yt,mergeEventHandlerClicks:gt,extractDOMProps:bt,filterChildrenByDisplayName:xt};export{h as ArrayUtils,_n as AssertionUtils,mn as CollectionTypeGuards,So as ColorUtils,et as ComputationUtils,g as CoreTypeGuards,v as DebugUtils,po as DomUtils,pn as FormatTypeGuards,j as LinkUtils,y as ObjectUtils,Bo as ProcessorUtils,Lo as ReactProcessorUtils,Un as ReactTypeGuards,ht as RenamedArrayMethods,St as RenamedObjectMethods,Zn as TransformersUtils,br as arrayFilter,wr as arrayFilterNonNullable,Sr as arrayFlat,kr as arrayFlatMap,Rr as arrayForEach,xr as arrayIncludes,gr as arrayMap,hr as arrayReduce,cr as assertIsAbsoluteUrl,Qt as assertIsArray,Ht as assertIsBigInt,zt as assertIsBoolean,sr as assertIsBufferLikeObject,or as assertIsCamelCase,qt as assertIsDefined,Zt as assertIsFunction,_t as assertIsInteger,lr as assertIsInternalUrl,ir as assertIsJSONArrayString,ar as assertIsJSONObjectString,ur as assertIsJsonString,er as assertIsMap,Xt as assertIsNil,Ft as assertIsNonEmptyString,Wt as assertIsNull,vt as assertIsNumber,le as assertIsRGBTuple,tr as assertIsSet,$t as assertIsString,Vt as assertIsSymbol,Jt as assertIsUndefined,rr as assertIsWeakMap,nr as assertIsWeakSet,Yt as assertObject,pe as capitalizeArray,te as capitalizeString,qe as capitalizedKeys,rt as contrastTextColor,mt as delay,bt as extractDOMProps,ut as extractRelativePath,pt as fetchJson,xt as filterChildrenByDisplayName,We as generateKeyMap,Xe as getCallerLocation,Ze as getKeyboardAction,re as getLuminance,lt as handleInternalHashScroll,Be as hasChildren,Ie as hasDefinedKeys,$e as hasNameMetadata,ve as hasOnClick,st as hexToHSL,it as hexToNormalizedRGB,$ as hexToRGB,nt as hexToRGBShorthand,E as highlight,ot as interpolateColor,P as isAbsoluteUrl,O as isArray,I as isArrayOf,S as isBigInt,M as isBoolean,q as isBufferLikeObject,V as isCamelCase,Le as isComponentType,Z as isDOMEntry,ie as isDOMPropKey,tt as isDarkColor,R as isDefined,ce as isElementLike,_e as isElementOfType,Ge as isEmail,Ue as isForwardRef,De as isFragment,b as isFunction,Oe as isHTMLString,Ce as isHexByteString,Ee as isInArray,Re as isInstanceOf,Te as isInteger,N as isInternalUrl,L as isJSONArrayString,U as isJSONObjectString,W as isJsonString,Ae as isKebabCase,m as isKeyInObject,J as isKeyOfArray,Pe as isKeyOfObject,fe as isLumGreaterThan,de as isLumLessThan,xe as isMap,A as isNil,x as isNonEmptyString,B as isNull,k as isNumber,l as isObject,je as isPhoneNumber,H as isPrimitive,Ke as isPromise,se as isPropValid,X as isRGBTuple,D as isReactElement,ee as isReactPortal,Ne as isRecordOf,Y as isRef,Q as isRefObject,he as isSet,we as isSnakeCase,p as isString,K as isSymbol,C as isUndefined,ue as isValidReactNode,Se as isWeakMap,ke as isWeakSet,Tt as lazyProxy,mr as logDev,yt as mergeCssVars,gt as mergeEventHandlerClicks,ft as mergeRefs,Qe as normalizeImageSrc,at as normalizeUrl,Er as objectEntries,Pr as objectFromEntries,jr as objectGet,Ir as objectHas,Cr as objectKeys,Gr as objectSet,Nr as objectValues,Ye as preloadImages,dt as retry,me as serialize,ct as stripHash,ze as toCamelCase,He as toKebabCase,Je as toKeyByField,Ve as toSnakeCase,F as validateRGB};
|
|
1
|
+
function z(e,t){let r={};for(let[n,o]of Object.entries(t)){let s=e[o];typeof s=="function"&&(r[n]=s.bind(e))}return r}var h=class e{static includes(t,r){return t.includes(r)}static createFixedLengthArray(t,r){if(t.length!==r)throw new Error(`Array must have exactly ${r} elements`);return t}static readAllItems(t){return[...t]}static map(t,r){return t.map(r)}static forEachUnion(t,r){(Array.isArray(t[0])?[].concat(...t):t).forEach(r)}static forEach(t,r){t.forEach(r)}static reduce(t,r,n){return t.reduce(r,n)}static flat(t){return t.reduce((r,n)=>r.concat(n),[])}static flatMap(t,r){return t.reduce((n,o,s)=>{let i=r(o,s);return n.concat(i)},[])}static filter(t,r){return t.filter(r)}static filterNonNullable(t){return e.filter(t,r=>r!=null)}},St=z(h,{arrayIncludes:"includes",arrayMap:"map",arrayFilter:"filter",arrayFlat:"flat",arrayReduce:"reduce",arrayForEach:"forEach",arrayFlatMap:"flatMap",arrayFilterNonNullable:"filterNonNullable"}),{arrayMap:br,arrayFilter:xr,arrayIncludes:hr,arrayReduce:Sr,arrayFlat:kr,arrayFlatMap:Rr,arrayForEach:wr,arrayFilterNonNullable:Ar}=St;var y=class{static keys(t){return Object.keys(t)}static entries(t){return t?Object.entries(t):[]}static fromEntries(t){return Object.fromEntries(t)}static values(t){return Object.values(t)}static has(t,r){if(!r)return!1;let n=r.split("."),o=t;for(let s of n){if(o==null||typeof o!="object"||!(s in o))return!1;o=o[s]}return!0}static get(t,r){if(!r)return;let n=r.split("."),o=t;for(let s of n){if(o==null||typeof o!="object"||!(s in o))return;o=o[s]}return o}static set(t,r,n){if(!r)return;let o=r.split("."),s=t;for(let i=0;i<o.length-1;i++){let a=o[i];if(typeof s!="object"||s===null)return;let c=s;(!(a in c)||typeof c[a]!="object"||c[a]===null)&&(c[a]={}),s=c[a]}typeof s=="object"&&s!==null&&(s[o[o.length-1]]=n)}},kt=z(y,{objectKeys:"keys",objectEntries:"entries",objectFromEntries:"fromEntries",objectValues:"values",objectHas:"has",objectGet:"get",objectSet:"set"}),{objectKeys:Er,objectEntries:Pr,objectFromEntries:Nr,objectValues:Ir,objectHas:jr,objectGet:Gr,objectSet:Mr}=kt;var k=e=>typeof e=="number"&&!Number.isNaN(e)&&Number.isFinite(e),Te=e=>Number.isInteger(e),p=e=>typeof e=="string",x=e=>typeof e=="string"&&e.length>0&&e.trim().length>0,M=e=>typeof e=="boolean",S=e=>typeof e=="bigint",K=e=>typeof e=="symbol",H=e=>p(e)||k(e)||M(e)||S(e);var Lr=Object.freeze(["div","span","a","p","ul","li"]),ye=Object.freeze(["b","i","p","ul","li","a","span","div","br","strong","em","u","code","pre","blockquote"]),ge={allowedKeys:["arrowleft","arrowright","arrowup","arrowdown","backspace","delete","tab"],clearKeys:["backspace","delete"],copyShortcut:{key:"c",modifiers:["ctrl","meta"]},pasteShortcut:{key:"v",modifiers:["ctrl","meta"]}};var be=Object.freeze(["log","warn","error","info","debug","table"]),f={isoRegex:/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,camelCase:/^[a-z]+(?:[A-Z][a-z0-9]*)*$/,kebabCase:/^[a-z0-9]+(?:-[a-z0-9]+)*$/,snakeCase:/^[a-z0-9]+(?:_[a-z0-9]+)*$/,hexString:/^[0-9a-fA-F]+$/,hexColor:/^[0-9A-Fa-f]{6}$/,letterSeparator:/[^A-Za-z]+/g,camelCaseBoundary:/(?:^\w|[A-Z]|\b\w)/g,kebabCaseBoundary:/([a-z0-9])([A-Z])/g,whitespace:/\s+/g,wordBoundarySplitter:/[^A-Za-z0-9]+/g,USPhoneNumber:/^(?:\+1\s?)?(?:\(\d{3}\)|\d{3})[-.\s]?\d{3}[-.\s]?\d{4}$/,EUPhoneNumber:/^\+?\d{1,4}[\s.-]?\d{2,4}([\s.-]?\d{2,4}){1,3}$/,genericPhoneNumber:/^\+?(\d[\d\s-().]{6,}\d)$/,genericEmail:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,emailRegex:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/,imageSrcRegex:/<img[^>]+src="([^">]+)"/i,singleAlphabetChar:/^[a-zA-Z]$/,htmlDetection:new RegExp(`<\\/?(${ye.join("|")})\\b[^>]*>|&[a-z]+;`,"i"),stackTracePrefix:/^\s*at\s+/},ne={reset:"\x1B[0m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",bold:"\x1B[1m",underline:"\x1B[4m"};var Rt={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0,autoFocus:!0,defaultValue:!0,defaultChecked:!0,innerHTML:!0,suppressContentEditableWarning:!0,suppressHydrationWarning:!0,valueLink:!0},wt={action:!0,formAction:!0,onCaptured:!0,precedence:!0,blocking:!0},At={autoFocus:!0,readOnly:!0,noValidate:!0,spellCheck:!0,tabIndex:!0,autoComplete:!0,autoCorrect:!0,autoCapitalize:!0},Ot={popover:!0,popoverTarget:!0,popoverTargetAction:!0,inert:!0,loading:!0,fetchpriority:!0,fetchPriority:!0,enterKeyHint:!0,shadowRoot:!0,disablePictureInPicture:!0,playsInline:!0},Ct={paintOrder:!0,vectorEffect:!0,imageRendering:!0,shapeRendering:!0,textAnchor:!0,ariaHasPopup:!0,ariaLabel:!0,ariaLabelledBy:!0,alignmentBaseline:!0,baselineShift:!0,dominantBaseline:!0},Et={about:!0,datatype:!0,inlist:!0,prefix:!0,property:!0,resource:!0,typeof:!0,vocab:!0,itemProp:!0,itemScope:!0,itemType:!0,itemID:!0,itemRef:!0},Pt={autoCapitalize:!0,autoCorrect:!0,autoSave:!0,color:!0,incremental:!0,results:!0,security:!0,unselectable:!0,on:!0,option:!0,fallback:!0},Nt={abbr:!0,accept:!0,acceptCharset:!0,accessKey:!0,action:!0,allow:!0,allowFullScreen:!0,allowPaymentRequest:!0,alt:!0,async:!0,autoComplete:!0,autoFocus:!0,autoPlay:!0,capture:!0,cellPadding:!0,cellSpacing:!0,challenge:!0,charSet:!0,checked:!0,cite:!0,classID:!0,className:!0,cols:!0,colSpan:!0,content:!0,contentEditable:!0,contextMenu:!0,controls:!0,controlsList:!0,coords:!0,crossOrigin:!0,data:!0,dateTime:!0,decoding:!0,default:!0,defer:!0,dir:!0,disabled:!0,disablePictureInPicture:!0,disableRemotePlayback:!0,download:!0,draggable:!0,encType:!0,enterKeyHint:!0,form:!0,formAction:!0,formEncType:!0,formMethod:!0,formNoValidate:!0,formTarget:!0,frameBorder:!0,headers:!0,height:!0,hidden:!0,high:!0,href:!0,hrefLang:!0,htmlFor:!0,httpEquiv:!0,id:!0,inputMode:!0,integrity:!0,is:!0,keyParams:!0,keyType:!0,kind:!0,label:!0,lang:!0,list:!0,loading:!0,loop:!0,low:!0,marginHeight:!0,marginWidth:!0,max:!0,maxLength:!0,media:!0,mediaGroup:!0,method:!0,min:!0,minLength:!0,multiple:!0,muted:!0,name:!0,nonce:!0,noValidate:!0,open:!0,optimum:!0,pattern:!0,placeholder:!0,playsInline:!0,poster:!0,preload:!0,profile:!0,radioGroup:!0,readOnly:!0,referrerPolicy:!0,rel:!0,required:!0,reversed:!0,role:!0,rows:!0,rowSpan:!0,sandbox:!0,scope:!0,scoped:!0,scrolling:!0,seamless:!0,selected:!0,shape:!0,size:!0,sizes:!0,slot:!0,span:!0,spellCheck:!0,src:!0,srcDoc:!0,srcLang:!0,srcSet:!0,start:!0,step:!0,style:!0,summary:!0,tabIndex:!0,target:!0,title:!0,translate:!0,type:!0,useMap:!0,value:!0,width:!0,wmode:!0,wrap:!0},It={alignmentBaseline:!0,baselineShift:!0,clip:!0,clipPath:!0,clipRule:!0,color:!0,colorInterpolation:!0,colorInterpolationFilters:!0,colorProfile:!0,colorRendering:!0,cursor:!0,direction:!0,display:!0,dominantBaseline:!0,enableBackground:!0,fill:!0,fillOpacity:!0,fillRule:!0,filter:!0,floodColor:!0,floodOpacity:!0,imageRendering:!0,lightingColor:!0,markerEnd:!0,markerMid:!0,markerStart:!0,mask:!0,opacity:!0,overflow:!0,paintOrder:!0,pointerEvents:!0,shapeRendering:!0,stopColor:!0,stopOpacity:!0,stroke:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeLinecap:!0,strokeLinejoin:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,textAnchor:!0,textDecoration:!0,textRendering:!0,unicodeBidi:!0,vectorEffect:!0,visibility:!0,wordSpacing:!0,writingMode:!0},jt={cx:!0,cy:!0,d:!0,dx:!0,dy:!0,fr:!0,fx:!0,fy:!0,height:!0,points:!0,r:!0,rx:!0,ry:!0,transform:!0,version:!0,viewBox:!0,width:!0,x:!0,x1:!0,x2:!0,y:!0,y1:!0,y2:!0,z:!0},Gt={accumulate:!0,additive:!0,allowReorder:!0,amplitude:!0,attributeName:!0,attributeType:!0,autoReverse:!0,begin:!0,bias:!0,by:!0,calcMode:!0,decelerate:!0,diffuseConstant:!0,divisor:!0,dur:!0,edgeMode:!0,elevation:!0,end:!0,exponent:!0,externalResourcesRequired:!0,filterRes:!0,filterUnits:!0,from:!0,in:!0,in2:!0,intercept:!0,k:!0,k1:!0,k2:!0,k3:!0,k4:!0,kernelMatrix:!0,kernelUnitLength:!0,keyPoints:!0,keySplines:!0,keyTimes:!0,limitingConeAngle:!0,mode:!0,numOctaves:!0,operator:!0,order:!0,orient:!0,orientation:!0,origin:!0,pathLength:!0,primitiveUnits:!0,repeatCount:!0,repeatDur:!0,restart:!0,result:!0,rotate:!0,scale:!0,seed:!0,slope:!0,spacing:!0,specularConstant:!0,specularExponent:!0,speed:!0,spreadMethod:!0,startOffset:!0,stdDeviation:!0,stitchTiles:!0,surfaceScale:!0,targetX:!0,targetY:!0,to:!0,values:!0,xChannelSelector:!0,yChannelSelector:!0,zoomAndPan:!0},Mt={accentHeight:!0,alphabetic:!0,arabicForm:!0,ascent:!0,bbox:!0,capHeight:!0,descent:!0,fontFamily:!0,fontSize:!0,fontSizeAdjust:!0,fontStretch:!0,fontStyle:!0,fontVariant:!0,fontWeight:!0,format:!0,g1:!0,g2:!0,glyphName:!0,glyphOrientationHorizontal:!0,glyphOrientationVertical:!0,glyphRef:!0,hanging:!0,horizAdvX:!0,horizOriginX:!0,ideographic:!0,kerning:!0,lengthAdjust:!0,letterSpacing:!0,local:!0,mathematical:!0,overlinePosition:!0,overlineThickness:!0,panose1:!0,refX:!0,refY:!0,renderingIntent:!0,strikethroughPosition:!0,strikethroughThickness:!0,string:!0,systemLanguage:!0,tableValues:!0,textLength:!0,u1:!0,u2:!0,underlinePosition:!0,underlineThickness:!0,unicode:!0,unicodeRange:!0,unitsPerEm:!0,vAlphabetic:!0,vHanging:!0,vIdeographic:!0,vMathematical:!0,values:!0,vertAdvY:!0,vertOriginX:!0,vertOriginY:!0,widths:!0,xHeight:!0},Kt={clipPathUnits:!0,contentScriptType:!0,contentStyleType:!0,gradientTransform:!0,gradientUnits:!0,markerHeight:!0,markerUnits:!0,markerWidth:!0,maskContentUnits:!0,maskUnits:!0,offset:!0,patternContentUnits:!0,patternTransform:!0,patternUnits:!0,preserveAlpha:!0,preserveAspectRatio:!0,requiredExtensions:!0,requiredFeatures:!0,viewTarget:!0,xlinkActuate:!0,xlinkArcrole:!0,xlinkHref:!0,xlinkRole:!0,xlinkShow:!0,xlinkTitle:!0,xlinkType:!0,xmlBase:!0,xmlns:!0,xmlnsXlink:!0,xmlLang:!0,xmlSpace:!0},Bt={for:!0,class:!0,autofocus:!0},oe={...Pt,...Et,...Ct,...Ot,...At,...wt,...Rt,...Bt,...Kt,...Mt,...Gt,...jt,...It,...Nt},_r=Object.keys(oe);var B=e=>e===null,C=e=>typeof e>"u",R=e=>e!=null,A=e=>e==null,b=e=>typeof e=="function",l=e=>!B(e)&&!O(e)&&typeof e=="object",O=e=>Array.isArray(e),xe=e=>e instanceof Map,he=e=>e instanceof Set,Se=e=>e instanceof WeakMap,ke=e=>e instanceof WeakSet;function Re(e,t){return e instanceof t}var V=e=>typeof e=="string"&&f.camelCase.test(e),we=e=>typeof e=="string"&&f.snakeCase.test(e),Ae=e=>typeof e=="string"&&f.kebabCase.test(e),L=e=>{if(!x(e))return!1;try{return Array.isArray(JSON.parse(e))}catch{return!1}},U=e=>{if(!x(e))return!1;try{let t=JSON.parse(e);return typeof t=="object"&&t!==null&&!Array.isArray(t)}catch{return!1}},Oe=e=>p(e)&&f.htmlDetection.test(e),Ce=e=>t=>!(!x(t)||t.length%2!==0||!f.hexString.test(t)||!C(e)&&t.length!==e),W=e=>L(e)||U(e);var P=e=>{if(!x(e))return!1;try{return new URL(e),!0}catch{return!1}},N=e=>{if(typeof window>"u"||typeof location>"u"||!x(e))return!1;if(e.startsWith("/"))return!0;try{return new URL(e,location.origin).hostname===location.hostname}catch{return!1}};var Ee=e=>{let t=new Set(e);return r=>!C(r)&&t.has(r)},Pe=e=>t=>(p(t)||k(t)||K(t))&&t in e,d=e=>t=>l(t)&&e in t,J=e=>t=>(p(t)||k(t)||K(t)||M(t))&&e.includes(t),I=(e,t)=>Array.isArray(t)&&t.every(e),Ne=(e,t)=>l(e)&&y.values(e).every(t),Ie=e=>t=>!t||!l(t)?!1:e.every(r=>d(r)(t)&&R(t[r])),je=e=>{let t=y.keys(e);return r=>{if(!l(r))return!1;for(let n of t){let o=e[n];if(!d(n)(r)||!o(r[n]))return!1}return!0}};var q=e=>{if(!l(e))return!1;let t="type"in e&&e.type==="Buffer",r="data"in e&&I(k,e.data);return t&&r},X=e=>O(e)&&e.length===3&&e.every(t=>k(t)&&t>=0&&t<=255),Ge=e=>x(e)?[f.USPhoneNumber,f.EUPhoneNumber,f.genericPhoneNumber].some(t=>t.test(e)):!1,Me=e=>p(e)&&f.emailRegex.test(e);var g={isString:p,isNumber:k,isBoolean:M,isBigInt:S,isNil:A,isDefined:R,isInteger:Te,isNonEmptyString:x,isSymbol:K,isPrimitive:H,isNull:B,isFunction:b,isObject:l,isArray:O,isMap:xe,isSet:he,isWeakMap:Se,isWeakSet:ke,isUndefined:C,isInstanceOf:Re},dn={isEmail:Me,isPhone:Ge,isUrlAbsolute:P,isUrlInternal:N,isJsonString:W,isHTMLString:Oe,isCamelCase:V,isSnakeCase:we,isKebabCase:Ae,isHexByteString:Ce,isJSONObjectString:U,isJSONArrayString:L,isRGBTuple:X,isBufferLikeObject:q},mn={isArrayOf:I,isRecordOf:Ne,isKeyOfObject:Pe,isKeyInObject:d,isKeyOfArray:J,isInArray:Ee,hasKeys:Ie,isShape:je};var Ke=e=>{let t=Object.create(null);return r=>{if(r in t)return t[r];let n=e(r);return t[r]=n,n}};var Lt=y.keys(oe).join("|"),Ut=new RegExp(`^((${Lt})|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$`),se=Ke(e=>Ut.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91),ie=e=>p(e)&&se(e),Z=e=>p(e[0])&&ie(e[0]);var Dt=(e,t)=>d("$$typeof")(e)&&e.$$typeof===t,Y=e=>R(e)&&(b(e)||l(e)&&"current"in e),Q=e=>!B(e)&&l(e)&&"current"in e,Be=e=>!!e&&d("then")(e)&&b(e.then),ee=e=>l(e)&&d("containerInfo")(e),Le=e=>l(e)&&d("children")(e)&&R(e.children),Ue=e=>b(e)||d("prototype")(e)&&l(e.prototype)&&d("render")(e.prototype)&&b(e.prototype.render),De=e=>Dt(e,Symbol.for("react.forward_ref"));import{isValidElement as ae,Fragment as vt}from"react";var ue=e=>A(e)||H(e)||ae(e)||ee(e)||I(ue,e),D=e=>ae(e),ve=e=>ae(e)&&e.type===vt,_e=e=>D(e)&&!A(e.props)&&d("onClick")(e.props)&&b(e.props.onClick),ce=e=>l(e)&&d("type")(e)&&d("props")(e)&&l(e.props)&&(p(e.type)||b(e.type)),$e=(e,t)=>ce(e)&&t.includes(e.type),Fe=e=>b(e)&&(l(e)||b(e))&&(d("displayName")(e)||d("name")(e)||d("type")(e));var Dn={isRef:Y,isRefObject:Q,isPromise:Be,isReactPortal:ee,hasChildren:Le,isComponentType:Ue,isForwardRef:De,isValidReactNode:ue,isReactElement:D,isFragment:ve,hasOnClick:_e,isElementLike:ce,isElementOfType:$e,hasNameMetadata:Fe,isDOMPropKey:ie,isDOMEntry:Z,isPropValid:se};var ze=(e,t,r)=>{if(!t(e))throw new Error(r??"Validation failed for value")},m=(e,t)=>(r,n)=>ze(r,e,n),_t=m(g.isNumber,"isNumber"),$t=m(g.isInteger,"isInteger"),Ft=m(g.isString,"isString"),zt=m(g.isNonEmptyString,"isNonEmptyString"),Ht=m(g.isBoolean,"isBoolean"),Vt=m(g.isBigInt,"isBigInt"),Wt=m(g.isSymbol,"isSymbol"),Jt=m(g.isNull,"isNull"),qt=m(g.isUndefined,"isUndefined"),Xt=m(g.isDefined,"isDefined"),Zt=m(g.isNil,"isNil"),Yt=m(g.isFunction,"isFunction"),Qt=m(g.isObject,"isObject"),er=m(g.isArray,"isArray"),tr=m(g.isMap,"isMap"),rr=m(g.isSet,"isSet"),nr=m(g.isWeakMap,"isWeakMap"),or=m(g.isWeakSet,"isWeakSet"),sr=m(V,"isCamelCase"),ir=m(q,"isBufferLikeObject"),ar=m(L,"isJSONArrayString"),ur=m(U,"isJSONObjectString"),cr=m(W,"isJsonString"),lr=m(P,"isAbsoluteUrl"),pr=m(N,"isInternalUrl"),le=m(X,"isRGBTuple"),$n={assertValue:ze,makeAssert:m,assertIsNumber:_t,assertIsInteger:$t,assertIsString:Ft,assertIsNonEmptyString:zt,assertIsBoolean:Ht,assertIsBigInt:Vt,assertIsSymbol:Wt,assertIsNull:Jt,assertIsUndefined:qt,assertIsDefined:Xt,assertIsNil:Zt,assertIsFunction:Yt,assertObject:Qt,assertIsArray:er,assertIsMap:tr,assertIsSet:rr,assertIsWeakMap:nr,assertIsWeakSet:or,assertIsCamelCase:sr,assertIsBufferLikeObject:ir,assertIsJSONArrayString:ar,assertIsJSONObjectString:ur,assertIsJsonString:cr,assertIsAbsoluteUrl:lr,assertIsInternalUrl:pr,assertIsRGBTuple:le};var te=e=>e[0].toUpperCase()+e.slice(1),He=e=>A(e)||!x(e)?"":e.replace(f.letterSeparator," ").replace(f.camelCaseBoundary,(r,n)=>n===0?r.toLowerCase():r.toUpperCase()).replace(f.whitespace,""),Ve=e=>A(e)||!x(e)?"":e.replace(f.wordBoundarySplitter," ").replace(f.kebabCaseBoundary,"$1 $2").trim().split(f.whitespace).join("-").toLowerCase(),We=e=>A(e)||!x(e)?"":e.replace(f.wordBoundarySplitter," ").replace(f.kebabCaseBoundary,"$1 $2").trim().split(f.whitespace).join("_").toLowerCase();var Je=e=>{let{keys:t,prefix:r,suffix:n}=e,o=h.map(t,s=>{let i=r?`${r}${s.charAt(0).toUpperCase()+s.slice(1)}${n}`:`${s.charAt(0).toLowerCase()+s.slice(1)}${n}`;return[s,i]});return y.fromEntries(o)},qe=(e,t)=>y.fromEntries(h.map(e,r=>{let n=r[t],{[t]:o,...s}=r;return[n,s]})),pe=e=>h.map(e,te),Xe=e=>pe(y.keys(e).map(String).filter(t=>/^[A-Za-z]/.test(t)));var Yn={capitalizedKeys:Xe,capitalizeArray:pe,toKeyByField:qe,generateKeyMap:Je,toSnakeCase:We,toKebabCase:Ve,toCamelCase:He,capitalizeString:te};function E(e,t="yellow"){return`${ne[t]}${e}${ne.reset}`}var dr={log:e=>E(e,"yellow"),info:e=>E(e,"cyan"),error:e=>E(e,"red"),debug:e=>E(e,"magenta"),warn:e=>E(e,"yellow"),table:e=>e},de=e=>{if(C(e))return"";if(p(e))return e;try{return JSON.stringify(e,(t,r)=>S(r)?r.toString():r,2)}catch{return String(e)}},Ze=e=>{let{preferredIndex:t=3,fallbackIndex:r=2,topParent:n=!1,stripPathPrefix:o=process.cwd()}=e,s=new Error().stack;if(!s)return"unknown";let i=s.split(`
|
|
2
|
+
`).slice(1).map(c=>c.replace(f.stackTracePrefix,"").trim()).filter(Boolean),a=n?[...i].reverse().find(c=>!c.includes("node_modules"))??i.at(-1):i[t]??i[r]??i.at(-1);return o?a?.replace(o,"")??"unknown":a??"unknown"},mr=(e,...t)=>{let r=process.env.NODE_ENV!=="production",{enabled:n=!0,overrideDev:o=!1}=e;if(!n||!r&&!o)return;let s="log",i=t[0];if(p(i)&&J(be)(i)&&(s=i),s==="table"){let u=h.map(t.slice(1),T=>T&&l(T)&&"current"in T?T.current.map(G=>({key:G.key,duration:G.end!=null&&G.start!=null?`${(G.end-G.start).toFixed(2)}ms`:"in progress"})):T);console.table(u.flat());return}let a=dr[s],c=t.map(u=>{let T=l(u)?de(u):String(u);return a?a(T):T});(console[s]??console.log)(...c)};var v=class{};v.highlight=E,v.serialize=de,v.getCallerLocation=Ze;function Ye(e,t={}){let r=(u,T)=>u.key.toLowerCase()!==T.key?!1:T.modifiers.some(w=>w==="ctrl"?u.ctrlKey:w==="meta"?u.metaKey:w==="alt"?u.altKey:w==="shift"?u.shiftKey:!1),n={...ge,...t},o=e.key.toLowerCase(),s=r(e,n.copyShortcut),i=r(e,n.pasteShortcut),a=n.clearKeys.includes(o),c=n.allowedKeys.includes(o);return{isPaste:i,isCopy:s,isClear:a,isAllowedKey:c,shouldBlockTyping:!c&&!s&&!i}}var _=new Map,fr=200;async function Qe(e,t={}){if(typeof window>"u")return;let{fetchPriority:r="low"}=t,o=(O(e)?e:[e]).filter(s=>!_.has(s)).map(s=>new Promise(i=>{let a=new Image;a.fetchPriority=r,a.src=s;let c=()=>{if(_.size>=fr){let u=_.keys().next().value;u&&_.delete(u)}_.set(s,!0),i()};a.complete?c():d("decode")(a)&&b(a.decode)?a.decode().then(c).catch(c):(a.onload=c,a.onerror=c)}));o.length!==0&&await Promise.all(o)}function et(e){return e?p(e)?e:(d("default")(e),d("default")(e)&&e.default&&l(e.default)&&d("src")(e.default)?e.default.src:l(e)&&d("src")(e)&&p(e.src)?e.src:""):""}var mo={getKeyboardAction:Ye,preloadImages:Qe,normalizeImageSrc:et};var tt=class{static toNum(t){return S(t)?Number(t):t}static round(t,r=0){let n=Math.pow(10,r);return Math.round(t*n)/n}static clamp(t,r,n){return Math.max(r,Math.min(n,t))}static getPercentage(t,r,n=0){if(r===0||r===0n)return 0;if(S(t)||S(r)){let o=BigInt(10**(n+2));return Number(BigInt(t)*100n*o/BigInt(r))/Number(o)}return this.round(t/r*100,n)}static computeMean(t){if(!t.length)return 0;let r=t.map(n=>this.toNum(n));return r.reduce((n,o)=>n+o,0)/r.length}static isAnomaly(t,r,n,o=2){return n===0?!1:Math.abs(t-r)>n*o}static computeRatio(t,r,n=2){return this.getPercentage(t,r,n)}static welfordUpdate(t,r){if(!t)return{welford:{count:1,mean:r,squaredDeviationSum:0},stdDev:0};let{count:n,mean:o,squaredDeviationSum:s}=t,i=n+1,a=r-o,c=o+a/i,u=s+a*(r-c),T=i>1?u/(i-1):0,w=Math.sqrt(T);return{welford:{count:i,mean:c,squaredDeviationSum:u},stdDev:w}}static computeDelta(t,r){if(S(t)&&S(r)){let n=t-r,o=n<0n?-n:n;return{netDelta:n,absDelta:o}}if(k(t)&&k(r)){let n=t-r,o=Math.abs(n);return{netDelta:n,absDelta:o}}throw new Error("Incompatible types: current and past must both be number or both be bigint.")}static computePercentageChange(t,r,n=1n){if(r===0||r===0n)return 0;if(S(t)||S(r)){let o=BigInt(t),s=BigInt(r);return Number((o-s)*(100n*n)/s)/Number(n)}return(t-r)/r*100}};var $=e=>{let t=e.startsWith("#")?e.slice(1):e;if(!f.hexColor.test(t))throw new Error(`Invalid hex color: "${e}"`);let r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),o=parseInt(t.slice(4,6),16);return[r,n,o]},F=e=>p(e)?$(e):(le(e),e),re=e=>{let[t,r,n]=F(e),o=s=>{let i=s/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*o(t)+.7152*o(r)+.0722*o(n)},me=(e,t)=>re(F(e))<t,rt=e=>me(e,.179),fe=(e,t)=>re(F(e))>t,nt=(e,t)=>{let{mode:r="tailwind",threshold:n=.179}=t??{},o=fe(e,n);return r==="css"?o?"#000000":"#ffffff":o?"text-black":"text-white"},ot=e=>{let t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,r=e.replace(t,(o,s,i,a)=>s+s+i+i+a+a),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return n?[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]:null},st=(e,t,r)=>{let n={r:Math.round(e.r+(t.r-e.r)*r),g:Math.round(e.g+(t.g-e.g)*r),b:Math.round(e.b+(t.b-e.b)*r)};return`rgb(${n.r}, ${n.g}, ${n.b})`};function it(e){let[t,r,n]=$(e).map(T=>T/255),o=Math.max(t,r,n),s=Math.min(t,r,n),i=(o+s)/2,a=0,c=0,u=o-s;return u!==0&&(c=i>.5?u/(2-o-s):u/(o+s),o===t?a=((r-n)/u+(r<n?6:0))*60:o===r?a=((n-t)/u+2)*60:o===n&&(a=((t-r)/u+4)*60)),{h:a,s:c,l:i}}var at=e=>{let[t,r,n]=$(e);return[t/255,r/255,n/255]};var ko={hexToNormalizedRGB:at,hexToHSL:it,interpolateColor:st,hexToRGBShorthand:ot,contrastTextColor:nt,isLumGreaterThan:fe,isDarkColor:rt,isLumLessThan:me,getLuminance:re,validateRGB:F,hexToRGB:$};function ut(e){if(!R(e))return"";if(p(e))return e;if(e instanceof URL)return e.toString();if(l(e)&&(d("pathname")(e)||d("query")(e))){let{pathname:t="",query:r,hash:n=""}=e,o="";if(l(r)){let a=new URLSearchParams;y.entries(r).forEach(([u,T])=>{R(T)&&(O(T)?h.forEach(T,w=>a.append(u,String(w))):a.append(u,String(T)))});let c=a.toString();c&&(o=`?${c}`)}let s=t||"",i=n&&!n.startsWith("#")?`#${n}`:n||"";return`${s}${o}${i}`}return""}var ct=e=>{if(!N(e))return"/";let t=e.trim();return t?t.startsWith("/")?t:P(t)?new URL(t).pathname||"/":`/${t}`:"/"},lt=e=>{if(!e)return"";if(!e.includes("#"))return e;try{let t=typeof window<"u"?window.location.origin:"http://localhost",r=new URL(e,t);return typeof window<"u"&&r.origin===window.location.origin?`${r.pathname}${r.search}`:`${r.origin}${r.pathname}${r.search}`}catch{return e.split("#")[0]}},pt=({event:e,href:t,behavior:r="smooth",block:n="start"})=>{if(typeof window>"u"||!t.startsWith("#")||/iPad|iPhone|iPod/.test(navigator.userAgent))return!1;let s=t.replace(/^#/,""),i=document.getElementById(s);return i?(e?.preventDefault(),i.scrollIntoView({behavior:r,block:n}),!0):!1};var j=class{};j.normalize=ut,j.extractRelativePath=ct,j.stripHash=lt,j.handleHashScroll=pt;async function dt(e){let t=await fetch(e);if(!t.ok)throw new Error(`\u274C Failed to fetch ${e}: ${t.status} ${t.statusText}`);try{return await t.json()}catch(r){throw new Error(`\u274C Failed to parse JSON from ${e}: ${r.message}`)}}var mt=e=>new Promise(t=>setTimeout(t,e));async function ft(e,t=5,r=500){let n;function o(s){return l(s)&&R(s)&&("code"in s||"message"in s)}for(let s=0;s<=t;s++)try{let i=await e();return s>0&&console.log({},`[Retry] Success on attempt ${s+1}`),i}catch(i){n=i;let a=!1;if(o(i)){let u=i.message??"";a=(i.code??"")==="BAD_DATA"||u.includes("Too Many Requests")}if(!a||s===t){console.error(`[Retry] Failed on attempt ${s+1}:`,i);let u;throw i instanceof Error?u=i:l(i)&&d("message")(i)&&p(i.message)?u=new Error(i.message):u=new Error(String(i||"Retry failed")),u}let c=r*2**s+Math.random()*200;console.warn(`[Retry] Rate limited on attempt ${s+1}, retrying in ${Math.round(c)}ms...`),await new Promise(u=>setTimeout(u,c))}throw console.error("[Retry] All retry attempts exhausted"),n||new Error("Retry attempts exhausted")}import{Children as Tr}from"react";var Tt=(...e)=>{let t=h.filter(e,Y);return r=>{for(let n of t)b(n)?n(r):Q(n)&&(n.current=r)}};function yt(e){let t=new Map,r=new Set(y.keys(e));return new Proxy(e,{get(n,o,s){if(!p(o)||!r.has(o))return Reflect.get(n,o,s);if(t.has(o))return t.get(o);let i=n[o];if(b(i)){let a=i();return t.set(o,a),a}return i}})}function gt(e,t){return{...y.fromEntries(y.entries(e).filter(([n,o])=>o!==void 0&&o!=="").map(([n,o])=>[n,o.toString()])),...t}}function bt(e,t){return r=>{e?.(r),r.defaultPrevented||t?.(r)}}function xt(e){let t=y.entries(e),r=h.filter(t,Z);return y.fromEntries(r)}function ht(e,t){return Tr.toArray(e).filter(r=>D(r)?r.type?.displayName===t:!1)}var Lo={fetchJson:dt,delay:mt,retry:ft},Uo={mergeRefs:Tt,lazyProxy:yt,mergeCssVars:gt,mergeEventHandlerClicks:bt,extractDOMProps:xt,filterChildrenByDisplayName:ht};export{h as ArrayUtils,$n as AssertionUtils,mn as CollectionTypeGuards,ko as ColorUtils,tt as ComputationUtils,g as CoreTypeGuards,v as DebugUtils,mo as DomUtils,dn as FormatTypeGuards,j as LinkUtils,y as ObjectUtils,Lo as ProcessorUtils,Uo as ReactProcessorUtils,Dn as ReactTypeGuards,St as RenamedArrayMethods,kt as RenamedObjectMethods,Yn as TransformersUtils,xr as arrayFilter,Ar as arrayFilterNonNullable,kr as arrayFlat,Rr as arrayFlatMap,wr as arrayForEach,hr as arrayIncludes,br as arrayMap,Sr as arrayReduce,lr as assertIsAbsoluteUrl,er as assertIsArray,Vt as assertIsBigInt,Ht as assertIsBoolean,ir as assertIsBufferLikeObject,sr as assertIsCamelCase,Xt as assertIsDefined,Yt as assertIsFunction,$t as assertIsInteger,pr as assertIsInternalUrl,ar as assertIsJSONArrayString,ur as assertIsJSONObjectString,cr as assertIsJsonString,tr as assertIsMap,Zt as assertIsNil,zt as assertIsNonEmptyString,Jt as assertIsNull,_t as assertIsNumber,le as assertIsRGBTuple,rr as assertIsSet,Ft as assertIsString,Wt as assertIsSymbol,qt as assertIsUndefined,nr as assertIsWeakMap,or as assertIsWeakSet,Qt as assertObject,pe as capitalizeArray,te as capitalizeString,Xe as capitalizedKeys,nt as contrastTextColor,mt as delay,xt as extractDOMProps,ct as extractRelativePath,dt as fetchJson,ht as filterChildrenByDisplayName,Je as generateKeyMap,Ze as getCallerLocation,Ye as getKeyboardAction,re as getLuminance,pt as handleInternalHashScroll,Le as hasChildren,Ie as hasDefinedKeys,Fe as hasNameMetadata,_e as hasOnClick,it as hexToHSL,at as hexToNormalizedRGB,$ as hexToRGB,ot as hexToRGBShorthand,E as highlight,st as interpolateColor,P as isAbsoluteUrl,O as isArray,I as isArrayOf,S as isBigInt,M as isBoolean,q as isBufferLikeObject,V as isCamelCase,Ue as isComponentType,Z as isDOMEntry,ie as isDOMPropKey,rt as isDarkColor,R as isDefined,ce as isElementLike,$e as isElementOfType,Me as isEmail,De as isForwardRef,ve as isFragment,b as isFunction,Oe as isHTMLString,Ce as isHexByteString,Ee as isInArray,Re as isInstanceOf,Te as isInteger,N as isInternalUrl,L as isJSONArrayString,U as isJSONObjectString,W as isJsonString,Ae as isKebabCase,d as isKeyInObject,J as isKeyOfArray,Pe as isKeyOfObject,fe as isLumGreaterThan,me as isLumLessThan,xe as isMap,A as isNil,x as isNonEmptyString,B as isNull,k as isNumber,l as isObject,Ge as isPhoneNumber,H as isPrimitive,Be as isPromise,se as isPropValid,X as isRGBTuple,D as isReactElement,ee as isReactPortal,Ne as isRecordOf,Y as isRef,Q as isRefObject,he as isSet,je as isShape,we as isSnakeCase,p as isString,K as isSymbol,C as isUndefined,ue as isValidReactNode,Se as isWeakMap,ke as isWeakSet,yt as lazyProxy,mr as logDev,gt as mergeCssVars,bt as mergeEventHandlerClicks,Tt as mergeRefs,et as normalizeImageSrc,ut as normalizeUrl,Pr as objectEntries,Nr as objectFromEntries,Gr as objectGet,jr as objectHas,Er as objectKeys,Mr as objectSet,Ir as objectValues,Qe as preloadImages,ft as retry,de as serialize,lt as stripHash,He as toCamelCase,Ve as toKebabCase,qe as toKeyByField,We as toSnakeCase,F as validateRGB};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|