@helpwave/hightide 0.1.48 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -29,135 +29,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  ));
30
30
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
31
 
32
- // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
33
- var require_use_sync_external_store_shim_production = __commonJS({
34
- "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"(exports2) {
35
- "use strict";
36
- var React21 = require("react");
37
- function is(x, y) {
38
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
39
- }
40
- var objectIs = "function" === typeof Object.is ? Object.is : is;
41
- var useState37 = React21.useState;
42
- var useEffect40 = React21.useEffect;
43
- var useLayoutEffect3 = React21.useLayoutEffect;
44
- var useDebugValue = React21.useDebugValue;
45
- function useSyncExternalStore$2(subscribe2, getSnapshot) {
46
- var value = getSnapshot(), _useState = useState37({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
47
- useLayoutEffect3(
48
- function() {
49
- inst.value = value;
50
- inst.getSnapshot = getSnapshot;
51
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
52
- },
53
- [subscribe2, value, getSnapshot]
54
- );
55
- useEffect40(
56
- function() {
57
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
58
- return subscribe2(function() {
59
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
60
- });
61
- },
62
- [subscribe2]
63
- );
64
- useDebugValue(value);
65
- return value;
66
- }
67
- function checkIfSnapshotChanged(inst) {
68
- var latestGetSnapshot = inst.getSnapshot;
69
- inst = inst.value;
70
- try {
71
- var nextValue = latestGetSnapshot();
72
- return !objectIs(inst, nextValue);
73
- } catch (error) {
74
- return true;
75
- }
76
- }
77
- function useSyncExternalStore$1(subscribe2, getSnapshot) {
78
- return getSnapshot();
79
- }
80
- var shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
81
- exports2.useSyncExternalStore = void 0 !== React21.useSyncExternalStore ? React21.useSyncExternalStore : shim;
82
- }
83
- });
84
-
85
- // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
86
- var require_use_sync_external_store_shim_development = __commonJS({
87
- "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports2) {
88
- "use strict";
89
- "production" !== process.env.NODE_ENV && function() {
90
- function is(x, y) {
91
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
92
- }
93
- function useSyncExternalStore$2(subscribe2, getSnapshot) {
94
- didWarnOld18Alpha || void 0 === React21.startTransition || (didWarnOld18Alpha = true, console.error(
95
- "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
96
- ));
97
- var value = getSnapshot();
98
- if (!didWarnUncachedGetSnapshot) {
99
- var cachedValue = getSnapshot();
100
- objectIs(value, cachedValue) || (console.error(
101
- "The result of getSnapshot should be cached to avoid an infinite loop"
102
- ), didWarnUncachedGetSnapshot = true);
103
- }
104
- cachedValue = useState37({
105
- inst: { value, getSnapshot }
106
- });
107
- var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
108
- useLayoutEffect3(
109
- function() {
110
- inst.value = value;
111
- inst.getSnapshot = getSnapshot;
112
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
113
- },
114
- [subscribe2, value, getSnapshot]
115
- );
116
- useEffect40(
117
- function() {
118
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
119
- return subscribe2(function() {
120
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
121
- });
122
- },
123
- [subscribe2]
124
- );
125
- useDebugValue(value);
126
- return value;
127
- }
128
- function checkIfSnapshotChanged(inst) {
129
- var latestGetSnapshot = inst.getSnapshot;
130
- inst = inst.value;
131
- try {
132
- var nextValue = latestGetSnapshot();
133
- return !objectIs(inst, nextValue);
134
- } catch (error) {
135
- return true;
136
- }
137
- }
138
- function useSyncExternalStore$1(subscribe2, getSnapshot) {
139
- return getSnapshot();
140
- }
141
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
142
- var React21 = require("react"), objectIs = "function" === typeof Object.is ? Object.is : is, useState37 = React21.useState, useEffect40 = React21.useEffect, useLayoutEffect3 = React21.useLayoutEffect, useDebugValue = React21.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
143
- exports2.useSyncExternalStore = void 0 !== React21.useSyncExternalStore ? React21.useSyncExternalStore : shim;
144
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
145
- }();
146
- }
147
- });
148
-
149
- // node_modules/use-sync-external-store/shim/index.js
150
- var require_shim = __commonJS({
151
- "node_modules/use-sync-external-store/shim/index.js"(exports2, module2) {
152
- "use strict";
153
- if (process.env.NODE_ENV === "production") {
154
- module2.exports = require_use_sync_external_store_shim_production();
155
- } else {
156
- module2.exports = require_use_sync_external_store_shim_development();
157
- }
158
- }
159
- });
160
-
161
32
  // node_modules/@swc/helpers/cjs/_interop_require_default.cjs
162
33
  var require_interop_require_default = __commonJS({
163
34
  "node_modules/@swc/helpers/cjs/_interop_require_default.cjs"(exports2) {
@@ -2712,7 +2583,7 @@ var require_image_component = __commonJS({
2712
2583
  Object.defineProperty(exports2, "Image", {
2713
2584
  enumerable: true,
2714
2585
  get: function() {
2715
- return Image3;
2586
+ return Image2;
2716
2587
  }
2717
2588
  });
2718
2589
  var _interop_require_default = require_interop_require_default();
@@ -2920,7 +2791,7 @@ var require_image_component = __commonJS({
2920
2791
  }, "__nimg-" + imgAttributes.src + imgAttributes.srcSet + imgAttributes.sizes)
2921
2792
  });
2922
2793
  }
2923
- var Image3 = /* @__PURE__ */ (0, _react.forwardRef)((props, forwardedRef) => {
2794
+ var Image2 = /* @__PURE__ */ (0, _react.forwardRef)((props, forwardedRef) => {
2924
2795
  const pagesRouter = (0, _react.useContext)(_routercontextsharedruntime.RouterContext);
2925
2796
  const isAppRouter = !pagesRouter;
2926
2797
  const configContext = (0, _react.useContext)(_imageconfigcontextsharedruntime.ImageConfigContext);
@@ -6238,7 +6109,7 @@ var require_link = __commonJS({
6238
6109
  resetVisible,
6239
6110
  setIntersectionRef
6240
6111
  ]);
6241
- const setRef2 = (0, _usemergedref.useMergedRef)(setIntersectionWithResetRef, childRef);
6112
+ const setRef = (0, _usemergedref.useMergedRef)(setIntersectionWithResetRef, childRef);
6242
6113
  _react.default.useEffect(() => {
6243
6114
  if (process.env.NODE_ENV !== "production") {
6244
6115
  return;
@@ -6262,7 +6133,7 @@ var require_link = __commonJS({
6262
6133
  router
6263
6134
  ]);
6264
6135
  const childProps = {
6265
- ref: setRef2,
6136
+ ref: setRef,
6266
6137
  onClick(e) {
6267
6138
  if (process.env.NODE_ENV !== "production") {
6268
6139
  if (!e) {
@@ -6370,7 +6241,7 @@ __export(index_exports, {
6370
6241
  ASTNodeInterpreter: () => ASTNodeInterpreter,
6371
6242
  AnimatedRing: () => AnimatedRing,
6372
6243
  ArrayUtil: () => ArrayUtil,
6373
- Avatar: () => Avatar2,
6244
+ Avatar: () => Avatar,
6374
6245
  AvatarGroup: () => AvatarGroup,
6375
6246
  AvatarUtil: () => AvatarUtil,
6376
6247
  BagFunctionUtil: () => BagFunctionUtil,
@@ -6379,7 +6250,7 @@ __export(index_exports, {
6379
6250
  ButtonUtil: () => ButtonUtil,
6380
6251
  Carousel: () => Carousel,
6381
6252
  CarouselSlide: () => CarouselSlide,
6382
- Checkbox: () => Checkbox2,
6253
+ Checkbox: () => Checkbox,
6383
6254
  CheckboxProperty: () => CheckboxProperty,
6384
6255
  CheckboxUncontrolled: () => CheckboxUncontrolled,
6385
6256
  Chip: () => Chip,
@@ -6449,11 +6320,11 @@ __export(index_exports, {
6449
6320
  OutlineButton: () => OutlineButton,
6450
6321
  Pagination: () => Pagination,
6451
6322
  ProgressIndicator: () => ProgressIndicator,
6323
+ PromiseUtils: () => PromiseUtils,
6452
6324
  PropertyBase: () => PropertyBase,
6453
6325
  RadialRings: () => RadialRings,
6454
6326
  Ring: () => Ring,
6455
6327
  RingWave: () => RingWave,
6456
- ScrollArea: () => ScrollArea2,
6457
6328
  ScrollPicker: () => ScrollPicker,
6458
6329
  SearchBar: () => SearchBar,
6459
6330
  Select: () => Select,
@@ -10273,377 +10144,7 @@ var FormElementWrapper = ({
10273
10144
  var import_clsx17 = __toESM(require("clsx"));
10274
10145
  var import_react22 = require("react");
10275
10146
  var import_lucide_react6 = require("lucide-react");
10276
-
10277
- // node_modules/@radix-ui/react-avatar/dist/index.mjs
10278
- var React9 = __toESM(require("react"), 1);
10279
-
10280
- // node_modules/@radix-ui/react-context/dist/index.mjs
10281
- var React3 = __toESM(require("react"), 1);
10282
10147
  var import_jsx_runtime23 = require("react/jsx-runtime");
10283
- function createContextScope(scopeName, createContextScopeDeps = []) {
10284
- let defaultContexts = [];
10285
- function createContext32(rootComponentName, defaultContext) {
10286
- const BaseContext = React3.createContext(defaultContext);
10287
- const index = defaultContexts.length;
10288
- defaultContexts = [...defaultContexts, defaultContext];
10289
- const Provider = (props) => {
10290
- const { scope, children, ...context } = props;
10291
- const Context = scope?.[scopeName]?.[index] || BaseContext;
10292
- const value = React3.useMemo(() => context, Object.values(context));
10293
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Context.Provider, { value, children });
10294
- };
10295
- Provider.displayName = rootComponentName + "Provider";
10296
- function useContext22(consumerName, scope) {
10297
- const Context = scope?.[scopeName]?.[index] || BaseContext;
10298
- const context = React3.useContext(Context);
10299
- if (context) return context;
10300
- if (defaultContext !== void 0) return defaultContext;
10301
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
10302
- }
10303
- return [Provider, useContext22];
10304
- }
10305
- const createScope = () => {
10306
- const scopeContexts = defaultContexts.map((defaultContext) => {
10307
- return React3.createContext(defaultContext);
10308
- });
10309
- return function useScope(scope) {
10310
- const contexts = scope?.[scopeName] || scopeContexts;
10311
- return React3.useMemo(
10312
- () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
10313
- [scope, contexts]
10314
- );
10315
- };
10316
- };
10317
- createScope.scopeName = scopeName;
10318
- return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
10319
- }
10320
- function composeContextScopes(...scopes) {
10321
- const baseScope = scopes[0];
10322
- if (scopes.length === 1) return baseScope;
10323
- const createScope = () => {
10324
- const scopeHooks = scopes.map((createScope2) => ({
10325
- useScope: createScope2(),
10326
- scopeName: createScope2.scopeName
10327
- }));
10328
- return function useComposedScopes(overrideScopes) {
10329
- const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
10330
- const scopeProps = useScope(overrideScopes);
10331
- const currentScope = scopeProps[`__scope${scopeName}`];
10332
- return { ...nextScopes2, ...currentScope };
10333
- }, {});
10334
- return React3.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
10335
- };
10336
- };
10337
- createScope.scopeName = baseScope.scopeName;
10338
- return createScope;
10339
- }
10340
-
10341
- // node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
10342
- var React4 = __toESM(require("react"), 1);
10343
- function useCallbackRef(callback) {
10344
- const callbackRef = React4.useRef(callback);
10345
- React4.useEffect(() => {
10346
- callbackRef.current = callback;
10347
- });
10348
- return React4.useMemo(() => (...args) => callbackRef.current?.(...args), []);
10349
- }
10350
-
10351
- // node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
10352
- var React5 = __toESM(require("react"), 1);
10353
- var useLayoutEffect22 = globalThis?.document ? React5.useLayoutEffect : () => {
10354
- };
10355
-
10356
- // node_modules/@radix-ui/react-primitive/dist/index.mjs
10357
- var React8 = __toESM(require("react"), 1);
10358
- var ReactDOM = __toESM(require("react-dom"), 1);
10359
-
10360
- // node_modules/@radix-ui/react-slot/dist/index.mjs
10361
- var React7 = __toESM(require("react"), 1);
10362
-
10363
- // node_modules/@radix-ui/react-compose-refs/dist/index.mjs
10364
- var React6 = __toESM(require("react"), 1);
10365
- function setRef(ref, value) {
10366
- if (typeof ref === "function") {
10367
- return ref(value);
10368
- } else if (ref !== null && ref !== void 0) {
10369
- ref.current = value;
10370
- }
10371
- }
10372
- function composeRefs(...refs) {
10373
- return (node) => {
10374
- let hasCleanup = false;
10375
- const cleanups = refs.map((ref) => {
10376
- const cleanup = setRef(ref, node);
10377
- if (!hasCleanup && typeof cleanup == "function") {
10378
- hasCleanup = true;
10379
- }
10380
- return cleanup;
10381
- });
10382
- if (hasCleanup) {
10383
- return () => {
10384
- for (let i = 0; i < cleanups.length; i++) {
10385
- const cleanup = cleanups[i];
10386
- if (typeof cleanup == "function") {
10387
- cleanup();
10388
- } else {
10389
- setRef(refs[i], null);
10390
- }
10391
- }
10392
- };
10393
- }
10394
- };
10395
- }
10396
- function useComposedRefs(...refs) {
10397
- return React6.useCallback(composeRefs(...refs), refs);
10398
- }
10399
-
10400
- // node_modules/@radix-ui/react-slot/dist/index.mjs
10401
- var import_jsx_runtime24 = require("react/jsx-runtime");
10402
- // @__NO_SIDE_EFFECTS__
10403
- function createSlot(ownerName) {
10404
- const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
10405
- const Slot2 = React7.forwardRef((props, forwardedRef) => {
10406
- const { children, ...slotProps } = props;
10407
- const childrenArray = React7.Children.toArray(children);
10408
- const slottable = childrenArray.find(isSlottable);
10409
- if (slottable) {
10410
- const newElement = slottable.props.children;
10411
- const newChildren = childrenArray.map((child) => {
10412
- if (child === slottable) {
10413
- if (React7.Children.count(newElement) > 1) return React7.Children.only(null);
10414
- return React7.isValidElement(newElement) ? newElement.props.children : null;
10415
- } else {
10416
- return child;
10417
- }
10418
- });
10419
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React7.isValidElement(newElement) ? React7.cloneElement(newElement, void 0, newChildren) : null });
10420
- }
10421
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
10422
- });
10423
- Slot2.displayName = `${ownerName}.Slot`;
10424
- return Slot2;
10425
- }
10426
- // @__NO_SIDE_EFFECTS__
10427
- function createSlotClone(ownerName) {
10428
- const SlotClone = React7.forwardRef((props, forwardedRef) => {
10429
- const { children, ...slotProps } = props;
10430
- if (React7.isValidElement(children)) {
10431
- const childrenRef = getElementRef(children);
10432
- const props2 = mergeProps(slotProps, children.props);
10433
- if (children.type !== React7.Fragment) {
10434
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
10435
- }
10436
- return React7.cloneElement(children, props2);
10437
- }
10438
- return React7.Children.count(children) > 1 ? React7.Children.only(null) : null;
10439
- });
10440
- SlotClone.displayName = `${ownerName}.SlotClone`;
10441
- return SlotClone;
10442
- }
10443
- var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
10444
- function isSlottable(child) {
10445
- return React7.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
10446
- }
10447
- function mergeProps(slotProps, childProps) {
10448
- const overrideProps = { ...childProps };
10449
- for (const propName in childProps) {
10450
- const slotPropValue = slotProps[propName];
10451
- const childPropValue = childProps[propName];
10452
- const isHandler = /^on[A-Z]/.test(propName);
10453
- if (isHandler) {
10454
- if (slotPropValue && childPropValue) {
10455
- overrideProps[propName] = (...args) => {
10456
- const result = childPropValue(...args);
10457
- slotPropValue(...args);
10458
- return result;
10459
- };
10460
- } else if (slotPropValue) {
10461
- overrideProps[propName] = slotPropValue;
10462
- }
10463
- } else if (propName === "style") {
10464
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
10465
- } else if (propName === "className") {
10466
- overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
10467
- }
10468
- }
10469
- return { ...slotProps, ...overrideProps };
10470
- }
10471
- function getElementRef(element) {
10472
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
10473
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
10474
- if (mayWarn) {
10475
- return element.ref;
10476
- }
10477
- getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
10478
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
10479
- if (mayWarn) {
10480
- return element.props.ref;
10481
- }
10482
- return element.props.ref || element.ref;
10483
- }
10484
-
10485
- // node_modules/@radix-ui/react-primitive/dist/index.mjs
10486
- var import_jsx_runtime25 = require("react/jsx-runtime");
10487
- var NODES = [
10488
- "a",
10489
- "button",
10490
- "div",
10491
- "form",
10492
- "h2",
10493
- "h3",
10494
- "img",
10495
- "input",
10496
- "label",
10497
- "li",
10498
- "nav",
10499
- "ol",
10500
- "p",
10501
- "select",
10502
- "span",
10503
- "svg",
10504
- "ul"
10505
- ];
10506
- var Primitive = NODES.reduce((primitive, node) => {
10507
- const Slot = createSlot(`Primitive.${node}`);
10508
- const Node2 = React8.forwardRef((props, forwardedRef) => {
10509
- const { asChild, ...primitiveProps } = props;
10510
- const Comp = asChild ? Slot : node;
10511
- if (typeof window !== "undefined") {
10512
- window[Symbol.for("radix-ui")] = true;
10513
- }
10514
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
10515
- });
10516
- Node2.displayName = `Primitive.${node}`;
10517
- return { ...primitive, [node]: Node2 };
10518
- }, {});
10519
-
10520
- // node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs
10521
- var import_shim = __toESM(require_shim(), 1);
10522
- function useIsHydrated() {
10523
- return (0, import_shim.useSyncExternalStore)(
10524
- subscribe,
10525
- () => true,
10526
- () => false
10527
- );
10528
- }
10529
- function subscribe() {
10530
- return () => {
10531
- };
10532
- }
10533
-
10534
- // node_modules/@radix-ui/react-avatar/dist/index.mjs
10535
- var import_jsx_runtime26 = require("react/jsx-runtime");
10536
- var AVATAR_NAME = "Avatar";
10537
- var [createAvatarContext, createAvatarScope] = createContextScope(AVATAR_NAME);
10538
- var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);
10539
- var Avatar = React9.forwardRef(
10540
- (props, forwardedRef) => {
10541
- const { __scopeAvatar, ...avatarProps } = props;
10542
- const [imageLoadingStatus, setImageLoadingStatus] = React9.useState("idle");
10543
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
10544
- AvatarProvider,
10545
- {
10546
- scope: __scopeAvatar,
10547
- imageLoadingStatus,
10548
- onImageLoadingStatusChange: setImageLoadingStatus,
10549
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Primitive.span, { ...avatarProps, ref: forwardedRef })
10550
- }
10551
- );
10552
- }
10553
- );
10554
- Avatar.displayName = AVATAR_NAME;
10555
- var IMAGE_NAME = "AvatarImage";
10556
- var AvatarImage = React9.forwardRef(
10557
- (props, forwardedRef) => {
10558
- const { __scopeAvatar, src, onLoadingStatusChange = () => {
10559
- }, ...imageProps } = props;
10560
- const context = useAvatarContext(IMAGE_NAME, __scopeAvatar);
10561
- const imageLoadingStatus = useImageLoadingStatus(src, imageProps);
10562
- const handleLoadingStatusChange = useCallbackRef((status) => {
10563
- onLoadingStatusChange(status);
10564
- context.onImageLoadingStatusChange(status);
10565
- });
10566
- useLayoutEffect22(() => {
10567
- if (imageLoadingStatus !== "idle") {
10568
- handleLoadingStatusChange(imageLoadingStatus);
10569
- }
10570
- }, [imageLoadingStatus, handleLoadingStatusChange]);
10571
- return imageLoadingStatus === "loaded" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Primitive.img, { ...imageProps, ref: forwardedRef, src }) : null;
10572
- }
10573
- );
10574
- AvatarImage.displayName = IMAGE_NAME;
10575
- var FALLBACK_NAME = "AvatarFallback";
10576
- var AvatarFallback = React9.forwardRef(
10577
- (props, forwardedRef) => {
10578
- const { __scopeAvatar, delayMs, ...fallbackProps } = props;
10579
- const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar);
10580
- const [canRender, setCanRender] = React9.useState(delayMs === void 0);
10581
- React9.useEffect(() => {
10582
- if (delayMs !== void 0) {
10583
- const timerId = window.setTimeout(() => setCanRender(true), delayMs);
10584
- return () => window.clearTimeout(timerId);
10585
- }
10586
- }, [delayMs]);
10587
- return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Primitive.span, { ...fallbackProps, ref: forwardedRef }) : null;
10588
- }
10589
- );
10590
- AvatarFallback.displayName = FALLBACK_NAME;
10591
- function resolveLoadingStatus(image, src) {
10592
- if (!image) {
10593
- return "idle";
10594
- }
10595
- if (!src) {
10596
- return "error";
10597
- }
10598
- if (image.src !== src) {
10599
- image.src = src;
10600
- }
10601
- return image.complete && image.naturalWidth > 0 ? "loaded" : "loading";
10602
- }
10603
- function useImageLoadingStatus(src, { referrerPolicy, crossOrigin }) {
10604
- const isHydrated = useIsHydrated();
10605
- const imageRef = React9.useRef(null);
10606
- const image = (() => {
10607
- if (!isHydrated) return null;
10608
- if (!imageRef.current) {
10609
- imageRef.current = new window.Image();
10610
- }
10611
- return imageRef.current;
10612
- })();
10613
- const [loadingStatus, setLoadingStatus] = React9.useState(
10614
- () => resolveLoadingStatus(image, src)
10615
- );
10616
- useLayoutEffect22(() => {
10617
- setLoadingStatus(resolveLoadingStatus(image, src));
10618
- }, [image, src]);
10619
- useLayoutEffect22(() => {
10620
- const updateStatus = (status) => () => {
10621
- setLoadingStatus(status);
10622
- };
10623
- if (!image) return;
10624
- const handleLoad = updateStatus("loaded");
10625
- const handleError = updateStatus("error");
10626
- image.addEventListener("load", handleLoad);
10627
- image.addEventListener("error", handleError);
10628
- if (referrerPolicy) {
10629
- image.referrerPolicy = referrerPolicy;
10630
- }
10631
- if (typeof crossOrigin === "string") {
10632
- image.crossOrigin = crossOrigin;
10633
- }
10634
- return () => {
10635
- image.removeEventListener("load", handleLoad);
10636
- image.removeEventListener("error", handleError);
10637
- };
10638
- }, [image, crossOrigin, referrerPolicy]);
10639
- return loadingStatus;
10640
- }
10641
- var Root = Avatar;
10642
- var Image = AvatarImage;
10643
- var Fallback = AvatarFallback;
10644
-
10645
- // src/components/icons-and-geometry/Avatar.tsx
10646
- var import_jsx_runtime27 = require("react/jsx-runtime");
10647
10148
  var avtarSizeList = ["sm", "md", "lg", "xl"];
10648
10149
  var avatarSizeMapping = {
10649
10150
  sm: 18,
@@ -10661,7 +10162,15 @@ var AvatarUtil = {
10661
10162
  avatarSizeMapping,
10662
10163
  sizes: avtarSizeList
10663
10164
  };
10664
- var Avatar2 = ({ image, name, size = "md", fullyRounded, className = "" }) => {
10165
+ var Avatar = ({
10166
+ image,
10167
+ name,
10168
+ size = "md",
10169
+ fullyRounded,
10170
+ className = ""
10171
+ }) => {
10172
+ const [hasError, setHasError] = (0, import_react22.useState)(false);
10173
+ const [isLoaded, setIsLoaded] = (0, import_react22.useState)(false);
10665
10174
  const pixels = avatarSizeMapping[size];
10666
10175
  const sizeStyle = {
10667
10176
  minWidth: pixels,
@@ -10679,25 +10188,27 @@ var Avatar2 = ({ image, name, size = "md", fullyRounded, className = "" }) => {
10679
10188
  "rounded-lg": !fullyRounded && !(size === "sm" || size === "md"),
10680
10189
  "rounded-sm": !fullyRounded && (size === "sm" || size === "md")
10681
10190
  };
10682
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
10683
- Root,
10191
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
10192
+ "div",
10684
10193
  {
10685
10194
  className: (0, import_clsx17.default)(
10686
- `flex-row-0 items-center justify-center bg-primary text-on-primary`,
10195
+ `relative flex-row-0 items-center justify-center bg-primary text-on-primary`,
10687
10196
  rounding,
10688
10197
  className
10689
10198
  ),
10690
10199
  style: sizeStyle,
10691
10200
  children: [
10692
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
10693
- Image,
10201
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10202
+ "img",
10694
10203
  {
10695
10204
  src: image?.avatarUrl,
10696
10205
  alt: image?.alt,
10697
- className: (0, import_clsx17.default)(rounding)
10206
+ className: (0, import_clsx17.default)(rounding, { "absolute left-0 top-0 -translate-1/2 opacity-0 z-1 ": !isLoaded || hasError }),
10207
+ onLoad: () => setIsLoaded(true),
10208
+ onError: () => setHasError(true)
10698
10209
  }
10699
10210
  ),
10700
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Fallback, { asChild: true, children: name ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: textClassName, children: displayName }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react6.UserIcon, { size: Math.round(pixels * 3 / 4) }) })
10211
+ name ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: textClassName, children: displayName }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react6.UserIcon, { size: Math.round(pixels * 3 / 4) })
10701
10212
  ]
10702
10213
  }
10703
10214
  );
@@ -10714,14 +10225,14 @@ var AvatarGroup = ({
10714
10225
  const stackingOverlap = 0.5;
10715
10226
  const notDisplayedProfiles = avatars.length - maxShownProfiles;
10716
10227
  const avatarGroupWidth = diameter * (stackingOverlap * (displayedProfiles.length - 1) + 1);
10717
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-row-2 relative", style: { height: diameter + "px" }, children: [
10718
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { style: { width: avatarGroupWidth + "px" }, children: displayedProfiles.map((avatar, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
10228
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex-row-2 relative", style: { height: diameter + "px" }, children: [
10229
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { width: avatarGroupWidth + "px" }, children: displayedProfiles.map((avatar, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10719
10230
  "div",
10720
10231
  {
10721
10232
  className: "absolute",
10722
10233
  style: { left: index * diameter * stackingOverlap + "px", zIndex: maxShownProfiles - index },
10723
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
10724
- Avatar2,
10234
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10235
+ Avatar,
10725
10236
  {
10726
10237
  ...avatar,
10727
10238
  size,
@@ -10732,11 +10243,11 @@ var AvatarGroup = ({
10732
10243
  },
10733
10244
  index
10734
10245
  )) }),
10735
- showTotalNumber && notDisplayedProfiles > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
10246
+ showTotalNumber && notDisplayedProfiles > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10736
10247
  "div",
10737
10248
  {
10738
10249
  className: (0, import_clsx17.default)(textClassNameMapping[size], "flex-row-2 truncate items-center"),
10739
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { children: [
10250
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { children: [
10740
10251
  "+ ",
10741
10252
  notDisplayedProfiles
10742
10253
  ] })
@@ -10747,7 +10258,7 @@ var AvatarGroup = ({
10747
10258
 
10748
10259
  // src/components/icons-and-geometry/Circle.tsx
10749
10260
  var import_clsx18 = __toESM(require("clsx"));
10750
- var import_jsx_runtime28 = require("react/jsx-runtime");
10261
+ var import_jsx_runtime24 = require("react/jsx-runtime");
10751
10262
  var Circle = ({
10752
10263
  radius = 20,
10753
10264
  className = "bg-primary",
@@ -10755,7 +10266,7 @@ var Circle = ({
10755
10266
  ...restProps
10756
10267
  }) => {
10757
10268
  const size = radius * 2;
10758
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
10269
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
10759
10270
  "div",
10760
10271
  {
10761
10272
  className: (0, import_clsx18.default)(`rounded-full`, className),
@@ -10772,13 +10283,13 @@ var Circle = ({
10772
10283
  // src/components/icons-and-geometry/Ring.tsx
10773
10284
  var import_react23 = require("react");
10774
10285
  var import_clsx19 = __toESM(require("clsx"));
10775
- var import_jsx_runtime29 = require("react/jsx-runtime");
10286
+ var import_jsx_runtime25 = require("react/jsx-runtime");
10776
10287
  var Ring = ({
10777
10288
  innerSize = 20,
10778
10289
  width = 7,
10779
10290
  className = "outline-primary"
10780
10291
  }) => {
10781
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10292
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
10782
10293
  "div",
10783
10294
  {
10784
10295
  className: (0, import_clsx19.default)(`bg-transparent rounded-full outline`, className),
@@ -10820,7 +10331,7 @@ var AnimatedRing = ({
10820
10331
  requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
10821
10332
  }
10822
10333
  }, []);
10823
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10334
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
10824
10335
  "div",
10825
10336
  {
10826
10337
  className: "flex-row-2 items-center justify-center",
@@ -10829,7 +10340,7 @@ var AnimatedRing = ({
10829
10340
  height: `${innerSize + 2 * width}px`,
10830
10341
  ...style
10831
10342
  },
10832
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10343
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
10833
10344
  Ring,
10834
10345
  {
10835
10346
  innerSize,
@@ -10875,7 +10386,7 @@ var RingWave = ({
10875
10386
  requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
10876
10387
  }
10877
10388
  }, []);
10878
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10389
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
10879
10390
  "div",
10880
10391
  {
10881
10392
  className: "flex-row-2 items-center justify-center",
@@ -10884,7 +10395,7 @@ var RingWave = ({
10884
10395
  height: `${endInnerSize + 2 * width}px`,
10885
10396
  ...style
10886
10397
  },
10887
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10398
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
10888
10399
  Ring,
10889
10400
  {
10890
10401
  innerSize: currentInnerSize,
@@ -10907,7 +10418,7 @@ var RadialRings = ({
10907
10418
  }) => {
10908
10419
  const [currentRing, setCurrentRing] = (0, import_react23.useState)(0);
10909
10420
  const size = sizeCircle3;
10910
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
10421
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
10911
10422
  "div",
10912
10423
  {
10913
10424
  className: "relative",
@@ -10916,7 +10427,7 @@ var RadialRings = ({
10916
10427
  height: `${sizeCircle3}px`
10917
10428
  },
10918
10429
  children: [
10919
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10430
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
10920
10431
  Circle,
10921
10432
  {
10922
10433
  radius: sizeCircle1 / 2,
@@ -10927,7 +10438,7 @@ var RadialRings = ({
10927
10438
  }
10928
10439
  }
10929
10440
  ),
10930
- currentRing === 0 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10441
+ currentRing === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
10931
10442
  AnimatedRing,
10932
10443
  {
10933
10444
  innerSize: sizeCircle1,
@@ -10947,7 +10458,7 @@ var RadialRings = ({
10947
10458
  }
10948
10459
  }
10949
10460
  ) : null,
10950
- currentRing === 2 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10461
+ currentRing === 2 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
10951
10462
  RingWave,
10952
10463
  {
10953
10464
  startInnerSize: sizeCircle1 - waveWidth,
@@ -10964,7 +10475,7 @@ var RadialRings = ({
10964
10475
  }
10965
10476
  }
10966
10477
  ) : null,
10967
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10478
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
10968
10479
  Circle,
10969
10480
  {
10970
10481
  radius: sizeCircle2 / 2,
@@ -10979,7 +10490,7 @@ var RadialRings = ({
10979
10490
  }
10980
10491
  }
10981
10492
  ),
10982
- currentRing === 1 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10493
+ currentRing === 1 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
10983
10494
  AnimatedRing,
10984
10495
  {
10985
10496
  innerSize: sizeCircle2 - 1,
@@ -10996,7 +10507,7 @@ var RadialRings = ({
10996
10507
  }
10997
10508
  }
10998
10509
  ) : null,
10999
- currentRing === 2 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10510
+ currentRing === 2 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
11000
10511
  RingWave,
11001
10512
  {
11002
10513
  startInnerSize: sizeCircle2,
@@ -11013,7 +10524,7 @@ var RadialRings = ({
11013
10524
  }
11014
10525
  }
11015
10526
  ) : null,
11016
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10527
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
11017
10528
  Circle,
11018
10529
  {
11019
10530
  radius: sizeCircle3 / 2,
@@ -11035,12 +10546,12 @@ var RadialRings = ({
11035
10546
 
11036
10547
  // src/components/icons-and-geometry/Tag.tsx
11037
10548
  var import_image = __toESM(require_image());
11038
- var import_jsx_runtime30 = require("react/jsx-runtime");
10549
+ var import_jsx_runtime26 = require("react/jsx-runtime");
11039
10550
  var TagIcon = ({
11040
10551
  className,
11041
10552
  size = 16
11042
10553
  }) => {
11043
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
10554
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
11044
10555
  import_image.default,
11045
10556
  {
11046
10557
  style: { width: `${size}px`, height: `${size}px`, minWidth: `${size}px`, minHeight: `${size}px` },
@@ -11057,7 +10568,7 @@ var TagIcon = ({
11057
10568
  var import_react24 = require("react");
11058
10569
  var import_clsx20 = __toESM(require("clsx"));
11059
10570
  var import_lucide_react7 = require("lucide-react");
11060
- var import_jsx_runtime31 = require("react/jsx-runtime");
10571
+ var import_jsx_runtime27 = require("react/jsx-runtime");
11061
10572
  var CarouselContext = (0, import_react24.createContext)(null);
11062
10573
  var useCarouselContext = () => {
11063
10574
  const context = (0, import_react24.useContext)(CarouselContext);
@@ -11085,7 +10596,7 @@ function CarouselTabs({
11085
10596
  onChange(newIndex);
11086
10597
  tabRefs.current[newIndex]?.focus();
11087
10598
  };
11088
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
10599
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11089
10600
  "div",
11090
10601
  {
11091
10602
  className: "flex-row-1 items-center justify-center w-full my-2",
@@ -11094,7 +10605,7 @@ function CarouselTabs({
11094
10605
  id: `${id}-tablist`,
11095
10606
  children: range(slideCount).map((index) => {
11096
10607
  const isSelected = currentIndex === index;
11097
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
10608
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11098
10609
  "button",
11099
10610
  {
11100
10611
  id: `${id}-tab-${index}`,
@@ -11129,7 +10640,7 @@ var CarouselSlide = (0, import_react24.forwardRef)(
11129
10640
  }, ref) {
11130
10641
  const translation = useHightideTranslation();
11131
10642
  const { id, slideCount } = useCarouselContext();
11132
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
10643
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11133
10644
  "div",
11134
10645
  {
11135
10646
  ...props,
@@ -11279,7 +10790,7 @@ var Carousel = ({
11279
10790
  (0, import_react24.useEffect)(() => {
11280
10791
  onSlideChanged?.(currentIndex);
11281
10792
  }, [currentIndex]);
11282
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CarouselContext.Provider, { value: { id, currentIndex, slideCount: length, isLooping }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
10793
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CarouselContext.Provider, { value: { id, currentIndex, slideCount: length, isLooping }, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
11283
10794
  "div",
11284
10795
  {
11285
10796
  ref: carouselContainerRef,
@@ -11289,13 +10800,13 @@ var Carousel = ({
11289
10800
  role: "region",
11290
10801
  "aria-roledescription": translation("slide"),
11291
10802
  children: [
11292
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
10803
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
11293
10804
  "div",
11294
10805
  {
11295
10806
  ...slideContainerProps,
11296
10807
  className: (0, import_clsx20.default)(`relative w-full overflow-hidden`, heightClassName, slideContainerProps?.className),
11297
10808
  children: [
11298
- hintNext ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
10809
+ hintNext ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
11299
10810
  "div",
11300
10811
  {
11301
10812
  onPointerDown: handlePointerDown,
@@ -11304,12 +10815,12 @@ var Carousel = ({
11304
10815
  onPointerLeave: handlePointerUp,
11305
10816
  className: (0, import_clsx20.default)(`flex-row-2 relative h-full`, heightClassName),
11306
10817
  children: [
11307
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex-row-2 relative h-full w-full px-2 overflow-hidden", children: items.map(({
10818
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex-row-2 relative h-full w-full px-2 overflow-hidden", children: items.map(({
11308
10819
  item,
11309
10820
  index
11310
10821
  }, listIndex) => {
11311
10822
  const isInItems = before.length <= listIndex && listIndex < items.length - after.length;
11312
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
10823
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11313
10824
  CarouselSlide,
11314
10825
  {
11315
10826
  ref: isInItems ? slideRefs[index] : void 0,
@@ -11329,13 +10840,13 @@ var Carousel = ({
11329
10840
  listIndex
11330
10841
  );
11331
10842
  }) }),
11332
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
10843
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11333
10844
  "div",
11334
10845
  {
11335
10846
  className: (0, import_clsx20.default)(`hidden desktop:block pointer-events-none absolute left-0 h-full w-[20%] bg-gradient-to-r to-transparent`, blurColor)
11336
10847
  }
11337
10848
  ),
11338
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
10849
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11339
10850
  "div",
11340
10851
  {
11341
10852
  className: (0, import_clsx20.default)(`hidden desktop:block pointer-events-none absolute right-0 h-full w-[20%] bg-gradient-to-l to-transparent`, blurColor)
@@ -11343,7 +10854,7 @@ var Carousel = ({
11343
10854
  )
11344
10855
  ]
11345
10856
  }
11346
- ) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
10857
+ ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11347
10858
  "div",
11348
10859
  {
11349
10860
  ref: slideRefs[currentIndex],
@@ -11358,32 +10869,32 @@ var Carousel = ({
11358
10869
  children: children[currentIndex]
11359
10870
  }
11360
10871
  ),
11361
- arrows && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
11362
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
10872
+ arrows && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
10873
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11363
10874
  IconButton,
11364
10875
  {
11365
10876
  color: "neutral",
11366
10877
  className: (0, import_clsx20.default)("absolute z-10 left-2 top-1/2 -translate-y-1/2 shadow-md", { hidden: !canGoLeft() }),
11367
10878
  disabled: !canGoLeft(),
11368
10879
  onClick: () => left(),
11369
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react7.ChevronLeft, { size: 24 })
10880
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react7.ChevronLeft, { size: 24 })
11370
10881
  }
11371
10882
  ),
11372
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
10883
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11373
10884
  IconButton,
11374
10885
  {
11375
10886
  color: "neutral",
11376
10887
  className: (0, import_clsx20.default)("absolute z-10 right-2 top-1/2 -translate-y-1/2 shadow-md", { hidden: !canGoRight() }),
11377
10888
  disabled: !canGoRight(),
11378
10889
  onClick: () => right(),
11379
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react7.ChevronRight, { size: 24 })
10890
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react7.ChevronRight, { size: 24 })
11380
10891
  }
11381
10892
  )
11382
10893
  ] })
11383
10894
  ]
11384
10895
  }
11385
10896
  ),
11386
- dots && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CarouselTabs, { onChange: setCurrentIndex })
10897
+ dots && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CarouselTabs, { onChange: setCurrentIndex })
11387
10898
  ]
11388
10899
  }
11389
10900
  ) });
@@ -11391,7 +10902,7 @@ var Carousel = ({
11391
10902
 
11392
10903
  // src/components/layout/DividerInserter.tsx
11393
10904
  var import_clsx21 = __toESM(require("clsx"));
11394
- var import_jsx_runtime32 = require("react/jsx-runtime");
10905
+ var import_jsx_runtime28 = require("react/jsx-runtime");
11395
10906
  var DividerInserter = ({
11396
10907
  children,
11397
10908
  divider,
@@ -11408,14 +10919,14 @@ var DividerInserter = ({
11408
10919
  }
11409
10920
  }
11410
10921
  }
11411
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: (0, import_clsx21.default)(className), ...restProps, children: nodes });
10922
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: (0, import_clsx21.default)(className), ...restProps, children: nodes });
11412
10923
  };
11413
10924
 
11414
10925
  // src/components/layout/FAQSection.tsx
11415
10926
  var import_clsx22 = __toESM(require("clsx"));
11416
10927
 
11417
10928
  // src/components/layout/MarkdownInterpreter.tsx
11418
- var import_jsx_runtime33 = require("react/jsx-runtime");
10929
+ var import_jsx_runtime29 = require("react/jsx-runtime");
11419
10930
  var astNodeInserterType = ["helpwave", "newline"];
11420
10931
  var ASTNodeInterpreter = ({
11421
10932
  node,
@@ -11424,27 +10935,27 @@ var ASTNodeInterpreter = ({
11424
10935
  }) => {
11425
10936
  switch (node.type) {
11426
10937
  case "newline":
11427
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("br", {});
10938
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("br", {});
11428
10939
  case "text":
11429
- return isRoot ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className, children: node.text }) : node.text;
10940
+ return isRoot ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className, children: node.text }) : node.text;
11430
10941
  case "helpwave":
11431
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-bold font-space no-underline", children: "helpwave" });
10942
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "font-bold font-space no-underline", children: "helpwave" });
11432
10943
  case "none":
11433
- return isRoot ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className, children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10944
+ return isRoot ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className, children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
11434
10945
  ASTNodeInterpreter,
11435
10946
  {
11436
10947
  node: value
11437
10948
  },
11438
10949
  index
11439
- )) }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ASTNodeInterpreter, { node: value }, index)) });
10950
+ )) }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ASTNodeInterpreter, { node: value }, index)) });
11440
10951
  case "bold":
11441
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("b", { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ASTNodeInterpreter, { node: value }, index)) });
10952
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("b", { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ASTNodeInterpreter, { node: value }, index)) });
11442
10953
  case "italic":
11443
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ASTNodeInterpreter, { node: value }, index)) });
10954
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("i", { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ASTNodeInterpreter, { node: value }, index)) });
11444
10955
  case "underline":
11445
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("u", { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ASTNodeInterpreter, { node: value }, index)) });
10956
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("u", { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ASTNodeInterpreter, { node: value }, index)) });
11446
10957
  case "font-space":
11447
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-space", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10958
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "font-space", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
11448
10959
  ASTNodeInterpreter,
11449
10960
  {
11450
10961
  node: value
@@ -11452,7 +10963,7 @@ var ASTNodeInterpreter = ({
11452
10963
  index
11453
10964
  )) });
11454
10965
  case "primary":
11455
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-primary", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10966
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-primary", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
11456
10967
  ASTNodeInterpreter,
11457
10968
  {
11458
10969
  node: value
@@ -11460,7 +10971,7 @@ var ASTNodeInterpreter = ({
11460
10971
  index
11461
10972
  )) });
11462
10973
  case "secondary":
11463
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-secondary", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10974
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-secondary", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
11464
10975
  ASTNodeInterpreter,
11465
10976
  {
11466
10977
  node: value
@@ -11468,7 +10979,7 @@ var ASTNodeInterpreter = ({
11468
10979
  index
11469
10980
  )) });
11470
10981
  case "warn":
11471
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-warning", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10982
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-warning", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
11472
10983
  ASTNodeInterpreter,
11473
10984
  {
11474
10985
  node: value
@@ -11476,7 +10987,7 @@ var ASTNodeInterpreter = ({
11476
10987
  index
11477
10988
  )) });
11478
10989
  case "positive":
11479
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-positive", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10990
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-positive", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
11480
10991
  ASTNodeInterpreter,
11481
10992
  {
11482
10993
  node: value
@@ -11484,7 +10995,7 @@ var ASTNodeInterpreter = ({
11484
10995
  index
11485
10996
  )) });
11486
10997
  case "negative":
11487
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-negative", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10998
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-negative", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
11488
10999
  ASTNodeInterpreter,
11489
11000
  {
11490
11001
  node: value
@@ -11642,24 +11153,24 @@ var optimizeTree = (node) => {
11642
11153
  var MarkdownInterpreter = ({ text, className }) => {
11643
11154
  const tree = parseMarkdown(text);
11644
11155
  const optimizedTree = optimizeTree(tree);
11645
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ASTNodeInterpreter, { node: optimizedTree, isRoot: true, className });
11156
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ASTNodeInterpreter, { node: optimizedTree, isRoot: true, className });
11646
11157
  };
11647
11158
 
11648
11159
  // src/components/layout/FAQSection.tsx
11649
- var import_jsx_runtime34 = require("react/jsx-runtime");
11160
+ var import_jsx_runtime30 = require("react/jsx-runtime");
11650
11161
  var FAQSection = ({
11651
11162
  entries,
11652
11163
  expandableClassName
11653
11164
  }) => {
11654
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("ul", { className: "flex-col-4", children: entries.map(({ id, title, content, ...restProps }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
11165
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ul", { className: "flex-col-4", children: entries.map(({ id, title, content, ...restProps }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
11655
11166
  ExpandableUncontrolled,
11656
11167
  {
11657
11168
  ...restProps,
11658
- label: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { id, className: "typography-title-md", children: title }),
11169
+ label: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { id, className: "typography-title-md", children: title }),
11659
11170
  clickOnlyOnHeader: false,
11660
- icon: (expanded) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ExpansionIcon, { isExpanded: expanded, className: "text-primary" }),
11171
+ icon: (expanded) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ExpansionIcon, { isExpanded: expanded, className: "text-primary" }),
11661
11172
  className: (0, import_clsx22.default)("rounded-xl", expandableClassName),
11662
- children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mt-2", children: content.type === "markdown" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(MarkdownInterpreter, { text: content.value }) : content.value })
11173
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mt-2", children: content.type === "markdown" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MarkdownInterpreter, { text: content.value }) : content.value })
11663
11174
  },
11664
11175
  id
11665
11176
  ) }, id)) });
@@ -11669,7 +11180,7 @@ var FAQSection = ({
11669
11180
  var import_react25 = require("react");
11670
11181
  var import_react_dom3 = require("react-dom");
11671
11182
  var import_clsx23 = require("clsx");
11672
- var import_jsx_runtime35 = require("react/jsx-runtime");
11183
+ var import_jsx_runtime31 = require("react/jsx-runtime");
11673
11184
  var FloatingContainer = (0, import_react25.forwardRef)(function FloatingContainer2({
11674
11185
  children,
11675
11186
  backgroundOverlay,
@@ -11681,9 +11192,9 @@ var FloatingContainer = (0, import_react25.forwardRef)(function FloatingContaine
11681
11192
  screenPadding = 16,
11682
11193
  gap = 4,
11683
11194
  ...props
11684
- }, forwardRef17) {
11195
+ }, forwardRef12) {
11685
11196
  const innerRef = (0, import_react25.useRef)(null);
11686
- (0, import_react25.useImperativeHandle)(forwardRef17, () => innerRef.current);
11197
+ (0, import_react25.useImperativeHandle)(forwardRef12, () => innerRef.current);
11687
11198
  const position = useFloatingElement({
11688
11199
  active: !props.hidden,
11689
11200
  containerRef: innerRef,
@@ -11696,9 +11207,9 @@ var FloatingContainer = (0, import_react25.forwardRef)(function FloatingContaine
11696
11207
  screenPadding
11697
11208
  });
11698
11209
  return (0, import_react_dom3.createPortal)(
11699
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
11210
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
11700
11211
  backgroundOverlay,
11701
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
11212
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
11702
11213
  "div",
11703
11214
  {
11704
11215
  ...props,
@@ -11725,7 +11236,7 @@ var FloatingContainer = (0, import_react25.forwardRef)(function FloatingContaine
11725
11236
  // src/components/layout/ListBox.tsx
11726
11237
  var import_react26 = __toESM(require("react"));
11727
11238
  var import_clsx24 = require("clsx");
11728
- var import_jsx_runtime36 = require("react/jsx-runtime");
11239
+ var import_jsx_runtime32 = require("react/jsx-runtime");
11729
11240
  var ListBoxContext = (0, import_react26.createContext)(null);
11730
11241
  function useListBoxContext() {
11731
11242
  const ctx = (0, import_react26.useContext)(ListBoxContext);
@@ -11752,7 +11263,7 @@ var ListBoxItem = (0, import_react26.forwardRef)(
11752
11263
  }, [id, value, disabled, registerItem, unregisterItem]);
11753
11264
  const isHighlighted = highlightedId === id;
11754
11265
  const selected = isSelected(value);
11755
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11266
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11756
11267
  "li",
11757
11268
  {
11758
11269
  ref: (node) => {
@@ -11869,7 +11380,7 @@ var ListBoxPrimitive = (0, import_react26.forwardRef)(
11869
11380
  }
11870
11381
  setHighlightedIndex(nextIndex);
11871
11382
  };
11872
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ListBoxContext.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11383
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ListBoxContext.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11873
11384
  "ul",
11874
11385
  {
11875
11386
  ref,
@@ -11934,7 +11445,7 @@ var ListBoxPrimitive = (0, import_react26.forwardRef)(
11934
11445
  }
11935
11446
  );
11936
11447
  var ListBoxMultiple = ({ ...props }) => {
11937
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ListBoxPrimitive, { ...props });
11448
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ListBoxPrimitive, { ...props });
11938
11449
  };
11939
11450
  var ListBoxMultipleUncontrolled = ({
11940
11451
  value: initialValue,
@@ -11942,7 +11453,7 @@ var ListBoxMultipleUncontrolled = ({
11942
11453
  ...props
11943
11454
  }) => {
11944
11455
  const [value, setValue] = useOverwritableState(initialValue, onSelectionChanged);
11945
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11456
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11946
11457
  ListBoxMultiple,
11947
11458
  {
11948
11459
  ...props,
@@ -11956,7 +11467,7 @@ var ListBox = (0, import_react26.forwardRef)(function ListBox2({
11956
11467
  onSelectionChanged,
11957
11468
  ...props
11958
11469
  }, ref) {
11959
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11470
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11960
11471
  ListBoxPrimitive,
11961
11472
  {
11962
11473
  ref,
@@ -11975,7 +11486,7 @@ var ListBoxUncontrolled = ({
11975
11486
  ...props
11976
11487
  }) => {
11977
11488
  const [value, setValue] = useOverwritableState(initialValue, onSelectionChanged);
11978
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11489
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11979
11490
  ListBox,
11980
11491
  {
11981
11492
  ...props,
@@ -11985,1073 +11496,102 @@ var ListBoxUncontrolled = ({
11985
11496
  );
11986
11497
  };
11987
11498
 
11988
- // node_modules/@radix-ui/react-scroll-area/dist/index.mjs
11989
- var React23 = __toESM(require("react"), 1);
11990
-
11991
- // node_modules/@radix-ui/react-presence/dist/index.mjs
11992
- var React22 = __toESM(require("react"), 1);
11993
- var React12 = __toESM(require("react"), 1);
11994
- function useStateMachine(initialState, machine) {
11995
- return React12.useReducer((state, event) => {
11996
- const nextState = machine[state][event];
11997
- return nextState ?? state;
11998
- }, initialState);
11499
+ // src/components/layout/TabView.tsx
11500
+ var import_react27 = require("react");
11501
+ var import_react28 = require("react");
11502
+ var import_clsx25 = __toESM(require("clsx"));
11503
+ var import_jsx_runtime33 = require("react/jsx-runtime");
11504
+ var TabContext = (0, import_react28.createContext)(null);
11505
+ function useTabContext() {
11506
+ const ctx = (0, import_react28.useContext)(TabContext);
11507
+ if (!ctx) throw new Error("useTabContext must be used inside a <TabView>");
11508
+ return ctx;
11999
11509
  }
12000
- var Presence = (props) => {
12001
- const { present, children } = props;
12002
- const presence = usePresence(present);
12003
- const child = typeof children === "function" ? children({ present: presence.isPresent }) : React22.Children.only(children);
12004
- const ref = useComposedRefs(presence.ref, getElementRef2(child));
12005
- const forceMount = typeof children === "function";
12006
- return forceMount || presence.isPresent ? React22.cloneElement(child, { ref }) : null;
12007
- };
12008
- Presence.displayName = "Presence";
12009
- function usePresence(present) {
12010
- const [node, setNode] = React22.useState();
12011
- const stylesRef = React22.useRef(null);
12012
- const prevPresentRef = React22.useRef(present);
12013
- const prevAnimationNameRef = React22.useRef("none");
12014
- const initialState = present ? "mounted" : "unmounted";
12015
- const [state, send] = useStateMachine(initialState, {
12016
- mounted: {
12017
- UNMOUNT: "unmounted",
12018
- ANIMATION_OUT: "unmountSuspended"
12019
- },
12020
- unmountSuspended: {
12021
- MOUNT: "mounted",
12022
- ANIMATION_END: "unmounted"
12023
- },
12024
- unmounted: {
12025
- MOUNT: "mounted"
12026
- }
12027
- });
12028
- React22.useEffect(() => {
12029
- const currentAnimationName = getAnimationName(stylesRef.current);
12030
- prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
12031
- }, [state]);
12032
- useLayoutEffect22(() => {
12033
- const styles = stylesRef.current;
12034
- const wasPresent = prevPresentRef.current;
12035
- const hasPresentChanged = wasPresent !== present;
12036
- if (hasPresentChanged) {
12037
- const prevAnimationName = prevAnimationNameRef.current;
12038
- const currentAnimationName = getAnimationName(styles);
12039
- if (present) {
12040
- send("MOUNT");
12041
- } else if (currentAnimationName === "none" || styles?.display === "none") {
12042
- send("UNMOUNT");
12043
- } else {
12044
- const isAnimating = prevAnimationName !== currentAnimationName;
12045
- if (wasPresent && isAnimating) {
12046
- send("ANIMATION_OUT");
12047
- } else {
12048
- send("UNMOUNT");
11510
+ function TabView({ children, outerDivProps, onTabChanged, initialTabIndex = 0, ...props }) {
11511
+ const [tabs, setTabs] = (0, import_react28.useState)([]);
11512
+ const [active, setActiveState] = (0, import_react28.useState)(null);
11513
+ const buttonRefs = (0, import_react28.useRef)({});
11514
+ const setActive = (id) => {
11515
+ setActiveState(id);
11516
+ onTabChanged?.(id);
11517
+ };
11518
+ const register = (id, label) => {
11519
+ setTabs((prev) => {
11520
+ const exists = prev.some((t) => t.id === id);
11521
+ if (!exists) {
11522
+ const updated = [...prev, { id, label }];
11523
+ if (active === null && updated[initialTabIndex]) {
11524
+ setActive(updated[initialTabIndex].id);
12049
11525
  }
11526
+ return updated;
12050
11527
  }
12051
- prevPresentRef.current = present;
12052
- }
12053
- }, [present, send]);
12054
- useLayoutEffect22(() => {
12055
- if (node) {
12056
- let timeoutId;
12057
- const ownerWindow = node.ownerDocument.defaultView ?? window;
12058
- const handleAnimationEnd = (event) => {
12059
- const currentAnimationName = getAnimationName(stylesRef.current);
12060
- const isCurrentAnimation = currentAnimationName.includes(event.animationName);
12061
- if (event.target === node && isCurrentAnimation) {
12062
- send("ANIMATION_END");
12063
- if (!prevPresentRef.current) {
12064
- const currentFillMode = node.style.animationFillMode;
12065
- node.style.animationFillMode = "forwards";
12066
- timeoutId = ownerWindow.setTimeout(() => {
12067
- if (node.style.animationFillMode === "forwards") {
12068
- node.style.animationFillMode = currentFillMode;
12069
- }
12070
- });
12071
- }
12072
- }
12073
- };
12074
- const handleAnimationStart = (event) => {
12075
- if (event.target === node) {
12076
- prevAnimationNameRef.current = getAnimationName(stylesRef.current);
12077
- }
12078
- };
12079
- node.addEventListener("animationstart", handleAnimationStart);
12080
- node.addEventListener("animationcancel", handleAnimationEnd);
12081
- node.addEventListener("animationend", handleAnimationEnd);
12082
- return () => {
12083
- ownerWindow.clearTimeout(timeoutId);
12084
- node.removeEventListener("animationstart", handleAnimationStart);
12085
- node.removeEventListener("animationcancel", handleAnimationEnd);
12086
- node.removeEventListener("animationend", handleAnimationEnd);
12087
- };
12088
- } else {
12089
- send("ANIMATION_END");
12090
- }
12091
- }, [node, send]);
12092
- return {
12093
- isPresent: ["mounted", "unmountSuspended"].includes(state),
12094
- ref: React22.useCallback((node2) => {
12095
- stylesRef.current = node2 ? getComputedStyle(node2) : null;
12096
- setNode(node2);
12097
- }, [])
11528
+ return prev;
11529
+ });
12098
11530
  };
11531
+ const unregister = (id) => {
11532
+ setTabs((prev) => prev.filter((t) => t.id !== id));
11533
+ delete buttonRefs.current[id];
11534
+ };
11535
+ const onKeyDown = (e, id) => {
11536
+ const idx = tabs.findIndex((t) => t.id === id);
11537
+ if (idx === -1) return;
11538
+ let nextIdx = idx;
11539
+ if (e.key === "ArrowRight") nextIdx = (idx + 1) % tabs.length;
11540
+ else if (e.key === "ArrowLeft") nextIdx = (idx - 1 + tabs.length) % tabs.length;
11541
+ else return;
11542
+ const nextId = tabs[nextIdx].id;
11543
+ setActive(nextId);
11544
+ buttonRefs.current[nextId]?.focus();
11545
+ };
11546
+ const value = { active, setActive, register, unregister, tabs };
11547
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { ...outerDivProps, className: (0, import_clsx25.default)("w-full", props.className), children: [
11548
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { role: "tablist", ...props, className: (0, import_clsx25.default)("flex-row-0"), children: tabs.map((t) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
11549
+ "button",
11550
+ {
11551
+ role: "tab",
11552
+ "aria-selected": active === t.id,
11553
+ "aria-controls": `${t.id}-panel`,
11554
+ id: `${t.id}-tab`,
11555
+ tabIndex: active === t.id ? 0 : -1,
11556
+ ref: (el) => buttonRefs.current[t.id] = el,
11557
+ onClick: () => setActive(t.id),
11558
+ onKeyDown: (e) => onKeyDown(e, t.id),
11559
+ className: (0, import_clsx25.default)(
11560
+ "flex-row-0 grow justify-center px-3 pb-1 typography-label-md border-b-2",
11561
+ active === t.id ? "border-primary" : "text-description hover:text-on-background"
11562
+ ),
11563
+ children: t.label
11564
+ },
11565
+ t.id
11566
+ )) }),
11567
+ children
11568
+ ] }) });
12099
11569
  }
12100
- function getAnimationName(styles) {
12101
- return styles?.animationName || "none";
12102
- }
12103
- function getElementRef2(element) {
12104
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
12105
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
12106
- if (mayWarn) {
12107
- return element.ref;
12108
- }
12109
- getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
12110
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
12111
- if (mayWarn) {
12112
- return element.props.ref;
12113
- }
12114
- return element.props.ref || element.ref;
12115
- }
12116
-
12117
- // node_modules/@radix-ui/react-direction/dist/index.mjs
12118
- var React13 = __toESM(require("react"), 1);
12119
- var import_jsx_runtime37 = require("react/jsx-runtime");
12120
- var DirectionContext = React13.createContext(void 0);
12121
- function useDirection(localDir) {
12122
- const globalDir = React13.useContext(DirectionContext);
12123
- return localDir || globalDir || "ltr";
12124
- }
12125
-
12126
- // node_modules/@radix-ui/number/dist/index.mjs
12127
- function clamp2(value, [min, max]) {
12128
- return Math.min(max, Math.max(min, value));
12129
- }
12130
-
12131
- // node_modules/@radix-ui/primitive/dist/index.mjs
12132
- function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
12133
- return function handleEvent(event) {
12134
- originalEventHandler?.(event);
12135
- if (checkForDefaultPrevented === false || !event.defaultPrevented) {
12136
- return ourEventHandler?.(event);
12137
- }
12138
- };
12139
- }
12140
-
12141
- // node_modules/@radix-ui/react-scroll-area/dist/index.mjs
12142
- var React14 = __toESM(require("react"), 1);
12143
- var import_jsx_runtime38 = require("react/jsx-runtime");
12144
- function useStateMachine2(initialState, machine) {
12145
- return React14.useReducer((state, event) => {
12146
- const nextState = machine[state][event];
12147
- return nextState ?? state;
12148
- }, initialState);
12149
- }
12150
- var SCROLL_AREA_NAME = "ScrollArea";
12151
- var [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME);
12152
- var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
12153
- var ScrollArea = React23.forwardRef(
12154
- (props, forwardedRef) => {
12155
- const {
12156
- __scopeScrollArea,
12157
- type = "hover",
12158
- dir,
12159
- scrollHideDelay = 600,
12160
- ...scrollAreaProps
12161
- } = props;
12162
- const [scrollArea, setScrollArea] = React23.useState(null);
12163
- const [viewport, setViewport] = React23.useState(null);
12164
- const [content, setContent] = React23.useState(null);
12165
- const [scrollbarX, setScrollbarX] = React23.useState(null);
12166
- const [scrollbarY, setScrollbarY] = React23.useState(null);
12167
- const [cornerWidth, setCornerWidth] = React23.useState(0);
12168
- const [cornerHeight, setCornerHeight] = React23.useState(0);
12169
- const [scrollbarXEnabled, setScrollbarXEnabled] = React23.useState(false);
12170
- const [scrollbarYEnabled, setScrollbarYEnabled] = React23.useState(false);
12171
- const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node));
12172
- const direction = useDirection(dir);
12173
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12174
- ScrollAreaProvider,
12175
- {
12176
- scope: __scopeScrollArea,
12177
- type,
12178
- dir: direction,
12179
- scrollHideDelay,
12180
- scrollArea,
12181
- viewport,
12182
- onViewportChange: setViewport,
12183
- content,
12184
- onContentChange: setContent,
12185
- scrollbarX,
12186
- onScrollbarXChange: setScrollbarX,
12187
- scrollbarXEnabled,
12188
- onScrollbarXEnabledChange: setScrollbarXEnabled,
12189
- scrollbarY,
12190
- onScrollbarYChange: setScrollbarY,
12191
- scrollbarYEnabled,
12192
- onScrollbarYEnabledChange: setScrollbarYEnabled,
12193
- onCornerWidthChange: setCornerWidth,
12194
- onCornerHeightChange: setCornerHeight,
12195
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12196
- Primitive.div,
12197
- {
12198
- dir: direction,
12199
- ...scrollAreaProps,
12200
- ref: composedRefs,
12201
- style: {
12202
- position: "relative",
12203
- // Pass corner sizes as CSS vars to reduce re-renders of context consumers
12204
- ["--radix-scroll-area-corner-width"]: cornerWidth + "px",
12205
- ["--radix-scroll-area-corner-height"]: cornerHeight + "px",
12206
- ...props.style
12207
- }
12208
- }
12209
- )
12210
- }
12211
- );
12212
- }
12213
- );
12214
- ScrollArea.displayName = SCROLL_AREA_NAME;
12215
- var VIEWPORT_NAME = "ScrollAreaViewport";
12216
- var ScrollAreaViewport = React23.forwardRef(
12217
- (props, forwardedRef) => {
12218
- const { __scopeScrollArea, children, nonce, ...viewportProps } = props;
12219
- const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);
12220
- const ref = React23.useRef(null);
12221
- const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);
12222
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
12223
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12224
- "style",
12225
- {
12226
- dangerouslySetInnerHTML: {
12227
- __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`
12228
- },
12229
- nonce
12230
- }
12231
- ),
12232
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12233
- Primitive.div,
12234
- {
12235
- "data-radix-scroll-area-viewport": "",
12236
- ...viewportProps,
12237
- ref: composedRefs,
12238
- style: {
12239
- /**
12240
- * We don't support `visible` because the intention is to have at least one scrollbar
12241
- * if this component is used and `visible` will behave like `auto` in that case
12242
- * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
12243
- *
12244
- * We don't handle `auto` because the intention is for the native implementation
12245
- * to be hidden if using this component. We just want to ensure the node is scrollable
12246
- * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
12247
- * the browser from having to work out whether to render native scrollbars or not,
12248
- * we tell it to with the intention of hiding them in CSS.
12249
- */
12250
- overflowX: context.scrollbarXEnabled ? "scroll" : "hidden",
12251
- overflowY: context.scrollbarYEnabled ? "scroll" : "hidden",
12252
- ...props.style
12253
- },
12254
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { ref: context.onContentChange, style: { minWidth: "100%", display: "table" }, children })
12255
- }
12256
- )
12257
- ] });
12258
- }
12259
- );
12260
- ScrollAreaViewport.displayName = VIEWPORT_NAME;
12261
- var SCROLLBAR_NAME = "ScrollAreaScrollbar";
12262
- var ScrollAreaScrollbar = React23.forwardRef(
12263
- (props, forwardedRef) => {
12264
- const { forceMount, ...scrollbarProps } = props;
12265
- const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
12266
- const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context;
12267
- const isHorizontal = props.orientation === "horizontal";
12268
- React23.useEffect(() => {
12269
- isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);
12270
- return () => {
12271
- isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);
12272
- };
12273
- }, [isHorizontal, onScrollbarXEnabledChange, onScrollbarYEnabledChange]);
12274
- return context.type === "hover" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ScrollAreaScrollbarHover, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "scroll" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ScrollAreaScrollbarScroll, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "auto" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ScrollAreaScrollbarAuto, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "always" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ScrollAreaScrollbarVisible, { ...scrollbarProps, ref: forwardedRef }) : null;
12275
- }
12276
- );
12277
- ScrollAreaScrollbar.displayName = SCROLLBAR_NAME;
12278
- var ScrollAreaScrollbarHover = React23.forwardRef((props, forwardedRef) => {
12279
- const { forceMount, ...scrollbarProps } = props;
12280
- const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
12281
- const [visible, setVisible] = React23.useState(false);
12282
- React23.useEffect(() => {
12283
- const scrollArea = context.scrollArea;
12284
- let hideTimer = 0;
12285
- if (scrollArea) {
12286
- const handlePointerEnter = () => {
12287
- window.clearTimeout(hideTimer);
12288
- setVisible(true);
12289
- };
12290
- const handlePointerLeave = () => {
12291
- hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay);
12292
- };
12293
- scrollArea.addEventListener("pointerenter", handlePointerEnter);
12294
- scrollArea.addEventListener("pointerleave", handlePointerLeave);
12295
- return () => {
12296
- window.clearTimeout(hideTimer);
12297
- scrollArea.removeEventListener("pointerenter", handlePointerEnter);
12298
- scrollArea.removeEventListener("pointerleave", handlePointerLeave);
12299
- };
12300
- }
12301
- }, [context.scrollArea, context.scrollHideDelay]);
12302
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Presence, { present: forceMount || visible, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12303
- ScrollAreaScrollbarAuto,
12304
- {
12305
- "data-state": visible ? "visible" : "hidden",
12306
- ...scrollbarProps,
12307
- ref: forwardedRef
12308
- }
12309
- ) });
12310
- });
12311
- var ScrollAreaScrollbarScroll = React23.forwardRef((props, forwardedRef) => {
12312
- const { forceMount, ...scrollbarProps } = props;
12313
- const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
12314
- const isHorizontal = props.orientation === "horizontal";
12315
- const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100);
12316
- const [state, send] = useStateMachine2("hidden", {
12317
- hidden: {
12318
- SCROLL: "scrolling"
12319
- },
12320
- scrolling: {
12321
- SCROLL_END: "idle",
12322
- POINTER_ENTER: "interacting"
12323
- },
12324
- interacting: {
12325
- SCROLL: "interacting",
12326
- POINTER_LEAVE: "idle"
12327
- },
12328
- idle: {
12329
- HIDE: "hidden",
12330
- SCROLL: "scrolling",
12331
- POINTER_ENTER: "interacting"
12332
- }
12333
- });
12334
- React23.useEffect(() => {
12335
- if (state === "idle") {
12336
- const hideTimer = window.setTimeout(() => send("HIDE"), context.scrollHideDelay);
12337
- return () => window.clearTimeout(hideTimer);
12338
- }
12339
- }, [state, context.scrollHideDelay, send]);
12340
- React23.useEffect(() => {
12341
- const viewport = context.viewport;
12342
- const scrollDirection = isHorizontal ? "scrollLeft" : "scrollTop";
12343
- if (viewport) {
12344
- let prevScrollPos = viewport[scrollDirection];
12345
- const handleScroll = () => {
12346
- const scrollPos = viewport[scrollDirection];
12347
- const hasScrollInDirectionChanged = prevScrollPos !== scrollPos;
12348
- if (hasScrollInDirectionChanged) {
12349
- send("SCROLL");
12350
- debounceScrollEnd();
12351
- }
12352
- prevScrollPos = scrollPos;
12353
- };
12354
- viewport.addEventListener("scroll", handleScroll);
12355
- return () => viewport.removeEventListener("scroll", handleScroll);
12356
- }
12357
- }, [context.viewport, isHorizontal, send, debounceScrollEnd]);
12358
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Presence, { present: forceMount || state !== "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12359
- ScrollAreaScrollbarVisible,
12360
- {
12361
- "data-state": state === "hidden" ? "hidden" : "visible",
12362
- ...scrollbarProps,
12363
- ref: forwardedRef,
12364
- onPointerEnter: composeEventHandlers(props.onPointerEnter, () => send("POINTER_ENTER")),
12365
- onPointerLeave: composeEventHandlers(props.onPointerLeave, () => send("POINTER_LEAVE"))
12366
- }
12367
- ) });
12368
- });
12369
- var ScrollAreaScrollbarAuto = React23.forwardRef((props, forwardedRef) => {
12370
- const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
12371
- const { forceMount, ...scrollbarProps } = props;
12372
- const [visible, setVisible] = React23.useState(false);
12373
- const isHorizontal = props.orientation === "horizontal";
12374
- const handleResize = useDebounceCallback(() => {
12375
- if (context.viewport) {
12376
- const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth;
12377
- const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight;
12378
- setVisible(isHorizontal ? isOverflowX : isOverflowY);
12379
- }
12380
- }, 10);
12381
- useResizeObserver(context.viewport, handleResize);
12382
- useResizeObserver(context.content, handleResize);
12383
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Presence, { present: forceMount || visible, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12384
- ScrollAreaScrollbarVisible,
12385
- {
12386
- "data-state": visible ? "visible" : "hidden",
12387
- ...scrollbarProps,
12388
- ref: forwardedRef
12389
- }
12390
- ) });
12391
- });
12392
- var ScrollAreaScrollbarVisible = React23.forwardRef((props, forwardedRef) => {
12393
- const { orientation = "vertical", ...scrollbarProps } = props;
12394
- const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
12395
- const thumbRef = React23.useRef(null);
12396
- const pointerOffsetRef = React23.useRef(0);
12397
- const [sizes, setSizes] = React23.useState({
12398
- content: 0,
12399
- viewport: 0,
12400
- scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
12401
- });
12402
- const thumbRatio = getThumbRatio(sizes.viewport, sizes.content);
12403
- const commonProps = {
12404
- ...scrollbarProps,
12405
- sizes,
12406
- onSizesChange: setSizes,
12407
- hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),
12408
- onThumbChange: (thumb) => thumbRef.current = thumb,
12409
- onThumbPointerUp: () => pointerOffsetRef.current = 0,
12410
- onThumbPointerDown: (pointerPos) => pointerOffsetRef.current = pointerPos
12411
- };
12412
- function getScrollPosition(pointerPos, dir) {
12413
- return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir);
12414
- }
12415
- if (orientation === "horizontal") {
12416
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12417
- ScrollAreaScrollbarX,
12418
- {
12419
- ...commonProps,
12420
- ref: forwardedRef,
12421
- onThumbPositionChange: () => {
12422
- if (context.viewport && thumbRef.current) {
12423
- const scrollPos = context.viewport.scrollLeft;
12424
- const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir);
12425
- thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;
12426
- }
12427
- },
12428
- onWheelScroll: (scrollPos) => {
12429
- if (context.viewport) context.viewport.scrollLeft = scrollPos;
12430
- },
12431
- onDragScroll: (pointerPos) => {
12432
- if (context.viewport) {
12433
- context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir);
12434
- }
12435
- }
12436
- }
12437
- );
12438
- }
12439
- if (orientation === "vertical") {
12440
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12441
- ScrollAreaScrollbarY,
12442
- {
12443
- ...commonProps,
12444
- ref: forwardedRef,
12445
- onThumbPositionChange: () => {
12446
- if (context.viewport && thumbRef.current) {
12447
- const scrollPos = context.viewport.scrollTop;
12448
- const offset = getThumbOffsetFromScroll(scrollPos, sizes);
12449
- thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;
12450
- }
12451
- },
12452
- onWheelScroll: (scrollPos) => {
12453
- if (context.viewport) context.viewport.scrollTop = scrollPos;
12454
- },
12455
- onDragScroll: (pointerPos) => {
12456
- if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos);
12457
- }
12458
- }
12459
- );
12460
- }
12461
- return null;
12462
- });
12463
- var ScrollAreaScrollbarX = React23.forwardRef((props, forwardedRef) => {
12464
- const { sizes, onSizesChange, ...scrollbarProps } = props;
12465
- const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
12466
- const [computedStyle, setComputedStyle] = React23.useState();
12467
- const ref = React23.useRef(null);
12468
- const composeRefs2 = useComposedRefs(forwardedRef, ref, context.onScrollbarXChange);
12469
- React23.useEffect(() => {
12470
- if (ref.current) setComputedStyle(getComputedStyle(ref.current));
12471
- }, [ref]);
12472
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12473
- ScrollAreaScrollbarImpl,
12474
- {
12475
- "data-orientation": "horizontal",
12476
- ...scrollbarProps,
12477
- ref: composeRefs2,
12478
- sizes,
12479
- style: {
12480
- bottom: 0,
12481
- left: context.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
12482
- right: context.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
12483
- ["--radix-scroll-area-thumb-width"]: getThumbSize(sizes) + "px",
12484
- ...props.style
12485
- },
12486
- onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.x),
12487
- onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.x),
12488
- onWheelScroll: (event, maxScrollPos) => {
12489
- if (context.viewport) {
12490
- const scrollPos = context.viewport.scrollLeft + event.deltaX;
12491
- props.onWheelScroll(scrollPos);
12492
- if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {
12493
- event.preventDefault();
12494
- }
12495
- }
12496
- },
12497
- onResize: () => {
12498
- if (ref.current && context.viewport && computedStyle) {
12499
- onSizesChange({
12500
- content: context.viewport.scrollWidth,
12501
- viewport: context.viewport.offsetWidth,
12502
- scrollbar: {
12503
- size: ref.current.clientWidth,
12504
- paddingStart: toInt(computedStyle.paddingLeft),
12505
- paddingEnd: toInt(computedStyle.paddingRight)
12506
- }
12507
- });
12508
- }
12509
- }
12510
- }
12511
- );
12512
- });
12513
- var ScrollAreaScrollbarY = React23.forwardRef((props, forwardedRef) => {
12514
- const { sizes, onSizesChange, ...scrollbarProps } = props;
12515
- const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
12516
- const [computedStyle, setComputedStyle] = React23.useState();
12517
- const ref = React23.useRef(null);
12518
- const composeRefs2 = useComposedRefs(forwardedRef, ref, context.onScrollbarYChange);
12519
- React23.useEffect(() => {
12520
- if (ref.current) setComputedStyle(getComputedStyle(ref.current));
12521
- }, [ref]);
12522
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12523
- ScrollAreaScrollbarImpl,
12524
- {
12525
- "data-orientation": "vertical",
12526
- ...scrollbarProps,
12527
- ref: composeRefs2,
12528
- sizes,
12529
- style: {
12530
- top: 0,
12531
- right: context.dir === "ltr" ? 0 : void 0,
12532
- left: context.dir === "rtl" ? 0 : void 0,
12533
- bottom: "var(--radix-scroll-area-corner-height)",
12534
- ["--radix-scroll-area-thumb-height"]: getThumbSize(sizes) + "px",
12535
- ...props.style
12536
- },
12537
- onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.y),
12538
- onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.y),
12539
- onWheelScroll: (event, maxScrollPos) => {
12540
- if (context.viewport) {
12541
- const scrollPos = context.viewport.scrollTop + event.deltaY;
12542
- props.onWheelScroll(scrollPos);
12543
- if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {
12544
- event.preventDefault();
12545
- }
12546
- }
12547
- },
12548
- onResize: () => {
12549
- if (ref.current && context.viewport && computedStyle) {
12550
- onSizesChange({
12551
- content: context.viewport.scrollHeight,
12552
- viewport: context.viewport.offsetHeight,
12553
- scrollbar: {
12554
- size: ref.current.clientHeight,
12555
- paddingStart: toInt(computedStyle.paddingTop),
12556
- paddingEnd: toInt(computedStyle.paddingBottom)
12557
- }
12558
- });
12559
- }
12560
- }
12561
- }
12562
- );
12563
- });
12564
- var [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME);
12565
- var ScrollAreaScrollbarImpl = React23.forwardRef((props, forwardedRef) => {
12566
- const {
12567
- __scopeScrollArea,
12568
- sizes,
12569
- hasThumb,
12570
- onThumbChange,
12571
- onThumbPointerUp,
12572
- onThumbPointerDown,
12573
- onThumbPositionChange,
12574
- onDragScroll,
12575
- onWheelScroll,
12576
- onResize,
12577
- ...scrollbarProps
12578
- } = props;
12579
- const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);
12580
- const [scrollbar, setScrollbar] = React23.useState(null);
12581
- const composeRefs2 = useComposedRefs(forwardedRef, (node) => setScrollbar(node));
12582
- const rectRef = React23.useRef(null);
12583
- const prevWebkitUserSelectRef = React23.useRef("");
12584
- const viewport = context.viewport;
12585
- const maxScrollPos = sizes.content - sizes.viewport;
12586
- const handleWheelScroll = useCallbackRef(onWheelScroll);
12587
- const handleThumbPositionChange = useCallbackRef(onThumbPositionChange);
12588
- const handleResize = useDebounceCallback(onResize, 10);
12589
- function handleDragScroll(event) {
12590
- if (rectRef.current) {
12591
- const x = event.clientX - rectRef.current.left;
12592
- const y = event.clientY - rectRef.current.top;
12593
- onDragScroll({ x, y });
12594
- }
12595
- }
12596
- React23.useEffect(() => {
12597
- const handleWheel = (event) => {
12598
- const element = event.target;
12599
- const isScrollbarWheel = scrollbar?.contains(element);
12600
- if (isScrollbarWheel) handleWheelScroll(event, maxScrollPos);
12601
- };
12602
- document.addEventListener("wheel", handleWheel, { passive: false });
12603
- return () => document.removeEventListener("wheel", handleWheel, { passive: false });
12604
- }, [viewport, scrollbar, maxScrollPos, handleWheelScroll]);
12605
- React23.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]);
12606
- useResizeObserver(scrollbar, handleResize);
12607
- useResizeObserver(context.content, handleResize);
12608
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12609
- ScrollbarProvider,
12610
- {
12611
- scope: __scopeScrollArea,
12612
- scrollbar,
12613
- hasThumb,
12614
- onThumbChange: useCallbackRef(onThumbChange),
12615
- onThumbPointerUp: useCallbackRef(onThumbPointerUp),
12616
- onThumbPositionChange: handleThumbPositionChange,
12617
- onThumbPointerDown: useCallbackRef(onThumbPointerDown),
12618
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12619
- Primitive.div,
12620
- {
12621
- ...scrollbarProps,
12622
- ref: composeRefs2,
12623
- style: { position: "absolute", ...scrollbarProps.style },
12624
- onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
12625
- const mainPointer = 0;
12626
- if (event.button === mainPointer) {
12627
- const element = event.target;
12628
- element.setPointerCapture(event.pointerId);
12629
- rectRef.current = scrollbar.getBoundingClientRect();
12630
- prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;
12631
- document.body.style.webkitUserSelect = "none";
12632
- if (context.viewport) context.viewport.style.scrollBehavior = "auto";
12633
- handleDragScroll(event);
12634
- }
12635
- }),
12636
- onPointerMove: composeEventHandlers(props.onPointerMove, handleDragScroll),
12637
- onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
12638
- const element = event.target;
12639
- if (element.hasPointerCapture(event.pointerId)) {
12640
- element.releasePointerCapture(event.pointerId);
12641
- }
12642
- document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;
12643
- if (context.viewport) context.viewport.style.scrollBehavior = "";
12644
- rectRef.current = null;
12645
- })
12646
- }
12647
- )
12648
- }
12649
- );
12650
- });
12651
- var THUMB_NAME = "ScrollAreaThumb";
12652
- var ScrollAreaThumb = React23.forwardRef(
12653
- (props, forwardedRef) => {
12654
- const { forceMount, ...thumbProps } = props;
12655
- const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);
12656
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Presence, { present: forceMount || scrollbarContext.hasThumb, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ScrollAreaThumbImpl, { ref: forwardedRef, ...thumbProps }) });
12657
- }
12658
- );
12659
- var ScrollAreaThumbImpl = React23.forwardRef(
12660
- (props, forwardedRef) => {
12661
- const { __scopeScrollArea, style, ...thumbProps } = props;
12662
- const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);
12663
- const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);
12664
- const { onThumbPositionChange } = scrollbarContext;
12665
- const composedRef = useComposedRefs(
12666
- forwardedRef,
12667
- (node) => scrollbarContext.onThumbChange(node)
12668
- );
12669
- const removeUnlinkedScrollListenerRef = React23.useRef(void 0);
12670
- const debounceScrollEnd = useDebounceCallback(() => {
12671
- if (removeUnlinkedScrollListenerRef.current) {
12672
- removeUnlinkedScrollListenerRef.current();
12673
- removeUnlinkedScrollListenerRef.current = void 0;
12674
- }
12675
- }, 100);
12676
- React23.useEffect(() => {
12677
- const viewport = scrollAreaContext.viewport;
12678
- if (viewport) {
12679
- const handleScroll = () => {
12680
- debounceScrollEnd();
12681
- if (!removeUnlinkedScrollListenerRef.current) {
12682
- const listener = addUnlinkedScrollListener(viewport, onThumbPositionChange);
12683
- removeUnlinkedScrollListenerRef.current = listener;
12684
- onThumbPositionChange();
12685
- }
12686
- };
12687
- onThumbPositionChange();
12688
- viewport.addEventListener("scroll", handleScroll);
12689
- return () => viewport.removeEventListener("scroll", handleScroll);
12690
- }
12691
- }, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]);
12692
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12693
- Primitive.div,
12694
- {
12695
- "data-state": scrollbarContext.hasThumb ? "visible" : "hidden",
12696
- ...thumbProps,
12697
- ref: composedRef,
12698
- style: {
12699
- width: "var(--radix-scroll-area-thumb-width)",
12700
- height: "var(--radix-scroll-area-thumb-height)",
12701
- ...style
12702
- },
12703
- onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, (event) => {
12704
- const thumb = event.target;
12705
- const thumbRect = thumb.getBoundingClientRect();
12706
- const x = event.clientX - thumbRect.left;
12707
- const y = event.clientY - thumbRect.top;
12708
- scrollbarContext.onThumbPointerDown({ x, y });
12709
- }),
12710
- onPointerUp: composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)
12711
- }
12712
- );
12713
- }
12714
- );
12715
- ScrollAreaThumb.displayName = THUMB_NAME;
12716
- var CORNER_NAME = "ScrollAreaCorner";
12717
- var ScrollAreaCorner = React23.forwardRef(
12718
- (props, forwardedRef) => {
12719
- const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea);
12720
- const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);
12721
- const hasCorner = context.type !== "scroll" && hasBothScrollbarsVisible;
12722
- return hasCorner ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ScrollAreaCornerImpl, { ...props, ref: forwardedRef }) : null;
12723
- }
12724
- );
12725
- ScrollAreaCorner.displayName = CORNER_NAME;
12726
- var ScrollAreaCornerImpl = React23.forwardRef((props, forwardedRef) => {
12727
- const { __scopeScrollArea, ...cornerProps } = props;
12728
- const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea);
12729
- const [width, setWidth] = React23.useState(0);
12730
- const [height, setHeight] = React23.useState(0);
12731
- const hasSize = Boolean(width && height);
12732
- useResizeObserver(context.scrollbarX, () => {
12733
- const height2 = context.scrollbarX?.offsetHeight || 0;
12734
- context.onCornerHeightChange(height2);
12735
- setHeight(height2);
12736
- });
12737
- useResizeObserver(context.scrollbarY, () => {
12738
- const width2 = context.scrollbarY?.offsetWidth || 0;
12739
- context.onCornerWidthChange(width2);
12740
- setWidth(width2);
12741
- });
12742
- return hasSize ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
12743
- Primitive.div,
12744
- {
12745
- ...cornerProps,
12746
- ref: forwardedRef,
12747
- style: {
12748
- width,
12749
- height,
12750
- position: "absolute",
12751
- right: context.dir === "ltr" ? 0 : void 0,
12752
- left: context.dir === "rtl" ? 0 : void 0,
12753
- bottom: 0,
12754
- ...props.style
12755
- }
12756
- }
12757
- ) : null;
12758
- });
12759
- function toInt(value) {
12760
- return value ? parseInt(value, 10) : 0;
12761
- }
12762
- function getThumbRatio(viewportSize, contentSize) {
12763
- const ratio = viewportSize / contentSize;
12764
- return isNaN(ratio) ? 0 : ratio;
12765
- }
12766
- function getThumbSize(sizes) {
12767
- const ratio = getThumbRatio(sizes.viewport, sizes.content);
12768
- const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
12769
- const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;
12770
- return Math.max(thumbSize, 18);
12771
- }
12772
- function getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = "ltr") {
12773
- const thumbSizePx = getThumbSize(sizes);
12774
- const thumbCenter = thumbSizePx / 2;
12775
- const offset = pointerOffset || thumbCenter;
12776
- const thumbOffsetFromEnd = thumbSizePx - offset;
12777
- const minPointerPos = sizes.scrollbar.paddingStart + offset;
12778
- const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;
12779
- const maxScrollPos = sizes.content - sizes.viewport;
12780
- const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
12781
- const interpolate = linearScale([minPointerPos, maxPointerPos], scrollRange);
12782
- return interpolate(pointerPos);
12783
- }
12784
- function getThumbOffsetFromScroll(scrollPos, sizes, dir = "ltr") {
12785
- const thumbSizePx = getThumbSize(sizes);
12786
- const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
12787
- const scrollbar = sizes.scrollbar.size - scrollbarPadding;
12788
- const maxScrollPos = sizes.content - sizes.viewport;
12789
- const maxThumbPos = scrollbar - thumbSizePx;
12790
- const scrollClampRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
12791
- const scrollWithoutMomentum = clamp2(scrollPos, scrollClampRange);
12792
- const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]);
12793
- return interpolate(scrollWithoutMomentum);
12794
- }
12795
- function linearScale(input, output) {
12796
- return (value) => {
12797
- if (input[0] === input[1] || output[0] === output[1]) return output[0];
12798
- const ratio = (output[1] - output[0]) / (input[1] - input[0]);
12799
- return output[0] + ratio * (value - input[0]);
12800
- };
12801
- }
12802
- function isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) {
12803
- return scrollPos > 0 && scrollPos < maxScrollPos;
12804
- }
12805
- var addUnlinkedScrollListener = (node, handler = () => {
12806
- }) => {
12807
- let prevPosition = { left: node.scrollLeft, top: node.scrollTop };
12808
- let rAF = 0;
12809
- (function loop() {
12810
- const position = { left: node.scrollLeft, top: node.scrollTop };
12811
- const isHorizontalScroll = prevPosition.left !== position.left;
12812
- const isVerticalScroll = prevPosition.top !== position.top;
12813
- if (isHorizontalScroll || isVerticalScroll) handler();
12814
- prevPosition = position;
12815
- rAF = window.requestAnimationFrame(loop);
12816
- })();
12817
- return () => window.cancelAnimationFrame(rAF);
12818
- };
12819
- function useDebounceCallback(callback, delay) {
12820
- const handleCallback = useCallbackRef(callback);
12821
- const debounceTimerRef = React23.useRef(0);
12822
- React23.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);
12823
- return React23.useCallback(() => {
12824
- window.clearTimeout(debounceTimerRef.current);
12825
- debounceTimerRef.current = window.setTimeout(handleCallback, delay);
12826
- }, [handleCallback, delay]);
12827
- }
12828
- function useResizeObserver(element, onResize) {
12829
- const handleResize = useCallbackRef(onResize);
12830
- useLayoutEffect22(() => {
12831
- let rAF = 0;
12832
- if (element) {
12833
- const resizeObserver = new ResizeObserver(() => {
12834
- cancelAnimationFrame(rAF);
12835
- rAF = window.requestAnimationFrame(handleResize);
12836
- });
12837
- resizeObserver.observe(element);
12838
- return () => {
12839
- window.cancelAnimationFrame(rAF);
12840
- resizeObserver.unobserve(element);
12841
- };
12842
- }
12843
- }, [element, handleResize]);
12844
- }
12845
- var Root2 = ScrollArea;
12846
- var Viewport = ScrollAreaViewport;
12847
- var Scrollbar = ScrollAreaScrollbar;
12848
- var Thumb = ScrollAreaThumb;
12849
- var Corner = ScrollAreaCorner;
12850
-
12851
- // src/components/layout/ScrollArea.tsx
12852
- var import_clsx25 = require("clsx");
12853
- var import_jsx_runtime39 = require("react/jsx-runtime");
12854
- var ScrollArea2 = ({
12855
- children,
12856
- scrollbarSize = "md",
12857
- scrollbarType = "auto",
12858
- scrollbarAxis = "both",
12859
- className,
12860
- ...props
12861
- }) => {
12862
- const scrollbarStyle = {
12863
- sm: { "--scrollbar-size": "calc(4px + var(--spacing))" },
12864
- md: { "--scrollbar-size": "calc(6px + var(--spacing))" }
12865
- }[scrollbarSize];
12866
- const hasHorizontalScrollBar = scrollbarAxis === "horizontal" || scrollbarAxis === "both";
12867
- const hasVerticalScrollBar = scrollbarAxis === "vertical" || scrollbarAxis === "both";
12868
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
12869
- Root2,
12870
- {
12871
- ...props,
12872
- className: (0, import_clsx25.clsx)(
12873
- "overflow-hidden",
12874
- className
12875
- ),
12876
- style: {
12877
- ...scrollbarStyle,
12878
- ...props.style
12879
- },
12880
- type: scrollbarType,
12881
- children: [
12882
- hasHorizontalScrollBar && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
12883
- Scrollbar,
12884
- {
12885
- orientation: "horizontal",
12886
- className: (0, import_clsx25.clsx)(
12887
- "peer/horizontal group/scrollbar flex-col-0 rounded-full select-none touch-none bg-scrollbar-track/50 hover:bg-scrollbar-track",
12888
- {
12889
- "h-[var(--scrollbar-size)]": scrollbarType === "always",
12890
- "data-[state=visible]:h-[var(--scrollbar-size)]": scrollbarType !== "always"
12891
- }
12892
- ),
12893
- children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
12894
- Thumb,
12895
- {
12896
- className: (0, import_clsx25.clsx)(
12897
- "flex relative rounded-full bg-scrollbar-thumb group-hover/scrollbar:bg-primary",
12898
- {
12899
- "min-h-[var(--scrollbar-size)]": scrollbarType === "always",
12900
- "data-[state=visible]:min-h-[var(--scrollbar-size)]": scrollbarType !== "always"
12901
- }
12902
- )
12903
- }
12904
- )
12905
- }
12906
- ),
12907
- hasVerticalScrollBar && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
12908
- Scrollbar,
12909
- {
12910
- orientation: "vertical",
12911
- className: (0, import_clsx25.clsx)(
12912
- "peer/vertical group/scrollbar flex-col-0 rounded-full select-none touch-none bg-scrollbar-track/50 hover:bg-scrollbar-track",
12913
- {
12914
- "w-[var(--scrollbar-size)]": scrollbarType === "always",
12915
- "data-[state=visible]:w-[var(--scrollbar-size)]": scrollbarType !== "always"
12916
- }
12917
- ),
12918
- children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
12919
- Thumb,
12920
- {
12921
- className: (0, import_clsx25.clsx)(
12922
- "flex relative rounded-full bg-scrollbar-thumb group-hover/scrollbar:bg-primary",
12923
- {
12924
- "min-w-[var(--scrollbar-size)]": scrollbarType === "always",
12925
- "data-[state=visible]:min-w-[var(--scrollbar-size)]": scrollbarType !== "always"
12926
- }
12927
- )
12928
- }
12929
- )
12930
- }
12931
- ),
12932
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
12933
- Viewport,
12934
- {
12935
- className: (0, import_clsx25.clsx)(
12936
- "border-inherit",
12937
- {
12938
- "w-[calc(100%_-_var(--scrollbar-size))] h-[calc(100%_-_var(--scrollbar-size))]": scrollbarType === "always",
12939
- "w-full h-full": scrollbarType === "scroll" || scrollbarType === "hover" || scrollbarType === "auto",
12940
- "peer-[&:where([data-state=visible])]/horizontal:h-[calc(100%_-_var(--scrollbar-size))] peer-[&:where([data-state=visible])]/vertical:w-[calc(100%_-_var(--scrollbar-size))]": scrollbarType === "auto"
12941
- }
12942
- ),
12943
- children
12944
- }
12945
- ),
12946
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
12947
- Corner,
12948
- {
12949
- className: (0, import_clsx25.clsx)(
12950
- "bg-scrollbar-track rounded-full"
12951
- )
12952
- }
12953
- )
12954
- ]
12955
- }
12956
- );
12957
- };
12958
-
12959
- // src/components/layout/TabView.tsx
12960
- var import_react27 = require("react");
12961
- var import_react28 = require("react");
12962
- var import_clsx26 = __toESM(require("clsx"));
12963
- var import_jsx_runtime40 = require("react/jsx-runtime");
12964
- var TabContext = (0, import_react28.createContext)(null);
12965
- function useTabContext() {
12966
- const ctx = (0, import_react28.useContext)(TabContext);
12967
- if (!ctx) throw new Error("useTabContext must be used inside a <TabView>");
12968
- return ctx;
12969
- }
12970
- function TabView({ children, outerDivProps, onTabChanged, initialTabIndex = 0, ...props }) {
12971
- const [tabs, setTabs] = (0, import_react28.useState)([]);
12972
- const [active, setActiveState] = (0, import_react28.useState)(null);
12973
- const buttonRefs = (0, import_react28.useRef)({});
12974
- const setActive = (id) => {
12975
- setActiveState(id);
12976
- onTabChanged?.(id);
12977
- };
12978
- const register = (id, label) => {
12979
- setTabs((prev) => {
12980
- const exists = prev.some((t) => t.id === id);
12981
- if (!exists) {
12982
- const updated = [...prev, { id, label }];
12983
- if (active === null && updated[initialTabIndex]) {
12984
- setActive(updated[initialTabIndex].id);
12985
- }
12986
- return updated;
12987
- }
12988
- return prev;
12989
- });
12990
- };
12991
- const unregister = (id) => {
12992
- setTabs((prev) => prev.filter((t) => t.id !== id));
12993
- delete buttonRefs.current[id];
12994
- };
12995
- const onKeyDown = (e, id) => {
12996
- const idx = tabs.findIndex((t) => t.id === id);
12997
- if (idx === -1) return;
12998
- let nextIdx = idx;
12999
- if (e.key === "ArrowRight") nextIdx = (idx + 1) % tabs.length;
13000
- else if (e.key === "ArrowLeft") nextIdx = (idx - 1 + tabs.length) % tabs.length;
13001
- else return;
13002
- const nextId = tabs[nextIdx].id;
13003
- setActive(nextId);
13004
- buttonRefs.current[nextId]?.focus();
13005
- };
13006
- const value = { active, setActive, register, unregister, tabs };
13007
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TabContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { ...outerDivProps, className: (0, import_clsx26.default)("w-full", props.className), children: [
13008
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { role: "tablist", ...props, className: (0, import_clsx26.default)("flex-row-0"), children: tabs.map((t) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
13009
- "button",
13010
- {
13011
- role: "tab",
13012
- "aria-selected": active === t.id,
13013
- "aria-controls": `${t.id}-panel`,
13014
- id: `${t.id}-tab`,
13015
- tabIndex: active === t.id ? 0 : -1,
13016
- ref: (el) => buttonRefs.current[t.id] = el,
13017
- onClick: () => setActive(t.id),
13018
- onKeyDown: (e) => onKeyDown(e, t.id),
13019
- className: (0, import_clsx26.default)(
13020
- "flex-row-0 grow justify-center px-3 pb-1 typography-label-md border-b-2",
13021
- active === t.id ? "border-primary" : "text-description hover:text-on-background"
13022
- ),
13023
- children: t.label
13024
- },
13025
- t.id
13026
- )) }),
13027
- children
13028
- ] }) });
13029
- }
13030
- function Tab({ id: customId, label, children, ...props }) {
13031
- const { active, register, unregister } = useTabContext();
13032
- const generatedId = (0, import_react27.useId)();
13033
- const id = customId ?? generatedId;
13034
- (0, import_react28.useEffect)(() => {
13035
- register(id, label);
13036
- return () => unregister(id);
13037
- }, [id, label]);
13038
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
13039
- "div",
13040
- {
13041
- role: "tabpanel",
13042
- id: `${id}-panel`,
13043
- "aria-labelledby": `${id}-tab`,
13044
- hidden: active !== id,
13045
- className: "mt-4 text-sm",
13046
- ...props,
13047
- children: active === id && children
13048
- }
13049
- );
11570
+ function Tab({ id: customId, label, children, ...props }) {
11571
+ const { active, register, unregister } = useTabContext();
11572
+ const generatedId = (0, import_react27.useId)();
11573
+ const id = customId ?? generatedId;
11574
+ (0, import_react28.useEffect)(() => {
11575
+ register(id, label);
11576
+ return () => unregister(id);
11577
+ }, [id, label]);
11578
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
11579
+ "div",
11580
+ {
11581
+ role: "tabpanel",
11582
+ id: `${id}-panel`,
11583
+ "aria-labelledby": `${id}-tab`,
11584
+ hidden: active !== id,
11585
+ className: "mt-4 text-sm",
11586
+ ...props,
11587
+ children: active === id && children
11588
+ }
11589
+ );
13050
11590
  }
13051
11591
 
13052
11592
  // src/components/layout/TextImage.tsx
13053
- var import_clsx27 = __toESM(require("clsx"));
13054
- var import_jsx_runtime41 = require("react/jsx-runtime");
11593
+ var import_clsx26 = __toESM(require("clsx"));
11594
+ var import_jsx_runtime34 = require("react/jsx-runtime");
13055
11595
  var TextImage = ({
13056
11596
  title,
13057
11597
  description,
@@ -13073,25 +11613,25 @@ var TextImage = ({
13073
11613
  secondary: "text-text-image-secondary-text bg-linear-to-r from-30% from-text-image-secondary-background to-text-image-secondary-background/55",
13074
11614
  dark: "text-text-image-dark-text bg-linear-to-r from-30% from-text-image-dark-background to-text-image-dark-background/55"
13075
11615
  };
13076
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11616
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
13077
11617
  "div",
13078
11618
  {
13079
- className: (0, import_clsx27.default)("rounded-2xl w-full", className),
11619
+ className: (0, import_clsx26.default)("rounded-2xl w-full", className),
13080
11620
  style: {
13081
11621
  backgroundImage: `url(${imageUrl})`,
13082
11622
  backgroundSize: "cover"
13083
11623
  },
13084
- children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
11624
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
13085
11625
  "div",
13086
11626
  {
13087
- className: (0, import_clsx27.default)(`flex-col-2 px-6 py-12 rounded-2xl h-full`, colorMapping[color], contentClassName),
11627
+ className: (0, import_clsx26.default)(`flex-col-2 px-6 py-12 rounded-2xl h-full`, colorMapping[color], contentClassName),
13088
11628
  children: [
13089
- badge && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: (0, import_clsx27.default)(`chip-full mb-2 py-2 px-4 w-fit`, chipColorMapping[color]), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-lg font-bold", children: badge }) }),
13090
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-col-1 overflow-hidden", children: [
13091
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "typography-title-lg", children: title }),
13092
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-ellipsis overflow-hidden", children: description })
11629
+ badge && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: (0, import_clsx26.default)(`chip-full mb-2 py-2 px-4 w-fit`, chipColorMapping[color]), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-lg font-bold", children: badge }) }),
11630
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex-col-1 overflow-hidden", children: [
11631
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "typography-title-lg", children: title }),
11632
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-ellipsis overflow-hidden", children: description })
13093
11633
  ] }),
13094
- onShowMoreClicked && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex-row-2 mt-2 underline", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { onClick: onShowMoreClicked, children: translation("showMore") }) })
11634
+ onShowMoreClicked && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex-row-2 mt-2 underline", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { onClick: onShowMoreClicked, children: translation("showMore") }) })
13095
11635
  ]
13096
11636
  }
13097
11637
  )
@@ -13100,7 +11640,7 @@ var TextImage = ({
13100
11640
  };
13101
11641
 
13102
11642
  // src/components/layout/VerticalDivider.tsx
13103
- var import_jsx_runtime42 = require("react/jsx-runtime");
11643
+ var import_jsx_runtime35 = require("react/jsx-runtime");
13104
11644
  var VerticalDivider = ({
13105
11645
  width = 1,
13106
11646
  height = 100,
@@ -13108,7 +11648,7 @@ var VerticalDivider = ({
13108
11648
  dashGap = 4,
13109
11649
  dashLength = 4
13110
11650
  }) => {
13111
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { style: { width: width + "px", height: height + "px" }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
11651
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { style: { width: width + "px", height: height + "px" }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
13112
11652
  "svg",
13113
11653
  {
13114
11654
  width,
@@ -13117,7 +11657,7 @@ var VerticalDivider = ({
13117
11657
  fill: "none",
13118
11658
  xmlns: "http://www.w3.org/2000/svg",
13119
11659
  children: [
13120
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
11660
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
13121
11661
  "line",
13122
11662
  {
13123
11663
  opacity: "0.5",
@@ -13131,7 +11671,7 @@ var VerticalDivider = ({
13131
11671
  strokeLinecap: "round"
13132
11672
  }
13133
11673
  ),
13134
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
11674
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
13135
11675
  "linearGradient",
13136
11676
  {
13137
11677
  id: "paint_linear",
@@ -13141,9 +11681,9 @@ var VerticalDivider = ({
13141
11681
  y2: height,
13142
11682
  gradientUnits: "userSpaceOnUse",
13143
11683
  children: [
13144
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { stopOpacity: "0", stopColor: "currentColor" }),
13145
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { offset: "0.5", stopColor: "currentColor" }),
13146
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { offset: "1", stopColor: "currentColor", stopOpacity: "0" })
11684
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("stop", { stopOpacity: "0", stopColor: "currentColor" }),
11685
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("stop", { offset: "0.5", stopColor: "currentColor" }),
11686
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("stop", { offset: "1", stopColor: "currentColor", stopOpacity: "0" })
13147
11687
  ]
13148
11688
  }
13149
11689
  ) })
@@ -13154,15 +11694,15 @@ var VerticalDivider = ({
13154
11694
 
13155
11695
  // src/components/loading-states/ErrorComponent.tsx
13156
11696
  var import_lucide_react8 = require("lucide-react");
13157
- var import_clsx28 = __toESM(require("clsx"));
13158
- var import_jsx_runtime43 = require("react/jsx-runtime");
11697
+ var import_clsx27 = __toESM(require("clsx"));
11698
+ var import_jsx_runtime36 = require("react/jsx-runtime");
13159
11699
  var ErrorComponent = ({
13160
11700
  errorText,
13161
11701
  classname
13162
11702
  }) => {
13163
11703
  const translation = useHightideTranslation();
13164
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: (0, import_clsx28.default)("flex-col-4 items-center justify-center w-full h-24", classname), children: [
13165
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.AlertOctagon, { size: 64, className: "text-warning" }),
11704
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: (0, import_clsx27.default)("flex-col-4 items-center justify-center w-full h-24", classname), children: [
11705
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react8.AlertOctagon, { size: 64, className: "text-warning" }),
13166
11706
  errorText ?? `${translation("errorOccurred")} :(`
13167
11707
  ] });
13168
11708
  };
@@ -13171,15 +11711,15 @@ var ErrorComponent = ({
13171
11711
  var import_react29 = require("react");
13172
11712
 
13173
11713
  // src/components/loading-states/LoadingContainer.tsx
13174
- var import_clsx29 = require("clsx");
13175
- var import_jsx_runtime44 = require("react/jsx-runtime");
11714
+ var import_clsx28 = require("clsx");
11715
+ var import_jsx_runtime37 = require("react/jsx-runtime");
13176
11716
  var LoadingContainer = ({ className }) => {
13177
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: (0, import_clsx29.clsx)("relative overflow-hidden shimmer bg-disabled-background rounded-md", className) });
11717
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: (0, import_clsx28.clsx)("relative overflow-hidden shimmer bg-disabled-background rounded-md", className) });
13178
11718
  };
13179
11719
 
13180
11720
  // src/components/loading-states/LoadingAndErrorComponent.tsx
13181
- var import_clsx30 = require("clsx");
13182
- var import_jsx_runtime45 = require("react/jsx-runtime");
11721
+ var import_clsx29 = require("clsx");
11722
+ var import_jsx_runtime38 = require("react/jsx-runtime");
13183
11723
  var LoadingAndErrorComponent = ({
13184
11724
  children,
13185
11725
  isLoading = false,
@@ -13199,41 +11739,41 @@ var LoadingAndErrorComponent = ({
13199
11739
  }, minimumLoadingDuration);
13200
11740
  }
13201
11741
  if (isLoading || minimumLoadingDuration && isInMinimumLoading) {
13202
- return loadingComponent ?? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(LoadingContainer, { className: (0, import_clsx30.clsx)(className) });
11742
+ return loadingComponent ?? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(LoadingContainer, { className: (0, import_clsx29.clsx)(className) });
13203
11743
  }
13204
11744
  if (hasError) {
13205
- return errorComponent ?? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(LoadingContainer, { className: (0, import_clsx30.clsx)("bg-negative", className) });
11745
+ return errorComponent ?? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(LoadingContainer, { className: (0, import_clsx29.clsx)("bg-negative", className) });
13206
11746
  }
13207
11747
  return children;
13208
11748
  };
13209
11749
 
13210
11750
  // src/components/loading-states/LoadingAnimation.tsx
13211
- var import_clsx31 = __toESM(require("clsx"));
13212
- var import_jsx_runtime46 = require("react/jsx-runtime");
11751
+ var import_clsx30 = __toESM(require("clsx"));
11752
+ var import_jsx_runtime39 = require("react/jsx-runtime");
13213
11753
  var LoadingAnimation = ({
13214
11754
  loadingText,
13215
11755
  classname
13216
11756
  }) => {
13217
11757
  const translation = useHightideTranslation();
13218
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: (0, import_clsx31.default)("flex-col-2 items-center justify-center w-full h-24", classname), children: [
13219
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(HelpwaveLogo, { animate: "loading" }),
11758
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: (0, import_clsx30.default)("flex-col-2 items-center justify-center w-full h-24", classname), children: [
11759
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(HelpwaveLogo, { animate: "loading" }),
13220
11760
  loadingText ?? `${translation("loading")}...`
13221
11761
  ] });
13222
11762
  };
13223
11763
 
13224
11764
  // src/components/loading-states/LoadingButton.tsx
13225
- var import_clsx32 = __toESM(require("clsx"));
13226
- var import_jsx_runtime47 = require("react/jsx-runtime");
11765
+ var import_clsx31 = __toESM(require("clsx"));
11766
+ var import_jsx_runtime40 = require("react/jsx-runtime");
13227
11767
  var LoadingButton = ({ isLoading = false, size = "medium", onClick, ...rest }) => {
13228
11768
  const paddingClass = ButtonUtil.paddingMapping[size];
13229
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "inline-block relative", children: [
13230
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: (0, import_clsx32.default)("flex-row-2 absolute inset-0 items-center justify-center bg-white/40", paddingClass), children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(HelpwaveLogo, { animate: "loading", className: "text-white" }) }),
13231
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SolidButton, { ...rest, disabled: rest.disabled, onClick })
11769
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "inline-block relative", children: [
11770
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: (0, import_clsx31.default)("flex-row-2 absolute inset-0 items-center justify-center bg-white/40", paddingClass), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(HelpwaveLogo, { animate: "loading", className: "text-white" }) }),
11771
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SolidButton, { ...rest, disabled: rest.disabled, onClick })
13232
11772
  ] });
13233
11773
  };
13234
11774
 
13235
11775
  // src/components/loading-states/ProgressIndicator.tsx
13236
- var import_jsx_runtime48 = require("react/jsx-runtime");
11776
+ var import_jsx_runtime41 = require("react/jsx-runtime");
13237
11777
  var sizeMapping = { small: 16, medium: 24, big: 48 };
13238
11778
  var ProgressIndicator = ({
13239
11779
  progress,
@@ -13250,7 +11790,7 @@ var ProgressIndicator = ({
13250
11790
  if (direction === "clockwise") {
13251
11791
  rotation += 360 * progress;
13252
11792
  }
13253
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
11793
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
13254
11794
  "svg",
13255
11795
  {
13256
11796
  style: {
@@ -13259,7 +11799,7 @@ var ProgressIndicator = ({
13259
11799
  transform: `rotate(${rotation}deg)`
13260
11800
  },
13261
11801
  children: [
13262
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
11802
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
13263
11803
  "circle",
13264
11804
  {
13265
11805
  cx: center,
@@ -13270,7 +11810,7 @@ var ProgressIndicator = ({
13270
11810
  className: "stroke-progress-indicator-fill"
13271
11811
  }
13272
11812
  ),
13273
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
11813
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
13274
11814
  "circle",
13275
11815
  {
13276
11816
  cx: center,
@@ -13290,23 +11830,23 @@ var ProgressIndicator = ({
13290
11830
 
13291
11831
  // src/components/navigation/BreadCrumb.tsx
13292
11832
  var import_link = __toESM(require_link2());
13293
- var import_clsx33 = __toESM(require("clsx"));
11833
+ var import_clsx32 = __toESM(require("clsx"));
13294
11834
  var import_react30 = require("react");
13295
- var import_jsx_runtime49 = require("react/jsx-runtime");
11835
+ var import_jsx_runtime42 = require("react/jsx-runtime");
13296
11836
  var BreadCrumb = ({ crumbs, linkClassName, containerClassName }) => {
13297
11837
  const color = "text-description";
13298
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: (0, import_clsx33.default)("flex-row-0.5 items-center", containerClassName), children: crumbs.map((crumb, index) => {
11838
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: (0, import_clsx32.default)("flex-row-0.5 items-center", containerClassName), children: crumbs.map((crumb, index) => {
13299
11839
  const isLast = index === crumbs.length - 1;
13300
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react30.Fragment, { children: [
13301
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11840
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_react30.Fragment, { children: [
11841
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
13302
11842
  import_link.default,
13303
11843
  {
13304
11844
  href: crumb.link,
13305
- className: (0, import_clsx33.default)("btn-sm hover:bg-description/20", linkClassName, { [color]: !isLast }),
11845
+ className: (0, import_clsx32.default)("btn-sm hover:bg-description/20", linkClassName, { [color]: !isLast }),
13306
11846
  children: crumb.display
13307
11847
  }
13308
11848
  ),
13309
- !isLast && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: (0, import_clsx33.default)(`px-1`, color), children: "/" })
11849
+ !isLast && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: (0, import_clsx32.default)(`px-1`, color), children: "/" })
13310
11850
  ] }, index);
13311
11851
  }) });
13312
11852
  };
@@ -13316,8 +11856,8 @@ var import_lucide_react9 = require("lucide-react");
13316
11856
  var import_react31 = require("react");
13317
11857
  var import_react32 = require("react");
13318
11858
  var import_link2 = __toESM(require_link2());
13319
- var import_clsx34 = __toESM(require("clsx"));
13320
- var import_jsx_runtime50 = require("react/jsx-runtime");
11859
+ var import_clsx33 = __toESM(require("clsx"));
11860
+ var import_jsx_runtime43 = require("react/jsx-runtime");
13321
11861
  function isSubItem(item) {
13322
11862
  return "items" in item && Array.isArray(item.items);
13323
11863
  }
@@ -13344,8 +11884,8 @@ var NavigationItemWithSubItem = ({
13344
11884
  setOpen(false);
13345
11885
  }
13346
11886
  }, []);
13347
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
13348
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
11887
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
11888
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
13349
11889
  "button",
13350
11890
  {
13351
11891
  id: "navigation-" + id,
@@ -13360,11 +11900,11 @@ var NavigationItemWithSubItem = ({
13360
11900
  "aria-controls": "navigation-items-" + id,
13361
11901
  children: [
13362
11902
  label,
13363
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ExpansionIcon, { isExpanded: isOpen })
11903
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ExpansionIcon, { isExpanded: isOpen })
13364
11904
  ]
13365
11905
  }
13366
11906
  ),
13367
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
11907
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
13368
11908
  "ul",
13369
11909
  {
13370
11910
  id: "navigation-items-" + id,
@@ -13378,12 +11918,12 @@ var NavigationItemWithSubItem = ({
13378
11918
  },
13379
11919
  onBlur,
13380
11920
  hidden: !isOpen,
13381
- className: (0, import_clsx34.default)(
11921
+ className: (0, import_clsx33.default)(
13382
11922
  "fixed flex-col-4 p-4 bg-surface text-on-surface shadow-side shadow-hw-bottom rounded-md z-2001",
13383
11923
  { "opacity-0": !style }
13384
11924
  ),
13385
11925
  style,
13386
- children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
11926
+ children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
13387
11927
  import_link2.default,
13388
11928
  {
13389
11929
  href: link,
@@ -13397,7 +11937,7 @@ var NavigationItemWithSubItem = ({
13397
11937
  ] });
13398
11938
  };
13399
11939
  var NavigationItemList = ({ items, ...restProps }) => {
13400
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("ul", { ...restProps, className: (0, import_clsx34.default)("flex-row-6 items-center", restProps.className), children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("li", { children: isSubItem(item) ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(NavigationItemWithSubItem, { ...item }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_link2.default, { href: item.link, target: item.external ? "_blank" : void 0, className: "link", children: item.label }) }, index)) });
11940
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("ul", { ...restProps, className: (0, import_clsx33.default)("flex-row-6 items-center", restProps.className), children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("li", { children: isSubItem(item) ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NavigationItemWithSubItem, { ...item }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_link2.default, { href: item.link, target: item.external ? "_blank" : void 0, className: "link", children: item.label }) }, index)) });
13401
11941
  };
13402
11942
  var Navigation = ({ ...props }) => {
13403
11943
  const [isMobileOpen, setIsMobileOpen] = (0, import_react32.useState)(false);
@@ -13406,15 +11946,15 @@ var Navigation = ({ ...props }) => {
13406
11946
  (0, import_react31.useEffect)(() => {
13407
11947
  menuRef.current?.focus();
13408
11948
  }, [isMobileOpen]);
13409
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("nav", { children: [
13410
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
11949
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("nav", { children: [
11950
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
13411
11951
  NavigationItemList,
13412
11952
  {
13413
11953
  ...props,
13414
- className: (0, import_clsx34.default)("hidden", { "desktop:flex": !isMobileOpen }, props.className)
11954
+ className: (0, import_clsx33.default)("hidden", { "desktop:flex": !isMobileOpen }, props.className)
13415
11955
  }
13416
11956
  ),
13417
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
11957
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
13418
11958
  IconButton,
13419
11959
  {
13420
11960
  color: "transparent",
@@ -13423,10 +11963,10 @@ var Navigation = ({ ...props }) => {
13423
11963
  "aria-haspopup": "true",
13424
11964
  "aria-expanded": isMobileOpen,
13425
11965
  "aria-controls": "navigation-menu-" + id,
13426
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react9.Menu, { className: "w-6 h-6" })
11966
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react9.Menu, { className: "w-6 h-6" })
13427
11967
  }
13428
11968
  ),
13429
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
11969
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
13430
11970
  "div",
13431
11971
  {
13432
11972
  id: "navigation-menu-" + id,
@@ -13439,7 +11979,7 @@ var Navigation = ({ ...props }) => {
13439
11979
  event.stopPropagation();
13440
11980
  }
13441
11981
  },
13442
- className: (0, import_clsx34.default)(
11982
+ className: (0, import_clsx33.default)(
13443
11983
  "flex-col-8 items-center justify-center fixed inset-0 p-8 w-screen h-screen z-2000 bg-surface text-on-surface",
13444
11984
  {
13445
11985
  "desktop:hidden": isMobileOpen
@@ -13447,8 +11987,8 @@ var Navigation = ({ ...props }) => {
13447
11987
  props.className
13448
11988
  ),
13449
11989
  children: [
13450
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(IconButton, { color: "transparent", onClick: () => setIsMobileOpen(false), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react9.XIcon, {}) }),
13451
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(NavigationItemList, { ...props, className: (0, import_clsx34.default)("flex-col-8", props.className) })
11990
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(IconButton, { color: "transparent", onClick: () => setIsMobileOpen(false), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react9.XIcon, {}) }),
11991
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NavigationItemList, { ...props, className: (0, import_clsx33.default)("flex-col-8", props.className) })
13452
11992
  ]
13453
11993
  }
13454
11994
  )
@@ -13457,9 +11997,9 @@ var Navigation = ({ ...props }) => {
13457
11997
 
13458
11998
  // src/components/navigation/Pagination.tsx
13459
11999
  var import_lucide_react10 = require("lucide-react");
13460
- var import_clsx35 = __toESM(require("clsx"));
12000
+ var import_clsx34 = __toESM(require("clsx"));
13461
12001
  var import_react33 = require("react");
13462
- var import_jsx_runtime51 = require("react/jsx-runtime");
12002
+ var import_jsx_runtime44 = require("react/jsx-runtime");
13463
12003
  var Pagination = ({
13464
12004
  pageIndex,
13465
12005
  pageCount,
@@ -13482,16 +12022,16 @@ var Pagination = ({
13482
12022
  const changePage = (page) => {
13483
12023
  onPageChanged(page);
13484
12024
  };
13485
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: (0, import_clsx35.default)("flex-row-1", className), style, children: [
13486
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(IconButton, { color: "transparent", onClick: () => changePage(0), disabled: onFirstPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react10.ChevronFirst, {}) }),
13487
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(IconButton, { color: "transparent", onClick: () => changePage(pageIndex - 1), disabled: onFirstPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react10.ChevronLeft, {}) }),
13488
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex-row-2 min-w-56 items-center justify-center mx-2 text-center", children: [
13489
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
12025
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: (0, import_clsx34.default)("flex-row-1", className), style, children: [
12026
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(IconButton, { color: "transparent", onClick: () => changePage(0), disabled: onFirstPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.ChevronFirst, {}) }),
12027
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(IconButton, { color: "transparent", onClick: () => changePage(pageIndex - 1), disabled: onFirstPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.ChevronLeft, {}) }),
12028
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex-row-2 min-w-56 items-center justify-center mx-2 text-center", children: [
12029
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
13490
12030
  Input,
13491
12031
  {
13492
12032
  value,
13493
- className: (0, import_clsx35.default)(
13494
- "w-full text-center font-bold input-indicator-hidden h-10"
12033
+ className: (0, import_clsx34.default)(
12034
+ "w-24 text-center font-bold input-indicator-hidden h-10"
13495
12035
  ),
13496
12036
  type: "number",
13497
12037
  min: 1,
@@ -13510,24 +12050,24 @@ var Pagination = ({
13510
12050
  editCompleteOptions: { delay: 800 }
13511
12051
  }
13512
12052
  ),
13513
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "select-none w-10", children: translation("of") }),
13514
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
12053
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "select-none w-10", children: translation("of") }),
12054
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
13515
12055
  "span",
13516
12056
  {
13517
- className: "flex-row-2 flex-1 items-center justify-center select-none h-10 bg-input-background text-input-text rounded-md font-bold",
12057
+ className: "flex-row-2 w-24 items-center justify-center select-none h-10 bg-input-background text-input-text rounded-md font-bold",
13518
12058
  children: pageCount
13519
12059
  }
13520
12060
  )
13521
12061
  ] }),
13522
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(IconButton, { color: "transparent", onClick: () => changePage(pageIndex + 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react10.ChevronRight, {}) }),
13523
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(IconButton, { color: "transparent", onClick: () => changePage(pageCount - 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react10.ChevronLast, {}) })
12062
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(IconButton, { color: "transparent", onClick: () => changePage(pageIndex + 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.ChevronRight, {}) }),
12063
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(IconButton, { color: "transparent", onClick: () => changePage(pageCount - 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.ChevronLast, {}) })
13524
12064
  ] });
13525
12065
  };
13526
12066
 
13527
12067
  // src/components/navigation/StepperBar.tsx
13528
12068
  var import_lucide_react11 = require("lucide-react");
13529
- var import_clsx36 = __toESM(require("clsx"));
13530
- var import_jsx_runtime52 = require("react/jsx-runtime");
12069
+ var import_clsx35 = __toESM(require("clsx"));
12070
+ var import_jsx_runtime45 = require("react/jsx-runtime");
13531
12071
  var defaultState = {
13532
12072
  currentStep: 0,
13533
12073
  seenSteps: /* @__PURE__ */ new Set([0])
@@ -13549,12 +12089,12 @@ var StepperBar = ({
13549
12089
  seenSteps.add(newStep);
13550
12090
  onChange({ currentStep: newStep, seenSteps });
13551
12091
  };
13552
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
12092
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
13553
12093
  "div",
13554
12094
  {
13555
- className: (0, import_clsx36.default)("flex-row-2 justify-between", className),
12095
+ className: (0, import_clsx35.default)("flex-row-2 justify-between", className),
13556
12096
  children: [
13557
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex-row-2 flex-[2] justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
12097
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex-row-2 flex-[2] justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
13558
12098
  SolidButton,
13559
12099
  {
13560
12100
  disabled: currentStep === 0 || disabledSteps.has(currentStep),
@@ -13563,18 +12103,18 @@ var StepperBar = ({
13563
12103
  },
13564
12104
  className: "flex-row-1 items-center justify-center",
13565
12105
  children: [
13566
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react11.ChevronLeft, { size: 14 }),
12106
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.ChevronLeft, { size: 14 }),
13567
12107
  translation("back")
13568
12108
  ]
13569
12109
  }
13570
12110
  ) }),
13571
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex-row-2 flex-[5] justify-center items-center", children: showDots && dots.map((value, index) => {
12111
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex-row-2 flex-[5] justify-center items-center", children: showDots && dots.map((value, index) => {
13572
12112
  const seen = seenSteps.has(index);
13573
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
12113
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
13574
12114
  "div",
13575
12115
  {
13576
12116
  onClick: () => seen && update(index),
13577
- className: (0, import_clsx36.default)(
12117
+ className: (0, import_clsx35.default)(
13578
12118
  "rounded-full w-4 h-4",
13579
12119
  {
13580
12120
  "bg-stepperbar-dot-active hover:brightness-75": index === currentStep && seen && !disabledSteps.has(currentStep),
@@ -13590,7 +12130,7 @@ var StepperBar = ({
13590
12130
  index
13591
12131
  );
13592
12132
  }) }),
13593
- currentStep !== numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
12133
+ currentStep !== numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
13594
12134
  SolidButton,
13595
12135
  {
13596
12136
  onClick: () => update(currentStep + 1),
@@ -13598,18 +12138,18 @@ var StepperBar = ({
13598
12138
  disabled: disabledSteps.has(currentStep),
13599
12139
  children: [
13600
12140
  translation("next"),
13601
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react11.ChevronRight, { size: 14 })
12141
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.ChevronRight, { size: 14 })
13602
12142
  ]
13603
12143
  }
13604
12144
  ) }),
13605
- currentStep === numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
12145
+ currentStep === numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
13606
12146
  SolidButton,
13607
12147
  {
13608
12148
  disabled: disabledSteps.has(currentStep),
13609
12149
  onClick: onFinish,
13610
12150
  className: "flex-row-1 items-center justify-center",
13611
12151
  children: [
13612
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react11.Check, { size: 14 }),
12152
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Check, { size: 14 }),
13613
12153
  finishText ?? translation("confirm")
13614
12154
  ]
13615
12155
  }
@@ -13620,7 +12160,7 @@ var StepperBar = ({
13620
12160
  };
13621
12161
  var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
13622
12162
  const [usedState, setUsedState] = useOverwritableState(state, onChange);
13623
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
12163
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
13624
12164
  StepperBar,
13625
12165
  {
13626
12166
  ...props,
@@ -13635,392 +12175,8 @@ var import_lucide_react14 = require("lucide-react");
13635
12175
 
13636
12176
  // src/components/user-action/Checkbox.tsx
13637
12177
  var import_lucide_react12 = require("lucide-react");
13638
- var import_clsx37 = __toESM(require("clsx"));
13639
-
13640
- // node_modules/@radix-ui/react-checkbox/dist/index.mjs
13641
- var React19 = __toESM(require("react"), 1);
13642
-
13643
- // node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
13644
- var React16 = __toESM(require("react"), 1);
13645
- var React24 = __toESM(require("react"), 1);
13646
- var useInsertionEffect = React16[" useInsertionEffect ".trim().toString()] || useLayoutEffect22;
13647
- function useControllableState({
13648
- prop,
13649
- defaultProp,
13650
- onChange = () => {
13651
- },
13652
- caller
13653
- }) {
13654
- const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
13655
- defaultProp,
13656
- onChange
13657
- });
13658
- const isControlled = prop !== void 0;
13659
- const value = isControlled ? prop : uncontrolledProp;
13660
- if (true) {
13661
- const isControlledRef = React16.useRef(prop !== void 0);
13662
- React16.useEffect(() => {
13663
- const wasControlled = isControlledRef.current;
13664
- if (wasControlled !== isControlled) {
13665
- const from = wasControlled ? "controlled" : "uncontrolled";
13666
- const to = isControlled ? "controlled" : "uncontrolled";
13667
- console.warn(
13668
- `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
13669
- );
13670
- }
13671
- isControlledRef.current = isControlled;
13672
- }, [isControlled, caller]);
13673
- }
13674
- const setValue = React16.useCallback(
13675
- (nextValue) => {
13676
- if (isControlled) {
13677
- const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
13678
- if (value2 !== prop) {
13679
- onChangeRef.current?.(value2);
13680
- }
13681
- } else {
13682
- setUncontrolledProp(nextValue);
13683
- }
13684
- },
13685
- [isControlled, prop, setUncontrolledProp, onChangeRef]
13686
- );
13687
- return [value, setValue];
13688
- }
13689
- function useUncontrolledState({
13690
- defaultProp,
13691
- onChange
13692
- }) {
13693
- const [value, setValue] = React16.useState(defaultProp);
13694
- const prevValueRef = React16.useRef(value);
13695
- const onChangeRef = React16.useRef(onChange);
13696
- useInsertionEffect(() => {
13697
- onChangeRef.current = onChange;
13698
- }, [onChange]);
13699
- React16.useEffect(() => {
13700
- if (prevValueRef.current !== value) {
13701
- onChangeRef.current?.(value);
13702
- prevValueRef.current = value;
13703
- }
13704
- }, [value, prevValueRef]);
13705
- return [value, setValue, onChangeRef];
13706
- }
13707
- function isFunction(value) {
13708
- return typeof value === "function";
13709
- }
13710
- var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
13711
-
13712
- // node_modules/@radix-ui/react-use-previous/dist/index.mjs
13713
- var React17 = __toESM(require("react"), 1);
13714
- function usePrevious(value) {
13715
- const ref = React17.useRef({ value, previous: value });
13716
- return React17.useMemo(() => {
13717
- if (ref.current.value !== value) {
13718
- ref.current.previous = ref.current.value;
13719
- ref.current.value = value;
13720
- }
13721
- return ref.current.previous;
13722
- }, [value]);
13723
- }
13724
-
13725
- // node_modules/@radix-ui/react-use-size/dist/index.mjs
13726
- var React18 = __toESM(require("react"), 1);
13727
- function useSize(element) {
13728
- const [size, setSize] = React18.useState(void 0);
13729
- useLayoutEffect22(() => {
13730
- if (element) {
13731
- setSize({ width: element.offsetWidth, height: element.offsetHeight });
13732
- const resizeObserver = new ResizeObserver((entries) => {
13733
- if (!Array.isArray(entries)) {
13734
- return;
13735
- }
13736
- if (!entries.length) {
13737
- return;
13738
- }
13739
- const entry = entries[0];
13740
- let width;
13741
- let height;
13742
- if ("borderBoxSize" in entry) {
13743
- const borderSizeEntry = entry["borderBoxSize"];
13744
- const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
13745
- width = borderSize["inlineSize"];
13746
- height = borderSize["blockSize"];
13747
- } else {
13748
- width = element.offsetWidth;
13749
- height = element.offsetHeight;
13750
- }
13751
- setSize({ width, height });
13752
- });
13753
- resizeObserver.observe(element, { box: "border-box" });
13754
- return () => resizeObserver.unobserve(element);
13755
- } else {
13756
- setSize(void 0);
13757
- }
13758
- }, [element]);
13759
- return size;
13760
- }
13761
-
13762
- // node_modules/@radix-ui/react-checkbox/dist/index.mjs
13763
- var import_jsx_runtime53 = require("react/jsx-runtime");
13764
- var CHECKBOX_NAME = "Checkbox";
13765
- var [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);
13766
- var [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
13767
- function CheckboxProvider(props) {
13768
- const {
13769
- __scopeCheckbox,
13770
- checked: checkedProp,
13771
- children,
13772
- defaultChecked,
13773
- disabled,
13774
- form,
13775
- name,
13776
- onCheckedChange,
13777
- required,
13778
- value = "on",
13779
- // @ts-expect-error
13780
- internal_do_not_use_render
13781
- } = props;
13782
- const [checked, setChecked] = useControllableState({
13783
- prop: checkedProp,
13784
- defaultProp: defaultChecked ?? false,
13785
- onChange: onCheckedChange,
13786
- caller: CHECKBOX_NAME
13787
- });
13788
- const [control, setControl] = React19.useState(null);
13789
- const [bubbleInput, setBubbleInput] = React19.useState(null);
13790
- const hasConsumerStoppedPropagationRef = React19.useRef(false);
13791
- const isFormControl = control ? !!form || !!control.closest("form") : (
13792
- // We set this to true by default so that events bubble to forms without JS (SSR)
13793
- true
13794
- );
13795
- const context = {
13796
- checked,
13797
- disabled,
13798
- setChecked,
13799
- control,
13800
- setControl,
13801
- name,
13802
- form,
13803
- value,
13804
- hasConsumerStoppedPropagationRef,
13805
- required,
13806
- defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,
13807
- isFormControl,
13808
- bubbleInput,
13809
- setBubbleInput
13810
- };
13811
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
13812
- CheckboxProviderImpl,
13813
- {
13814
- scope: __scopeCheckbox,
13815
- ...context,
13816
- children: isFunction2(internal_do_not_use_render) ? internal_do_not_use_render(context) : children
13817
- }
13818
- );
13819
- }
13820
- var TRIGGER_NAME = "CheckboxTrigger";
13821
- var CheckboxTrigger = React19.forwardRef(
13822
- ({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) => {
13823
- const {
13824
- control,
13825
- value,
13826
- disabled,
13827
- checked,
13828
- required,
13829
- setControl,
13830
- setChecked,
13831
- hasConsumerStoppedPropagationRef,
13832
- isFormControl,
13833
- bubbleInput
13834
- } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);
13835
- const composedRefs = useComposedRefs(forwardedRef, setControl);
13836
- const initialCheckedStateRef = React19.useRef(checked);
13837
- React19.useEffect(() => {
13838
- const form = control?.form;
13839
- if (form) {
13840
- const reset = () => setChecked(initialCheckedStateRef.current);
13841
- form.addEventListener("reset", reset);
13842
- return () => form.removeEventListener("reset", reset);
13843
- }
13844
- }, [control, setChecked]);
13845
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
13846
- Primitive.button,
13847
- {
13848
- type: "button",
13849
- role: "checkbox",
13850
- "aria-checked": isIndeterminate(checked) ? "mixed" : checked,
13851
- "aria-required": required,
13852
- "data-state": getState(checked),
13853
- "data-disabled": disabled ? "" : void 0,
13854
- disabled,
13855
- value,
13856
- ...checkboxProps,
13857
- ref: composedRefs,
13858
- onKeyDown: composeEventHandlers(onKeyDown, (event) => {
13859
- if (event.key === "Enter") event.preventDefault();
13860
- }),
13861
- onClick: composeEventHandlers(onClick, (event) => {
13862
- setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked);
13863
- if (bubbleInput && isFormControl) {
13864
- hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
13865
- if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
13866
- }
13867
- })
13868
- }
13869
- );
13870
- }
13871
- );
13872
- CheckboxTrigger.displayName = TRIGGER_NAME;
13873
- var Checkbox = React19.forwardRef(
13874
- (props, forwardedRef) => {
13875
- const {
13876
- __scopeCheckbox,
13877
- name,
13878
- checked,
13879
- defaultChecked,
13880
- required,
13881
- disabled,
13882
- value,
13883
- onCheckedChange,
13884
- form,
13885
- ...checkboxProps
13886
- } = props;
13887
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
13888
- CheckboxProvider,
13889
- {
13890
- __scopeCheckbox,
13891
- checked,
13892
- defaultChecked,
13893
- disabled,
13894
- required,
13895
- onCheckedChange,
13896
- name,
13897
- form,
13898
- value,
13899
- internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
13900
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
13901
- CheckboxTrigger,
13902
- {
13903
- ...checkboxProps,
13904
- ref: forwardedRef,
13905
- __scopeCheckbox
13906
- }
13907
- ),
13908
- isFormControl && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
13909
- CheckboxBubbleInput,
13910
- {
13911
- __scopeCheckbox
13912
- }
13913
- )
13914
- ] })
13915
- }
13916
- );
13917
- }
13918
- );
13919
- Checkbox.displayName = CHECKBOX_NAME;
13920
- var INDICATOR_NAME = "CheckboxIndicator";
13921
- var CheckboxIndicator = React19.forwardRef(
13922
- (props, forwardedRef) => {
13923
- const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
13924
- const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);
13925
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
13926
- Presence,
13927
- {
13928
- present: forceMount || isIndeterminate(context.checked) || context.checked === true,
13929
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
13930
- Primitive.span,
13931
- {
13932
- "data-state": getState(context.checked),
13933
- "data-disabled": context.disabled ? "" : void 0,
13934
- ...indicatorProps,
13935
- ref: forwardedRef,
13936
- style: { pointerEvents: "none", ...props.style }
13937
- }
13938
- )
13939
- }
13940
- );
13941
- }
13942
- );
13943
- CheckboxIndicator.displayName = INDICATOR_NAME;
13944
- var BUBBLE_INPUT_NAME = "CheckboxBubbleInput";
13945
- var CheckboxBubbleInput = React19.forwardRef(
13946
- ({ __scopeCheckbox, ...props }, forwardedRef) => {
13947
- const {
13948
- control,
13949
- hasConsumerStoppedPropagationRef,
13950
- checked,
13951
- defaultChecked,
13952
- required,
13953
- disabled,
13954
- name,
13955
- value,
13956
- form,
13957
- bubbleInput,
13958
- setBubbleInput
13959
- } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);
13960
- const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);
13961
- const prevChecked = usePrevious(checked);
13962
- const controlSize = useSize(control);
13963
- React19.useEffect(() => {
13964
- const input = bubbleInput;
13965
- if (!input) return;
13966
- const inputProto = window.HTMLInputElement.prototype;
13967
- const descriptor = Object.getOwnPropertyDescriptor(
13968
- inputProto,
13969
- "checked"
13970
- );
13971
- const setChecked = descriptor.set;
13972
- const bubbles = !hasConsumerStoppedPropagationRef.current;
13973
- if (prevChecked !== checked && setChecked) {
13974
- const event = new Event("click", { bubbles });
13975
- input.indeterminate = isIndeterminate(checked);
13976
- setChecked.call(input, isIndeterminate(checked) ? false : checked);
13977
- input.dispatchEvent(event);
13978
- }
13979
- }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
13980
- const defaultCheckedRef = React19.useRef(isIndeterminate(checked) ? false : checked);
13981
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
13982
- Primitive.input,
13983
- {
13984
- type: "checkbox",
13985
- "aria-hidden": true,
13986
- defaultChecked: defaultChecked ?? defaultCheckedRef.current,
13987
- required,
13988
- disabled,
13989
- name,
13990
- value,
13991
- form,
13992
- ...props,
13993
- tabIndex: -1,
13994
- ref: composedRefs,
13995
- style: {
13996
- ...props.style,
13997
- ...controlSize,
13998
- position: "absolute",
13999
- pointerEvents: "none",
14000
- opacity: 0,
14001
- margin: 0,
14002
- // We transform because the input is absolutely positioned but we have
14003
- // rendered it **after** the button. This pulls it back to sit on top
14004
- // of the button.
14005
- transform: "translateX(-100%)"
14006
- }
14007
- }
14008
- );
14009
- }
14010
- );
14011
- CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;
14012
- function isFunction2(value) {
14013
- return typeof value === "function";
14014
- }
14015
- function isIndeterminate(checked) {
14016
- return checked === "indeterminate";
14017
- }
14018
- function getState(checked) {
14019
- return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
14020
- }
14021
-
14022
- // src/components/user-action/Checkbox.tsx
14023
- var import_jsx_runtime54 = require("react/jsx-runtime");
12178
+ var import_clsx36 = __toESM(require("clsx"));
12179
+ var import_jsx_runtime46 = require("react/jsx-runtime");
14024
12180
  var checkboxSizeMapping = {
14025
12181
  sm: "size-5 border-1",
14026
12182
  md: "size-6 border-1",
@@ -14031,25 +12187,36 @@ var checkboxIconSizeMapping = {
14031
12187
  md: "size-5 stroke-3",
14032
12188
  lg: "size-7 stroke-3"
14033
12189
  };
14034
- var Checkbox2 = ({
12190
+ var Checkbox = ({
14035
12191
  disabled,
14036
12192
  checked = false,
14037
12193
  indeterminate = false,
14038
- onChange,
12194
+ onCheckedChange,
14039
12195
  size = "md",
14040
12196
  className = "",
14041
12197
  ...props
14042
12198
  }) => {
14043
12199
  const usedSizeClass = checkboxSizeMapping[size];
14044
12200
  const innerIconSize = checkboxIconSizeMapping[size];
14045
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14046
- Checkbox,
12201
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
12202
+ "div",
14047
12203
  {
14048
12204
  ...props,
14049
- disabled,
14050
- checked: indeterminate ? "indeterminate" : checked,
14051
- onCheckedChange: onChange,
14052
- className: (0, import_clsx37.default)(
12205
+ onClick: (event) => {
12206
+ if (!disabled) {
12207
+ onCheckedChange(!checked);
12208
+ props.onClick?.(event);
12209
+ }
12210
+ },
12211
+ onKeyDown: (event) => {
12212
+ if (disabled) return;
12213
+ if (event.key === " " || event.key === "Enter") {
12214
+ event.preventDefault();
12215
+ onCheckedChange(!checked);
12216
+ props.onKeyDown?.(event);
12217
+ }
12218
+ },
12219
+ className: (0, import_clsx36.default)(
14053
12220
  usedSizeClass,
14054
12221
  `flex-col-0 items-center justify-center rounded`,
14055
12222
  {
@@ -14060,34 +12227,38 @@ var Checkbox2 = ({
14060
12227
  },
14061
12228
  className
14062
12229
  ),
14063
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(CheckboxIndicator, { children: [
14064
- !checked && !indeterminate && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: (0, import_clsx37.default)("bg-input-background", innerIconSize) }),
14065
- checked && !indeterminate && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react12.Check, { className: innerIconSize }),
14066
- indeterminate && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react12.Minus, { className: innerIconSize })
14067
- ] })
12230
+ role: "checkbox",
12231
+ "aria-checked": indeterminate ? "mixed" : checked,
12232
+ "aria-disabled": disabled,
12233
+ tabIndex: disabled ? -1 : 0,
12234
+ children: [
12235
+ !checked && !indeterminate && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: (0, import_clsx36.default)("bg-input-background", innerIconSize) }),
12236
+ checked && !indeterminate && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Check, { className: innerIconSize }),
12237
+ indeterminate && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Minus, { className: innerIconSize })
12238
+ ]
14068
12239
  }
14069
12240
  );
14070
12241
  };
14071
12242
  var CheckboxUncontrolled = ({
14072
12243
  checked: initialChecked,
14073
- onChange,
12244
+ onCheckedChange,
14074
12245
  ...props
14075
12246
  }) => {
14076
- const [checked, setChecked] = useOverwritableState(initialChecked, onChange);
14077
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14078
- Checkbox2,
12247
+ const [checked, setChecked] = useOverwritableState(initialChecked, onCheckedChange);
12248
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
12249
+ Checkbox,
14079
12250
  {
14080
12251
  ...props,
14081
12252
  checked,
14082
- onChange: setChecked
12253
+ onCheckedChange: setChecked
14083
12254
  }
14084
12255
  );
14085
12256
  };
14086
12257
 
14087
12258
  // src/components/properties/PropertyBase.tsx
14088
12259
  var import_lucide_react13 = require("lucide-react");
14089
- var import_clsx38 = __toESM(require("clsx"));
14090
- var import_jsx_runtime55 = require("react/jsx-runtime");
12260
+ var import_clsx37 = __toESM(require("clsx"));
12261
+ var import_jsx_runtime47 = require("react/jsx-runtime");
14091
12262
  var PropertyBase = ({
14092
12263
  name,
14093
12264
  input,
@@ -14100,11 +12271,11 @@ var PropertyBase = ({
14100
12271
  }) => {
14101
12272
  const translation = useHightideTranslation();
14102
12273
  const requiredAndNoValue = softRequired && !hasValue;
14103
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: (0, import_clsx38.default)("flex-row-0 group", className), children: [
14104
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
12274
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: (0, import_clsx37.default)("flex-row-0 group", className), children: [
12275
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
14105
12276
  "div",
14106
12277
  {
14107
- className: (0, import_clsx38.default)(
12278
+ className: (0, import_clsx37.default)(
14108
12279
  "flex-row-2 max-w-48 min-w-48 px-3 py-2 items-center rounded-l-xl border-2 border-r-0",
14109
12280
  {
14110
12281
  "bg-property-title-background text-property-title-text group-hover:border-primary": !requiredAndNoValue,
@@ -14113,15 +12284,15 @@ var PropertyBase = ({
14113
12284
  className
14114
12285
  ),
14115
12286
  children: [
14116
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "max-w-6 min-w-6 text-text-primary", children: icon }),
14117
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "font-semibold", children: name })
12287
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "max-w-6 min-w-6 text-text-primary", children: icon }),
12288
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "font-semibold", children: name })
14118
12289
  ]
14119
12290
  }
14120
12291
  ),
14121
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
12292
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
14122
12293
  "div",
14123
12294
  {
14124
- className: (0, import_clsx38.default)(
12295
+ className: (0, import_clsx37.default)(
14125
12296
  "flex-row-2 grow px-3 py-2 justify-between items-center rounded-r-xl border-2 border-l-0 min-h-15",
14126
12297
  {
14127
12298
  "bg-input-background text-input-text group-hover:border-primary": !requiredAndNoValue,
@@ -14131,13 +12302,13 @@ var PropertyBase = ({
14131
12302
  ),
14132
12303
  children: [
14133
12304
  input({ softRequired, hasValue }),
14134
- requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "text-warning", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react13.AlertTriangle, { size: 24 }) }),
14135
- onRemove && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
12305
+ requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "text-warning", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react13.AlertTriangle, { size: 24 }) }),
12306
+ onRemove && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
14136
12307
  TextButton,
14137
12308
  {
14138
12309
  onClick: onRemove,
14139
12310
  color: "negative",
14140
- className: (0, import_clsx38.default)("items-center"),
12311
+ className: (0, import_clsx37.default)("items-center"),
14141
12312
  disabled: !hasValue,
14142
12313
  children: translation("remove")
14143
12314
  }
@@ -14150,7 +12321,7 @@ var PropertyBase = ({
14150
12321
 
14151
12322
  // src/components/properties/CheckboxProperty.tsx
14152
12323
  var import_react34 = require("react");
14153
- var import_jsx_runtime56 = require("react/jsx-runtime");
12324
+ var import_jsx_runtime48 = require("react/jsx-runtime");
14154
12325
  var CheckboxProperty = ({
14155
12326
  value,
14156
12327
  onChange,
@@ -14159,25 +12330,25 @@ var CheckboxProperty = ({
14159
12330
  }) => {
14160
12331
  const translation = useHightideTranslation();
14161
12332
  const id = (0, import_react34.useId)();
14162
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
12333
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14163
12334
  PropertyBase,
14164
12335
  {
14165
12336
  ...baseProps,
14166
12337
  hasValue: true,
14167
12338
  readOnly,
14168
- icon: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react14.Check, { size: 24 }),
14169
- input: () => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex-row-2 items-center", children: [
14170
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
14171
- Checkbox2,
12339
+ icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react14.Check, { size: 24 }),
12340
+ input: () => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex-row-2 items-center", children: [
12341
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
12342
+ Checkbox,
14172
12343
  {
14173
12344
  id,
14174
12345
  checked: value ?? true,
14175
12346
  disabled: readOnly,
14176
- onChange,
12347
+ onCheckedChange: onChange,
14177
12348
  "aria-labelledby": id + "label"
14178
12349
  }
14179
12350
  ),
14180
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label, { id: id + "label", children: `${translation("yes")}/${translation("no")}` })
12351
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Label, { id: id + "label", children: `${translation("yes")}/${translation("no")}` })
14181
12352
  ] })
14182
12353
  }
14183
12354
  );
@@ -14185,8 +12356,8 @@ var CheckboxProperty = ({
14185
12356
 
14186
12357
  // src/components/properties/DateProperty.tsx
14187
12358
  var import_lucide_react15 = require("lucide-react");
14188
- var import_clsx39 = __toESM(require("clsx"));
14189
- var import_jsx_runtime57 = require("react/jsx-runtime");
12359
+ var import_clsx38 = __toESM(require("clsx"));
12360
+ var import_jsx_runtime49 = require("react/jsx-runtime");
14190
12361
  var DateProperty = ({
14191
12362
  value,
14192
12363
  onChange,
@@ -14197,16 +12368,16 @@ var DateProperty = ({
14197
12368
  }) => {
14198
12369
  const hasValue = !!value;
14199
12370
  const dateText = value ? type === "dateTime" ? formatDateTime(value) : formatDate(value) : "";
14200
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
12371
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
14201
12372
  PropertyBase,
14202
12373
  {
14203
12374
  ...baseProps,
14204
12375
  hasValue,
14205
- icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react15.CalendarDays, { size: 24 }),
14206
- input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
12376
+ icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react15.CalendarDays, { size: 24 }),
12377
+ input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
14207
12378
  Input,
14208
12379
  {
14209
- className: (0, import_clsx39.default)("!ring-0 !border-0 !outline-0 !p-0 !m-0 !shadow-none !w-fit !rounded-none", { "bg-surface-warning": softRequired && !hasValue }),
12380
+ className: (0, import_clsx38.default)("!ring-0 !border-0 !outline-0 !p-0 !m-0 !shadow-none !w-fit !rounded-none", { "bg-surface-warning": softRequired && !hasValue }),
14210
12381
  value: dateText,
14211
12382
  type: type === "dateTime" ? "datetime-local" : "date",
14212
12383
  readOnly,
@@ -14228,8 +12399,8 @@ var DateProperty = ({
14228
12399
 
14229
12400
  // src/components/properties/MultiSelectProperty.tsx
14230
12401
  var import_lucide_react16 = require("lucide-react");
14231
- var import_clsx40 = __toESM(require("clsx"));
14232
- var import_jsx_runtime58 = require("react/jsx-runtime");
12402
+ var import_clsx39 = __toESM(require("clsx"));
12403
+ var import_jsx_runtime50 = require("react/jsx-runtime");
14233
12404
  var MultiSelectProperty = ({
14234
12405
  children,
14235
12406
  values,
@@ -14237,25 +12408,25 @@ var MultiSelectProperty = ({
14237
12408
  ...props
14238
12409
  }) => {
14239
12410
  const hasValue = values.length > 0;
14240
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
12411
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14241
12412
  PropertyBase,
14242
12413
  {
14243
12414
  ...props,
14244
12415
  hasValue,
14245
- icon: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react16.List, { size: 24 }),
14246
- input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
12416
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react16.List, { size: 24 }),
12417
+ input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14247
12418
  MultiSelectChipDisplay,
14248
12419
  {
14249
12420
  values,
14250
12421
  onValuesChanged,
14251
12422
  disabled: props.readOnly,
14252
12423
  contentPanelProps: {
14253
- className: (0, import_clsx40.default)(
12424
+ className: (0, import_clsx39.default)(
14254
12425
  "!border-none !min-h-10"
14255
12426
  )
14256
12427
  },
14257
12428
  chipDisplayProps: {
14258
- className: (0, import_clsx40.default)({
12429
+ className: (0, import_clsx39.default)({
14259
12430
  "!bg-warning !text-surface-warning": softRequired && !hasValue
14260
12431
  })
14261
12432
  },
@@ -14268,8 +12439,8 @@ var MultiSelectProperty = ({
14268
12439
 
14269
12440
  // src/components/properties/NumberProperty.tsx
14270
12441
  var import_lucide_react17 = require("lucide-react");
14271
- var import_clsx41 = __toESM(require("clsx"));
14272
- var import_jsx_runtime59 = require("react/jsx-runtime");
12442
+ var import_clsx40 = __toESM(require("clsx"));
12443
+ var import_jsx_runtime51 = require("react/jsx-runtime");
14273
12444
  var NumberProperty = ({
14274
12445
  value,
14275
12446
  onChange,
@@ -14281,22 +12452,22 @@ var NumberProperty = ({
14281
12452
  }) => {
14282
12453
  const translation = useHightideTranslation();
14283
12454
  const hasValue = value !== void 0;
14284
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
12455
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
14285
12456
  PropertyBase,
14286
12457
  {
14287
12458
  ...baseProps,
14288
12459
  onRemove,
14289
12460
  hasValue,
14290
- icon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react17.Binary, { size: 24 }),
14291
- input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
12461
+ icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react17.Binary, { size: 24 }),
12462
+ input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
14292
12463
  "div",
14293
12464
  {
14294
- className: (0, import_clsx41.default)("flex-row-2 grow", { "text-warning": softRequired && !hasValue }),
12465
+ className: (0, import_clsx40.default)("flex-row-2 grow", { "text-warning": softRequired && !hasValue }),
14295
12466
  children: [
14296
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
12467
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
14297
12468
  Input,
14298
12469
  {
14299
- className: (0, import_clsx41.default)("!ring-0 !border-0 !outline-0 !p-0 !m-0 !w-fit !shadow-none !rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
12470
+ className: (0, import_clsx40.default)("!ring-0 !border-0 !outline-0 !p-0 !m-0 !w-fit !shadow-none !rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
14300
12471
  value: value?.toString() ?? "",
14301
12472
  type: "number",
14302
12473
  readOnly,
@@ -14319,7 +12490,7 @@ var NumberProperty = ({
14319
12490
  }
14320
12491
  }
14321
12492
  ),
14322
- suffix && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: (0, import_clsx41.default)("ml-1", { "bg-surface-warning": softRequired && !hasValue }), children: suffix })
12493
+ suffix && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: (0, import_clsx40.default)("ml-1", { "bg-surface-warning": softRequired && !hasValue }), children: suffix })
14323
12494
  ]
14324
12495
  }
14325
12496
  )
@@ -14329,8 +12500,8 @@ var NumberProperty = ({
14329
12500
 
14330
12501
  // src/components/properties/SelectProperty.tsx
14331
12502
  var import_lucide_react18 = require("lucide-react");
14332
- var import_clsx42 = __toESM(require("clsx"));
14333
- var import_jsx_runtime60 = require("react/jsx-runtime");
12503
+ var import_clsx41 = __toESM(require("clsx"));
12504
+ var import_jsx_runtime52 = require("react/jsx-runtime");
14334
12505
  var SingleSelectProperty = ({
14335
12506
  children,
14336
12507
  value,
@@ -14339,20 +12510,20 @@ var SingleSelectProperty = ({
14339
12510
  ...props
14340
12511
  }) => {
14341
12512
  const hasValue = value !== void 0;
14342
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
12513
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
14343
12514
  PropertyBase,
14344
12515
  {
14345
12516
  ...props,
14346
12517
  hasValue,
14347
- icon: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react18.List, { size: 24 }),
14348
- input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
12518
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react18.List, { size: 24 }),
12519
+ input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
14349
12520
  Select,
14350
12521
  {
14351
12522
  value,
14352
12523
  onValueChanged,
14353
12524
  disabled: props.readOnly,
14354
12525
  buttonProps: {
14355
- className: (0, import_clsx42.default)(
12526
+ className: (0, import_clsx41.default)(
14356
12527
  "border-none w-full",
14357
12528
  {
14358
12529
  "!bg-warning !text-surface-warning": softRequired && !hasValue
@@ -14369,12 +12540,12 @@ var SingleSelectProperty = ({
14369
12540
 
14370
12541
  // src/components/properties/TextProperty.tsx
14371
12542
  var import_lucide_react19 = require("lucide-react");
14372
- var import_clsx44 = __toESM(require("clsx"));
12543
+ var import_clsx43 = __toESM(require("clsx"));
14373
12544
 
14374
12545
  // src/components/user-action/Textarea.tsx
14375
12546
  var import_react35 = require("react");
14376
- var import_clsx43 = __toESM(require("clsx"));
14377
- var import_jsx_runtime61 = require("react/jsx-runtime");
12547
+ var import_clsx42 = __toESM(require("clsx"));
12548
+ var import_jsx_runtime53 = require("react/jsx-runtime");
14378
12549
  var Textarea = (0, import_react35.forwardRef)(function Textarea2({
14379
12550
  id,
14380
12551
  onChange,
@@ -14393,12 +12564,12 @@ var Textarea = (0, import_react35.forwardRef)(function Textarea2({
14393
12564
  onEditCompleted?.(text);
14394
12565
  clearTimer();
14395
12566
  };
14396
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
12567
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14397
12568
  "textarea",
14398
12569
  {
14399
12570
  ref,
14400
12571
  id,
14401
- className: (0, import_clsx43.default)(
12572
+ className: (0, import_clsx42.default)(
14402
12573
  "resize-none w-full h-32 overflow-y-scroll",
14403
12574
  "py-2 px-3 rounded-md border-2 border-transparent focus-style-none",
14404
12575
  {
@@ -14431,7 +12602,7 @@ var TextareaUncontrolled = ({
14431
12602
  ...props
14432
12603
  }) => {
14433
12604
  const [text, setText] = useOverwritableState(value, onChangeText);
14434
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
12605
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14435
12606
  Textarea,
14436
12607
  {
14437
12608
  ...props,
@@ -14451,10 +12622,10 @@ var TextareaWithHeadline = ({
14451
12622
  }) => {
14452
12623
  const genId = (0, import_react35.useId)();
14453
12624
  const usedId = id ?? genId;
14454
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
12625
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
14455
12626
  "div",
14456
12627
  {
14457
- className: (0, import_clsx43.default)(
12628
+ className: (0, import_clsx42.default)(
14458
12629
  "group flex-col-3 border-2 rounded-lg",
14459
12630
  {
14460
12631
  "bg-input-background text-input-text hover:border-primary focus-within:border-primary": !disabled,
@@ -14463,13 +12634,13 @@ var TextareaWithHeadline = ({
14463
12634
  containerClassName
14464
12635
  ),
14465
12636
  children: [
14466
- headline && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Label, { size: "md", ...headlineProps, htmlFor: usedId, children: headline }),
14467
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
12637
+ headline && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Label, { size: "md", ...headlineProps, htmlFor: usedId, children: headline }),
12638
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14468
12639
  Textarea,
14469
12640
  {
14470
12641
  ...props,
14471
12642
  id: usedId,
14472
- className: (0, import_clsx43.default)(
12643
+ className: (0, import_clsx42.default)(
14473
12644
  "border-transparent focus:ring-0 focus-visible:ring-0 resize-none h-32",
14474
12645
  className
14475
12646
  ),
@@ -14482,7 +12653,7 @@ var TextareaWithHeadline = ({
14482
12653
  };
14483
12654
 
14484
12655
  // src/components/properties/TextProperty.tsx
14485
- var import_jsx_runtime62 = require("react/jsx-runtime");
12656
+ var import_jsx_runtime54 = require("react/jsx-runtime");
14486
12657
  var TextProperty = ({
14487
12658
  value,
14488
12659
  readOnly,
@@ -14493,17 +12664,17 @@ var TextProperty = ({
14493
12664
  }) => {
14494
12665
  const translation = useHightideTranslation();
14495
12666
  const hasValue = value !== void 0;
14496
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
12667
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14497
12668
  PropertyBase,
14498
12669
  {
14499
12670
  ...baseProps,
14500
12671
  onRemove,
14501
12672
  hasValue,
14502
- icon: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react19.Text, { size: 24 }),
14503
- input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
12673
+ icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react19.Text, { size: 24 }),
12674
+ input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14504
12675
  Textarea,
14505
12676
  {
14506
- className: (0, import_clsx44.default)({
12677
+ className: (0, import_clsx43.default)({
14507
12678
  "bg-surface-warning placeholder-warning": softRequired && !hasValue
14508
12679
  }),
14509
12680
  rows: 5,
@@ -14532,12 +12703,12 @@ var TextProperty = ({
14532
12703
  };
14533
12704
 
14534
12705
  // src/components/table/FillerRowElement.tsx
14535
- var import_clsx45 = require("clsx");
14536
- var import_jsx_runtime63 = require("react/jsx-runtime");
12706
+ var import_clsx44 = require("clsx");
12707
+ var import_jsx_runtime55 = require("react/jsx-runtime");
14537
12708
  var FillerRowElement = ({
14538
12709
  className
14539
12710
  }) => {
14540
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: (0, import_clsx45.clsx)("flex flex-row items-center w-1/2 h-4 text-disabled font-bold", className), children: "-" });
12711
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: (0, import_clsx44.clsx)("flex flex-row items-center w-1/2 h-4 text-disabled font-bold", className), children: "-" });
14541
12712
  };
14542
12713
 
14543
12714
  // src/components/table/Filter.ts
@@ -14556,18 +12727,18 @@ var TableFilters = {
14556
12727
 
14557
12728
  // src/components/table/Table.tsx
14558
12729
  var import_react41 = require("react");
14559
- var import_clsx49 = __toESM(require("clsx"));
12730
+ var import_clsx48 = __toESM(require("clsx"));
14560
12731
  var import_react_table = require("@tanstack/react-table");
14561
12732
  var import_react_custom_scrollbars_23 = require("react-custom-scrollbars-2");
14562
12733
 
14563
12734
  // src/components/table/TableCell.tsx
14564
- var import_clsx46 = require("clsx");
14565
- var import_jsx_runtime64 = require("react/jsx-runtime");
12735
+ var import_clsx45 = require("clsx");
12736
+ var import_jsx_runtime56 = require("react/jsx-runtime");
14566
12737
  var TableCell = ({
14567
12738
  children,
14568
12739
  className
14569
12740
  }) => {
14570
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: (0, import_clsx46.clsx)("block max-w-full overflow-ellipsis truncate", className), children });
12741
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: (0, import_clsx45.clsx)("block max-w-full overflow-ellipsis truncate", className), children });
14571
12742
  };
14572
12743
 
14573
12744
  // src/hooks/useResizeCallbackWrapper.ts
@@ -14583,8 +12754,8 @@ var useResizeCallbackWrapper = (callback) => {
14583
12754
 
14584
12755
  // src/components/table/TableSortButton.tsx
14585
12756
  var import_lucide_react20 = require("lucide-react");
14586
- var import_clsx47 = __toESM(require("clsx"));
14587
- var import_jsx_runtime65 = require("react/jsx-runtime");
12757
+ var import_clsx46 = __toESM(require("clsx"));
12758
+ var import_jsx_runtime57 = require("react/jsx-runtime");
14588
12759
  var TableSortButton = ({
14589
12760
  sortDirection,
14590
12761
  invert = false,
@@ -14592,20 +12763,20 @@ var TableSortButton = ({
14592
12763
  className,
14593
12764
  ...buttonProps
14594
12765
  }) => {
14595
- let icon = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react20.ChevronsUpDown, { className: "w-full h-full" });
12766
+ let icon = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react20.ChevronsUpDown, { className: "w-full h-full" });
14596
12767
  if (sortDirection) {
14597
12768
  let usedSortDirection = sortDirection;
14598
12769
  if (invert) {
14599
12770
  usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
14600
12771
  }
14601
- icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react20.ChevronUp, { className: "w-full h-full" }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react20.ChevronDown, { className: "w-full h-full" });
12772
+ icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react20.ChevronUp, { className: "w-full h-full" }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react20.ChevronDown, { className: "w-full h-full" });
14602
12773
  }
14603
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
12774
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
14604
12775
  IconButton,
14605
12776
  {
14606
12777
  size: "tiny",
14607
12778
  color,
14608
- className: (0, import_clsx47.default)(className),
12779
+ className: (0, import_clsx46.default)(className),
14609
12780
  ...buttonProps,
14610
12781
  children: icon
14611
12782
  }
@@ -14617,7 +12788,7 @@ var import_lucide_react21 = require("lucide-react");
14617
12788
 
14618
12789
  // src/components/user-action/Menu.tsx
14619
12790
  var import_react39 = require("react");
14620
- var import_clsx48 = __toESM(require("clsx"));
12791
+ var import_clsx47 = __toESM(require("clsx"));
14621
12792
 
14622
12793
  // src/utils/bagFunctions.ts
14623
12794
  var resolve = (children, bag) => {
@@ -14752,17 +12923,17 @@ var useOutsideClick = (refs, handler) => {
14752
12923
  };
14753
12924
 
14754
12925
  // src/components/user-action/Menu.tsx
14755
- var import_jsx_runtime66 = require("react/jsx-runtime");
12926
+ var import_jsx_runtime58 = require("react/jsx-runtime");
14756
12927
  var MenuItem = ({
14757
12928
  children,
14758
12929
  onClick,
14759
12930
  alignment = "left",
14760
12931
  isDisabled = false,
14761
12932
  className
14762
- }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
12933
+ }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
14763
12934
  "div",
14764
12935
  {
14765
- className: (0, import_clsx48.default)("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
12936
+ className: (0, import_clsx47.default)("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
14766
12937
  "text-right": alignment === "right",
14767
12938
  "text-left": alignment === "left",
14768
12939
  "text-disabled cursor-not-allowed": isDisabled,
@@ -14828,14 +12999,14 @@ var Menu = ({
14828
12999
  setIsHidden(false);
14829
13000
  }
14830
13001
  }, [isOpen]);
14831
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
13002
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
14832
13003
  trigger(bag, triggerRef),
14833
- (0, import_react_dom4.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
13004
+ (0, import_react_dom4.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
14834
13005
  "div",
14835
13006
  {
14836
13007
  ref: menuRef,
14837
13008
  onClick: (e) => e.stopPropagation(),
14838
- className: (0, import_clsx48.default)(
13009
+ className: (0, import_clsx47.default)(
14839
13010
  "absolute rounded-md bg-menu-background text-menu-text shadow-around-lg shadow-strong z-[300]",
14840
13011
  {
14841
13012
  "animate-pop-in": isOpen,
@@ -14860,7 +13031,7 @@ var Menu = ({
14860
13031
 
14861
13032
  // src/components/table/TableFilterButton.tsx
14862
13033
  var import_react40 = require("react");
14863
- var import_jsx_runtime67 = require("react/jsx-runtime");
13034
+ var import_jsx_runtime59 = require("react/jsx-runtime");
14864
13035
  var TableFilterButton = ({
14865
13036
  filterType,
14866
13037
  column
@@ -14872,12 +13043,12 @@ var TableFilterButton = ({
14872
13043
  (0, import_react40.useEffect)(() => {
14873
13044
  setFilterValue(columnFilterValue);
14874
13045
  }, [columnFilterValue]);
14875
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
13046
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
14876
13047
  Menu,
14877
13048
  {
14878
- trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { ref, className: "relative", children: [
14879
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(IconButton, { color: "neutral", size: "tiny", onClick: toggleOpen, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react21.FilterIcon, {}) }),
14880
- hasFilter && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
13049
+ trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { ref, className: "relative", children: [
13050
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(IconButton, { color: "neutral", size: "tiny", onClick: toggleOpen, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react21.FilterIcon, {}) }),
13051
+ hasFilter && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
14881
13052
  "div",
14882
13053
  {
14883
13054
  className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary pointer-events-none",
@@ -14885,9 +13056,9 @@ var TableFilterButton = ({
14885
13056
  }
14886
13057
  )
14887
13058
  ] }),
14888
- children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
14889
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("h4", { className: "typography-label-md-semibold", children: translation("filter") }),
14890
- filterType === "text" && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
13059
+ children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
13060
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h4", { className: "typography-label-md-semibold", children: translation("filter") }),
13061
+ filterType === "text" && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
14891
13062
  Input,
14892
13063
  {
14893
13064
  value: filterValue ?? "",
@@ -14897,8 +13068,8 @@ var TableFilterButton = ({
14897
13068
  className: "h-10"
14898
13069
  }
14899
13070
  ),
14900
- filterType === "range" && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-2 items-center", children: [
14901
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
13071
+ filterType === "range" && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex-row-2 items-center", children: [
13072
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
14902
13073
  Input,
14903
13074
  {
14904
13075
  value: filterValue?.[0] ?? "",
@@ -14911,8 +13082,8 @@ var TableFilterButton = ({
14911
13082
  className: "h-10 input-indicator-hidden w-40"
14912
13083
  }
14913
13084
  ),
14914
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "font-bold", children: "-" }),
14915
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
13085
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "font-bold", children: "-" }),
13086
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
14916
13087
  Input,
14917
13088
  {
14918
13089
  value: filterValue?.[1] ?? "",
@@ -14926,8 +13097,8 @@ var TableFilterButton = ({
14926
13097
  }
14927
13098
  )
14928
13099
  ] }),
14929
- filterType === "dateRange" && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
14930
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
13100
+ filterType === "dateRange" && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
13101
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
14931
13102
  Input,
14932
13103
  {
14933
13104
  value: filterValue?.[0] ? filterValue?.[0].toISOString().slice(0, 16) : "",
@@ -14940,7 +13111,7 @@ var TableFilterButton = ({
14940
13111
  className: "h-10 w-50"
14941
13112
  }
14942
13113
  ),
14943
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
13114
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
14944
13115
  Input,
14945
13116
  {
14946
13117
  value: filterValue?.[1] ? filterValue?.[1].toISOString().slice(0, 16) : "",
@@ -14954,12 +13125,12 @@ var TableFilterButton = ({
14954
13125
  }
14955
13126
  )
14956
13127
  ] }),
14957
- /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-2 justify-end w-full", children: [
14958
- hasFilter && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SolidButton, { color: "negative", size: "small", onClick: () => {
13128
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex-row-2 justify-end w-full", children: [
13129
+ hasFilter && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SolidButton, { color: "negative", size: "small", onClick: () => {
14959
13130
  column.setFilterValue(void 0);
14960
13131
  close();
14961
13132
  }, children: translation("remove") }),
14962
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SolidButton, { size: "small", onClick: () => {
13133
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SolidButton, { size: "small", onClick: () => {
14963
13134
  column.setFilterValue(filterValue);
14964
13135
  close();
14965
13136
  }, children: translation("apply") })
@@ -14970,7 +13141,7 @@ var TableFilterButton = ({
14970
13141
  };
14971
13142
 
14972
13143
  // src/components/table/Table.tsx
14973
- var import_jsx_runtime68 = require("react/jsx-runtime");
13144
+ var import_jsx_runtime60 = require("react/jsx-runtime");
14974
13145
  var Table = ({
14975
13146
  data,
14976
13147
  fillerRow,
@@ -15089,7 +13260,7 @@ var Table = ({
15089
13260
  minSize: 60,
15090
13261
  maxSize: 700,
15091
13262
  cell: ({ cell }) => {
15092
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableCell, { children: cell.getValue() });
13263
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TableCell, { children: cell.getValue() });
15093
13264
  },
15094
13265
  ...defaultColumn
15095
13266
  },
@@ -15174,24 +13345,25 @@ var Table = ({
15174
13345
  }
15175
13346
  return colSizes;
15176
13347
  }, [table.getState().columnSizingInfo, table.getState().columnSizing]);
15177
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { ref, className: (0, import_clsx49.default)("flex-col-4", className), children: [
15178
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
13348
+ console.log(table.getState().sorting);
13349
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { ref, className: (0, import_clsx48.default)("flex-col-4", className), children: [
13350
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
15179
13351
  import_react_custom_scrollbars_23.Scrollbars,
15180
13352
  {
15181
13353
  autoHeight: true,
15182
13354
  autoHeightMax: tableRef.current?.offsetHeight ? tableRef.current?.offsetHeight + 2 : void 0,
15183
13355
  autoHide: true,
15184
- children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
13356
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
15185
13357
  "table",
15186
13358
  {
15187
13359
  ref: tableRef,
15188
- className: (0, import_clsx49.default)(tableClassName),
13360
+ className: (0, import_clsx48.default)(tableClassName),
15189
13361
  style: {
15190
13362
  ...columnSizeVars,
15191
13363
  width: Math.floor(Math.max(table.getTotalSize() - columns.length, ref.current?.offsetWidth ?? table.getTotalSize()))
15192
13364
  },
15193
13365
  children: [
15194
- table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
13366
+ table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
15195
13367
  "col",
15196
13368
  {
15197
13369
  style: {
@@ -15202,22 +13374,38 @@ var Table = ({
15202
13374
  },
15203
13375
  header.id
15204
13376
  )) }, headerGroup.id)),
15205
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("tr", { className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
15206
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
13377
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
13378
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
15207
13379
  "th",
15208
13380
  {
15209
13381
  colSpan: header.colSpan,
15210
- className: (0, import_clsx49.default)("relative group", header.column.columnDef.meta?.className),
13382
+ className: (0, import_clsx48.default)("relative group", header.column.columnDef.meta?.className),
15211
13383
  children: [
15212
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "flex-row-2 w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex-row-1 items-center", children: [
15213
- header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
13384
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex-row-2 w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-row-1 items-center", children: [
13385
+ header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
15214
13386
  TableSortButton,
15215
13387
  {
15216
13388
  sortDirection: header.column.getIsSorted(),
15217
- onClick: () => header.column.toggleSorting()
13389
+ onClick: () => {
13390
+ const sorted = header.column.getIsSorted();
13391
+ const isMulti = header.column.getCanMultiSort();
13392
+ console.log(isMulti, header.column.id);
13393
+ if (!isMulti) {
13394
+ table.resetSorting();
13395
+ }
13396
+ if (!sorted) {
13397
+ header.column.toggleSorting(true, isMulti);
13398
+ return;
13399
+ } else if (sorted === "desc") {
13400
+ header.column.toggleSorting(false, isMulti);
13401
+ }
13402
+ if (sorted === "asc") {
13403
+ header.column.clearSorting();
13404
+ }
13405
+ }
15218
13406
  }
15219
13407
  ),
15220
- header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
13408
+ header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
15221
13409
  TableFilterButton,
15222
13410
  {
15223
13411
  column: header.column,
@@ -15229,7 +13417,7 @@ var Table = ({
15229
13417
  header.getContext()
15230
13418
  )
15231
13419
  ] }) }),
15232
- header.column.getCanResize() && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
13420
+ header.column.getCanResize() && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
15233
13421
  "div",
15234
13422
  {
15235
13423
  onMouseDown: header.getResizeHandler(),
@@ -15248,18 +13436,26 @@ var Table = ({
15248
13436
  header.id
15249
13437
  );
15250
13438
  }) }, headerGroup.id)) }),
15251
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("tbody", { children: [
13439
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("tbody", { children: [
15252
13440
  table.getRowModel().rows.map((row) => {
15253
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("tr", { onClick: () => onRowClick?.(row, table), className: table.options.meta?.bodyRowClassName, children: row.getVisibleCells().map((cell) => {
15254
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("td", { children: (0, import_react_table.flexRender)(
15255
- cell.column.columnDef.cell,
15256
- cell.getContext()
15257
- ) }, cell.id);
15258
- }) }, row.id);
13441
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13442
+ "tr",
13443
+ {
13444
+ onClick: () => onRowClick?.(row, table),
13445
+ className: table.options.meta?.bodyRowClassName,
13446
+ children: row.getVisibleCells().map((cell) => {
13447
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { children: (0, import_react_table.flexRender)(
13448
+ cell.column.columnDef.cell,
13449
+ cell.getContext()
13450
+ ) }, cell.id);
13451
+ })
13452
+ },
13453
+ row.id
13454
+ );
15259
13455
  }),
15260
13456
  range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
15261
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("tr", { children: columns.map((column) => {
15262
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(FillerRowElement, {}) }, column.id);
13457
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { children: columns.map((column) => {
13458
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FillerRowElement, {}) }, column.id);
15263
13459
  }) }, "filler-row-" + index);
15264
13460
  })
15265
13461
  ] })
@@ -15268,7 +13464,7 @@ var Table = ({
15268
13464
  )
15269
13465
  }
15270
13466
  ),
15271
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
13467
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
15272
13468
  Pagination,
15273
13469
  {
15274
13470
  pageIndex: table.getState().pagination.pageIndex,
@@ -15280,7 +13476,7 @@ var Table = ({
15280
13476
  };
15281
13477
  var TableUncontrolled = ({ data, ...props }) => {
15282
13478
  const [usedDate] = useOverwritableState(data);
15283
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
13479
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
15284
13480
  Table,
15285
13481
  {
15286
13482
  ...props,
@@ -15304,12 +13500,12 @@ var TableWithSelection = ({
15304
13500
  {
15305
13501
  id: selectionRowId,
15306
13502
  header: ({ table }) => {
15307
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
15308
- Checkbox2,
13503
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13504
+ Checkbox,
15309
13505
  {
15310
13506
  checked: table.getIsAllRowsSelected(),
15311
13507
  indeterminate: table.getIsSomeRowsSelected(),
15312
- onChange: (value) => {
13508
+ onCheckedChange: (value) => {
15313
13509
  const newValue = !!value;
15314
13510
  table.toggleAllRowsSelected(newValue);
15315
13511
  }
@@ -15317,12 +13513,12 @@ var TableWithSelection = ({
15317
13513
  );
15318
13514
  },
15319
13515
  cell: ({ row }) => {
15320
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
15321
- Checkbox2,
13516
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
13517
+ Checkbox,
15322
13518
  {
15323
13519
  disabled: !row.getCanSelect(),
15324
13520
  checked: row.getIsSelected(),
15325
- onChange: row.getToggleSelectedHandler()
13521
+ onCheckedChange: row.getToggleSelectedHandler()
15326
13522
  }
15327
13523
  );
15328
13524
  },
@@ -15335,15 +13531,15 @@ var TableWithSelection = ({
15335
13531
  ...columns
15336
13532
  ];
15337
13533
  }, [columns, selectionRowId]);
15338
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
13534
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
15339
13535
  Table,
15340
13536
  {
15341
13537
  columns: columnsWithSelection,
15342
13538
  fillerRow: (columnId, table) => {
15343
13539
  if (columnId === selectionRowId) {
15344
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Checkbox2, { checked: false, disabled: true, className: "max-w-6" });
13540
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Checkbox, { checked: false, disabled: true, className: "max-w-6" });
15345
13541
  }
15346
- return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(FillerRowElement, {});
13542
+ return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FillerRowElement, {});
15347
13543
  },
15348
13544
  state: {
15349
13545
  rowSelection,
@@ -15357,7 +13553,7 @@ var TableWithSelection = ({
15357
13553
  },
15358
13554
  meta: {
15359
13555
  ...meta,
15360
- bodyRowClassName: (0, import_clsx49.default)(
13556
+ bodyRowClassName: (0, import_clsx48.default)(
15361
13557
  { "cursor-pointer": !disableClickRowClickSelection },
15362
13558
  meta?.bodyRowClassName
15363
13559
  )
@@ -15369,7 +13565,7 @@ var TableWithSelection = ({
15369
13565
 
15370
13566
  // src/components/user-action/CopyToClipboardWrapper.tsx
15371
13567
  var import_react42 = require("react");
15372
- var import_clsx50 = require("clsx");
13568
+ var import_clsx49 = require("clsx");
15373
13569
 
15374
13570
  // src/utils/writeToClipboard.ts
15375
13571
  var writeToClipboard = (text) => {
@@ -15378,7 +13574,7 @@ var writeToClipboard = (text) => {
15378
13574
 
15379
13575
  // src/components/user-action/CopyToClipboardWrapper.tsx
15380
13576
  var import_lucide_react22 = require("lucide-react");
15381
- var import_jsx_runtime69 = require("react/jsx-runtime");
13577
+ var import_jsx_runtime61 = require("react/jsx-runtime");
15382
13578
  var CopyToClipboardWrapper = ({
15383
13579
  children,
15384
13580
  textToCopy,
@@ -15409,10 +13605,10 @@ var CopyToClipboardWrapper = ({
15409
13605
  left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
15410
13606
  right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
15411
13607
  };
15412
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
13608
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
15413
13609
  "div",
15414
13610
  {
15415
- className: (0, import_clsx50.clsx)("relative inline-block cursor-copy", containerClassName),
13611
+ className: (0, import_clsx49.clsx)("relative inline-block cursor-copy", containerClassName),
15416
13612
  onMouseEnter: () => {
15417
13613
  setIsShowingIndication(true);
15418
13614
  },
@@ -15427,10 +13623,10 @@ var CopyToClipboardWrapper = ({
15427
13623
  },
15428
13624
  children: [
15429
13625
  children,
15430
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
13626
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
15431
13627
  "div",
15432
13628
  {
15433
- className: (0, import_clsx50.clsx)(
13629
+ className: (0, import_clsx49.clsx)(
15434
13630
  `absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
15435
13631
  shadow-around-md bg-tooltip-background cursor-default pointer-events-none`,
15436
13632
  "transition-opacity duration-200",
@@ -15442,18 +13638,18 @@ var CopyToClipboardWrapper = ({
15442
13638
  opacity: isShowingIndication || isShowingConfirmation ? 1 : 0
15443
13639
  },
15444
13640
  children: [
15445
- isShowingConfirmation && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex-row-1", children: [
15446
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react22.CheckIcon, { size: 16, className: "text-positive" }),
13641
+ isShowingConfirmation && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex-row-1", children: [
13642
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react22.CheckIcon, { size: 16, className: "text-positive" }),
15447
13643
  translation("copied")
15448
13644
  ] }),
15449
- isShowingIndication && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex-row-1 text-description", children: [
15450
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react22.Copy, { size: 16 }),
13645
+ isShowingIndication && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex-row-1 text-description", children: [
13646
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react22.Copy, { size: 16 }),
15451
13647
  translation("clickToCopy")
15452
13648
  ] }),
15453
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
13649
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
15454
13650
  "div",
15455
13651
  {
15456
- className: (0, import_clsx50.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
13652
+ className: (0, import_clsx49.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
15457
13653
  style: { ...triangleStyle[position], zIndex: zIndex + 1 }
15458
13654
  }
15459
13655
  )
@@ -15466,8 +13662,8 @@ var CopyToClipboardWrapper = ({
15466
13662
  };
15467
13663
 
15468
13664
  // src/components/user-action/DateAndTimePicker.tsx
15469
- var import_clsx51 = __toESM(require("clsx"));
15470
- var import_jsx_runtime70 = require("react/jsx-runtime");
13665
+ var import_clsx50 = __toESM(require("clsx"));
13666
+ var import_jsx_runtime62 = require("react/jsx-runtime");
15471
13667
  var DateTimePicker = ({
15472
13668
  value = /* @__PURE__ */ new Date(),
15473
13669
  start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
@@ -15485,7 +13681,7 @@ var DateTimePicker = ({
15485
13681
  let dateDisplay;
15486
13682
  let timeDisplay;
15487
13683
  if (useDate) {
15488
- dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
13684
+ dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
15489
13685
  DatePicker,
15490
13686
  {
15491
13687
  ...datePickerProps,
@@ -15499,25 +13695,25 @@ var DateTimePicker = ({
15499
13695
  );
15500
13696
  }
15501
13697
  if (useTime) {
15502
- timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
13698
+ timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
15503
13699
  TimePicker,
15504
13700
  {
15505
13701
  ...timePickerProps,
15506
- className: (0, import_clsx51.default)("h-full", { "justify-between w-full": mode === "time" }),
13702
+ className: (0, import_clsx50.default)("h-full", { "justify-between w-full": mode === "time" }),
15507
13703
  maxHeight: 250,
15508
13704
  time: value,
15509
13705
  onChange
15510
13706
  }
15511
13707
  );
15512
13708
  }
15513
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex-col-2 w-fit", children: [
15514
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex-row-4", children: [
13709
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-col-2 w-fit", children: [
13710
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-row-4", children: [
15515
13711
  dateDisplay,
15516
13712
  timeDisplay
15517
13713
  ] }),
15518
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "flex-row-2 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex-row-2 mt-1", children: [
15519
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
15520
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
13714
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex-row-2 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-row-2 mt-1", children: [
13715
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
13716
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
15521
13717
  SolidButton,
15522
13718
  {
15523
13719
  size: "medium",
@@ -15531,8 +13727,8 @@ var DateTimePicker = ({
15531
13727
 
15532
13728
  // src/components/user-action/ScrollPicker.tsx
15533
13729
  var import_react43 = require("react");
15534
- var import_clsx52 = __toESM(require("clsx"));
15535
- var import_jsx_runtime71 = require("react/jsx-runtime");
13730
+ var import_clsx51 = __toESM(require("clsx"));
13731
+ var import_jsx_runtime63 = require("react/jsx-runtime");
15536
13732
  var up = 1;
15537
13733
  var down = -1;
15538
13734
  var ScrollPicker = ({
@@ -15671,7 +13867,7 @@ var ScrollPicker = ({
15671
13867
  }
15672
13868
  return clamp(1 - opacityValue / max);
15673
13869
  };
15674
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
13870
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
15675
13871
  "div",
15676
13872
  {
15677
13873
  className: "relative overflow-hidden",
@@ -15682,15 +13878,15 @@ var ScrollPicker = ({
15682
13878
  setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + deltaY }));
15683
13879
  }
15684
13880
  },
15685
- children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
15686
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
13881
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
13882
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
15687
13883
  "div",
15688
13884
  {
15689
13885
  className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-divider/50 border-y-2 border-x-0 ",
15690
13886
  style: { height: `${itemHeight}px` }
15691
13887
  }
15692
13888
  ),
15693
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
13889
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
15694
13890
  "div",
15695
13891
  {
15696
13892
  className: "flex-col-2 select-none",
@@ -15698,10 +13894,10 @@ var ScrollPicker = ({
15698
13894
  transform: `translateY(${-transition * (distance + itemHeight)}px)`,
15699
13895
  columnGap: `${distance}px`
15700
13896
  },
15701
- children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
13897
+ children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
15702
13898
  "div",
15703
13899
  {
15704
- className: (0, import_clsx52.default)(
13900
+ className: (0, import_clsx51.default)(
15705
13901
  `flex-col-2 items-center justify-center rounded-md`,
15706
13902
  {
15707
13903
  "text-primary font-bold": currentIndex === index,
@@ -15729,8 +13925,8 @@ var ScrollPicker = ({
15729
13925
 
15730
13926
  // src/components/user-action/SearchBar.tsx
15731
13927
  var import_lucide_react23 = require("lucide-react");
15732
- var import_clsx53 = require("clsx");
15733
- var import_jsx_runtime72 = require("react/jsx-runtime");
13928
+ var import_clsx52 = require("clsx");
13929
+ var import_jsx_runtime64 = require("react/jsx-runtime");
15734
13930
  var SearchBar = ({
15735
13931
  placeholder,
15736
13932
  onSearch,
@@ -15739,21 +13935,21 @@ var SearchBar = ({
15739
13935
  ...inputProps
15740
13936
  }) => {
15741
13937
  const translation = useHightideTranslation();
15742
- return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: (0, import_clsx53.clsx)("flex-row-2 justify-between items-center", containerClassName), children: [
15743
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
13938
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: (0, import_clsx52.clsx)("flex-row-2 justify-between items-center", containerClassName), children: [
13939
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
15744
13940
  Input,
15745
13941
  {
15746
13942
  ...inputProps,
15747
13943
  placeholder: placeholder ?? translation("search")
15748
13944
  }
15749
13945
  ),
15750
- onSearch && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react23.Search, { className: "w-full h-full" }) })
13946
+ onSearch && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_lucide_react23.Search, { className: "w-full h-full" }) })
15751
13947
  ] });
15752
13948
  };
15753
13949
 
15754
13950
  // src/components/user-action/Tooltip.tsx
15755
- var import_clsx54 = require("clsx");
15756
- var import_jsx_runtime73 = require("react/jsx-runtime");
13951
+ var import_clsx53 = require("clsx");
13952
+ var import_jsx_runtime65 = require("react/jsx-runtime");
15757
13953
  var Tooltip = ({
15758
13954
  tooltip,
15759
13955
  children,
@@ -15783,17 +13979,17 @@ var Tooltip = ({
15783
13979
  left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
15784
13980
  right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
15785
13981
  };
15786
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
13982
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
15787
13983
  "div",
15788
13984
  {
15789
- className: (0, import_clsx54.clsx)("relative inline-block", containerClassName),
13985
+ className: (0, import_clsx53.clsx)("relative inline-block", containerClassName),
15790
13986
  ...handlers,
15791
13987
  children: [
15792
13988
  children,
15793
- isHovered && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
13989
+ isHovered && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
15794
13990
  "div",
15795
13991
  {
15796
- className: (0, import_clsx54.clsx)(
13992
+ className: (0, import_clsx53.clsx)(
15797
13993
  `opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
15798
13994
  animate-tooltip-fade-in shadow-around-md bg-tooltip-background`,
15799
13995
  positionClasses[position],
@@ -15802,10 +13998,10 @@ var Tooltip = ({
15802
13998
  style: { zIndex, animationDelay: animationDelay + "ms" },
15803
13999
  children: [
15804
14000
  tooltip,
15805
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
14001
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
15806
14002
  "div",
15807
14003
  {
15808
- className: (0, import_clsx54.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
14004
+ className: (0, import_clsx53.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
15809
14005
  style: { ...triangleStyle[position], zIndex: zIndex + 1 }
15810
14006
  }
15811
14007
  )
@@ -15820,8 +14016,8 @@ var Tooltip = ({
15820
14016
  // src/components/user-action/input/InsideLabelInput.tsx
15821
14017
  var import_react44 = require("react");
15822
14018
  var import_react45 = require("react");
15823
- var import_clsx55 = __toESM(require("clsx"));
15824
- var import_jsx_runtime74 = require("react/jsx-runtime");
14019
+ var import_clsx54 = __toESM(require("clsx"));
14020
+ var import_jsx_runtime66 = require("react/jsx-runtime");
15825
14021
  var InsideLabelInput = (0, import_react45.forwardRef)(function InsideLabelInput2({
15826
14022
  id: customId,
15827
14023
  label,
@@ -15831,13 +14027,13 @@ var InsideLabelInput = (0, import_react45.forwardRef)(function InsideLabelInput2
15831
14027
  const [isFocused, setIsFocused] = (0, import_react45.useState)(false);
15832
14028
  const generatedId = (0, import_react44.useId)();
15833
14029
  const id = customId ?? generatedId;
15834
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: (0, import_clsx55.default)("relative"), children: [
15835
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
14030
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: (0, import_clsx54.default)("relative"), children: [
14031
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
15836
14032
  Input,
15837
14033
  {
15838
14034
  ...props,
15839
14035
  id,
15840
- className: (0, import_clsx55.default)("h-14 px-4 pb-2 py-6.5", props.className),
14036
+ className: (0, import_clsx54.default)("h-14 px-4 pb-2 py-6.5", props.className),
15841
14037
  ref: forwardedRef,
15842
14038
  "aria-labelledby": id + "-label",
15843
14039
  onFocus: (event) => {
@@ -15850,13 +14046,13 @@ var InsideLabelInput = (0, import_react45.forwardRef)(function InsideLabelInput2
15850
14046
  }
15851
14047
  }
15852
14048
  ),
15853
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
14049
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
15854
14050
  "label",
15855
14051
  {
15856
14052
  id: id + "-label",
15857
14053
  "aria-hidden": true,
15858
14054
  "data-display": isFocused || !!value ? "small" : "full",
15859
- className: (0, import_clsx55.default)(
14055
+ className: (0, import_clsx54.default)(
15860
14056
  // margin left to account for the border which is ignored for absolute positions
15861
14057
  "absolute left-4 ml-0.5 top-2 transition-all delay-25 pointer-events-none touch-none",
15862
14058
  "data-[display=small]:top-2 data-[display=small]:h-force-4.5 data-[display=small]:typography-caption-sm data-[display=small]:overflow-y-hidden",
@@ -15872,7 +14068,7 @@ var InsideLabelInputUncontrolled = ({
15872
14068
  ...props
15873
14069
  }) => {
15874
14070
  const [value, setValue] = useOverwritableState(initialValue, props.onChangeText);
15875
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
14071
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
15876
14072
  InsideLabelInput,
15877
14073
  {
15878
14074
  ...props,
@@ -15885,8 +14081,8 @@ var InsideLabelInputUncontrolled = ({
15885
14081
  // src/components/user-action/input/ToggleableInput.tsx
15886
14082
  var import_react46 = require("react");
15887
14083
  var import_lucide_react24 = require("lucide-react");
15888
- var import_clsx56 = __toESM(require("clsx"));
15889
- var import_jsx_runtime75 = require("react/jsx-runtime");
14084
+ var import_clsx55 = __toESM(require("clsx"));
14085
+ var import_jsx_runtime67 = require("react/jsx-runtime");
15890
14086
  var ToggleableInput = (0, import_react46.forwardRef)(function ToggleableInput2({
15891
14087
  value,
15892
14088
  initialState = "display",
@@ -15901,8 +14097,8 @@ var ToggleableInput = (0, import_react46.forwardRef)(function ToggleableInput2({
15901
14097
  innerRef.current?.focus();
15902
14098
  }
15903
14099
  }, [isEditing]);
15904
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: (0, import_clsx56.default)("relative flex-row-2", { "flex-1": isEditing }), children: [
15905
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
14100
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: (0, import_clsx55.default)("relative flex-row-2", { "flex-1": isEditing }), children: [
14101
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
15906
14102
  Input,
15907
14103
  {
15908
14104
  ...props,
@@ -15921,16 +14117,16 @@ var ToggleableInput = (0, import_react46.forwardRef)(function ToggleableInput2({
15921
14117
  ...editCompleteOptions,
15922
14118
  allowEnterComplete: true
15923
14119
  },
15924
- className: (0, import_clsx56.default)(`w-full ring-0 outline-0 decoration-primary underline-offset-4`, {
14120
+ className: (0, import_clsx55.default)(`w-full ring-0 outline-0 decoration-primary underline-offset-4`, {
15925
14121
  "underline": isEditing,
15926
14122
  "text-transparent": !isEditing
15927
14123
  }),
15928
14124
  defaultStyle: false
15929
14125
  }
15930
14126
  ),
15931
- !isEditing && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
15932
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: (0, import_clsx56.default)(" truncate"), children: value }),
15933
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react24.Pencil, { className: (0, import_clsx56.default)(`size-force-4`, { "text-transparent": isEditing }) })
14127
+ !isEditing && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
14128
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: (0, import_clsx55.default)(" truncate"), children: value }),
14129
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react24.Pencil, { className: (0, import_clsx55.default)(`size-force-4`, { "text-transparent": isEditing }) })
15934
14130
  ] })
15935
14131
  ] });
15936
14132
  });
@@ -15940,7 +14136,7 @@ var ToggleableInputUncontrolled = ({
15940
14136
  ...restProps
15941
14137
  }) => {
15942
14138
  const [value, setValue] = useOverwritableState(initialValue, onChangeText);
15943
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
14139
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
15944
14140
  ToggleableInput,
15945
14141
  {
15946
14142
  value,
@@ -15954,7 +14150,7 @@ var ToggleableInputUncontrolled = ({
15954
14150
  var import_react47 = require("react");
15955
14151
  var import_react48 = require("react");
15956
14152
  var import_react49 = require("react");
15957
- var import_jsx_runtime76 = require("react/jsx-runtime");
14153
+ var import_jsx_runtime68 = require("react/jsx-runtime");
15958
14154
  var FocusTrap = (0, import_react49.forwardRef)(function FocusTrap2({
15959
14155
  active = true,
15960
14156
  initialFocus,
@@ -15964,7 +14160,7 @@ var FocusTrap = (0, import_react49.forwardRef)(function FocusTrap2({
15964
14160
  const innerRef = (0, import_react47.useRef)(null);
15965
14161
  (0, import_react48.useImperativeHandle)(forwardedRef, () => innerRef.current);
15966
14162
  useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
15967
- return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { ref: innerRef, ...props });
14163
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { ref: innerRef, ...props });
15968
14164
  });
15969
14165
 
15970
14166
  // src/components/utils/Transition.tsx
@@ -16353,6 +14549,19 @@ var LoopingArrayCalculator = class _LoopingArrayCalculator {
16353
14549
 
16354
14550
  // src/utils/noop.ts
16355
14551
  var noop = () => void 0;
14552
+
14553
+ // src/utils/promise.ts
14554
+ async function sleep(ms) {
14555
+ return new Promise((resolve2) => setTimeout(resolve2, ms));
14556
+ }
14557
+ async function delayed(value, ms) {
14558
+ await sleep(ms);
14559
+ return value;
14560
+ }
14561
+ var PromiseUtils = {
14562
+ sleep,
14563
+ delayed
14564
+ };
16356
14565
  // Annotate the CommonJS export names for ESM import in node:
16357
14566
  0 && (module.exports = {
16358
14567
  ASTNodeInterpreter,
@@ -16437,11 +14646,11 @@ var noop = () => void 0;
16437
14646
  OutlineButton,
16438
14647
  Pagination,
16439
14648
  ProgressIndicator,
14649
+ PromiseUtils,
16440
14650
  PropertyBase,
16441
14651
  RadialRings,
16442
14652
  Ring,
16443
14653
  RingWave,
16444
- ScrollArea,
16445
14654
  ScrollPicker,
16446
14655
  SearchBar,
16447
14656
  Select,
@@ -16542,28 +14751,4 @@ var noop = () => void 0;
16542
14751
  weekDayList,
16543
14752
  writeToClipboard
16544
14753
  });
16545
- /*! Bundled license information:
16546
-
16547
- use-sync-external-store/cjs/use-sync-external-store-shim.production.js:
16548
- (**
16549
- * @license React
16550
- * use-sync-external-store-shim.production.js
16551
- *
16552
- * Copyright (c) Meta Platforms, Inc. and affiliates.
16553
- *
16554
- * This source code is licensed under the MIT license found in the
16555
- * LICENSE file in the root directory of this source tree.
16556
- *)
16557
-
16558
- use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
16559
- (**
16560
- * @license React
16561
- * use-sync-external-store-shim.development.js
16562
- *
16563
- * Copyright (c) Meta Platforms, Inc. and affiliates.
16564
- *
16565
- * This source code is licensed under the MIT license found in the
16566
- * LICENSE file in the root directory of this source tree.
16567
- *)
16568
- */
16569
14754
  //# sourceMappingURL=index.js.map