@hot-updater/console 1.0.0-rc.2 → 1.0.0-rc.3

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.
Files changed (110) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/InsightsErrorAlert-1cg6LDJG.js +1 -0
  3. package/.output/public/assets/InsightsPageHeader-oNIg_lcd.js +1 -0
  4. package/.output/public/assets/InsightsRolloutCard-Zsv9gBjU.js +42 -0
  5. package/.output/public/assets/{api-keys-BzKocqRy.js → api-keys-ChJjsbP2.js} +1 -1
  6. package/.output/public/assets/{api-keys-api-BHcODB7q.js → api-keys-api-LchP65vQ.js} +1 -1
  7. package/.output/public/assets/{card-Dhr_eFYj.js → card-iD7iiy4T.js} +1 -1
  8. package/.output/public/assets/{chart-no-axes-combined-Dy4WJv2U.js → chart-no-axes-combined-C0G0fQ3J.js} +1 -1
  9. package/.output/public/assets/createServerFn-DHc2erub.js +3 -0
  10. package/.output/public/assets/dialog-DX6o8qCL.js +1 -0
  11. package/.output/public/assets/{dist-C_NydL0e.js → dist-BPrb_vuw.js} +1 -1
  12. package/.output/public/assets/index-C6Nb14xG.js +10 -0
  13. package/.output/public/assets/{input-group-cSOG4wh_.js → input-group-Pa3SAbEI.js} +1 -1
  14. package/.output/public/assets/insights-C1uKy3p2.js +1 -0
  15. package/.output/public/assets/installations-Bj5AzZ3T.js +1 -0
  16. package/.output/public/assets/{installations-CE33wgbY.js → installations-DDTw9DSK.js} +2 -2
  17. package/.output/public/assets/{lazyRouteComponent-Ccp3bwBY.js → lazyRouteComponent-BN0MS05o.js} +1 -1
  18. package/.output/public/assets/{link-CI8idAUi.js → link-BG06whwB.js} +1 -1
  19. package/.output/public/assets/{loader-circle-BoxLrsOu.js → loader-circle-Bbp8LGVC.js} +1 -1
  20. package/.output/public/assets/{refresh-cw-Bqc72UZG.js → refresh-cw-DZgiAOMk.js} +1 -1
  21. package/.output/public/assets/routes-9E2okfpG.js +1 -0
  22. package/.output/public/assets/{routes-DGVXdzpw.js → routes-B3JviaDV.js} +2 -2
  23. package/.output/public/assets/{shield-check-uK3MHWJZ.js → shield-check-DoIiaaXU.js} +1 -1
  24. package/.output/public/assets/{signing-CMf4aqDO.js → signing-BKy9fIdB.js} +1 -1
  25. package/.output/public/assets/styles-C5-su40i.css +2 -0
  26. package/.output/public/assets/{table-2vcV89QB.js → table-bpgpQkPz.js} +1 -1
  27. package/.output/public/assets/useOpenInteractionType-4dPacbwb.js +1 -0
  28. package/.output/public/assets/x-Cr_sPM8E.js +1 -0
  29. package/.output/server/{__23tanstack-start-server-fn-resolver-B7ioJhtE.mjs → __23tanstack-start-server-fn-resolver-EMel9KYs.mjs} +36 -32
  30. package/.output/server/_libs/@base-ui/react+[...].mjs +1051 -1051
  31. package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +1554 -0
  32. package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
  33. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
  34. package/.output/server/_libs/d3-array.mjs +231 -0
  35. package/.output/server/_libs/d3-color.mjs +330 -0
  36. package/.output/server/_libs/d3-format.mjs +252 -0
  37. package/.output/server/_libs/d3-interpolate.mjs +207 -0
  38. package/.output/server/_libs/d3-path.mjs +77 -0
  39. package/.output/server/_libs/d3-scale+[...].mjs +1907 -0
  40. package/.output/server/_libs/d3-shape.mjs +818 -0
  41. package/.output/server/_libs/decimal.js-light.mjs +884 -0
  42. package/.output/server/_libs/es-toolkit.mjs +1159 -0
  43. package/.output/server/_libs/eventemitter3.mjs +236 -0
  44. package/.output/server/_libs/immer.mjs +532 -0
  45. package/.output/server/_libs/lucide-react.mjs +1 -1
  46. package/.output/server/_libs/next-themes.mjs +1 -1
  47. package/.output/server/_libs/react-redux+[...].mjs +205 -0
  48. package/.output/server/_libs/recharts+[...].mjs +14636 -0
  49. package/.output/server/_libs/sonner.mjs +1 -1
  50. package/.output/server/_libs/tanstack__react-query.mjs +1 -1
  51. package/.output/server/_runtime.mjs +10 -1
  52. package/.output/server/_ssr/InsightsErrorAlert-DzDVdfgW.mjs +169 -0
  53. package/.output/server/_ssr/{InsightsPageHeader-Df4Brj8u.mjs → InsightsPageHeader-CZ2AaQGk.mjs} +8 -120
  54. package/.output/server/_ssr/InsightsRolloutCard-DHB2iM4t.mjs +693 -0
  55. package/.output/server/_ssr/{api-keys-CZeTPQys.mjs → api-keys-BBl84_lN.mjs} +7 -7
  56. package/.output/server/_ssr/{api-keys-api-BUPQVSpk.mjs → api-keys-api-KSH04dLB.mjs} +2 -2
  57. package/.output/server/_ssr/{api-keys-rpc-Cs7tS5_j.mjs → api-keys-rpc-DBmgnW5o.mjs} +3 -3
  58. package/.output/server/_ssr/{api-rpc-tAupfGQm.mjs → api-rpc-DX5B6b-L.mjs} +25 -25
  59. package/.output/server/_ssr/{auth-rpc-DUaeOWKK.mjs → auth-rpc-gaibR719.mjs} +4 -4
  60. package/.output/server/_ssr/{auth.server-DW71WzsD.mjs → auth.server-DF_shCeq.mjs} +1 -1
  61. package/.output/server/_ssr/{bundle-signing-rpc-BhnBw0-d.mjs → bundle-signing-rpc-C01EKpb-.mjs} +2 -2
  62. package/.output/server/_ssr/{bundle-signing.server-C4NW5mWx.mjs → bundle-signing.server-Co_zHdJx.mjs} +1 -1
  63. package/.output/server/_ssr/{card-BRiPmi0C.mjs → card-gGh8F6kQ.mjs} +1 -1
  64. package/.output/server/_ssr/{config.server-afDuAwaG.mjs → config.server-NIXXHk-e.mjs} +5 -5
  65. package/.output/server/_ssr/{createSsrRpc-DjWNJ0uc.mjs → createSsrRpc-4rr4IJh3.mjs} +3 -3
  66. package/.output/server/_ssr/{deleteBundle-BTGwBgzx.mjs → deleteBundle-C71v1GBr.mjs} +1 -1
  67. package/.output/server/_ssr/{dialog-DS-nw-pA.mjs → dialog-DNtKYR5K.mjs} +1 -1
  68. package/.output/server/_ssr/{downloadBundle-CNnYxYO2.mjs → downloadBundle-A9zYC2go.mjs} +1 -1
  69. package/.output/server/_ssr/{getBundleChildren-C0vh4ZvE.mjs → getBundleChildren-CMGSGBWv.mjs} +1 -1
  70. package/.output/server/_ssr/{input-group-BpsnmvZw.mjs → input-group-Oj4kUnE4.mjs} +1 -1
  71. package/.output/server/_ssr/{insights-BdS364Xu.mjs → insights-oK2n5WBp.mjs} +13 -67
  72. package/.output/server/_ssr/insights-recovery-DSFM-YTL.mjs +21 -0
  73. package/.output/server/_ssr/insights-recovery-rpc-CgeCAs2K.mjs +16 -0
  74. package/.output/server/_ssr/{insights-rpc-38DujK0G.mjs → insights-rpc-DBf0ouen.mjs} +2 -2
  75. package/.output/server/_ssr/insightsRecovery-DFkXGFjd.mjs +108 -0
  76. package/.output/server/_ssr/{installations-CtA59MQG.mjs → installations-DBmYuVBi.mjs} +2 -2
  77. package/.output/server/_ssr/{installations-DiVKEF5T.mjs → installations-DQyJN-pZ.mjs} +9 -9
  78. package/.output/server/_ssr/{router-B9wG_9f8.mjs → router-C8J4nYEG.mjs} +13 -13
  79. package/.output/server/_ssr/{routes-CKrrS2q2.mjs → routes-C2RIYhyl.mjs} +2 -2
  80. package/.output/server/_ssr/{routes-D7Yh_jfj.mjs → routes-NlTRKPML.mjs} +21 -86
  81. package/.output/server/_ssr/{runtime.server-DacU1TBV.mjs → runtime.server-DLZpzphL.mjs} +1 -1
  82. package/.output/server/_ssr/{server-D_C2rMzf.mjs → server-hgrXpJQY.mjs} +3 -3
  83. package/.output/server/_ssr/{signing-Dz1WkZOf.mjs → signing-bfOvUMSJ.mjs} +3 -3
  84. package/.output/server/_ssr/ssr.mjs +1 -1
  85. package/.output/server/_ssr/{table-CnZmon_Z.mjs → table-QQ9cnWf2.mjs} +3 -3
  86. package/.output/server/_tanstack-start-manifest_v-BAb_a_eC.mjs +97 -0
  87. package/.output/server/index.mjs +152 -152
  88. package/package.json +5 -5
  89. package/src/components/features/insights/InsightsRolloutCard.tsx +505 -0
  90. package/src/components/features/releases/ReleaseEditorSheet.tsx +13 -0
  91. package/src/components/ui/empty.tsx +101 -0
  92. package/src/lib/insights-recovery-rpc.ts +14 -0
  93. package/src/lib/insights-recovery.ts +55 -0
  94. package/src/lib/server/insightsRecovery.ts +157 -0
  95. package/src/routes/insights.tsx +2 -0
  96. package/.output/public/assets/HashValueDisplay-CB0Eskit.js +0 -1
  97. package/.output/public/assets/InsightsPageHeader-Car5LNiZ.js +0 -1
  98. package/.output/public/assets/composite-Bp98A0Ld.js +0 -1
  99. package/.output/public/assets/createServerFn-CA8fs7QD.js +0 -3
  100. package/.output/public/assets/dialog-CUTrcPlB.js +0 -1
  101. package/.output/public/assets/index-DdAz-CXv.js +0 -10
  102. package/.output/public/assets/insights-C0PBSZ-n.js +0 -1
  103. package/.output/public/assets/installations-CStZja8x.js +0 -1
  104. package/.output/public/assets/routes-DTlwOr8I.js +0 -1
  105. package/.output/public/assets/styles-BCvbtKsm.css +0 -2
  106. package/.output/public/assets/useCompositeListItem-CHLITE_4.js +0 -1
  107. package/.output/public/assets/x-DCd0j8c6.js +0 -1
  108. package/.output/server/_ssr/HashValueDisplay-DwpGLfrl.mjs +0 -55
  109. package/.output/server/_tanstack-start-manifest_v-2MjTyxil.mjs +0 -97
  110. /package/.output/public/assets/{preload-helper-CQ36nxok.js → preload-helper-B_l5jfgx.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { r as __toESM, t as __commonJSMin } from "../../_runtime.mjs";
1
+ import { i as __toESM, t as __commonJSMin } from "../../_runtime.mjs";
2
2
  //#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react.production.js
3
3
  /**
4
4
  * @license React
@@ -9902,903 +9902,241 @@ function useControlled({ controlled, default: defaultProp, name, state = "value"
9902
9902
  }, [])];
9903
9903
  }
9904
9904
  //#endregion
9905
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/toggle-group/ToggleGroupContext.js
9906
- var ToggleGroupContext = /* @__PURE__ */ import_react.createContext(void 0);
9907
- function useToggleGroupContext(optional = true) {
9908
- const context = import_react.useContext(ToggleGroupContext);
9909
- if (context === void 0 && !optional) throw new Error(formatErrorMessage(7));
9905
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/root/SelectRootContext.js
9906
+ var SelectRootContext = /* @__PURE__ */ import_react.createContext(null);
9907
+ var SelectFloatingContext = /* @__PURE__ */ import_react.createContext(null);
9908
+ function useSelectRootContext() {
9909
+ const context = import_react.useContext(SelectRootContext);
9910
+ if (context === null) throw new Error(formatErrorMessage(60));
9911
+ return context;
9912
+ }
9913
+ function useSelectFloatingContext() {
9914
+ const context = import_react.useContext(SelectFloatingContext);
9915
+ if (context === null) throw new Error(formatErrorMessage(61));
9910
9916
  return context;
9911
9917
  }
9912
9918
  //#endregion
9913
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/list/CompositeListContext.js
9914
- var CompositeListContext = /* @__PURE__ */ import_react.createContext({
9915
- register: () => {},
9916
- unregister: () => {},
9917
- subscribeMapChange: () => {
9918
- return () => {};
9919
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/field/control/FieldControlDataAttributes.js
9920
+ var FieldControlDataAttributes = /* @__PURE__ */ function(FieldControlDataAttributes) {
9921
+ /**
9922
+ * Present when the field is disabled.
9923
+ */
9924
+ FieldControlDataAttributes["disabled"] = "data-disabled";
9925
+ /**
9926
+ * Present when the field is in a valid state.
9927
+ */
9928
+ FieldControlDataAttributes["valid"] = "data-valid";
9929
+ /**
9930
+ * Present when the field is in an invalid state.
9931
+ */
9932
+ FieldControlDataAttributes["invalid"] = "data-invalid";
9933
+ /**
9934
+ * Present when the field has been touched.
9935
+ */
9936
+ FieldControlDataAttributes["touched"] = "data-touched";
9937
+ /**
9938
+ * Present when the field's value has changed.
9939
+ */
9940
+ FieldControlDataAttributes["dirty"] = "data-dirty";
9941
+ /**
9942
+ * Present when the field is filled.
9943
+ */
9944
+ FieldControlDataAttributes["filled"] = "data-filled";
9945
+ /**
9946
+ * Present when the field control is focused.
9947
+ */
9948
+ FieldControlDataAttributes["focused"] = "data-focused";
9949
+ return FieldControlDataAttributes;
9950
+ }({});
9951
+ //#endregion
9952
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/field-constants/constants.js
9953
+ var DEFAULT_VALIDITY_STATE = {
9954
+ badInput: false,
9955
+ customError: false,
9956
+ patternMismatch: false,
9957
+ rangeOverflow: false,
9958
+ rangeUnderflow: false,
9959
+ stepMismatch: false,
9960
+ tooLong: false,
9961
+ tooShort: false,
9962
+ typeMismatch: false,
9963
+ valid: null,
9964
+ valueMissing: false
9965
+ };
9966
+ var DEFAULT_FIELD_STATE_ATTRIBUTES = {
9967
+ valid: null,
9968
+ touched: false,
9969
+ dirty: false,
9970
+ filled: false,
9971
+ focused: false
9972
+ };
9973
+ var DEFAULT_FIELD_ROOT_STATE = {
9974
+ disabled: false,
9975
+ ...DEFAULT_FIELD_STATE_ATTRIBUTES
9976
+ };
9977
+ var fieldValidityMapping = { valid(value) {
9978
+ if (value === null) return null;
9979
+ if (value) return { [FieldControlDataAttributes.valid]: "" };
9980
+ return { [FieldControlDataAttributes.invalid]: "" };
9981
+ } };
9982
+ //#endregion
9983
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/field-root-context/FieldRootContext.js
9984
+ var DEFAULT_FIELD_ROOT_CONTEXT = {
9985
+ invalid: void 0,
9986
+ name: void 0,
9987
+ validityData: {
9988
+ state: DEFAULT_VALIDITY_STATE,
9989
+ errors: [],
9990
+ error: "",
9991
+ value: "",
9992
+ initialValue: null
9919
9993
  },
9920
- elementsRef: { current: [] },
9921
- nextIndexRef: { current: 0 }
9922
- });
9923
- function useCompositeListContext() {
9924
- return import_react.useContext(CompositeListContext);
9994
+ setValidityData: NOOP,
9995
+ disabled: void 0,
9996
+ touched: DEFAULT_FIELD_STATE_ATTRIBUTES.touched,
9997
+ setTouched: NOOP,
9998
+ dirty: DEFAULT_FIELD_STATE_ATTRIBUTES.dirty,
9999
+ setDirty: NOOP,
10000
+ filled: DEFAULT_FIELD_STATE_ATTRIBUTES.filled,
10001
+ setFilled: NOOP,
10002
+ focused: DEFAULT_FIELD_STATE_ATTRIBUTES.focused,
10003
+ setFocused: NOOP,
10004
+ validate: () => null,
10005
+ validationMode: "onSubmit",
10006
+ validationDebounceTime: 0,
10007
+ shouldValidateOnChange: () => false,
10008
+ state: DEFAULT_FIELD_ROOT_STATE,
10009
+ markedDirtyRef: { current: false },
10010
+ registerFieldControl: NOOP,
10011
+ validation: {
10012
+ getValidationProps: (props = EMPTY_OBJECT) => props,
10013
+ getInputValidationProps: (props = EMPTY_OBJECT) => props,
10014
+ inputRef: { current: null },
10015
+ commit: async () => {}
10016
+ }
10017
+ };
10018
+ var FieldRootContext = /* @__PURE__ */ import_react.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
10019
+ function useFieldRootContext(optional = true) {
10020
+ const context = import_react.useContext(FieldRootContext);
10021
+ if (context.setValidityData === NOOP && !optional) throw new Error(formatErrorMessage(28));
10022
+ return context;
9925
10023
  }
9926
10024
  //#endregion
9927
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/list/useCompositeListItem.js
9928
- var IndexGuessBehavior = /* @__PURE__ */ function(IndexGuessBehavior) {
9929
- IndexGuessBehavior[IndexGuessBehavior["None"] = 0] = "None";
9930
- IndexGuessBehavior[IndexGuessBehavior["GuessFromOrder"] = 1] = "GuessFromOrder";
9931
- return IndexGuessBehavior;
9932
- }({});
9933
- /**
9934
- * Used to register a list item and its index (DOM position) in the `CompositeList`.
9935
- */
9936
- function useCompositeListItem(params = {}) {
9937
- const { label, metadata, textRef, indexGuessBehavior, index: externalIndex } = params;
9938
- const { register, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef } = useCompositeListContext();
9939
- const indexRef = import_react.useRef(-1);
9940
- const [index, setIndex] = import_react.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => {
9941
- if (indexRef.current === -1) {
9942
- const newIndex = nextIndexRef.current;
9943
- nextIndexRef.current += 1;
9944
- indexRef.current = newIndex;
9945
- }
9946
- return indexRef.current;
9947
- } : -1));
9948
- const componentRef = import_react.useRef(null);
9949
- const ref = import_react.useCallback((node) => {
9950
- componentRef.current = node;
9951
- if (index !== -1 && node !== null) {
9952
- elementsRef.current[index] = node;
9953
- if (labelsRef) {
9954
- const isLabelDefined = label !== void 0;
9955
- labelsRef.current[index] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent;
9956
- }
9957
- }
9958
- }, [
9959
- index,
9960
- elementsRef,
9961
- labelsRef,
9962
- label,
9963
- textRef
9964
- ]);
9965
- useIsoLayoutEffect(() => {
9966
- if (externalIndex != null) return;
9967
- const node = componentRef.current;
9968
- if (node) {
9969
- register(node, metadata);
9970
- return () => {
9971
- unregister(node);
9972
- };
9973
- }
9974
- }, [
9975
- externalIndex,
9976
- register,
9977
- unregister,
9978
- metadata
9979
- ]);
10025
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/field-register-control/useRegisterFieldControl.js
10026
+ function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true) {
10027
+ const { registerFieldControl } = useFieldRootContext();
10028
+ const sourceRef = import_react.useRef(null);
10029
+ if (!sourceRef.current) sourceRef.current = Symbol();
9980
10030
  useIsoLayoutEffect(() => {
9981
- if (externalIndex != null) return;
9982
- return subscribeMapChange((map) => {
9983
- const i = componentRef.current ? map.get(componentRef.current)?.index : null;
9984
- if (i != null) setIndex(i);
10031
+ const source = sourceRef.current;
10032
+ if (!source || !enabled) return;
10033
+ registerFieldControl(source, {
10034
+ controlRef,
10035
+ getValue: getFormValueOverride,
10036
+ id,
10037
+ value
9985
10038
  });
10039
+ return () => {
10040
+ registerFieldControl(source, void 0);
10041
+ };
9986
10042
  }, [
9987
- externalIndex,
9988
- subscribeMapChange,
9989
- setIndex
10043
+ controlRef,
10044
+ enabled,
10045
+ getFormValueOverride,
10046
+ id,
10047
+ registerFieldControl,
10048
+ value
9990
10049
  ]);
9991
- return import_react.useMemo(() => ({
9992
- ref,
9993
- index
9994
- }), [index, ref]);
9995
- }
9996
- //#endregion
9997
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/item/useCompositeItem.js
9998
- function useCompositeItem(params = {}) {
9999
- const { highlightItemOnHover, highlightedIndex, onHighlightedIndexChange } = useCompositeRootContext();
10000
- const { ref, index } = useCompositeListItem(params);
10001
- const isHighlighted = highlightedIndex === index;
10002
- const itemRef = import_react.useRef(null);
10003
- const mergedRef = useMergedRefs(ref, itemRef);
10004
- return {
10005
- compositeProps: import_react.useMemo(() => ({
10006
- tabIndex: isHighlighted ? 0 : -1,
10007
- onFocus() {
10008
- onHighlightedIndexChange(index);
10009
- },
10010
- onMouseMove() {
10011
- const item = itemRef.current;
10012
- if (!highlightItemOnHover || !item) return;
10013
- const disabled = item.hasAttribute("disabled") || item.ariaDisabled === "true";
10014
- if (!isHighlighted && !disabled) item.focus();
10015
- }
10016
- }), [
10017
- isHighlighted,
10018
- onHighlightedIndexChange,
10019
- index,
10020
- highlightItemOnHover
10021
- ]),
10022
- compositeRef: mergedRef,
10023
- index
10024
- };
10025
10050
  }
10026
10051
  //#endregion
10027
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/item/CompositeItem.js
10052
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/labelable-provider/LabelableContext.js
10028
10053
  /**
10029
- * @internal
10054
+ * A context for providing [labelable elements](https://html.spec.whatwg.org/multipage/forms.html#category-label)\
10055
+ * with an accessible name (label) and description.
10030
10056
  */
10031
- function CompositeItem(componentProps) {
10032
- const { render, className, style, state = EMPTY_OBJECT, props = EMPTY_ARRAY$1, refs = EMPTY_ARRAY$1, metadata, stateAttributesMapping, tag = "div", ...elementProps } = componentProps;
10033
- const { compositeProps, compositeRef } = useCompositeItem({ metadata });
10034
- return useRenderElement(tag, componentProps, {
10035
- state,
10036
- ref: [...refs, compositeRef],
10037
- props: [
10038
- compositeProps,
10039
- ...props,
10040
- elementProps
10041
- ],
10042
- stateAttributesMapping
10043
- });
10044
- }
10045
- //#endregion
10046
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/toggle/Toggle.js
10047
- /**
10048
- * A two-state button that can be on or off.
10049
- * Renders a `<button>` element.
10050
- *
10051
- * Documentation: [Base UI Toggle](https://base-ui.com/react/components/toggle)
10052
- */
10053
- var Toggle = /* @__PURE__ */ import_react.forwardRef(function Toggle(componentProps, forwardedRef) {
10054
- const { className, defaultPressed: defaultPressedProp = false, disabled: disabledProp = false, form, onPressedChange, pressed: pressedProp, render, type, value: valueProp, nativeButton = true, style, ...elementProps } = componentProps;
10055
- const value = useBaseUiId(valueProp || void 0);
10056
- const groupContext = useToggleGroupContext();
10057
- const groupValue = groupContext?.value ?? [];
10058
- const defaultPressed = groupContext ? void 0 : defaultPressedProp;
10059
- const disabled = (disabledProp || groupContext?.disabled) ?? false;
10060
- const [pressed, setPressedState] = useControlled({
10061
- controlled: groupContext ? value !== void 0 && groupValue.indexOf(value) > -1 : pressedProp,
10062
- default: defaultPressed,
10063
- name: "Toggle",
10064
- state: "pressed"
10065
- });
10066
- const { getButtonProps, buttonRef } = useButton({
10067
- disabled,
10068
- native: nativeButton
10069
- });
10070
- const state = {
10071
- disabled,
10072
- pressed
10073
- };
10074
- const refs = [buttonRef, forwardedRef];
10075
- const props = [
10076
- {
10077
- "aria-pressed": pressed,
10078
- onClick(event) {
10079
- const nextPressed = !pressed;
10080
- const details = createChangeEventDetails(none, event.nativeEvent);
10081
- if (value) groupContext?.setGroupValue?.(value, nextPressed, details);
10082
- onPressedChange?.(nextPressed, details);
10083
- if (details.isCanceled) return;
10084
- setPressedState(nextPressed);
10085
- }
10086
- },
10087
- elementProps,
10088
- getButtonProps
10089
- ];
10090
- const element = useRenderElement("button", componentProps, {
10091
- enabled: !groupContext,
10092
- state,
10093
- ref: refs,
10094
- props
10095
- });
10096
- if (groupContext) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeItem, {
10097
- tag: "button",
10098
- render,
10099
- className,
10100
- style,
10101
- state,
10102
- refs,
10103
- props
10104
- });
10105
- return element;
10057
+ var LabelableContext = /* @__PURE__ */ import_react.createContext({
10058
+ controlId: void 0,
10059
+ registerControlId: NOOP,
10060
+ labelId: void 0,
10061
+ setLabelId: NOOP,
10062
+ messageIds: [],
10063
+ setMessageIds: NOOP,
10064
+ getDescriptionProps: (externalProps) => externalProps
10106
10065
  });
10066
+ function useLabelableContext() {
10067
+ return import_react.useContext(LabelableContext);
10068
+ }
10107
10069
  //#endregion
10108
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/list/CompositeList.js
10109
- /**
10110
- * Provides context for a list of items in a composite component.
10111
- * @internal
10112
- */
10113
- function CompositeList(props) {
10114
- const { children, elementsRef, labelsRef, onMapChange: onMapChangeProp } = props;
10115
- const onMapChange = useStableCallback(onMapChangeProp);
10116
- const nextIndexRef = import_react.useRef(0);
10117
- const listeners = useRefWithInit(createListeners).current;
10118
- const map = useRefWithInit(createMap).current;
10119
- const [mapTick, setMapTick] = import_react.useState(0);
10120
- const lastTickRef = import_react.useRef(mapTick);
10121
- const register = useStableCallback((node, metadata) => {
10122
- map.set(node, metadata ?? null);
10123
- lastTickRef.current += 1;
10124
- setMapTick(lastTickRef.current);
10125
- });
10126
- const unregister = useStableCallback((node) => {
10127
- map.delete(node);
10128
- lastTickRef.current += 1;
10129
- setMapTick(lastTickRef.current);
10070
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/labelable-provider/useLabelableId.js
10071
+ function useLabelableId(params = {}) {
10072
+ const { id, implicit = false, controlRef } = params;
10073
+ const { controlId, registerControlId } = useLabelableContext();
10074
+ const defaultId = useBaseUiId(id);
10075
+ const controlIdForEffect = implicit ? controlId : void 0;
10076
+ const controlSourceRef = useRefWithInit(() => Symbol("labelable-control"));
10077
+ const hasRegisteredRef = import_react.useRef(false);
10078
+ const hadExplicitIdRef = import_react.useRef(id != null);
10079
+ const unregisterControlId = useStableCallback(() => {
10080
+ if (!hasRegisteredRef.current || registerControlId === NOOP) return;
10081
+ hasRegisteredRef.current = false;
10082
+ registerControlId(controlSourceRef.current, void 0);
10130
10083
  });
10131
- const sortedMap = import_react.useMemo(() => {
10132
- disableEslintWarning(mapTick);
10133
- const newMap = /* @__PURE__ */ new Map();
10134
- Array.from(map.keys()).filter((node) => node.isConnected).sort(sortByDocumentPosition).forEach((node, index) => {
10135
- const metadata = map.get(node) ?? {};
10136
- newMap.set(node, {
10137
- ...metadata,
10138
- index
10139
- });
10140
- });
10141
- return newMap;
10142
- }, [map, mapTick]);
10143
- useIsoLayoutEffect(() => {
10144
- if (typeof MutationObserver !== "function" || sortedMap.size === 0) return;
10145
- const mutationObserver = new MutationObserver((entries) => {
10146
- const diff = /* @__PURE__ */ new Set();
10147
- const updateDiff = (node) => diff.has(node) ? diff.delete(node) : diff.add(node);
10148
- entries.forEach((entry) => {
10149
- entry.removedNodes.forEach(updateDiff);
10150
- entry.addedNodes.forEach(updateDiff);
10151
- });
10152
- if (diff.size === 0) {
10153
- lastTickRef.current += 1;
10154
- setMapTick(lastTickRef.current);
10155
- }
10156
- });
10157
- sortedMap.forEach((_, node) => {
10158
- if (node.parentElement) mutationObserver.observe(node.parentElement, { childList: true });
10159
- });
10160
- return () => {
10161
- mutationObserver.disconnect();
10162
- };
10163
- }, [sortedMap]);
10164
10084
  useIsoLayoutEffect(() => {
10165
- if (lastTickRef.current === mapTick) {
10166
- if (elementsRef.current.length !== sortedMap.size) elementsRef.current.length = sortedMap.size;
10167
- if (labelsRef && labelsRef.current.length !== sortedMap.size) labelsRef.current.length = sortedMap.size;
10168
- nextIndexRef.current = sortedMap.size;
10085
+ if (registerControlId === NOOP) return;
10086
+ let nextId;
10087
+ if (implicit) {
10088
+ const elem = controlRef?.current;
10089
+ if (isElement(elem) && elem.closest("label") != null) nextId = id ?? null;
10090
+ else nextId = controlIdForEffect ?? defaultId;
10091
+ } else if (id != null) {
10092
+ hadExplicitIdRef.current = true;
10093
+ nextId = id;
10094
+ } else if (hadExplicitIdRef.current) nextId = defaultId;
10095
+ else {
10096
+ unregisterControlId();
10097
+ return;
10169
10098
  }
10170
- onMapChange(sortedMap);
10099
+ if (nextId === void 0) {
10100
+ unregisterControlId();
10101
+ return;
10102
+ }
10103
+ hasRegisteredRef.current = true;
10104
+ registerControlId(controlSourceRef.current, nextId);
10171
10105
  }, [
10172
- onMapChange,
10173
- sortedMap,
10174
- elementsRef,
10175
- labelsRef,
10176
- mapTick
10177
- ]);
10178
- useIsoLayoutEffect(() => {
10179
- return () => {
10180
- elementsRef.current = [];
10181
- };
10182
- }, [elementsRef]);
10183
- useIsoLayoutEffect(() => {
10184
- return () => {
10185
- if (labelsRef) labelsRef.current = [];
10186
- };
10187
- }, [labelsRef]);
10188
- const subscribeMapChange = useStableCallback((fn) => {
10189
- listeners.add(fn);
10190
- return () => {
10191
- listeners.delete(fn);
10192
- };
10193
- });
10194
- useIsoLayoutEffect(() => {
10195
- listeners.forEach((l) => l(sortedMap));
10196
- }, [listeners, sortedMap]);
10197
- const contextValue = import_react.useMemo(() => ({
10198
- register,
10199
- unregister,
10200
- subscribeMapChange,
10201
- elementsRef,
10202
- labelsRef,
10203
- nextIndexRef
10204
- }), [
10205
- register,
10206
- unregister,
10207
- subscribeMapChange,
10208
- elementsRef,
10209
- labelsRef,
10210
- nextIndexRef
10106
+ id,
10107
+ controlRef,
10108
+ controlIdForEffect,
10109
+ registerControlId,
10110
+ implicit,
10111
+ defaultId,
10112
+ controlSourceRef,
10113
+ unregisterControlId
10211
10114
  ]);
10212
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeListContext.Provider, {
10213
- value: contextValue,
10214
- children
10215
- });
10115
+ import_react.useEffect(() => {
10116
+ return unregisterControlId;
10117
+ }, [unregisterControlId]);
10118
+ return controlId ?? defaultId;
10216
10119
  }
10217
- function createMap() {
10218
- return /* @__PURE__ */ new Map();
10120
+ //#endregion
10121
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/itemEquality.js
10122
+ var defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);
10123
+ function compareItemEquality(itemValue, selectedValue, comparer) {
10124
+ if (itemValue == null || selectedValue == null) return Object.is(itemValue, selectedValue);
10125
+ return comparer(itemValue, selectedValue);
10219
10126
  }
10220
- function createListeners() {
10221
- return /* @__PURE__ */ new Set();
10127
+ function selectedValueIncludes(selectedValues, itemValue, comparer) {
10128
+ if (!selectedValues || selectedValues.length === 0) return false;
10129
+ return selectedValues.some((selectedValue) => {
10130
+ if (selectedValue === void 0) return false;
10131
+ return compareItemEquality(itemValue, selectedValue, comparer);
10132
+ });
10222
10133
  }
10223
- function sortByDocumentPosition(a, b) {
10224
- const position = a.compareDocumentPosition(b);
10225
- if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) return -1;
10226
- if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) return 1;
10227
- return 0;
10228
- }
10229
- function disableEslintWarning(_) {}
10230
- //#endregion
10231
- //#region ../../node_modules/.pnpm/@base-ui+utils@0.2.9_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/utils/esm/isElementDisabled.js
10232
- function isElementDisabled(element) {
10233
- return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
10234
- }
10235
- //#endregion
10236
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/root/useCompositeRoot.js
10237
- var EMPTY_ARRAY = [];
10238
- function useCompositeRoot(params) {
10239
- const { itemSizes, cols = 1, loopFocus = true, onLoop, dense = false, orientation = "both", direction, highlightedIndex: externalHighlightedIndex, onHighlightedIndexChange: externalSetHighlightedIndex, rootRef: externalRef, enableHomeAndEndKeys = false, stopEventPropagation = false, disabledIndices, modifierKeys = EMPTY_ARRAY } = params;
10240
- const [internalHighlightedIndex, internalSetHighlightedIndex] = import_react.useState(0);
10241
- const isGrid = cols > 1;
10242
- const rootRef = import_react.useRef(null);
10243
- const mergedRef = useMergedRefs(rootRef, externalRef);
10244
- const elementsRef = import_react.useRef([]);
10245
- const hasSetDefaultIndexRef = import_react.useRef(false);
10246
- const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;
10247
- const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {
10248
- (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);
10249
- if (shouldScrollIntoView) {
10250
- const newActiveItem = elementsRef.current[index];
10251
- scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);
10252
- }
10253
- });
10254
- const onMapChange = useStableCallback((map) => {
10255
- if (map.size === 0 || hasSetDefaultIndexRef.current) return;
10256
- hasSetDefaultIndexRef.current = true;
10257
- const sortedElements = Array.from(map.keys());
10258
- const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute("data-composite-item-active")) ?? null;
10259
- const activeIndex = activeItem ? sortedElements.indexOf(activeItem) : -1;
10260
- if (activeIndex !== -1) onHighlightedIndexChange(activeIndex);
10261
- scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);
10262
- });
10263
- const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => {
10264
- if (!onLoop) return nextIndex;
10265
- return onLoop?.(event, prevIndex, nextIndex, elementsRef);
10266
- });
10267
- const props = import_react.useMemo(() => ({
10268
- "aria-orientation": orientation === "both" ? void 0 : orientation,
10269
- ref: mergedRef,
10270
- onFocus(event) {
10271
- const element = rootRef.current;
10272
- const target = getTarget(event.nativeEvent);
10273
- if (!element || target == null || !isNativeInput(target)) return;
10274
- target.setSelectionRange(0, target.value.length ?? 0);
10275
- },
10276
- onKeyDown(event) {
10277
- const RELEVANT_KEYS = enableHomeAndEndKeys ? COMPOSITE_KEYS : ARROW_KEYS;
10278
- if (!RELEVANT_KEYS.has(event.key)) return;
10279
- if (isModifierKeySet(event, modifierKeys)) return;
10280
- if (!rootRef.current) return;
10281
- const isRtl = direction === "rtl";
10282
- const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT;
10283
- const forwardKey = {
10284
- horizontal: horizontalForwardKey,
10285
- vertical: ARROW_DOWN,
10286
- both: horizontalForwardKey
10287
- }[orientation];
10288
- const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT;
10289
- const backwardKey = {
10290
- horizontal: horizontalBackwardKey,
10291
- vertical: ARROW_UP,
10292
- both: horizontalBackwardKey
10293
- }[orientation];
10294
- const target = getTarget(event.nativeEvent);
10295
- if (target != null && isNativeInput(target) && !isElementDisabled(target)) {
10296
- const selectionStart = target.selectionStart;
10297
- const selectionEnd = target.selectionEnd;
10298
- const textContent = target.value ?? "";
10299
- if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) return;
10300
- if (event.key !== backwardKey && selectionStart < textContent.length) return;
10301
- if (event.key !== forwardKey && selectionStart > 0) return;
10302
- }
10303
- let nextIndex = highlightedIndex;
10304
- const minIndex = getMinListIndex(elementsRef, disabledIndices);
10305
- const maxIndex = getMaxListIndex(elementsRef, disabledIndices);
10306
- if (isGrid) {
10307
- const sizes = itemSizes || Array.from({ length: elementsRef.current.length }, () => ({
10308
- width: 1,
10309
- height: 1
10310
- }));
10311
- const cellMap = createGridCellMap(sizes, cols, dense);
10312
- const minGridIndex = cellMap.findIndex((index) => index != null && !isListIndexDisabled(elementsRef.current, index, disabledIndices));
10313
- const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isListIndexDisabled(elementsRef.current, index, disabledIndices) ? cellIndex : foundIndex, -1);
10314
- nextIndex = cellMap[getGridNavigatedIndex(cellMap.map((itemIndex) => itemIndex != null ? elementsRef.current[itemIndex] : null), {
10315
- event,
10316
- orientation,
10317
- loopFocus,
10318
- onLoop: wrappedOnLoop,
10319
- cols,
10320
- disabledIndices: getGridCellIndices([...disabledIndices || elementsRef.current.map((_, index) => isListIndexDisabled(elementsRef.current, index) ? index : void 0), void 0], cellMap),
10321
- minIndex: minGridIndex,
10322
- maxIndex: maxGridIndex,
10323
- prevIndex: getGridCellIndexOfCorner(highlightedIndex > maxIndex ? minIndex : highlightedIndex, sizes, cellMap, cols, event.key === "ArrowDown" ? "bl" : event.key === "ArrowRight" ? "tr" : "tl"),
10324
- rtl: isRtl
10325
- })];
10326
- }
10327
- const forwardKeys = {
10328
- horizontal: [horizontalForwardKey],
10329
- vertical: [ARROW_DOWN],
10330
- both: [horizontalForwardKey, ARROW_DOWN]
10331
- }[orientation];
10332
- const backwardKeys = {
10333
- horizontal: [horizontalBackwardKey],
10334
- vertical: [ARROW_UP],
10335
- both: [horizontalBackwardKey, ARROW_UP]
10336
- }[orientation];
10337
- const preventedKeys = isGrid ? RELEVANT_KEYS : {
10338
- horizontal: enableHomeAndEndKeys ? HORIZONTAL_KEYS_WITH_EXTRA_KEYS : HORIZONTAL_KEYS,
10339
- vertical: enableHomeAndEndKeys ? VERTICAL_KEYS_WITH_EXTRA_KEYS : VERTICAL_KEYS,
10340
- both: RELEVANT_KEYS
10341
- }[orientation];
10342
- if (enableHomeAndEndKeys) {
10343
- if (event.key === "Home") nextIndex = minIndex;
10344
- else if (event.key === "End") nextIndex = maxIndex;
10345
- }
10346
- if (nextIndex === highlightedIndex && (forwardKeys.includes(event.key) || backwardKeys.includes(event.key))) if (loopFocus && nextIndex === maxIndex && forwardKeys.includes(event.key)) {
10347
- nextIndex = minIndex;
10348
- if (onLoop) nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
10349
- } else if (loopFocus && nextIndex === minIndex && backwardKeys.includes(event.key)) {
10350
- nextIndex = maxIndex;
10351
- if (onLoop) nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
10352
- } else nextIndex = findNonDisabledListIndex(elementsRef.current, {
10353
- startingIndex: nextIndex,
10354
- decrement: backwardKeys.includes(event.key),
10355
- disabledIndices
10356
- });
10357
- if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) {
10358
- if (stopEventPropagation) event.stopPropagation();
10359
- if (preventedKeys.has(event.key)) event.preventDefault();
10360
- onHighlightedIndexChange(nextIndex, true);
10361
- queueMicrotask(() => {
10362
- elementsRef.current[nextIndex]?.focus();
10363
- });
10364
- }
10365
- }
10366
- }), [
10367
- cols,
10368
- dense,
10369
- direction,
10370
- disabledIndices,
10371
- elementsRef,
10372
- enableHomeAndEndKeys,
10373
- highlightedIndex,
10374
- isGrid,
10375
- itemSizes,
10376
- loopFocus,
10377
- onLoop,
10378
- wrappedOnLoop,
10379
- mergedRef,
10380
- modifierKeys,
10381
- onHighlightedIndexChange,
10382
- orientation,
10383
- stopEventPropagation
10384
- ]);
10385
- return import_react.useMemo(() => ({
10386
- props,
10387
- highlightedIndex,
10388
- onHighlightedIndexChange,
10389
- elementsRef,
10390
- disabledIndices,
10391
- onMapChange,
10392
- relayKeyboardEvent: props.onKeyDown
10393
- }), [
10394
- props,
10395
- highlightedIndex,
10396
- onHighlightedIndexChange,
10397
- elementsRef,
10398
- disabledIndices,
10399
- onMapChange
10400
- ]);
10401
- }
10402
- function isModifierKeySet(event, ignoredModifierKeys) {
10403
- for (const key of MODIFIER_KEYS.values()) {
10404
- if (ignoredModifierKeys.includes(key)) continue;
10405
- if (event.getModifierState(key)) return true;
10406
- }
10407
- return false;
10408
- }
10409
- //#endregion
10410
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/root/CompositeRoot.js
10411
- /**
10412
- * @internal
10413
- */
10414
- function CompositeRoot(componentProps) {
10415
- const { render, className, style, refs = EMPTY_ARRAY$1, props = EMPTY_ARRAY$1, state = EMPTY_OBJECT, stateAttributesMapping, highlightedIndex: highlightedIndexProp, onHighlightedIndexChange: onHighlightedIndexChangeProp, orientation, dense, itemSizes, loopFocus, onLoop, cols, enableHomeAndEndKeys, onMapChange: onMapChangeProp, stopEventPropagation = true, rootRef, disabledIndices, modifierKeys, highlightItemOnHover = false, tag = "div", ...elementProps } = componentProps;
10416
- const { props: defaultProps, highlightedIndex, onHighlightedIndexChange, elementsRef, onMapChange: onMapChangeUnwrapped, relayKeyboardEvent } = useCompositeRoot({
10417
- itemSizes,
10418
- cols,
10419
- loopFocus,
10420
- onLoop,
10421
- dense,
10422
- orientation,
10423
- highlightedIndex: highlightedIndexProp,
10424
- onHighlightedIndexChange: onHighlightedIndexChangeProp,
10425
- rootRef,
10426
- stopEventPropagation,
10427
- enableHomeAndEndKeys,
10428
- direction: useDirection(),
10429
- disabledIndices,
10430
- modifierKeys
10431
- });
10432
- const element = useRenderElement(tag, componentProps, {
10433
- state,
10434
- ref: refs,
10435
- props: [
10436
- defaultProps,
10437
- ...props,
10438
- elementProps
10439
- ],
10440
- stateAttributesMapping
10441
- });
10442
- const contextValue = import_react.useMemo(() => ({
10443
- highlightedIndex,
10444
- onHighlightedIndexChange,
10445
- highlightItemOnHover,
10446
- relayKeyboardEvent
10447
- }), [
10448
- highlightedIndex,
10449
- onHighlightedIndexChange,
10450
- highlightItemOnHover,
10451
- relayKeyboardEvent
10452
- ]);
10453
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeRootContext.Provider, {
10454
- value: contextValue,
10455
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeList, {
10456
- elementsRef,
10457
- onMapChange: (newMap) => {
10458
- onMapChangeProp?.(newMap);
10459
- onMapChangeUnwrapped(newMap);
10460
- },
10461
- children: element
10462
- })
10463
- });
10464
- }
10465
- //#endregion
10466
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/toolbar/root/ToolbarRootContext.js
10467
- var ToolbarRootContext = /* @__PURE__ */ import_react.createContext(void 0);
10468
- function useToolbarRootContext(optional) {
10469
- const context = import_react.useContext(ToolbarRootContext);
10470
- if (context === void 0 && !optional) throw new Error(formatErrorMessage(69));
10471
- return context;
10472
- }
10473
- //#endregion
10474
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/toggle-group/ToggleGroupDataAttributes.js
10475
- var ToggleGroupDataAttributes = /* @__PURE__ */ function(ToggleGroupDataAttributes) {
10476
- /**
10477
- * Present when the toggle group is disabled.
10478
- */
10479
- ToggleGroupDataAttributes["disabled"] = "data-disabled";
10480
- /**
10481
- * Indicates the orientation of the toggle group.
10482
- * @type {'horizontal' | 'vertical'}
10483
- */
10484
- ToggleGroupDataAttributes["orientation"] = "data-orientation";
10485
- /**
10486
- * Present when the toggle group allows multiple buttons to be in the pressed state at the same time.
10487
- */
10488
- ToggleGroupDataAttributes["multiple"] = "data-multiple";
10489
- return ToggleGroupDataAttributes;
10490
- }({});
10491
- //#endregion
10492
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/toggle-group/ToggleGroup.js
10493
- var stateAttributesMapping$4 = { multiple(value) {
10494
- if (value) return { [ToggleGroupDataAttributes.multiple]: "" };
10495
- return null;
10496
- } };
10497
- /**
10498
- * Provides a shared state to a series of toggle buttons.
10499
- *
10500
- * Documentation: [Base UI Toggle Group](https://base-ui.com/react/components/toggle-group)
10501
- */
10502
- var ToggleGroup = /* @__PURE__ */ import_react.forwardRef(function ToggleGroup(componentProps, forwardedRef) {
10503
- const { defaultValue: defaultValueProp, disabled: disabledProp = false, loopFocus = true, onValueChange, orientation = "horizontal", multiple = false, value: valueProp, className, render, style, ...elementProps } = componentProps;
10504
- const toolbarContext = useToolbarRootContext(true);
10505
- const isValueInitialized = import_react.useMemo(() => valueProp !== void 0 || defaultValueProp !== void 0, [valueProp, defaultValueProp]);
10506
- const disabled = (toolbarContext?.disabled ?? false) || disabledProp;
10507
- const [groupValue, setValueState] = useControlled({
10508
- controlled: valueProp,
10509
- default: valueProp === void 0 ? defaultValueProp ?? EMPTY_ARRAY$1 : void 0,
10510
- name: "ToggleGroup",
10511
- state: "value"
10512
- });
10513
- const setGroupValue = useStableCallback((newValue, nextPressed, eventDetails) => {
10514
- let newGroupValue;
10515
- if (multiple) {
10516
- newGroupValue = groupValue.slice();
10517
- if (nextPressed) newGroupValue.push(newValue);
10518
- else newGroupValue.splice(groupValue.indexOf(newValue), 1);
10519
- } else newGroupValue = nextPressed ? [newValue] : [];
10520
- onValueChange?.(newGroupValue, eventDetails);
10521
- if (eventDetails.isCanceled) return;
10522
- setValueState(newGroupValue);
10523
- });
10524
- const state = {
10525
- disabled,
10526
- multiple,
10527
- orientation
10528
- };
10529
- const contextValue = import_react.useMemo(() => ({
10530
- disabled,
10531
- orientation,
10532
- setGroupValue,
10533
- value: groupValue,
10534
- isValueInitialized
10535
- }), [
10536
- disabled,
10537
- orientation,
10538
- setGroupValue,
10539
- groupValue,
10540
- isValueInitialized
10541
- ]);
10542
- const defaultProps = { role: "group" };
10543
- const element = useRenderElement("div", componentProps, {
10544
- enabled: Boolean(toolbarContext),
10545
- state,
10546
- ref: forwardedRef,
10547
- props: [defaultProps, elementProps],
10548
- stateAttributesMapping: stateAttributesMapping$4
10549
- });
10550
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupContext.Provider, {
10551
- value: contextValue,
10552
- children: toolbarContext ? element : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeRoot, {
10553
- render,
10554
- className,
10555
- style,
10556
- state,
10557
- refs: [forwardedRef],
10558
- props: [defaultProps, elementProps],
10559
- stateAttributesMapping: stateAttributesMapping$4,
10560
- loopFocus,
10561
- enableHomeAndEndKeys: true,
10562
- orientation
10563
- })
10564
- });
10565
- });
10566
- //#endregion
10567
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/root/SelectRootContext.js
10568
- var SelectRootContext = /* @__PURE__ */ import_react.createContext(null);
10569
- var SelectFloatingContext = /* @__PURE__ */ import_react.createContext(null);
10570
- function useSelectRootContext() {
10571
- const context = import_react.useContext(SelectRootContext);
10572
- if (context === null) throw new Error(formatErrorMessage(60));
10573
- return context;
10574
- }
10575
- function useSelectFloatingContext() {
10576
- const context = import_react.useContext(SelectFloatingContext);
10577
- if (context === null) throw new Error(formatErrorMessage(61));
10578
- return context;
10579
- }
10580
- //#endregion
10581
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/field/control/FieldControlDataAttributes.js
10582
- var FieldControlDataAttributes = /* @__PURE__ */ function(FieldControlDataAttributes) {
10583
- /**
10584
- * Present when the field is disabled.
10585
- */
10586
- FieldControlDataAttributes["disabled"] = "data-disabled";
10587
- /**
10588
- * Present when the field is in a valid state.
10589
- */
10590
- FieldControlDataAttributes["valid"] = "data-valid";
10591
- /**
10592
- * Present when the field is in an invalid state.
10593
- */
10594
- FieldControlDataAttributes["invalid"] = "data-invalid";
10595
- /**
10596
- * Present when the field has been touched.
10597
- */
10598
- FieldControlDataAttributes["touched"] = "data-touched";
10599
- /**
10600
- * Present when the field's value has changed.
10601
- */
10602
- FieldControlDataAttributes["dirty"] = "data-dirty";
10603
- /**
10604
- * Present when the field is filled.
10605
- */
10606
- FieldControlDataAttributes["filled"] = "data-filled";
10607
- /**
10608
- * Present when the field control is focused.
10609
- */
10610
- FieldControlDataAttributes["focused"] = "data-focused";
10611
- return FieldControlDataAttributes;
10612
- }({});
10613
- //#endregion
10614
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/field-constants/constants.js
10615
- var DEFAULT_VALIDITY_STATE = {
10616
- badInput: false,
10617
- customError: false,
10618
- patternMismatch: false,
10619
- rangeOverflow: false,
10620
- rangeUnderflow: false,
10621
- stepMismatch: false,
10622
- tooLong: false,
10623
- tooShort: false,
10624
- typeMismatch: false,
10625
- valid: null,
10626
- valueMissing: false
10627
- };
10628
- var DEFAULT_FIELD_STATE_ATTRIBUTES = {
10629
- valid: null,
10630
- touched: false,
10631
- dirty: false,
10632
- filled: false,
10633
- focused: false
10634
- };
10635
- var DEFAULT_FIELD_ROOT_STATE = {
10636
- disabled: false,
10637
- ...DEFAULT_FIELD_STATE_ATTRIBUTES
10638
- };
10639
- var fieldValidityMapping = { valid(value) {
10640
- if (value === null) return null;
10641
- if (value) return { [FieldControlDataAttributes.valid]: "" };
10642
- return { [FieldControlDataAttributes.invalid]: "" };
10643
- } };
10644
- //#endregion
10645
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/field-root-context/FieldRootContext.js
10646
- var DEFAULT_FIELD_ROOT_CONTEXT = {
10647
- invalid: void 0,
10648
- name: void 0,
10649
- validityData: {
10650
- state: DEFAULT_VALIDITY_STATE,
10651
- errors: [],
10652
- error: "",
10653
- value: "",
10654
- initialValue: null
10655
- },
10656
- setValidityData: NOOP,
10657
- disabled: void 0,
10658
- touched: DEFAULT_FIELD_STATE_ATTRIBUTES.touched,
10659
- setTouched: NOOP,
10660
- dirty: DEFAULT_FIELD_STATE_ATTRIBUTES.dirty,
10661
- setDirty: NOOP,
10662
- filled: DEFAULT_FIELD_STATE_ATTRIBUTES.filled,
10663
- setFilled: NOOP,
10664
- focused: DEFAULT_FIELD_STATE_ATTRIBUTES.focused,
10665
- setFocused: NOOP,
10666
- validate: () => null,
10667
- validationMode: "onSubmit",
10668
- validationDebounceTime: 0,
10669
- shouldValidateOnChange: () => false,
10670
- state: DEFAULT_FIELD_ROOT_STATE,
10671
- markedDirtyRef: { current: false },
10672
- registerFieldControl: NOOP,
10673
- validation: {
10674
- getValidationProps: (props = EMPTY_OBJECT) => props,
10675
- getInputValidationProps: (props = EMPTY_OBJECT) => props,
10676
- inputRef: { current: null },
10677
- commit: async () => {}
10678
- }
10679
- };
10680
- var FieldRootContext = /* @__PURE__ */ import_react.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
10681
- function useFieldRootContext(optional = true) {
10682
- const context = import_react.useContext(FieldRootContext);
10683
- if (context.setValidityData === NOOP && !optional) throw new Error(formatErrorMessage(28));
10684
- return context;
10685
- }
10686
- //#endregion
10687
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/field-register-control/useRegisterFieldControl.js
10688
- function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true) {
10689
- const { registerFieldControl } = useFieldRootContext();
10690
- const sourceRef = import_react.useRef(null);
10691
- if (!sourceRef.current) sourceRef.current = Symbol();
10692
- useIsoLayoutEffect(() => {
10693
- const source = sourceRef.current;
10694
- if (!source || !enabled) return;
10695
- registerFieldControl(source, {
10696
- controlRef,
10697
- getValue: getFormValueOverride,
10698
- id,
10699
- value
10700
- });
10701
- return () => {
10702
- registerFieldControl(source, void 0);
10703
- };
10704
- }, [
10705
- controlRef,
10706
- enabled,
10707
- getFormValueOverride,
10708
- id,
10709
- registerFieldControl,
10710
- value
10711
- ]);
10712
- }
10713
- //#endregion
10714
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/labelable-provider/LabelableContext.js
10715
- /**
10716
- * A context for providing [labelable elements](https://html.spec.whatwg.org/multipage/forms.html#category-label)\
10717
- * with an accessible name (label) and description.
10718
- */
10719
- var LabelableContext = /* @__PURE__ */ import_react.createContext({
10720
- controlId: void 0,
10721
- registerControlId: NOOP,
10722
- labelId: void 0,
10723
- setLabelId: NOOP,
10724
- messageIds: [],
10725
- setMessageIds: NOOP,
10726
- getDescriptionProps: (externalProps) => externalProps
10727
- });
10728
- function useLabelableContext() {
10729
- return import_react.useContext(LabelableContext);
10730
- }
10731
- //#endregion
10732
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/labelable-provider/useLabelableId.js
10733
- function useLabelableId(params = {}) {
10734
- const { id, implicit = false, controlRef } = params;
10735
- const { controlId, registerControlId } = useLabelableContext();
10736
- const defaultId = useBaseUiId(id);
10737
- const controlIdForEffect = implicit ? controlId : void 0;
10738
- const controlSourceRef = useRefWithInit(() => Symbol("labelable-control"));
10739
- const hasRegisteredRef = import_react.useRef(false);
10740
- const hadExplicitIdRef = import_react.useRef(id != null);
10741
- const unregisterControlId = useStableCallback(() => {
10742
- if (!hasRegisteredRef.current || registerControlId === NOOP) return;
10743
- hasRegisteredRef.current = false;
10744
- registerControlId(controlSourceRef.current, void 0);
10745
- });
10746
- useIsoLayoutEffect(() => {
10747
- if (registerControlId === NOOP) return;
10748
- let nextId;
10749
- if (implicit) {
10750
- const elem = controlRef?.current;
10751
- if (isElement(elem) && elem.closest("label") != null) nextId = id ?? null;
10752
- else nextId = controlIdForEffect ?? defaultId;
10753
- } else if (id != null) {
10754
- hadExplicitIdRef.current = true;
10755
- nextId = id;
10756
- } else if (hadExplicitIdRef.current) nextId = defaultId;
10757
- else {
10758
- unregisterControlId();
10759
- return;
10760
- }
10761
- if (nextId === void 0) {
10762
- unregisterControlId();
10763
- return;
10764
- }
10765
- hasRegisteredRef.current = true;
10766
- registerControlId(controlSourceRef.current, nextId);
10767
- }, [
10768
- id,
10769
- controlRef,
10770
- controlIdForEffect,
10771
- registerControlId,
10772
- implicit,
10773
- defaultId,
10774
- controlSourceRef,
10775
- unregisterControlId
10776
- ]);
10777
- import_react.useEffect(() => {
10778
- return unregisterControlId;
10779
- }, [unregisterControlId]);
10780
- return controlId ?? defaultId;
10781
- }
10782
- //#endregion
10783
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/itemEquality.js
10784
- var defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);
10785
- function compareItemEquality(itemValue, selectedValue, comparer) {
10786
- if (itemValue == null || selectedValue == null) return Object.is(itemValue, selectedValue);
10787
- return comparer(itemValue, selectedValue);
10788
- }
10789
- function selectedValueIncludes(selectedValues, itemValue, comparer) {
10790
- if (!selectedValues || selectedValues.length === 0) return false;
10791
- return selectedValues.some((selectedValue) => {
10792
- if (selectedValue === void 0) return false;
10793
- return compareItemEquality(itemValue, selectedValue, comparer);
10794
- });
10795
- }
10796
- function findItemIndex(itemValues, selectedValue, comparer) {
10797
- if (!itemValues || itemValues.length === 0) return -1;
10798
- return itemValues.findIndex((itemValue) => {
10799
- if (itemValue === void 0) return false;
10800
- return compareItemEquality(itemValue, selectedValue, comparer);
10801
- });
10134
+ function findItemIndex(itemValues, selectedValue, comparer) {
10135
+ if (!itemValues || itemValues.length === 0) return -1;
10136
+ return itemValues.findIndex((itemValue) => {
10137
+ if (itemValue === void 0) return false;
10138
+ return compareItemEquality(itemValue, selectedValue, comparer);
10139
+ });
10802
10140
  }
10803
10141
  function removeItem(selectedValues, itemValue, comparer) {
10804
10142
  return selectedValues.filter((selectedValue) => !compareItemEquality(itemValue, selectedValue, comparer));
@@ -11392,7 +10730,7 @@ function getPseudoElementBounds(element) {
11392
10730
  //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/trigger/SelectTrigger.js
11393
10731
  var BOUNDARY_OFFSET = 2;
11394
10732
  var SELECTED_DELAY = 400;
11395
- var stateAttributesMapping$3 = {
10733
+ var stateAttributesMapping$4 = {
11396
10734
  ...pressableTriggerOpenStateMapping,
11397
10735
  ...fieldValidityMapping,
11398
10736
  popupSide: (side) => side ? { "data-popup-side": side } : null,
@@ -11517,13 +10855,13 @@ var SelectTrigger = /* @__PURE__ */ import_react.forwardRef(function SelectTrigg
11517
10855
  return useRenderElement("button", componentProps, {
11518
10856
  ref: [forwardedRef, triggerRef],
11519
10857
  state,
11520
- stateAttributesMapping: stateAttributesMapping$3,
10858
+ stateAttributesMapping: stateAttributesMapping$4,
11521
10859
  props
11522
10860
  });
11523
10861
  });
11524
10862
  //#endregion
11525
10863
  //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/value/SelectValue.js
11526
- var stateAttributesMapping$2 = { value: () => null };
10864
+ var stateAttributesMapping$3 = { value: () => null };
11527
10865
  /**
11528
10866
  * A text label of the currently selected item.
11529
10867
  * Renders a `<span>` element.
@@ -11553,7 +10891,7 @@ var SelectValue = /* @__PURE__ */ import_react.forwardRef(function SelectValue(c
11553
10891
  state,
11554
10892
  ref: [forwardedRef, valueRef],
11555
10893
  props: [{ children }, elementProps],
11556
- stateAttributesMapping: stateAttributesMapping$2
10894
+ stateAttributesMapping: stateAttributesMapping$3
11557
10895
  });
11558
10896
  });
11559
10897
  //#endregion
@@ -11603,6 +10941,143 @@ var SelectPortal = /* @__PURE__ */ import_react.forwardRef(function SelectPortal
11603
10941
  });
11604
10942
  });
11605
10943
  //#endregion
10944
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/list/CompositeListContext.js
10945
+ var CompositeListContext = /* @__PURE__ */ import_react.createContext({
10946
+ register: () => {},
10947
+ unregister: () => {},
10948
+ subscribeMapChange: () => {
10949
+ return () => {};
10950
+ },
10951
+ elementsRef: { current: [] },
10952
+ nextIndexRef: { current: 0 }
10953
+ });
10954
+ function useCompositeListContext() {
10955
+ return import_react.useContext(CompositeListContext);
10956
+ }
10957
+ //#endregion
10958
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/list/CompositeList.js
10959
+ /**
10960
+ * Provides context for a list of items in a composite component.
10961
+ * @internal
10962
+ */
10963
+ function CompositeList(props) {
10964
+ const { children, elementsRef, labelsRef, onMapChange: onMapChangeProp } = props;
10965
+ const onMapChange = useStableCallback(onMapChangeProp);
10966
+ const nextIndexRef = import_react.useRef(0);
10967
+ const listeners = useRefWithInit(createListeners).current;
10968
+ const map = useRefWithInit(createMap).current;
10969
+ const [mapTick, setMapTick] = import_react.useState(0);
10970
+ const lastTickRef = import_react.useRef(mapTick);
10971
+ const register = useStableCallback((node, metadata) => {
10972
+ map.set(node, metadata ?? null);
10973
+ lastTickRef.current += 1;
10974
+ setMapTick(lastTickRef.current);
10975
+ });
10976
+ const unregister = useStableCallback((node) => {
10977
+ map.delete(node);
10978
+ lastTickRef.current += 1;
10979
+ setMapTick(lastTickRef.current);
10980
+ });
10981
+ const sortedMap = import_react.useMemo(() => {
10982
+ disableEslintWarning(mapTick);
10983
+ const newMap = /* @__PURE__ */ new Map();
10984
+ Array.from(map.keys()).filter((node) => node.isConnected).sort(sortByDocumentPosition).forEach((node, index) => {
10985
+ const metadata = map.get(node) ?? {};
10986
+ newMap.set(node, {
10987
+ ...metadata,
10988
+ index
10989
+ });
10990
+ });
10991
+ return newMap;
10992
+ }, [map, mapTick]);
10993
+ useIsoLayoutEffect(() => {
10994
+ if (typeof MutationObserver !== "function" || sortedMap.size === 0) return;
10995
+ const mutationObserver = new MutationObserver((entries) => {
10996
+ const diff = /* @__PURE__ */ new Set();
10997
+ const updateDiff = (node) => diff.has(node) ? diff.delete(node) : diff.add(node);
10998
+ entries.forEach((entry) => {
10999
+ entry.removedNodes.forEach(updateDiff);
11000
+ entry.addedNodes.forEach(updateDiff);
11001
+ });
11002
+ if (diff.size === 0) {
11003
+ lastTickRef.current += 1;
11004
+ setMapTick(lastTickRef.current);
11005
+ }
11006
+ });
11007
+ sortedMap.forEach((_, node) => {
11008
+ if (node.parentElement) mutationObserver.observe(node.parentElement, { childList: true });
11009
+ });
11010
+ return () => {
11011
+ mutationObserver.disconnect();
11012
+ };
11013
+ }, [sortedMap]);
11014
+ useIsoLayoutEffect(() => {
11015
+ if (lastTickRef.current === mapTick) {
11016
+ if (elementsRef.current.length !== sortedMap.size) elementsRef.current.length = sortedMap.size;
11017
+ if (labelsRef && labelsRef.current.length !== sortedMap.size) labelsRef.current.length = sortedMap.size;
11018
+ nextIndexRef.current = sortedMap.size;
11019
+ }
11020
+ onMapChange(sortedMap);
11021
+ }, [
11022
+ onMapChange,
11023
+ sortedMap,
11024
+ elementsRef,
11025
+ labelsRef,
11026
+ mapTick
11027
+ ]);
11028
+ useIsoLayoutEffect(() => {
11029
+ return () => {
11030
+ elementsRef.current = [];
11031
+ };
11032
+ }, [elementsRef]);
11033
+ useIsoLayoutEffect(() => {
11034
+ return () => {
11035
+ if (labelsRef) labelsRef.current = [];
11036
+ };
11037
+ }, [labelsRef]);
11038
+ const subscribeMapChange = useStableCallback((fn) => {
11039
+ listeners.add(fn);
11040
+ return () => {
11041
+ listeners.delete(fn);
11042
+ };
11043
+ });
11044
+ useIsoLayoutEffect(() => {
11045
+ listeners.forEach((l) => l(sortedMap));
11046
+ }, [listeners, sortedMap]);
11047
+ const contextValue = import_react.useMemo(() => ({
11048
+ register,
11049
+ unregister,
11050
+ subscribeMapChange,
11051
+ elementsRef,
11052
+ labelsRef,
11053
+ nextIndexRef
11054
+ }), [
11055
+ register,
11056
+ unregister,
11057
+ subscribeMapChange,
11058
+ elementsRef,
11059
+ labelsRef,
11060
+ nextIndexRef
11061
+ ]);
11062
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeListContext.Provider, {
11063
+ value: contextValue,
11064
+ children
11065
+ });
11066
+ }
11067
+ function createMap() {
11068
+ return /* @__PURE__ */ new Map();
11069
+ }
11070
+ function createListeners() {
11071
+ return /* @__PURE__ */ new Set();
11072
+ }
11073
+ function sortByDocumentPosition(a, b) {
11074
+ const position = a.compareDocumentPosition(b);
11075
+ if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) return -1;
11076
+ if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) return 1;
11077
+ return 0;
11078
+ }
11079
+ function disableEslintWarning(_) {}
11080
+ //#endregion
11606
11081
  //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/positioner/SelectPositionerContext.js
11607
11082
  var SelectPositionerContext = /* @__PURE__ */ import_react.createContext(void 0);
11608
11083
  function useSelectPositionerContext() {
@@ -11800,6 +11275,14 @@ var styleDisableScrollbar = {
11800
11275
  }
11801
11276
  };
11802
11277
  //#endregion
11278
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/toolbar/root/ToolbarRootContext.js
11279
+ var ToolbarRootContext = /* @__PURE__ */ import_react.createContext(void 0);
11280
+ function useToolbarRootContext(optional) {
11281
+ const context = import_react.useContext(ToolbarRootContext);
11282
+ if (context === void 0 && !optional) throw new Error(formatErrorMessage(69));
11283
+ return context;
11284
+ }
11285
+ //#endregion
11803
11286
  //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/csp-context/CSPContext.js
11804
11287
  /**
11805
11288
  * @internal
@@ -11814,7 +11297,7 @@ function useCSPContext() {
11814
11297
  }
11815
11298
  //#endregion
11816
11299
  //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/popup/SelectPopup.js
11817
- var stateAttributesMapping$1 = {
11300
+ var stateAttributesMapping$2 = {
11818
11301
  ...popupStateMapping,
11819
11302
  ...transitionStatusMapping
11820
11303
  };
@@ -12093,7 +11576,7 @@ var SelectPopup = /* @__PURE__ */ import_react.forwardRef(function SelectPopup(c
12093
11576
  const element = useRenderElement("div", componentProps, {
12094
11577
  ref: [forwardedRef, popupRef],
12095
11578
  state,
12096
- stateAttributesMapping: stateAttributesMapping$1,
11579
+ stateAttributesMapping: stateAttributesMapping$2,
12097
11580
  props: [
12098
11581
  popupProps,
12099
11582
  defaultProps,
@@ -12153,38 +11636,108 @@ function unsetTransformStyles(popupElement) {
12153
11636
  };
12154
11637
  }
12155
11638
  //#endregion
12156
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/list/SelectList.js
12157
- /**
12158
- * A container for the select items.
12159
- * Renders a `<div>` element.
12160
- *
12161
- * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
12162
- */
12163
- var SelectList = /* @__PURE__ */ import_react.forwardRef(function SelectList(componentProps, forwardedRef) {
12164
- const { render, className, style, ...elementProps } = componentProps;
12165
- const { store, scrollHandlerRef } = useSelectRootContext();
12166
- const { alignItemWithTriggerActive } = useSelectPositionerContext();
12167
- const hasScrollArrows = useStore(store, selectors.hasScrollArrows);
12168
- const openMethod = useStore(store, selectors.openMethod);
12169
- const multiple = useStore(store, selectors.multiple);
12170
- const defaultProps = {
12171
- id: `${useStore(store, selectors.id)}-list`,
12172
- role: "listbox",
12173
- "aria-multiselectable": multiple || void 0,
12174
- onScroll(event) {
12175
- scrollHandlerRef.current?.(event.currentTarget);
12176
- },
12177
- ...alignItemWithTriggerActive && { style: LIST_FUNCTIONAL_STYLES },
12178
- className: hasScrollArrows && openMethod !== "touch" ? styleDisableScrollbar.className : void 0
12179
- };
12180
- return useRenderElement("div", componentProps, {
12181
- ref: [forwardedRef, useStableCallback((element) => {
12182
- store.set("listElement", element);
12183
- })],
12184
- props: [defaultProps, elementProps]
12185
- });
12186
- });
12187
- //#endregion
11639
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/list/SelectList.js
11640
+ /**
11641
+ * A container for the select items.
11642
+ * Renders a `<div>` element.
11643
+ *
11644
+ * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
11645
+ */
11646
+ var SelectList = /* @__PURE__ */ import_react.forwardRef(function SelectList(componentProps, forwardedRef) {
11647
+ const { render, className, style, ...elementProps } = componentProps;
11648
+ const { store, scrollHandlerRef } = useSelectRootContext();
11649
+ const { alignItemWithTriggerActive } = useSelectPositionerContext();
11650
+ const hasScrollArrows = useStore(store, selectors.hasScrollArrows);
11651
+ const openMethod = useStore(store, selectors.openMethod);
11652
+ const multiple = useStore(store, selectors.multiple);
11653
+ const defaultProps = {
11654
+ id: `${useStore(store, selectors.id)}-list`,
11655
+ role: "listbox",
11656
+ "aria-multiselectable": multiple || void 0,
11657
+ onScroll(event) {
11658
+ scrollHandlerRef.current?.(event.currentTarget);
11659
+ },
11660
+ ...alignItemWithTriggerActive && { style: LIST_FUNCTIONAL_STYLES },
11661
+ className: hasScrollArrows && openMethod !== "touch" ? styleDisableScrollbar.className : void 0
11662
+ };
11663
+ return useRenderElement("div", componentProps, {
11664
+ ref: [forwardedRef, useStableCallback((element) => {
11665
+ store.set("listElement", element);
11666
+ })],
11667
+ props: [defaultProps, elementProps]
11668
+ });
11669
+ });
11670
+ //#endregion
11671
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/list/useCompositeListItem.js
11672
+ var IndexGuessBehavior = /* @__PURE__ */ function(IndexGuessBehavior) {
11673
+ IndexGuessBehavior[IndexGuessBehavior["None"] = 0] = "None";
11674
+ IndexGuessBehavior[IndexGuessBehavior["GuessFromOrder"] = 1] = "GuessFromOrder";
11675
+ return IndexGuessBehavior;
11676
+ }({});
11677
+ /**
11678
+ * Used to register a list item and its index (DOM position) in the `CompositeList`.
11679
+ */
11680
+ function useCompositeListItem(params = {}) {
11681
+ const { label, metadata, textRef, indexGuessBehavior, index: externalIndex } = params;
11682
+ const { register, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef } = useCompositeListContext();
11683
+ const indexRef = import_react.useRef(-1);
11684
+ const [index, setIndex] = import_react.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => {
11685
+ if (indexRef.current === -1) {
11686
+ const newIndex = nextIndexRef.current;
11687
+ nextIndexRef.current += 1;
11688
+ indexRef.current = newIndex;
11689
+ }
11690
+ return indexRef.current;
11691
+ } : -1));
11692
+ const componentRef = import_react.useRef(null);
11693
+ const ref = import_react.useCallback((node) => {
11694
+ componentRef.current = node;
11695
+ if (index !== -1 && node !== null) {
11696
+ elementsRef.current[index] = node;
11697
+ if (labelsRef) {
11698
+ const isLabelDefined = label !== void 0;
11699
+ labelsRef.current[index] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent;
11700
+ }
11701
+ }
11702
+ }, [
11703
+ index,
11704
+ elementsRef,
11705
+ labelsRef,
11706
+ label,
11707
+ textRef
11708
+ ]);
11709
+ useIsoLayoutEffect(() => {
11710
+ if (externalIndex != null) return;
11711
+ const node = componentRef.current;
11712
+ if (node) {
11713
+ register(node, metadata);
11714
+ return () => {
11715
+ unregister(node);
11716
+ };
11717
+ }
11718
+ }, [
11719
+ externalIndex,
11720
+ register,
11721
+ unregister,
11722
+ metadata
11723
+ ]);
11724
+ useIsoLayoutEffect(() => {
11725
+ if (externalIndex != null) return;
11726
+ return subscribeMapChange((map) => {
11727
+ const i = componentRef.current ? map.get(componentRef.current)?.index : null;
11728
+ if (i != null) setIndex(i);
11729
+ });
11730
+ }, [
11731
+ externalIndex,
11732
+ subscribeMapChange,
11733
+ setIndex
11734
+ ]);
11735
+ return import_react.useMemo(() => ({
11736
+ ref,
11737
+ index
11738
+ }), [index, ref]);
11739
+ }
11740
+ //#endregion
12188
11741
  //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/item/SelectItemContext.js
12189
11742
  var SelectItemContext = /* @__PURE__ */ import_react.createContext(void 0);
12190
11743
  function useSelectItemContext() {
@@ -12425,172 +11978,619 @@ var SelectItemText = /* @__PURE__ */ import_react.memo(/* @__PURE__ */ import_re
12425
11978
  forwardedRef,
12426
11979
  textRef
12427
11980
  ],
12428
- props: elementProps
11981
+ props: elementProps
11982
+ });
11983
+ }));
11984
+ //#endregion
11985
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/scroll-arrow/SelectScrollArrow.js
11986
+ /**
11987
+ * @internal
11988
+ */
11989
+ var SelectScrollArrow = /* @__PURE__ */ import_react.forwardRef(function SelectScrollArrow(componentProps, forwardedRef) {
11990
+ const { render, className, style, direction, keepMounted = false, ...elementProps } = componentProps;
11991
+ const isUp = direction === "up";
11992
+ const { store, popupRef, listRef, handleScrollArrowVisibility, scrollArrowsMountedCountRef } = useSelectRootContext();
11993
+ const { side, scrollDownArrowRef, scrollUpArrowRef } = useSelectPositionerContext();
11994
+ const stateVisible = useStore(store, isUp ? selectors.scrollUpArrowVisible : selectors.scrollDownArrowVisible);
11995
+ const openMethod = useStore(store, selectors.openMethod);
11996
+ const visible = stateVisible && openMethod !== "touch";
11997
+ const timeout = useTimeout();
11998
+ const scrollArrowRef = isUp ? scrollUpArrowRef : scrollDownArrowRef;
11999
+ const { transitionStatus, setMounted } = useTransitionStatus(visible);
12000
+ useIsoLayoutEffect(() => {
12001
+ scrollArrowsMountedCountRef.current += 1;
12002
+ if (!store.state.hasScrollArrows) store.set("hasScrollArrows", true);
12003
+ return () => {
12004
+ scrollArrowsMountedCountRef.current = Math.max(0, scrollArrowsMountedCountRef.current - 1);
12005
+ if (scrollArrowsMountedCountRef.current === 0 && store.state.hasScrollArrows) store.set("hasScrollArrows", false);
12006
+ };
12007
+ }, [store, scrollArrowsMountedCountRef]);
12008
+ useOpenChangeComplete({
12009
+ open: visible,
12010
+ ref: scrollArrowRef,
12011
+ onComplete() {
12012
+ if (!visible) setMounted(false);
12013
+ }
12014
+ });
12015
+ const element = useRenderElement("div", componentProps, {
12016
+ ref: [forwardedRef, scrollArrowRef],
12017
+ state: {
12018
+ direction,
12019
+ visible,
12020
+ side,
12021
+ transitionStatus
12022
+ },
12023
+ props: [{
12024
+ "aria-hidden": true,
12025
+ children: isUp ? "▲" : "▼",
12026
+ style: { position: "absolute" },
12027
+ onMouseMove(event) {
12028
+ if (event.movementX === 0 && event.movementY === 0 || timeout.isStarted()) return;
12029
+ store.set("activeIndex", null);
12030
+ function scrollNextItem() {
12031
+ const scroller = store.state.listElement ?? popupRef.current;
12032
+ if (!scroller) return;
12033
+ store.set("activeIndex", null);
12034
+ handleScrollArrowVisibility();
12035
+ const maxScrollTop = getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);
12036
+ const scrollTop = normalizeScrollOffset(scroller.scrollTop, maxScrollTop);
12037
+ const isScrolledToEdge = scrollTop === (isUp ? 0 : maxScrollTop);
12038
+ const items = listRef.current;
12039
+ if (scrollTop !== scroller.scrollTop) scroller.scrollTop = scrollTop;
12040
+ if (items.length === 0) store.set(isUp ? "scrollUpArrowVisible" : "scrollDownArrowVisible", !isScrolledToEdge);
12041
+ if (isScrolledToEdge) {
12042
+ timeout.clear();
12043
+ return;
12044
+ }
12045
+ if (items.length > 0) {
12046
+ const scrollArrowHeight = scrollArrowRef.current?.offsetHeight || 0;
12047
+ scroller.scrollTop = getTargetScrollTop(items, isUp, scrollTop, scroller.clientHeight, scrollArrowHeight, maxScrollTop);
12048
+ }
12049
+ timeout.start(40, scrollNextItem);
12050
+ }
12051
+ timeout.start(40, scrollNextItem);
12052
+ },
12053
+ onMouseLeave() {
12054
+ timeout.clear();
12055
+ }
12056
+ }, elementProps]
12057
+ });
12058
+ if (!(visible || keepMounted)) return null;
12059
+ return element;
12060
+ });
12061
+ function getTargetScrollTop(items, isUp, scrollTop, clientHeight, scrollArrowHeight, maxScrollTop) {
12062
+ if (isUp) {
12063
+ let firstVisibleIndex = 0;
12064
+ const visibleTop = scrollTop + scrollArrowHeight - 1;
12065
+ for (let i = 0; i < items.length; i += 1) {
12066
+ const item = items[i];
12067
+ if (item && item.offsetTop >= visibleTop) {
12068
+ firstVisibleIndex = i;
12069
+ break;
12070
+ }
12071
+ }
12072
+ const targetIndex = Math.max(0, firstVisibleIndex - 1);
12073
+ const targetItem = items[targetIndex];
12074
+ return targetIndex < firstVisibleIndex && targetItem ? normalizeScrollOffset(targetItem.offsetTop - scrollArrowHeight, maxScrollTop) : 0;
12075
+ }
12076
+ let lastVisibleIndex = items.length - 1;
12077
+ const visibleBottom = scrollTop + clientHeight - scrollArrowHeight + 1;
12078
+ for (let i = 0; i < items.length; i += 1) {
12079
+ const item = items[i];
12080
+ if (item && item.offsetTop + item.offsetHeight > visibleBottom) {
12081
+ lastVisibleIndex = Math.max(0, i - 1);
12082
+ break;
12083
+ }
12084
+ }
12085
+ const targetIndex = Math.min(items.length - 1, lastVisibleIndex + 1);
12086
+ const targetItem = items[targetIndex];
12087
+ return targetIndex > lastVisibleIndex && targetItem ? normalizeScrollOffset(targetItem.offsetTop + targetItem.offsetHeight - clientHeight + scrollArrowHeight, maxScrollTop) : maxScrollTop;
12088
+ }
12089
+ //#endregion
12090
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/scroll-down-arrow/SelectScrollDownArrow.js
12091
+ /**
12092
+ * An element that scrolls the select popup down when hovered. Does not render when using touch input.
12093
+ * Renders a `<div>` element.
12094
+ *
12095
+ * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
12096
+ */
12097
+ var SelectScrollDownArrow = /* @__PURE__ */ import_react.forwardRef(function SelectScrollDownArrow(props, forwardedRef) {
12098
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollArrow, {
12099
+ ...props,
12100
+ ref: forwardedRef,
12101
+ direction: "down"
12102
+ });
12103
+ });
12104
+ //#endregion
12105
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/scroll-up-arrow/SelectScrollUpArrow.js
12106
+ /**
12107
+ * An element that scrolls the select popup up when hovered. Does not render when using touch input.
12108
+ * Renders a `<div>` element.
12109
+ *
12110
+ * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
12111
+ */
12112
+ var SelectScrollUpArrow = /* @__PURE__ */ import_react.forwardRef(function SelectScrollUpArrow(props, forwardedRef) {
12113
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollArrow, {
12114
+ ...props,
12115
+ ref: forwardedRef,
12116
+ direction: "up"
12117
+ });
12118
+ });
12119
+ //#endregion
12120
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/group/SelectGroupContext.js
12121
+ var SelectGroupContext = /* @__PURE__ */ import_react.createContext(void 0);
12122
+ //#endregion
12123
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/group/SelectGroup.js
12124
+ /**
12125
+ * Groups related select items with the corresponding label.
12126
+ * Renders a `<div>` element.
12127
+ *
12128
+ * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
12129
+ */
12130
+ var SelectGroup = /* @__PURE__ */ import_react.forwardRef(function SelectGroup(componentProps, forwardedRef) {
12131
+ const { render, className, style, ...elementProps } = componentProps;
12132
+ const [labelId, setLabelId] = import_react.useState();
12133
+ const contextValue = import_react.useMemo(() => ({
12134
+ labelId,
12135
+ setLabelId
12136
+ }), [labelId, setLabelId]);
12137
+ const element = useRenderElement("div", componentProps, {
12138
+ ref: forwardedRef,
12139
+ props: [{
12140
+ role: "group",
12141
+ "aria-labelledby": labelId
12142
+ }, elementProps]
12143
+ });
12144
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectGroupContext.Provider, {
12145
+ value: contextValue,
12146
+ children: element
12147
+ });
12148
+ });
12149
+ //#endregion
12150
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/toggle-group/ToggleGroupContext.js
12151
+ var ToggleGroupContext = /* @__PURE__ */ import_react.createContext(void 0);
12152
+ function useToggleGroupContext(optional = true) {
12153
+ const context = import_react.useContext(ToggleGroupContext);
12154
+ if (context === void 0 && !optional) throw new Error(formatErrorMessage(7));
12155
+ return context;
12156
+ }
12157
+ //#endregion
12158
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/item/useCompositeItem.js
12159
+ function useCompositeItem(params = {}) {
12160
+ const { highlightItemOnHover, highlightedIndex, onHighlightedIndexChange } = useCompositeRootContext();
12161
+ const { ref, index } = useCompositeListItem(params);
12162
+ const isHighlighted = highlightedIndex === index;
12163
+ const itemRef = import_react.useRef(null);
12164
+ const mergedRef = useMergedRefs(ref, itemRef);
12165
+ return {
12166
+ compositeProps: import_react.useMemo(() => ({
12167
+ tabIndex: isHighlighted ? 0 : -1,
12168
+ onFocus() {
12169
+ onHighlightedIndexChange(index);
12170
+ },
12171
+ onMouseMove() {
12172
+ const item = itemRef.current;
12173
+ if (!highlightItemOnHover || !item) return;
12174
+ const disabled = item.hasAttribute("disabled") || item.ariaDisabled === "true";
12175
+ if (!isHighlighted && !disabled) item.focus();
12176
+ }
12177
+ }), [
12178
+ isHighlighted,
12179
+ onHighlightedIndexChange,
12180
+ index,
12181
+ highlightItemOnHover
12182
+ ]),
12183
+ compositeRef: mergedRef,
12184
+ index
12185
+ };
12186
+ }
12187
+ //#endregion
12188
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/item/CompositeItem.js
12189
+ /**
12190
+ * @internal
12191
+ */
12192
+ function CompositeItem(componentProps) {
12193
+ const { render, className, style, state = EMPTY_OBJECT, props = EMPTY_ARRAY$1, refs = EMPTY_ARRAY$1, metadata, stateAttributesMapping, tag = "div", ...elementProps } = componentProps;
12194
+ const { compositeProps, compositeRef } = useCompositeItem({ metadata });
12195
+ return useRenderElement(tag, componentProps, {
12196
+ state,
12197
+ ref: [...refs, compositeRef],
12198
+ props: [
12199
+ compositeProps,
12200
+ ...props,
12201
+ elementProps
12202
+ ],
12203
+ stateAttributesMapping
12429
12204
  });
12430
- }));
12205
+ }
12431
12206
  //#endregion
12432
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/scroll-arrow/SelectScrollArrow.js
12207
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/toggle/Toggle.js
12433
12208
  /**
12434
- * @internal
12209
+ * A two-state button that can be on or off.
12210
+ * Renders a `<button>` element.
12211
+ *
12212
+ * Documentation: [Base UI Toggle](https://base-ui.com/react/components/toggle)
12435
12213
  */
12436
- var SelectScrollArrow = /* @__PURE__ */ import_react.forwardRef(function SelectScrollArrow(componentProps, forwardedRef) {
12437
- const { render, className, style, direction, keepMounted = false, ...elementProps } = componentProps;
12438
- const isUp = direction === "up";
12439
- const { store, popupRef, listRef, handleScrollArrowVisibility, scrollArrowsMountedCountRef } = useSelectRootContext();
12440
- const { side, scrollDownArrowRef, scrollUpArrowRef } = useSelectPositionerContext();
12441
- const stateVisible = useStore(store, isUp ? selectors.scrollUpArrowVisible : selectors.scrollDownArrowVisible);
12442
- const openMethod = useStore(store, selectors.openMethod);
12443
- const visible = stateVisible && openMethod !== "touch";
12444
- const timeout = useTimeout();
12445
- const scrollArrowRef = isUp ? scrollUpArrowRef : scrollDownArrowRef;
12446
- const { transitionStatus, setMounted } = useTransitionStatus(visible);
12447
- useIsoLayoutEffect(() => {
12448
- scrollArrowsMountedCountRef.current += 1;
12449
- if (!store.state.hasScrollArrows) store.set("hasScrollArrows", true);
12450
- return () => {
12451
- scrollArrowsMountedCountRef.current = Math.max(0, scrollArrowsMountedCountRef.current - 1);
12452
- if (scrollArrowsMountedCountRef.current === 0 && store.state.hasScrollArrows) store.set("hasScrollArrows", false);
12453
- };
12454
- }, [store, scrollArrowsMountedCountRef]);
12455
- useOpenChangeComplete({
12456
- open: visible,
12457
- ref: scrollArrowRef,
12458
- onComplete() {
12459
- if (!visible) setMounted(false);
12460
- }
12214
+ var Toggle = /* @__PURE__ */ import_react.forwardRef(function Toggle(componentProps, forwardedRef) {
12215
+ const { className, defaultPressed: defaultPressedProp = false, disabled: disabledProp = false, form, onPressedChange, pressed: pressedProp, render, type, value: valueProp, nativeButton = true, style, ...elementProps } = componentProps;
12216
+ const value = useBaseUiId(valueProp || void 0);
12217
+ const groupContext = useToggleGroupContext();
12218
+ const groupValue = groupContext?.value ?? [];
12219
+ const defaultPressed = groupContext ? void 0 : defaultPressedProp;
12220
+ const disabled = (disabledProp || groupContext?.disabled) ?? false;
12221
+ const [pressed, setPressedState] = useControlled({
12222
+ controlled: groupContext ? value !== void 0 && groupValue.indexOf(value) > -1 : pressedProp,
12223
+ default: defaultPressed,
12224
+ name: "Toggle",
12225
+ state: "pressed"
12461
12226
  });
12462
- const element = useRenderElement("div", componentProps, {
12463
- ref: [forwardedRef, scrollArrowRef],
12464
- state: {
12465
- direction,
12466
- visible,
12467
- side,
12468
- transitionStatus
12469
- },
12470
- props: [{
12471
- "aria-hidden": true,
12472
- children: isUp ? "▲" : "▼",
12473
- style: { position: "absolute" },
12474
- onMouseMove(event) {
12475
- if (event.movementX === 0 && event.movementY === 0 || timeout.isStarted()) return;
12476
- store.set("activeIndex", null);
12477
- function scrollNextItem() {
12478
- const scroller = store.state.listElement ?? popupRef.current;
12479
- if (!scroller) return;
12480
- store.set("activeIndex", null);
12481
- handleScrollArrowVisibility();
12482
- const maxScrollTop = getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);
12483
- const scrollTop = normalizeScrollOffset(scroller.scrollTop, maxScrollTop);
12484
- const isScrolledToEdge = scrollTop === (isUp ? 0 : maxScrollTop);
12485
- const items = listRef.current;
12486
- if (scrollTop !== scroller.scrollTop) scroller.scrollTop = scrollTop;
12487
- if (items.length === 0) store.set(isUp ? "scrollUpArrowVisible" : "scrollDownArrowVisible", !isScrolledToEdge);
12488
- if (isScrolledToEdge) {
12489
- timeout.clear();
12490
- return;
12491
- }
12492
- if (items.length > 0) {
12493
- const scrollArrowHeight = scrollArrowRef.current?.offsetHeight || 0;
12494
- scroller.scrollTop = getTargetScrollTop(items, isUp, scrollTop, scroller.clientHeight, scrollArrowHeight, maxScrollTop);
12495
- }
12496
- timeout.start(40, scrollNextItem);
12497
- }
12498
- timeout.start(40, scrollNextItem);
12499
- },
12500
- onMouseLeave() {
12501
- timeout.clear();
12227
+ const { getButtonProps, buttonRef } = useButton({
12228
+ disabled,
12229
+ native: nativeButton
12230
+ });
12231
+ const state = {
12232
+ disabled,
12233
+ pressed
12234
+ };
12235
+ const refs = [buttonRef, forwardedRef];
12236
+ const props = [
12237
+ {
12238
+ "aria-pressed": pressed,
12239
+ onClick(event) {
12240
+ const nextPressed = !pressed;
12241
+ const details = createChangeEventDetails(none, event.nativeEvent);
12242
+ if (value) groupContext?.setGroupValue?.(value, nextPressed, details);
12243
+ onPressedChange?.(nextPressed, details);
12244
+ if (details.isCanceled) return;
12245
+ setPressedState(nextPressed);
12502
12246
  }
12503
- }, elementProps]
12247
+ },
12248
+ elementProps,
12249
+ getButtonProps
12250
+ ];
12251
+ const element = useRenderElement("button", componentProps, {
12252
+ enabled: !groupContext,
12253
+ state,
12254
+ ref: refs,
12255
+ props
12256
+ });
12257
+ if (groupContext) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeItem, {
12258
+ tag: "button",
12259
+ render,
12260
+ className,
12261
+ style,
12262
+ state,
12263
+ refs,
12264
+ props
12504
12265
  });
12505
- if (!(visible || keepMounted)) return null;
12506
12266
  return element;
12507
12267
  });
12508
- function getTargetScrollTop(items, isUp, scrollTop, clientHeight, scrollArrowHeight, maxScrollTop) {
12509
- if (isUp) {
12510
- let firstVisibleIndex = 0;
12511
- const visibleTop = scrollTop + scrollArrowHeight - 1;
12512
- for (let i = 0; i < items.length; i += 1) {
12513
- const item = items[i];
12514
- if (item && item.offsetTop >= visibleTop) {
12515
- firstVisibleIndex = i;
12516
- break;
12268
+ //#endregion
12269
+ //#region ../../node_modules/.pnpm/@base-ui+utils@0.2.9_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/utils/esm/isElementDisabled.js
12270
+ function isElementDisabled(element) {
12271
+ return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
12272
+ }
12273
+ //#endregion
12274
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/root/useCompositeRoot.js
12275
+ var EMPTY_ARRAY = [];
12276
+ function useCompositeRoot(params) {
12277
+ const { itemSizes, cols = 1, loopFocus = true, onLoop, dense = false, orientation = "both", direction, highlightedIndex: externalHighlightedIndex, onHighlightedIndexChange: externalSetHighlightedIndex, rootRef: externalRef, enableHomeAndEndKeys = false, stopEventPropagation = false, disabledIndices, modifierKeys = EMPTY_ARRAY } = params;
12278
+ const [internalHighlightedIndex, internalSetHighlightedIndex] = import_react.useState(0);
12279
+ const isGrid = cols > 1;
12280
+ const rootRef = import_react.useRef(null);
12281
+ const mergedRef = useMergedRefs(rootRef, externalRef);
12282
+ const elementsRef = import_react.useRef([]);
12283
+ const hasSetDefaultIndexRef = import_react.useRef(false);
12284
+ const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;
12285
+ const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {
12286
+ (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);
12287
+ if (shouldScrollIntoView) {
12288
+ const newActiveItem = elementsRef.current[index];
12289
+ scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);
12290
+ }
12291
+ });
12292
+ const onMapChange = useStableCallback((map) => {
12293
+ if (map.size === 0 || hasSetDefaultIndexRef.current) return;
12294
+ hasSetDefaultIndexRef.current = true;
12295
+ const sortedElements = Array.from(map.keys());
12296
+ const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute("data-composite-item-active")) ?? null;
12297
+ const activeIndex = activeItem ? sortedElements.indexOf(activeItem) : -1;
12298
+ if (activeIndex !== -1) onHighlightedIndexChange(activeIndex);
12299
+ scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);
12300
+ });
12301
+ const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => {
12302
+ if (!onLoop) return nextIndex;
12303
+ return onLoop?.(event, prevIndex, nextIndex, elementsRef);
12304
+ });
12305
+ const props = import_react.useMemo(() => ({
12306
+ "aria-orientation": orientation === "both" ? void 0 : orientation,
12307
+ ref: mergedRef,
12308
+ onFocus(event) {
12309
+ const element = rootRef.current;
12310
+ const target = getTarget(event.nativeEvent);
12311
+ if (!element || target == null || !isNativeInput(target)) return;
12312
+ target.setSelectionRange(0, target.value.length ?? 0);
12313
+ },
12314
+ onKeyDown(event) {
12315
+ const RELEVANT_KEYS = enableHomeAndEndKeys ? COMPOSITE_KEYS : ARROW_KEYS;
12316
+ if (!RELEVANT_KEYS.has(event.key)) return;
12317
+ if (isModifierKeySet(event, modifierKeys)) return;
12318
+ if (!rootRef.current) return;
12319
+ const isRtl = direction === "rtl";
12320
+ const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT;
12321
+ const forwardKey = {
12322
+ horizontal: horizontalForwardKey,
12323
+ vertical: ARROW_DOWN,
12324
+ both: horizontalForwardKey
12325
+ }[orientation];
12326
+ const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT;
12327
+ const backwardKey = {
12328
+ horizontal: horizontalBackwardKey,
12329
+ vertical: ARROW_UP,
12330
+ both: horizontalBackwardKey
12331
+ }[orientation];
12332
+ const target = getTarget(event.nativeEvent);
12333
+ if (target != null && isNativeInput(target) && !isElementDisabled(target)) {
12334
+ const selectionStart = target.selectionStart;
12335
+ const selectionEnd = target.selectionEnd;
12336
+ const textContent = target.value ?? "";
12337
+ if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) return;
12338
+ if (event.key !== backwardKey && selectionStart < textContent.length) return;
12339
+ if (event.key !== forwardKey && selectionStart > 0) return;
12340
+ }
12341
+ let nextIndex = highlightedIndex;
12342
+ const minIndex = getMinListIndex(elementsRef, disabledIndices);
12343
+ const maxIndex = getMaxListIndex(elementsRef, disabledIndices);
12344
+ if (isGrid) {
12345
+ const sizes = itemSizes || Array.from({ length: elementsRef.current.length }, () => ({
12346
+ width: 1,
12347
+ height: 1
12348
+ }));
12349
+ const cellMap = createGridCellMap(sizes, cols, dense);
12350
+ const minGridIndex = cellMap.findIndex((index) => index != null && !isListIndexDisabled(elementsRef.current, index, disabledIndices));
12351
+ const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isListIndexDisabled(elementsRef.current, index, disabledIndices) ? cellIndex : foundIndex, -1);
12352
+ nextIndex = cellMap[getGridNavigatedIndex(cellMap.map((itemIndex) => itemIndex != null ? elementsRef.current[itemIndex] : null), {
12353
+ event,
12354
+ orientation,
12355
+ loopFocus,
12356
+ onLoop: wrappedOnLoop,
12357
+ cols,
12358
+ disabledIndices: getGridCellIndices([...disabledIndices || elementsRef.current.map((_, index) => isListIndexDisabled(elementsRef.current, index) ? index : void 0), void 0], cellMap),
12359
+ minIndex: minGridIndex,
12360
+ maxIndex: maxGridIndex,
12361
+ prevIndex: getGridCellIndexOfCorner(highlightedIndex > maxIndex ? minIndex : highlightedIndex, sizes, cellMap, cols, event.key === "ArrowDown" ? "bl" : event.key === "ArrowRight" ? "tr" : "tl"),
12362
+ rtl: isRtl
12363
+ })];
12364
+ }
12365
+ const forwardKeys = {
12366
+ horizontal: [horizontalForwardKey],
12367
+ vertical: [ARROW_DOWN],
12368
+ both: [horizontalForwardKey, ARROW_DOWN]
12369
+ }[orientation];
12370
+ const backwardKeys = {
12371
+ horizontal: [horizontalBackwardKey],
12372
+ vertical: [ARROW_UP],
12373
+ both: [horizontalBackwardKey, ARROW_UP]
12374
+ }[orientation];
12375
+ const preventedKeys = isGrid ? RELEVANT_KEYS : {
12376
+ horizontal: enableHomeAndEndKeys ? HORIZONTAL_KEYS_WITH_EXTRA_KEYS : HORIZONTAL_KEYS,
12377
+ vertical: enableHomeAndEndKeys ? VERTICAL_KEYS_WITH_EXTRA_KEYS : VERTICAL_KEYS,
12378
+ both: RELEVANT_KEYS
12379
+ }[orientation];
12380
+ if (enableHomeAndEndKeys) {
12381
+ if (event.key === "Home") nextIndex = minIndex;
12382
+ else if (event.key === "End") nextIndex = maxIndex;
12383
+ }
12384
+ if (nextIndex === highlightedIndex && (forwardKeys.includes(event.key) || backwardKeys.includes(event.key))) if (loopFocus && nextIndex === maxIndex && forwardKeys.includes(event.key)) {
12385
+ nextIndex = minIndex;
12386
+ if (onLoop) nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
12387
+ } else if (loopFocus && nextIndex === minIndex && backwardKeys.includes(event.key)) {
12388
+ nextIndex = maxIndex;
12389
+ if (onLoop) nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
12390
+ } else nextIndex = findNonDisabledListIndex(elementsRef.current, {
12391
+ startingIndex: nextIndex,
12392
+ decrement: backwardKeys.includes(event.key),
12393
+ disabledIndices
12394
+ });
12395
+ if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) {
12396
+ if (stopEventPropagation) event.stopPropagation();
12397
+ if (preventedKeys.has(event.key)) event.preventDefault();
12398
+ onHighlightedIndexChange(nextIndex, true);
12399
+ queueMicrotask(() => {
12400
+ elementsRef.current[nextIndex]?.focus();
12401
+ });
12517
12402
  }
12518
12403
  }
12519
- const targetIndex = Math.max(0, firstVisibleIndex - 1);
12520
- const targetItem = items[targetIndex];
12521
- return targetIndex < firstVisibleIndex && targetItem ? normalizeScrollOffset(targetItem.offsetTop - scrollArrowHeight, maxScrollTop) : 0;
12522
- }
12523
- let lastVisibleIndex = items.length - 1;
12524
- const visibleBottom = scrollTop + clientHeight - scrollArrowHeight + 1;
12525
- for (let i = 0; i < items.length; i += 1) {
12526
- const item = items[i];
12527
- if (item && item.offsetTop + item.offsetHeight > visibleBottom) {
12528
- lastVisibleIndex = Math.max(0, i - 1);
12529
- break;
12530
- }
12404
+ }), [
12405
+ cols,
12406
+ dense,
12407
+ direction,
12408
+ disabledIndices,
12409
+ elementsRef,
12410
+ enableHomeAndEndKeys,
12411
+ highlightedIndex,
12412
+ isGrid,
12413
+ itemSizes,
12414
+ loopFocus,
12415
+ onLoop,
12416
+ wrappedOnLoop,
12417
+ mergedRef,
12418
+ modifierKeys,
12419
+ onHighlightedIndexChange,
12420
+ orientation,
12421
+ stopEventPropagation
12422
+ ]);
12423
+ return import_react.useMemo(() => ({
12424
+ props,
12425
+ highlightedIndex,
12426
+ onHighlightedIndexChange,
12427
+ elementsRef,
12428
+ disabledIndices,
12429
+ onMapChange,
12430
+ relayKeyboardEvent: props.onKeyDown
12431
+ }), [
12432
+ props,
12433
+ highlightedIndex,
12434
+ onHighlightedIndexChange,
12435
+ elementsRef,
12436
+ disabledIndices,
12437
+ onMapChange
12438
+ ]);
12439
+ }
12440
+ function isModifierKeySet(event, ignoredModifierKeys) {
12441
+ for (const key of MODIFIER_KEYS.values()) {
12442
+ if (ignoredModifierKeys.includes(key)) continue;
12443
+ if (event.getModifierState(key)) return true;
12531
12444
  }
12532
- const targetIndex = Math.min(items.length - 1, lastVisibleIndex + 1);
12533
- const targetItem = items[targetIndex];
12534
- return targetIndex > lastVisibleIndex && targetItem ? normalizeScrollOffset(targetItem.offsetTop + targetItem.offsetHeight - clientHeight + scrollArrowHeight, maxScrollTop) : maxScrollTop;
12445
+ return false;
12535
12446
  }
12536
12447
  //#endregion
12537
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/scroll-down-arrow/SelectScrollDownArrow.js
12448
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/internals/composite/root/CompositeRoot.js
12538
12449
  /**
12539
- * An element that scrolls the select popup down when hovered. Does not render when using touch input.
12540
- * Renders a `<div>` element.
12541
- *
12542
- * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
12450
+ * @internal
12543
12451
  */
12544
- var SelectScrollDownArrow = /* @__PURE__ */ import_react.forwardRef(function SelectScrollDownArrow(props, forwardedRef) {
12545
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollArrow, {
12546
- ...props,
12547
- ref: forwardedRef,
12548
- direction: "down"
12452
+ function CompositeRoot(componentProps) {
12453
+ const { render, className, style, refs = EMPTY_ARRAY$1, props = EMPTY_ARRAY$1, state = EMPTY_OBJECT, stateAttributesMapping, highlightedIndex: highlightedIndexProp, onHighlightedIndexChange: onHighlightedIndexChangeProp, orientation, dense, itemSizes, loopFocus, onLoop, cols, enableHomeAndEndKeys, onMapChange: onMapChangeProp, stopEventPropagation = true, rootRef, disabledIndices, modifierKeys, highlightItemOnHover = false, tag = "div", ...elementProps } = componentProps;
12454
+ const { props: defaultProps, highlightedIndex, onHighlightedIndexChange, elementsRef, onMapChange: onMapChangeUnwrapped, relayKeyboardEvent } = useCompositeRoot({
12455
+ itemSizes,
12456
+ cols,
12457
+ loopFocus,
12458
+ onLoop,
12459
+ dense,
12460
+ orientation,
12461
+ highlightedIndex: highlightedIndexProp,
12462
+ onHighlightedIndexChange: onHighlightedIndexChangeProp,
12463
+ rootRef,
12464
+ stopEventPropagation,
12465
+ enableHomeAndEndKeys,
12466
+ direction: useDirection(),
12467
+ disabledIndices,
12468
+ modifierKeys
12549
12469
  });
12550
- });
12551
- //#endregion
12552
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/scroll-up-arrow/SelectScrollUpArrow.js
12553
- /**
12554
- * An element that scrolls the select popup up when hovered. Does not render when using touch input.
12555
- * Renders a `<div>` element.
12556
- *
12557
- * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
12558
- */
12559
- var SelectScrollUpArrow = /* @__PURE__ */ import_react.forwardRef(function SelectScrollUpArrow(props, forwardedRef) {
12560
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollArrow, {
12561
- ...props,
12562
- ref: forwardedRef,
12563
- direction: "up"
12470
+ const element = useRenderElement(tag, componentProps, {
12471
+ state,
12472
+ ref: refs,
12473
+ props: [
12474
+ defaultProps,
12475
+ ...props,
12476
+ elementProps
12477
+ ],
12478
+ stateAttributesMapping
12564
12479
  });
12565
- });
12480
+ const contextValue = import_react.useMemo(() => ({
12481
+ highlightedIndex,
12482
+ onHighlightedIndexChange,
12483
+ highlightItemOnHover,
12484
+ relayKeyboardEvent
12485
+ }), [
12486
+ highlightedIndex,
12487
+ onHighlightedIndexChange,
12488
+ highlightItemOnHover,
12489
+ relayKeyboardEvent
12490
+ ]);
12491
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeRootContext.Provider, {
12492
+ value: contextValue,
12493
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeList, {
12494
+ elementsRef,
12495
+ onMapChange: (newMap) => {
12496
+ onMapChangeProp?.(newMap);
12497
+ onMapChangeUnwrapped(newMap);
12498
+ },
12499
+ children: element
12500
+ })
12501
+ });
12502
+ }
12566
12503
  //#endregion
12567
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/group/SelectGroupContext.js
12568
- var SelectGroupContext = /* @__PURE__ */ import_react.createContext(void 0);
12504
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/toggle-group/ToggleGroupDataAttributes.js
12505
+ var ToggleGroupDataAttributes = /* @__PURE__ */ function(ToggleGroupDataAttributes) {
12506
+ /**
12507
+ * Present when the toggle group is disabled.
12508
+ */
12509
+ ToggleGroupDataAttributes["disabled"] = "data-disabled";
12510
+ /**
12511
+ * Indicates the orientation of the toggle group.
12512
+ * @type {'horizontal' | 'vertical'}
12513
+ */
12514
+ ToggleGroupDataAttributes["orientation"] = "data-orientation";
12515
+ /**
12516
+ * Present when the toggle group allows multiple buttons to be in the pressed state at the same time.
12517
+ */
12518
+ ToggleGroupDataAttributes["multiple"] = "data-multiple";
12519
+ return ToggleGroupDataAttributes;
12520
+ }({});
12569
12521
  //#endregion
12570
- //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/select/group/SelectGroup.js
12522
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.5.0_@types+react@19.2.15_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@base-ui/react/esm/toggle-group/ToggleGroup.js
12523
+ var stateAttributesMapping$1 = { multiple(value) {
12524
+ if (value) return { [ToggleGroupDataAttributes.multiple]: "" };
12525
+ return null;
12526
+ } };
12571
12527
  /**
12572
- * Groups related select items with the corresponding label.
12573
- * Renders a `<div>` element.
12528
+ * Provides a shared state to a series of toggle buttons.
12574
12529
  *
12575
- * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
12530
+ * Documentation: [Base UI Toggle Group](https://base-ui.com/react/components/toggle-group)
12576
12531
  */
12577
- var SelectGroup = /* @__PURE__ */ import_react.forwardRef(function SelectGroup(componentProps, forwardedRef) {
12578
- const { render, className, style, ...elementProps } = componentProps;
12579
- const [labelId, setLabelId] = import_react.useState();
12532
+ var ToggleGroup = /* @__PURE__ */ import_react.forwardRef(function ToggleGroup(componentProps, forwardedRef) {
12533
+ const { defaultValue: defaultValueProp, disabled: disabledProp = false, loopFocus = true, onValueChange, orientation = "horizontal", multiple = false, value: valueProp, className, render, style, ...elementProps } = componentProps;
12534
+ const toolbarContext = useToolbarRootContext(true);
12535
+ const isValueInitialized = import_react.useMemo(() => valueProp !== void 0 || defaultValueProp !== void 0, [valueProp, defaultValueProp]);
12536
+ const disabled = (toolbarContext?.disabled ?? false) || disabledProp;
12537
+ const [groupValue, setValueState] = useControlled({
12538
+ controlled: valueProp,
12539
+ default: valueProp === void 0 ? defaultValueProp ?? EMPTY_ARRAY$1 : void 0,
12540
+ name: "ToggleGroup",
12541
+ state: "value"
12542
+ });
12543
+ const setGroupValue = useStableCallback((newValue, nextPressed, eventDetails) => {
12544
+ let newGroupValue;
12545
+ if (multiple) {
12546
+ newGroupValue = groupValue.slice();
12547
+ if (nextPressed) newGroupValue.push(newValue);
12548
+ else newGroupValue.splice(groupValue.indexOf(newValue), 1);
12549
+ } else newGroupValue = nextPressed ? [newValue] : [];
12550
+ onValueChange?.(newGroupValue, eventDetails);
12551
+ if (eventDetails.isCanceled) return;
12552
+ setValueState(newGroupValue);
12553
+ });
12554
+ const state = {
12555
+ disabled,
12556
+ multiple,
12557
+ orientation
12558
+ };
12580
12559
  const contextValue = import_react.useMemo(() => ({
12581
- labelId,
12582
- setLabelId
12583
- }), [labelId, setLabelId]);
12560
+ disabled,
12561
+ orientation,
12562
+ setGroupValue,
12563
+ value: groupValue,
12564
+ isValueInitialized
12565
+ }), [
12566
+ disabled,
12567
+ orientation,
12568
+ setGroupValue,
12569
+ groupValue,
12570
+ isValueInitialized
12571
+ ]);
12572
+ const defaultProps = { role: "group" };
12584
12573
  const element = useRenderElement("div", componentProps, {
12574
+ enabled: Boolean(toolbarContext),
12575
+ state,
12585
12576
  ref: forwardedRef,
12586
- props: [{
12587
- role: "group",
12588
- "aria-labelledby": labelId
12589
- }, elementProps]
12577
+ props: [defaultProps, elementProps],
12578
+ stateAttributesMapping: stateAttributesMapping$1
12590
12579
  });
12591
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectGroupContext.Provider, {
12580
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupContext.Provider, {
12592
12581
  value: contextValue,
12593
- children: element
12582
+ children: toolbarContext ? element : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeRoot, {
12583
+ render,
12584
+ className,
12585
+ style,
12586
+ state,
12587
+ refs: [forwardedRef],
12588
+ props: [defaultProps, elementProps],
12589
+ stateAttributesMapping: stateAttributesMapping$1,
12590
+ loopFocus,
12591
+ enableHomeAndEndKeys: true,
12592
+ orientation
12593
+ })
12594
12594
  });
12595
12595
  });
12596
12596
  //#endregion
@@ -13987,4 +13987,4 @@ var SwitchThumb = /* @__PURE__ */ import_react.forwardRef(function SwitchThumb(c
13987
13987
  });
13988
13988
  });
13989
13989
  //#endregion
13990
- export { DialogDescription as A, TooltipRoot as B, Toggle as C, DialogTitle as D, DialogTrigger as E, TooltipArrow as F, useRender as G, require_react_dom as H, TooltipPopup as I, require_react as J, mergeProps as K, TooltipPositioner as L, DialogBackdrop as M, AlertDialogRoot as N, DialogPortal as O, TooltipProvider as P, TooltipPortal as R, ToggleGroup as S, AlertDialogTrigger as T, Separator as U, require_with_selector as V, Button as W, SelectPortal as _, SliderTrack as a, SelectTrigger as b, SelectGroup as c, SelectItemText as d, SelectItemIndicator as f, SelectPositioner as g, SelectPopup as h, SliderThumb as i, DialogClose as j, DialogPopup as k, SelectScrollUpArrow as l, SelectList as m, SwitchRoot as n, SliderControl as o, SelectItem as p, require_jsx_runtime as q, SliderIndicator as r, SliderRoot as s, SwitchThumb as t, SelectScrollDownArrow as u, SelectIcon as v, DialogRoot as w, SelectRoot as x, SelectValue as y, TooltipTrigger as z };
13990
+ export { DialogDescription as A, TooltipRoot as B, SelectRoot as C, DialogTitle as D, DialogTrigger as E, TooltipArrow as F, useRender as G, require_react_dom as H, TooltipPopup as I, require_react as J, mergeProps as K, TooltipPositioner as L, DialogBackdrop as M, AlertDialogRoot as N, DialogPortal as O, TooltipProvider as P, TooltipPortal as R, SelectTrigger as S, AlertDialogTrigger as T, Separator as U, require_with_selector as V, Button as W, SelectPopup as _, SliderTrack as a, SelectIcon as b, ToggleGroup as c, SelectScrollUpArrow as d, SelectScrollDownArrow as f, SelectList as g, SelectItem as h, SliderThumb as i, DialogClose as j, DialogPopup as k, Toggle as l, SelectItemIndicator as m, SwitchRoot as n, SliderControl as o, SelectItemText as p, require_jsx_runtime as q, SliderIndicator as r, SliderRoot as s, SwitchThumb as t, SelectGroup as u, SelectPositioner as v, DialogRoot as w, SelectValue as x, SelectPortal as y, TooltipTrigger as z };