@webskill/chatbot 0.24.3 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chatbot.css +25 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.js +1191 -280
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import { ActionBarPrimitive, AttachmentPrimitive, AuiProvider, ComposerPrimitive
|
|
|
23
23
|
import { BrowserWorkerScriptExecutor, WebOfficePolicy, capturePhoto, checkCameraAvailability, checkDictationAvailability, compressImageToBudget, createEncryptedMemoryStore, createLlmClient, createWebOfficeToolSource, deleteMemoryEncryptionKey, openCamera, openMemoryEncryptionKey, probeChromeBuiltinAvailability, startDictation, toDocumentImage } from "@webskill/sdk/browser";
|
|
24
24
|
import { JsonRenderSpecSurface, NativeSpecSurface, OpenUiSpecSurface, ReactBridgeState, SpecInteractionChannel, SurfaceFormTextsProvider, UiSurfaceSnapshotList, probeJsonRenderAvailability } from "@webskill/sdk/ui-react";
|
|
25
25
|
import { A2UI_SPEC_FORM_PATH, collectFormScopes, createUiCatalogToolSource, fromA2uiSpecAction, fromA2uiSurfaceAction, interactionToFormModel, interactionToUiSpec, loadOpenUiPeers, loadWebSkillLitCatalog, renderMiniChart, shapeInteractionValue, toA2uiSpecMessages, toA2uiSurfaceAction, toVercelToolInvocation, uiCatalog } from "@webskill/sdk/ui";
|
|
26
|
-
import { DownloadedFilePolicy, PAGE_ACTION_KINDS, SCROLL_DIRECTIONS, TodoStore, createDelegationToolSource, createDocumentToolSource, createDownloadedFileToolSource, createDwgToolSource, createPageActionToolSource, createPageImageToolSource, createPagePerceptionToolSource, createRemoteImageToolSource, createSkillGenerationToolSource, createSpreadsheetToolSource, createTabWorksetToolSource, createTableQueryToolSource, createTemplateToolSource, createTodoToolSource, profileTable, sniffDocumentFormat, withDelegationOrigin } from "@webskill/sdk/agent";
|
|
26
|
+
import { DownloadedFilePolicy, PAGE_ACTION_KINDS, SCROLL_DIRECTIONS, TodoStore, createDelegationToolSource, createDocumentToolSource, createDownloadedFileToolSource, createDwgToolSource, createPageActionToolSource, createPageImageToolSource, createPagePerceptionToolSource, createRemoteImageToolSource, createSkillGenerationToolSource, createSpreadsheetToolSource, createTabWorksetToolSource, createTableQueryToolSource, createTemplateToolSource, createTodoToolSource, isStreamingTableWorkbook, profileStreamingTable, profileTable, sniffDocumentFormat, summarizeStreamingWorkbook, withDelegationOrigin } from "@webskill/sdk/agent";
|
|
27
27
|
import { DataRenderers, Tools } from "@assistant-ui/core/react";
|
|
28
28
|
import { ModelContext, Suggestions } from "@assistant-ui/core/store";
|
|
29
29
|
import { Derived, attachTransformScopes, useClientLookup, useClientResource } from "@assistant-ui/store";
|
|
@@ -1572,8 +1572,8 @@ function CopyButton({ value, label, copiedLabel, className = "" }) {
|
|
|
1572
1572
|
|
|
1573
1573
|
//#endregion
|
|
1574
1574
|
//#region ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.5_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
1575
|
-
var __defProp$
|
|
1576
|
-
var __name$
|
|
1575
|
+
var __defProp$30 = Object.defineProperty;
|
|
1576
|
+
var __name$30 = (target, value) => __defProp$30(target, "name", {
|
|
1577
1577
|
value,
|
|
1578
1578
|
configurable: true
|
|
1579
1579
|
});
|
|
@@ -1581,7 +1581,7 @@ function setRef$2(ref, value) {
|
|
|
1581
1581
|
if (typeof ref === "function") return ref(value);
|
|
1582
1582
|
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
1583
1583
|
}
|
|
1584
|
-
__name$
|
|
1584
|
+
__name$30(setRef$2, "setRef");
|
|
1585
1585
|
function composeRefs$1(...refs) {
|
|
1586
1586
|
return (node) => {
|
|
1587
1587
|
let hasCleanup = false;
|
|
@@ -1599,16 +1599,16 @@ function composeRefs$1(...refs) {
|
|
|
1599
1599
|
};
|
|
1600
1600
|
};
|
|
1601
1601
|
}
|
|
1602
|
-
__name$
|
|
1602
|
+
__name$30(composeRefs$1, "composeRefs");
|
|
1603
1603
|
function useComposedRefs$1(...refs) {
|
|
1604
1604
|
return React$1.useCallback(composeRefs$1(...refs), refs);
|
|
1605
1605
|
}
|
|
1606
|
-
__name$
|
|
1606
|
+
__name$30(useComposedRefs$1, "useComposedRefs");
|
|
1607
1607
|
|
|
1608
1608
|
//#endregion
|
|
1609
1609
|
//#region ../../node_modules/.pnpm/@radix-ui+react-context@1.2.2_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
1610
|
-
var __defProp$
|
|
1611
|
-
var __name$
|
|
1610
|
+
var __defProp$29 = Object.defineProperty;
|
|
1611
|
+
var __name$29 = (target, value) => __defProp$29(target, "name", {
|
|
1612
1612
|
value,
|
|
1613
1613
|
configurable: true
|
|
1614
1614
|
});
|
|
@@ -1616,7 +1616,7 @@ var __name$27 = (target, value) => __defProp$27(target, "name", {
|
|
|
1616
1616
|
function createContext2(rootComponentName, defaultContext) {
|
|
1617
1617
|
const Context = React$1.createContext(defaultContext);
|
|
1618
1618
|
Context.displayName = rootComponentName + "Context";
|
|
1619
|
-
const Provider = /* @__PURE__ */ __name$
|
|
1619
|
+
const Provider = /* @__PURE__ */ __name$29((props) => {
|
|
1620
1620
|
const { children, ...context } = props;
|
|
1621
1621
|
const value = React$1.useMemo(() => context, Object.values(context));
|
|
1622
1622
|
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
@@ -1633,10 +1633,10 @@ function createContext2(rootComponentName, defaultContext) {
|
|
|
1633
1633
|
if (optional) return void 0;
|
|
1634
1634
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
1635
1635
|
}
|
|
1636
|
-
__name$
|
|
1636
|
+
__name$29(useContext2, "useContext");
|
|
1637
1637
|
return [Provider, useContext2];
|
|
1638
1638
|
}
|
|
1639
|
-
__name$
|
|
1639
|
+
__name$29(createContext2, "createContext");
|
|
1640
1640
|
// @__NO_SIDE_EFFECTS__
|
|
1641
1641
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
1642
1642
|
let defaultContexts = [];
|
|
@@ -1645,7 +1645,7 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
1645
1645
|
BaseContext.displayName = rootComponentName + "Context";
|
|
1646
1646
|
const index = defaultContexts.length;
|
|
1647
1647
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
1648
|
-
const Provider = /* @__PURE__ */ __name$
|
|
1648
|
+
const Provider = /* @__PURE__ */ __name$29((props) => {
|
|
1649
1649
|
const { scope, children, ...context } = props;
|
|
1650
1650
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
1651
1651
|
const value = React$1.useMemo(() => context, Object.values(context));
|
|
@@ -1664,15 +1664,15 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
1664
1664
|
if (optional) return void 0;
|
|
1665
1665
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
1666
1666
|
}
|
|
1667
|
-
__name$
|
|
1667
|
+
__name$29(useContext2, "useContext");
|
|
1668
1668
|
return [Provider, useContext2];
|
|
1669
1669
|
}
|
|
1670
|
-
__name$
|
|
1671
|
-
const createScope = /* @__PURE__ */ __name$
|
|
1670
|
+
__name$29(createContext3, "createContext");
|
|
1671
|
+
const createScope = /* @__PURE__ */ __name$29(() => {
|
|
1672
1672
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
1673
1673
|
return React$1.createContext(defaultContext);
|
|
1674
1674
|
});
|
|
1675
|
-
return /* @__PURE__ */ __name$
|
|
1675
|
+
return /* @__PURE__ */ __name$29(function useScope(scope) {
|
|
1676
1676
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
1677
1677
|
return React$1.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
1678
1678
|
...scope,
|
|
@@ -1683,16 +1683,16 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
1683
1683
|
createScope.scopeName = scopeName;
|
|
1684
1684
|
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
1685
1685
|
}
|
|
1686
|
-
__name$
|
|
1686
|
+
__name$29(createContextScope, "createContextScope");
|
|
1687
1687
|
function composeContextScopes(...scopes) {
|
|
1688
1688
|
const baseScope = scopes[0];
|
|
1689
1689
|
if (scopes.length === 1) return baseScope;
|
|
1690
|
-
const createScope = /* @__PURE__ */ __name$
|
|
1690
|
+
const createScope = /* @__PURE__ */ __name$29(() => {
|
|
1691
1691
|
const scopeHooks = scopes.map((createScope2) => ({
|
|
1692
1692
|
useScope: createScope2(),
|
|
1693
1693
|
scopeName: createScope2.scopeName
|
|
1694
1694
|
}));
|
|
1695
|
-
return /* @__PURE__ */ __name$
|
|
1695
|
+
return /* @__PURE__ */ __name$29(function useComposedScopes(overrideScopes) {
|
|
1696
1696
|
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
1697
1697
|
const currentScope = useScope(overrideScopes)[`__scope${scopeName}`];
|
|
1698
1698
|
return {
|
|
@@ -1706,33 +1706,33 @@ function composeContextScopes(...scopes) {
|
|
|
1706
1706
|
createScope.scopeName = baseScope.scopeName;
|
|
1707
1707
|
return createScope;
|
|
1708
1708
|
}
|
|
1709
|
-
__name$
|
|
1709
|
+
__name$29(composeContextScopes, "composeContextScopes");
|
|
1710
1710
|
|
|
1711
1711
|
//#endregion
|
|
1712
1712
|
//#region ../../node_modules/.pnpm/@radix-ui+primitive@1.1.7/node_modules/@radix-ui/primitive/dist/index.mjs
|
|
1713
|
-
var __defProp$
|
|
1714
|
-
var __name$
|
|
1713
|
+
var __defProp$28 = Object.defineProperty;
|
|
1714
|
+
var __name$28 = (target, value) => __defProp$28(target, "name", {
|
|
1715
1715
|
value,
|
|
1716
1716
|
configurable: true
|
|
1717
1717
|
});
|
|
1718
1718
|
var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
1719
1719
|
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
1720
|
-
return /* @__PURE__ */ __name$
|
|
1720
|
+
return /* @__PURE__ */ __name$28(function handleEvent(event) {
|
|
1721
1721
|
originalEventHandler?.(event);
|
|
1722
1722
|
if (checkForDefaultPrevented === false || !event || !event.defaultPrevented) return ourEventHandler?.(event);
|
|
1723
1723
|
}, "handleEvent");
|
|
1724
1724
|
}
|
|
1725
|
-
__name$
|
|
1725
|
+
__name$28(composeEventHandlers, "composeEventHandlers");
|
|
1726
1726
|
function getOwnerWindow(element) {
|
|
1727
1727
|
if (!canUseDOM) throw new Error("Cannot access window outside of the DOM");
|
|
1728
1728
|
return element?.ownerDocument?.defaultView ?? window;
|
|
1729
1729
|
}
|
|
1730
|
-
__name$
|
|
1730
|
+
__name$28(getOwnerWindow, "getOwnerWindow");
|
|
1731
1731
|
function getOwnerDocument(element) {
|
|
1732
1732
|
if (!canUseDOM) throw new Error("Cannot access document outside of the DOM");
|
|
1733
1733
|
return element?.ownerDocument ?? document;
|
|
1734
1734
|
}
|
|
1735
|
-
__name$
|
|
1735
|
+
__name$28(getOwnerDocument, "getOwnerDocument");
|
|
1736
1736
|
function getActiveElement(node, activeDescendant = false) {
|
|
1737
1737
|
const { activeElement } = getOwnerDocument(node);
|
|
1738
1738
|
if (!activeElement?.nodeName) return null;
|
|
@@ -1746,11 +1746,11 @@ function getActiveElement(node, activeDescendant = false) {
|
|
|
1746
1746
|
}
|
|
1747
1747
|
return activeElement;
|
|
1748
1748
|
}
|
|
1749
|
-
__name$
|
|
1749
|
+
__name$28(getActiveElement, "getActiveElement");
|
|
1750
1750
|
function isFrame(element) {
|
|
1751
1751
|
return element.tagName === "IFRAME";
|
|
1752
1752
|
}
|
|
1753
|
-
__name$
|
|
1753
|
+
__name$28(isFrame, "isFrame");
|
|
1754
1754
|
|
|
1755
1755
|
//#endregion
|
|
1756
1756
|
//#region ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.4_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
@@ -1758,8 +1758,8 @@ var useLayoutEffect2 = globalThis?.document ? React$1.useLayoutEffect : () => {}
|
|
|
1758
1758
|
|
|
1759
1759
|
//#endregion
|
|
1760
1760
|
//#region ../../node_modules/.pnpm/@radix-ui+react-use-effect-event@0.0.5_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-use-effect-event/dist/index.mjs
|
|
1761
|
-
var __defProp$
|
|
1762
|
-
var __name$
|
|
1761
|
+
var __defProp$27 = Object.defineProperty;
|
|
1762
|
+
var __name$27 = (target, value) => __defProp$27(target, "name", {
|
|
1763
1763
|
value,
|
|
1764
1764
|
configurable: true
|
|
1765
1765
|
});
|
|
@@ -1778,17 +1778,17 @@ function useEffectEvent$1(callback) {
|
|
|
1778
1778
|
});
|
|
1779
1779
|
return React$1.useMemo(() => ((...args) => ref.current?.(...args)), []);
|
|
1780
1780
|
}
|
|
1781
|
-
__name$
|
|
1781
|
+
__name$27(useEffectEvent$1, "useEffectEvent");
|
|
1782
1782
|
|
|
1783
1783
|
//#endregion
|
|
1784
1784
|
//#region ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.6_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
1785
|
-
var __defProp$
|
|
1786
|
-
var __name$
|
|
1785
|
+
var __defProp$26 = Object.defineProperty;
|
|
1786
|
+
var __name$26 = (target, value) => __defProp$26(target, "name", {
|
|
1787
1787
|
value,
|
|
1788
1788
|
configurable: true
|
|
1789
1789
|
});
|
|
1790
1790
|
var useInsertionEffect$1 = React$1[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
1791
|
-
function useControllableState({ prop, defaultProp, onChange = /* @__PURE__ */ __name$
|
|
1791
|
+
function useControllableState({ prop, defaultProp, onChange = /* @__PURE__ */ __name$26(() => {}, "onChange"), caller }) {
|
|
1792
1792
|
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
1793
1793
|
defaultProp,
|
|
1794
1794
|
onChange
|
|
@@ -1815,7 +1815,7 @@ function useControllableState({ prop, defaultProp, onChange = /* @__PURE__ */ __
|
|
|
1815
1815
|
onChangeRef
|
|
1816
1816
|
])];
|
|
1817
1817
|
}
|
|
1818
|
-
__name$
|
|
1818
|
+
__name$26(useControllableState, "useControllableState");
|
|
1819
1819
|
function useUncontrolledState({ defaultProp, onChange }) {
|
|
1820
1820
|
const [value, setValue] = React$1.useState(defaultProp);
|
|
1821
1821
|
const prevValueRef = React$1.useRef(value);
|
|
@@ -1835,11 +1835,11 @@ function useUncontrolledState({ defaultProp, onChange }) {
|
|
|
1835
1835
|
onChangeRef
|
|
1836
1836
|
];
|
|
1837
1837
|
}
|
|
1838
|
-
__name$
|
|
1838
|
+
__name$26(useUncontrolledState, "useUncontrolledState");
|
|
1839
1839
|
function isFunction(value) {
|
|
1840
1840
|
return typeof value === "function";
|
|
1841
1841
|
}
|
|
1842
|
-
__name$
|
|
1842
|
+
__name$26(isFunction, "isFunction");
|
|
1843
1843
|
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
|
1844
1844
|
function useControllableStateReducer(reducer, userArgs, initialArg, init) {
|
|
1845
1845
|
const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;
|
|
@@ -1898,12 +1898,12 @@ function useControllableStateReducer(reducer, userArgs, initialArg, init) {
|
|
|
1898
1898
|
]);
|
|
1899
1899
|
return [state, dispatch];
|
|
1900
1900
|
}
|
|
1901
|
-
__name$
|
|
1901
|
+
__name$26(useControllableStateReducer, "useControllableStateReducer");
|
|
1902
1902
|
|
|
1903
1903
|
//#endregion
|
|
1904
1904
|
//#region ../../node_modules/.pnpm/@radix-ui+react-use-size@1.1.4_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
1905
|
-
var __defProp$
|
|
1906
|
-
var __name$
|
|
1905
|
+
var __defProp$25 = Object.defineProperty;
|
|
1906
|
+
var __name$25 = (target, value) => __defProp$25(target, "name", {
|
|
1907
1907
|
value,
|
|
1908
1908
|
configurable: true
|
|
1909
1909
|
});
|
|
@@ -1941,22 +1941,22 @@ function useSize(element) {
|
|
|
1941
1941
|
}, [element]);
|
|
1942
1942
|
return size;
|
|
1943
1943
|
}
|
|
1944
|
-
__name$
|
|
1944
|
+
__name$25(useSize, "useSize");
|
|
1945
1945
|
|
|
1946
1946
|
//#endregion
|
|
1947
1947
|
//#region ../../node_modules/.pnpm/@radix-ui+react-presence@1.1.10_@types+react-dom@19.2.3_@types+react@19.2.17__@types+re_138587ba593102bdcf335a5673d92068/node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
1948
|
-
var __defProp$
|
|
1949
|
-
var __name$
|
|
1948
|
+
var __defProp$24 = Object.defineProperty;
|
|
1949
|
+
var __name$24 = (target, value) => __defProp$24(target, "name", {
|
|
1950
1950
|
value,
|
|
1951
1951
|
configurable: true
|
|
1952
1952
|
});
|
|
1953
|
-
function useStateMachine(initialState, machine) {
|
|
1953
|
+
function useStateMachine$1(initialState, machine) {
|
|
1954
1954
|
return React$1.useReducer((state, event) => {
|
|
1955
1955
|
return machine[state][event] ?? state;
|
|
1956
1956
|
}, initialState);
|
|
1957
1957
|
}
|
|
1958
|
-
__name$
|
|
1959
|
-
var Presence = /* @__PURE__ */ __name$
|
|
1958
|
+
__name$24(useStateMachine$1, "useStateMachine");
|
|
1959
|
+
var Presence = /* @__PURE__ */ __name$24((props) => {
|
|
1960
1960
|
const { present, children } = props;
|
|
1961
1961
|
const presence = usePresence$1(present);
|
|
1962
1962
|
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React$1.Children.only(children);
|
|
@@ -1969,7 +1969,7 @@ function usePresence$1(present) {
|
|
|
1969
1969
|
const prevPresentRef = React$1.useRef(present);
|
|
1970
1970
|
const prevAnimationNameRef = React$1.useRef("none");
|
|
1971
1971
|
const mountAnimationNameRef = React$1.useRef(void 0);
|
|
1972
|
-
const [state, send] = useStateMachine(present ? "mounted" : "unmounted", {
|
|
1972
|
+
const [state, send] = useStateMachine$1(present ? "mounted" : "unmounted", {
|
|
1973
1973
|
mounted: {
|
|
1974
1974
|
UNMOUNT: "unmounted",
|
|
1975
1975
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -2005,7 +2005,7 @@ function usePresence$1(present) {
|
|
|
2005
2005
|
if (node) {
|
|
2006
2006
|
let timeoutId;
|
|
2007
2007
|
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
2008
|
-
const handleAnimationEnd = /* @__PURE__ */ __name$
|
|
2008
|
+
const handleAnimationEnd = /* @__PURE__ */ __name$24((event) => {
|
|
2009
2009
|
const isCurrentAnimation = getAnimationName(stylesRef.current).includes(CSS.escape(event.animationName));
|
|
2010
2010
|
if (event.target === node && isCurrentAnimation) {
|
|
2011
2011
|
send("ANIMATION_END");
|
|
@@ -2018,7 +2018,7 @@ function usePresence$1(present) {
|
|
|
2018
2018
|
}
|
|
2019
2019
|
}
|
|
2020
2020
|
}, "handleAnimationEnd");
|
|
2021
|
-
const handleAnimationStart = /* @__PURE__ */ __name$
|
|
2021
|
+
const handleAnimationStart = /* @__PURE__ */ __name$24((event) => {
|
|
2022
2022
|
if (event.target === node) prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
2023
2023
|
}, "handleAnimationStart");
|
|
2024
2024
|
node.addEventListener("animationstart", handleAnimationStart);
|
|
@@ -2044,12 +2044,12 @@ function usePresence$1(present) {
|
|
|
2044
2044
|
}, [])
|
|
2045
2045
|
};
|
|
2046
2046
|
}
|
|
2047
|
-
__name$
|
|
2047
|
+
__name$24(usePresence$1, "usePresence");
|
|
2048
2048
|
function setRef$1(ref, value) {
|
|
2049
2049
|
if (typeof ref === "function") return ref(value);
|
|
2050
2050
|
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
2051
2051
|
}
|
|
2052
|
-
__name$
|
|
2052
|
+
__name$24(setRef$1, "setRef");
|
|
2053
2053
|
function useStableComposedRefs(...refs) {
|
|
2054
2054
|
const refsRef = React$1.useRef(refs);
|
|
2055
2055
|
refsRef.current = refs;
|
|
@@ -2070,11 +2070,11 @@ function useStableComposedRefs(...refs) {
|
|
|
2070
2070
|
};
|
|
2071
2071
|
}, []);
|
|
2072
2072
|
}
|
|
2073
|
-
__name$
|
|
2073
|
+
__name$24(useStableComposedRefs, "useStableComposedRefs");
|
|
2074
2074
|
function getAnimationName(styles) {
|
|
2075
2075
|
return styles?.animationName || "none";
|
|
2076
2076
|
}
|
|
2077
|
-
__name$
|
|
2077
|
+
__name$24(getAnimationName, "getAnimationName");
|
|
2078
2078
|
function getElementRef$1(element) {
|
|
2079
2079
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
2080
2080
|
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
@@ -2084,12 +2084,12 @@ function getElementRef$1(element) {
|
|
|
2084
2084
|
if (mayWarn) return element.props.ref;
|
|
2085
2085
|
return element.props.ref || element.ref;
|
|
2086
2086
|
}
|
|
2087
|
-
__name$
|
|
2087
|
+
__name$24(getElementRef$1, "getElementRef");
|
|
2088
2088
|
|
|
2089
2089
|
//#endregion
|
|
2090
2090
|
//#region ../../node_modules/.pnpm/@radix-ui+react-slot@1.3.3_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
2091
|
-
var __defProp$
|
|
2092
|
-
var __name$
|
|
2091
|
+
var __defProp$23 = Object.defineProperty;
|
|
2092
|
+
var __name$23 = (target, value) => __defProp$23(target, "name", {
|
|
2093
2093
|
value,
|
|
2094
2094
|
configurable: true
|
|
2095
2095
|
});
|
|
@@ -2126,17 +2126,17 @@ function createSlot(ownerName) {
|
|
|
2126
2126
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
2127
2127
|
return Slot2;
|
|
2128
2128
|
}
|
|
2129
|
-
__name$
|
|
2129
|
+
__name$23(createSlot, "createSlot");
|
|
2130
2130
|
var SLOTTABLE_IDENTIFIER = Symbol.for("radix.slottable");
|
|
2131
2131
|
// @__NO_SIDE_EFFECTS__
|
|
2132
2132
|
function createSlottable(ownerName) {
|
|
2133
|
-
const Slottable2 = /* @__PURE__ */ __name$
|
|
2133
|
+
const Slottable2 = /* @__PURE__ */ __name$23((props) => "child" in props ? props.children(props.child) : props.children, "Slottable");
|
|
2134
2134
|
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
2135
2135
|
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
2136
2136
|
return Slottable2;
|
|
2137
2137
|
}
|
|
2138
|
-
__name$
|
|
2139
|
-
var getSlottableElementFromSlottable = /* @__PURE__ */ __name$
|
|
2138
|
+
__name$23(createSlottable, "createSlottable");
|
|
2139
|
+
var getSlottableElementFromSlottable = /* @__PURE__ */ __name$23((slottable, child) => {
|
|
2140
2140
|
if ("child" in slottable.props) {
|
|
2141
2141
|
const child2 = slottable.props.child;
|
|
2142
2142
|
if (!React$1.isValidElement(child2)) return null;
|
|
@@ -2167,7 +2167,7 @@ function mergeProps(slotProps, childProps) {
|
|
|
2167
2167
|
...overrideProps
|
|
2168
2168
|
};
|
|
2169
2169
|
}
|
|
2170
|
-
__name$
|
|
2170
|
+
__name$23(mergeProps, "mergeProps");
|
|
2171
2171
|
function getElementRef(element) {
|
|
2172
2172
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
2173
2173
|
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
@@ -2177,32 +2177,32 @@ function getElementRef(element) {
|
|
|
2177
2177
|
if (mayWarn) return element.props.ref;
|
|
2178
2178
|
return element.props.ref || element.ref;
|
|
2179
2179
|
}
|
|
2180
|
-
__name$
|
|
2180
|
+
__name$23(getElementRef, "getElementRef");
|
|
2181
2181
|
function isSlottable(child) {
|
|
2182
2182
|
return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
2183
2183
|
}
|
|
2184
|
-
__name$
|
|
2184
|
+
__name$23(isSlottable, "isSlottable");
|
|
2185
2185
|
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
2186
2186
|
function isLazyComponent(element) {
|
|
2187
2187
|
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
2188
2188
|
}
|
|
2189
|
-
__name$
|
|
2189
|
+
__name$23(isLazyComponent, "isLazyComponent");
|
|
2190
2190
|
function isPromiseLike(value) {
|
|
2191
2191
|
return typeof value === "object" && value !== null && "then" in value;
|
|
2192
2192
|
}
|
|
2193
|
-
__name$
|
|
2194
|
-
var createSlotError = /* @__PURE__ */ __name$
|
|
2193
|
+
__name$23(isPromiseLike, "isPromiseLike");
|
|
2194
|
+
var createSlotError = /* @__PURE__ */ __name$23((ownerName) => {
|
|
2195
2195
|
return `${ownerName} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`;
|
|
2196
2196
|
}, "createSlotError");
|
|
2197
|
-
var createSlottableError = /* @__PURE__ */ __name$
|
|
2197
|
+
var createSlottableError = /* @__PURE__ */ __name$23((ownerName) => {
|
|
2198
2198
|
return `${ownerName} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`;
|
|
2199
2199
|
}, "createSlottableError");
|
|
2200
2200
|
var use = React$1[" use ".trim().toString()];
|
|
2201
2201
|
|
|
2202
2202
|
//#endregion
|
|
2203
2203
|
//#region ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.10_@types+react-dom@19.2.3_@types+react@19.2.17__@types+r_be17283a23f513d7b972453cc36e2a96/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
2204
|
-
var __defProp$
|
|
2205
|
-
var __name$
|
|
2204
|
+
var __defProp$22 = Object.defineProperty;
|
|
2205
|
+
var __name$22 = (target, value) => __defProp$22(target, "name", {
|
|
2206
2206
|
value,
|
|
2207
2207
|
configurable: true
|
|
2208
2208
|
});
|
|
@@ -2244,12 +2244,12 @@ var Primitive = [
|
|
|
2244
2244
|
function dispatchDiscreteCustomEvent(target, event) {
|
|
2245
2245
|
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
2246
2246
|
}
|
|
2247
|
-
__name$
|
|
2247
|
+
__name$22(dispatchDiscreteCustomEvent, "dispatchDiscreteCustomEvent");
|
|
2248
2248
|
|
|
2249
2249
|
//#endregion
|
|
2250
2250
|
//#region ../../node_modules/.pnpm/@radix-ui+react-collection@1.1.15_@types+react-dom@19.2.3_@types+react@19.2.17__@types+_e3b314e214d3788bd2a3a0fbdfeba189/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
2251
|
-
var __defProp$
|
|
2252
|
-
var __name$
|
|
2251
|
+
var __defProp$21 = Object.defineProperty;
|
|
2252
|
+
var __name$21 = (target, value) => __defProp$21(target, "name", {
|
|
2253
2253
|
value,
|
|
2254
2254
|
configurable: true
|
|
2255
2255
|
});
|
|
@@ -2261,7 +2261,7 @@ function createCollection(name) {
|
|
|
2261
2261
|
collectionRef: { current: null },
|
|
2262
2262
|
itemMap: /* @__PURE__ */ new Map()
|
|
2263
2263
|
});
|
|
2264
|
-
const CollectionProvider = /* @__PURE__ */ __name$
|
|
2264
|
+
const CollectionProvider = /* @__PURE__ */ __name$21((props) => {
|
|
2265
2265
|
const { scope, children } = props;
|
|
2266
2266
|
const ref = React$1.useRef(null);
|
|
2267
2267
|
const itemMap = React$1.useRef(/* @__PURE__ */ new Map()).current;
|
|
@@ -2315,7 +2315,7 @@ function createCollection(name) {
|
|
|
2315
2315
|
return Array.from(context.itemMap.values()).sort((a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current));
|
|
2316
2316
|
}, [context.collectionRef, context.itemMap]);
|
|
2317
2317
|
}
|
|
2318
|
-
__name$
|
|
2318
|
+
__name$21(useCollection, "useCollection");
|
|
2319
2319
|
return [
|
|
2320
2320
|
{
|
|
2321
2321
|
Provider: CollectionProvider,
|
|
@@ -2326,11 +2326,11 @@ function createCollection(name) {
|
|
|
2326
2326
|
createCollectionScope
|
|
2327
2327
|
];
|
|
2328
2328
|
}
|
|
2329
|
-
__name$
|
|
2329
|
+
__name$21(createCollection, "createCollection");
|
|
2330
2330
|
var __instanciated = /* @__PURE__ */ new WeakMap();
|
|
2331
2331
|
var OrderedDict = class _OrderedDict extends Map {
|
|
2332
2332
|
static {
|
|
2333
|
-
__name$
|
|
2333
|
+
__name$21(this, "OrderedDict");
|
|
2334
2334
|
}
|
|
2335
2335
|
#keys;
|
|
2336
2336
|
constructor(entries) {
|
|
@@ -2598,18 +2598,18 @@ function at(array, index) {
|
|
|
2598
2598
|
const actualIndex = toSafeIndex(array, index);
|
|
2599
2599
|
return actualIndex === -1 ? void 0 : array[actualIndex];
|
|
2600
2600
|
}
|
|
2601
|
-
__name$
|
|
2601
|
+
__name$21(at, "at");
|
|
2602
2602
|
function toSafeIndex(array, index) {
|
|
2603
2603
|
const length = array.length;
|
|
2604
2604
|
const relativeIndex = toSafeInteger(index);
|
|
2605
2605
|
const actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;
|
|
2606
2606
|
return actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;
|
|
2607
2607
|
}
|
|
2608
|
-
__name$
|
|
2608
|
+
__name$21(toSafeIndex, "toSafeIndex");
|
|
2609
2609
|
function toSafeInteger(number) {
|
|
2610
2610
|
return number !== number || number === 0 ? 0 : Math.trunc(number);
|
|
2611
2611
|
}
|
|
2612
|
-
__name$
|
|
2612
|
+
__name$21(toSafeInteger, "toSafeInteger");
|
|
2613
2613
|
// @__NO_SIDE_EFFECTS__
|
|
2614
2614
|
function createCollection2(name) {
|
|
2615
2615
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
@@ -2619,16 +2619,16 @@ function createCollection2(name) {
|
|
|
2619
2619
|
collectionRef: { current: null },
|
|
2620
2620
|
collectionRefObject: { current: null },
|
|
2621
2621
|
itemMap: new OrderedDict(),
|
|
2622
|
-
setItemMap: /* @__PURE__ */ __name$
|
|
2622
|
+
setItemMap: /* @__PURE__ */ __name$21(() => void 0, "setItemMap")
|
|
2623
2623
|
});
|
|
2624
|
-
const CollectionProvider = /* @__PURE__ */ __name$
|
|
2624
|
+
const CollectionProvider = /* @__PURE__ */ __name$21(({ state, ...props }) => {
|
|
2625
2625
|
return state ? /* @__PURE__ */ jsx(CollectionProviderImpl, {
|
|
2626
2626
|
...props,
|
|
2627
2627
|
state
|
|
2628
2628
|
}) : /* @__PURE__ */ jsx(CollectionInit, { ...props });
|
|
2629
2629
|
}, "CollectionProvider");
|
|
2630
2630
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
2631
|
-
const CollectionInit = /* @__PURE__ */ __name$
|
|
2631
|
+
const CollectionInit = /* @__PURE__ */ __name$21((props) => {
|
|
2632
2632
|
const state = useInitCollection();
|
|
2633
2633
|
return /* @__PURE__ */ jsx(CollectionProviderImpl, {
|
|
2634
2634
|
...props,
|
|
@@ -2636,7 +2636,7 @@ function createCollection2(name) {
|
|
|
2636
2636
|
});
|
|
2637
2637
|
}, "CollectionInit");
|
|
2638
2638
|
CollectionInit.displayName = PROVIDER_NAME + "Init";
|
|
2639
|
-
const CollectionProviderImpl = /* @__PURE__ */ __name$
|
|
2639
|
+
const CollectionProviderImpl = /* @__PURE__ */ __name$21((props) => {
|
|
2640
2640
|
const { scope, children, state } = props;
|
|
2641
2641
|
const ref = React$1.useRef(null);
|
|
2642
2642
|
const [collectionElement, setCollectionElement] = React$1.useState(null);
|
|
@@ -2725,12 +2725,12 @@ function createCollection2(name) {
|
|
|
2725
2725
|
function useInitCollection() {
|
|
2726
2726
|
return React$1.useState(new OrderedDict());
|
|
2727
2727
|
}
|
|
2728
|
-
__name$
|
|
2728
|
+
__name$21(useInitCollection, "useInitCollection");
|
|
2729
2729
|
function useCollection(scope) {
|
|
2730
2730
|
const { itemMap } = useCollectionContext(name + "CollectionConsumer", scope);
|
|
2731
2731
|
return itemMap;
|
|
2732
2732
|
}
|
|
2733
|
-
__name$
|
|
2733
|
+
__name$21(useCollection, "useCollection");
|
|
2734
2734
|
return [{
|
|
2735
2735
|
Provider: CollectionProvider,
|
|
2736
2736
|
Slot: CollectionSlot,
|
|
@@ -2741,7 +2741,7 @@ function createCollection2(name) {
|
|
|
2741
2741
|
useInitCollection
|
|
2742
2742
|
}];
|
|
2743
2743
|
}
|
|
2744
|
-
__name$
|
|
2744
|
+
__name$21(createCollection2, "createCollection");
|
|
2745
2745
|
function shallowEqual$1(a, b) {
|
|
2746
2746
|
if (a === b) return true;
|
|
2747
2747
|
if (typeof a !== "object" || typeof b !== "object") return false;
|
|
@@ -2755,15 +2755,15 @@ function shallowEqual$1(a, b) {
|
|
|
2755
2755
|
}
|
|
2756
2756
|
return true;
|
|
2757
2757
|
}
|
|
2758
|
-
__name$
|
|
2758
|
+
__name$21(shallowEqual$1, "shallowEqual");
|
|
2759
2759
|
function isElementPreceding(a, b) {
|
|
2760
2760
|
return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);
|
|
2761
2761
|
}
|
|
2762
|
-
__name$
|
|
2762
|
+
__name$21(isElementPreceding, "isElementPreceding");
|
|
2763
2763
|
function sortByDocumentPosition(a, b) {
|
|
2764
2764
|
return !a[1].element || !b[1].element ? 0 : isElementPreceding(a[1].element, b[1].element) ? -1 : 1;
|
|
2765
2765
|
}
|
|
2766
|
-
__name$
|
|
2766
|
+
__name$21(sortByDocumentPosition, "sortByDocumentPosition");
|
|
2767
2767
|
function getChildListObserver(callback) {
|
|
2768
2768
|
return new MutationObserver((mutationsList) => {
|
|
2769
2769
|
for (const mutation of mutationsList) if (mutation.type === "childList") {
|
|
@@ -2772,12 +2772,12 @@ function getChildListObserver(callback) {
|
|
|
2772
2772
|
}
|
|
2773
2773
|
});
|
|
2774
2774
|
}
|
|
2775
|
-
__name$
|
|
2775
|
+
__name$21(getChildListObserver, "getChildListObserver");
|
|
2776
2776
|
|
|
2777
2777
|
//#endregion
|
|
2778
2778
|
//#region ../../node_modules/.pnpm/@radix-ui+react-direction@1.1.4_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
2779
|
-
var __defProp$
|
|
2780
|
-
var __name$
|
|
2779
|
+
var __defProp$20 = Object.defineProperty;
|
|
2780
|
+
var __name$20 = (target, value) => __defProp$20(target, "name", {
|
|
2781
2781
|
value,
|
|
2782
2782
|
configurable: true
|
|
2783
2783
|
});
|
|
@@ -2786,12 +2786,12 @@ function useDirection(localDir) {
|
|
|
2786
2786
|
const globalDir = React$1.useContext(DirectionContext);
|
|
2787
2787
|
return localDir || globalDir || "ltr";
|
|
2788
2788
|
}
|
|
2789
|
-
__name$
|
|
2789
|
+
__name$20(useDirection, "useDirection");
|
|
2790
2790
|
|
|
2791
2791
|
//#endregion
|
|
2792
2792
|
//#region ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.4_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
2793
|
-
var __defProp$
|
|
2794
|
-
var __name$
|
|
2793
|
+
var __defProp$19 = Object.defineProperty;
|
|
2794
|
+
var __name$19 = (target, value) => __defProp$19(target, "name", {
|
|
2795
2795
|
value,
|
|
2796
2796
|
configurable: true
|
|
2797
2797
|
});
|
|
@@ -2802,12 +2802,12 @@ function useCallbackRef$1(callback) {
|
|
|
2802
2802
|
});
|
|
2803
2803
|
return React$1.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);
|
|
2804
2804
|
}
|
|
2805
|
-
__name$
|
|
2805
|
+
__name$19(useCallbackRef$1, "useCallbackRef");
|
|
2806
2806
|
|
|
2807
2807
|
//#endregion
|
|
2808
2808
|
//#region ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.19_@types+react-dom@19.2.3_@types+react@19.2.17___1726272c044b69ad8799cdb51c1704df/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
2809
|
-
var __defProp$
|
|
2810
|
-
var __name$
|
|
2809
|
+
var __defProp$18 = Object.defineProperty;
|
|
2810
|
+
var __name$18 = (target, value) => __defProp$18(target, "name", {
|
|
2811
2811
|
value,
|
|
2812
2812
|
configurable: true
|
|
2813
2813
|
});
|
|
@@ -2821,7 +2821,7 @@ var DismissableLayerContext = React$1.createContext({
|
|
|
2821
2821
|
branches: /* @__PURE__ */ new Set(),
|
|
2822
2822
|
dismissableSurfaces: /* @__PURE__ */ new Set()
|
|
2823
2823
|
});
|
|
2824
|
-
var DismissableLayer = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
2824
|
+
var DismissableLayer = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$18(function DismissableLayer2(props, forwardedRef) {
|
|
2825
2825
|
const { disableOutsidePointerEvents = false, deferPointerDownOutside = false, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, ...layerProps } = props;
|
|
2826
2826
|
const context = React$1.useContext(DismissableLayerContext);
|
|
2827
2827
|
const [node, setNode] = React$1.useState(null);
|
|
@@ -2908,7 +2908,7 @@ var DismissableLayer = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name
|
|
|
2908
2908
|
};
|
|
2909
2909
|
}, [node, context]);
|
|
2910
2910
|
React$1.useEffect(() => {
|
|
2911
|
-
const handleUpdate = /* @__PURE__ */ __name$
|
|
2911
|
+
const handleUpdate = /* @__PURE__ */ __name$18(() => force({}), "handleUpdate");
|
|
2912
2912
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
2913
2913
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
2914
2914
|
}, []);
|
|
@@ -2924,7 +2924,7 @@ var DismissableLayer = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name
|
|
|
2924
2924
|
onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
2925
2925
|
});
|
|
2926
2926
|
}, "DismissableLayer"));
|
|
2927
|
-
var DismissableLayerBranch = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
2927
|
+
var DismissableLayerBranch = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$18(function DismissableLayerBranch2(props, forwardedRef) {
|
|
2928
2928
|
const context = React$1.useContext(DismissableLayerContext);
|
|
2929
2929
|
const ref = React$1.useRef(null);
|
|
2930
2930
|
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
@@ -2954,8 +2954,8 @@ function useDismissableLayerSurface() {
|
|
|
2954
2954
|
}, [node, context.dismissableSurfaces]);
|
|
2955
2955
|
return setNode;
|
|
2956
2956
|
}
|
|
2957
|
-
__name$
|
|
2958
|
-
var IS_TRUE = /* @__PURE__ */ __name$
|
|
2957
|
+
__name$18(useDismissableLayerSurface, "useDismissableLayerSurface");
|
|
2958
|
+
var IS_TRUE = /* @__PURE__ */ __name$18(() => true, "IS_TRUE");
|
|
2959
2959
|
function usePointerDownOutside(onPointerDownOutside, args) {
|
|
2960
2960
|
const { ownerDocument = globalThis?.document, deferPointerDownOutside = false, isDeferredPointerDownOutsideRef, dismissableSurfaces, shouldHandlePointerDownOutside = IS_TRUE } = args;
|
|
2961
2961
|
const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside);
|
|
@@ -2969,11 +2969,11 @@ function usePointerDownOutside(onPointerDownOutside, args) {
|
|
|
2969
2969
|
isDeferredPointerDownOutsideRef.current = false;
|
|
2970
2970
|
interceptedOutsideInteractionEventsRef.current.clear();
|
|
2971
2971
|
}
|
|
2972
|
-
__name$
|
|
2972
|
+
__name$18(resetOutsideInteraction, "resetOutsideInteraction");
|
|
2973
2973
|
function isOutsideInteractionIntercepted() {
|
|
2974
2974
|
return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean);
|
|
2975
2975
|
}
|
|
2976
|
-
__name$
|
|
2976
|
+
__name$18(isOutsideInteractionIntercepted, "isOutsideInteractionIntercepted");
|
|
2977
2977
|
function handleInteractionCapture(event) {
|
|
2978
2978
|
if (!isPointerDownOutsideRef.current) return;
|
|
2979
2979
|
const target = event.target;
|
|
@@ -2982,12 +2982,12 @@ function usePointerDownOutside(onPointerDownOutside, args) {
|
|
|
2982
2982
|
if (isPointerDownOutsideRef.current) handleClickRef.current();
|
|
2983
2983
|
}, 0);
|
|
2984
2984
|
}
|
|
2985
|
-
__name$
|
|
2985
|
+
__name$18(handleInteractionCapture, "handleInteractionCapture");
|
|
2986
2986
|
function handleInteractionBubble(event) {
|
|
2987
2987
|
if (isPointerDownOutsideRef.current) interceptedOutsideInteractionEventsRef.current.set(event.type, false);
|
|
2988
2988
|
}
|
|
2989
|
-
__name$
|
|
2990
|
-
const handlePointerDown = /* @__PURE__ */ __name$
|
|
2989
|
+
__name$18(handleInteractionBubble, "handleInteractionBubble");
|
|
2990
|
+
const handlePointerDown = /* @__PURE__ */ __name$18((event) => {
|
|
2991
2991
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
2992
2992
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
2993
2993
|
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
@@ -2995,7 +2995,7 @@ function usePointerDownOutside(onPointerDownOutside, args) {
|
|
|
2995
2995
|
resetOutsideInteraction();
|
|
2996
2996
|
if (!wasOutsideInteractionIntercepted) handleAndDispatchCustomEvent$1(POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, { discrete: true });
|
|
2997
2997
|
};
|
|
2998
|
-
__name$
|
|
2998
|
+
__name$18(handleAndDispatchPointerDownOutsideEvent2, "handleAndDispatchPointerDownOutsideEvent");
|
|
2999
2999
|
if (!shouldHandlePointerDownOutside(event.target)) {
|
|
3000
3000
|
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
3001
3001
|
resetOutsideInteraction();
|
|
@@ -3050,30 +3050,30 @@ function usePointerDownOutside(onPointerDownOutside, args) {
|
|
|
3050
3050
|
dismissableSurfaces,
|
|
3051
3051
|
shouldHandlePointerDownOutside
|
|
3052
3052
|
]);
|
|
3053
|
-
return { onPointerDownCapture: /* @__PURE__ */ __name$
|
|
3053
|
+
return { onPointerDownCapture: /* @__PURE__ */ __name$18(() => isPointerInsideReactTreeRef.current = true, "onPointerDownCapture") };
|
|
3054
3054
|
}
|
|
3055
|
-
__name$
|
|
3055
|
+
__name$18(usePointerDownOutside, "usePointerDownOutside");
|
|
3056
3056
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
3057
3057
|
const handleFocusOutside = useCallbackRef$1(onFocusOutside);
|
|
3058
3058
|
const isFocusInsideReactTreeRef = React$1.useRef(false);
|
|
3059
3059
|
React$1.useEffect(() => {
|
|
3060
|
-
const handleFocus = /* @__PURE__ */ __name$
|
|
3060
|
+
const handleFocus = /* @__PURE__ */ __name$18((event) => {
|
|
3061
3061
|
if (event.target && !isFocusInsideReactTreeRef.current) handleAndDispatchCustomEvent$1(FOCUS_OUTSIDE, handleFocusOutside, { originalEvent: event }, { discrete: false });
|
|
3062
3062
|
}, "handleFocus");
|
|
3063
3063
|
ownerDocument.addEventListener("focusin", handleFocus);
|
|
3064
3064
|
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
3065
3065
|
}, [ownerDocument, handleFocusOutside]);
|
|
3066
3066
|
return {
|
|
3067
|
-
onFocusCapture: /* @__PURE__ */ __name$
|
|
3068
|
-
onBlurCapture: /* @__PURE__ */ __name$
|
|
3067
|
+
onFocusCapture: /* @__PURE__ */ __name$18(() => isFocusInsideReactTreeRef.current = true, "onFocusCapture"),
|
|
3068
|
+
onBlurCapture: /* @__PURE__ */ __name$18(() => isFocusInsideReactTreeRef.current = false, "onBlurCapture")
|
|
3069
3069
|
};
|
|
3070
3070
|
}
|
|
3071
|
-
__name$
|
|
3071
|
+
__name$18(useFocusOutside, "useFocusOutside");
|
|
3072
3072
|
function dispatchUpdate() {
|
|
3073
3073
|
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
3074
3074
|
document.dispatchEvent(event);
|
|
3075
3075
|
}
|
|
3076
|
-
__name$
|
|
3076
|
+
__name$18(dispatchUpdate, "dispatchUpdate");
|
|
3077
3077
|
function handleAndDispatchCustomEvent$1(name, handler, detail, { discrete }) {
|
|
3078
3078
|
const target = detail.originalEvent.target;
|
|
3079
3079
|
const event = new CustomEvent(name, {
|
|
@@ -3085,14 +3085,14 @@ function handleAndDispatchCustomEvent$1(name, handler, detail, { discrete }) {
|
|
|
3085
3085
|
if (discrete) dispatchDiscreteCustomEvent(target, event);
|
|
3086
3086
|
else target.dispatchEvent(event);
|
|
3087
3087
|
}
|
|
3088
|
-
__name$
|
|
3089
|
-
var Root$
|
|
3088
|
+
__name$18(handleAndDispatchCustomEvent$1, "handleAndDispatchCustomEvent");
|
|
3089
|
+
var Root$5 = DismissableLayer;
|
|
3090
3090
|
var Branch = DismissableLayerBranch;
|
|
3091
3091
|
|
|
3092
3092
|
//#endregion
|
|
3093
3093
|
//#region ../../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.6_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
3094
|
-
var __defProp$
|
|
3095
|
-
var __name$
|
|
3094
|
+
var __defProp$17 = Object.defineProperty;
|
|
3095
|
+
var __name$17 = (target, value) => __defProp$17(target, "name", {
|
|
3096
3096
|
value,
|
|
3097
3097
|
configurable: true
|
|
3098
3098
|
});
|
|
@@ -3102,7 +3102,7 @@ function FocusGuards(props) {
|
|
|
3102
3102
|
useFocusGuards();
|
|
3103
3103
|
return props.children;
|
|
3104
3104
|
}
|
|
3105
|
-
__name$
|
|
3105
|
+
__name$17(FocusGuards, "FocusGuards");
|
|
3106
3106
|
function useFocusGuards() {
|
|
3107
3107
|
React$1.useEffect(() => {
|
|
3108
3108
|
if (!guards) guards = {
|
|
@@ -3123,7 +3123,7 @@ function useFocusGuards() {
|
|
|
3123
3123
|
};
|
|
3124
3124
|
}, []);
|
|
3125
3125
|
}
|
|
3126
|
-
__name$
|
|
3126
|
+
__name$17(useFocusGuards, "useFocusGuards");
|
|
3127
3127
|
function createFocusGuard() {
|
|
3128
3128
|
const element = document.createElement("span");
|
|
3129
3129
|
element.setAttribute("data-radix-focus-guard", "");
|
|
@@ -3134,12 +3134,12 @@ function createFocusGuard() {
|
|
|
3134
3134
|
element.style.pointerEvents = "none";
|
|
3135
3135
|
return element;
|
|
3136
3136
|
}
|
|
3137
|
-
__name$
|
|
3137
|
+
__name$17(createFocusGuard, "createFocusGuard");
|
|
3138
3138
|
|
|
3139
3139
|
//#endregion
|
|
3140
3140
|
//#region ../../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.16_@types+react-dom@19.2.3_@types+react@19.2.17__@types_688a7092b7a27f27c45d3c59450c400f/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
3141
|
-
var __defProp$
|
|
3142
|
-
var __name$
|
|
3141
|
+
var __defProp$16 = Object.defineProperty;
|
|
3142
|
+
var __name$16 = (target, value) => __defProp$16(target, "name", {
|
|
3143
3143
|
value,
|
|
3144
3144
|
configurable: true
|
|
3145
3145
|
});
|
|
@@ -3149,7 +3149,7 @@ var EVENT_OPTIONS$1 = {
|
|
|
3149
3149
|
bubbles: false,
|
|
3150
3150
|
cancelable: true
|
|
3151
3151
|
};
|
|
3152
|
-
var FocusScope = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
3152
|
+
var FocusScope = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$16(function FocusScope2(props, forwardedRef) {
|
|
3153
3153
|
const { loop = false, trapped = false, onMountAutoFocus: onMountAutoFocusProp, onUnmountAutoFocus: onUnmountAutoFocusProp, ...scopeProps } = props;
|
|
3154
3154
|
const [container, setContainer] = React$1.useState(null);
|
|
3155
3155
|
const onMountAutoFocus = useCallbackRef$1(onMountAutoFocusProp);
|
|
@@ -3181,9 +3181,9 @@ var FocusScope = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$14(fu
|
|
|
3181
3181
|
if (document.activeElement !== document.body) return;
|
|
3182
3182
|
for (const mutation of mutations) if (mutation.removedNodes.length > 0) focus(container);
|
|
3183
3183
|
};
|
|
3184
|
-
__name$
|
|
3185
|
-
__name$
|
|
3186
|
-
__name$
|
|
3184
|
+
__name$16(handleFocusIn2, "handleFocusIn");
|
|
3185
|
+
__name$16(handleFocusOut2, "handleFocusOut");
|
|
3186
|
+
__name$16(handleMutations2, "handleMutations");
|
|
3187
3187
|
document.addEventListener("focusin", handleFocusIn2);
|
|
3188
3188
|
document.addEventListener("focusout", handleFocusOut2);
|
|
3189
3189
|
const mutationObserver = new MutationObserver(handleMutations2);
|
|
@@ -3270,15 +3270,15 @@ function focusFirst$3(candidates, { select = false } = {}) {
|
|
|
3270
3270
|
if (document.activeElement !== previouslyFocusedElement) return;
|
|
3271
3271
|
}
|
|
3272
3272
|
}
|
|
3273
|
-
__name$
|
|
3273
|
+
__name$16(focusFirst$3, "focusFirst");
|
|
3274
3274
|
function getTabbableEdges(container) {
|
|
3275
3275
|
const candidates = getTabbableCandidates$1(container);
|
|
3276
3276
|
return [findVisible(candidates, container), findVisible(candidates.reverse(), container)];
|
|
3277
3277
|
}
|
|
3278
|
-
__name$
|
|
3278
|
+
__name$16(getTabbableEdges, "getTabbableEdges");
|
|
3279
3279
|
function getTabbableCandidates$1(container) {
|
|
3280
3280
|
const nodes = [];
|
|
3281
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */ __name$
|
|
3281
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */ __name$16((node) => {
|
|
3282
3282
|
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
3283
3283
|
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
3284
3284
|
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
@@ -3286,12 +3286,12 @@ function getTabbableCandidates$1(container) {
|
|
|
3286
3286
|
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
3287
3287
|
return nodes;
|
|
3288
3288
|
}
|
|
3289
|
-
__name$
|
|
3289
|
+
__name$16(getTabbableCandidates$1, "getTabbableCandidates");
|
|
3290
3290
|
function findVisible(elements, container) {
|
|
3291
3291
|
const canUseCheckVisibility = typeof container.checkVisibility === "function" && container.checkVisibility({ checkVisibilityCSS: true });
|
|
3292
3292
|
for (const element of elements) if (!(canUseCheckVisibility ? !element.checkVisibility({ checkVisibilityCSS: true }) : isHidden(element, { upTo: container }))) return element;
|
|
3293
3293
|
}
|
|
3294
|
-
__name$
|
|
3294
|
+
__name$16(findVisible, "findVisible");
|
|
3295
3295
|
function isHidden(node, { upTo }) {
|
|
3296
3296
|
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
3297
3297
|
while (node) {
|
|
@@ -3301,11 +3301,11 @@ function isHidden(node, { upTo }) {
|
|
|
3301
3301
|
}
|
|
3302
3302
|
return false;
|
|
3303
3303
|
}
|
|
3304
|
-
__name$
|
|
3304
|
+
__name$16(isHidden, "isHidden");
|
|
3305
3305
|
function isSelectableInput(element) {
|
|
3306
3306
|
return element instanceof HTMLInputElement && "select" in element;
|
|
3307
3307
|
}
|
|
3308
|
-
__name$
|
|
3308
|
+
__name$16(isSelectableInput, "isSelectableInput");
|
|
3309
3309
|
function focus(element, { select = false } = {}) {
|
|
3310
3310
|
if (element && element.focus) {
|
|
3311
3311
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -3313,7 +3313,7 @@ function focus(element, { select = false } = {}) {
|
|
|
3313
3313
|
if (element !== previouslyFocusedElement && isSelectableInput(element) && select) element.select();
|
|
3314
3314
|
}
|
|
3315
3315
|
}
|
|
3316
|
-
__name$
|
|
3316
|
+
__name$16(focus, "focus");
|
|
3317
3317
|
var focusScopesStack = createFocusScopesStack();
|
|
3318
3318
|
function createFocusScopesStack() {
|
|
3319
3319
|
let stack = [];
|
|
@@ -3330,23 +3330,23 @@ function createFocusScopesStack() {
|
|
|
3330
3330
|
}
|
|
3331
3331
|
};
|
|
3332
3332
|
}
|
|
3333
|
-
__name$
|
|
3333
|
+
__name$16(createFocusScopesStack, "createFocusScopesStack");
|
|
3334
3334
|
function arrayRemove(array, item) {
|
|
3335
3335
|
const updatedArray = [...array];
|
|
3336
3336
|
const index = updatedArray.indexOf(item);
|
|
3337
3337
|
if (index !== -1) updatedArray.splice(index, 1);
|
|
3338
3338
|
return updatedArray;
|
|
3339
3339
|
}
|
|
3340
|
-
__name$
|
|
3340
|
+
__name$16(arrayRemove, "arrayRemove");
|
|
3341
3341
|
function removeLinks(items) {
|
|
3342
3342
|
return items.filter((item) => item.tagName !== "A");
|
|
3343
3343
|
}
|
|
3344
|
-
__name$
|
|
3344
|
+
__name$16(removeLinks, "removeLinks");
|
|
3345
3345
|
|
|
3346
3346
|
//#endregion
|
|
3347
3347
|
//#region ../../node_modules/.pnpm/@radix-ui+react-id@1.1.4_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
3348
|
-
var __defProp$
|
|
3349
|
-
var __name$
|
|
3348
|
+
var __defProp$15 = Object.defineProperty;
|
|
3349
|
+
var __name$15 = (target, value) => __defProp$15(target, "name", {
|
|
3350
3350
|
value,
|
|
3351
3351
|
configurable: true
|
|
3352
3352
|
});
|
|
@@ -3359,7 +3359,7 @@ function useId$1(deterministicId) {
|
|
|
3359
3359
|
}, [deterministicId]);
|
|
3360
3360
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
3361
3361
|
}
|
|
3362
|
-
__name$
|
|
3362
|
+
__name$15(useId$1, "useId");
|
|
3363
3363
|
|
|
3364
3364
|
//#endregion
|
|
3365
3365
|
//#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
@@ -3387,7 +3387,7 @@ const oppositeSideMap = {
|
|
|
3387
3387
|
bottom: "top",
|
|
3388
3388
|
top: "bottom"
|
|
3389
3389
|
};
|
|
3390
|
-
function clamp$
|
|
3390
|
+
function clamp$2(start, value, end) {
|
|
3391
3391
|
return max(start, min(value, end));
|
|
3392
3392
|
}
|
|
3393
3393
|
function evaluate(value, param) {
|
|
@@ -3688,7 +3688,7 @@ const arrow$3 = (options) => ({
|
|
|
3688
3688
|
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
3689
3689
|
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
3690
3690
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
3691
|
-
const offset = clamp$
|
|
3691
|
+
const offset = clamp$2(minPadding, center, max);
|
|
3692
3692
|
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
3693
3693
|
const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;
|
|
3694
3694
|
return {
|
|
@@ -3909,7 +3909,7 @@ const shift$2 = function(options) {
|
|
|
3909
3909
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
3910
3910
|
let mainAxisCoord = coords[mainAxis];
|
|
3911
3911
|
let crossAxisCoord = coords[crossAxis];
|
|
3912
|
-
const clampCoord = (axis, coord) => clamp$
|
|
3912
|
+
const clampCoord = (axis, coord) => clamp$2(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
|
|
3913
3913
|
if (checkMainAxis) mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
|
|
3914
3914
|
if (checkCrossAxis) crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
|
|
3915
3915
|
const limitedCoords = limiter.fn({
|
|
@@ -4997,12 +4997,12 @@ const arrow = (options, deps) => {
|
|
|
4997
4997
|
|
|
4998
4998
|
//#endregion
|
|
4999
4999
|
//#region ../../node_modules/.pnpm/@radix-ui+react-arrow@1.1.15_@types+react-dom@19.2.3_@types+react@19.2.17__@types+react_4d0c091b4d3d78b3d38bb97d37c10718/node_modules/@radix-ui/react-arrow/dist/index.mjs
|
|
5000
|
-
var __defProp$
|
|
5001
|
-
var __name$
|
|
5000
|
+
var __defProp$14 = Object.defineProperty;
|
|
5001
|
+
var __name$14 = (target, value) => __defProp$14(target, "name", {
|
|
5002
5002
|
value,
|
|
5003
5003
|
configurable: true
|
|
5004
5004
|
});
|
|
5005
|
-
var Arrow$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
5005
|
+
var Arrow$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$14(function Arrow2(props, forwardedRef) {
|
|
5006
5006
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
5007
5007
|
return /* @__PURE__ */ jsx(Primitive.svg, {
|
|
5008
5008
|
...arrowProps,
|
|
@@ -5014,19 +5014,19 @@ var Arrow$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$12(funct
|
|
|
5014
5014
|
children: props.asChild ? children : /* @__PURE__ */ jsx("polygon", { points: "0,0 30,0 15,10" })
|
|
5015
5015
|
});
|
|
5016
5016
|
}, "Arrow"));
|
|
5017
|
-
var Root$
|
|
5017
|
+
var Root$4 = Arrow$1;
|
|
5018
5018
|
|
|
5019
5019
|
//#endregion
|
|
5020
5020
|
//#region ../../node_modules/.pnpm/@radix-ui+react-popper@1.3.7_@types+react-dom@19.2.3_@types+react@19.2.17__@types+react_4e5bda27561956783247cbf95bf4739f/node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
5021
|
-
var __defProp$
|
|
5022
|
-
var __name$
|
|
5021
|
+
var __defProp$13 = Object.defineProperty;
|
|
5022
|
+
var __name$13 = (target, value) => __defProp$13(target, "name", {
|
|
5023
5023
|
value,
|
|
5024
5024
|
configurable: true
|
|
5025
5025
|
});
|
|
5026
5026
|
var POPPER_NAME = "Popper";
|
|
5027
5027
|
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
5028
5028
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
5029
|
-
var Popper = /* @__PURE__ */ __name$
|
|
5029
|
+
var Popper = /* @__PURE__ */ __name$13((props) => {
|
|
5030
5030
|
const { __scopePopper, children } = props;
|
|
5031
5031
|
const [anchor, setAnchor] = React$1.useState(null);
|
|
5032
5032
|
const [placementState, setPlacementState] = React$1.useState(void 0);
|
|
@@ -5040,7 +5040,7 @@ var Popper = /* @__PURE__ */ __name$11((props) => {
|
|
|
5040
5040
|
});
|
|
5041
5041
|
}, "Popper");
|
|
5042
5042
|
var ANCHOR_NAME = "PopperAnchor";
|
|
5043
|
-
var PopperAnchor = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
5043
|
+
var PopperAnchor = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$13(function PopperAnchor2(props, forwardedRef) {
|
|
5044
5044
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
5045
5045
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
5046
5046
|
const ref = React$1.useRef(null);
|
|
@@ -5068,7 +5068,7 @@ var PopperAnchor = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$11(
|
|
|
5068
5068
|
}, "PopperAnchor"));
|
|
5069
5069
|
var CONTENT_NAME$5 = "PopperContent";
|
|
5070
5070
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$5);
|
|
5071
|
-
var PopperContent = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
5071
|
+
var PopperContent = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$13(function PopperContent2(props, forwardedRef) {
|
|
5072
5072
|
const { __scopePopper, side = "bottom", sideOffset = 0, align = "center", alignOffset = 0, arrowPadding = 0, avoidCollisions = true, collisionBoundary = [], collisionPadding: collisionPaddingProp = 0, sticky = "partial", hideWhenDetached = false, updatePositionStrategy = "optimized", onPlaced, ...contentProps } = props;
|
|
5073
5073
|
const context = usePopperContext(CONTENT_NAME$5, __scopePopper);
|
|
5074
5074
|
const [content, setContent] = React$1.useState(null);
|
|
@@ -5095,7 +5095,7 @@ var PopperContent = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$11
|
|
|
5095
5095
|
const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
|
|
5096
5096
|
strategy: "fixed",
|
|
5097
5097
|
placement: desiredPlacement,
|
|
5098
|
-
whileElementsMounted: /* @__PURE__ */ __name$
|
|
5098
|
+
whileElementsMounted: /* @__PURE__ */ __name$13((...args) => {
|
|
5099
5099
|
return autoUpdate(...args, { animationFrame: updatePositionStrategy === "always" });
|
|
5100
5100
|
}, "whileElementsMounted"),
|
|
5101
5101
|
elements: { reference: context.anchor },
|
|
@@ -5113,7 +5113,7 @@ var PopperContent = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$11
|
|
|
5113
5113
|
avoidCollisions && flip({ ...detectOverflowOptions }),
|
|
5114
5114
|
size({
|
|
5115
5115
|
...detectOverflowOptions,
|
|
5116
|
-
apply: /* @__PURE__ */ __name$
|
|
5116
|
+
apply: /* @__PURE__ */ __name$13(({ elements, rects, availableWidth, availableHeight }) => {
|
|
5117
5117
|
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
|
5118
5118
|
const contentStyle = elements.floating.style;
|
|
5119
5119
|
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
|
|
@@ -5199,7 +5199,7 @@ var OPPOSITE_SIDE = {
|
|
|
5199
5199
|
bottom: "top",
|
|
5200
5200
|
left: "right"
|
|
5201
5201
|
};
|
|
5202
|
-
var PopperArrow = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
5202
|
+
var PopperArrow = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$13(function PopperArrow2(props, forwardedRef) {
|
|
5203
5203
|
const { __scopePopper, ...arrowProps } = props;
|
|
5204
5204
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
5205
5205
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -5224,7 +5224,7 @@ var PopperArrow = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$11(f
|
|
|
5224
5224
|
}[contentContext.placedSide],
|
|
5225
5225
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
5226
5226
|
},
|
|
5227
|
-
children: /* @__PURE__ */ jsx(Root$
|
|
5227
|
+
children: /* @__PURE__ */ jsx(Root$4, {
|
|
5228
5228
|
...arrowProps,
|
|
5229
5229
|
ref: forwardedRef,
|
|
5230
5230
|
style: {
|
|
@@ -5237,8 +5237,8 @@ var PopperArrow = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$11(f
|
|
|
5237
5237
|
function isNotNull$1(value) {
|
|
5238
5238
|
return value !== null;
|
|
5239
5239
|
}
|
|
5240
|
-
__name$
|
|
5241
|
-
var transformOrigin = /* @__PURE__ */ __name$
|
|
5240
|
+
__name$13(isNotNull$1, "isNotNull");
|
|
5241
|
+
var transformOrigin = /* @__PURE__ */ __name$13((options) => ({
|
|
5242
5242
|
name: "transformOrigin",
|
|
5243
5243
|
options,
|
|
5244
5244
|
fn(data) {
|
|
@@ -5279,7 +5279,7 @@ function getSideAndAlignFromPlacement(placement) {
|
|
|
5279
5279
|
const [side, align = "center"] = placement.split("-");
|
|
5280
5280
|
return [side, align];
|
|
5281
5281
|
}
|
|
5282
|
-
__name$
|
|
5282
|
+
__name$13(getSideAndAlignFromPlacement, "getSideAndAlignFromPlacement");
|
|
5283
5283
|
var Root2$3 = Popper;
|
|
5284
5284
|
var Anchor = PopperAnchor;
|
|
5285
5285
|
var Content = PopperContent;
|
|
@@ -5287,12 +5287,12 @@ var Arrow = PopperArrow;
|
|
|
5287
5287
|
|
|
5288
5288
|
//#endregion
|
|
5289
5289
|
//#region ../../node_modules/.pnpm/@radix-ui+react-portal@1.1.17_@types+react-dom@19.2.3_@types+react@19.2.17__@types+reac_17de5f572cef13944a3e44b7d1e8f104/node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
5290
|
-
var __defProp$
|
|
5291
|
-
var __name$
|
|
5290
|
+
var __defProp$12 = Object.defineProperty;
|
|
5291
|
+
var __name$12 = (target, value) => __defProp$12(target, "name", {
|
|
5292
5292
|
value,
|
|
5293
5293
|
configurable: true
|
|
5294
5294
|
});
|
|
5295
|
-
var Portal$2 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
5295
|
+
var Portal$2 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$12(function Portal2(props, forwardedRef) {
|
|
5296
5296
|
const { container: containerProp, ...portalProps } = props;
|
|
5297
5297
|
const [mounted, setMounted] = React$1.useState(false);
|
|
5298
5298
|
useLayoutEffect2(() => setMounted(true), []);
|
|
@@ -5305,8 +5305,8 @@ var Portal$2 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$10(func
|
|
|
5305
5305
|
|
|
5306
5306
|
//#endregion
|
|
5307
5307
|
//#region ../../node_modules/.pnpm/@radix-ui+react-use-is-hydrated@0.1.3_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs
|
|
5308
|
-
var __defProp$
|
|
5309
|
-
var __name$
|
|
5308
|
+
var __defProp$11 = Object.defineProperty;
|
|
5309
|
+
var __name$11 = (target, value) => __defProp$11(target, "name", {
|
|
5310
5310
|
value,
|
|
5311
5311
|
configurable: true
|
|
5312
5312
|
});
|
|
@@ -5321,22 +5321,22 @@ function useIsHydrated() {
|
|
|
5321
5321
|
}, []);
|
|
5322
5322
|
return isHydrated;
|
|
5323
5323
|
}
|
|
5324
|
-
__name$
|
|
5324
|
+
__name$11(useIsHydrated, "useIsHydrated");
|
|
5325
5325
|
var useReactSyncExternalStore = React$1[" useSyncExternalStore ".trim().toString()];
|
|
5326
5326
|
function subscribe() {
|
|
5327
5327
|
return () => {};
|
|
5328
5328
|
}
|
|
5329
|
-
__name$
|
|
5329
|
+
__name$11(subscribe, "subscribe");
|
|
5330
5330
|
function useIsHydratedModern() {
|
|
5331
5331
|
return useReactSyncExternalStore(subscribe, () => true, () => false);
|
|
5332
5332
|
}
|
|
5333
|
-
__name$
|
|
5333
|
+
__name$11(useIsHydratedModern, "useIsHydratedModern");
|
|
5334
5334
|
var useIsHydrated2 = typeof useReactSyncExternalStore === "function" ? useIsHydratedModern : useIsHydrated;
|
|
5335
5335
|
|
|
5336
5336
|
//#endregion
|
|
5337
5337
|
//#region ../../node_modules/.pnpm/@radix-ui+react-roving-focus@1.1.19_@types+react-dom@19.2.3_@types+react@19.2.17__@type_1ba36d19799ef89b87b035255f196a64/node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
|
5338
|
-
var __defProp$
|
|
5339
|
-
var __name$
|
|
5338
|
+
var __defProp$10 = Object.defineProperty;
|
|
5339
|
+
var __name$10 = (target, value) => __defProp$10(target, "name", {
|
|
5340
5340
|
value,
|
|
5341
5341
|
configurable: true
|
|
5342
5342
|
});
|
|
@@ -5349,7 +5349,7 @@ var GROUP_NAME = "RovingFocusGroup";
|
|
|
5349
5349
|
var [Collection$2, useCollection$2, createCollectionScope$2] = createCollection(GROUP_NAME);
|
|
5350
5350
|
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(GROUP_NAME, [createCollectionScope$2]);
|
|
5351
5351
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
5352
|
-
var RovingFocusGroup = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
5352
|
+
var RovingFocusGroup = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$10(function RovingFocusGroup2(props, forwardedRef) {
|
|
5353
5353
|
return /* @__PURE__ */ jsx(Collection$2.Provider, {
|
|
5354
5354
|
scope: props.__scopeRovingFocusGroup,
|
|
5355
5355
|
children: /* @__PURE__ */ jsx(Collection$2.Slot, {
|
|
@@ -5361,7 +5361,7 @@ var RovingFocusGroup = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name
|
|
|
5361
5361
|
})
|
|
5362
5362
|
});
|
|
5363
5363
|
}, "RovingFocusGroup"));
|
|
5364
|
-
var RovingFocusGroupImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
5364
|
+
var RovingFocusGroupImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$10(function RovingFocusGroupImpl2(props, forwardedRef) {
|
|
5365
5365
|
const { __scopeRovingFocusGroup, orientation, loop = false, dir, currentTabStopId: currentTabStopIdProp, defaultCurrentTabStopId, onCurrentTabStopIdChange, onEntryFocus, preventScrollOnEntryFocus = false, ...groupProps } = props;
|
|
5366
5366
|
const ref = React$1.useRef(null);
|
|
5367
5367
|
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
@@ -5427,7 +5427,7 @@ var RovingFocusGroupImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __
|
|
|
5427
5427
|
});
|
|
5428
5428
|
}, "RovingFocusGroupImpl"));
|
|
5429
5429
|
var ITEM_NAME$1 = "RovingFocusGroupItem";
|
|
5430
|
-
var RovingFocusGroupItem = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
5430
|
+
var RovingFocusGroupItem = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$10(function RovingFocusGroupItem2(props, forwardedRef) {
|
|
5431
5431
|
const { __scopeRovingFocusGroup, focusable = true, active = false, tabStopId, children, ...itemProps } = props;
|
|
5432
5432
|
const autoId = useId$1();
|
|
5433
5433
|
const id = tabStopId || autoId;
|
|
@@ -5512,14 +5512,14 @@ function getDirectionAwareKey(key, dir) {
|
|
|
5512
5512
|
if (dir !== "rtl") return key;
|
|
5513
5513
|
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
5514
5514
|
}
|
|
5515
|
-
__name$
|
|
5515
|
+
__name$10(getDirectionAwareKey, "getDirectionAwareKey");
|
|
5516
5516
|
function getFocusIntent(event, orientation, dir) {
|
|
5517
5517
|
const key = getDirectionAwareKey(event.key, dir);
|
|
5518
5518
|
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
5519
5519
|
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
5520
5520
|
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
5521
5521
|
}
|
|
5522
|
-
__name$
|
|
5522
|
+
__name$10(getFocusIntent, "getFocusIntent");
|
|
5523
5523
|
function focusFirst$2(candidates, preventScroll = false) {
|
|
5524
5524
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
5525
5525
|
for (const candidate of candidates) {
|
|
@@ -5528,12 +5528,12 @@ function focusFirst$2(candidates, preventScroll = false) {
|
|
|
5528
5528
|
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
5529
5529
|
}
|
|
5530
5530
|
}
|
|
5531
|
-
__name$
|
|
5531
|
+
__name$10(focusFirst$2, "focusFirst");
|
|
5532
5532
|
function wrapArray$1(array, startIndex) {
|
|
5533
5533
|
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
5534
5534
|
}
|
|
5535
|
-
__name$
|
|
5536
|
-
var Root$
|
|
5535
|
+
__name$10(wrapArray$1, "wrapArray");
|
|
5536
|
+
var Root$3 = RovingFocusGroup;
|
|
5537
5537
|
var Item = RovingFocusGroupItem;
|
|
5538
5538
|
|
|
5539
5539
|
//#endregion
|
|
@@ -6378,8 +6378,8 @@ ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
|
6378
6378
|
|
|
6379
6379
|
//#endregion
|
|
6380
6380
|
//#region ../../node_modules/.pnpm/@radix-ui+react-menu@2.1.24_@types+react-dom@19.2.3_@types+react@19.2.17__@types+react@_b4abbb2a563651316651d75e08bb1ff0/node_modules/@radix-ui/react-menu/dist/index.mjs
|
|
6381
|
-
var __defProp$
|
|
6382
|
-
var __name$
|
|
6381
|
+
var __defProp$9 = Object.defineProperty;
|
|
6382
|
+
var __name$9 = (target, value) => __defProp$9(target, "name", {
|
|
6383
6383
|
value,
|
|
6384
6384
|
configurable: true
|
|
6385
6385
|
});
|
|
@@ -6410,7 +6410,7 @@ var usePopperScope$1 = createPopperScope();
|
|
|
6410
6410
|
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
6411
6411
|
var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
|
|
6412
6412
|
var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
6413
|
-
var Menu = /* @__PURE__ */ __name$
|
|
6413
|
+
var Menu = /* @__PURE__ */ __name$9((props) => {
|
|
6414
6414
|
const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
|
|
6415
6415
|
const popperScope = usePopperScope$1(__scopeMenu);
|
|
6416
6416
|
const [content, setContent] = React$1.useState(null);
|
|
@@ -6418,7 +6418,7 @@ var Menu = /* @__PURE__ */ __name$7((props) => {
|
|
|
6418
6418
|
const handleOpenChange = useCallbackRef$1(onOpenChange);
|
|
6419
6419
|
const direction = useDirection(dir);
|
|
6420
6420
|
React$1.useEffect(() => {
|
|
6421
|
-
const handleKeyDown = /* @__PURE__ */ __name$
|
|
6421
|
+
const handleKeyDown = /* @__PURE__ */ __name$9(() => {
|
|
6422
6422
|
isUsingKeyboardRef.current = true;
|
|
6423
6423
|
document.addEventListener("pointerdown", handlePointer, {
|
|
6424
6424
|
capture: true,
|
|
@@ -6429,7 +6429,7 @@ var Menu = /* @__PURE__ */ __name$7((props) => {
|
|
|
6429
6429
|
once: true
|
|
6430
6430
|
});
|
|
6431
6431
|
}, "handleKeyDown");
|
|
6432
|
-
const handlePointer = /* @__PURE__ */ __name$
|
|
6432
|
+
const handlePointer = /* @__PURE__ */ __name$9(() => isUsingKeyboardRef.current = false, "handlePointer");
|
|
6433
6433
|
document.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
6434
6434
|
return () => {
|
|
6435
6435
|
document.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
@@ -6439,7 +6439,7 @@ var Menu = /* @__PURE__ */ __name$7((props) => {
|
|
|
6439
6439
|
}, []);
|
|
6440
6440
|
React$1.useEffect(() => {
|
|
6441
6441
|
if (!open) return;
|
|
6442
|
-
const handleBlur = /* @__PURE__ */ __name$
|
|
6442
|
+
const handleBlur = /* @__PURE__ */ __name$9(() => handleOpenChange(false), "handleBlur");
|
|
6443
6443
|
window.addEventListener("blur", handleBlur);
|
|
6444
6444
|
return () => window.removeEventListener("blur", handleBlur);
|
|
6445
6445
|
}, [open, handleOpenChange]);
|
|
@@ -6462,7 +6462,7 @@ var Menu = /* @__PURE__ */ __name$7((props) => {
|
|
|
6462
6462
|
})
|
|
6463
6463
|
});
|
|
6464
6464
|
}, "Menu");
|
|
6465
|
-
var MenuAnchor = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
6465
|
+
var MenuAnchor = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$9(function MenuAnchor2(props, forwardedRef) {
|
|
6466
6466
|
const { __scopeMenu, ...anchorProps } = props;
|
|
6467
6467
|
const popperScope = usePopperScope$1(__scopeMenu);
|
|
6468
6468
|
return /* @__PURE__ */ jsx(Anchor, {
|
|
@@ -6473,7 +6473,7 @@ var MenuAnchor = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$7(fun
|
|
|
6473
6473
|
}, "MenuAnchor"));
|
|
6474
6474
|
var PORTAL_NAME$2 = "MenuPortal";
|
|
6475
6475
|
var [PortalProvider$2, usePortalContext$2] = createMenuContext(PORTAL_NAME$2, { forceMount: void 0 });
|
|
6476
|
-
var MenuPortal = /* @__PURE__ */ __name$
|
|
6476
|
+
var MenuPortal = /* @__PURE__ */ __name$9((props) => {
|
|
6477
6477
|
const { __scopeMenu, forceMount, children, container } = props;
|
|
6478
6478
|
const context = useMenuContext(PORTAL_NAME$2, __scopeMenu);
|
|
6479
6479
|
return /* @__PURE__ */ jsx(PortalProvider$2, {
|
|
@@ -6491,7 +6491,7 @@ var MenuPortal = /* @__PURE__ */ __name$7((props) => {
|
|
|
6491
6491
|
}, "MenuPortal");
|
|
6492
6492
|
var CONTENT_NAME$4 = "MenuContent";
|
|
6493
6493
|
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$4);
|
|
6494
|
-
var MenuContent = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
6494
|
+
var MenuContent = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$9(function MenuContent2(props, forwardedRef) {
|
|
6495
6495
|
const portalContext = usePortalContext$2(CONTENT_NAME$4, props.__scopeMenu);
|
|
6496
6496
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
6497
6497
|
const context = useMenuContext(CONTENT_NAME$4, props.__scopeMenu);
|
|
@@ -6513,7 +6513,7 @@ var MenuContent = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$7(fu
|
|
|
6513
6513
|
})
|
|
6514
6514
|
});
|
|
6515
6515
|
}, "MenuContent"));
|
|
6516
|
-
var MenuRootContentModal = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
6516
|
+
var MenuRootContentModal = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$9(function MenuRootContentModal2(props, forwardedRef) {
|
|
6517
6517
|
const context = useMenuContext(CONTENT_NAME$4, props.__scopeMenu);
|
|
6518
6518
|
const ref = React$1.useRef(null);
|
|
6519
6519
|
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
@@ -6531,7 +6531,7 @@ var MenuRootContentModal = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __
|
|
|
6531
6531
|
onDismiss: () => context.onOpenChange(false)
|
|
6532
6532
|
});
|
|
6533
6533
|
}, "MenuRootContentModal"));
|
|
6534
|
-
var MenuRootContentNonModal = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
6534
|
+
var MenuRootContentNonModal = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$9(function MenuRootContentNonModal2(props, forwardedRef) {
|
|
6535
6535
|
const context = useMenuContext(CONTENT_NAME$4, props.__scopeMenu);
|
|
6536
6536
|
return /* @__PURE__ */ jsx(MenuContentImpl, {
|
|
6537
6537
|
...props,
|
|
@@ -6543,7 +6543,7 @@ var MenuRootContentNonModal = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */
|
|
|
6543
6543
|
});
|
|
6544
6544
|
}, "MenuRootContentNonModal"));
|
|
6545
6545
|
var Slot$1 = createSlot("MenuContent.ScrollLock");
|
|
6546
|
-
var MenuContentImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
6546
|
+
var MenuContentImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$9(function MenuContentImpl2(props, forwardedRef) {
|
|
6547
6547
|
const { __scopeMenu, loop = false, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEntryFocus, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, disableOutsideScroll, ...contentProps } = props;
|
|
6548
6548
|
const context = useMenuContext(CONTENT_NAME$4, __scopeMenu);
|
|
6549
6549
|
const rootContext = useMenuRootContext(CONTENT_NAME$4, __scopeMenu);
|
|
@@ -6564,14 +6564,14 @@ var MenuContentImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
|
6564
6564
|
as: Slot$1,
|
|
6565
6565
|
allowPinchZoom: true
|
|
6566
6566
|
} : void 0;
|
|
6567
|
-
const handleTypeaheadSearch = /* @__PURE__ */ __name$
|
|
6567
|
+
const handleTypeaheadSearch = /* @__PURE__ */ __name$9((key) => {
|
|
6568
6568
|
const search = searchRef.current + key;
|
|
6569
6569
|
const items = getItems().filter((item) => !item.disabled);
|
|
6570
6570
|
const currentItem = document.activeElement;
|
|
6571
6571
|
const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;
|
|
6572
6572
|
const nextMatch = getNextMatch(items.map((item) => item.textValue), search, currentMatch);
|
|
6573
6573
|
const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;
|
|
6574
|
-
(/* @__PURE__ */ __name$
|
|
6574
|
+
(/* @__PURE__ */ __name$9((function updateSearch(value) {
|
|
6575
6575
|
searchRef.current = value;
|
|
6576
6576
|
window.clearTimeout(timerRef.current);
|
|
6577
6577
|
if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3);
|
|
@@ -6621,7 +6621,7 @@ var MenuContentImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
|
6621
6621
|
onFocusOutside,
|
|
6622
6622
|
onInteractOutside,
|
|
6623
6623
|
onDismiss,
|
|
6624
|
-
children: /* @__PURE__ */ jsx(Root$
|
|
6624
|
+
children: /* @__PURE__ */ jsx(Root$3, {
|
|
6625
6625
|
asChild: true,
|
|
6626
6626
|
...rovingFocusGroupScope,
|
|
6627
6627
|
dir: rootContext.dir,
|
|
@@ -6686,14 +6686,14 @@ var MenuContentImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
|
6686
6686
|
}, "MenuContentImpl"));
|
|
6687
6687
|
var ITEM_NAME = "MenuItem";
|
|
6688
6688
|
var ITEM_SELECT = "menu.itemSelect";
|
|
6689
|
-
var MenuItem = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
6689
|
+
var MenuItem = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$9(function MenuItem2(props, forwardedRef) {
|
|
6690
6690
|
const { disabled = false, onSelect, ...itemProps } = props;
|
|
6691
6691
|
const ref = React$1.useRef(null);
|
|
6692
6692
|
const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);
|
|
6693
6693
|
const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);
|
|
6694
6694
|
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
6695
6695
|
const isPointerDownRef = React$1.useRef(false);
|
|
6696
|
-
const handleSelect = /* @__PURE__ */ __name$
|
|
6696
|
+
const handleSelect = /* @__PURE__ */ __name$9(() => {
|
|
6697
6697
|
const menuItem = ref.current;
|
|
6698
6698
|
if (!disabled && menuItem) {
|
|
6699
6699
|
const itemSelectEvent = new CustomEvent(ITEM_SELECT, {
|
|
@@ -6728,7 +6728,7 @@ var MenuItem = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$7(funct
|
|
|
6728
6728
|
})
|
|
6729
6729
|
});
|
|
6730
6730
|
}, "MenuItem"));
|
|
6731
|
-
var MenuItemImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
6731
|
+
var MenuItemImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$9(function MenuItemImpl2(props, forwardedRef) {
|
|
6732
6732
|
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
6733
6733
|
const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);
|
|
6734
6734
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
@@ -6769,7 +6769,7 @@ var MenuItemImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$7(f
|
|
|
6769
6769
|
})
|
|
6770
6770
|
});
|
|
6771
6771
|
}, "MenuItemImpl"));
|
|
6772
|
-
var MenuCheckboxItem = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
6772
|
+
var MenuCheckboxItem = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$9(function MenuCheckboxItem2(props, forwardedRef) {
|
|
6773
6773
|
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
6774
6774
|
return /* @__PURE__ */ jsx(ItemIndicatorProvider, {
|
|
6775
6775
|
scope: props.__scopeMenu,
|
|
@@ -6786,11 +6786,11 @@ var MenuCheckboxItem = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name
|
|
|
6786
6786
|
}, "MenuCheckboxItem"));
|
|
6787
6787
|
var [RadioGroupProvider, useRadioGroupContext] = createMenuContext("MenuRadioGroup", {
|
|
6788
6788
|
value: void 0,
|
|
6789
|
-
onValueChange: /* @__PURE__ */ __name$
|
|
6789
|
+
onValueChange: /* @__PURE__ */ __name$9(() => {}, "onValueChange")
|
|
6790
6790
|
});
|
|
6791
6791
|
var ITEM_INDICATOR_NAME = "MenuItemIndicator";
|
|
6792
6792
|
var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(ITEM_INDICATOR_NAME, { checked: false });
|
|
6793
|
-
var MenuItemIndicator = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
6793
|
+
var MenuItemIndicator = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$9(function MenuItemIndicator2(props, forwardedRef) {
|
|
6794
6794
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
6795
6795
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
6796
6796
|
return /* @__PURE__ */ jsx(Presence, {
|
|
@@ -6807,15 +6807,15 @@ var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
|
|
|
6807
6807
|
function getOpenState(open) {
|
|
6808
6808
|
return open ? "open" : "closed";
|
|
6809
6809
|
}
|
|
6810
|
-
__name$
|
|
6810
|
+
__name$9(getOpenState, "getOpenState");
|
|
6811
6811
|
function isIndeterminate(checked) {
|
|
6812
6812
|
return checked === "indeterminate";
|
|
6813
6813
|
}
|
|
6814
|
-
__name$
|
|
6814
|
+
__name$9(isIndeterminate, "isIndeterminate");
|
|
6815
6815
|
function getCheckedState(checked) {
|
|
6816
6816
|
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
6817
6817
|
}
|
|
6818
|
-
__name$
|
|
6818
|
+
__name$9(getCheckedState, "getCheckedState");
|
|
6819
6819
|
function focusFirst$1(candidates) {
|
|
6820
6820
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
6821
6821
|
for (const candidate of candidates) {
|
|
@@ -6824,11 +6824,11 @@ function focusFirst$1(candidates) {
|
|
|
6824
6824
|
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
6825
6825
|
}
|
|
6826
6826
|
}
|
|
6827
|
-
__name$
|
|
6827
|
+
__name$9(focusFirst$1, "focusFirst");
|
|
6828
6828
|
function wrapArray(array, startIndex) {
|
|
6829
6829
|
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
6830
6830
|
}
|
|
6831
|
-
__name$
|
|
6831
|
+
__name$9(wrapArray, "wrapArray");
|
|
6832
6832
|
function getNextMatch(values, search, currentMatch) {
|
|
6833
6833
|
const normalizedSearch = search.length > 1 && Array.from(search).every((char) => char === search[0]) ? search[0] : search;
|
|
6834
6834
|
const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;
|
|
@@ -6837,7 +6837,7 @@ function getNextMatch(values, search, currentMatch) {
|
|
|
6837
6837
|
const nextMatch = wrappedValues.find((value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase()));
|
|
6838
6838
|
return nextMatch !== currentMatch ? nextMatch : void 0;
|
|
6839
6839
|
}
|
|
6840
|
-
__name$
|
|
6840
|
+
__name$9(getNextMatch, "getNextMatch");
|
|
6841
6841
|
function isPointInPolygon$1(point, polygon) {
|
|
6842
6842
|
const { x, y } = point;
|
|
6843
6843
|
let inside = false;
|
|
@@ -6852,7 +6852,7 @@ function isPointInPolygon$1(point, polygon) {
|
|
|
6852
6852
|
}
|
|
6853
6853
|
return inside;
|
|
6854
6854
|
}
|
|
6855
|
-
__name$
|
|
6855
|
+
__name$9(isPointInPolygon$1, "isPointInPolygon");
|
|
6856
6856
|
function isPointerInGraceArea(event, area) {
|
|
6857
6857
|
if (!area) return false;
|
|
6858
6858
|
return isPointInPolygon$1({
|
|
@@ -6860,11 +6860,11 @@ function isPointerInGraceArea(event, area) {
|
|
|
6860
6860
|
y: event.clientY
|
|
6861
6861
|
}, area);
|
|
6862
6862
|
}
|
|
6863
|
-
__name$
|
|
6863
|
+
__name$9(isPointerInGraceArea, "isPointerInGraceArea");
|
|
6864
6864
|
function whenMouse(handler) {
|
|
6865
6865
|
return (event) => event.pointerType === "mouse" ? handler(event) : void 0;
|
|
6866
6866
|
}
|
|
6867
|
-
__name$
|
|
6867
|
+
__name$9(whenMouse, "whenMouse");
|
|
6868
6868
|
var Root3$1 = Menu;
|
|
6869
6869
|
var Anchor2 = MenuAnchor;
|
|
6870
6870
|
var Portal$1 = MenuPortal;
|
|
@@ -6875,8 +6875,8 @@ var ItemIndicator = MenuItemIndicator;
|
|
|
6875
6875
|
|
|
6876
6876
|
//#endregion
|
|
6877
6877
|
//#region ../../node_modules/.pnpm/@radix-ui+react-dropdown-menu@2.1.24_@types+react-dom@19.2.3_@types+react@19.2.17__@typ_cea3081213c77aa7bdcc6d13e3bb1673/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs
|
|
6878
|
-
var __defProp$
|
|
6879
|
-
var __name$
|
|
6878
|
+
var __defProp$8 = Object.defineProperty;
|
|
6879
|
+
var __name$8 = (target, value) => __defProp$8(target, "name", {
|
|
6880
6880
|
value,
|
|
6881
6881
|
configurable: true
|
|
6882
6882
|
});
|
|
@@ -6884,7 +6884,7 @@ var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
|
6884
6884
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [createMenuScope]);
|
|
6885
6885
|
var useMenuScope = createMenuScope();
|
|
6886
6886
|
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
6887
|
-
var DropdownMenu$1 = /* @__PURE__ */ __name$
|
|
6887
|
+
var DropdownMenu$1 = /* @__PURE__ */ __name$8((props) => {
|
|
6888
6888
|
const { __scopeDropdownMenu, children, dir, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
6889
6889
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
6890
6890
|
const triggerRef = React$1.useRef(null);
|
|
@@ -6914,7 +6914,7 @@ var DropdownMenu$1 = /* @__PURE__ */ __name$6((props) => {
|
|
|
6914
6914
|
});
|
|
6915
6915
|
}, "DropdownMenu");
|
|
6916
6916
|
var TRIGGER_NAME$3 = "DropdownMenuTrigger";
|
|
6917
|
-
var DropdownMenuTrigger$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
6917
|
+
var DropdownMenuTrigger$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$8(function DropdownMenuTrigger2(props, forwardedRef) {
|
|
6918
6918
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
6919
6919
|
const context = useDropdownMenuContext(TRIGGER_NAME$3, __scopeDropdownMenu);
|
|
6920
6920
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -6952,7 +6952,7 @@ var DropdownMenuTrigger$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ _
|
|
|
6952
6952
|
})
|
|
6953
6953
|
});
|
|
6954
6954
|
}, "DropdownMenuTrigger"));
|
|
6955
|
-
var DropdownMenuPortal = /* @__PURE__ */ __name$
|
|
6955
|
+
var DropdownMenuPortal = /* @__PURE__ */ __name$8((props) => {
|
|
6956
6956
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
6957
6957
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
6958
6958
|
return /* @__PURE__ */ jsx(Portal$1, {
|
|
@@ -6961,7 +6961,7 @@ var DropdownMenuPortal = /* @__PURE__ */ __name$6((props) => {
|
|
|
6961
6961
|
});
|
|
6962
6962
|
}, "DropdownMenuPortal");
|
|
6963
6963
|
var CONTENT_NAME$3 = "DropdownMenuContent";
|
|
6964
|
-
var DropdownMenuContent$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
6964
|
+
var DropdownMenuContent$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$8(function DropdownMenuContent2(props, forwardedRef) {
|
|
6965
6965
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
6966
6966
|
const context = useDropdownMenuContext(CONTENT_NAME$3, __scopeDropdownMenu);
|
|
6967
6967
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -6993,7 +6993,7 @@ var DropdownMenuContent$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ _
|
|
|
6993
6993
|
}
|
|
6994
6994
|
});
|
|
6995
6995
|
}, "DropdownMenuContent"));
|
|
6996
|
-
var DropdownMenuItem$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
6996
|
+
var DropdownMenuItem$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$8(function DropdownMenuItem2(props, forwardedRef) {
|
|
6997
6997
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
6998
6998
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
6999
6999
|
return /* @__PURE__ */ jsx(Item2$1, {
|
|
@@ -7002,7 +7002,7 @@ var DropdownMenuItem$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __na
|
|
|
7002
7002
|
ref: forwardedRef
|
|
7003
7003
|
});
|
|
7004
7004
|
}, "DropdownMenuItem"));
|
|
7005
|
-
var DropdownMenuCheckboxItem$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
7005
|
+
var DropdownMenuCheckboxItem$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$8(function DropdownMenuCheckboxItem2(props, forwardedRef) {
|
|
7006
7006
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
7007
7007
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7008
7008
|
return /* @__PURE__ */ jsx(CheckboxItem, {
|
|
@@ -7011,7 +7011,7 @@ var DropdownMenuCheckboxItem$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__
|
|
|
7011
7011
|
ref: forwardedRef
|
|
7012
7012
|
});
|
|
7013
7013
|
}, "DropdownMenuCheckboxItem"));
|
|
7014
|
-
var DropdownMenuItemIndicator = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$
|
|
7014
|
+
var DropdownMenuItemIndicator = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$8(function DropdownMenuItemIndicator2(props, forwardedRef) {
|
|
7015
7015
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
7016
7016
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7017
7017
|
return /* @__PURE__ */ jsx(ItemIndicator, {
|
|
@@ -7138,6 +7138,744 @@ function DropdownMenuCheckboxItem({ children, className = "", ...props }) {
|
|
|
7138
7138
|
});
|
|
7139
7139
|
}
|
|
7140
7140
|
|
|
7141
|
+
//#endregion
|
|
7142
|
+
//#region ../../node_modules/.pnpm/@radix-ui+number@1.1.3/node_modules/@radix-ui/number/dist/index.mjs
|
|
7143
|
+
var __defProp$7 = Object.defineProperty;
|
|
7144
|
+
var __name$7 = (target, value) => __defProp$7(target, "name", {
|
|
7145
|
+
value,
|
|
7146
|
+
configurable: true
|
|
7147
|
+
});
|
|
7148
|
+
function clamp$1(value, [min, max]) {
|
|
7149
|
+
return Math.min(max, Math.max(min, value));
|
|
7150
|
+
}
|
|
7151
|
+
__name$7(clamp$1, "clamp");
|
|
7152
|
+
|
|
7153
|
+
//#endregion
|
|
7154
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-scroll-area@1.2.18_@types+react-dom@19.2.3_@types+react@19.2.17__@types_47fa784ca1dbd5b454eeb26b59d20014/node_modules/@radix-ui/react-scroll-area/dist/index.mjs
|
|
7155
|
+
var __defProp$6 = Object.defineProperty;
|
|
7156
|
+
var __name$6 = (target, value) => __defProp$6(target, "name", {
|
|
7157
|
+
value,
|
|
7158
|
+
configurable: true
|
|
7159
|
+
});
|
|
7160
|
+
function useStateMachine(initialState, machine) {
|
|
7161
|
+
return React$1.useReducer((state, event) => {
|
|
7162
|
+
return machine[state][event] ?? state;
|
|
7163
|
+
}, initialState);
|
|
7164
|
+
}
|
|
7165
|
+
__name$6(useStateMachine, "useStateMachine");
|
|
7166
|
+
var SCROLL_AREA_NAME = "ScrollArea";
|
|
7167
|
+
var [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME);
|
|
7168
|
+
var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
|
|
7169
|
+
var ScrollArea$1 = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollArea2(props, forwardedRef) {
|
|
7170
|
+
const { __scopeScrollArea, type = "hover", dir, scrollHideDelay = 600, ...scrollAreaProps } = props;
|
|
7171
|
+
const [scrollArea, setScrollArea] = React$1.useState(null);
|
|
7172
|
+
const [viewport, setViewport] = React$1.useState(null);
|
|
7173
|
+
const [content, setContent] = React$1.useState(null);
|
|
7174
|
+
const [scrollbarX, setScrollbarX] = React$1.useState(null);
|
|
7175
|
+
const [scrollbarY, setScrollbarY] = React$1.useState(null);
|
|
7176
|
+
const [cornerWidth, setCornerWidth] = React$1.useState(0);
|
|
7177
|
+
const [cornerHeight, setCornerHeight] = React$1.useState(0);
|
|
7178
|
+
const [scrollbarXEnabled, setScrollbarXEnabled] = React$1.useState(false);
|
|
7179
|
+
const [scrollbarYEnabled, setScrollbarYEnabled] = React$1.useState(false);
|
|
7180
|
+
const composedRefs = useComposedRefs$1(forwardedRef, setScrollArea);
|
|
7181
|
+
const direction = useDirection(dir);
|
|
7182
|
+
return /* @__PURE__ */ jsx(ScrollAreaProvider, {
|
|
7183
|
+
scope: __scopeScrollArea,
|
|
7184
|
+
type,
|
|
7185
|
+
dir: direction,
|
|
7186
|
+
scrollHideDelay,
|
|
7187
|
+
scrollArea,
|
|
7188
|
+
viewport,
|
|
7189
|
+
onViewportChange: setViewport,
|
|
7190
|
+
content,
|
|
7191
|
+
onContentChange: setContent,
|
|
7192
|
+
scrollbarX,
|
|
7193
|
+
onScrollbarXChange: setScrollbarX,
|
|
7194
|
+
scrollbarXEnabled,
|
|
7195
|
+
onScrollbarXEnabledChange: setScrollbarXEnabled,
|
|
7196
|
+
scrollbarY,
|
|
7197
|
+
onScrollbarYChange: setScrollbarY,
|
|
7198
|
+
scrollbarYEnabled,
|
|
7199
|
+
onScrollbarYEnabledChange: setScrollbarYEnabled,
|
|
7200
|
+
onCornerWidthChange: setCornerWidth,
|
|
7201
|
+
onCornerHeightChange: setCornerHeight,
|
|
7202
|
+
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
7203
|
+
dir: direction,
|
|
7204
|
+
...scrollAreaProps,
|
|
7205
|
+
ref: composedRefs,
|
|
7206
|
+
style: {
|
|
7207
|
+
position: "relative",
|
|
7208
|
+
"--radix-scroll-area-corner-width": cornerWidth + "px",
|
|
7209
|
+
"--radix-scroll-area-corner-height": cornerHeight + "px",
|
|
7210
|
+
...props.style
|
|
7211
|
+
}
|
|
7212
|
+
})
|
|
7213
|
+
});
|
|
7214
|
+
}, "ScrollArea"));
|
|
7215
|
+
var VIEWPORT_NAME$1 = "ScrollAreaViewport";
|
|
7216
|
+
var ScrollAreaViewport = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaViewport2(props, forwardedRef) {
|
|
7217
|
+
const { __scopeScrollArea, children, nonce, ...viewportProps } = props;
|
|
7218
|
+
const context = useScrollAreaContext(VIEWPORT_NAME$1, __scopeScrollArea);
|
|
7219
|
+
const composedRefs = useComposedRefs$1(forwardedRef, React$1.useRef(null), context.onViewportChange);
|
|
7220
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ScrollAreaViewportStyle, { nonce }), /* @__PURE__ */ jsx(Primitive.div, {
|
|
7221
|
+
"data-radix-scroll-area-viewport": "",
|
|
7222
|
+
...viewportProps,
|
|
7223
|
+
ref: composedRefs,
|
|
7224
|
+
style: {
|
|
7225
|
+
/**
|
|
7226
|
+
* We don't support `visible` because the intention is to have at least one scrollbar
|
|
7227
|
+
* if this component is used and `visible` will behave like `auto` in that case
|
|
7228
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
|
|
7229
|
+
*
|
|
7230
|
+
* We don't handle `auto` because the intention is for the native implementation
|
|
7231
|
+
* to be hidden if using this component. We just want to ensure the node is scrollable
|
|
7232
|
+
* so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
|
|
7233
|
+
* the browser from having to work out whether to render native scrollbars or not,
|
|
7234
|
+
* we tell it to with the intention of hiding them in CSS.
|
|
7235
|
+
*/
|
|
7236
|
+
overflowX: context.scrollbarXEnabled ? "scroll" : "hidden",
|
|
7237
|
+
overflowY: context.scrollbarYEnabled ? "scroll" : "hidden",
|
|
7238
|
+
...props.style
|
|
7239
|
+
},
|
|
7240
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
7241
|
+
ref: context.onContentChange,
|
|
7242
|
+
style: {
|
|
7243
|
+
minWidth: "100%",
|
|
7244
|
+
display: "table"
|
|
7245
|
+
},
|
|
7246
|
+
children
|
|
7247
|
+
})
|
|
7248
|
+
})] });
|
|
7249
|
+
}, "ScrollAreaViewport"));
|
|
7250
|
+
var ScrollAreaViewportStyle = /* @__PURE__ */ React$1.memo(/* @__PURE__ */ __name$6(function ScrollAreaViewportStyle2({ nonce }) {
|
|
7251
|
+
return /* @__PURE__ */ jsx("style", {
|
|
7252
|
+
dangerouslySetInnerHTML: { __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}` },
|
|
7253
|
+
nonce
|
|
7254
|
+
});
|
|
7255
|
+
}, "ScrollAreaViewportStyle"), (prevProps, nextProps) => prevProps.nonce === nextProps.nonce);
|
|
7256
|
+
var SCROLLBAR_NAME = "ScrollAreaScrollbar";
|
|
7257
|
+
var ScrollAreaScrollbar = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaScrollbar2(props, forwardedRef) {
|
|
7258
|
+
const { forceMount, ...scrollbarProps } = props;
|
|
7259
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
7260
|
+
const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context;
|
|
7261
|
+
const isHorizontal = props.orientation === "horizontal";
|
|
7262
|
+
React$1.useEffect(() => {
|
|
7263
|
+
isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);
|
|
7264
|
+
return () => {
|
|
7265
|
+
isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);
|
|
7266
|
+
};
|
|
7267
|
+
}, [
|
|
7268
|
+
isHorizontal,
|
|
7269
|
+
onScrollbarXEnabledChange,
|
|
7270
|
+
onScrollbarYEnabledChange
|
|
7271
|
+
]);
|
|
7272
|
+
return context.type === "hover" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarHover, {
|
|
7273
|
+
...scrollbarProps,
|
|
7274
|
+
ref: forwardedRef,
|
|
7275
|
+
forceMount
|
|
7276
|
+
}) : context.type === "scroll" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarScroll, {
|
|
7277
|
+
...scrollbarProps,
|
|
7278
|
+
ref: forwardedRef,
|
|
7279
|
+
forceMount
|
|
7280
|
+
}) : context.type === "auto" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarAuto, {
|
|
7281
|
+
...scrollbarProps,
|
|
7282
|
+
ref: forwardedRef,
|
|
7283
|
+
forceMount
|
|
7284
|
+
}) : context.type === "always" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarVisible, {
|
|
7285
|
+
...scrollbarProps,
|
|
7286
|
+
ref: forwardedRef,
|
|
7287
|
+
"data-state": "visible"
|
|
7288
|
+
}) : null;
|
|
7289
|
+
}, "ScrollAreaScrollbar"));
|
|
7290
|
+
var ScrollAreaScrollbarHover = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaScrollbarHover2(props, forwardedRef) {
|
|
7291
|
+
const { forceMount, ...scrollbarProps } = props;
|
|
7292
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
7293
|
+
const [visible, setVisible] = React$1.useState(false);
|
|
7294
|
+
React$1.useEffect(() => {
|
|
7295
|
+
const scrollArea = context.scrollArea;
|
|
7296
|
+
let hideTimer = 0;
|
|
7297
|
+
if (scrollArea) {
|
|
7298
|
+
const handlePointerEnter = /* @__PURE__ */ __name$6(() => {
|
|
7299
|
+
window.clearTimeout(hideTimer);
|
|
7300
|
+
setVisible(true);
|
|
7301
|
+
}, "handlePointerEnter");
|
|
7302
|
+
const handlePointerLeave = /* @__PURE__ */ __name$6(() => {
|
|
7303
|
+
hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay);
|
|
7304
|
+
}, "handlePointerLeave");
|
|
7305
|
+
scrollArea.addEventListener("pointerenter", handlePointerEnter);
|
|
7306
|
+
scrollArea.addEventListener("pointerleave", handlePointerLeave);
|
|
7307
|
+
return () => {
|
|
7308
|
+
window.clearTimeout(hideTimer);
|
|
7309
|
+
scrollArea.removeEventListener("pointerenter", handlePointerEnter);
|
|
7310
|
+
scrollArea.removeEventListener("pointerleave", handlePointerLeave);
|
|
7311
|
+
};
|
|
7312
|
+
}
|
|
7313
|
+
}, [context.scrollArea, context.scrollHideDelay]);
|
|
7314
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
7315
|
+
present: forceMount || visible,
|
|
7316
|
+
children: /* @__PURE__ */ jsx(ScrollAreaScrollbarAuto, {
|
|
7317
|
+
"data-state": visible ? "visible" : "hidden",
|
|
7318
|
+
...scrollbarProps,
|
|
7319
|
+
ref: forwardedRef
|
|
7320
|
+
})
|
|
7321
|
+
});
|
|
7322
|
+
}, "ScrollAreaScrollbarHover"));
|
|
7323
|
+
var ScrollAreaScrollbarScroll = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaScrollbarScroll2(props, forwardedRef) {
|
|
7324
|
+
const { forceMount, ...scrollbarProps } = props;
|
|
7325
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
7326
|
+
const isHorizontal = props.orientation === "horizontal";
|
|
7327
|
+
const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100);
|
|
7328
|
+
const [state, send] = useStateMachine("hidden", {
|
|
7329
|
+
hidden: { SCROLL: "scrolling" },
|
|
7330
|
+
scrolling: {
|
|
7331
|
+
SCROLL_END: "idle",
|
|
7332
|
+
POINTER_ENTER: "interacting"
|
|
7333
|
+
},
|
|
7334
|
+
interacting: {
|
|
7335
|
+
SCROLL: "interacting",
|
|
7336
|
+
POINTER_LEAVE: "idle"
|
|
7337
|
+
},
|
|
7338
|
+
idle: {
|
|
7339
|
+
HIDE: "hidden",
|
|
7340
|
+
SCROLL: "scrolling",
|
|
7341
|
+
POINTER_ENTER: "interacting"
|
|
7342
|
+
}
|
|
7343
|
+
});
|
|
7344
|
+
React$1.useEffect(() => {
|
|
7345
|
+
if (state === "idle") {
|
|
7346
|
+
const hideTimer = window.setTimeout(() => send("HIDE"), context.scrollHideDelay);
|
|
7347
|
+
return () => window.clearTimeout(hideTimer);
|
|
7348
|
+
}
|
|
7349
|
+
}, [
|
|
7350
|
+
state,
|
|
7351
|
+
context.scrollHideDelay,
|
|
7352
|
+
send
|
|
7353
|
+
]);
|
|
7354
|
+
React$1.useEffect(() => {
|
|
7355
|
+
const viewport = context.viewport;
|
|
7356
|
+
const scrollDirection = isHorizontal ? "scrollLeft" : "scrollTop";
|
|
7357
|
+
if (viewport) {
|
|
7358
|
+
let prevScrollPos = viewport[scrollDirection];
|
|
7359
|
+
const handleScroll = /* @__PURE__ */ __name$6(() => {
|
|
7360
|
+
const scrollPos = viewport[scrollDirection];
|
|
7361
|
+
if (prevScrollPos !== scrollPos) {
|
|
7362
|
+
send("SCROLL");
|
|
7363
|
+
debounceScrollEnd();
|
|
7364
|
+
}
|
|
7365
|
+
prevScrollPos = scrollPos;
|
|
7366
|
+
}, "handleScroll");
|
|
7367
|
+
viewport.addEventListener("scroll", handleScroll);
|
|
7368
|
+
return () => viewport.removeEventListener("scroll", handleScroll);
|
|
7369
|
+
}
|
|
7370
|
+
}, [
|
|
7371
|
+
context.viewport,
|
|
7372
|
+
isHorizontal,
|
|
7373
|
+
send,
|
|
7374
|
+
debounceScrollEnd
|
|
7375
|
+
]);
|
|
7376
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
7377
|
+
present: forceMount || state !== "hidden",
|
|
7378
|
+
children: /* @__PURE__ */ jsx(ScrollAreaScrollbarVisible, {
|
|
7379
|
+
"data-state": state === "hidden" ? "hidden" : "visible",
|
|
7380
|
+
...scrollbarProps,
|
|
7381
|
+
ref: forwardedRef,
|
|
7382
|
+
onPointerEnter: composeEventHandlers(props.onPointerEnter, () => send("POINTER_ENTER")),
|
|
7383
|
+
onPointerLeave: composeEventHandlers(props.onPointerLeave, () => send("POINTER_LEAVE"))
|
|
7384
|
+
})
|
|
7385
|
+
});
|
|
7386
|
+
}, "ScrollAreaScrollbarScroll"));
|
|
7387
|
+
var ScrollAreaScrollbarAuto = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaScrollbarAuto2(props, forwardedRef) {
|
|
7388
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
7389
|
+
const { forceMount, ...scrollbarProps } = props;
|
|
7390
|
+
const [visible, setVisible] = React$1.useState(false);
|
|
7391
|
+
const isHorizontal = props.orientation === "horizontal";
|
|
7392
|
+
const handleResize = useDebounceCallback(() => {
|
|
7393
|
+
if (context.viewport) {
|
|
7394
|
+
const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth;
|
|
7395
|
+
const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight;
|
|
7396
|
+
setVisible(isHorizontal ? isOverflowX : isOverflowY);
|
|
7397
|
+
}
|
|
7398
|
+
}, 10);
|
|
7399
|
+
useResizeObserver(context.viewport, handleResize);
|
|
7400
|
+
useResizeObserver(context.content, handleResize);
|
|
7401
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
7402
|
+
present: forceMount || visible,
|
|
7403
|
+
children: /* @__PURE__ */ jsx(ScrollAreaScrollbarVisible, {
|
|
7404
|
+
"data-state": visible ? "visible" : "hidden",
|
|
7405
|
+
...scrollbarProps,
|
|
7406
|
+
ref: forwardedRef
|
|
7407
|
+
})
|
|
7408
|
+
});
|
|
7409
|
+
}, "ScrollAreaScrollbarAuto"));
|
|
7410
|
+
var ScrollAreaScrollbarVisible = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaScrollbarVisible2(props, forwardedRef) {
|
|
7411
|
+
const { orientation = "vertical", ...scrollbarProps } = props;
|
|
7412
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
7413
|
+
const thumbRef = React$1.useRef(null);
|
|
7414
|
+
const pointerOffsetRef = React$1.useRef(0);
|
|
7415
|
+
const [sizes, setSizes] = React$1.useState({
|
|
7416
|
+
content: 0,
|
|
7417
|
+
viewport: 0,
|
|
7418
|
+
scrollbar: {
|
|
7419
|
+
size: 0,
|
|
7420
|
+
paddingStart: 0,
|
|
7421
|
+
paddingEnd: 0
|
|
7422
|
+
}
|
|
7423
|
+
});
|
|
7424
|
+
const thumbRatio = getThumbRatio(sizes.viewport, sizes.content);
|
|
7425
|
+
const commonProps = {
|
|
7426
|
+
...scrollbarProps,
|
|
7427
|
+
sizes,
|
|
7428
|
+
onSizesChange: setSizes,
|
|
7429
|
+
hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),
|
|
7430
|
+
onThumbChange: /* @__PURE__ */ __name$6((thumb) => thumbRef.current = thumb, "onThumbChange"),
|
|
7431
|
+
onThumbPointerUp: /* @__PURE__ */ __name$6(() => pointerOffsetRef.current = 0, "onThumbPointerUp"),
|
|
7432
|
+
onThumbPointerDown: /* @__PURE__ */ __name$6((pointerPos) => pointerOffsetRef.current = pointerPos, "onThumbPointerDown")
|
|
7433
|
+
};
|
|
7434
|
+
function getScrollPosition(pointerPos, dir) {
|
|
7435
|
+
return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir);
|
|
7436
|
+
}
|
|
7437
|
+
__name$6(getScrollPosition, "getScrollPosition");
|
|
7438
|
+
if (orientation === "horizontal") return /* @__PURE__ */ jsx(ScrollAreaScrollbarX, {
|
|
7439
|
+
...commonProps,
|
|
7440
|
+
ref: forwardedRef,
|
|
7441
|
+
onThumbPositionChange: () => {
|
|
7442
|
+
if (context.viewport && thumbRef.current) {
|
|
7443
|
+
const scrollPos = context.viewport.scrollLeft;
|
|
7444
|
+
const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir);
|
|
7445
|
+
thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;
|
|
7446
|
+
}
|
|
7447
|
+
},
|
|
7448
|
+
onWheelScroll: (scrollPos) => {
|
|
7449
|
+
if (context.viewport) context.viewport.scrollLeft = scrollPos;
|
|
7450
|
+
},
|
|
7451
|
+
onDragScroll: (pointerPos) => {
|
|
7452
|
+
if (context.viewport) context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir);
|
|
7453
|
+
}
|
|
7454
|
+
});
|
|
7455
|
+
if (orientation === "vertical") return /* @__PURE__ */ jsx(ScrollAreaScrollbarY, {
|
|
7456
|
+
...commonProps,
|
|
7457
|
+
ref: forwardedRef,
|
|
7458
|
+
onThumbPositionChange: () => {
|
|
7459
|
+
if (context.viewport && thumbRef.current) {
|
|
7460
|
+
const scrollPos = context.viewport.scrollTop;
|
|
7461
|
+
const offset = getThumbOffsetFromScroll(scrollPos, sizes);
|
|
7462
|
+
thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;
|
|
7463
|
+
}
|
|
7464
|
+
},
|
|
7465
|
+
onWheelScroll: (scrollPos) => {
|
|
7466
|
+
if (context.viewport) context.viewport.scrollTop = scrollPos;
|
|
7467
|
+
},
|
|
7468
|
+
onDragScroll: (pointerPos) => {
|
|
7469
|
+
if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos);
|
|
7470
|
+
}
|
|
7471
|
+
});
|
|
7472
|
+
return null;
|
|
7473
|
+
}, "ScrollAreaScrollbarVisible"));
|
|
7474
|
+
var ScrollAreaScrollbarX = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaScrollbarX2(props, forwardedRef) {
|
|
7475
|
+
const { sizes, onSizesChange, ...scrollbarProps } = props;
|
|
7476
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
7477
|
+
const [computedStyle, setComputedStyle] = React$1.useState();
|
|
7478
|
+
const ref = React$1.useRef(null);
|
|
7479
|
+
const composeRefs = useComposedRefs$1(forwardedRef, ref, context.onScrollbarXChange);
|
|
7480
|
+
React$1.useEffect(() => {
|
|
7481
|
+
if (ref.current) setComputedStyle(getComputedStyle(ref.current));
|
|
7482
|
+
}, [ref]);
|
|
7483
|
+
return /* @__PURE__ */ jsx(ScrollAreaScrollbarImpl, {
|
|
7484
|
+
"data-orientation": "horizontal",
|
|
7485
|
+
...scrollbarProps,
|
|
7486
|
+
ref: composeRefs,
|
|
7487
|
+
sizes,
|
|
7488
|
+
style: {
|
|
7489
|
+
bottom: 0,
|
|
7490
|
+
left: context.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
7491
|
+
right: context.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
7492
|
+
"--radix-scroll-area-thumb-width": getThumbSize(sizes) + "px",
|
|
7493
|
+
...props.style
|
|
7494
|
+
},
|
|
7495
|
+
onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.x),
|
|
7496
|
+
onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.x),
|
|
7497
|
+
onWheelScroll: (event, maxScrollPos) => {
|
|
7498
|
+
if (context.viewport) {
|
|
7499
|
+
const scrollPos = context.viewport.scrollLeft + event.deltaX;
|
|
7500
|
+
props.onWheelScroll(scrollPos);
|
|
7501
|
+
if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) event.preventDefault();
|
|
7502
|
+
}
|
|
7503
|
+
},
|
|
7504
|
+
onResize: () => {
|
|
7505
|
+
if (ref.current && context.viewport && computedStyle) onSizesChange({
|
|
7506
|
+
content: context.viewport.scrollWidth,
|
|
7507
|
+
viewport: context.viewport.offsetWidth,
|
|
7508
|
+
scrollbar: {
|
|
7509
|
+
size: ref.current.clientWidth,
|
|
7510
|
+
paddingStart: toInt(computedStyle.paddingLeft),
|
|
7511
|
+
paddingEnd: toInt(computedStyle.paddingRight)
|
|
7512
|
+
}
|
|
7513
|
+
});
|
|
7514
|
+
}
|
|
7515
|
+
});
|
|
7516
|
+
}, "ScrollAreaScrollbarX"));
|
|
7517
|
+
var ScrollAreaScrollbarY = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaScrollbarY2(props, forwardedRef) {
|
|
7518
|
+
const { sizes, onSizesChange, ...scrollbarProps } = props;
|
|
7519
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
7520
|
+
const [computedStyle, setComputedStyle] = React$1.useState();
|
|
7521
|
+
const ref = React$1.useRef(null);
|
|
7522
|
+
const composeRefs = useComposedRefs$1(forwardedRef, ref, context.onScrollbarYChange);
|
|
7523
|
+
React$1.useEffect(() => {
|
|
7524
|
+
if (ref.current) setComputedStyle(getComputedStyle(ref.current));
|
|
7525
|
+
}, [ref]);
|
|
7526
|
+
return /* @__PURE__ */ jsx(ScrollAreaScrollbarImpl, {
|
|
7527
|
+
"data-orientation": "vertical",
|
|
7528
|
+
...scrollbarProps,
|
|
7529
|
+
ref: composeRefs,
|
|
7530
|
+
sizes,
|
|
7531
|
+
style: {
|
|
7532
|
+
top: 0,
|
|
7533
|
+
right: context.dir === "ltr" ? 0 : void 0,
|
|
7534
|
+
left: context.dir === "rtl" ? 0 : void 0,
|
|
7535
|
+
bottom: "var(--radix-scroll-area-corner-height)",
|
|
7536
|
+
"--radix-scroll-area-thumb-height": getThumbSize(sizes) + "px",
|
|
7537
|
+
...props.style
|
|
7538
|
+
},
|
|
7539
|
+
onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.y),
|
|
7540
|
+
onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.y),
|
|
7541
|
+
onWheelScroll: (event, maxScrollPos) => {
|
|
7542
|
+
if (context.viewport) {
|
|
7543
|
+
const scrollPos = context.viewport.scrollTop + event.deltaY;
|
|
7544
|
+
props.onWheelScroll(scrollPos);
|
|
7545
|
+
if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) event.preventDefault();
|
|
7546
|
+
}
|
|
7547
|
+
},
|
|
7548
|
+
onResize: () => {
|
|
7549
|
+
if (ref.current && context.viewport && computedStyle) onSizesChange({
|
|
7550
|
+
content: context.viewport.scrollHeight,
|
|
7551
|
+
viewport: context.viewport.offsetHeight,
|
|
7552
|
+
scrollbar: {
|
|
7553
|
+
size: ref.current.clientHeight,
|
|
7554
|
+
paddingStart: toInt(computedStyle.paddingTop),
|
|
7555
|
+
paddingEnd: toInt(computedStyle.paddingBottom)
|
|
7556
|
+
}
|
|
7557
|
+
});
|
|
7558
|
+
}
|
|
7559
|
+
});
|
|
7560
|
+
}, "ScrollAreaScrollbarY"));
|
|
7561
|
+
var [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME);
|
|
7562
|
+
var ScrollAreaScrollbarImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaScrollbarImpl2(props, forwardedRef) {
|
|
7563
|
+
const { __scopeScrollArea, sizes, hasThumb, onThumbChange, onThumbPointerUp, onThumbPointerDown, onThumbPositionChange, onDragScroll, onWheelScroll, onResize, ...scrollbarProps } = props;
|
|
7564
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);
|
|
7565
|
+
const [scrollbar, setScrollbar] = React$1.useState(null);
|
|
7566
|
+
const composeRefs = useComposedRefs$1(forwardedRef, setScrollbar);
|
|
7567
|
+
const rectRef = React$1.useRef(null);
|
|
7568
|
+
const prevWebkitUserSelectRef = React$1.useRef("");
|
|
7569
|
+
const viewport = context.viewport;
|
|
7570
|
+
const maxScrollPos = sizes.content - sizes.viewport;
|
|
7571
|
+
const handleWheelScroll = useCallbackRef$1(onWheelScroll);
|
|
7572
|
+
const handleThumbPositionChange = useCallbackRef$1(onThumbPositionChange);
|
|
7573
|
+
const handleResize = useDebounceCallback(onResize, 10);
|
|
7574
|
+
function handleDragScroll(event) {
|
|
7575
|
+
if (rectRef.current) {
|
|
7576
|
+
const x = event.clientX - rectRef.current.left;
|
|
7577
|
+
const y = event.clientY - rectRef.current.top;
|
|
7578
|
+
onDragScroll({
|
|
7579
|
+
x,
|
|
7580
|
+
y
|
|
7581
|
+
});
|
|
7582
|
+
}
|
|
7583
|
+
}
|
|
7584
|
+
__name$6(handleDragScroll, "handleDragScroll");
|
|
7585
|
+
React$1.useEffect(() => {
|
|
7586
|
+
const handleWheel = /* @__PURE__ */ __name$6((event) => {
|
|
7587
|
+
const element = event.target;
|
|
7588
|
+
if (scrollbar?.contains(element)) handleWheelScroll(event, maxScrollPos);
|
|
7589
|
+
}, "handleWheel");
|
|
7590
|
+
document.addEventListener("wheel", handleWheel, { passive: false });
|
|
7591
|
+
return () => document.removeEventListener("wheel", handleWheel, { passive: false });
|
|
7592
|
+
}, [
|
|
7593
|
+
viewport,
|
|
7594
|
+
scrollbar,
|
|
7595
|
+
maxScrollPos,
|
|
7596
|
+
handleWheelScroll
|
|
7597
|
+
]);
|
|
7598
|
+
React$1.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]);
|
|
7599
|
+
useResizeObserver(scrollbar, handleResize);
|
|
7600
|
+
useResizeObserver(context.content, handleResize);
|
|
7601
|
+
return /* @__PURE__ */ jsx(ScrollbarProvider, {
|
|
7602
|
+
scope: __scopeScrollArea,
|
|
7603
|
+
scrollbar,
|
|
7604
|
+
hasThumb,
|
|
7605
|
+
onThumbChange: useCallbackRef$1(onThumbChange),
|
|
7606
|
+
onThumbPointerUp: useCallbackRef$1(onThumbPointerUp),
|
|
7607
|
+
onThumbPositionChange: handleThumbPositionChange,
|
|
7608
|
+
onThumbPointerDown: useCallbackRef$1(onThumbPointerDown),
|
|
7609
|
+
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
7610
|
+
...scrollbarProps,
|
|
7611
|
+
ref: composeRefs,
|
|
7612
|
+
style: {
|
|
7613
|
+
position: "absolute",
|
|
7614
|
+
...scrollbarProps.style
|
|
7615
|
+
},
|
|
7616
|
+
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
|
|
7617
|
+
if (event.button === 0) {
|
|
7618
|
+
event.target.setPointerCapture(event.pointerId);
|
|
7619
|
+
rectRef.current = scrollbar.getBoundingClientRect();
|
|
7620
|
+
prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;
|
|
7621
|
+
document.body.style.webkitUserSelect = "none";
|
|
7622
|
+
if (context.viewport) context.viewport.style.scrollBehavior = "auto";
|
|
7623
|
+
handleDragScroll(event);
|
|
7624
|
+
}
|
|
7625
|
+
}),
|
|
7626
|
+
onPointerMove: composeEventHandlers(props.onPointerMove, handleDragScroll),
|
|
7627
|
+
onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
|
|
7628
|
+
const element = event.target;
|
|
7629
|
+
if (element.hasPointerCapture(event.pointerId)) element.releasePointerCapture(event.pointerId);
|
|
7630
|
+
document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;
|
|
7631
|
+
if (context.viewport) context.viewport.style.scrollBehavior = "";
|
|
7632
|
+
rectRef.current = null;
|
|
7633
|
+
})
|
|
7634
|
+
})
|
|
7635
|
+
});
|
|
7636
|
+
}, "ScrollAreaScrollbarImpl"));
|
|
7637
|
+
var THUMB_NAME = "ScrollAreaThumb";
|
|
7638
|
+
var ScrollAreaThumb = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaThumb2(props, forwardedRef) {
|
|
7639
|
+
const { forceMount, ...thumbProps } = props;
|
|
7640
|
+
const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);
|
|
7641
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
7642
|
+
present: forceMount || scrollbarContext.hasThumb,
|
|
7643
|
+
children: /* @__PURE__ */ jsx(ScrollAreaThumbImpl, {
|
|
7644
|
+
ref: forwardedRef,
|
|
7645
|
+
...thumbProps
|
|
7646
|
+
})
|
|
7647
|
+
});
|
|
7648
|
+
}, "ScrollAreaThumb"));
|
|
7649
|
+
var ScrollAreaThumbImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaThumbImpl2(props, forwardedRef) {
|
|
7650
|
+
const { __scopeScrollArea, style, ...thumbProps } = props;
|
|
7651
|
+
const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);
|
|
7652
|
+
const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);
|
|
7653
|
+
const { onThumbPositionChange } = scrollbarContext;
|
|
7654
|
+
const composedRef = useComposedRefs$1(forwardedRef, scrollbarContext.onThumbChange);
|
|
7655
|
+
const removeUnlinkedScrollListenerRef = React$1.useRef(void 0);
|
|
7656
|
+
const debounceScrollEnd = useDebounceCallback(() => {
|
|
7657
|
+
if (removeUnlinkedScrollListenerRef.current) {
|
|
7658
|
+
removeUnlinkedScrollListenerRef.current();
|
|
7659
|
+
removeUnlinkedScrollListenerRef.current = void 0;
|
|
7660
|
+
}
|
|
7661
|
+
}, 100);
|
|
7662
|
+
React$1.useEffect(() => {
|
|
7663
|
+
const viewport = scrollAreaContext.viewport;
|
|
7664
|
+
if (viewport) {
|
|
7665
|
+
const handleScroll = /* @__PURE__ */ __name$6(() => {
|
|
7666
|
+
debounceScrollEnd();
|
|
7667
|
+
if (!removeUnlinkedScrollListenerRef.current) {
|
|
7668
|
+
const listener = addUnlinkedScrollListener(viewport, onThumbPositionChange);
|
|
7669
|
+
removeUnlinkedScrollListenerRef.current = listener;
|
|
7670
|
+
onThumbPositionChange();
|
|
7671
|
+
}
|
|
7672
|
+
}, "handleScroll");
|
|
7673
|
+
onThumbPositionChange();
|
|
7674
|
+
viewport.addEventListener("scroll", handleScroll);
|
|
7675
|
+
return () => viewport.removeEventListener("scroll", handleScroll);
|
|
7676
|
+
}
|
|
7677
|
+
}, [
|
|
7678
|
+
scrollAreaContext.viewport,
|
|
7679
|
+
debounceScrollEnd,
|
|
7680
|
+
onThumbPositionChange
|
|
7681
|
+
]);
|
|
7682
|
+
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
7683
|
+
"data-state": scrollbarContext.hasThumb ? "visible" : "hidden",
|
|
7684
|
+
...thumbProps,
|
|
7685
|
+
ref: composedRef,
|
|
7686
|
+
style: {
|
|
7687
|
+
width: "var(--radix-scroll-area-thumb-width)",
|
|
7688
|
+
height: "var(--radix-scroll-area-thumb-height)",
|
|
7689
|
+
...style
|
|
7690
|
+
},
|
|
7691
|
+
onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, (event) => {
|
|
7692
|
+
const thumbRect = event.target.getBoundingClientRect();
|
|
7693
|
+
const x = event.clientX - thumbRect.left;
|
|
7694
|
+
const y = event.clientY - thumbRect.top;
|
|
7695
|
+
scrollbarContext.onThumbPointerDown({
|
|
7696
|
+
x,
|
|
7697
|
+
y
|
|
7698
|
+
});
|
|
7699
|
+
}),
|
|
7700
|
+
onPointerUp: composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)
|
|
7701
|
+
});
|
|
7702
|
+
}, "ScrollAreaThumbImpl"));
|
|
7703
|
+
var CORNER_NAME = "ScrollAreaCorner";
|
|
7704
|
+
var ScrollAreaCorner = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaCorner2(props, forwardedRef) {
|
|
7705
|
+
const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea);
|
|
7706
|
+
const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);
|
|
7707
|
+
return context.type !== "scroll" && hasBothScrollbarsVisible ? /* @__PURE__ */ jsx(ScrollAreaCornerImpl, {
|
|
7708
|
+
...props,
|
|
7709
|
+
ref: forwardedRef
|
|
7710
|
+
}) : null;
|
|
7711
|
+
}, "ScrollAreaCorner"));
|
|
7712
|
+
var ScrollAreaCornerImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$6(function ScrollAreaCornerImpl2(props, forwardedRef) {
|
|
7713
|
+
const { __scopeScrollArea, ...cornerProps } = props;
|
|
7714
|
+
const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea);
|
|
7715
|
+
const [width, setWidth] = React$1.useState(0);
|
|
7716
|
+
const [height, setHeight] = React$1.useState(0);
|
|
7717
|
+
const hasSize = Boolean(width && height);
|
|
7718
|
+
const { onCornerWidthChange, onCornerHeightChange } = context;
|
|
7719
|
+
useResizeObserver(context.scrollbarX, () => {
|
|
7720
|
+
const height2 = context.scrollbarX?.offsetHeight || 0;
|
|
7721
|
+
context.onCornerHeightChange(height2);
|
|
7722
|
+
setHeight(height2);
|
|
7723
|
+
});
|
|
7724
|
+
useResizeObserver(context.scrollbarY, () => {
|
|
7725
|
+
const width2 = context.scrollbarY?.offsetWidth || 0;
|
|
7726
|
+
context.onCornerWidthChange(width2);
|
|
7727
|
+
setWidth(width2);
|
|
7728
|
+
});
|
|
7729
|
+
React$1.useEffect(() => {
|
|
7730
|
+
return () => {
|
|
7731
|
+
onCornerWidthChange(0);
|
|
7732
|
+
onCornerHeightChange(0);
|
|
7733
|
+
};
|
|
7734
|
+
}, [onCornerWidthChange, onCornerHeightChange]);
|
|
7735
|
+
return hasSize ? /* @__PURE__ */ jsx(Primitive.div, {
|
|
7736
|
+
...cornerProps,
|
|
7737
|
+
ref: forwardedRef,
|
|
7738
|
+
style: {
|
|
7739
|
+
width,
|
|
7740
|
+
height,
|
|
7741
|
+
position: "absolute",
|
|
7742
|
+
right: context.dir === "ltr" ? 0 : void 0,
|
|
7743
|
+
left: context.dir === "rtl" ? 0 : void 0,
|
|
7744
|
+
bottom: 0,
|
|
7745
|
+
...props.style
|
|
7746
|
+
}
|
|
7747
|
+
}) : null;
|
|
7748
|
+
}, "ScrollAreaCornerImpl"));
|
|
7749
|
+
function toInt(value) {
|
|
7750
|
+
return value ? parseInt(value, 10) : 0;
|
|
7751
|
+
}
|
|
7752
|
+
__name$6(toInt, "toInt");
|
|
7753
|
+
function getThumbRatio(viewportSize, contentSize) {
|
|
7754
|
+
const ratio = viewportSize / contentSize;
|
|
7755
|
+
return isNaN(ratio) ? 0 : ratio;
|
|
7756
|
+
}
|
|
7757
|
+
__name$6(getThumbRatio, "getThumbRatio");
|
|
7758
|
+
function getThumbSize(sizes) {
|
|
7759
|
+
const ratio = getThumbRatio(sizes.viewport, sizes.content);
|
|
7760
|
+
const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
|
|
7761
|
+
const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;
|
|
7762
|
+
return Math.max(thumbSize, 18);
|
|
7763
|
+
}
|
|
7764
|
+
__name$6(getThumbSize, "getThumbSize");
|
|
7765
|
+
function getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = "ltr") {
|
|
7766
|
+
const thumbSizePx = getThumbSize(sizes);
|
|
7767
|
+
const thumbCenter = thumbSizePx / 2;
|
|
7768
|
+
const offset = pointerOffset || thumbCenter;
|
|
7769
|
+
const thumbOffsetFromEnd = thumbSizePx - offset;
|
|
7770
|
+
const minPointerPos = sizes.scrollbar.paddingStart + offset;
|
|
7771
|
+
const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;
|
|
7772
|
+
const maxScrollPos = sizes.content - sizes.viewport;
|
|
7773
|
+
const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
|
|
7774
|
+
return linearScale([minPointerPos, maxPointerPos], scrollRange)(pointerPos);
|
|
7775
|
+
}
|
|
7776
|
+
__name$6(getScrollPositionFromPointer, "getScrollPositionFromPointer");
|
|
7777
|
+
function getThumbOffsetFromScroll(scrollPos, sizes, dir = "ltr") {
|
|
7778
|
+
const thumbSizePx = getThumbSize(sizes);
|
|
7779
|
+
const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
|
|
7780
|
+
const scrollbar = sizes.scrollbar.size - scrollbarPadding;
|
|
7781
|
+
const maxScrollPos = sizes.content - sizes.viewport;
|
|
7782
|
+
const maxThumbPos = scrollbar - thumbSizePx;
|
|
7783
|
+
const scrollWithoutMomentum = clamp$1(scrollPos, dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0]);
|
|
7784
|
+
return linearScale([0, maxScrollPos], [0, maxThumbPos])(scrollWithoutMomentum);
|
|
7785
|
+
}
|
|
7786
|
+
__name$6(getThumbOffsetFromScroll, "getThumbOffsetFromScroll");
|
|
7787
|
+
function linearScale(input, output) {
|
|
7788
|
+
return (value) => {
|
|
7789
|
+
if (input[0] === input[1] || output[0] === output[1]) return output[0];
|
|
7790
|
+
const ratio = (output[1] - output[0]) / (input[1] - input[0]);
|
|
7791
|
+
return output[0] + ratio * (value - input[0]);
|
|
7792
|
+
};
|
|
7793
|
+
}
|
|
7794
|
+
__name$6(linearScale, "linearScale");
|
|
7795
|
+
function isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) {
|
|
7796
|
+
return scrollPos > 0 && scrollPos < maxScrollPos;
|
|
7797
|
+
}
|
|
7798
|
+
__name$6(isScrollingWithinScrollbarBounds, "isScrollingWithinScrollbarBounds");
|
|
7799
|
+
var addUnlinkedScrollListener = /* @__PURE__ */ __name$6((node, handler = () => {}) => {
|
|
7800
|
+
let prevPosition = {
|
|
7801
|
+
left: node.scrollLeft,
|
|
7802
|
+
top: node.scrollTop
|
|
7803
|
+
};
|
|
7804
|
+
let rAF = 0;
|
|
7805
|
+
(/* @__PURE__ */ __name$6((function loop() {
|
|
7806
|
+
const position = {
|
|
7807
|
+
left: node.scrollLeft,
|
|
7808
|
+
top: node.scrollTop
|
|
7809
|
+
};
|
|
7810
|
+
const isHorizontalScroll = prevPosition.left !== position.left;
|
|
7811
|
+
const isVerticalScroll = prevPosition.top !== position.top;
|
|
7812
|
+
if (isHorizontalScroll || isVerticalScroll) handler();
|
|
7813
|
+
prevPosition = position;
|
|
7814
|
+
rAF = window.requestAnimationFrame(loop);
|
|
7815
|
+
}), "loop"))();
|
|
7816
|
+
return () => window.cancelAnimationFrame(rAF);
|
|
7817
|
+
}, "addUnlinkedScrollListener");
|
|
7818
|
+
function useDebounceCallback(callback, delay) {
|
|
7819
|
+
const handleCallback = useCallbackRef$1(callback);
|
|
7820
|
+
const debounceTimerRef = React$1.useRef(0);
|
|
7821
|
+
React$1.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);
|
|
7822
|
+
return React$1.useCallback(() => {
|
|
7823
|
+
window.clearTimeout(debounceTimerRef.current);
|
|
7824
|
+
debounceTimerRef.current = window.setTimeout(handleCallback, delay);
|
|
7825
|
+
}, [handleCallback, delay]);
|
|
7826
|
+
}
|
|
7827
|
+
__name$6(useDebounceCallback, "useDebounceCallback");
|
|
7828
|
+
function useResizeObserver(element, onResize) {
|
|
7829
|
+
const handleResize = useCallbackRef$1(onResize);
|
|
7830
|
+
useLayoutEffect2(() => {
|
|
7831
|
+
let rAF = 0;
|
|
7832
|
+
if (element) {
|
|
7833
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
7834
|
+
cancelAnimationFrame(rAF);
|
|
7835
|
+
rAF = window.requestAnimationFrame(handleResize);
|
|
7836
|
+
});
|
|
7837
|
+
resizeObserver.observe(element);
|
|
7838
|
+
return () => {
|
|
7839
|
+
window.cancelAnimationFrame(rAF);
|
|
7840
|
+
resizeObserver.unobserve(element);
|
|
7841
|
+
};
|
|
7842
|
+
}
|
|
7843
|
+
}, [element, handleResize]);
|
|
7844
|
+
}
|
|
7845
|
+
__name$6(useResizeObserver, "useResizeObserver");
|
|
7846
|
+
var Root$2 = ScrollArea$1;
|
|
7847
|
+
var Viewport$1 = ScrollAreaViewport;
|
|
7848
|
+
var Scrollbar = ScrollAreaScrollbar;
|
|
7849
|
+
var Thumb = ScrollAreaThumb;
|
|
7850
|
+
var Corner = ScrollAreaCorner;
|
|
7851
|
+
|
|
7852
|
+
//#endregion
|
|
7853
|
+
//#region ../ui-kit/src/components/ScrollArea.tsx
|
|
7854
|
+
/** Source-owned scroll container with accessible Radix viewport semantics. */
|
|
7855
|
+
function ScrollArea({ children, className = "", ...props }) {
|
|
7856
|
+
return /* @__PURE__ */ jsxs(Root$2, {
|
|
7857
|
+
className: `relative overflow-hidden ${className}`,
|
|
7858
|
+
...props,
|
|
7859
|
+
children: [
|
|
7860
|
+
/* @__PURE__ */ jsx(Viewport$1, {
|
|
7861
|
+
className: "h-full w-full rounded-[inherit]",
|
|
7862
|
+
children
|
|
7863
|
+
}),
|
|
7864
|
+
/* @__PURE__ */ jsx(Scrollbar, {
|
|
7865
|
+
orientation: "vertical",
|
|
7866
|
+
className: "flex w-2.5 touch-none select-none p-0.5 transition-colors",
|
|
7867
|
+
children: /* @__PURE__ */ jsx(Thumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
7868
|
+
}),
|
|
7869
|
+
/* @__PURE__ */ jsx(Scrollbar, {
|
|
7870
|
+
orientation: "horizontal",
|
|
7871
|
+
className: "flex h-2.5 touch-none select-none p-0.5 transition-colors",
|
|
7872
|
+
children: /* @__PURE__ */ jsx(Thumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
7873
|
+
}),
|
|
7874
|
+
/* @__PURE__ */ jsx(Corner, { className: "bg-surface" })
|
|
7875
|
+
]
|
|
7876
|
+
});
|
|
7877
|
+
}
|
|
7878
|
+
|
|
7141
7879
|
//#endregion
|
|
7142
7880
|
//#region ../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.23_@types+react-dom@19.2.3_@types+react@19.2.17__@types+reac_ebeaa069aac513f5f318f7d1d5f561bf/node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
7143
7881
|
var __defProp$5 = Object.defineProperty;
|
|
@@ -7721,7 +8459,7 @@ var ToastImpl = /* @__PURE__ */ React$1.forwardRef(/* @__PURE__ */ __name$3(func
|
|
|
7721
8459
|
onClose: handleClose,
|
|
7722
8460
|
children: ReactDOM.createPortal(/* @__PURE__ */ jsx(Collection.ItemSlot, {
|
|
7723
8461
|
scope: __scopeToast,
|
|
7724
|
-
children: /* @__PURE__ */ jsx(Root$
|
|
8462
|
+
children: /* @__PURE__ */ jsx(Root$5, {
|
|
7725
8463
|
asChild: true,
|
|
7726
8464
|
onEscapeKeyDown: composeEventHandlers(onEscapeKeyDown, (event) => {
|
|
7727
8465
|
if (!getItems().some((item) => item.ref.current?.contains(event.target))) handleClose();
|
|
@@ -7993,6 +8731,42 @@ function ToastClose({ className = "", children, asChild, ...props }) {
|
|
|
7993
8731
|
});
|
|
7994
8732
|
}
|
|
7995
8733
|
|
|
8734
|
+
//#endregion
|
|
8735
|
+
//#region ../ui-kit/src/components/Table.tsx
|
|
8736
|
+
/**
|
|
8737
|
+
* Semantic table primitive for compact operational data.
|
|
8738
|
+
*
|
|
8739
|
+
* 基类锁定 `w`(className 覆盖不生效):`w-full` 是表格约定。
|
|
8740
|
+
*/
|
|
8741
|
+
function Table({ className = "", ...props }) {
|
|
8742
|
+
return /* @__PURE__ */ jsx("table", {
|
|
8743
|
+
className: `w-full caption-bottom text-sm ${className}`,
|
|
8744
|
+
...props
|
|
8745
|
+
});
|
|
8746
|
+
}
|
|
8747
|
+
|
|
8748
|
+
//#endregion
|
|
8749
|
+
//#region ../ui-kit/src/components/DataTable.tsx
|
|
8750
|
+
/**
|
|
8751
|
+
* Source-owned shadcn-style table foundation.
|
|
8752
|
+
* The wrapper owns the visible frame and horizontal overflow; consumers own data behavior.
|
|
8753
|
+
*
|
|
8754
|
+
* 基类锁定 `min-w`(className 覆盖不生效):`min-w-max` 是横向滚动的前提。
|
|
8755
|
+
* `select-text`(0.10.0 UI-UX5 #40.12):单元格文本必须能用鼠标选中复制(如 run id),
|
|
8756
|
+
* 不被上层容器或控件壳的 user-select 设置截断。
|
|
8757
|
+
*/
|
|
8758
|
+
function DataTable({ children, className = "", containerClassName = "", ...props }) {
|
|
8759
|
+
return /* @__PURE__ */ jsx(ScrollArea, {
|
|
8760
|
+
className: `rounded-md border border-border bg-surface ${containerClassName}`,
|
|
8761
|
+
"data-webskill-data-table": "",
|
|
8762
|
+
children: /* @__PURE__ */ jsx(Table, {
|
|
8763
|
+
className: `min-w-max border-collapse text-sm text-ink select-text ${className}`,
|
|
8764
|
+
...props,
|
|
8765
|
+
children
|
|
8766
|
+
})
|
|
8767
|
+
});
|
|
8768
|
+
}
|
|
8769
|
+
|
|
7996
8770
|
//#endregion
|
|
7997
8771
|
//#region ../ui-kit/src/components/Dialog.tsx
|
|
7998
8772
|
/** 宽度阶梯由 Dialog 持有,AlertDialog 复用同一份——两套定义会让弹层宽度悄悄分叉 */
|
|
@@ -19638,6 +20412,38 @@ function defaultUrlTransform(value) {
|
|
|
19638
20412
|
return "";
|
|
19639
20413
|
}
|
|
19640
20414
|
|
|
20415
|
+
//#endregion
|
|
20416
|
+
//#region ../../node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.js
|
|
20417
|
+
/**
|
|
20418
|
+
* @import {Root} from 'mdast'
|
|
20419
|
+
* @import {Options} from 'remark-gfm'
|
|
20420
|
+
* @import {} from 'remark-parse'
|
|
20421
|
+
* @import {} from 'remark-stringify'
|
|
20422
|
+
* @import {Processor} from 'unified'
|
|
20423
|
+
*/
|
|
20424
|
+
/** @type {Options} */
|
|
20425
|
+
const emptyOptions = {};
|
|
20426
|
+
/**
|
|
20427
|
+
* Add support GFM (autolink literals, footnotes, strikethrough, tables,
|
|
20428
|
+
* tasklists).
|
|
20429
|
+
*
|
|
20430
|
+
* @param {Options | null | undefined} [options]
|
|
20431
|
+
* Configuration (optional).
|
|
20432
|
+
* @returns {undefined}
|
|
20433
|
+
* Nothing.
|
|
20434
|
+
*/
|
|
20435
|
+
function remarkGfm(options) {
|
|
20436
|
+
const self = this;
|
|
20437
|
+
const settings = options || emptyOptions;
|
|
20438
|
+
const data = self.data();
|
|
20439
|
+
const micromarkExtensions = data.micromarkExtensions || (data.micromarkExtensions = []);
|
|
20440
|
+
const fromMarkdownExtensions = data.fromMarkdownExtensions || (data.fromMarkdownExtensions = []);
|
|
20441
|
+
const toMarkdownExtensions = data.toMarkdownExtensions || (data.toMarkdownExtensions = []);
|
|
20442
|
+
micromarkExtensions.push(gfm(settings));
|
|
20443
|
+
fromMarkdownExtensions.push(gfmFromMarkdown());
|
|
20444
|
+
toMarkdownExtensions.push(gfmToMarkdown(settings));
|
|
20445
|
+
}
|
|
20446
|
+
|
|
19641
20447
|
//#endregion
|
|
19642
20448
|
//#region ../ui-kit/src/markdown/image.tsx
|
|
19643
20449
|
/** `<img>` 里的 data URL 不会执行脚本,SVG 同理——放行的前提就是这个上下文 */
|
|
@@ -24785,9 +25591,31 @@ function CodeBlock({ node: _node, className, children, ...rest }) {
|
|
|
24785
25591
|
* 模块级常量,**不可内联进 JSX**:react-markdown 按 `components` 的引用决定是否重建子树,
|
|
24786
25592
|
* 每次渲染换新对象会让图片组件卸载重挂,于是流式输出期间同一张图被反复解析。
|
|
24787
25593
|
*/
|
|
25594
|
+
const MARKDOWN_REMARK_PLUGINS = [remarkGfm];
|
|
24788
25595
|
const MARKDOWN_COMPONENTS = {
|
|
24789
25596
|
code: CodeBlock,
|
|
24790
25597
|
img: MarkdownImage,
|
|
25598
|
+
table: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(DataTable, {
|
|
25599
|
+
containerClassName: "my-3",
|
|
25600
|
+
...props,
|
|
25601
|
+
children
|
|
25602
|
+
}),
|
|
25603
|
+
thead: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("thead", {
|
|
25604
|
+
className: "bg-subtle text-ink",
|
|
25605
|
+
...props
|
|
25606
|
+
}),
|
|
25607
|
+
tr: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("tr", {
|
|
25608
|
+
className: "border-b border-border/60 last:border-0",
|
|
25609
|
+
...props
|
|
25610
|
+
}),
|
|
25611
|
+
th: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("th", {
|
|
25612
|
+
className: "border-r border-border/60 px-3 py-2 align-top font-semibold break-words last:border-r-0",
|
|
25613
|
+
...props
|
|
25614
|
+
}),
|
|
25615
|
+
td: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("td", {
|
|
25616
|
+
className: "border-r border-border/60 px-3 py-2 align-top break-words last:border-r-0",
|
|
25617
|
+
...props
|
|
25618
|
+
}),
|
|
24791
25619
|
p: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("p", {
|
|
24792
25620
|
className: "my-2",
|
|
24793
25621
|
...props
|
|
@@ -24815,6 +25643,7 @@ function Markdown({ children, className = "" }) {
|
|
|
24815
25643
|
return /* @__PURE__ */ jsx("div", {
|
|
24816
25644
|
className: `text-sm leading-6 text-ink ${className}`,
|
|
24817
25645
|
children: /* @__PURE__ */ jsx(Markdown$1, {
|
|
25646
|
+
remarkPlugins: MARKDOWN_REMARK_PLUGINS,
|
|
24818
25647
|
urlTransform: markdownUrlTransform,
|
|
24819
25648
|
components: MARKDOWN_COMPONENTS,
|
|
24820
25649
|
children
|
|
@@ -24822,38 +25651,6 @@ function Markdown({ children, className = "" }) {
|
|
|
24822
25651
|
});
|
|
24823
25652
|
}
|
|
24824
25653
|
|
|
24825
|
-
//#endregion
|
|
24826
|
-
//#region ../../node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.js
|
|
24827
|
-
/**
|
|
24828
|
-
* @import {Root} from 'mdast'
|
|
24829
|
-
* @import {Options} from 'remark-gfm'
|
|
24830
|
-
* @import {} from 'remark-parse'
|
|
24831
|
-
* @import {} from 'remark-stringify'
|
|
24832
|
-
* @import {Processor} from 'unified'
|
|
24833
|
-
*/
|
|
24834
|
-
/** @type {Options} */
|
|
24835
|
-
const emptyOptions = {};
|
|
24836
|
-
/**
|
|
24837
|
-
* Add support GFM (autolink literals, footnotes, strikethrough, tables,
|
|
24838
|
-
* tasklists).
|
|
24839
|
-
*
|
|
24840
|
-
* @param {Options | null | undefined} [options]
|
|
24841
|
-
* Configuration (optional).
|
|
24842
|
-
* @returns {undefined}
|
|
24843
|
-
* Nothing.
|
|
24844
|
-
*/
|
|
24845
|
-
function remarkGfm(options) {
|
|
24846
|
-
const self = this;
|
|
24847
|
-
const settings = options || emptyOptions;
|
|
24848
|
-
const data = self.data();
|
|
24849
|
-
const micromarkExtensions = data.micromarkExtensions || (data.micromarkExtensions = []);
|
|
24850
|
-
const fromMarkdownExtensions = data.fromMarkdownExtensions || (data.fromMarkdownExtensions = []);
|
|
24851
|
-
const toMarkdownExtensions = data.toMarkdownExtensions || (data.toMarkdownExtensions = []);
|
|
24852
|
-
micromarkExtensions.push(gfm(settings));
|
|
24853
|
-
fromMarkdownExtensions.push(gfmFromMarkdown());
|
|
24854
|
-
toMarkdownExtensions.push(gfmToMarkdown(settings));
|
|
24855
|
-
}
|
|
24856
|
-
|
|
24857
25654
|
//#endregion
|
|
24858
25655
|
//#region ../../node_modules/.pnpm/@assistant-ui+react-markdown@0.14.8_@assistant-ui+react@0.15.1_@types+react-dom@19.2.3__49324ceaef79b2a6657cae4ac6d15169/node_modules/@assistant-ui/react-markdown/dist/memoization.js
|
|
24859
25656
|
const areChildrenEqual = (prev, next) => {
|
|
@@ -25265,6 +26062,7 @@ const FILE_MIME_TYPES = ["application/pdf"];
|
|
|
25265
26062
|
* 不走直通的 `file`:docx / xlsx / pptx 发给 provider 会被当成二进制垃圾。
|
|
25266
26063
|
*/
|
|
25267
26064
|
const DOCX_MIME = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
26065
|
+
const XLS_MIME = "application/vnd.ms-excel";
|
|
25268
26066
|
const XLSX_MIME = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
25269
26067
|
const PPTX_MIME = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
25270
26068
|
/**
|
|
@@ -25290,11 +26088,13 @@ const IMAGE_MIME_SET = new Set(IMAGE_MIME_TYPES);
|
|
|
25290
26088
|
const FILE_MIME_SET = new Set(FILE_MIME_TYPES);
|
|
25291
26089
|
const EXTRACTED_MIME_SET = /* @__PURE__ */ new Set([
|
|
25292
26090
|
DOCX_MIME,
|
|
26091
|
+
XLS_MIME,
|
|
25293
26092
|
XLSX_MIME,
|
|
25294
26093
|
PPTX_MIME
|
|
25295
26094
|
]);
|
|
25296
26095
|
const EXTRACTED_EXTENSION_SET = /* @__PURE__ */ new Set([
|
|
25297
26096
|
"docx",
|
|
26097
|
+
"xls",
|
|
25298
26098
|
"xlsx",
|
|
25299
26099
|
"pptx"
|
|
25300
26100
|
]);
|
|
@@ -25313,7 +26113,7 @@ function extensionOf(fileName) {
|
|
|
25313
26113
|
if (FILE_MIME_SET.has(type)) return "file";
|
|
25314
26114
|
if (type.startsWith("text/") || type === "application/json") return "text";
|
|
25315
26115
|
if (type === "" && TEXT_EXTENSION_SET.has(extensionOf(fileName))) return "text";
|
|
25316
|
-
if (type === "" && EXTRACTED_EXTENSION_SET.has(extensionOf(fileName))) return "document-text";
|
|
26116
|
+
if ((type === "" || type === OPAQUE_MIME) && EXTRACTED_EXTENSION_SET.has(extensionOf(fileName))) return "document-text";
|
|
25317
26117
|
if ((type === "" || type === OPAQUE_MIME) && BINARY_EXTENSION_SET.has(extensionOf(fileName))) return "binary";
|
|
25318
26118
|
}
|
|
25319
26119
|
|
|
@@ -25916,6 +26716,7 @@ const chatbotDictionary = defineDictionary({
|
|
|
25916
26716
|
"composer.inputLabel": "Message input",
|
|
25917
26717
|
"composer.send": "Send",
|
|
25918
26718
|
"composer.stop": "Stop",
|
|
26719
|
+
"composer.processingAttachments": "Processing attachments on this device. Large files may take a while; please keep this chat open…",
|
|
25919
26720
|
"composer.attachments": "Attachments",
|
|
25920
26721
|
"composer.addAttachment": "Attach a file",
|
|
25921
26722
|
"composer.removeAttachment": "Remove attachment: {name}",
|
|
@@ -26376,6 +27177,7 @@ const chatbotDictionary = defineDictionary({
|
|
|
26376
27177
|
"composer.inputLabel": "消息输入框",
|
|
26377
27178
|
"composer.send": "发送",
|
|
26378
27179
|
"composer.stop": "停止",
|
|
27180
|
+
"composer.processingAttachments": "正在本机处理附件,大文件可能需要一些时间,请保持对话打开…",
|
|
26379
27181
|
"composer.attachments": "附件",
|
|
26380
27182
|
"composer.addAttachment": "添加附件",
|
|
26381
27183
|
"composer.removeAttachment": "移除附件:{name}",
|
|
@@ -27918,7 +28720,7 @@ function smallTableHint(id) {
|
|
|
27918
28720
|
* 已解析的表按「会话 + 来源」缓存(FR-10.17)。
|
|
27919
28721
|
*
|
|
27920
28722
|
* 缓存的是进行中的 promise:分流时解析一次,紧接着的查询复用同一份;失败不留。
|
|
27921
|
-
* 容量 2
|
|
28723
|
+
* 容量 2、最近使用淘汰——网格工作簿会占堆内存,流式工作簿只缓存元数据与取件出口,
|
|
27922
28724
|
* 留两格是为「同一会话里先后传两份表做对比」。
|
|
27923
28725
|
*/
|
|
27924
28726
|
var TableCache = class {
|
|
@@ -29453,8 +30255,10 @@ var ChatEngine = class {
|
|
|
29453
30255
|
* 而是给出一个调不到的工具(没 reader 却给 id),或者白白丢掉全文(有 reader 却当没有)。
|
|
29454
30256
|
*/
|
|
29455
30257
|
#hasDocumentReader(attachment) {
|
|
29456
|
-
|
|
29457
|
-
|
|
30258
|
+
if (attachment.contentType.split(";")[0]?.trim().toLowerCase() === SUPPORTED_DOCUMENT_MIME.pdf) return this.#adapter.pdfDocumentReader !== void 0;
|
|
30259
|
+
if (attachment.kind !== "document-text") return false;
|
|
30260
|
+
const format = extractedDocumentFormat(attachment.contentType, attachment.name);
|
|
30261
|
+
return (format === "xlsx" ? this.#adapter.xlsxDocumentReader : format === "pptx" ? this.#adapter.pptxDocumentReader : this.#adapter.docxDocumentReader) !== void 0;
|
|
29458
30262
|
}
|
|
29459
30263
|
/**
|
|
29460
30264
|
* 文本类附件的正文。`text` 存的就是文本;`document-text` 存的是**原件**,文本在这里现抽。
|
|
@@ -29468,39 +30272,62 @@ var ChatEngine = class {
|
|
|
29468
30272
|
async #attachmentText(attachment, path) {
|
|
29469
30273
|
if (attachment.kind === "text") return await this.#adapter.storage.readText(path);
|
|
29470
30274
|
const bytes = await this.#adapter.storage.readBinary(path);
|
|
29471
|
-
if (
|
|
30275
|
+
if (sniffDocumentFormat(bytes, attachment.name) === void 0) return new TextDecoder().decode(bytes);
|
|
29472
30276
|
const format = extractedDocumentFormat(attachment.contentType, attachment.name);
|
|
29473
30277
|
const extract = format === "xlsx" ? this.#adapter.xlsxExtractor : format === "pptx" ? this.#adapter.pptxExtractor : this.#adapter.docxExtractor;
|
|
29474
30278
|
if (extract === void 0) return void 0;
|
|
29475
30279
|
return await extract(bytes);
|
|
29476
30280
|
}
|
|
30281
|
+
async #readTable(reader, path) {
|
|
30282
|
+
if (reader.readStreaming !== void 0) {
|
|
30283
|
+
const storage = this.#adapter.storage;
|
|
30284
|
+
if (storage.createReadStream !== void 0) return await reader.readStreaming(() => storage.createReadStream(path));
|
|
30285
|
+
return await reader.readStreaming(await storage.readBinary(path));
|
|
30286
|
+
}
|
|
30287
|
+
return await reader.read(await this.#adapter.storage.readBinary(path));
|
|
30288
|
+
}
|
|
29477
30289
|
/**
|
|
29478
30290
|
* xlsx 附件的发送形态分流(0.26.0 分册 10 · FR-10.1 / FR-10.5)。
|
|
29479
30291
|
*
|
|
29480
30292
|
* 返回 `undefined` = 不适用(没接端口、不是 xlsx、解析失败),调用方走 0.25.0 的原路径——
|
|
29481
30293
|
* 解析失败时同一份坏文件会在原路径里以既有的形态报错,这里不新增失败形态。
|
|
29482
|
-
*
|
|
30294
|
+
* 解析在这里先做一次、工作簿进缓存,随后的 `query_table` 复用同一份。
|
|
29483
30295
|
*/
|
|
29484
30296
|
async #tableRouting(attachment, path, sessionId) {
|
|
29485
30297
|
const reader = this.#adapter.xlsxTableReader;
|
|
29486
30298
|
if (reader === void 0 || attachment.kind !== "document-text") return void 0;
|
|
29487
30299
|
if (extractedDocumentFormat(attachment.contentType, attachment.name) !== "xlsx") return void 0;
|
|
29488
|
-
const workbook = await this.#tables.get(sessionId, `att:${attachment.path}`, async () =>
|
|
30300
|
+
const workbook = await this.#tables.get(sessionId, `att:${attachment.path}`, async () => this.#readTable(reader, path)).catch(() => void 0);
|
|
29489
30301
|
if (workbook === void 0) return void 0;
|
|
29490
|
-
|
|
30302
|
+
let tokens;
|
|
30303
|
+
let rows;
|
|
30304
|
+
let profile;
|
|
30305
|
+
if (isStreamingTableWorkbook(workbook)) {
|
|
30306
|
+
const summary = await summarizeStreamingWorkbook(workbook);
|
|
30307
|
+
tokens = summary.tokens;
|
|
30308
|
+
rows = summary.dataRows;
|
|
30309
|
+
profile = () => profileStreamingTable({
|
|
30310
|
+
name: attachment.name,
|
|
30311
|
+
id: attachment.id,
|
|
30312
|
+
workbook
|
|
30313
|
+
});
|
|
30314
|
+
} else {
|
|
30315
|
+
tokens = estimateTableTokens(workbook);
|
|
30316
|
+
rows = countDataRows(workbook);
|
|
30317
|
+
profile = () => Promise.resolve(profileTable({
|
|
30318
|
+
name: attachment.name,
|
|
30319
|
+
id: attachment.id,
|
|
30320
|
+
workbook
|
|
30321
|
+
}));
|
|
30322
|
+
}
|
|
29491
30323
|
if (tokens <= 24e3) return {
|
|
29492
30324
|
kind: "inline",
|
|
29493
30325
|
hint: smallTableHint(attachment.id)
|
|
29494
30326
|
};
|
|
29495
|
-
const rows = countDataRows(workbook);
|
|
29496
30327
|
const locale = this.#liveConfig?.appearance.locale ?? "en";
|
|
29497
30328
|
return {
|
|
29498
30329
|
kind: "profile",
|
|
29499
|
-
profile:
|
|
29500
|
-
name: attachment.name,
|
|
29501
|
-
id: attachment.id,
|
|
29502
|
-
workbook
|
|
29503
|
-
}),
|
|
30330
|
+
profile: await profile(),
|
|
29504
30331
|
steering: tableQuerySteering({
|
|
29505
30332
|
id: attachment.id,
|
|
29506
30333
|
tokens,
|
|
@@ -29523,8 +30350,22 @@ var ChatEngine = class {
|
|
|
29523
30350
|
async #downloadSheetRouting(input) {
|
|
29524
30351
|
const reader = this.#adapter.xlsxTableReader;
|
|
29525
30352
|
if (reader === void 0) return void 0;
|
|
29526
|
-
const workbook = await this.#tables.get(this.#currentSessionId ?? "", `dl:${input.entry.id}`, () => reader.read(input.bytes)).catch(() => void 0);
|
|
30353
|
+
const workbook = await this.#tables.get(this.#currentSessionId ?? "", `dl:${input.entry.id}`, () => reader.readStreaming !== void 0 ? reader.readStreaming(input.bytes) : reader.read(input.bytes)).catch(() => void 0);
|
|
29527
30354
|
if (workbook === void 0) return void 0;
|
|
30355
|
+
if (isStreamingTableWorkbook(workbook)) {
|
|
30356
|
+
const summary = await summarizeStreamingWorkbook(workbook);
|
|
30357
|
+
if (summary.tokens <= 24e3 && summary.textChars <= ATTACHMENT_TEXT_LIMIT) return void 0;
|
|
30358
|
+
return `${await profileStreamingTable({
|
|
30359
|
+
name: input.entry.name,
|
|
30360
|
+
id: input.entry.id,
|
|
30361
|
+
workbook
|
|
30362
|
+
})}\n\n` + tableQuerySteering({
|
|
30363
|
+
id: input.entry.id,
|
|
30364
|
+
tokens: summary.tokens,
|
|
30365
|
+
rows: summary.dataRows,
|
|
30366
|
+
download: true
|
|
30367
|
+
});
|
|
30368
|
+
}
|
|
29528
30369
|
const tokens = estimateTableTokens(workbook);
|
|
29529
30370
|
if (tokens <= 24e3 && tableTextChars(workbook) <= ATTACHMENT_TEXT_LIMIT) return void 0;
|
|
29530
30371
|
return `${profileTable({
|
|
@@ -29551,10 +30392,10 @@ var ChatEngine = class {
|
|
|
29551
30392
|
const prefix = PREFIXED_TEMPLATE_IDS.find((p) => id.startsWith(p));
|
|
29552
30393
|
if (prefix) throw new WebSkillError("TOOL_UNSUPPORTED", `The id "${id}" names a ${prefix === "skill:" ? "file bundled with a skill" : "document open in an online viewer"}. It can only be used as a template (inspect_template / fill_template), not queried here.`);
|
|
29553
30394
|
const sessionId = (context?.runId !== void 0 ? await this.#sessionOfRun(context.runId) : void 0) ?? this.#currentSessionId ?? "";
|
|
29554
|
-
const notXlsx = (name) => new WebSkillError("TOOL_UNSUPPORTED", `"${name}" is not an Excel (.xlsx) workbook; query_table reads .xlsx only.`);
|
|
30395
|
+
const notXlsx = (name) => new WebSkillError("TOOL_UNSUPPORTED", `"${name}" is not an Excel (.xlsx/.xls) workbook; query_table reads .xlsx and .xls only.`);
|
|
29555
30396
|
const fromAttachment = async (a) => {
|
|
29556
30397
|
if (a.kind !== "document-text" || extractedDocumentFormat(a.contentType, a.name) !== "xlsx") throw notXlsx(a.name);
|
|
29557
|
-
const workbook = await this.#tables.get(sessionId, `att:${a.path}`, async () =>
|
|
30398
|
+
const workbook = await this.#tables.get(sessionId, `att:${a.path}`, async () => this.#readTable(reader, `${this.attachmentsRoot}/${a.path}`));
|
|
29558
30399
|
return {
|
|
29559
30400
|
name: a.name,
|
|
29560
30401
|
workbook
|
|
@@ -29575,7 +30416,7 @@ var ChatEngine = class {
|
|
|
29575
30416
|
if (sniffDocumentFormat(bytes, name) !== "xlsx") throw notXlsx(name);
|
|
29576
30417
|
return {
|
|
29577
30418
|
name,
|
|
29578
|
-
workbook: await this.#tables.get(sessionId, source, () => reader.read(bytes))
|
|
30419
|
+
workbook: await this.#tables.get(sessionId, source, () => reader.readStreaming !== void 0 ? reader.readStreaming(bytes) : reader.read(bytes))
|
|
29579
30420
|
};
|
|
29580
30421
|
};
|
|
29581
30422
|
const stored = context?.binaries?.get(id);
|
|
@@ -30266,7 +31107,16 @@ var ChatEngine = class {
|
|
|
30266
31107
|
}),
|
|
30267
31108
|
...this.#adapter.xlsxTableReader ? [createTableQueryToolSource({
|
|
30268
31109
|
tables: { load: (id, context) => this.#loadTable(id, context, downloadPolicy) },
|
|
30269
|
-
downloadedFiles: () => downloadPolicy?.enabled === true
|
|
31110
|
+
downloadedFiles: () => downloadPolicy?.enabled === true,
|
|
31111
|
+
writeArtifact: (path, content, mimeType, context) => {
|
|
31112
|
+
if (!context?.runId) throw new WebSkillError("TOOL_EXECUTION_FAILED", "Writing a query result requires an active run.");
|
|
31113
|
+
return artifactStore.createBinaryArtifact({
|
|
31114
|
+
runId: context.runId,
|
|
31115
|
+
path,
|
|
31116
|
+
content,
|
|
31117
|
+
mimeType
|
|
31118
|
+
});
|
|
31119
|
+
}
|
|
30270
31120
|
})] : [],
|
|
30271
31121
|
...this.#adapter.xlsxTemplateEngine || this.#adapter.docxTemplateEngine ? [createTemplateToolSource({
|
|
30272
31122
|
files: { read: readTemplateBytes },
|
|
@@ -32442,7 +33292,7 @@ function ModelMenuButton({ models }) {
|
|
|
32442
33292
|
}, option.id))
|
|
32443
33293
|
})] });
|
|
32444
33294
|
}
|
|
32445
|
-
function AssistantUiComposer({ running, disabled = false, waitTarget, placeholder, attachments = false, attachmentInfo, attachmentImages, centered = false, models, noModel, dictationLang, onDictationPermissionDenied, onCameraPermissionDenied, capabilities }) {
|
|
33295
|
+
function AssistantUiComposer({ running, disabled = false, processingAttachments = false, waitTarget, placeholder, attachments = false, attachmentInfo, attachmentImages, centered = false, models, noModel, dictationLang, onDictationPermissionDenied, onCameraPermissionDenied, capabilities }) {
|
|
32446
33296
|
const t = useT();
|
|
32447
33297
|
const locale = useLocale();
|
|
32448
33298
|
const dictation = useComposerDictation(dictationLang ?? DEFAULT_DICTATION_LANG[locale], onDictationPermissionDenied);
|
|
@@ -32459,11 +33309,20 @@ function AssistantUiComposer({ running, disabled = false, waitTarget, placeholde
|
|
|
32459
33309
|
const cameraReason = !attachments ? t("composer.camera.noStorage") : attachmentReason ?? (camera.availability.available ? void 0 : t(`composer.camera.${camera.availability.reason}`));
|
|
32460
33310
|
const cameraFailure = camera.failure === void 0 ? void 0 : camera.failure === "denied" && onCameraPermissionDenied !== void 0 ? t("composer.camera.denied.handoff") : t(`composer.camera.${camera.failure}`);
|
|
32461
33311
|
const plainChatHintId = useId();
|
|
32462
|
-
return /* @__PURE__ */
|
|
33312
|
+
return /* @__PURE__ */ jsxs(ComposerPrimitive.Root, {
|
|
32463
33313
|
"data-testid": "assistant-ui-composer",
|
|
32464
33314
|
"data-centered": centered,
|
|
32465
33315
|
className: "webskill-aui-composer shrink-0 px-4 py-4",
|
|
32466
|
-
children: /* @__PURE__ */ jsxs(
|
|
33316
|
+
children: [processingAttachments ? /* @__PURE__ */ jsxs("div", {
|
|
33317
|
+
"data-testid": "attachment-processing",
|
|
33318
|
+
role: "status",
|
|
33319
|
+
"aria-live": "polite",
|
|
33320
|
+
className: "webskill-chat-prose mx-auto flex w-full items-center gap-2 px-3 pb-2 text-xs text-muted",
|
|
33321
|
+
children: [/* @__PURE__ */ jsx(LoaderCircle, {
|
|
33322
|
+
className: "size-3.5 shrink-0 animate-spin motion-reduce:animate-none",
|
|
33323
|
+
"aria-hidden": true
|
|
33324
|
+
}), /* @__PURE__ */ jsx("span", { children: t("composer.processingAttachments") })]
|
|
33325
|
+
}) : null, /* @__PURE__ */ jsxs(ComposerPrimitive.AttachmentDropzone, {
|
|
32467
33326
|
disabled: !attachments,
|
|
32468
33327
|
className: "webskill-aui-composer-shell webskill-chat-prose mx-auto flex w-full flex-col gap-2 px-3 py-2 transition-colors data-[dragging=true]:border-ring",
|
|
32469
33328
|
children: [
|
|
@@ -32689,7 +33548,7 @@ function AssistantUiComposer({ running, disabled = false, waitTarget, placeholde
|
|
|
32689
33548
|
onCancel: camera.cancel
|
|
32690
33549
|
})
|
|
32691
33550
|
]
|
|
32692
|
-
})
|
|
33551
|
+
})]
|
|
32693
33552
|
});
|
|
32694
33553
|
}
|
|
32695
33554
|
|
|
@@ -42980,6 +43839,22 @@ function fallbackReason(error) {
|
|
|
42980
43839
|
const code = error?.code;
|
|
42981
43840
|
return typeof code === "string" && code !== "" ? code : "a2ui-render-failed";
|
|
42982
43841
|
}
|
|
43842
|
+
function formControlValues(root) {
|
|
43843
|
+
const values = {};
|
|
43844
|
+
const visit = (node) => {
|
|
43845
|
+
for (const child of node.children) {
|
|
43846
|
+
if (child instanceof HTMLInputElement) {
|
|
43847
|
+
if (child.id) values[child.id] = child.type === "checkbox" ? child.checked : child.type === "number" ? Number(child.value) : child.value;
|
|
43848
|
+
} else if (child instanceof HTMLTextAreaElement || child instanceof HTMLSelectElement) {
|
|
43849
|
+
if (child.id) values[child.id] = child instanceof HTMLSelectElement && child.multiple ? [...child.selectedOptions].map((option) => option.value) : child.value;
|
|
43850
|
+
}
|
|
43851
|
+
if (child.shadowRoot) visit(child.shadowRoot);
|
|
43852
|
+
else visit(child);
|
|
43853
|
+
}
|
|
43854
|
+
};
|
|
43855
|
+
if (root) visit(root.shadowRoot ?? root);
|
|
43856
|
+
return values;
|
|
43857
|
+
}
|
|
42983
43858
|
/**
|
|
42984
43859
|
* `a2ui` 档:catalog 声明树经 BYOC catalog 的 Lit 元素渲染。
|
|
42985
43860
|
* 元素与协议里公布的 `catalog_definition` 派生自同一份 shape,因此这里
|
|
@@ -42990,6 +43865,7 @@ function fallbackReason(error) {
|
|
|
42990
43865
|
*/
|
|
42991
43866
|
function A2uiSpecSurface({ spec, surfaceId, actions, onAction, registry, runId, draft, onDraftChange }) {
|
|
42992
43867
|
const mountRef = useRef(null);
|
|
43868
|
+
const formValuesRef = useRef({});
|
|
42993
43869
|
const [fallback, setFallback] = useState();
|
|
42994
43870
|
const emit = useEffectEvent((actionId, value) => {
|
|
42995
43871
|
const declared = (actions ?? []).find((action) => action.id === actionId);
|
|
@@ -43019,8 +43895,11 @@ function A2uiSpecSurface({ spec, surfaceId, actions, onAction, registry, runId,
|
|
|
43019
43895
|
const processor = new MessageProcessor([catalog, lit.basicCatalog], (action) => {
|
|
43020
43896
|
const decoded = fromA2uiSpecAction(action);
|
|
43021
43897
|
if (!decoded) return;
|
|
43022
|
-
const values =
|
|
43023
|
-
|
|
43898
|
+
const values = {
|
|
43899
|
+
...processor.getClientDataModel("v0.9.1")?.surfaces?.[a2uiSurfaceId]?.[A2UI_SPEC_FORM_PATH.slice(1)],
|
|
43900
|
+
...formControlValues(surfaceElement)
|
|
43901
|
+
};
|
|
43902
|
+
emit(decoded.actionId, values);
|
|
43024
43903
|
}, { version: "v0.9.1" });
|
|
43025
43904
|
processor.onSurfaceCreated((surface) => {
|
|
43026
43905
|
if (disposed) return;
|
|
@@ -43029,6 +43908,21 @@ function A2uiSpecSurface({ spec, surfaceId, actions, onAction, registry, runId,
|
|
|
43029
43908
|
mount.replaceChildren(surfaceElement);
|
|
43030
43909
|
});
|
|
43031
43910
|
processor.processMessages(toA2uiSpecMessages(uiCatalog, spec, { surfaceId: a2uiSurfaceId }));
|
|
43911
|
+
const previousValues = formValuesRef.current;
|
|
43912
|
+
if (Object.keys(previousValues).length > 0) {
|
|
43913
|
+
const defaults = processor.getClientDataModel("v0.9.1")?.surfaces?.[a2uiSurfaceId]?.[A2UI_SPEC_FORM_PATH.slice(1)];
|
|
43914
|
+
processor.processMessages([{
|
|
43915
|
+
version: "v0.9.1",
|
|
43916
|
+
updateDataModel: {
|
|
43917
|
+
surfaceId: a2uiSurfaceId,
|
|
43918
|
+
path: A2UI_SPEC_FORM_PATH,
|
|
43919
|
+
value: {
|
|
43920
|
+
...defaults,
|
|
43921
|
+
...previousValues
|
|
43922
|
+
}
|
|
43923
|
+
}
|
|
43924
|
+
}]);
|
|
43925
|
+
}
|
|
43032
43926
|
} catch (error) {
|
|
43033
43927
|
reportA2uiFallback(surfaceId, "spec", error);
|
|
43034
43928
|
if (!disposed) setFallback(fallbackReason(error));
|
|
@@ -43036,6 +43930,8 @@ function A2uiSpecSurface({ spec, surfaceId, actions, onAction, registry, runId,
|
|
|
43036
43930
|
})();
|
|
43037
43931
|
return () => {
|
|
43038
43932
|
disposed = true;
|
|
43933
|
+
const values = surfaceElement?.surface?.dataModel.get(A2UI_SPEC_FORM_PATH);
|
|
43934
|
+
if (typeof values === "object" && values !== null && !Array.isArray(values)) formValuesRef.current = values;
|
|
43039
43935
|
surfaceElement?.remove();
|
|
43040
43936
|
};
|
|
43041
43937
|
}, [spec, surfaceId]);
|
|
@@ -44489,7 +45385,7 @@ function attachmentAccept(options) {
|
|
|
44489
45385
|
if (options.images) parts.push(...IMAGE_MIME_TYPES);
|
|
44490
45386
|
if (options.files) parts.push(...FILE_MIME_TYPES);
|
|
44491
45387
|
if (options.documents) parts.push(DOCX_MIME, ".docx");
|
|
44492
|
-
if (options.spreadsheets) parts.push(XLSX_MIME, ".xlsx");
|
|
45388
|
+
if (options.spreadsheets) parts.push(XLS_MIME, ".xls", XLSX_MIME, ".xlsx");
|
|
44493
45389
|
if (options.presentations) parts.push(PPTX_MIME, ".pptx");
|
|
44494
45390
|
if (options.drawings) parts.push(...DWG_MIME_TYPES, ...BINARY_EXTENSIONS.map((ext) => `.${ext}`));
|
|
44495
45391
|
return parts.join(",");
|
|
@@ -46053,6 +46949,7 @@ function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, render
|
|
|
46053
46949
|
const [loadingEarlierMessages, setLoadingEarlierMessages] = useState(false);
|
|
46054
46950
|
const [currentSessionId, setCurrentSessionId] = useState();
|
|
46055
46951
|
const [sending, setSending] = useState(false);
|
|
46952
|
+
const [processingAttachments, setProcessingAttachments] = useState(false);
|
|
46056
46953
|
/** 这一条排在同会话的上一条后面(FR-20.3):排队本身保护历史顺序,要改的是它不可见 */
|
|
46057
46954
|
const [queuedSend, setQueuedSend] = useState(false);
|
|
46058
46955
|
/**
|
|
@@ -46323,6 +47220,7 @@ function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, render
|
|
|
46323
47220
|
setError(void 0);
|
|
46324
47221
|
break;
|
|
46325
47222
|
case "message-complete":
|
|
47223
|
+
if (event.message.role === "user") setProcessingAttachments(false);
|
|
46326
47224
|
setMessages((prev) => prev.some((message) => message.id === event.message.id) ? prev : [...prev, event.message]);
|
|
46327
47225
|
break;
|
|
46328
47226
|
case "interaction-requested":
|
|
@@ -46396,7 +47294,13 @@ function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, render
|
|
|
46396
47294
|
setNoModelGuideOpen(true);
|
|
46397
47295
|
return;
|
|
46398
47296
|
}
|
|
47297
|
+
const hasAttachments = attachments.length > 0;
|
|
47298
|
+
if (hasAttachments) {
|
|
47299
|
+
setProcessingAttachments(true);
|
|
47300
|
+
setSending(true);
|
|
47301
|
+
}
|
|
46399
47302
|
(async () => {
|
|
47303
|
+
if (hasAttachments) await new Promise((resolve) => setTimeout(resolve, 0));
|
|
46400
47304
|
await flushPendingDeletes();
|
|
46401
47305
|
let sessionId = currentSessionId;
|
|
46402
47306
|
if (!sessionId) {
|
|
@@ -46408,7 +47312,13 @@ function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, render
|
|
|
46408
47312
|
const needsTitle = sessionsRef.current.find((session) => session.id === sessionId)?.title === void 0;
|
|
46409
47313
|
await engine.send(text, attachments);
|
|
46410
47314
|
if (needsTitle) await refreshSessions();
|
|
46411
|
-
})().catch((e) =>
|
|
47315
|
+
})().catch((e) => {
|
|
47316
|
+
if (hasAttachments) {
|
|
47317
|
+
setProcessingAttachments(false);
|
|
47318
|
+
setSending(false);
|
|
47319
|
+
}
|
|
47320
|
+
setError({ message: toErrorMessage(e) });
|
|
47321
|
+
});
|
|
46412
47322
|
}, [
|
|
46413
47323
|
engine,
|
|
46414
47324
|
currentSessionId,
|
|
@@ -46764,6 +47674,7 @@ function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, render
|
|
|
46764
47674
|
} } : {},
|
|
46765
47675
|
running: busy,
|
|
46766
47676
|
disabled: interactionPending,
|
|
47677
|
+
processingAttachments,
|
|
46767
47678
|
...interactionTarget !== void 0 ? { waitTarget: interactionTarget } : {},
|
|
46768
47679
|
centered: composerCentered,
|
|
46769
47680
|
attachments: attachmentsReady,
|
|
@@ -46852,7 +47763,7 @@ function VercelPayloadPreview({ bridge }) {
|
|
|
46852
47763
|
* Version of the published `@webskill/chatbot` package, injected at build time.
|
|
46853
47764
|
* @stable
|
|
46854
47765
|
*/
|
|
46855
|
-
const CHATBOT_VERSION = "0.
|
|
47766
|
+
const CHATBOT_VERSION = "0.26.0";
|
|
46856
47767
|
|
|
46857
47768
|
//#endregion
|
|
46858
47769
|
export { A2uiSurfaceHost, A2uiSurfaceSnapshotHost, CHATBOT_VERSION, ChatEngine, Chatbot, ChatbotVisionDelegate, CompositeUiBridge, DEFAULT_RENDERER_CAPABILITIES, DEFAULT_RUNTIME_CONFIG_STORAGE_KEY, ErrorCard, InteractionCard, InterruptedBanner, OpenUiSurfaceHost, OpenUiSurfaceSnapshotHost, ResultBlockList, ResultBlocksPro, SkillBadges, SpecInteraction, VercelPayloadPreview, VercelSurfaceHost, VercelSurfaceSnapshotHost, WEB_OFFICE_TEMPLATE_PREFIX, chatbotDictionary, configureA2uiMarkdown, createHttpMessageComponent, createLocalStorageRuntimeConfigStore, createMemoryRuntimeConfigStore, isLlmEntryUsable, pickUsableLlmEntry, probeA2uiAvailability, probeOpenUiAvailability, sandboxExecutorDeps, useT };
|