import { require_jsx_runtime } from "./chunk-G5LRF5Q3.js"; import { ArrowDownRegular, ArrowUpRegular, Checkmark12Filled, Checkmark16Filled, CheckmarkCircle12Filled, CheckmarkCircleFilled, CheckmarkFilled, ChevronDown16Regular, ChevronDown20Regular, ChevronDownRegular, ChevronLeftFilled, ChevronLeftRegular, ChevronRight12Regular, ChevronRightFilled, ChevronRightRegular, ChevronUp16Regular, CircleFilled, DiamondDismiss12Filled, DiamondDismissFilled, Dismiss12Regular, Dismiss20Regular, DismissFilled, DismissRegular, IconDirectionContextProvider, Info12Filled, Info12Regular, Info16Filled, Info16Regular, Info20Filled, Info20Regular, InfoFilled, Lightbulb16Regular, MoreHorizontalFilled, MoreHorizontalRegular, Navigation20Filled, PauseCircleRegular, PersonRegular, Pin20Regular, PlayCircleRegular, PresenceAvailable10Filled, PresenceAvailable10Regular, PresenceAvailable12Filled, PresenceAvailable12Regular, PresenceAvailable16Filled, PresenceAvailable16Regular, PresenceAvailable20Filled, PresenceAvailable20Regular, PresenceAway10Filled, PresenceAway10Regular, PresenceAway12Filled, PresenceAway12Regular, PresenceAway16Filled, PresenceAway16Regular, PresenceAway20Filled, PresenceAway20Regular, PresenceBlocked10Regular, PresenceBlocked12Regular, PresenceBlocked16Regular, PresenceBlocked20Regular, PresenceBusy10Filled, PresenceBusy12Filled, PresenceBusy16Filled, PresenceBusy20Filled, PresenceDnd10Filled, PresenceDnd10Regular, PresenceDnd12Filled, PresenceDnd12Regular, PresenceDnd16Filled, PresenceDnd16Regular, PresenceDnd20Filled, PresenceDnd20Regular, PresenceOffline10Regular, PresenceOffline12Regular, PresenceOffline16Regular, PresenceOffline20Regular, PresenceOof10Regular, PresenceOof12Regular, PresenceOof16Regular, PresenceOof20Regular, PresenceUnknown10Regular, PresenceUnknown12Regular, PresenceUnknown16Regular, PresenceUnknown20Regular, ProhibitedFilled, RendererProvider, SearchRegular, Square12Filled, Square16Filled, StarFilled, StarRegular, TextDirectionProvider, Warning12Filled, WarningFilled, __css, __resetCSS, __resetStyles, __styles, __styles2, bundleIcon, createDOMRenderer, iconFilledClassName, iconRegularClassName, makeResetStyles, makeStaticStyles, makeStyles, mergeClasses, renderToStyleElements, shorthands, useRenderer } from "./chunk-WF23Q3BR.js"; import { require_scheduler } from "./chunk-RYT6YT3P.js"; import { require_react_dom } from "./chunk-HJTH342H.js"; import { require_react } from "./chunk-KNNXW3SV.js"; import { __commonJS, __export, __toESM } from "./chunk-DC5AMYBS.js"; // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js var require_use_sync_external_store_shim_development = __commonJS({ "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { "use strict"; (function() { function is(x, y) { return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; } function useSyncExternalStore$2(subscribe, getSnapshot) { didWarnOld18Alpha || void 0 === React671.startTransition || (didWarnOld18Alpha = true, console.error( "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." )); var value = getSnapshot(); if (!didWarnUncachedGetSnapshot) { var cachedValue = getSnapshot(); objectIs(value, cachedValue) || (console.error( "The result of getSnapshot should be cached to avoid an infinite loop" ), didWarnUncachedGetSnapshot = true); } cachedValue = useState42({ inst: { value, getSnapshot } }); var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; useLayoutEffect3( function() { inst.value = value; inst.getSnapshot = getSnapshot; checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }, [subscribe, value, getSnapshot] ); useEffect65( function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); return subscribe(function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }); }, [subscribe] ); useDebugValue(value); return value; } function checkIfSnapshotChanged(inst) { var latestGetSnapshot = inst.getSnapshot; inst = inst.value; try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); } catch (error) { return true; } } function useSyncExternalStore$1(subscribe, getSnapshot) { return getSnapshot(); } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React671 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState42 = React671.useState, useEffect65 = React671.useEffect, useLayoutEffect3 = React671.useLayoutEffect, useDebugValue = React671.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; exports.useSyncExternalStore = void 0 !== React671.useSyncExternalStore ? React671.useSyncExternalStore : shim; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); // node_modules/use-sync-external-store/shim/index.js var require_shim = __commonJS({ "node_modules/use-sync-external-store/shim/index.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_use_sync_external_store_shim_development(); } } }); // node_modules/@fluentui/react-provider/lib/components/FluentProvider/createCSSRuleFromTheme.js var CSS_ESCAPE_MAP = { "<": "\\3C ", ">": "\\3E " }; function escapeForStyleTag(value) { return value.replace(/[<>]/g, (match) => CSS_ESCAPE_MAP[match]); } function createCSSRuleFromTheme(selector, theme) { if (theme) { const cssVarsAsString = Object.keys(theme).reduce((cssVarRule, cssVar) => { return `${cssVarRule}--${cssVar}: ${theme[cssVar]}; `; }, ""); return `${selector} { ${escapeForStyleTag(cssVarsAsString)} }`; } return `${selector} {}`; } // node_modules/@fluentui/react-provider/lib/components/FluentProvider/FluentProvider.js var React59 = __toESM(require_react()); // node_modules/@fluentui/react-utilities/lib/compose/slot.js var slot_exports = {}; __export(slot_exports, { always: () => always, optional: () => optional, resolveShorthand: () => resolveShorthand }); var React = __toESM(require_react()); // node_modules/@fluentui/react-utilities/lib/compose/constants.js var SLOT_RENDER_FUNCTION_SYMBOL = Symbol.for("fui.slotRenderFunction"); var SLOT_ELEMENT_TYPE_SYMBOL = Symbol.for("fui.slotElementType"); var SLOT_CLASS_NAME_PROP_SYMBOL = Symbol.for("fui.slotClassNameProp"); // node_modules/@fluentui/react-utilities/lib/compose/slot.js function always(value, options) { const { defaultProps, elementType } = options; const props = resolveShorthand(value); const propsWithMetadata = { ...defaultProps, ...props, [SLOT_ELEMENT_TYPE_SYMBOL]: elementType, [SLOT_CLASS_NAME_PROP_SYMBOL]: (props === null || props === void 0 ? void 0 : props.className) || (defaultProps === null || defaultProps === void 0 ? void 0 : defaultProps.className) }; if (props && typeof props.children === "function") { propsWithMetadata[SLOT_RENDER_FUNCTION_SYMBOL] = props.children; propsWithMetadata.children = defaultProps === null || defaultProps === void 0 ? void 0 : defaultProps.children; } return propsWithMetadata; } function optional(value, options) { if (value === null || value === void 0 && !options.renderByDefault) { return void 0; } return always(value, options); } function resolveShorthand(value) { if (typeof value === "string" || typeof value === "number" || isIterable(value) || // eslint-disable-next-line @typescript-eslint/no-explicit-any React.isValidElement(value)) { return { children: value }; } if (value && typeof value !== "object" && true) { console.error(`@fluentui/react-utilities [slot.${resolveShorthand.name}]: A slot got an invalid value "${value}" (${typeof value}). A valid value for a slot is a slot shorthand or slot properties object. Slot shorthands can be strings, numbers, arrays or JSX elements`); } return value; } var isIterable = (value) => typeof value === "object" && value !== null && Symbol.iterator in value; // node_modules/@fluentui/react-utilities/lib/compose/isResolvedShorthand.js var React2 = __toESM(require_react()); function isResolvedShorthand(shorthand) { return shorthand !== null && typeof shorthand === "object" && !Array.isArray(shorthand) && !React2.isValidElement(shorthand); } // node_modules/@fluentui/react-utilities/lib/compose/isSlot.js function isSlot(element) { return Boolean(element === null || element === void 0 ? void 0 : element.hasOwnProperty(SLOT_ELEMENT_TYPE_SYMBOL)); } // node_modules/@fluentui/react-utilities/lib/compose/assertSlots.js var React3 = __toESM(require_react()); function assertSlots(state) { if (true) { const typedState = state; for (const slotName of Object.keys(typedState.components)) { const slotElement = typedState[slotName]; if (slotElement === void 0) { continue; } if (!isSlot(slotElement)) { typedState[slotName] = always(slotElement, { // eslint-disable-next-line @typescript-eslint/no-deprecated elementType: typedState.components[slotName] }); console.warn(`@fluentui/react-utilities [${assertSlots.name}]: "state.${slotName}" is not a slot! Be sure to create slots properly by using "slot.always" or "slot.optional".`); } else { const { [SLOT_ELEMENT_TYPE_SYMBOL]: elementType } = slotElement; if (elementType !== typedState.components[slotName]) { slotElement[SLOT_ELEMENT_TYPE_SYMBOL] = typedState.components[slotName]; console.warn(`@fluentui/react-utilities [${assertSlots.name}]: "state.${slotName}" element type differs from "state.components.${slotName}", ${elementType} !== ${typedState.components[slotName]}. Be sure to create slots properly by using "slot.always" or "slot.optional" with the correct elementType.`); } } } } } // node_modules/@fluentui/react-utilities/lib/compose/getIntrinsicElementProps.js var React5 = __toESM(require_react()); // node_modules/@fluentui/react-utilities/lib/utils/getNativeElementProps.js var React4 = __toESM(require_react()); // node_modules/@fluentui/react-utilities/lib/utils/properties.js var toObjectMap = (...items) => { const result = {}; for (const item of items) { const keys = Array.isArray(item) ? item : Object.keys(item); for (const key of keys) { result[key] = 1; } } return result; }; var baseElementEvents = toObjectMap([ "onAuxClick", "onAnimationEnd", "onAnimationStart", "onCopy", "onCut", "onPaste", "onCompositionEnd", "onCompositionStart", "onCompositionUpdate", "onFocus", "onFocusCapture", "onBlur", "onBlurCapture", "onChange", "onInput", "onSubmit", "onLoad", "onError", "onKeyDown", "onKeyDownCapture", "onKeyPress", "onKeyUp", "onAbort", "onCanPlay", "onCanPlayThrough", "onDurationChange", "onEmptied", "onEncrypted", "onEnded", "onLoadedData", "onLoadedMetadata", "onLoadStart", "onPause", "onPlay", "onPlaying", "onProgress", "onRateChange", "onSeeked", "onSeeking", "onStalled", "onSuspend", "onTimeUpdate", "onVolumeChange", "onWaiting", "onClick", "onClickCapture", "onContextMenu", "onDoubleClick", "onDrag", "onDragEnd", "onDragEnter", "onDragExit", "onDragLeave", "onDragOver", "onDragStart", "onDrop", "onMouseDown", "onMouseDownCapture", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseOut", "onMouseOver", "onMouseUp", "onMouseUpCapture", "onSelect", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "onScroll", "onWheel", "onPointerCancel", "onPointerDown", "onPointerEnter", "onPointerLeave", "onPointerMove", "onPointerOut", "onPointerOver", "onPointerUp", "onGotPointerCapture", "onLostPointerCapture" ]); var baseElementProperties = toObjectMap([ "accessKey", "children", "className", "contentEditable", "dir", "draggable", "hidden", "htmlFor", "id", "lang", "popover", "focusgroup", "ref", "role", "style", "tabIndex", "title", "translate", "spellCheck", "name" ]); var microdataProperties = toObjectMap([ "itemID", "itemProp", "itemRef", "itemScope", "itemType" ]); var htmlElementProperties = toObjectMap(baseElementProperties, baseElementEvents, microdataProperties); var labelProperties = toObjectMap(htmlElementProperties, [ "form" ]); var audioProperties = toObjectMap(htmlElementProperties, [ "height", "loop", "muted", "preload", "src", "width" ]); var videoProperties = toObjectMap(audioProperties, [ "poster" ]); var olProperties = toObjectMap(htmlElementProperties, [ "start" ]); var liProperties = toObjectMap(htmlElementProperties, [ "value" ]); var anchorProperties = toObjectMap(htmlElementProperties, [ "download", "href", "hrefLang", "media", "referrerPolicy", "rel", "target", "type" ]); var timeProperties = toObjectMap(htmlElementProperties, [ "dateTime" ]); var buttonProperties = toObjectMap(htmlElementProperties, [ "autoFocus", "disabled", "form", "formAction", "formEncType", "formMethod", "formNoValidate", "formTarget", "popoverTarget", "popoverTargetAction", "type", "value" ]); var inputProperties = toObjectMap(buttonProperties, [ "accept", "alt", "autoCorrect", "autoCapitalize", "autoComplete", "checked", "dirname", "form", "height", "inputMode", "list", "max", "maxLength", "min", "minLength", "multiple", "pattern", "placeholder", "readOnly", "required", "src", "step", "size", "type", "value", "width" ]); var textAreaProperties = toObjectMap(buttonProperties, [ "autoCapitalize", "cols", "dirname", "form", "maxLength", "placeholder", "readOnly", "required", "rows", "wrap" ]); var selectProperties = toObjectMap(buttonProperties, [ "form", "multiple", "required" ]); var optionProperties = toObjectMap(htmlElementProperties, [ "selected", "value" ]); var tableProperties = toObjectMap(htmlElementProperties, [ "cellPadding", "cellSpacing" ]); var trProperties = htmlElementProperties; var thProperties = toObjectMap(htmlElementProperties, [ "colSpan", "rowSpan", "scope" ]); var tdProperties = toObjectMap(htmlElementProperties, [ "colSpan", "headers", "rowSpan", "scope" ]); var colGroupProperties = toObjectMap(htmlElementProperties, [ "span" ]); var colProperties = toObjectMap(htmlElementProperties, [ "span" ]); var fieldsetProperties = toObjectMap(htmlElementProperties, [ "disabled", "form" ]); var formProperties = toObjectMap(htmlElementProperties, [ "acceptCharset", "action", "encType", "encType", "method", "noValidate", "target" ]); var iframeProperties = toObjectMap(htmlElementProperties, [ "allow", "allowFullScreen", "allowPaymentRequest", "allowTransparency", "csp", "height", "importance", "referrerPolicy", "sandbox", "src", "srcDoc", "width" ]); var imgProperties = toObjectMap(htmlElementProperties, [ "alt", "crossOrigin", "height", "src", "srcSet", "useMap", "width" ]); var dialogProperties = toObjectMap(htmlElementProperties, [ "open", "onCancel", "onClose" ]); function getNativeProps(props, allowedPropNames, excludedPropNames) { const isArray = Array.isArray(allowedPropNames); const result = {}; const keys = Object.keys(props); for (const key of keys) { const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf("data-") === 0 || key.indexOf("aria-") === 0; if (isNativeProp && (!excludedPropNames || (excludedPropNames === null || excludedPropNames === void 0 ? void 0 : excludedPropNames.indexOf(key)) === -1)) { result[key] = props[key]; } } return result; } // node_modules/@fluentui/react-utilities/lib/utils/getNativeElementProps.js var nativeElementMap = { label: labelProperties, audio: audioProperties, video: videoProperties, ol: olProperties, li: liProperties, a: anchorProperties, button: buttonProperties, input: inputProperties, textarea: textAreaProperties, select: selectProperties, option: optionProperties, table: tableProperties, tr: trProperties, th: thProperties, td: tdProperties, colGroup: colGroupProperties, col: colProperties, fieldset: fieldsetProperties, form: formProperties, iframe: iframeProperties, img: imgProperties, time: timeProperties, dialog: dialogProperties }; function getNativeElementProps(tagName, props, excludedPropNames) { const allowedPropNames = tagName && nativeElementMap[tagName] || htmlElementProperties; allowedPropNames.as = 1; return getNativeProps(props, allowedPropNames, excludedPropNames); } var getPartitionedNativeProps = ({ primarySlotTagName, props, excludedPropNames }) => { return { root: { style: props.style, className: props.className }, // eslint-disable-next-line @typescript-eslint/no-deprecated primary: getNativeElementProps(primarySlotTagName, props, [ ...excludedPropNames || [], "style", "className" ]) }; }; // node_modules/@fluentui/react-utilities/lib/compose/getIntrinsicElementProps.js var getIntrinsicElementProps = (tagName, props, excludedPropNames) => { var _props_as; return getNativeElementProps((_props_as = props.as) !== null && _props_as !== void 0 ? _props_as : tagName, props, excludedPropNames); }; // node_modules/@fluentui/react-utilities/lib/compose/getSlotClassNameProp.js var getSlotClassNameProp = (slot) => { if (SLOT_CLASS_NAME_PROP_SYMBOL in slot && typeof slot[SLOT_CLASS_NAME_PROP_SYMBOL] === "string") { return slot[SLOT_CLASS_NAME_PROP_SYMBOL]; } return void 0; }; // node_modules/@fluentui/react-utilities/lib/compose/deprecated/getSlots.js var React6 = __toESM(require_react()); // node_modules/@fluentui/react-utilities/lib/utils/omit.js function omit(obj, exclusions) { const result = {}; for (const key in obj) { if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) { result[key] = obj[key]; } } return result; } // node_modules/@fluentui/react-utilities/lib/compose/deprecated/getSlots.js function getSlots(state) { const typeState = state; const slots = {}; const slotProps = {}; const slotNames = Object.keys(typeState.components); for (const slotName of slotNames) { const [slot, props] = getSlot(typeState, slotName); slots[slotName] = slot; slotProps[slotName] = props; } return { slots, slotProps }; } function getSlot(state, slotName) { var _state_components, _state_components1; const props = state[slotName]; if (props === void 0) { return [ null, void 0 ]; } const { as: asProp, children, ...rest } = props; const renderFunction = isSlot(props) ? props[SLOT_RENDER_FUNCTION_SYMBOL] : void 0; const slot = ((_state_components = state.components) === null || _state_components === void 0 ? void 0 : _state_components[slotName]) === void 0 || // eslint-disable-line @typescript-eslint/no-deprecated // eslint-disable-next-line @typescript-eslint/no-deprecated typeof state.components[slotName] === "string" ? asProp || ((_state_components1 = state.components) === null || _state_components1 === void 0 ? void 0 : _state_components1[slotName]) || "div" : state.components[slotName]; const asserted = slot; if (renderFunction || typeof children === "function") { const render = renderFunction || children; return [ React6.Fragment, { children: render(asserted, rest) } ]; } const shouldOmitAsProp = typeof slot === "string" && asProp; const slotProps = shouldOmitAsProp ? omit(props, [ "as" ]) : props; return [ asserted, slotProps ]; } // node_modules/@fluentui/react-utilities/lib/compose/deprecated/resolveShorthand.js var resolveShorthand2 = (value, options) => optional(value, { ...options, renderByDefault: options === null || options === void 0 ? void 0 : options.required, // elementType as undefined is the way to identify between a slot and a resolveShorthand call // in the case elementType is undefined assertSlots will fail, ensuring it'll only work with slot method. elementType: void 0 }); // node_modules/@fluentui/react-utilities/lib/compose/deprecated/getSlotsNext.js var React7 = __toESM(require_react()); // node_modules/@fluentui/react-utilities/lib/hooks/useBrowserTimer.js var React8 = __toESM(require_react()); function useBrowserTimer(setTimer, cancelTimer) { const id = React8.useRef(void 0); const set = React8.useCallback((fn, delay) => { if (id.current !== void 0) { cancelTimer(id.current); } id.current = setTimer(fn, delay); return id.current; }, [ cancelTimer, setTimer ]); const cancel = React8.useCallback(() => { if (id.current !== void 0) { cancelTimer(id.current); id.current = void 0; } }, [ cancelTimer ]); React8.useEffect(() => cancel, [ cancel ]); return [ set, cancel ]; } // node_modules/@fluentui/react-shared-contexts/lib/ThemeContext/ThemeContext.js var React9 = __toESM(require_react()); var ThemeContext = React9.createContext(void 0); var ThemeProvider = ThemeContext.Provider; // node_modules/@fluentui/react-shared-contexts/lib/ThemeClassNameContext/ThemeClassNameContext.js var React10 = __toESM(require_react()); var ThemeClassNameContext = React10.createContext(void 0); var themeClassNameContextDefaultVaue = ""; var ThemeClassNameProvider = ThemeClassNameContext.Provider; function useThemeClassName() { var _React_useContext; return (_React_useContext = React10.useContext(ThemeClassNameContext)) !== null && _React_useContext !== void 0 ? _React_useContext : themeClassNameContextDefaultVaue; } // node_modules/@fluentui/react-shared-contexts/lib/TooltipVisibilityContext/TooltipContext.js var React11 = __toESM(require_react()); var TooltipVisibilityContext = React11.createContext(void 0); var tooltipVisibilityContextDefaultValue = {}; var TooltipVisibilityProvider = TooltipVisibilityContext.Provider; function useTooltipVisibility() { var _React_useContext; return (_React_useContext = React11.useContext(TooltipVisibilityContext)) !== null && _React_useContext !== void 0 ? _React_useContext : tooltipVisibilityContextDefaultValue; } // node_modules/@fluentui/react-shared-contexts/lib/ProviderContext/ProviderContext.js var React12 = __toESM(require_react()); var ProviderContext = React12.createContext(void 0); var providerContextDefaultValue = { // eslint-disable-next-line @nx/workspace-no-restricted-globals -- expected ignore ( SSR friendly acquisition of globals ) targetDocument: typeof document === "object" ? document : void 0, dir: "ltr" }; var Provider = ProviderContext.Provider; function useFluent() { var _React_useContext; return (_React_useContext = React12.useContext(ProviderContext)) !== null && _React_useContext !== void 0 ? _React_useContext : providerContextDefaultValue; } // node_modules/@fluentui/react-shared-contexts/lib/OverridesContext/OverridesContext.js var React13 = __toESM(require_react()); var OverridesContext = React13.createContext(void 0); var OverridesProvider = OverridesContext.Provider; function useOverrides() { var _React_useContext; return (_React_useContext = React13.useContext(OverridesContext)) !== null && _React_useContext !== void 0 ? _React_useContext : {}; } // node_modules/@fluentui/react-shared-contexts/lib/CustomStyleHooksContext/CustomStyleHooksContext.js var React14 = __toESM(require_react()); var CustomStyleHooksContext = React14.createContext(void 0); var noop = () => { }; var CustomStyleHooksProvider = CustomStyleHooksContext.Provider; var useCustomStyleHook = (hook) => { var _React_useContext; var _React_useContext_hook; return (_React_useContext_hook = (_React_useContext = React14.useContext(CustomStyleHooksContext)) === null || _React_useContext === void 0 ? void 0 : _React_useContext[hook]) !== null && _React_useContext_hook !== void 0 ? _React_useContext_hook : noop; }; // node_modules/@fluentui/react-shared-contexts/lib/BackgroundAppearanceContext/BackgroundAppearanceContext.js var React15 = __toESM(require_react()); var BackgroundAppearanceContext = React15.createContext(void 0); var BackgroundAppearanceProvider = BackgroundAppearanceContext.Provider; function useBackgroundAppearance() { return React15.useContext(BackgroundAppearanceContext); } // node_modules/@fluentui/react-shared-contexts/lib/PortalMountNodeContext.js var React16 = __toESM(require_react()); var PortalMountNodeContext = React16.createContext(void 0); var PortalMountNodeProvider = PortalMountNodeContext.Provider; function usePortalMountNode() { return React16.useContext(PortalMountNodeContext); } // node_modules/@fluentui/react-shared-contexts/lib/AnnounceContext/AnnounceContext.js var React17 = __toESM(require_react()); var AnnounceContext = React17.createContext(void 0); var AnnounceProvider = AnnounceContext.Provider; function useAnnounce() { var _React_useContext; return (_React_useContext = React17.useContext(AnnounceContext)) !== null && _React_useContext !== void 0 ? _React_useContext : { announce: () => void 0 }; } // node_modules/@fluentui/react-utilities/lib/hooks/useAnimationFrame.js var setAnimationFrameNoop = (callback) => { callback(0); return 0; }; var cancelAnimationFrameNoop = (handle) => handle; function useAnimationFrame() { const { targetDocument } = useFluent(); const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView; const setAnimationFrame = win ? win.requestAnimationFrame : setAnimationFrameNoop; const clearAnimationFrame = win ? win.cancelAnimationFrame : cancelAnimationFrameNoop; return useBrowserTimer(setAnimationFrame, clearAnimationFrame); } // node_modules/@fluentui/react-utilities/lib/hooks/useApplyScrollbarWidth.js var React18 = __toESM(require_react()); // node_modules/@fluentui/react-utilities/lib/utils/measureScrollBarWidth.js function measureScrollbarWidth(targetDocument) { const outer = targetDocument.createElement("div"); outer.style.visibility = "hidden"; outer.style.overflow = "scroll"; const inner = targetDocument.createElement("div"); outer.appendChild(inner); targetDocument.body.appendChild(outer); const scrollbarWidth = outer.offsetWidth - inner.offsetWidth; outer.remove(); return scrollbarWidth; } // node_modules/@fluentui/react-utilities/lib/hooks/useApplyScrollbarWidth.js var cache = /* @__PURE__ */ new WeakMap(); function useApplyScrollbarWidth(options = {}) { const { force, property = "width" } = options; const applyScrollbarWidth = React18.useCallback((element) => { if (!element) { return; } if (!force && cache.has(element.ownerDocument)) { const cachedWidth = cache.get(element.ownerDocument); if (cachedWidth !== void 0) { element.style.setProperty(property, `${cachedWidth}px`); return; } } const scrollbarWidth = measureScrollbarWidth(element.ownerDocument); cache.set(element.ownerDocument, scrollbarWidth); element.style.setProperty(property, `${scrollbarWidth}px`); }, [ force, property ]); return applyScrollbarWidth; } // node_modules/@fluentui/react-utilities/lib/hooks/useControllableState.js var React19 = __toESM(require_react()); function isFactoryDispatch(newState) { return typeof newState === "function"; } var useControllableState = (options) => { "use no memo"; if (true) { if (options.state !== void 0 && options.defaultState !== void 0) { console.error(`@fluentui/react-utilities [useControllableState]: A component must be either controlled or uncontrolled (specify either the state or the defaultState, but not both). Decide between using a controlled or uncontrolled component and remove one of this props. More info: https://reactjs.org/link/controlled-components ${new Error().stack}`); } } const [internalState, setInternalState] = React19.useState(() => { if (options.defaultState === void 0) { return options.initialState; } return isInitializer(options.defaultState) ? options.defaultState() : options.defaultState; }); const stateValueRef = React19.useRef(options.state); React19.useEffect(() => { stateValueRef.current = options.state; }, [ options.state ]); const setControlledState = React19.useCallback((newState) => { if (isFactoryDispatch(newState)) { newState(stateValueRef.current); } }, []); return useIsControlled(options.state) ? [ options.state, setControlledState ] : [ internalState, setInternalState ]; }; function isInitializer(value) { return typeof value === "function"; } var useIsControlled = (controlledValue) => { "use no memo"; const [isControlled] = React19.useState(() => controlledValue !== void 0); if (true) { React19.useEffect(() => { if (isControlled !== (controlledValue !== void 0)) { const error = new Error(); const controlWarning = isControlled ? "a controlled value to be uncontrolled" : "an uncontrolled value to be controlled"; const undefinedWarning = isControlled ? "defined to an undefined" : "undefined to a defined"; console.error(`@fluentui/react-utilities [useControllableState]: A component is changing ${controlWarning}. This is likely caused by the value changing from ${undefinedWarning} value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components ${error.stack}`); } }, [ isControlled, controlledValue ]); } return isControlled; }; // node_modules/@fluentui/react-utilities/lib/hooks/useEventCallback.js var React22 = __toESM(require_react()); // node_modules/@fluentui/react-utilities/lib/hooks/useIsomorphicLayoutEffect.js var React21 = __toESM(require_react()); // node_modules/@fluentui/react-utilities/lib/ssr/canUseDOM.js function canUseDOM() { return ( /* eslint-disable @nx/workspace-no-restricted-globals -- expected ignore ( SSR friendly acquisition of globals )*/ typeof window !== "undefined" && !!(window.document && // eslint-disable-next-line @typescript-eslint/no-deprecated window.document.createElement) ); } // node_modules/@fluentui/react-utilities/lib/ssr/SSRContext.js var React20 = __toESM(require_react()); var defaultSSRContextValue = { current: 0 }; var SSRContext = React20.createContext(void 0); function useSSRContext() { var _React_useContext; return (_React_useContext = React20.useContext(SSRContext)) !== null && _React_useContext !== void 0 ? _React_useContext : defaultSSRContextValue; } var SSRProvider = (props) => { const [value] = React20.useState(() => ({ current: 0 })); return React20.createElement(SSRContext.Provider, { value }, props.children); }; function useIsSSR() { const isInSSRContext = useSSRContext() !== defaultSSRContextValue; const [isSSR, setIsSSR] = React20.useState(isInSSRContext); if (true) { if (!isInSSRContext && !canUseDOM()) { console.error(`@fluentui/react-components [${useIsSSR.name}]: When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server. Check documentation at https://aka.ms/fluentui-ssr.`); } } if (canUseDOM() && isInSSRContext) { React20.useLayoutEffect(() => { setIsSSR(false); }, []); } return isSSR; } // node_modules/@fluentui/react-utilities/lib/hooks/useIsomorphicLayoutEffect.js var useIsomorphicLayoutEffect = canUseDOM() ? React21.useLayoutEffect : React21.useEffect; // node_modules/@fluentui/react-utilities/lib/hooks/useEventCallback.js var useEventCallback = (fn) => { const callbackRef = React22.useRef(() => { throw new Error("Cannot call an event handler while rendering"); }); useIsomorphicLayoutEffect(() => { callbackRef.current = fn; }, [ fn ]); return React22.useCallback((...args) => { const callback = callbackRef.current; return callback(...args); }, [ callbackRef ]); }; // node_modules/@fluentui/react-utilities/lib/hooks/useFirstMount.js var React23 = __toESM(require_react()); function useFirstMount() { const isFirst = React23.useRef(true); React23.useEffect(() => { if (isFirst.current) { isFirst.current = false; } }, []); return isFirst.current; } // node_modules/@fluentui/react-utilities/lib/hooks/useForceUpdate.js var React24 = __toESM(require_react()); function useForceUpdate() { return React24.useReducer((x) => x + 1, 0)[1]; } // node_modules/@fluentui/react-utilities/lib/hooks/useId.js var React25 = __toESM(require_react()); var IdPrefixContext = React25.createContext(void 0); var IdPrefixProvider = IdPrefixContext.Provider; function useIdPrefix() { return React25.useContext(IdPrefixContext) || ""; } function resetIdsForTests() { defaultSSRContextValue.current = 0; } function useId2(prefix = "fui-", providedId) { "use no memo"; const contextValue = useSSRContext(); const idPrefix = useIdPrefix(); const _useId = React25["useId"]; if (_useId) { const generatedId = _useId(); const escapedId = React25.useMemo(() => generatedId.replace(/:/g, ""), [ generatedId ]); return providedId || `${idPrefix}${prefix}${escapedId}`; } return React25.useMemo(() => { if (providedId) { return providedId; } return `${idPrefix}${prefix}${++contextValue.current}`; }, [ idPrefix, prefix, providedId, contextValue ]); } // node_modules/@fluentui/react-utilities/lib/hooks/useMergedRefs.js var React26 = __toESM(require_react()); function useMergedRefs(...refs) { "use no memo"; const mergedCallback = React26.useCallback( (value) => { mergedCallback.current = value; for (const ref of refs) { if (typeof ref === "string" && true) { console.error(`@fluentui/react-utilities [useMergedRefs]: This hook does not support the usage of string refs. Please use React.useRef instead. For more info on 'React.useRef', see https://react.dev/reference/react/useRef. For more info on string refs, see https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-string-refs.`); } if (typeof ref === "function") { ref(value); } else if (ref) { ref.current = value; } } }, // eslint-disable-next-line react-hooks/exhaustive-deps -- already exhaustive [ ...refs ] ); return mergedCallback; } // node_modules/@fluentui/react-utilities/lib/hooks/useOnClickOutside.js var React27 = __toESM(require_react()); var DEFAULT_CONTAINS = (parent2, child) => !!(parent2 === null || parent2 === void 0 ? void 0 : parent2.contains(child)); var useOnClickOutside = (options) => { const { targetDocument } = useFluent(); const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView; const { refs, callback, element, disabled, disabledFocusOnIframe, contains = DEFAULT_CONTAINS } = options; const timeoutId = React27.useRef(void 0); useIFrameFocus({ element, disabled: disabledFocusOnIframe || disabled, callback, refs, contains }); const isMouseDownInsideRef = React27.useRef(false); const listener = useEventCallback((ev) => { if (isMouseDownInsideRef.current) { isMouseDownInsideRef.current = false; return; } const target = ev.composedPath()[0]; const isOutside = refs.every((ref) => !contains(ref.current || null, target)); if (isOutside && !disabled) { callback(ev); } }); const handleMouseDown = useEventCallback((ev) => { isMouseDownInsideRef.current = refs.some((ref) => contains(ref.current || null, ev.target)); }); React27.useEffect(() => { if (disabled) { return; } let currentEvent = getWindowEvent(win); const conditionalHandler = (event) => { if (event === currentEvent) { currentEvent = void 0; return; } listener(event); }; element === null || element === void 0 ? void 0 : element.addEventListener("click", conditionalHandler, true); element === null || element === void 0 ? void 0 : element.addEventListener("touchstart", conditionalHandler, true); element === null || element === void 0 ? void 0 : element.addEventListener("contextmenu", conditionalHandler, true); element === null || element === void 0 ? void 0 : element.addEventListener("mousedown", handleMouseDown, true); timeoutId.current = win === null || win === void 0 ? void 0 : win.setTimeout(() => { currentEvent = void 0; }, 1); return () => { element === null || element === void 0 ? void 0 : element.removeEventListener("click", conditionalHandler, true); element === null || element === void 0 ? void 0 : element.removeEventListener("touchstart", conditionalHandler, true); element === null || element === void 0 ? void 0 : element.removeEventListener("contextmenu", conditionalHandler, true); element === null || element === void 0 ? void 0 : element.removeEventListener("mousedown", handleMouseDown, true); win === null || win === void 0 ? void 0 : win.clearTimeout(timeoutId.current); currentEvent = void 0; }; }, [ listener, element, disabled, handleMouseDown, win ]); }; var getWindowEvent = (target) => { if (target) { var _target_ownerDocument_defaultView, _target_ownerDocument; if (typeof target.window === "object" && target.window === target) { return target.event; } var _target_ownerDocument_defaultView_event; return (_target_ownerDocument_defaultView_event = (_target_ownerDocument = target.ownerDocument) === null || _target_ownerDocument === void 0 ? void 0 : (_target_ownerDocument_defaultView = _target_ownerDocument.defaultView) === null || _target_ownerDocument_defaultView === void 0 ? void 0 : _target_ownerDocument_defaultView.event) !== null && _target_ownerDocument_defaultView_event !== void 0 ? _target_ownerDocument_defaultView_event : void 0; } return void 0; }; var FUI_FRAME_EVENT = "fuiframefocus"; var useIFrameFocus = (options) => { const { disabled, element: targetDocument, callback, contains = DEFAULT_CONTAINS, pollDuration = 100, refs } = options; const timeoutRef = React27.useRef(void 0); const listener = useEventCallback((e) => { const isOutside = refs.every((ref) => !contains(ref.current || null, e.target)); if (isOutside && !disabled) { callback(e); } }); React27.useEffect(() => { if (disabled) { return; } targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener(FUI_FRAME_EVENT, listener, true); return () => { targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener(FUI_FRAME_EVENT, listener, true); }; }, [ targetDocument, disabled, listener ]); React27.useEffect(() => { var _targetDocument_defaultView; if (disabled) { return; } timeoutRef.current = targetDocument === null || targetDocument === void 0 ? void 0 : (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.setInterval(() => { const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement; if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === "IFRAME" || (activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === "WEBVIEW") { const event = new CustomEvent(FUI_FRAME_EVENT, { bubbles: true }); activeElement.dispatchEvent(event); } }, pollDuration); return () => { var _targetDocument_defaultView2; targetDocument === null || targetDocument === void 0 ? void 0 : (_targetDocument_defaultView2 = targetDocument.defaultView) === null || _targetDocument_defaultView2 === void 0 ? void 0 : _targetDocument_defaultView2.clearInterval(timeoutRef.current); }; }, [ targetDocument, disabled, pollDuration ]); }; // node_modules/@fluentui/react-utilities/lib/hooks/useOnScrollOutside.js var React28 = __toESM(require_react()); var useOnScrollOutside = (options) => { const { refs, callback, element, disabled, contains: containsProp } = options; const listener = useEventCallback((ev) => { const contains = containsProp || ((parent2, child) => !!(parent2 === null || parent2 === void 0 ? void 0 : parent2.contains(child))); const target = ev.composedPath()[0]; const isOutside = refs.every((ref) => !contains(ref.current || null, target)); if (isOutside && !disabled) { callback(ev); } }); React28.useEffect(() => { if (disabled) { return; } element === null || element === void 0 ? void 0 : element.addEventListener("wheel", listener); element === null || element === void 0 ? void 0 : element.addEventListener("touchmove", listener); return () => { element === null || element === void 0 ? void 0 : element.removeEventListener("wheel", listener); element === null || element === void 0 ? void 0 : element.removeEventListener("touchmove", listener); }; }, [ listener, element, disabled ]); }; // node_modules/@fluentui/react-utilities/lib/hooks/usePrevious.js var React29 = __toESM(require_react()); var usePrevious = (value) => { const ref = React29.useRef(null); React29.useEffect(() => { ref.current = value; }, [ value ]); return ref.current; }; // node_modules/@fluentui/react-utilities/lib/hooks/useScrollbarWidth.js var React30 = __toESM(require_react()); var cache2 = /* @__PURE__ */ new WeakMap(); function useScrollbarWidth(options) { const { targetDocument, force } = options; return React30.useMemo(() => { if (!targetDocument) { return 0; } if (!force && cache2.has(targetDocument)) { return cache2.get(targetDocument); } const scrollbarWidth = measureScrollbarWidth(targetDocument); cache2.set(targetDocument, scrollbarWidth); return scrollbarWidth; }, [ targetDocument, force ]); } // node_modules/@fluentui/react-utilities/lib/hooks/useTimeout.js var setTimeoutNoop = (_callback) => -1; var clearTimeoutNoop = (_handle) => void 0; function useTimeout() { const { targetDocument } = useFluent(); const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView; const setTimerFn = win ? win.setTimeout : setTimeoutNoop; const clearTimerFn = win ? win.clearTimeout : clearTimeoutNoop; return useBrowserTimer(setTimerFn, clearTimerFn); } // node_modules/@fluentui/react-utilities/lib/utils/clamp.js var clamp = (value, min2, max2) => Math.max(min2, Math.min(max2, value || 0)); // node_modules/@fluentui/react-utilities/lib/utils/getReactElementRef.js var React31 = __toESM(require_react()); var IS_REACT_19_OR_HIGHER = parseInt(React31.version, 10) >= 19; function getReactElementRef(element) { if (!element) { return void 0; } if (IS_REACT_19_OR_HIGHER) { return element.props.ref; } return element.ref; } // node_modules/@fluentui/react-utilities/lib/utils/getRTLSafeKey.js var getRTLSafeKey = (key, dir) => { if (dir === "rtl") { switch (key) { case "ArrowLeft": { return "ArrowRight"; } case "ArrowRight": { return "ArrowLeft"; } } } return key; }; // node_modules/@fluentui/react-utilities/lib/utils/mergeCallbacks.js function mergeCallbacks(callback1, callback2) { return (...args) => { callback1 === null || callback1 === void 0 ? void 0 : callback1(...args); callback2 === null || callback2 === void 0 ? void 0 : callback2(...args); }; } // node_modules/@fluentui/react-utilities/lib/utils/isHTMLElement.js function isHTMLElement(element, options) { var _typedElement_ownerDocument; const typedElement = element; var _options_constructorName; return Boolean((typedElement === null || typedElement === void 0 ? void 0 : (_typedElement_ownerDocument = typedElement.ownerDocument) === null || _typedElement_ownerDocument === void 0 ? void 0 : _typedElement_ownerDocument.defaultView) && typedElement instanceof typedElement.ownerDocument.defaultView[(_options_constructorName = options === null || options === void 0 ? void 0 : options.constructorName) !== null && _options_constructorName !== void 0 ? _options_constructorName : "HTMLElement"]); } // node_modules/@fluentui/react-utilities/lib/utils/isInteractiveHTMLElement.js function isInteractiveHTMLElement(element) { if (!isHTMLElement(element)) { return false; } const { tagName } = element; switch (tagName) { case "BUTTON": case "A": case "INPUT": case "TEXTAREA": return true; } return element.isContentEditable; } // node_modules/@fluentui/react-utilities/lib/utils/priorityQueue.js function createPriorityQueue(compare) { const arr = []; let size3 = 0; const swap = (a, b) => { const tmp = arr[a]; arr[a] = arr[b]; arr[b] = tmp; }; const heapify = (i) => { let smallest = i; const l = left(i); const r = right(i); if (l < size3 && compare(arr[l], arr[smallest]) < 0) { smallest = l; } if (r < size3 && compare(arr[r], arr[smallest]) < 0) { smallest = r; } if (smallest !== i) { swap(smallest, i); heapify(smallest); } }; const dequeue = () => { if (size3 === 0) { throw new Error("Priority queue empty"); } const res = arr[0]; arr[0] = arr[--size3]; heapify(0); return res; }; const peek = () => { if (size3 === 0) { return null; } return arr[0]; }; const enqueue = (item) => { arr[size3++] = item; let i = size3 - 1; let p = parent(i); while (i > 0 && compare(arr[p], arr[i]) > 0) { swap(p, i); i = p; p = parent(i); } }; const contains = (item) => { const index = arr.indexOf(item); return index >= 0 && index < size3; }; const remove = (item) => { const i = arr.indexOf(item); if (i === -1 || i >= size3) { return; } arr[i] = arr[--size3]; heapify(i); }; const clear = () => { size3 = 0; }; const all = () => { return arr.slice(0, size3); }; return { all, clear, contains, dequeue, enqueue, peek, remove, size: () => size3 }; } var left = (i) => { return 2 * i + 1; }; var right = (i) => { return 2 * i + 2; }; var parent = (i) => { return Math.floor((i - 1) / 2); }; // node_modules/@fluentui/react-utilities/lib/trigger/applyTriggerPropsToChildren.js var React33 = __toESM(require_react()); // node_modules/@fluentui/react-utilities/lib/trigger/isFluentTrigger.js var React32 = __toESM(require_react()); function isFluentTrigger(element) { return Boolean(element.type.isFluentTriggerComponent); } // node_modules/@fluentui/react-utilities/lib/trigger/applyTriggerPropsToChildren.js function applyTriggerPropsToChildren(children, triggerChildProps) { if (typeof children === "function") { return children(triggerChildProps); } else if (children) { return cloneTriggerTree(children, triggerChildProps); } return children || null; } function cloneTriggerTree(child, triggerProps) { if (!React33.isValidElement(child) || child.type === React33.Fragment) { throw new Error("A trigger element must be a single element for this component. Please ensure that you're not using React Fragments."); } if (isFluentTrigger(child)) { const grandchild = cloneTriggerTree(child.props.children, triggerProps); return React33.cloneElement(child, void 0, grandchild); } else { return React33.cloneElement(child, triggerProps); } } // node_modules/@fluentui/react-utilities/lib/trigger/getTriggerChild.js var React34 = __toESM(require_react()); function getTriggerChild(children) { if (!React34.isValidElement(children)) { return null; } return isFluentTrigger(children) ? getTriggerChild( // FIXME: This casting should be unnecessary as isFluentTrigger is a guard type method, // but for some reason it's failing on build children.props.children ) : children; } // node_modules/@fluentui/react-utilities/lib/events/mouseTouchHelpers.js var React35 = __toESM(require_react()); function isTouchEvent(event) { return event.type.startsWith("touch"); } function isMouseEvent(event) { return event.type.startsWith("mouse") || [ "click", "contextmenu", "dblclick" ].indexOf(event.type) > -1; } function getEventClientCoords(event) { if (isMouseEvent(event)) { return { clientX: event.clientX, clientY: event.clientY }; } else if (isTouchEvent(event)) { return { clientX: event.touches[0].clientX, clientY: event.touches[0].clientY }; } else { if (true) { throw new Error("@fluentui/react-utilities]: Unable to get clientX. Unknown event type."); } return { clientX: 0, clientY: 0 }; } } // node_modules/@fluentui/react-utilities/lib/selection/useSelection.js var React36 = __toESM(require_react()); // node_modules/@fluentui/react-utilities/lib/utils/createSetFromIterable.js function createSetFromIterable(iterable) { return iterable instanceof Set ? iterable : new Set(iterable); } // node_modules/@fluentui/react-utilities/lib/selection/useSelection.js function useSelectionState(params) { const [selected, setSelected] = useControllableState({ initialState: /* @__PURE__ */ new Set(), defaultState: React36.useMemo(() => params.defaultSelectedItems && createSetFromIterable(params.defaultSelectedItems), [ params.defaultSelectedItems ]), state: React36.useMemo(() => params.selectedItems && createSetFromIterable(params.selectedItems), [ params.selectedItems ]) }); const changeSelection = (event, nextSelectedItems) => { var _params_onSelectionChange; (_params_onSelectionChange = params.onSelectionChange) === null || _params_onSelectionChange === void 0 ? void 0 : _params_onSelectionChange.call(params, event, { selectedItems: nextSelectedItems }); setSelected(nextSelectedItems); }; return [ selected, changeSelection ]; } function useSingleSelection(params) { const [selected, changeSelection] = useSelectionState(params); const methods = { deselectItem: (event) => changeSelection(event, /* @__PURE__ */ new Set()), selectItem: (event, itemId) => changeSelection(event, /* @__PURE__ */ new Set([ itemId ])), toggleAllItems: () => { if (true) { throw new Error("[react-utilities]: `toggleAllItems` should not be used in single selection mode"); } }, toggleItem: (event, itemId) => changeSelection(event, /* @__PURE__ */ new Set([ itemId ])), clearItems: (event) => changeSelection(event, /* @__PURE__ */ new Set()), isSelected: (itemId) => { var _selected_has; return (_selected_has = selected.has(itemId)) !== null && _selected_has !== void 0 ? _selected_has : false; } }; return [ selected, methods ]; } function useMultipleSelection(params) { const [selected, changeSelection] = useSelectionState(params); const methods = { toggleItem: (event, itemId) => { const nextSelectedItems = new Set(selected); if (selected.has(itemId)) { nextSelectedItems.delete(itemId); } else { nextSelectedItems.add(itemId); } changeSelection(event, nextSelectedItems); }, selectItem: (event, itemId) => { const nextSelectedItems = new Set(selected); nextSelectedItems.add(itemId); changeSelection(event, nextSelectedItems); }, deselectItem: (event, itemId) => { const nextSelectedItems = new Set(selected); nextSelectedItems.delete(itemId); changeSelection(event, nextSelectedItems); }, clearItems: (event) => { changeSelection(event, /* @__PURE__ */ new Set()); }, isSelected: (itemId) => selected.has(itemId), toggleAllItems: (event, itemIds) => { const allItemsSelected = itemIds.every((itemId) => selected.has(itemId)); const nextSelectedItems = new Set(selected); if (allItemsSelected) { nextSelectedItems.clear(); } else { itemIds.forEach((itemId) => nextSelectedItems.add(itemId)); } changeSelection(event, nextSelectedItems); } }; return [ selected, methods ]; } function useSelection(params) { "use no memo"; if (params.selectionMode === "multiselect") { return useMultipleSelection(params); } return useSingleSelection(params); } // node_modules/@fluentui/react-utilities/lib/virtualParent/isVirtualElement.js function isVirtualElement(element) { return element && !!element._virtual; } // node_modules/@fluentui/react-utilities/lib/virtualParent/getParent.js function getVirtualParent(child) { return isVirtualElement(child) ? child._virtual.parent || null : null; } function getParent(child, options = {}) { if (!child) { return null; } if (!options.skipVirtual) { const virtualParent = getVirtualParent(child); if (virtualParent) { return virtualParent; } } const parent2 = child.parentNode; if (parent2 && parent2.nodeType === 11) { return parent2.host; } return parent2; } // node_modules/@fluentui/react-utilities/lib/virtualParent/elementContains.js function elementContains(parent2, child) { if (!parent2 || !child) { return false; } if (parent2 === child) { return true; } else { const set = /* @__PURE__ */ new WeakSet(); while (child) { const nextParent = getParent(child, { skipVirtual: set.has(child) }); set.add(child); if (nextParent === parent2) { return true; } child = nextParent; } } return false; } // node_modules/@fluentui/react-utilities/lib/virtualParent/setVirtualParent.js function setVirtualParent(child, parent2) { if (!child) { return; } Object.assign(child, { _virtual: { parent: parent2 } }); } // node_modules/@fluentui/react-jsx-runtime/lib/jsx/createJSX.js var React39 = __toESM(require_react()); // node_modules/@fluentui/react-jsx-runtime/lib/utils/createCompatSlotComponent.js var React37 = __toESM(require_react()); function createCompatSlotComponent(type, props) { return { ...props, [SLOT_ELEMENT_TYPE_SYMBOL]: type }; } // node_modules/@fluentui/react-jsx-runtime/lib/utils/warnIfElementTypeIsInvalid.js var React38 = __toESM(require_react()); function warnIfElementTypeIsInvalid(type) { if (typeof type === "object" && type !== null && // eslint-disable-next-line dot-notation type["$$typeof"] === void 0) { console.error(`@fluentui/react-jsx-runtime: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: ${type}. If this happened in a slot of Fluent UI component, you might be facing package resolution issues. Please make sure you don't have multiple versions of "@fluentui/react-utilities" installed in your dependencies or sub-dependencies. You can check this by searching up for matching entries in a lockfile produced by your package manager (yarn.lock, pnpm-lock.yaml or package-lock.json).`); } } // node_modules/@fluentui/react-jsx-runtime/lib/jsx/createJSX.js function createJSX(runtime, slotRuntime) { return function jsx2(type, overrideProps, key, source, self) { if (isSlot(overrideProps)) { return slotRuntime(createCompatSlotComponent(type, overrideProps), null, key, source, self); } if (isSlot(type)) { return slotRuntime(type, overrideProps, key, source, self); } warnIfElementTypeIsInvalid(type); return runtime(type, overrideProps, key, source, self); }; } // node_modules/@fluentui/react-jsx-runtime/lib/jsx/jsxSlot.js var React40 = __toESM(require_react()); // node_modules/@fluentui/react-jsx-runtime/lib/utils/getMetadataFromSlotComponent.js function getMetadataFromSlotComponent(type) { const { as, [SLOT_CLASS_NAME_PROP_SYMBOL]: _classNameProp, [SLOT_ELEMENT_TYPE_SYMBOL]: baseElementType, [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction, ...propsWithoutMetadata } = type; const props = propsWithoutMetadata; const elementType = typeof baseElementType === "string" ? as !== null && as !== void 0 ? as : baseElementType : baseElementType; if (typeof elementType !== "string" && as) { props.as = as; } return { elementType, props, renderFunction }; } // node_modules/@fluentui/react-jsx-runtime/lib/utils/Runtime.js var ReactRuntime = __toESM(require_jsx_runtime()); var Runtime = ReactRuntime; // node_modules/@fluentui/react-jsx-runtime/lib/jsx/jsxSlot.js var jsxSlot = (type, overrideProps, key) => { const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type); const props = { ...slotProps, ...overrideProps }; if (renderFunction) { return Runtime.jsx(React40.Fragment, { children: renderFunction(elementType, props) }, key); } return Runtime.jsx(elementType, props, key); }; // node_modules/@fluentui/react-jsx-runtime/lib/jsx/jsxsSlot.js var React41 = __toESM(require_react()); var jsxsSlot = (type, overrideProps, key) => { const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type); const props = { ...slotProps, ...overrideProps }; if (renderFunction) { return Runtime.jsx(React41.Fragment, { children: renderFunction(elementType, { ...props, children: Runtime.jsxs(React41.Fragment, { children: props.children }, void 0) }) }, key); } return Runtime.jsxs(elementType, props, key); }; // node_modules/@fluentui/react-jsx-runtime/lib/jsx-runtime.js var import_react = __toESM(require_react()); var jsx = createJSX(Runtime.jsx, jsxSlot); var jsxs = createJSX(Runtime.jsxs, jsxsSlot); // node_modules/@fluentui/react-provider/lib/components/FluentProvider/renderFluentProvider.js var renderFluentProvider_unstable = (state, contextValues) => { assertSlots(state); return jsx(Provider, { value: contextValues.provider, children: jsx(ThemeProvider, { value: contextValues.theme, children: jsx(ThemeClassNameProvider, { value: contextValues.themeClassName, children: jsx(CustomStyleHooksProvider, { value: contextValues.customStyleHooks_unstable, children: jsx(TooltipVisibilityProvider, { value: contextValues.tooltip, children: jsx(TextDirectionProvider, { dir: contextValues.textDirection, children: jsx(IconDirectionContextProvider, { value: contextValues.iconDirection, children: jsx(OverridesProvider, { value: contextValues.overrides_unstable, children: jsxs(state.root, { children: [ canUseDOM() ? null : jsx("style", { // Using dangerous HTML because react can escape characters // which can lead to invalid CSS. // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML: { __html: state.serverStyleProps.cssRule }, ...state.serverStyleProps.attributes }), state.root.children ] }) }) }) }) }) }) }) }) }); }; // node_modules/keyborg/dist/esm/index.js var _canUseWeakRef = typeof WeakRef !== "undefined"; var WeakRefInstance = class { constructor(instance) { if (_canUseWeakRef && typeof instance === "object") { this._weakRef = new WeakRef(instance); } else { this._instance = instance; } } /** * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef/deref} */ deref() { var _a, _b; let instance; if (this._weakRef) { instance = (_a = this._weakRef) == null ? void 0 : _a.deref(); if (!instance) { delete this._weakRef; } } else { instance = this._instance; if ((_b = instance == null ? void 0 : instance.isDisposed) == null ? void 0 : _b.call(instance)) { delete this._instance; } } return instance; } }; var KEYBORG_FOCUSIN = "keyborg:focusin"; var KEYBORG_FOCUSOUT = "keyborg:focusout"; function canOverrideNativeFocus(win) { const HTMLElement2 = win.HTMLElement; const origFocus = HTMLElement2.prototype.focus; let isCustomFocusCalled = false; HTMLElement2.prototype.focus = function focus() { isCustomFocusCalled = true; }; const btn = win.document.createElement("button"); btn.focus(); HTMLElement2.prototype.focus = origFocus; return isCustomFocusCalled; } var _canOverrideNativeFocus = false; function nativeFocus(element) { const focus = element.focus; if (focus.__keyborgNativeFocus) { focus.__keyborgNativeFocus.call(element); } else { element.focus(); } } function setupFocusEvent(win) { const kwin = win; if (!_canOverrideNativeFocus) { _canOverrideNativeFocus = canOverrideNativeFocus(kwin); } const origFocus = kwin.HTMLElement.prototype.focus; if (origFocus.__keyborgNativeFocus) { return; } kwin.HTMLElement.prototype.focus = focus; const shadowTargets = /* @__PURE__ */ new Set(); const focusOutHandler = (e) => { const target = e.target; if (!target) { return; } const event = new CustomEvent(KEYBORG_FOCUSOUT, { cancelable: true, bubbles: true, // Allows the event to bubble past an open shadow root composed: true, detail: { originalEvent: e } }); target.dispatchEvent(event); }; const focusInHandler = (e) => { const target = e.target; if (!target) { return; } let node = e.composedPath()[0]; const currentShadows = /* @__PURE__ */ new Set(); while (node) { if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { currentShadows.add(node); node = node.host; } else { node = node.parentNode; } } for (const shadowRootWeakRef of shadowTargets) { const shadowRoot = shadowRootWeakRef.deref(); if (!shadowRoot || !currentShadows.has(shadowRoot)) { shadowTargets.delete(shadowRootWeakRef); if (shadowRoot) { shadowRoot.removeEventListener("focusin", focusInHandler, true); shadowRoot.removeEventListener("focusout", focusOutHandler, true); } } } onFocusIn(target, e.relatedTarget || void 0); }; const onFocusIn = (target, relatedTarget, originalEvent) => { var _a; const shadowRoot = target.shadowRoot; if (shadowRoot) { for (const shadowRootWeakRef of shadowTargets) { if (shadowRootWeakRef.deref() === shadowRoot) { return; } } shadowRoot.addEventListener("focusin", focusInHandler, true); shadowRoot.addEventListener("focusout", focusOutHandler, true); shadowTargets.add(new WeakRefInstance(shadowRoot)); return; } const details = { relatedTarget, originalEvent }; const event = new CustomEvent(KEYBORG_FOCUSIN, { cancelable: true, bubbles: true, // Allows the event to bubble past an open shadow root composed: true, detail: details }); event.details = details; if (_canOverrideNativeFocus || data.lastFocusedProgrammatically) { details.isFocusedProgrammatically = target === ((_a = data.lastFocusedProgrammatically) == null ? void 0 : _a.deref()); data.lastFocusedProgrammatically = void 0; } target.dispatchEvent(event); }; const data = kwin.__keyborgData = { focusInHandler, focusOutHandler, shadowTargets }; kwin.document.addEventListener( "focusin", kwin.__keyborgData.focusInHandler, true ); kwin.document.addEventListener( "focusout", kwin.__keyborgData.focusOutHandler, true ); function focus() { const keyborgNativeFocusEvent = kwin.__keyborgData; if (keyborgNativeFocusEvent) { keyborgNativeFocusEvent.lastFocusedProgrammatically = new WeakRefInstance( this ); } return origFocus.apply(this, arguments); } let activeElement = kwin.document.activeElement; while (activeElement && activeElement.shadowRoot) { onFocusIn(activeElement); activeElement = activeElement.shadowRoot.activeElement; } focus.__keyborgNativeFocus = origFocus; } function disposeFocusEvent(win) { const kwin = win; const proto = kwin.HTMLElement.prototype; const origFocus = proto.focus.__keyborgNativeFocus; const keyborgNativeFocusEvent = kwin.__keyborgData; if (keyborgNativeFocusEvent) { kwin.document.removeEventListener( "focusin", keyborgNativeFocusEvent.focusInHandler, true ); kwin.document.removeEventListener( "focusout", keyborgNativeFocusEvent.focusOutHandler, true ); for (const shadowRootWeakRef of keyborgNativeFocusEvent.shadowTargets) { const shadowRoot = shadowRootWeakRef.deref(); if (shadowRoot) { shadowRoot.removeEventListener( "focusin", keyborgNativeFocusEvent.focusInHandler, true ); shadowRoot.removeEventListener( "focusout", keyborgNativeFocusEvent.focusOutHandler, true ); } } keyborgNativeFocusEvent.shadowTargets.clear(); delete kwin.__keyborgData; } if (origFocus) { proto.focus = origFocus; } } var _dismissTimeout = 500; var _lastId = 0; var KeyborgCore = class { constructor(win, props) { this._isNavigatingWithKeyboard_DO_NOT_USE = false; this._onFocusIn = (e) => { if (this._isMouseOrTouchUsedTimer) { return; } if (this.isNavigatingWithKeyboard) { return; } const details = e.detail; if (!details.relatedTarget) { return; } if (details.isFocusedProgrammatically || details.isFocusedProgrammatically === void 0) { return; } this.isNavigatingWithKeyboard = true; }; this._onMouseDown = (e) => { if (e.buttons === 0 || e.clientX === 0 && e.clientY === 0 && e.screenX === 0 && e.screenY === 0) { return; } this._onMouseOrTouch(); }; this._onMouseOrTouch = () => { const win2 = this._win; if (win2) { if (this._isMouseOrTouchUsedTimer) { win2.clearTimeout(this._isMouseOrTouchUsedTimer); } this._isMouseOrTouchUsedTimer = win2.setTimeout(() => { delete this._isMouseOrTouchUsedTimer; }, 1e3); } this.isNavigatingWithKeyboard = false; }; this._onKeyDown = (e) => { const isNavigatingWithKeyboard = this.isNavigatingWithKeyboard; if (isNavigatingWithKeyboard) { if (this._shouldDismissKeyboardNavigation(e)) { this._scheduleDismiss(); } } else { if (this._shouldTriggerKeyboardNavigation(e)) { this.isNavigatingWithKeyboard = true; } } }; this.id = "c" + ++_lastId; this._win = win; const doc = win.document; if (props) { const triggerKeys = props.triggerKeys; const dismissKeys = props.dismissKeys; if (triggerKeys == null ? void 0 : triggerKeys.length) { this._triggerKeys = new Set(triggerKeys); } if (dismissKeys == null ? void 0 : dismissKeys.length) { this._dismissKeys = new Set(dismissKeys); } } doc.addEventListener(KEYBORG_FOCUSIN, this._onFocusIn, true); doc.addEventListener("mousedown", this._onMouseDown, true); win.addEventListener("keydown", this._onKeyDown, true); doc.addEventListener("touchstart", this._onMouseOrTouch, true); doc.addEventListener("touchend", this._onMouseOrTouch, true); doc.addEventListener("touchcancel", this._onMouseOrTouch, true); setupFocusEvent(win); } get isNavigatingWithKeyboard() { return this._isNavigatingWithKeyboard_DO_NOT_USE; } set isNavigatingWithKeyboard(val) { if (this._isNavigatingWithKeyboard_DO_NOT_USE !== val) { this._isNavigatingWithKeyboard_DO_NOT_USE = val; this.update(); } } dispose() { const win = this._win; if (win) { if (this._isMouseOrTouchUsedTimer) { win.clearTimeout(this._isMouseOrTouchUsedTimer); this._isMouseOrTouchUsedTimer = void 0; } if (this._dismissTimer) { win.clearTimeout(this._dismissTimer); this._dismissTimer = void 0; } disposeFocusEvent(win); const doc = win.document; doc.removeEventListener(KEYBORG_FOCUSIN, this._onFocusIn, true); doc.removeEventListener("mousedown", this._onMouseDown, true); win.removeEventListener("keydown", this._onKeyDown, true); doc.removeEventListener("touchstart", this._onMouseOrTouch, true); doc.removeEventListener("touchend", this._onMouseOrTouch, true); doc.removeEventListener("touchcancel", this._onMouseOrTouch, true); delete this._win; } } isDisposed() { return !!this._win; } /** * Updates all keyborg instances with the keyboard navigation state */ update() { var _a, _b; const keyborgs = (_b = (_a = this._win) == null ? void 0 : _a.__keyborg) == null ? void 0 : _b.refs; if (keyborgs) { for (const id of Object.keys(keyborgs)) { Keyborg.update(keyborgs[id], this.isNavigatingWithKeyboard); } } } /** * @returns whether the keyboard event should trigger keyboard navigation mode */ _shouldTriggerKeyboardNavigation(e) { var _a; if (e.key === "Tab") { return true; } const activeElement = (_a = this._win) == null ? void 0 : _a.document.activeElement; const isTriggerKey = !this._triggerKeys || this._triggerKeys.has(e.keyCode); const isEditable = activeElement && (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA" || activeElement.isContentEditable); return isTriggerKey && !isEditable; } /** * @returns whether the keyboard event should dismiss keyboard navigation mode */ _shouldDismissKeyboardNavigation(e) { var _a; return (_a = this._dismissKeys) == null ? void 0 : _a.has(e.keyCode); } _scheduleDismiss() { const win = this._win; if (win) { if (this._dismissTimer) { win.clearTimeout(this._dismissTimer); this._dismissTimer = void 0; } const was = win.document.activeElement; this._dismissTimer = win.setTimeout(() => { this._dismissTimer = void 0; const cur = win.document.activeElement; if (was && cur && was === cur) { this.isNavigatingWithKeyboard = false; } }, _dismissTimeout); } } }; var Keyborg = class _Keyborg { constructor(win, props) { this._cb = []; this._id = "k" + ++_lastId; this._win = win; const current = win.__keyborg; if (current) { this._core = current.core; current.refs[this._id] = this; } else { this._core = new KeyborgCore(win, props); win.__keyborg = { core: this._core, refs: { [this._id]: this } }; } } static create(win, props) { return new _Keyborg(win, props); } static dispose(instance) { instance.dispose(); } /** * Updates all subscribed callbacks with the keyboard navigation state */ static update(instance, isNavigatingWithKeyboard) { instance._cb.forEach((callback) => callback(isNavigatingWithKeyboard)); } dispose() { var _a; const current = (_a = this._win) == null ? void 0 : _a.__keyborg; if (current == null ? void 0 : current.refs[this._id]) { delete current.refs[this._id]; if (Object.keys(current.refs).length === 0) { current.core.dispose(); delete this._win.__keyborg; } } else if (true) { console.error( `Keyborg instance ${this._id} is being disposed incorrectly.` ); } this._cb = []; delete this._core; delete this._win; } /** * @returns Whether the user is navigating with keyboard */ isNavigatingWithKeyboard() { var _a; return !!((_a = this._core) == null ? void 0 : _a.isNavigatingWithKeyboard); } /** * @param callback - Called when the keyboard navigation state changes */ subscribe(callback) { this._cb.push(callback); } /** * @param callback - Registered with subscribe */ unsubscribe(callback) { const index = this._cb.indexOf(callback); if (index >= 0) { this._cb.splice(index, 1); } } /** * Manually set the keyboard navigtion state */ setVal(isNavigatingWithKeyboard) { if (this._core) { this._core.isNavigatingWithKeyboard = isNavigatingWithKeyboard; } } }; function createKeyborg(win, props) { return Keyborg.create(win, props); } function disposeKeyborg(instance) { Keyborg.dispose(instance); } // node_modules/tabster/dist/tabster.esm.js var TABSTER_ATTRIBUTE_NAME = "data-tabster"; var TABSTER_DUMMY_INPUT_ATTRIBUTE_NAME = "data-tabster-dummy"; var FOCUSABLE_SELECTOR = `:is(${["a[href]", "button", "input", "select", "textarea", "*[tabindex]", "*[contenteditable]", "details > summary", "audio[controls]", "video[controls]"].join(", ")}):not(:disabled)`; var AsyncFocusSources = { EscapeGroupper: 1, Restorer: 2, Deloser: 3 }; var ObservedElementAccessibilities = { Any: 0, Accessible: 1, Focusable: 2 }; var ObservedElementRequestStatuses = { Waiting: 0, Succeeded: 1, Canceled: 2, TimedOut: 3 }; var ObservedElementFailureReasons = { CanceledFocusChange: 1, TimeoutElementNotInDOM: 2, TimeoutElementNotAccessible: 3, TimeoutElementNotFocusable: 4, TimeoutElementNotReady: 5, SupersededByNewRequest: 6, FocusCallFailed: 7 }; var Visibilities = { Invisible: 0, PartiallyVisible: 1, Visible: 2 }; var RestorerTypes = { Source: 0, Target: 1 }; var MoverDirections = { Both: 0, // Default, both left/up keys move to the previous, right/down move to the next. Vertical: 1, // Only up/down arrows move to the next/previous. Horizontal: 2, // Only left/right arrows move to the next/previous. Grid: 3, // Two-dimentional movement depending on the visual placement. GridLinear: 4 // Two-dimentional movement depending on the visual placement. Allows linear movement. }; var MoverKeys = { ArrowUp: 1, ArrowDown: 2, ArrowLeft: 3, ArrowRight: 4, PageUp: 5, PageDown: 6, Home: 7, End: 8 }; var GroupperTabbabilities = { Unlimited: 0, Limited: 1, // The tabbability is limited to the container and explicit Enter is needed to go inside. LimitedTrapFocus: 2 // The focus is limited as above, plus trapped when inside. }; var GroupperMoveFocusActions = { Enter: 1, Escape: 2 }; var SysDummyInputsPositions = { Auto: 0, // Tabster will place dummy inputs depending on the container tag name and on the default behaviour. Inside: 1, // Tabster will always place dummy inputs inside the container. Outside: 2 // Tabster will always place dummy inputs outside of the container. }; function getTabsterOnElement(tabster, element) { var _a; return (_a = tabster.storageEntry(element)) === null || _a === void 0 ? void 0 : _a.tabster; } function updateTabsterByAttribute(tabster, element, dispose) { var _a, _b, _c; const newAttrValue = dispose || tabster._noop ? void 0 : element.getAttribute(TABSTER_ATTRIBUTE_NAME); let entry = tabster.storageEntry(element); let newAttr; if (newAttrValue) { if (newAttrValue !== ((_a = entry === null || entry === void 0 ? void 0 : entry.attr) === null || _a === void 0 ? void 0 : _a.string)) { try { const newValue = JSON.parse(newAttrValue); if (typeof newValue !== "object") { throw new Error(`Value is not a JSON object, got '${newAttrValue}'.`); } newAttr = { string: newAttrValue, object: newValue }; } catch (e) { if (true) { console.error(`data-tabster attribute error: ${e}`, element); } } } else { return; } } else if (!entry) { return; } if (!entry) { entry = tabster.storageEntry(element, true); } if (!entry.tabster) { entry.tabster = {}; } const tabsterOnElement = entry.tabster || {}; const oldTabsterProps = ((_b = entry.attr) === null || _b === void 0 ? void 0 : _b.object) || {}; const newTabsterProps = (newAttr === null || newAttr === void 0 ? void 0 : newAttr.object) || {}; for (const key of Object.keys(oldTabsterProps)) { if (!newTabsterProps[key]) { if (key === "root") { const root = tabsterOnElement[key]; if (root) { tabster.root.onRoot(root, true); } } switch (key) { case "deloser": case "root": case "groupper": case "modalizer": case "restorer": case "mover": const part = tabsterOnElement[key]; if (part) { part.dispose(); delete tabsterOnElement[key]; } break; case "observed": delete tabsterOnElement[key]; if (tabster.observedElement) { tabster.observedElement.onObservedElementUpdate(element); } break; case "focusable": case "outline": case "uncontrolled": case "sys": delete tabsterOnElement[key]; break; } } } for (const key of Object.keys(newTabsterProps)) { const sys = newTabsterProps.sys; switch (key) { case "deloser": if (tabsterOnElement.deloser) { tabsterOnElement.deloser.setProps(newTabsterProps.deloser); } else { if (tabster.deloser) { tabsterOnElement.deloser = tabster.deloser.createDeloser(element, newTabsterProps.deloser); } else if (true) { console.error("Deloser API used before initialization, please call `getDeloser()`"); } } break; case "root": if (tabsterOnElement.root) { tabsterOnElement.root.setProps(newTabsterProps.root); } else { tabsterOnElement.root = tabster.root.createRoot(element, newTabsterProps.root, sys); } tabster.root.onRoot(tabsterOnElement.root); break; case "modalizer": { let newModalizerProps; const modalizerAPI = tabster.modalizer; if (tabsterOnElement.modalizer) { const props = newTabsterProps.modalizer; const newModalizerId = props.id; if (newModalizerId && ((_c = oldTabsterProps === null || oldTabsterProps === void 0 ? void 0 : oldTabsterProps.modalizer) === null || _c === void 0 ? void 0 : _c.id) !== newModalizerId) { tabsterOnElement.modalizer.dispose(); newModalizerProps = props; } else { tabsterOnElement.modalizer.setProps(props); } } else { if (modalizerAPI) { newModalizerProps = newTabsterProps.modalizer; } else if (true) { console.error("Modalizer API used before initialization, please call `getModalizer()`"); } } if (modalizerAPI && newModalizerProps) { tabsterOnElement.modalizer = modalizerAPI.createModalizer(element, newModalizerProps, sys); } } break; case "restorer": if (tabsterOnElement.restorer) { tabsterOnElement.restorer.setProps(newTabsterProps.restorer); } else { if (tabster.restorer) { if (newTabsterProps.restorer) { tabsterOnElement.restorer = tabster.restorer.createRestorer(element, newTabsterProps.restorer); } } else if (true) { console.error("Restorer API used before initialization, please call `getRestorer()`"); } } break; case "focusable": tabsterOnElement.focusable = newTabsterProps.focusable; break; case "groupper": if (tabsterOnElement.groupper) { tabsterOnElement.groupper.setProps(newTabsterProps.groupper); } else { if (tabster.groupper) { tabsterOnElement.groupper = tabster.groupper.createGroupper(element, newTabsterProps.groupper, sys); } else if (true) { console.error("Groupper API used before initialization, please call `getGroupper()`"); } } break; case "mover": if (tabsterOnElement.mover) { tabsterOnElement.mover.setProps(newTabsterProps.mover); } else { if (tabster.mover) { tabsterOnElement.mover = tabster.mover.createMover(element, newTabsterProps.mover, sys); } else if (true) { console.error("Mover API used before initialization, please call `getMover()`"); } } break; case "observed": if (tabster.observedElement) { tabsterOnElement.observed = newTabsterProps.observed; tabster.observedElement.onObservedElementUpdate(element); } else if (true) { console.error("ObservedElement API used before initialization, please call `getObservedElement()`"); } break; case "uncontrolled": tabsterOnElement.uncontrolled = newTabsterProps.uncontrolled; break; case "outline": if (tabster.outline) { tabsterOnElement.outline = newTabsterProps.outline; } else if (true) { console.error("Outline API used before initialization, please call `getOutline()`"); } break; case "sys": tabsterOnElement.sys = newTabsterProps.sys; break; default: console.error(`Unknown key '${key}' in data-tabster attribute value.`); } } if (newAttr) { entry.attr = newAttr; } else { if (Object.keys(tabsterOnElement).length === 0) { delete entry.tabster; delete entry.attr; } tabster.storageEntry(element, false); } } var TabsterFocusInEventName = "tabster:focusin"; var TabsterFocusOutEventName = "tabster:focusout"; var TabsterMoveFocusEventName = "tabster:movefocus"; var ModalizerActiveEventName = "tabster:modalizer:active"; var ModalizerInactiveEventName = "tabster:modalizer:inactive"; var MoverStateEventName = "tabster:mover:state"; var MoverMoveFocusEventName = "tabster:mover:movefocus"; var MoverMemorizedElementEventName = "tabster:mover:memorized-element"; var GroupperMoveFocusEventName = "tabster:groupper:movefocus"; var RestorerRestoreFocusEventName = "tabster:restorer:restore-focus"; var RootFocusEventName = "tabster:root:focus"; var RootBlurEventName = "tabster:root:blur"; var CustomEvent_ = typeof CustomEvent !== "undefined" ? CustomEvent : function() { }; var TabsterCustomEvent = class extends CustomEvent_ { constructor(type, detail) { super(type, { bubbles: true, cancelable: true, composed: true, detail }); this.details = detail; } }; var TabsterFocusInEvent = class extends TabsterCustomEvent { constructor(detail) { super(TabsterFocusInEventName, detail); } }; var TabsterFocusOutEvent = class extends TabsterCustomEvent { constructor(detail) { super(TabsterFocusOutEventName, detail); } }; var TabsterMoveFocusEvent = class extends TabsterCustomEvent { constructor(detail) { super(TabsterMoveFocusEventName, detail); } }; var MoverStateEvent = class extends TabsterCustomEvent { constructor(detail) { super(MoverStateEventName, detail); } }; var MoverMoveFocusEvent = class extends TabsterCustomEvent { constructor(detail) { super(MoverMoveFocusEventName, detail); } }; var GroupperMoveFocusEvent = class extends TabsterCustomEvent { constructor(detail) { super(GroupperMoveFocusEventName, detail); } }; var ModalizerActiveEvent = class extends TabsterCustomEvent { constructor(detail) { super(ModalizerActiveEventName, detail); } }; var ModalizerInactiveEvent = class extends TabsterCustomEvent { constructor(detail) { super(ModalizerInactiveEventName, detail); } }; var RestorerRestoreFocusEvent = class extends TabsterCustomEvent { constructor() { super(RestorerRestoreFocusEventName); } }; var RootFocusEvent = class extends TabsterCustomEvent { constructor(detail) { super(RootFocusEventName, detail); } }; var RootBlurEvent = class extends TabsterCustomEvent { constructor(detail) { super(RootBlurEventName, detail); } }; var _createMutationObserver = (callback) => new MutationObserver(callback); var _createTreeWalker = (doc, root, whatToShow, filter) => doc.createTreeWalker(root, whatToShow, filter); var _getParentNode = (node) => node ? node.parentNode : null; var _getParentElement = (element) => element ? element.parentElement : null; var _nodeContains = (parent2, child) => !!(child && (parent2 === null || parent2 === void 0 ? void 0 : parent2.contains(child))); var _getActiveElement = (doc) => doc.activeElement; var _querySelector = (element, selector) => element.querySelector(selector); var _querySelectorAll = (element, selector) => Array.prototype.slice.call(element.querySelectorAll(selector), 0); var _getElementById = (doc, id) => doc.getElementById(id); var _getFirstChild = (node) => (node === null || node === void 0 ? void 0 : node.firstChild) || null; var _getLastChild = (node) => (node === null || node === void 0 ? void 0 : node.lastChild) || null; var _getNextSibling = (node) => (node === null || node === void 0 ? void 0 : node.nextSibling) || null; var _getPreviousSibling = (node) => (node === null || node === void 0 ? void 0 : node.previousSibling) || null; var _getFirstElementChild = (element) => (element === null || element === void 0 ? void 0 : element.firstElementChild) || null; var _getLastElementChild = (element) => (element === null || element === void 0 ? void 0 : element.lastElementChild) || null; var _getNextElementSibling = (element) => (element === null || element === void 0 ? void 0 : element.nextElementSibling) || null; var _getPreviousElementSibling = (element) => (element === null || element === void 0 ? void 0 : element.previousElementSibling) || null; var _appendChild = (parent2, child) => parent2.appendChild(child); var _insertBefore = (parent2, child, referenceChild) => parent2.insertBefore(child, referenceChild); var _getSelection = (ref) => { var _a; return ((_a = ref.ownerDocument) === null || _a === void 0 ? void 0 : _a.getSelection()) || null; }; var _getElementsByName = (referenceElement, name) => referenceElement.ownerDocument.getElementsByName(name); var dom = { createMutationObserver: _createMutationObserver, createTreeWalker: _createTreeWalker, getParentNode: _getParentNode, getParentElement: _getParentElement, nodeContains: _nodeContains, getActiveElement: _getActiveElement, querySelector: _querySelector, querySelectorAll: _querySelectorAll, getElementById: _getElementById, getFirstChild: _getFirstChild, getLastChild: _getLastChild, getNextSibling: _getNextSibling, getPreviousSibling: _getPreviousSibling, getFirstElementChild: _getFirstElementChild, getLastElementChild: _getLastElementChild, getNextElementSibling: _getNextElementSibling, getPreviousElementSibling: _getPreviousElementSibling, appendChild: _appendChild, insertBefore: _insertBefore, getSelection: _getSelection, getElementsByName: _getElementsByName }; function setDOMAPI(domapi) { for (const key of Object.keys(domapi)) { dom[key] = domapi[key]; } } var _isBrokenIE11; var _DOMRect = typeof DOMRect !== "undefined" ? DOMRect : class { constructor(x, y, width, height) { this.left = x || 0; this.top = y || 0; this.right = (x || 0) + (width || 0); this.bottom = (y || 0) + (height || 0); } }; var _uidCounter = 0; try { document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT); _isBrokenIE11 = false; } catch (e) { _isBrokenIE11 = true; } var _updateDummyInputsTimeout = 100; function getInstanceContext(getWindow2) { const win = getWindow2(); let ctx = win.__tabsterInstanceContext; if (!ctx) { ctx = { elementByUId: {}, basics: { Promise: win.Promise || void 0, WeakRef: win.WeakRef || void 0 }, containerBoundingRectCache: {}, lastContainerBoundingRectCacheId: 0, fakeWeakRefs: [], fakeWeakRefsStarted: false }; win.__tabsterInstanceContext = ctx; } return ctx; } function disposeInstanceContext(win) { const ctx = win.__tabsterInstanceContext; if (ctx) { ctx.elementByUId = {}; delete ctx.WeakRef; ctx.containerBoundingRectCache = {}; if (ctx.containerBoundingRectCacheTimer) { win.clearTimeout(ctx.containerBoundingRectCacheTimer); } if (ctx.fakeWeakRefsTimer) { win.clearTimeout(ctx.fakeWeakRefsTimer); } ctx.fakeWeakRefs = []; delete win.__tabsterInstanceContext; } } function createWeakMap(win) { const ctx = win.__tabsterInstanceContext; return new ((ctx === null || ctx === void 0 ? void 0 : ctx.basics.WeakMap) || WeakMap)(); } function hasSubFocusable(element) { return !!element.querySelector(FOCUSABLE_SELECTOR); } var FakeWeakRef = class { constructor(target) { this._target = target; } deref() { return this._target; } static cleanup(fwr, forceRemove) { if (!fwr._target) { return true; } if (forceRemove || !documentContains(fwr._target.ownerDocument, fwr._target)) { delete fwr._target; return true; } return false; } }; var WeakHTMLElement = class { constructor(getWindow2, element, data) { const context = getInstanceContext(getWindow2); let ref; if (context.WeakRef) { ref = new context.WeakRef(element); } else { ref = new FakeWeakRef(element); context.fakeWeakRefs.push(ref); } this._ref = ref; this._data = data; } get() { const ref = this._ref; let element; if (ref) { element = ref.deref(); if (!element) { delete this._ref; } } return element; } getData() { return this._data; } }; function cleanupFakeWeakRefs(getWindow2, forceRemove) { const context = getInstanceContext(getWindow2); context.fakeWeakRefs = context.fakeWeakRefs.filter((e) => !FakeWeakRef.cleanup(e, forceRemove)); } function startFakeWeakRefsCleanup(getWindow2) { const context = getInstanceContext(getWindow2); if (!context.fakeWeakRefsStarted) { context.fakeWeakRefsStarted = true; context.WeakRef = getWeakRef(context); } if (!context.fakeWeakRefsTimer) { context.fakeWeakRefsTimer = getWindow2().setTimeout(() => { context.fakeWeakRefsTimer = void 0; cleanupFakeWeakRefs(getWindow2); startFakeWeakRefsCleanup(getWindow2); }, 2 * 60 * 1e3); } } function stopFakeWeakRefsCleanupAndClearStorage(getWindow2) { const context = getInstanceContext(getWindow2); context.fakeWeakRefsStarted = false; if (context.fakeWeakRefsTimer) { getWindow2().clearTimeout(context.fakeWeakRefsTimer); context.fakeWeakRefsTimer = void 0; context.fakeWeakRefs = []; } } function createElementTreeWalker(doc, root, acceptNode) { if (root.nodeType !== Node.ELEMENT_NODE) { return void 0; } const filter = _isBrokenIE11 ? acceptNode : { acceptNode }; return dom.createTreeWalker( doc, root, NodeFilter.SHOW_ELEMENT, filter, // @ts-ignore: We still don't want to completely break IE11, so, entityReferenceExpansion argument is not optional. false /* Last argument is not optional for IE11! */ ); } function getBoundingRect(getWindow2, element) { let cacheId = element.__tabsterCacheId; const context = getInstanceContext(getWindow2); const cached = cacheId ? context.containerBoundingRectCache[cacheId] : void 0; if (cached) { return cached.rect; } const scrollingElement = element.ownerDocument && element.ownerDocument.documentElement; if (!scrollingElement) { return new _DOMRect(); } let left2 = 0; let top = 0; let right2 = scrollingElement.clientWidth; let bottom = scrollingElement.clientHeight; if (element !== scrollingElement) { const r = element.getBoundingClientRect(); left2 = Math.max(left2, r.left); top = Math.max(top, r.top); right2 = Math.min(right2, r.right); bottom = Math.min(bottom, r.bottom); } const rect = new _DOMRect(left2 < right2 ? left2 : -1, top < bottom ? top : -1, left2 < right2 ? right2 - left2 : 0, top < bottom ? bottom - top : 0); if (!cacheId) { cacheId = "r-" + ++context.lastContainerBoundingRectCacheId; element.__tabsterCacheId = cacheId; } context.containerBoundingRectCache[cacheId] = { rect, element }; if (!context.containerBoundingRectCacheTimer) { context.containerBoundingRectCacheTimer = window.setTimeout(() => { context.containerBoundingRectCacheTimer = void 0; for (const cId of Object.keys(context.containerBoundingRectCache)) { delete context.containerBoundingRectCache[cId].element.__tabsterCacheId; } context.containerBoundingRectCache = {}; }, 50); } return rect; } function isElementVerticallyVisibleInContainer(getWindow2, element, tolerance) { const container = getScrollableContainer(element); if (!container) { return false; } const containerRect = getBoundingRect(getWindow2, container); const elementRect = element.getBoundingClientRect(); const intersectionTolerance = elementRect.height * (1 - tolerance); const topIntersection = Math.max(0, containerRect.top - elementRect.top); const bottomIntersection = Math.max(0, elementRect.bottom - containerRect.bottom); const totalIntersection = topIntersection + bottomIntersection; return totalIntersection === 0 || totalIntersection <= intersectionTolerance; } function scrollIntoView(getWindow2, element, alignToTop) { const container = getScrollableContainer(element); if (container) { const containerRect = getBoundingRect(getWindow2, container); const elementRect = element.getBoundingClientRect(); if (alignToTop) { container.scrollTop += elementRect.top - containerRect.top; } else { container.scrollTop += elementRect.bottom - containerRect.bottom; } } } function getScrollableContainer(element) { const doc = element.ownerDocument; if (doc) { for (let el = dom.getParentElement(element); el; el = dom.getParentElement(el)) { if (el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight) { return el; } } return doc.documentElement; } return null; } function makeFocusIgnored(element) { element.__shouldIgnoreFocus = true; } function shouldIgnoreFocus(element) { return !!element.__shouldIgnoreFocus; } function getUId(wnd) { const rnd = new Uint32Array(4); if (wnd.crypto && wnd.crypto.getRandomValues) { wnd.crypto.getRandomValues(rnd); } else if (wnd.msCrypto && wnd.msCrypto.getRandomValues) { wnd.msCrypto.getRandomValues(rnd); } else { for (let i = 0; i < rnd.length; i++) { rnd[i] = 4294967295 * Math.random(); } } const srnd = []; for (let i = 0; i < rnd.length; i++) { srnd.push(rnd[i].toString(36)); } srnd.push("|"); srnd.push((++_uidCounter).toString(36)); srnd.push("|"); srnd.push(Date.now().toString(36)); return srnd.join(""); } function getElementUId(getWindow2, element) { const context = getInstanceContext(getWindow2); let uid = element.__tabsterElementUID; if (!uid) { uid = element.__tabsterElementUID = getUId(getWindow2()); } if (!context.elementByUId[uid] && documentContains(element.ownerDocument, element)) { context.elementByUId[uid] = new WeakHTMLElement(getWindow2, element); } return uid; } function clearElementCache(getWindow2, parent2) { const context = getInstanceContext(getWindow2); for (const key of Object.keys(context.elementByUId)) { const wel = context.elementByUId[key]; const el = wel && wel.get(); if (el && parent2) { if (!dom.nodeContains(parent2, el)) { continue; } } delete context.elementByUId[key]; } } function documentContains(doc, element) { return dom.nodeContains(doc === null || doc === void 0 ? void 0 : doc.body, element); } function matchesSelector(element, selector) { const matches = element.matches || element.matchesSelector || element.msMatchesSelector || element.webkitMatchesSelector; return matches && matches.call(element, selector); } function getPromise(getWindow2) { const context = getInstanceContext(getWindow2); if (context.basics.Promise) { return context.basics.Promise; } throw new Error("No Promise defined."); } function getWeakRef(context) { return context.basics.WeakRef; } var _lastTabsterPartId = 0; var TabsterPart = class { constructor(tabster, element, props) { const getWindow2 = tabster.getWindow; this._tabster = tabster; this._element = new WeakHTMLElement(getWindow2, element); this._props = { ...props }; this.id = "i" + ++_lastTabsterPartId; } getElement() { return this._element.get(); } getProps() { return this._props; } setProps(props) { this._props = { ...props }; } }; var DummyInput = class { constructor(getWindow2, isOutside, props, element, fixedTarget) { var _a; this._focusIn = (e) => { if (this._fixedTarget) { const target = this._fixedTarget.get(); if (target) { nativeFocus(target); } return; } const input2 = this.input; if (this.onFocusIn && input2) { const relatedTarget = e.relatedTarget; this.onFocusIn(this, this._isBackward(true, input2, relatedTarget), relatedTarget); } }; this._focusOut = (e) => { if (this._fixedTarget) { return; } this.useDefaultAction = false; const input2 = this.input; if (this.onFocusOut && input2) { const relatedTarget = e.relatedTarget; this.onFocusOut(this, this._isBackward(false, input2, relatedTarget), relatedTarget); } }; const win = getWindow2(); const input = win.document.createElement("i"); input.tabIndex = 0; input.setAttribute("role", "none"); input.setAttribute(TABSTER_DUMMY_INPUT_ATTRIBUTE_NAME, ""); input.setAttribute("aria-hidden", "true"); const style = input.style; style.position = "fixed"; style.width = style.height = "1px"; style.opacity = "0.001"; style.zIndex = "-1"; style.setProperty("content-visibility", "hidden"); makeFocusIgnored(input); this.input = input; this.isFirst = props.isFirst; this.isOutside = isOutside; this._isPhantom = (_a = props.isPhantom) !== null && _a !== void 0 ? _a : false; this._fixedTarget = fixedTarget; input.addEventListener("focusin", this._focusIn); input.addEventListener("focusout", this._focusOut); input.__tabsterDummyContainer = element; if (this._isPhantom) { this._disposeTimer = win.setTimeout(() => { delete this._disposeTimer; this.dispose(); }, 0); this._clearDisposeTimeout = () => { if (this._disposeTimer) { win.clearTimeout(this._disposeTimer); delete this._disposeTimer; } delete this._clearDisposeTimeout; }; } } dispose() { var _a; if (this._clearDisposeTimeout) { this._clearDisposeTimeout(); } const input = this.input; if (!input) { return; } delete this._fixedTarget; delete this.onFocusIn; delete this.onFocusOut; delete this.input; input.removeEventListener("focusin", this._focusIn); input.removeEventListener("focusout", this._focusOut); delete input.__tabsterDummyContainer; (_a = dom.getParentNode(input)) === null || _a === void 0 ? void 0 : _a.removeChild(input); } setTopLeft(top, left2) { var _a; const style = (_a = this.input) === null || _a === void 0 ? void 0 : _a.style; if (style) { style.top = `${top}px`; style.left = `${left2}px`; } } _isBackward(isIn, current, previous) { return isIn && !previous ? !this.isFirst : !!(previous && current.compareDocumentPosition(previous) & Node.DOCUMENT_POSITION_FOLLOWING); } }; var DummyInputManagerPriorities = { Root: 1, Modalizer: 2, Mover: 3, Groupper: 4 }; var DummyInputManager = class { constructor(tabster, element, priority, sys, outsideByDefault, callForDefaultAction) { this._element = element; this._instance = new DummyInputManagerCore(tabster, element, this, priority, sys, outsideByDefault, callForDefaultAction); } _setHandlers(onFocusIn, onFocusOut) { this._onFocusIn = onFocusIn; this._onFocusOut = onFocusOut; } moveOut(backwards) { var _a; (_a = this._instance) === null || _a === void 0 ? void 0 : _a.moveOut(backwards); } moveOutWithDefaultAction(backwards, relatedEvent) { var _a; (_a = this._instance) === null || _a === void 0 ? void 0 : _a.moveOutWithDefaultAction(backwards, relatedEvent); } getHandler(isIn) { return isIn ? this._onFocusIn : this._onFocusOut; } setTabbable(tabbable) { var _a; (_a = this._instance) === null || _a === void 0 ? void 0 : _a.setTabbable(this, tabbable); } dispose() { if (this._instance) { this._instance.dispose(this); delete this._instance; } delete this._onFocusIn; delete this._onFocusOut; } static moveWithPhantomDummy(tabster, element, moveOutOfElement, isBackward, relatedEvent) { const dummy = new DummyInput(tabster.getWindow, true, { isPhantom: true, isFirst: true }); const input = dummy.input; if (input) { let parent2; let insertBefore2; if (element.tagName === "BODY") { parent2 = element; insertBefore2 = moveOutOfElement && isBackward || !moveOutOfElement && !isBackward ? dom.getFirstElementChild(element) : null; } else { if (moveOutOfElement && (!isBackward || isBackward && !tabster.focusable.isFocusable(element, false, true, true))) { parent2 = element; insertBefore2 = isBackward ? element.firstElementChild : null; } else { parent2 = dom.getParentElement(element); insertBefore2 = moveOutOfElement && isBackward || !moveOutOfElement && !isBackward ? element : dom.getNextElementSibling(element); } let potentialDummy; let dummyFor; do { potentialDummy = moveOutOfElement && isBackward || !moveOutOfElement && !isBackward ? dom.getPreviousElementSibling(insertBefore2) : insertBefore2; dummyFor = getDummyInputContainer(potentialDummy); if (dummyFor === element) { insertBefore2 = moveOutOfElement && isBackward || !moveOutOfElement && !isBackward ? potentialDummy : dom.getNextElementSibling(potentialDummy); } else { dummyFor = null; } } while (dummyFor); } if (parent2 === null || parent2 === void 0 ? void 0 : parent2.dispatchEvent(new TabsterMoveFocusEvent({ by: "root", owner: parent2, next: null, relatedEvent }))) { dom.insertBefore(parent2, input, insertBefore2); nativeFocus(input); } } } static addPhantomDummyWithTarget(tabster, sourceElement, isBackward, targetElement) { const dummy = new DummyInput(tabster.getWindow, true, { isPhantom: true, isFirst: true }, void 0, new WeakHTMLElement(tabster.getWindow, targetElement)); const input = dummy.input; if (input) { let dummyParent; let insertBefore2; if (hasSubFocusable(sourceElement) && !isBackward) { dummyParent = sourceElement; insertBefore2 = dom.getFirstElementChild(sourceElement); } else { dummyParent = dom.getParentElement(sourceElement); insertBefore2 = isBackward ? sourceElement : dom.getNextElementSibling(sourceElement); } if (dummyParent) { dom.insertBefore(dummyParent, input, insertBefore2); } } } }; function setDummyInputDebugValue(dummy, wrappers) { var _a; const what = { 1: "Root", 2: "Modalizer", 3: "Mover", 4: "Groupper" }; (_a = dummy.input) === null || _a === void 0 ? void 0 : _a.setAttribute(TABSTER_DUMMY_INPUT_ATTRIBUTE_NAME, [`isFirst=${dummy.isFirst}`, `isOutside=${dummy.isOutside}`, ...wrappers.map((w) => `(${what[w.priority]}, tabbable=${w.tabbable})`)].join(", ")); } var DummyInputObserver = class { constructor(win) { this._updateQueue = /* @__PURE__ */ new Set(); this._lastUpdateQueueTime = 0; this._changedParents = /* @__PURE__ */ new WeakSet(); this._dummyElements = []; this._dummyCallbacks = /* @__PURE__ */ new WeakMap(); this._domChanged = (parent2) => { var _a; if (this._changedParents.has(parent2)) { return; } this._changedParents.add(parent2); if (this._updateDummyInputsTimer) { return; } this._updateDummyInputsTimer = (_a = this._win) === null || _a === void 0 ? void 0 : _a.call(this).setTimeout(() => { delete this._updateDummyInputsTimer; for (const ref of this._dummyElements) { const dummyElement = ref.get(); if (dummyElement) { const callback = this._dummyCallbacks.get(dummyElement); if (callback) { const dummyParent = dom.getParentNode(dummyElement); if (!dummyParent || this._changedParents.has(dummyParent)) { callback(); } } } } this._changedParents = /* @__PURE__ */ new WeakSet(); }, _updateDummyInputsTimeout); }; this._win = win; } add(dummy, callback) { if (!this._dummyCallbacks.has(dummy) && this._win) { this._dummyElements.push(new WeakHTMLElement(this._win, dummy)); this._dummyCallbacks.set(dummy, callback); this.domChanged = this._domChanged; } } remove(dummy) { this._dummyElements = this._dummyElements.filter((ref) => { const element = ref.get(); return element && element !== dummy; }); this._dummyCallbacks.delete(dummy); if (this._dummyElements.length === 0) { delete this.domChanged; } } dispose() { var _a; const win = (_a = this._win) === null || _a === void 0 ? void 0 : _a.call(this); if (this._updateTimer) { win === null || win === void 0 ? void 0 : win.clearTimeout(this._updateTimer); delete this._updateTimer; } if (this._updateDummyInputsTimer) { win === null || win === void 0 ? void 0 : win.clearTimeout(this._updateDummyInputsTimer); delete this._updateDummyInputsTimer; } this._changedParents = /* @__PURE__ */ new WeakSet(); this._dummyCallbacks = /* @__PURE__ */ new WeakMap(); this._dummyElements = []; this._updateQueue.clear(); delete this.domChanged; delete this._win; } updatePositions(compute) { if (!this._win) { return; } this._updateQueue.add(compute); this._lastUpdateQueueTime = Date.now(); this._scheduledUpdatePositions(); } _scheduledUpdatePositions() { var _a; if (this._updateTimer) { return; } this._updateTimer = (_a = this._win) === null || _a === void 0 ? void 0 : _a.call(this).setTimeout(() => { delete this._updateTimer; if (this._lastUpdateQueueTime + _updateDummyInputsTimeout <= Date.now()) { const scrollTopLeftCache = /* @__PURE__ */ new Map(); const setTopLeftCallbacks = []; for (const compute of this._updateQueue) { setTopLeftCallbacks.push(compute(scrollTopLeftCache)); } this._updateQueue.clear(); for (const setTopLeft of setTopLeftCallbacks) { setTopLeft(); } scrollTopLeftCache.clear(); } else { this._scheduledUpdatePositions(); } }, _updateDummyInputsTimeout); } }; var DummyInputManagerCore = class { constructor(tabster, element, manager, priority, sys, outsideByDefault, callForDefaultAction) { this._wrappers = []; this._isOutside = false; this._transformElements = /* @__PURE__ */ new Set(); this._onFocusIn = (dummyInput, isBackward, relatedTarget) => { this._onFocus(true, dummyInput, isBackward, relatedTarget); }; this._onFocusOut = (dummyInput, isBackward, relatedTarget) => { this._onFocus(false, dummyInput, isBackward, relatedTarget); }; this.moveOut = (backwards) => { var _a; const first = this._firstDummy; const last = this._lastDummy; if (first && last) { this._ensurePosition(); const firstInput = first.input; const lastInput = last.input; const element2 = (_a = this._element) === null || _a === void 0 ? void 0 : _a.get(); if (firstInput && lastInput && element2) { let toFocus; if (backwards) { firstInput.tabIndex = 0; toFocus = firstInput; } else { lastInput.tabIndex = 0; toFocus = lastInput; } if (toFocus) { nativeFocus(toFocus); } } } }; this.moveOutWithDefaultAction = (backwards, relatedEvent) => { var _a; const first = this._firstDummy; const last = this._lastDummy; if (first && last) { this._ensurePosition(); const firstInput = first.input; const lastInput = last.input; const element2 = (_a = this._element) === null || _a === void 0 ? void 0 : _a.get(); if (firstInput && lastInput && element2) { let toFocus; if (backwards) { if (!first.isOutside && this._tabster.focusable.isFocusable(element2, true, true, true)) { toFocus = element2; } else { first.useDefaultAction = true; firstInput.tabIndex = 0; toFocus = firstInput; } } else { last.useDefaultAction = true; lastInput.tabIndex = 0; toFocus = lastInput; } if (toFocus && element2.dispatchEvent(new TabsterMoveFocusEvent({ by: "root", owner: element2, next: null, relatedEvent }))) { nativeFocus(toFocus); } } } }; this.setTabbable = (manager2, tabbable) => { var _a, _b; for (const w of this._wrappers) { if (w.manager === manager2) { w.tabbable = tabbable; break; } } const wrapper = this._getCurrent(); if (wrapper) { const tabIndex = wrapper.tabbable ? 0 : -1; let input = (_a = this._firstDummy) === null || _a === void 0 ? void 0 : _a.input; if (input) { input.tabIndex = tabIndex; } input = (_b = this._lastDummy) === null || _b === void 0 ? void 0 : _b.input; if (input) { input.tabIndex = tabIndex; } } if (true) { this._firstDummy && setDummyInputDebugValue(this._firstDummy, this._wrappers); this._lastDummy && setDummyInputDebugValue(this._lastDummy, this._wrappers); } }; this._addDummyInputs = () => { if (this._addTimer) { return; } this._addTimer = this._getWindow().setTimeout(() => { delete this._addTimer; this._ensurePosition(); if (true) { this._firstDummy && setDummyInputDebugValue(this._firstDummy, this._wrappers); this._lastDummy && setDummyInputDebugValue(this._lastDummy, this._wrappers); } this._addTransformOffsets(); }, 0); }; this._addTransformOffsets = () => { this._tabster._dummyObserver.updatePositions(this._computeTransformOffsets); }; this._computeTransformOffsets = (scrollTopLeftCache) => { var _a, _b; const from = ((_a = this._firstDummy) === null || _a === void 0 ? void 0 : _a.input) || ((_b = this._lastDummy) === null || _b === void 0 ? void 0 : _b.input); const transformElements = this._transformElements; const newTransformElements = /* @__PURE__ */ new Set(); let scrollTop = 0; let scrollLeft = 0; const win = this._getWindow(); for (let element2 = from; element2 && element2.nodeType === Node.ELEMENT_NODE; element2 = dom.getParentElement(element2)) { let scrollTopLeft = scrollTopLeftCache.get(element2); if (scrollTopLeft === void 0) { const transform = win.getComputedStyle(element2).transform; if (transform && transform !== "none") { scrollTopLeft = { scrollTop: element2.scrollTop, scrollLeft: element2.scrollLeft }; } scrollTopLeftCache.set(element2, scrollTopLeft || null); } if (scrollTopLeft) { newTransformElements.add(element2); if (!transformElements.has(element2)) { element2.addEventListener("scroll", this._addTransformOffsets); } scrollTop += scrollTopLeft.scrollTop; scrollLeft += scrollTopLeft.scrollLeft; } } for (const el2 of transformElements) { if (!newTransformElements.has(el2)) { el2.removeEventListener("scroll", this._addTransformOffsets); } } this._transformElements = newTransformElements; return () => { var _a2, _b2; (_a2 = this._firstDummy) === null || _a2 === void 0 ? void 0 : _a2.setTopLeft(scrollTop, scrollLeft); (_b2 = this._lastDummy) === null || _b2 === void 0 ? void 0 : _b2.setTopLeft(scrollTop, scrollLeft); }; }; const el = element.get(); if (!el) { throw new Error("No element"); } this._tabster = tabster; this._getWindow = tabster.getWindow; this._callForDefaultAction = callForDefaultAction; const instance = el.__tabsterDummy; (instance || this)._wrappers.push({ manager, priority, tabbable: true }); if (instance) { if (true) { this._firstDummy && setDummyInputDebugValue(this._firstDummy, instance._wrappers); this._lastDummy && setDummyInputDebugValue(this._lastDummy, instance._wrappers); } return instance; } el.__tabsterDummy = this; const forcedDummyPosition = sys === null || sys === void 0 ? void 0 : sys.dummyInputsPosition; const tagName = el.tagName; this._isOutside = !forcedDummyPosition ? (outsideByDefault || tagName === "UL" || tagName === "OL" || tagName === "TABLE") && !(tagName === "LI" || tagName === "TD" || tagName === "TH") : forcedDummyPosition === SysDummyInputsPositions.Outside; this._firstDummy = new DummyInput(this._getWindow, this._isOutside, { isFirst: true }, element); this._lastDummy = new DummyInput(this._getWindow, this._isOutside, { isFirst: false }, element); const dummyElement = this._firstDummy.input; dummyElement && tabster._dummyObserver.add(dummyElement, this._addDummyInputs); this._firstDummy.onFocusIn = this._onFocusIn; this._firstDummy.onFocusOut = this._onFocusOut; this._lastDummy.onFocusIn = this._onFocusIn; this._lastDummy.onFocusOut = this._onFocusOut; this._element = element; this._addDummyInputs(); } dispose(manager, force) { var _a, _b, _c, _d; const wrappers = this._wrappers = this._wrappers.filter((w) => w.manager !== manager && !force); if (true) { this._firstDummy && setDummyInputDebugValue(this._firstDummy, wrappers); this._lastDummy && setDummyInputDebugValue(this._lastDummy, wrappers); } if (wrappers.length === 0) { delete ((_a = this._element) === null || _a === void 0 ? void 0 : _a.get()).__tabsterDummy; for (const el of this._transformElements) { el.removeEventListener("scroll", this._addTransformOffsets); } this._transformElements.clear(); const win = this._getWindow(); if (this._addTimer) { win.clearTimeout(this._addTimer); delete this._addTimer; } const dummyElement = (_b = this._firstDummy) === null || _b === void 0 ? void 0 : _b.input; dummyElement && this._tabster._dummyObserver.remove(dummyElement); (_c = this._firstDummy) === null || _c === void 0 ? void 0 : _c.dispose(); (_d = this._lastDummy) === null || _d === void 0 ? void 0 : _d.dispose(); } } _onFocus(isIn, dummyInput, isBackward, relatedTarget) { var _a; const wrapper = this._getCurrent(); if (wrapper && (!dummyInput.useDefaultAction || this._callForDefaultAction)) { (_a = wrapper.manager.getHandler(isIn)) === null || _a === void 0 ? void 0 : _a(dummyInput, isBackward, relatedTarget); } } _getCurrent() { this._wrappers.sort((a, b) => { if (a.tabbable !== b.tabbable) { return a.tabbable ? -1 : 1; } return a.priority - b.priority; }); return this._wrappers[0]; } _ensurePosition() { var _a, _b, _c; const element = (_a = this._element) === null || _a === void 0 ? void 0 : _a.get(); const firstDummyInput = (_b = this._firstDummy) === null || _b === void 0 ? void 0 : _b.input; const lastDummyInput = (_c = this._lastDummy) === null || _c === void 0 ? void 0 : _c.input; if (!element || !firstDummyInput || !lastDummyInput) { return; } if (this._isOutside) { const elementParent = dom.getParentNode(element); if (elementParent) { const nextSibling = dom.getNextSibling(element); if (nextSibling !== lastDummyInput) { dom.insertBefore(elementParent, lastDummyInput, nextSibling); } if (dom.getPreviousElementSibling(element) !== firstDummyInput) { dom.insertBefore(elementParent, firstDummyInput, element); } } } else { if (dom.getLastElementChild(element) !== lastDummyInput) { dom.appendChild(element, lastDummyInput); } const firstElementChild = dom.getFirstElementChild(element); if (firstElementChild && firstElementChild !== firstDummyInput && firstElementChild.parentNode) { dom.insertBefore(firstElementChild.parentNode, firstDummyInput, firstElementChild); } } } }; function getLastChild$2(container) { let lastChild = null; for (let i = dom.getLastElementChild(container); i; i = dom.getLastElementChild(i)) { lastChild = i; } return lastChild || void 0; } function getAdjacentElement(from, prev) { let cur = from; let adjacent = null; while (cur && !adjacent) { adjacent = prev ? dom.getPreviousElementSibling(cur) : dom.getNextElementSibling(cur); cur = dom.getParentElement(cur); } return adjacent || void 0; } function augmentAttribute(tabster, element, name, value) { const entry = tabster.storageEntry(element, true); let ret = false; if (!entry.aug) { if (value === void 0) { return ret; } entry.aug = {}; } if (value === void 0) { if (name in entry.aug) { const origVal = entry.aug[name]; delete entry.aug[name]; if (origVal === null) { element.removeAttribute(name); } else { element.setAttribute(name, origVal); } ret = true; } } else { let origValue; if (!(name in entry.aug)) { origValue = element.getAttribute(name); } if (origValue !== void 0 && origValue !== value) { entry.aug[name] = origValue; if (value === null) { element.removeAttribute(name); } else { element.setAttribute(name, value); } ret = true; } } if (value === void 0 && Object.keys(entry.aug).length === 0) { delete entry.aug; tabster.storageEntry(element, false); } return ret; } function isDisplayNone(element) { var _a, _b; const elementDocument = element.ownerDocument; const computedStyle = (_a = elementDocument.defaultView) === null || _a === void 0 ? void 0 : _a.getComputedStyle(element); if (element.offsetParent === null && elementDocument.body !== element && (computedStyle === null || computedStyle === void 0 ? void 0 : computedStyle.position) !== "fixed") { return true; } if ((computedStyle === null || computedStyle === void 0 ? void 0 : computedStyle.visibility) === "hidden") { return true; } if ((computedStyle === null || computedStyle === void 0 ? void 0 : computedStyle.position) === "fixed") { if (computedStyle.display === "none") { return true; } if (((_b = element.parentElement) === null || _b === void 0 ? void 0 : _b.offsetParent) === null && elementDocument.body !== element.parentElement) { return true; } } return false; } function isRadio(element) { return element.tagName === "INPUT" && !!element.name && element.type === "radio"; } function getRadioButtonGroup(element) { if (!isRadio(element)) { return; } const name = element.name; let radioButtons = Array.from(dom.getElementsByName(element, name)); let checked; radioButtons = radioButtons.filter((el) => { if (isRadio(el)) { if (el.checked) { checked = el; } return true; } return false; }); return { name, buttons: new Set(radioButtons), checked }; } function getDummyInputContainer(element) { var _a; return ((_a = element === null || element === void 0 ? void 0 : element.__tabsterDummyContainer) === null || _a === void 0 ? void 0 : _a.get()) || null; } function getTabsterAttribute(props, plain) { const attr = JSON.stringify(props); if (plain === true) { return attr; } return { [TABSTER_ATTRIBUTE_NAME]: attr }; } function mergeTabsterProps(props, newProps) { for (const key of Object.keys(newProps)) { const value = newProps[key]; if (value) { props[key] = value; } else { delete props[key]; } } } function setTabsterAttribute(element, newProps, update) { let props; if (update) { const attr = element.getAttribute(TABSTER_ATTRIBUTE_NAME); if (attr) { try { props = JSON.parse(attr); } catch (e) { if (true) { console.error(`data-tabster attribute error: ${e}`, element); } } } } if (!props) { props = {}; } mergeTabsterProps(props, newProps); if (Object.keys(props).length > 0) { element.setAttribute(TABSTER_ATTRIBUTE_NAME, getTabsterAttribute(props, true)); } else { element.removeAttribute(TABSTER_ATTRIBUTE_NAME); } } function _setInformativeStyle$3(weakElement, remove, id) { if (true) { const element = weakElement.get(); if (element) { if (remove) { element.style.removeProperty("--tabster-root"); } else { element.style.setProperty("--tabster-root", id + ","); } } } } var RootDummyManager = class extends DummyInputManager { constructor(tabster, element, setFocused, sys) { super(tabster, element, DummyInputManagerPriorities.Root, sys, void 0, true); this._onDummyInputFocus = (dummyInput) => { var _a; if (dummyInput.useDefaultAction) { this._setFocused(false); } else { this._tabster.keyboardNavigation.setNavigatingWithKeyboard(true); const element2 = this._element.get(); if (element2) { this._setFocused(true); const toFocus = this._tabster.focusedElement.getFirstOrLastTabbable(dummyInput.isFirst, { container: element2, ignoreAccessibility: true }); if (toFocus) { nativeFocus(toFocus); return; } } (_a = dummyInput.input) === null || _a === void 0 ? void 0 : _a.blur(); } }; this._setHandlers(this._onDummyInputFocus); this._tabster = tabster; this._setFocused = setFocused; } }; var Root = class extends TabsterPart { constructor(tabster, element, onDispose, props, sys) { super(tabster, element, props); this._isFocused = false; this._setFocused = (hasFocused) => { var _a; if (this._setFocusedTimer) { this._tabster.getWindow().clearTimeout(this._setFocusedTimer); delete this._setFocusedTimer; } if (this._isFocused === hasFocused) { return; } const element2 = this._element.get(); if (element2) { if (hasFocused) { this._isFocused = true; (_a = this._dummyManager) === null || _a === void 0 ? void 0 : _a.setTabbable(false); element2.dispatchEvent(new RootFocusEvent({ element: element2 })); } else { this._setFocusedTimer = this._tabster.getWindow().setTimeout(() => { var _a2; delete this._setFocusedTimer; this._isFocused = false; (_a2 = this._dummyManager) === null || _a2 === void 0 ? void 0 : _a2.setTabbable(true); element2.dispatchEvent(new RootBlurEvent({ element: element2 })); }, 0); } } }; this._onFocusIn = (event) => { const getParent2 = this._tabster.getParent; const rootElement = this._element.get(); let curElement = event.composedPath()[0]; do { if (curElement === rootElement) { this._setFocused(true); return; } curElement = curElement && getParent2(curElement); } while (curElement); }; this._onFocusOut = () => { this._setFocused(false); }; this._onDispose = onDispose; const win = tabster.getWindow; this.uid = getElementUId(win, element); this._sys = sys; if (tabster.controlTab || tabster.rootDummyInputs) { this.addDummyInputs(); } const w = win(); const doc = w.document; doc.addEventListener(KEYBORG_FOCUSIN, this._onFocusIn); doc.addEventListener(KEYBORG_FOCUSOUT, this._onFocusOut); this._add(); } addDummyInputs() { if (!this._dummyManager) { this._dummyManager = new RootDummyManager(this._tabster, this._element, this._setFocused, this._sys); } } dispose() { var _a; this._onDispose(this); const win = this._tabster.getWindow(); const doc = win.document; doc.removeEventListener(KEYBORG_FOCUSIN, this._onFocusIn); doc.removeEventListener(KEYBORG_FOCUSOUT, this._onFocusOut); if (this._setFocusedTimer) { win.clearTimeout(this._setFocusedTimer); delete this._setFocusedTimer; } (_a = this._dummyManager) === null || _a === void 0 ? void 0 : _a.dispose(); this._remove(); } moveOutWithDefaultAction(isBackward, relatedEvent) { const dummyManager = this._dummyManager; if (dummyManager) { dummyManager.moveOutWithDefaultAction(isBackward, relatedEvent); } else { const el = this.getElement(); if (el) { RootDummyManager.moveWithPhantomDummy(this._tabster, el, true, isBackward, relatedEvent); } } } _add() { if (true) { _setInformativeStyle$3(this._element, false, this.uid); } } _remove() { if (true) { _setInformativeStyle$3(this._element, true); } } }; var RootAPI = class { constructor(tabster, autoRoot) { this._autoRootWaiting = false; this._roots = {}; this._forceDummy = false; this.rootById = {}; this._autoRootCreate = () => { var _a; const doc = this._win().document; const body = doc.body; if (body) { this._autoRootUnwait(doc); const props = this._autoRoot; if (props) { setTabsterAttribute(body, { root: props }, true); updateTabsterByAttribute(this._tabster, body); return (_a = getTabsterOnElement(this._tabster, body)) === null || _a === void 0 ? void 0 : _a.root; } } else if (!this._autoRootWaiting) { this._autoRootWaiting = true; doc.addEventListener("readystatechange", this._autoRootCreate); } return void 0; }; this._onRootDispose = (root) => { delete this._roots[root.id]; }; this._tabster = tabster; this._win = tabster.getWindow; this._autoRoot = autoRoot; tabster.queueInit(() => { if (this._autoRoot) { this._autoRootCreate(); } }); } _autoRootUnwait(doc) { doc.removeEventListener("readystatechange", this._autoRootCreate); this._autoRootWaiting = false; } dispose() { const win = this._win(); this._autoRootUnwait(win.document); delete this._autoRoot; Object.keys(this._roots).forEach((rootId) => { if (this._roots[rootId]) { this._roots[rootId].dispose(); delete this._roots[rootId]; } }); this.rootById = {}; } createRoot(element, props, sys) { if (true) ; const newRoot = new Root(this._tabster, element, this._onRootDispose, props, sys); this._roots[newRoot.id] = newRoot; if (this._forceDummy) { newRoot.addDummyInputs(); } return newRoot; } addDummyInputs() { this._forceDummy = true; const roots = this._roots; for (const id of Object.keys(roots)) { roots[id].addDummyInputs(); } } static getRootByUId(getWindow2, id) { const tabster = getWindow2().__tabsterInstance; return tabster && tabster.root.rootById[id]; } /** * Fetches the tabster context for an element walking up its ancestors * * @param tabster Tabster instance * @param element The element the tabster context should represent * @param options Additional options * @returns undefined if the element is not a child of a tabster root, otherwise all applicable tabster behaviours and configurations */ static getTabsterContext(tabster, element, options = {}) { var _a, _b, _c, _d; if (!element.ownerDocument) { return void 0; } const { checkRtl, referenceElement } = options; const getParent2 = tabster.getParent; tabster.drainInitQueue(); let root; let modalizer; let groupper; let mover; let excludedFromMover = false; let groupperBeforeMover; let modalizerInGroupper; let dirRightToLeft; let uncontrolled; let curElement = referenceElement || element; const ignoreKeydown = {}; while (curElement && (!root || checkRtl)) { const tabsterOnElement = getTabsterOnElement(tabster, curElement); if (checkRtl && dirRightToLeft === void 0) { const dir = curElement.dir; if (dir) { dirRightToLeft = dir.toLowerCase() === "rtl"; } } if (!tabsterOnElement) { curElement = getParent2(curElement); continue; } const tagName = curElement.tagName; if ((tabsterOnElement.uncontrolled || tagName === "IFRAME" || tagName === "WEBVIEW") && tabster.focusable.isVisible(curElement)) { uncontrolled = curElement; } if (!mover && ((_a = tabsterOnElement.focusable) === null || _a === void 0 ? void 0 : _a.excludeFromMover) && !groupper) { excludedFromMover = true; } const curModalizer = tabsterOnElement.modalizer; const curGroupper = tabsterOnElement.groupper; const curMover = tabsterOnElement.mover; if (!modalizer && curModalizer) { modalizer = curModalizer; } if (!groupper && curGroupper && (!modalizer || curModalizer)) { if (modalizer) { if (!curGroupper.isActive() && curGroupper.getProps().tabbability && modalizer.userId !== ((_b = tabster.modalizer) === null || _b === void 0 ? void 0 : _b.activeId)) { modalizer = void 0; groupper = curGroupper; } modalizerInGroupper = curGroupper; } else { groupper = curGroupper; } } if (!mover && curMover && (!modalizer || curModalizer) && (!curGroupper || curElement !== element) && curElement.contains(element)) { mover = curMover; groupperBeforeMover = !!groupper && groupper !== curGroupper; } if (tabsterOnElement.root) { root = tabsterOnElement.root; } if ((_c = tabsterOnElement.focusable) === null || _c === void 0 ? void 0 : _c.ignoreKeydown) { Object.assign(ignoreKeydown, tabsterOnElement.focusable.ignoreKeydown); } curElement = getParent2(curElement); } if (!root) { const rootAPI = tabster.root; const autoRoot = rootAPI._autoRoot; if (autoRoot) { if ((_d = element.ownerDocument) === null || _d === void 0 ? void 0 : _d.body) { root = rootAPI._autoRootCreate(); } } } if (groupper && !mover) { groupperBeforeMover = true; } if (!root) { if (modalizer || groupper || mover) { console.error("Tabster Root is required for Mover, Groupper and Modalizer to work."); } } const shouldIgnoreKeydown = (event) => !!ignoreKeydown[event.key]; return root ? { root, modalizer, groupper, mover, groupperBeforeMover, modalizerInGroupper, rtl: checkRtl ? !!dirRightToLeft : void 0, uncontrolled, excludedFromMover, ignoreKeydown: shouldIgnoreKeydown } : void 0; } static getRoot(tabster, element) { var _a; const getParent2 = tabster.getParent; for (let el = element; el; el = getParent2(el)) { const root = (_a = getTabsterOnElement(tabster, el)) === null || _a === void 0 ? void 0 : _a.root; if (root) { return root; } } return void 0; } onRoot(root, removed) { if (removed) { delete this.rootById[root.uid]; } else { this.rootById[root.uid] = root; } } }; var Subscribable = class { constructor() { this._callbacks = []; } dispose() { this._callbacks = []; delete this._val; } subscribe(callback) { const callbacks = this._callbacks; const index = callbacks.indexOf(callback); if (index < 0) { callbacks.push(callback); } } subscribeFirst(callback) { const callbacks = this._callbacks; const index = callbacks.indexOf(callback); if (index >= 0) { callbacks.splice(index, 1); } callbacks.unshift(callback); } unsubscribe(callback) { const index = this._callbacks.indexOf(callback); if (index >= 0) { this._callbacks.splice(index, 1); } } setVal(val, detail) { if (this._val === val) { return; } this._val = val; this._callCallbacks(val, detail); } getVal() { return this._val; } trigger(val, detail) { this._callCallbacks(val, detail); } _callCallbacks(val, detail) { this._callbacks.forEach((callback) => callback(val, detail)); } }; var FocusableAPI = class { constructor(tabster) { this._tabster = tabster; } dispose() { } getProps(element) { const tabsterOnElement = getTabsterOnElement(this._tabster, element); return tabsterOnElement && tabsterOnElement.focusable || {}; } isFocusable(el, includeProgrammaticallyFocusable, noVisibleCheck, noAccessibleCheck) { if (matchesSelector(el, FOCUSABLE_SELECTOR) && (includeProgrammaticallyFocusable || el.tabIndex !== -1)) { return (noVisibleCheck || this.isVisible(el)) && (noAccessibleCheck || this.isAccessible(el)); } return false; } isVisible(el) { if (!el.ownerDocument || el.nodeType !== Node.ELEMENT_NODE) { return false; } if (isDisplayNone(el)) { return false; } const rect = el.ownerDocument.body.getBoundingClientRect(); if (rect.width === 0 && rect.height === 0) { return false; } return true; } isAccessible(el) { var _a; for (let e = el; e; e = dom.getParentElement(e)) { const tabsterOnElement = getTabsterOnElement(this._tabster, e); if (this._isHidden(e)) { return false; } const ignoreDisabled = (_a = tabsterOnElement === null || tabsterOnElement === void 0 ? void 0 : tabsterOnElement.focusable) === null || _a === void 0 ? void 0 : _a.ignoreAriaDisabled; if (!ignoreDisabled && this._isDisabled(e)) { return false; } } return true; } _isDisabled(el) { return el.hasAttribute("disabled"); } _isHidden(el) { var _a; const attrVal = el.getAttribute("aria-hidden"); if (attrVal && attrVal.toLowerCase() === "true") { if (!((_a = this._tabster.modalizer) === null || _a === void 0 ? void 0 : _a.isAugmented(el))) { return true; } } return false; } findFirst(options, out) { return this.findElement({ ...options }, out); } findLast(options, out) { return this.findElement({ isBackward: true, ...options }, out); } findNext(options, out) { return this.findElement({ ...options }, out); } findPrev(options, out) { return this.findElement({ ...options, isBackward: true }, out); } findDefault(options, out) { return this.findElement({ ...options, acceptCondition: (el) => this.isFocusable(el, options.includeProgrammaticallyFocusable) && !!this.getProps(el).isDefault }, out) || null; } findAll(options) { return this._findElements(true, options) || []; } findElement(options, out) { const found = this._findElements(false, options, out); return found ? found[0] : found; } _findElements(isFindAll, options, out) { var _a, _b, _c; const { container, currentElement = null, includeProgrammaticallyFocusable, useActiveModalizer, ignoreAccessibility, modalizerId, isBackward, onElement } = options; if (!out) { out = {}; } const elements = []; let { acceptCondition } = options; const hasCustomCondition = !!acceptCondition; if (!container) { return null; } if (!acceptCondition) { acceptCondition = (el) => this.isFocusable(el, includeProgrammaticallyFocusable, false, ignoreAccessibility); } const acceptElementState = { container, modalizerUserId: modalizerId === void 0 && useActiveModalizer ? (_a = this._tabster.modalizer) === null || _a === void 0 ? void 0 : _a.activeId : modalizerId || ((_c = (_b = RootAPI.getTabsterContext(this._tabster, container)) === null || _b === void 0 ? void 0 : _b.modalizer) === null || _c === void 0 ? void 0 : _c.userId), from: currentElement || container, isBackward, isFindAll, acceptCondition, hasCustomCondition, includeProgrammaticallyFocusable, ignoreAccessibility, cachedGrouppers: {}, cachedRadioGroups: {} }; const walker = createElementTreeWalker(container.ownerDocument, container, (node) => this._acceptElement(node, acceptElementState)); if (!walker) { return null; } const prepareForNextElement = (shouldContinueIfNotFound) => { var _a2, _b2; const foundElement = (_a2 = acceptElementState.foundElement) !== null && _a2 !== void 0 ? _a2 : acceptElementState.foundBackward; if (foundElement) { elements.push(foundElement); } if (isFindAll) { if (foundElement) { acceptElementState.found = false; delete acceptElementState.foundElement; delete acceptElementState.foundBackward; delete acceptElementState.fromCtx; acceptElementState.from = foundElement; if (onElement && !onElement(foundElement)) { return false; } } return !!(foundElement || shouldContinueIfNotFound); } else { if (foundElement && out) { out.uncontrolled = (_b2 = RootAPI.getTabsterContext(this._tabster, foundElement)) === null || _b2 === void 0 ? void 0 : _b2.uncontrolled; } return !!(shouldContinueIfNotFound && !foundElement); } }; if (!currentElement) { out.outOfDOMOrder = true; } if (currentElement && dom.nodeContains(container, currentElement)) { walker.currentNode = currentElement; } else if (isBackward) { const lastChild = getLastChild$2(container); if (!lastChild) { return null; } if (this._acceptElement(lastChild, acceptElementState) === NodeFilter.FILTER_ACCEPT && !prepareForNextElement(true)) { if (acceptElementState.skippedFocusable) { out.outOfDOMOrder = true; } return elements; } walker.currentNode = lastChild; } do { if (isBackward) { walker.previousNode(); } else { walker.nextNode(); } } while (prepareForNextElement()); if (acceptElementState.skippedFocusable) { out.outOfDOMOrder = true; } return elements.length ? elements : null; } _acceptElement(element, state) { var _a, _b, _c; if (state.found) { return NodeFilter.FILTER_ACCEPT; } const foundBackward = state.foundBackward; if (foundBackward && (element === foundBackward || !dom.nodeContains(foundBackward, element))) { state.found = true; state.foundElement = foundBackward; return NodeFilter.FILTER_ACCEPT; } const container = state.container; if (element === container) { return NodeFilter.FILTER_SKIP; } if (!dom.nodeContains(container, element)) { return NodeFilter.FILTER_REJECT; } if (getDummyInputContainer(element)) { return NodeFilter.FILTER_REJECT; } if (dom.nodeContains(state.rejectElementsFrom, element)) { return NodeFilter.FILTER_REJECT; } const ctx = state.currentCtx = RootAPI.getTabsterContext(this._tabster, element); if (!ctx) { return NodeFilter.FILTER_SKIP; } if (shouldIgnoreFocus(element)) { if (this.isFocusable(element, void 0, true, true)) { state.skippedFocusable = true; } return NodeFilter.FILTER_SKIP; } if (!state.hasCustomCondition && (element.tagName === "IFRAME" || element.tagName === "WEBVIEW")) { if (this.isVisible(element) && ((_a = ctx.modalizer) === null || _a === void 0 ? void 0 : _a.userId) === ((_b = this._tabster.modalizer) === null || _b === void 0 ? void 0 : _b.activeId)) { state.found = true; state.rejectElementsFrom = state.foundElement = element; return NodeFilter.FILTER_ACCEPT; } else { return NodeFilter.FILTER_REJECT; } } if (!state.ignoreAccessibility && !this.isAccessible(element)) { if (this.isFocusable(element, false, true, true)) { state.skippedFocusable = true; } return NodeFilter.FILTER_REJECT; } let result; let fromCtx = state.fromCtx; if (!fromCtx) { fromCtx = state.fromCtx = RootAPI.getTabsterContext(this._tabster, state.from); } const fromMover = fromCtx === null || fromCtx === void 0 ? void 0 : fromCtx.mover; let groupper = ctx.groupper; let mover = ctx.mover; result = (_c = this._tabster.modalizer) === null || _c === void 0 ? void 0 : _c.acceptElement(element, state); if (result !== void 0) { state.skippedFocusable = true; } if (result === void 0 && (groupper || mover || fromMover)) { const groupperElement = groupper === null || groupper === void 0 ? void 0 : groupper.getElement(); const fromMoverElement = fromMover === null || fromMover === void 0 ? void 0 : fromMover.getElement(); let moverElement = mover === null || mover === void 0 ? void 0 : mover.getElement(); if (moverElement && dom.nodeContains(fromMoverElement, moverElement) && dom.nodeContains(container, fromMoverElement) && (!groupperElement || !mover || dom.nodeContains(fromMoverElement, groupperElement))) { mover = fromMover; moverElement = fromMoverElement; } if (groupperElement) { if (groupperElement === container || !dom.nodeContains(container, groupperElement)) { groupper = void 0; } else if (!dom.nodeContains(groupperElement, element)) { return NodeFilter.FILTER_REJECT; } } if (moverElement) { if (!dom.nodeContains(container, moverElement)) { mover = void 0; } else if (!dom.nodeContains(moverElement, element)) { return NodeFilter.FILTER_REJECT; } } if (groupper && mover) { if (moverElement && groupperElement && !dom.nodeContains(groupperElement, moverElement)) { mover = void 0; } else { groupper = void 0; } } if (groupper) { result = groupper.acceptElement(element, state); } if (mover) { result = mover.acceptElement(element, state); } } if (result === void 0) { result = state.acceptCondition(element) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; if (result === NodeFilter.FILTER_SKIP && this.isFocusable(element, false, true, true)) { state.skippedFocusable = true; } } if (result === NodeFilter.FILTER_ACCEPT && !state.found) { if (!state.isFindAll && isRadio(element) && !element.checked) { const radioGroupName = element.name; let radioGroup = state.cachedRadioGroups[radioGroupName]; if (!radioGroup) { radioGroup = getRadioButtonGroup(element); if (radioGroup) { state.cachedRadioGroups[radioGroupName] = radioGroup; } } if ((radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.checked) && radioGroup.checked !== element) { return NodeFilter.FILTER_SKIP; } } if (state.isBackward) { state.foundBackward = element; result = NodeFilter.FILTER_SKIP; } else { state.found = true; state.foundElement = element; } } return result; } }; var Keys = { Tab: "Tab", Enter: "Enter", Escape: "Escape", PageUp: "PageUp", PageDown: "PageDown", End: "End", Home: "Home", ArrowLeft: "ArrowLeft", ArrowUp: "ArrowUp", ArrowRight: "ArrowRight", ArrowDown: "ArrowDown" }; function getUncontrolledCompletelyContainer(tabster, element) { var _a; const getParent2 = tabster.getParent; let el = element; do { const uncontrolledOnElement = (_a = getTabsterOnElement(tabster, el)) === null || _a === void 0 ? void 0 : _a.uncontrolled; if (uncontrolledOnElement && tabster.uncontrolled.isUncontrolledCompletely(el, !!uncontrolledOnElement.completely)) { return el; } el = getParent2(el); } while (el); return void 0; } var AsyncFocusIntentPriorityBySource = { [AsyncFocusSources.Restorer]: 0, [AsyncFocusSources.Deloser]: 1, [AsyncFocusSources.EscapeGroupper]: 2 }; var FocusedElementState = class _FocusedElementState extends Subscribable { constructor(tabster, getWindow2) { super(); this._init = () => { const win = this._win(); const doc = win.document; doc.addEventListener(KEYBORG_FOCUSIN, this._onFocusIn, true); doc.addEventListener(KEYBORG_FOCUSOUT, this._onFocusOut, true); win.addEventListener("keydown", this._onKeyDown, true); const activeElement = dom.getActiveElement(doc); if (activeElement && activeElement !== doc.body) { this._setFocusedElement(activeElement); } this.subscribe(this._onChanged); }; this._onFocusIn = (e) => { const target = e.composedPath()[0]; if (target) { this._setFocusedElement(target, e.detail.relatedTarget, e.detail.isFocusedProgrammatically); } }; this._onFocusOut = (e) => { var _a; this._setFocusedElement(void 0, (_a = e.detail) === null || _a === void 0 ? void 0 : _a.originalEvent.relatedTarget); }; this._validateFocusedElement = (element) => { }; this._onKeyDown = (event) => { if (event.key !== Keys.Tab || event.ctrlKey) { return; } const currentElement = this.getVal(); if (!currentElement || !currentElement.ownerDocument || currentElement.contentEditable === "true") { return; } const tabster2 = this._tabster; const controlTab = tabster2.controlTab; const ctx = RootAPI.getTabsterContext(tabster2, currentElement); if (!ctx || ctx.ignoreKeydown(event)) { return; } const isBackward = event.shiftKey; const next = _FocusedElementState.findNextTabbable(tabster2, ctx, void 0, currentElement, void 0, isBackward, true); const rootElement = ctx.root.getElement(); if (!rootElement) { return; } const nextElement = next === null || next === void 0 ? void 0 : next.element; const uncontrolledCompletelyContainer = getUncontrolledCompletelyContainer(tabster2, currentElement); if (nextElement) { const nextUncontrolled = next.uncontrolled; if (ctx.uncontrolled || dom.nodeContains(nextUncontrolled, currentElement)) { if (!next.outOfDOMOrder && nextUncontrolled === ctx.uncontrolled || uncontrolledCompletelyContainer && !dom.nodeContains(uncontrolledCompletelyContainer, nextElement)) { return; } DummyInputManager.addPhantomDummyWithTarget(tabster2, currentElement, isBackward, nextElement); return; } if (nextUncontrolled && tabster2.focusable.isVisible(nextUncontrolled) || nextElement.tagName === "IFRAME" && tabster2.focusable.isVisible(nextElement)) { if (rootElement.dispatchEvent(new TabsterMoveFocusEvent({ by: "root", owner: rootElement, next: nextElement, relatedEvent: event }))) { DummyInputManager.moveWithPhantomDummy(tabster2, nextUncontrolled !== null && nextUncontrolled !== void 0 ? nextUncontrolled : nextElement, false, isBackward, event); } return; } if (controlTab || (next === null || next === void 0 ? void 0 : next.outOfDOMOrder)) { if (rootElement.dispatchEvent(new TabsterMoveFocusEvent({ by: "root", owner: rootElement, next: nextElement, relatedEvent: event }))) { event.preventDefault(); event.stopImmediatePropagation(); nativeFocus(nextElement); } } } else { if (!uncontrolledCompletelyContainer && rootElement.dispatchEvent(new TabsterMoveFocusEvent({ by: "root", owner: rootElement, next: null, relatedEvent: event }))) { ctx.root.moveOutWithDefaultAction(isBackward, event); } } }; this._onChanged = (element, detail) => { var _a, _b; if (element) { element.dispatchEvent(new TabsterFocusInEvent(detail)); } else { const last = (_a = this._lastVal) === null || _a === void 0 ? void 0 : _a.get(); if (last) { const d = { ...detail }; const lastCtx = RootAPI.getTabsterContext(this._tabster, last); const modalizerId = (_b = lastCtx === null || lastCtx === void 0 ? void 0 : lastCtx.modalizer) === null || _b === void 0 ? void 0 : _b.userId; if (modalizerId) { d.modalizerId = modalizerId; } last.dispatchEvent(new TabsterFocusOutEvent(d)); } } }; this._tabster = tabster; this._win = getWindow2; tabster.queueInit(this._init); } dispose() { super.dispose(); const win = this._win(); const doc = win.document; doc.removeEventListener(KEYBORG_FOCUSIN, this._onFocusIn, true); doc.removeEventListener(KEYBORG_FOCUSOUT, this._onFocusOut, true); win.removeEventListener("keydown", this._onKeyDown, true); this.unsubscribe(this._onChanged); const asyncFocus = this._asyncFocus; if (asyncFocus) { win.clearTimeout(asyncFocus.timeout); delete this._asyncFocus; } delete _FocusedElementState._lastResetElement; delete this._nextVal; delete this._lastVal; } static forgetMemorized(instance, parent2) { var _a, _b; let wel = _FocusedElementState._lastResetElement; let el = wel && wel.get(); if (el && dom.nodeContains(parent2, el)) { delete _FocusedElementState._lastResetElement; } el = (_b = (_a = instance._nextVal) === null || _a === void 0 ? void 0 : _a.element) === null || _b === void 0 ? void 0 : _b.get(); if (el && dom.nodeContains(parent2, el)) { delete instance._nextVal; } wel = instance._lastVal; el = wel && wel.get(); if (el && dom.nodeContains(parent2, el)) { delete instance._lastVal; } } getFocusedElement() { return this.getVal(); } getLastFocusedElement() { var _a; let el = (_a = this._lastVal) === null || _a === void 0 ? void 0 : _a.get(); if (!el || el && !documentContains(el.ownerDocument, el)) { this._lastVal = el = void 0; } return el; } focus(element, noFocusedProgrammaticallyFlag, noAccessibleCheck, preventScroll) { if (!this._tabster.focusable.isFocusable(element, noFocusedProgrammaticallyFlag, false, noAccessibleCheck)) { return false; } element.focus({ preventScroll }); return true; } focusDefault(container) { const el = this._tabster.focusable.findDefault({ container }); if (el) { this._tabster.focusedElement.focus(el); return true; } return false; } getFirstOrLastTabbable(isFirst, props) { var _a; const { container, ignoreAccessibility } = props; let toFocus; if (container) { const ctx = RootAPI.getTabsterContext(this._tabster, container); if (ctx) { toFocus = (_a = _FocusedElementState.findNextTabbable(this._tabster, ctx, container, void 0, void 0, !isFirst, ignoreAccessibility)) === null || _a === void 0 ? void 0 : _a.element; } } if (toFocus && !dom.nodeContains(container, toFocus)) { toFocus = void 0; } return toFocus || void 0; } _focusFirstOrLast(isFirst, props) { const toFocus = this.getFirstOrLastTabbable(isFirst, props); if (toFocus) { this.focus(toFocus, false, true); return true; } return false; } focusFirst(props) { return this._focusFirstOrLast(true, props); } focusLast(props) { return this._focusFirstOrLast(false, props); } resetFocus(container) { if (!this._tabster.focusable.isVisible(container)) { return false; } if (!this._tabster.focusable.isFocusable(container, true, true, true)) { const prevTabIndex = container.getAttribute("tabindex"); const prevAriaHidden = container.getAttribute("aria-hidden"); container.tabIndex = -1; container.setAttribute("aria-hidden", "true"); _FocusedElementState._lastResetElement = new WeakHTMLElement(this._win, container); this.focus(container, true, true); this._setOrRemoveAttribute(container, "tabindex", prevTabIndex); this._setOrRemoveAttribute(container, "aria-hidden", prevAriaHidden); } else { this.focus(container); } return true; } requestAsyncFocus(source, callback, delay) { const win = this._tabster.getWindow(); const currentAsyncFocus = this._asyncFocus; if (currentAsyncFocus) { if (AsyncFocusIntentPriorityBySource[source] > AsyncFocusIntentPriorityBySource[currentAsyncFocus.source]) { return; } win.clearTimeout(currentAsyncFocus.timeout); } this._asyncFocus = { source, callback, timeout: win.setTimeout(() => { this._asyncFocus = void 0; callback(); }, delay) }; } cancelAsyncFocus(source) { const asyncFocus = this._asyncFocus; if ((asyncFocus === null || asyncFocus === void 0 ? void 0 : asyncFocus.source) === source) { this._tabster.getWindow().clearTimeout(asyncFocus.timeout); this._asyncFocus = void 0; } } _setOrRemoveAttribute(element, name, value) { if (value === null) { element.removeAttribute(name); } else { element.setAttribute(name, value); } } _setFocusedElement(element, relatedTarget, isFocusedProgrammatically) { var _a, _b; if (this._tabster._noop) { return; } const detail = { relatedTarget }; if (element) { const lastResetElement = (_a = _FocusedElementState._lastResetElement) === null || _a === void 0 ? void 0 : _a.get(); _FocusedElementState._lastResetElement = void 0; if (lastResetElement === element || shouldIgnoreFocus(element)) { return; } detail.isFocusedProgrammatically = isFocusedProgrammatically; const ctx = RootAPI.getTabsterContext(this._tabster, element); const modalizerId = (_b = ctx === null || ctx === void 0 ? void 0 : ctx.modalizer) === null || _b === void 0 ? void 0 : _b.userId; if (modalizerId) { detail.modalizerId = modalizerId; } } const nextVal = this._nextVal = { element: element ? new WeakHTMLElement(this._win, element) : void 0, detail }; if (element && element !== this._val) { this._validateFocusedElement(element); } if (this._nextVal === nextVal) { this.setVal(element, detail); } this._nextVal = void 0; } setVal(val, detail) { super.setVal(val, detail); if (val) { this._lastVal = new WeakHTMLElement(this._win, val); } } static findNextTabbable(tabster, ctx, container, currentElement, referenceElement, isBackward, ignoreAccessibility) { const actualContainer = container || ctx.root.getElement(); if (!actualContainer) { return null; } let next = null; const isTabbingTimer = _FocusedElementState._isTabbingTimer; const win = tabster.getWindow(); if (isTabbingTimer) { win.clearTimeout(isTabbingTimer); } _FocusedElementState.isTabbing = true; _FocusedElementState._isTabbingTimer = win.setTimeout(() => { delete _FocusedElementState._isTabbingTimer; _FocusedElementState.isTabbing = false; }, 0); const modalizer = ctx.modalizer; const groupper = ctx.groupper; const mover = ctx.mover; const callFindNext = (what) => { next = what.findNextTabbable(currentElement, referenceElement, isBackward, ignoreAccessibility); if (currentElement && !(next === null || next === void 0 ? void 0 : next.element)) { const parentElement2 = what !== modalizer && dom.getParentElement(what.getElement()); if (parentElement2) { const parentCtx = RootAPI.getTabsterContext(tabster, currentElement, { referenceElement: parentElement2 }); if (parentCtx) { const currentScopeElement = what.getElement(); const newCurrent = isBackward ? currentScopeElement : currentScopeElement && getLastChild$2(currentScopeElement) || currentScopeElement; if (newCurrent) { next = _FocusedElementState.findNextTabbable(tabster, parentCtx, container, newCurrent, parentElement2, isBackward, ignoreAccessibility); if (next) { next.outOfDOMOrder = true; } } } } } }; if (groupper && mover) { callFindNext(ctx.groupperBeforeMover ? groupper : mover); } else if (groupper) { callFindNext(groupper); } else if (mover) { callFindNext(mover); } else if (modalizer) { callFindNext(modalizer); } else { const findProps = { container: actualContainer, currentElement, referenceElement, ignoreAccessibility, useActiveModalizer: true }; const findPropsOut = {}; const nextElement = tabster.focusable[isBackward ? "findPrev" : "findNext"](findProps, findPropsOut); next = { element: nextElement, outOfDOMOrder: findPropsOut.outOfDOMOrder, uncontrolled: findPropsOut.uncontrolled }; } return next; } }; FocusedElementState.isTabbing = false; var GroupperDummyManager = class extends DummyInputManager { constructor(element, groupper, tabster, sys) { super(tabster, element, DummyInputManagerPriorities.Groupper, sys, true); this._setHandlers((dummyInput, isBackward, relatedTarget) => { var _a, _b; const container = element.get(); const input = dummyInput.input; if (container && input) { const ctx = RootAPI.getTabsterContext(tabster, input); if (ctx) { let next; next = (_a = groupper.findNextTabbable(relatedTarget || void 0, void 0, isBackward, true)) === null || _a === void 0 ? void 0 : _a.element; if (!next) { next = (_b = FocusedElementState.findNextTabbable(tabster, ctx, void 0, dummyInput.isOutside ? input : getAdjacentElement(container, !isBackward), void 0, isBackward, true)) === null || _b === void 0 ? void 0 : _b.element; } if (next) { nativeFocus(next); } } } }); } }; var Groupper = class extends TabsterPart { constructor(tabster, element, onDispose, props, sys) { super(tabster, element, props); this._shouldTabInside = false; this.makeTabbable(false); this._onDispose = onDispose; if (!tabster.controlTab) { this.dummyManager = new GroupperDummyManager(this._element, this, tabster, sys); } } dispose() { var _a; this._onDispose(this); const element = this._element.get(); (_a = this.dummyManager) === null || _a === void 0 ? void 0 : _a.dispose(); delete this.dummyManager; if (element) { if (true) { _setInformativeStyle$1(this._element, true); } } delete this._first; } findNextTabbable(currentElement, referenceElement, isBackward, ignoreAccessibility) { const groupperElement = this.getElement(); if (!groupperElement) { return null; } const currentIsDummy = getDummyInputContainer(currentElement) === groupperElement; if (!this._shouldTabInside && currentElement && dom.nodeContains(groupperElement, currentElement) && !currentIsDummy) { return { element: void 0, outOfDOMOrder: true }; } const groupperFirstFocusable = this.getFirst(true); if (!currentElement || !dom.nodeContains(groupperElement, currentElement) || currentIsDummy) { return { element: groupperFirstFocusable, outOfDOMOrder: true }; } const tabster = this._tabster; let next = null; let outOfDOMOrder = false; let uncontrolled; if (this._shouldTabInside && groupperFirstFocusable) { const findProps = { container: groupperElement, currentElement, referenceElement, ignoreAccessibility, useActiveModalizer: true }; const findPropsOut = {}; next = tabster.focusable[isBackward ? "findPrev" : "findNext"](findProps, findPropsOut); outOfDOMOrder = !!findPropsOut.outOfDOMOrder; if (!next && this._props.tabbability === GroupperTabbabilities.LimitedTrapFocus) { next = tabster.focusable[isBackward ? "findLast" : "findFirst"]({ container: groupperElement, ignoreAccessibility, useActiveModalizer: true }, findPropsOut); outOfDOMOrder = true; } uncontrolled = findPropsOut.uncontrolled; } return { element: next, uncontrolled, outOfDOMOrder }; } makeTabbable(isTabbable) { this._shouldTabInside = isTabbable || !this._props.tabbability; if (true) { _setInformativeStyle$1(this._element, !this._shouldTabInside); } } isActive(noIfFirstIsFocused) { var _a; const element = this.getElement() || null; let isParentActive = true; for (let e = dom.getParentElement(element); e; e = dom.getParentElement(e)) { const g = (_a = getTabsterOnElement(this._tabster, e)) === null || _a === void 0 ? void 0 : _a.groupper; if (g) { if (!g._shouldTabInside) { isParentActive = false; } } } let ret = isParentActive ? this._props.tabbability ? this._shouldTabInside : false : void 0; if (ret && noIfFirstIsFocused) { const focused = this._tabster.focusedElement.getFocusedElement(); if (focused) { ret = focused !== this.getFirst(true); } } return ret; } getFirst(orContainer) { var _a; const groupperElement = this.getElement(); let first; if (groupperElement) { if (orContainer && this._tabster.focusable.isFocusable(groupperElement)) { return groupperElement; } first = (_a = this._first) === null || _a === void 0 ? void 0 : _a.get(); if (!first) { first = this._tabster.focusable.findFirst({ container: groupperElement, useActiveModalizer: true }) || void 0; if (first) { this.setFirst(first); } } } return first; } setFirst(element) { if (element) { this._first = new WeakHTMLElement(this._tabster.getWindow, element); } else { delete this._first; } } acceptElement(element, state) { const cachedGrouppers = state.cachedGrouppers; const parentElement2 = dom.getParentElement(this.getElement()); const parentCtx = parentElement2 && RootAPI.getTabsterContext(this._tabster, parentElement2); const parentCtxGroupper = parentCtx === null || parentCtx === void 0 ? void 0 : parentCtx.groupper; const parentGroupper = (parentCtx === null || parentCtx === void 0 ? void 0 : parentCtx.groupperBeforeMover) ? parentCtxGroupper : void 0; let parentGroupperElement; const getIsActive = (groupper) => { let cached = cachedGrouppers[groupper.id]; let isActive2; if (cached) { isActive2 = cached.isActive; } else { isActive2 = this.isActive(true); cached = cachedGrouppers[groupper.id] = { isActive: isActive2 }; } return isActive2; }; if (parentGroupper) { parentGroupperElement = parentGroupper.getElement(); if (!getIsActive(parentGroupper) && parentGroupperElement && state.container !== parentGroupperElement && dom.nodeContains(state.container, parentGroupperElement)) { state.skippedFocusable = true; return NodeFilter.FILTER_REJECT; } } const isActive = getIsActive(this); const groupperElement = this.getElement(); if (groupperElement) { if (isActive !== true) { if (groupperElement === element && parentCtxGroupper) { if (!parentGroupperElement) { parentGroupperElement = parentCtxGroupper.getElement(); } if (parentGroupperElement && !getIsActive(parentCtxGroupper) && dom.nodeContains(state.container, parentGroupperElement) && parentGroupperElement !== state.container) { state.skippedFocusable = true; return NodeFilter.FILTER_REJECT; } } if (groupperElement !== element && dom.nodeContains(groupperElement, element)) { state.skippedFocusable = true; return NodeFilter.FILTER_REJECT; } const cached = cachedGrouppers[this.id]; let first; if ("first" in cached) { first = cached.first; } else { first = cached.first = this.getFirst(true); } if (first && state.acceptCondition(first)) { state.rejectElementsFrom = groupperElement; state.skippedFocusable = true; if (first !== state.from) { state.found = true; state.foundElement = first; return NodeFilter.FILTER_ACCEPT; } else { return NodeFilter.FILTER_REJECT; } } } } return void 0; } }; var GroupperAPI = class { constructor(tabster, getWindow2) { this._current = {}; this._grouppers = {}; this._init = () => { const win = this._win(); this._tabster.focusedElement.subscribeFirst(this._onFocus); const doc = win.document; const activeElement = dom.getActiveElement(doc); if (activeElement) { this._onFocus(activeElement); } doc.addEventListener("mousedown", this._onMouseDown, true); win.addEventListener("keydown", this._onKeyDown, true); win.addEventListener(GroupperMoveFocusEventName, this._onMoveFocus); }; this._onGroupperDispose = (groupper) => { delete this._grouppers[groupper.id]; }; this._onFocus = (element) => { if (element) { this._updateCurrent(element); } }; this._onMouseDown = (e) => { let target = e.target; while (target && !this._tabster.focusable.isFocusable(target)) { target = this._tabster.getParent(target); } if (target) { this._updateCurrent(target); } }; this._onKeyDown = (event) => { if (event.key !== Keys.Enter && event.key !== Keys.Escape) { return; } if (event.ctrlKey || event.altKey || event.shiftKey || event.metaKey) { return; } const element = this._tabster.focusedElement.getFocusedElement(); if (element) { this.handleKeyPress(element, event); } }; this._onMoveFocus = (e) => { var _a; const element = e.composedPath()[0]; const action = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.action; if (element && action !== void 0 && !e.defaultPrevented) { if (action === GroupperMoveFocusActions.Enter) { this._enterGroupper(element); } else { this._escapeGroupper(element); } e.stopImmediatePropagation(); } }; this._tabster = tabster; this._win = getWindow2; tabster.queueInit(this._init); } dispose() { const win = this._win(); this._tabster.focusedElement.cancelAsyncFocus(AsyncFocusSources.EscapeGroupper); this._current = {}; if (this._updateTimer) { win.clearTimeout(this._updateTimer); delete this._updateTimer; } this._tabster.focusedElement.unsubscribe(this._onFocus); win.document.removeEventListener("mousedown", this._onMouseDown, true); win.removeEventListener("keydown", this._onKeyDown, true); win.removeEventListener(GroupperMoveFocusEventName, this._onMoveFocus); Object.keys(this._grouppers).forEach((groupperId) => { if (this._grouppers[groupperId]) { this._grouppers[groupperId].dispose(); delete this._grouppers[groupperId]; } }); } createGroupper(element, props, sys) { if (true) ; const tabster = this._tabster; const newGroupper = new Groupper(tabster, element, this._onGroupperDispose, props, sys); this._grouppers[newGroupper.id] = newGroupper; const focusedElement = tabster.focusedElement.getFocusedElement(); if (focusedElement && dom.nodeContains(element, focusedElement) && !this._updateTimer) { this._updateTimer = this._win().setTimeout(() => { delete this._updateTimer; if (focusedElement === tabster.focusedElement.getFocusedElement()) { this._updateCurrent(focusedElement); } }, 0); } return newGroupper; } forgetCurrentGrouppers() { this._current = {}; } _updateCurrent(element) { var _a; if (this._updateTimer) { this._win().clearTimeout(this._updateTimer); delete this._updateTimer; } const tabster = this._tabster; const newIds = {}; for (let el = tabster.getParent(element); el; el = tabster.getParent(el)) { const groupper = (_a = getTabsterOnElement(tabster, el)) === null || _a === void 0 ? void 0 : _a.groupper; if (groupper) { newIds[groupper.id] = true; this._current[groupper.id] = groupper; const isTabbable = groupper.isActive() || element !== el && (!groupper.getProps().delegated || groupper.getFirst(false) !== element); groupper.makeTabbable(isTabbable); } } for (const id of Object.keys(this._current)) { const groupper = this._current[id]; if (!(groupper.id in newIds)) { groupper.makeTabbable(false); groupper.setFirst(void 0); delete this._current[id]; } } } _enterGroupper(element, relatedEvent) { const tabster = this._tabster; const ctx = RootAPI.getTabsterContext(tabster, element); const groupper = (ctx === null || ctx === void 0 ? void 0 : ctx.groupper) || (ctx === null || ctx === void 0 ? void 0 : ctx.modalizerInGroupper); const groupperElement = groupper === null || groupper === void 0 ? void 0 : groupper.getElement(); if (groupper && groupperElement && (element === groupperElement || groupper.getProps().delegated && element === groupper.getFirst(false))) { const next = tabster.focusable.findNext({ container: groupperElement, currentElement: element, useActiveModalizer: true }); if (next && (!relatedEvent || relatedEvent && groupperElement.dispatchEvent(new TabsterMoveFocusEvent({ by: "groupper", owner: groupperElement, next, relatedEvent })))) { if (relatedEvent) { relatedEvent.preventDefault(); relatedEvent.stopImmediatePropagation(); } next.focus(); return next; } } return null; } _escapeGroupper(element, relatedEvent, fromModalizer) { const tabster = this._tabster; const ctx = RootAPI.getTabsterContext(tabster, element); let groupper = (ctx === null || ctx === void 0 ? void 0 : ctx.groupper) || (ctx === null || ctx === void 0 ? void 0 : ctx.modalizerInGroupper); const groupperElement = groupper === null || groupper === void 0 ? void 0 : groupper.getElement(); if (groupper && groupperElement && dom.nodeContains(groupperElement, element)) { let next; if (element !== groupperElement || fromModalizer) { next = groupper.getFirst(true); } else { const parentElement2 = dom.getParentElement(groupperElement); const parentCtx = parentElement2 ? RootAPI.getTabsterContext(tabster, parentElement2) : void 0; groupper = parentCtx === null || parentCtx === void 0 ? void 0 : parentCtx.groupper; next = groupper === null || groupper === void 0 ? void 0 : groupper.getFirst(true); } if (next && (!relatedEvent || relatedEvent && groupperElement.dispatchEvent(new TabsterMoveFocusEvent({ by: "groupper", owner: groupperElement, next, relatedEvent })))) { if (groupper) { groupper.makeTabbable(false); } next.focus(); return next; } } return null; } moveFocus(element, action) { return action === GroupperMoveFocusActions.Enter ? this._enterGroupper(element) : this._escapeGroupper(element); } handleKeyPress(element, event, fromModalizer) { const tabster = this._tabster; const ctx = RootAPI.getTabsterContext(tabster, element); if (ctx && ((ctx === null || ctx === void 0 ? void 0 : ctx.groupper) || (ctx === null || ctx === void 0 ? void 0 : ctx.modalizerInGroupper))) { tabster.focusedElement.cancelAsyncFocus(AsyncFocusSources.EscapeGroupper); if (ctx.ignoreKeydown(event)) { return; } if (event.key === Keys.Enter) { this._enterGroupper(element, event); } else if (event.key === Keys.Escape) { const focusedElement = tabster.focusedElement.getFocusedElement(); tabster.focusedElement.requestAsyncFocus(AsyncFocusSources.EscapeGroupper, () => { if (focusedElement !== tabster.focusedElement.getFocusedElement() && // A part of Modalizer that has called this handler to escape the active groupper // might have been removed from DOM, if the focus is on body, we still want to handle Esc. (fromModalizer && !focusedElement || !fromModalizer)) { return; } this._escapeGroupper(element, event, fromModalizer); }, 0); } } } }; function _setInformativeStyle$1(weakElement, remove) { if (true) { const element = weakElement.get(); if (element) { if (remove) { element.style.removeProperty("--tabster-groupper"); } else { element.style.setProperty("--tabster-groupper", "unlimited"); } } } } var KeyboardNavigationState = class extends Subscribable { constructor(getWindow2) { super(); this._onChange = (isNavigatingWithKeyboard) => { this.setVal(isNavigatingWithKeyboard, void 0); }; this._keyborg = createKeyborg(getWindow2()); this._keyborg.subscribe(this._onChange); } dispose() { super.dispose(); if (this._keyborg) { this._keyborg.unsubscribe(this._onChange); disposeKeyborg(this._keyborg); delete this._keyborg; } } setNavigatingWithKeyboard(isNavigatingWithKeyboard) { var _a; (_a = this._keyborg) === null || _a === void 0 ? void 0 : _a.setVal(isNavigatingWithKeyboard); } isNavigatingWithKeyboard() { var _a; return !!((_a = this._keyborg) === null || _a === void 0 ? void 0 : _a.isNavigatingWithKeyboard()); } }; var _wasFocusedCounter = 0; var _ariaHidden = "aria-hidden"; function _setInformativeStyle(weakElement, remove, internalId, userId, isActive, wasFocused) { if (true) { const element = weakElement.get(); if (element) { if (remove) { element.style.removeProperty("--tabster-modalizer"); } else { element.style.setProperty("--tabster-modalizer", internalId + "," + userId + "," + (isActive ? "active" : "inactive") + ",," + (wasFocused ? `focused(${wasFocused})` : "not-focused")); } } } } var ModalizerDummyManager = class extends DummyInputManager { constructor(element, tabster, sys) { super(tabster, element, DummyInputManagerPriorities.Modalizer, sys); this._setHandlers((dummyInput, isBackward) => { var _a, _b; const el = element.get(); const container = el && ((_a = RootAPI.getRoot(tabster, el)) === null || _a === void 0 ? void 0 : _a.getElement()); const input = dummyInput.input; let toFocus; if (container && input) { const dummyContainer = getDummyInputContainer(input); const ctx = RootAPI.getTabsterContext(tabster, dummyContainer || input); if (ctx) { toFocus = (_b = FocusedElementState.findNextTabbable(tabster, ctx, container, input, void 0, isBackward, true)) === null || _b === void 0 ? void 0 : _b.element; } if (toFocus) { nativeFocus(toFocus); } } }); } }; var Modalizer = class extends TabsterPart { constructor(tabster, element, onDispose, props, sys, activeElements) { super(tabster, element, props); this._wasFocused = 0; this.userId = props.id; this._onDispose = onDispose; this._activeElements = activeElements; if (!tabster.controlTab) { this.dummyManager = new ModalizerDummyManager(this._element, tabster, sys); } if (true) { _setInformativeStyle(this._element, false, this.id, this.userId, this._isActive, this._wasFocused); } } makeActive(isActive) { if (this._isActive !== isActive) { this._isActive = isActive; const element = this.getElement(); if (element) { const activeElements = this._activeElements; const index = activeElements.map((e) => e.get()).indexOf(element); if (isActive) { if (index < 0) { activeElements.push(new WeakHTMLElement(this._tabster.getWindow, element)); } } else { if (index >= 0) { activeElements.splice(index, 1); } } } if (true) { _setInformativeStyle(this._element, false, this.id, this.userId, this._isActive, this._wasFocused); } this._dispatchEvent(isActive); } } focused(noIncrement) { if (!noIncrement) { this._wasFocused = ++_wasFocusedCounter; } return this._wasFocused; } setProps(props) { if (props.id) { this.userId = props.id; } this._props = { ...props }; } dispose() { var _a; this.makeActive(false); this._onDispose(this); (_a = this.dummyManager) === null || _a === void 0 ? void 0 : _a.dispose(); delete this.dummyManager; this._activeElements = []; this._remove(); } isActive() { return !!this._isActive; } contains(element) { return dom.nodeContains(this.getElement(), element); } findNextTabbable(currentElement, referenceElement, isBackward, ignoreAccessibility) { var _a, _b; const modalizerElement = this.getElement(); if (!modalizerElement) { return null; } const tabster = this._tabster; let next = null; let outOfDOMOrder = false; let uncontrolled; const container = currentElement && ((_a = RootAPI.getRoot(tabster, currentElement)) === null || _a === void 0 ? void 0 : _a.getElement()); if (container) { const findProps = { container, currentElement, referenceElement, ignoreAccessibility, useActiveModalizer: true }; const findPropsOut = {}; next = tabster.focusable[isBackward ? "findPrev" : "findNext"](findProps, findPropsOut); if (!next && this._props.isTrapped && ((_b = tabster.modalizer) === null || _b === void 0 ? void 0 : _b.activeId)) { next = tabster.focusable[isBackward ? "findLast" : "findFirst"]({ container, ignoreAccessibility, useActiveModalizer: true }, findPropsOut); if (next === null) { next = currentElement; } outOfDOMOrder = true; } else { outOfDOMOrder = !!findPropsOut.outOfDOMOrder; } uncontrolled = findPropsOut.uncontrolled; } return { element: next, uncontrolled, outOfDOMOrder }; } _dispatchEvent(isActive, allElements) { const element = this.getElement(); let defaultPrevented = false; if (element) { const elements = allElements ? this._activeElements.map((e) => e.get()) : [element]; for (const el of elements) { if (el) { const eventDetail = { id: this.userId, element }; const event = isActive ? new ModalizerActiveEvent(eventDetail) : new ModalizerInactiveEvent(eventDetail); el.dispatchEvent(event); if (event.defaultPrevented) { defaultPrevented = true; } } } } return defaultPrevented; } _remove() { if (true) { _setInformativeStyle(this._element, true); } } }; var ModalizerAPI = class { constructor(tabster, alwaysAccessibleSelector, accessibleCheck) { this._onModalizerDispose = (modalizer) => { const id = modalizer.id; const userId = modalizer.userId; const part = this._parts[userId]; delete this._modalizers[id]; if (part) { delete part[id]; if (Object.keys(part).length === 0) { delete this._parts[userId]; const activationHistory = this._activationHistory; const cleanActivationHistory = []; let prevHistoryItem; for (let i = activationHistory.length; i--; ) { const modalizerUserIdFromHistory = activationHistory[i]; if (modalizerUserIdFromHistory === userId) { continue; } if (modalizerUserIdFromHistory !== prevHistoryItem) { prevHistoryItem = modalizerUserIdFromHistory; if (modalizerUserIdFromHistory || cleanActivationHistory.length > 0) { cleanActivationHistory.unshift(modalizerUserIdFromHistory); } } } this._activationHistory = cleanActivationHistory; if (this.activeId === userId) { const prevActiveId = cleanActivationHistory[0]; const prevActive = prevActiveId ? Object.values(this._parts[prevActiveId])[0] : void 0; this.setActive(prevActive); } } } }; this._onKeyDown = (event) => { var _a; if (event.key !== Keys.Escape) { return; } const tabster2 = this._tabster; const element = tabster2.focusedElement.getFocusedElement(); if (element) { const ctx = RootAPI.getTabsterContext(tabster2, element); const modalizer = ctx === null || ctx === void 0 ? void 0 : ctx.modalizer; if (ctx && !ctx.groupper && (modalizer === null || modalizer === void 0 ? void 0 : modalizer.isActive()) && !ctx.ignoreKeydown(event)) { const activeId = modalizer.userId; if (activeId) { const part = this._parts[activeId]; if (part) { const focusedSince = Object.keys(part).map((id) => { var _a2; const m = part[id]; const el = m.getElement(); let groupper; if (el) { groupper = (_a2 = getTabsterOnElement(tabster2, el)) === null || _a2 === void 0 ? void 0 : _a2.groupper; } return m && el && groupper ? { el, focusedSince: m.focused(true) } : { focusedSince: 0 }; }).filter((f) => f.focusedSince > 0).sort((a, b) => a.focusedSince > b.focusedSince ? -1 : a.focusedSince < b.focusedSince ? 1 : 0); if (focusedSince.length) { const groupperElement = focusedSince[0].el; if (groupperElement) { (_a = tabster2.groupper) === null || _a === void 0 ? void 0 : _a.handleKeyPress(groupperElement, event, true); } } } } } } }; this._onFocus = (focusedElement, detail) => { var _a; const tabster2 = this._tabster; const ctx = focusedElement && RootAPI.getTabsterContext(tabster2, focusedElement); if (!ctx || !focusedElement) { return; } const augmentedMap = this._augMap; for (let e = focusedElement; e; e = dom.getParentElement(e)) { if (augmentedMap.has(e)) { augmentedMap.delete(e); augmentAttribute(tabster2, e, _ariaHidden); } } let modalizer = ctx.modalizer; const tabsterOnFocusedElement = getTabsterOnElement(tabster2, focusedElement); const modalizerOnFocusedElement = tabsterOnFocusedElement === null || tabsterOnFocusedElement === void 0 ? void 0 : tabsterOnFocusedElement.modalizer; if (modalizerOnFocusedElement) { modalizerOnFocusedElement.focused(); if (modalizerOnFocusedElement.userId === this.activeId && tabsterOnFocusedElement.groupper) { const parentElement2 = tabster2.getParent(focusedElement); const parentModalizer = parentElement2 && ((_a = RootAPI.getTabsterContext(tabster2, parentElement2)) === null || _a === void 0 ? void 0 : _a.modalizer); if (parentModalizer) { modalizer = parentModalizer; } else { this.setActive(void 0); return; } } } modalizer === null || modalizer === void 0 ? void 0 : modalizer.focused(); if ((modalizer === null || modalizer === void 0 ? void 0 : modalizer.userId) === this.activeId) { this.currentIsOthersAccessible = modalizer === null || modalizer === void 0 ? void 0 : modalizer.getProps().isOthersAccessible; return; } if (detail.isFocusedProgrammatically || this.currentIsOthersAccessible || (modalizer === null || modalizer === void 0 ? void 0 : modalizer.getProps().isAlwaysAccessible)) { this.setActive(modalizer); } else { const win2 = this._win(); win2.clearTimeout(this._restoreModalizerFocusTimer); this._restoreModalizerFocusTimer = win2.setTimeout(() => this._restoreModalizerFocus(focusedElement), 100); } }; this._tabster = tabster; this._win = tabster.getWindow; this._modalizers = {}; this._parts = {}; this._augMap = /* @__PURE__ */ new WeakMap(); this._aug = []; this._alwaysAccessibleSelector = alwaysAccessibleSelector; this._accessibleCheck = accessibleCheck; this._activationHistory = []; this.activeElements = []; if (!tabster.controlTab) { tabster.root.addDummyInputs(); } const win = this._win(); win.addEventListener("keydown", this._onKeyDown, true); tabster.queueInit(() => { this._tabster.focusedElement.subscribe(this._onFocus); }); } dispose() { const win = this._win(); win.removeEventListener("keydown", this._onKeyDown, true); Object.keys(this._modalizers).forEach((modalizerId) => { if (this._modalizers[modalizerId]) { this._modalizers[modalizerId].dispose(); delete this._modalizers[modalizerId]; } }); win.clearTimeout(this._restoreModalizerFocusTimer); win.clearTimeout(this._hiddenUpdateTimer); this._parts = {}; delete this.activeId; this.activeElements = []; this._augMap = /* @__PURE__ */ new WeakMap(); this._aug = []; this._tabster.focusedElement.unsubscribe(this._onFocus); } createModalizer(element, props, sys) { var _a; if (true) ; const modalizer = new Modalizer(this._tabster, element, this._onModalizerDispose, props, sys, this.activeElements); const id = modalizer.id; const userId = props.id; this._modalizers[id] = modalizer; let part = this._parts[userId]; if (!part) { part = this._parts[userId] = {}; } part[id] = modalizer; const focusedElement = (_a = this._tabster.focusedElement.getFocusedElement()) !== null && _a !== void 0 ? _a : null; if (element !== focusedElement && dom.nodeContains(element, focusedElement)) { if (userId !== this.activeId) { this.setActive(modalizer); } else { modalizer.makeActive(true); } } return modalizer; } isAugmented(element) { return this._augMap.has(element); } hiddenUpdate() { if (this._hiddenUpdateTimer) { return; } this._hiddenUpdateTimer = this._win().setTimeout(() => { delete this._hiddenUpdateTimer; this._hiddenUpdate(); }, 250); } setActive(modalizer) { const userId = modalizer === null || modalizer === void 0 ? void 0 : modalizer.userId; const activeId = this.activeId; if (activeId === userId) { return; } this.activeId = userId; if (activeId) { const part = this._parts[activeId]; if (part) { for (const id of Object.keys(part)) { part[id].makeActive(false); } } } if (userId) { const part = this._parts[userId]; if (part) { for (const id of Object.keys(part)) { part[id].makeActive(true); } } } this.currentIsOthersAccessible = modalizer === null || modalizer === void 0 ? void 0 : modalizer.getProps().isOthersAccessible; this.hiddenUpdate(); const activationHistory = this._activationHistory; if (activationHistory[0] !== userId && (userId !== void 0 || activationHistory.length > 0)) { activationHistory.unshift(userId); } } focus(elementFromModalizer, noFocusFirst, noFocusDefault) { const tabster = this._tabster; const ctx = RootAPI.getTabsterContext(tabster, elementFromModalizer); const modalizer = ctx === null || ctx === void 0 ? void 0 : ctx.modalizer; if (modalizer) { this.setActive(modalizer); const props = modalizer.getProps(); const modalizerRoot = modalizer.getElement(); if (modalizerRoot) { if (noFocusFirst === void 0) { noFocusFirst = props.isNoFocusFirst; } if (!noFocusFirst && tabster.keyboardNavigation.isNavigatingWithKeyboard() && tabster.focusedElement.focusFirst({ container: modalizerRoot })) { return true; } if (noFocusDefault === void 0) { noFocusDefault = props.isNoFocusDefault; } if (!noFocusDefault && tabster.focusedElement.focusDefault(modalizerRoot)) { return true; } tabster.focusedElement.resetFocus(modalizerRoot); } } else if (true) { console.error("Element is not in Modalizer.", elementFromModalizer); } return false; } activate(modalizerElementOrContainer) { var _a; const modalizerToActivate = modalizerElementOrContainer ? (_a = RootAPI.getTabsterContext(this._tabster, modalizerElementOrContainer)) === null || _a === void 0 ? void 0 : _a.modalizer : void 0; if (!modalizerElementOrContainer || modalizerToActivate) { this.setActive(modalizerToActivate); return true; } return false; } acceptElement(element, state) { var _a; const modalizerUserId = state.modalizerUserId; const currentModalizer = (_a = state.currentCtx) === null || _a === void 0 ? void 0 : _a.modalizer; if (modalizerUserId) { for (const e of this.activeElements) { const el = e.get(); if (el && (dom.nodeContains(element, el) || el === element)) { return NodeFilter.FILTER_SKIP; } } } const ret = modalizerUserId === (currentModalizer === null || currentModalizer === void 0 ? void 0 : currentModalizer.userId) || !modalizerUserId && (currentModalizer === null || currentModalizer === void 0 ? void 0 : currentModalizer.getProps().isAlwaysAccessible) ? void 0 : NodeFilter.FILTER_SKIP; if (ret !== void 0) { state.skippedFocusable = true; } return ret; } _hiddenUpdate() { var _a; const tabster = this._tabster; const body = tabster.getWindow().document.body; const activeId = this.activeId; const parts = this._parts; const visibleElements = []; const hiddenElements = []; const alwaysAccessibleSelector = this._alwaysAccessibleSelector; const alwaysAccessibleElements = alwaysAccessibleSelector ? Array.from(dom.querySelectorAll(body, alwaysAccessibleSelector)) : []; const activeModalizerElements = []; for (const userId of Object.keys(parts)) { const modalizerParts = parts[userId]; for (const id of Object.keys(modalizerParts)) { const modalizer = modalizerParts[id]; const el = modalizer.getElement(); const props = modalizer.getProps(); const isAlwaysAccessible = props.isAlwaysAccessible; if (el) { if (userId === activeId) { activeModalizerElements.push(el); if (!this.currentIsOthersAccessible) { visibleElements.push(el); } } else if (isAlwaysAccessible) { alwaysAccessibleElements.push(el); } else { hiddenElements.push(el); } } } } const augmentedMap = this._augMap; const allVisibleElements = visibleElements.length > 0 ? [...visibleElements, ...alwaysAccessibleElements] : void 0; const newAugmented = []; const newAugmentedMap = /* @__PURE__ */ new WeakMap(); const toggle = (element, hide3) => { var _a2; const tagName = element.tagName; if (tagName === "SCRIPT" || tagName === "STYLE") { return; } let isAugmented = false; if (augmentedMap.has(element)) { if (hide3) { isAugmented = true; } else { augmentedMap.delete(element); augmentAttribute(tabster, element, _ariaHidden); } } else if (hide3 && !((_a2 = this._accessibleCheck) === null || _a2 === void 0 ? void 0 : _a2.call(this, element, activeModalizerElements)) && augmentAttribute(tabster, element, _ariaHidden, "true")) { augmentedMap.set(element, true); isAugmented = true; } if (isAugmented) { newAugmented.push(new WeakHTMLElement(tabster.getWindow, element)); newAugmentedMap.set(element, true); } }; const walk = (element) => { var _a2; for (let el = dom.getFirstElementChild(element); el; el = dom.getNextElementSibling(el)) { let skip = false; let containsModalizer = false; let containedByModalizer = false; if (allVisibleElements) { const elParent = tabster.getParent(el); for (const c of allVisibleElements) { if (el === c) { skip = true; break; } if (dom.nodeContains(el, c)) { containsModalizer = true; break; } else if (dom.nodeContains(c, elParent)) { containedByModalizer = true; } } if (containsModalizer || ((_a2 = el.__tabsterElementFlags) === null || _a2 === void 0 ? void 0 : _a2.noDirectAriaHidden)) { walk(el); } else if (!skip && !containedByModalizer) { toggle(el, true); } } else { toggle(el, false); } } }; if (!allVisibleElements) { alwaysAccessibleElements.forEach((e) => toggle(e, false)); } hiddenElements.forEach((e) => toggle(e, true)); if (body) { walk(body); } (_a = this._aug) === null || _a === void 0 ? void 0 : _a.map((e) => e.get()).forEach((e) => { if (e && !newAugmentedMap.get(e)) { toggle(e, false); } }); this._aug = newAugmented; this._augMap = newAugmentedMap; } /** * Called when an element is focused outside of an active modalizer. * Attempts to pull focus back into the active modalizer * @param outsideElement - An element being focused outside of the modalizer */ _restoreModalizerFocus(outsideElement) { var _a; const ownerDocument = outsideElement === null || outsideElement === void 0 ? void 0 : outsideElement.ownerDocument; if (!outsideElement || !ownerDocument) { return; } const focusedElement = this._tabster.focusedElement.getFocusedElement(); const focusedElementModalizer = focusedElement && ((_a = RootAPI.getTabsterContext(this._tabster, focusedElement)) === null || _a === void 0 ? void 0 : _a.modalizer); if (!focusedElement || focusedElement && (focusedElementModalizer === null || focusedElementModalizer === void 0 ? void 0 : focusedElementModalizer.userId) === this.activeId) { return; } const tabster = this._tabster; const ctx = RootAPI.getTabsterContext(tabster, outsideElement); const modalizer = ctx === null || ctx === void 0 ? void 0 : ctx.modalizer; const activeId = this.activeId; if (!modalizer && !activeId || modalizer && activeId === modalizer.userId) { return; } const container = ctx === null || ctx === void 0 ? void 0 : ctx.root.getElement(); if (container) { let toFocus = tabster.focusable.findFirst({ container, useActiveModalizer: true }); if (toFocus) { if (outsideElement.compareDocumentPosition(toFocus) & document.DOCUMENT_POSITION_PRECEDING) { toFocus = tabster.focusable.findLast({ container, useActiveModalizer: true }); if (!toFocus) { throw new Error("Something went wrong."); } } tabster.focusedElement.focus(toFocus); return; } } outsideElement.blur(); } }; var _inputSelector = ["input", "textarea", "*[contenteditable]"].join(", "); var MoverDummyManager = class extends DummyInputManager { constructor(element, tabster, getMemorized, sys) { super(tabster, element, DummyInputManagerPriorities.Mover, sys); this._onFocusDummyInput = (dummyInput) => { var _a, _b; const container = this._element.get(); const input = dummyInput.input; if (container && input) { const ctx = RootAPI.getTabsterContext(this._tabster, container); let toFocus; if (ctx) { toFocus = (_a = FocusedElementState.findNextTabbable(this._tabster, ctx, void 0, input, void 0, !dummyInput.isFirst, true)) === null || _a === void 0 ? void 0 : _a.element; } const memorized = (_b = this._getMemorized()) === null || _b === void 0 ? void 0 : _b.get(); if (memorized && this._tabster.focusable.isFocusable(memorized)) { toFocus = memorized; } if (toFocus) { nativeFocus(toFocus); } } }; this._tabster = tabster; this._getMemorized = getMemorized; this._setHandlers(this._onFocusDummyInput); } }; var _moverUpdateAdd = 1; var _moverUpdateAttr = 2; var _moverUpdateRemove = 3; var Mover = class extends TabsterPart { constructor(tabster, element, onDispose, props, sys) { var _a; super(tabster, element, props); this._visible = {}; this._onIntersection = (entries) => { for (const entry of entries) { const el = entry.target; const id = getElementUId(this._win, el); let newVisibility; let fullyVisible = this._fullyVisible; if (entry.intersectionRatio >= 0.25) { newVisibility = entry.intersectionRatio >= 0.75 ? Visibilities.Visible : Visibilities.PartiallyVisible; if (newVisibility === Visibilities.Visible) { fullyVisible = id; } } else { newVisibility = Visibilities.Invisible; } if (this._visible[id] !== newVisibility) { if (newVisibility === void 0) { delete this._visible[id]; if (fullyVisible === id) { delete this._fullyVisible; } } else { this._visible[id] = newVisibility; this._fullyVisible = fullyVisible; } const state = this.getState(el); if (state) { el.dispatchEvent(new MoverStateEvent(state)); } } } }; this._win = tabster.getWindow; this.visibilityTolerance = (_a = props.visibilityTolerance) !== null && _a !== void 0 ? _a : 0.8; if (this._props.trackState || this._props.visibilityAware) { this._intersectionObserver = new IntersectionObserver(this._onIntersection, { threshold: [0, 0.25, 0.5, 0.75, 1] }); this._observeState(); } this._onDispose = onDispose; const getMemorized = () => props.memorizeCurrent ? this._current : void 0; if (!tabster.controlTab) { this.dummyManager = new MoverDummyManager(this._element, tabster, getMemorized, sys); } } dispose() { var _a; this._onDispose(this); if (this._intersectionObserver) { this._intersectionObserver.disconnect(); delete this._intersectionObserver; } delete this._current; delete this._fullyVisible; delete this._allElements; delete this._updateQueue; if (this._unobserve) { this._unobserve(); delete this._unobserve; } const win = this._win(); if (this._setCurrentTimer) { win.clearTimeout(this._setCurrentTimer); delete this._setCurrentTimer; } if (this._updateTimer) { win.clearTimeout(this._updateTimer); delete this._updateTimer; } (_a = this.dummyManager) === null || _a === void 0 ? void 0 : _a.dispose(); delete this.dummyManager; } setCurrent(element) { if (element) { this._current = new WeakHTMLElement(this._win, element); } else { this._current = void 0; } if ((this._props.trackState || this._props.visibilityAware) && !this._setCurrentTimer) { this._setCurrentTimer = this._win().setTimeout(() => { var _a; delete this._setCurrentTimer; const changed = []; if (this._current !== this._prevCurrent) { changed.push(this._current); changed.push(this._prevCurrent); this._prevCurrent = this._current; } for (const weak of changed) { const el = weak === null || weak === void 0 ? void 0 : weak.get(); if (el && ((_a = this._allElements) === null || _a === void 0 ? void 0 : _a.get(el)) === this) { const props = this._props; if (el && (props.visibilityAware !== void 0 || props.trackState)) { const state = this.getState(el); if (state) { el.dispatchEvent(new MoverStateEvent(state)); } } } } }); } } getCurrent() { var _a; return ((_a = this._current) === null || _a === void 0 ? void 0 : _a.get()) || null; } findNextTabbable(currentElement, referenceElement, isBackward, ignoreAccessibility) { const container = this.getElement(); const currentIsDummy = container && getDummyInputContainer(currentElement) === container; if (!container) { return null; } let next = null; let outOfDOMOrder = false; let uncontrolled; if (this._props.tabbable || currentIsDummy || currentElement && !dom.nodeContains(container, currentElement)) { const findProps = { currentElement, referenceElement, container, ignoreAccessibility, useActiveModalizer: true }; const findPropsOut = {}; next = this._tabster.focusable[isBackward ? "findPrev" : "findNext"](findProps, findPropsOut); outOfDOMOrder = !!findPropsOut.outOfDOMOrder; uncontrolled = findPropsOut.uncontrolled; } return { element: next, uncontrolled, outOfDOMOrder }; } acceptElement(element, state) { var _a, _b; if (!FocusedElementState.isTabbing) { return ((_a = state.currentCtx) === null || _a === void 0 ? void 0 : _a.excludedFromMover) ? NodeFilter.FILTER_REJECT : void 0; } const { memorizeCurrent, visibilityAware, hasDefault = true } = this._props; const moverElement = this.getElement(); if (moverElement && (memorizeCurrent || visibilityAware || hasDefault) && (!dom.nodeContains(moverElement, state.from) || getDummyInputContainer(state.from) === moverElement)) { let found; if (memorizeCurrent) { const current = (_b = this._current) === null || _b === void 0 ? void 0 : _b.get(); if (current && state.acceptCondition(current)) { found = current; } } if (!found && hasDefault) { found = this._tabster.focusable.findDefault({ container: moverElement, useActiveModalizer: true }); } if (!found && visibilityAware) { found = this._tabster.focusable.findElement({ container: moverElement, useActiveModalizer: true, isBackward: state.isBackward, acceptCondition: (el) => { var _a2; const id = getElementUId(this._win, el); const visibility = this._visible[id]; return moverElement !== el && !!((_a2 = this._allElements) === null || _a2 === void 0 ? void 0 : _a2.get(el)) && state.acceptCondition(el) && (visibility === Visibilities.Visible || visibility === Visibilities.PartiallyVisible && (visibilityAware === Visibilities.PartiallyVisible || !this._fullyVisible)); } }); } if (found) { state.found = true; state.foundElement = found; state.rejectElementsFrom = moverElement; state.skippedFocusable = true; return NodeFilter.FILTER_ACCEPT; } } return void 0; } _observeState() { const element = this.getElement(); if (this._unobserve || !element || typeof MutationObserver === "undefined") { return; } const win = this._win(); const allElements = this._allElements = /* @__PURE__ */ new WeakMap(); const tabsterFocusable = this._tabster.focusable; let updateQueue = this._updateQueue = []; const observer = dom.createMutationObserver((mutations) => { for (const mutation of mutations) { const target = mutation.target; const removed = mutation.removedNodes; const added = mutation.addedNodes; if (mutation.type === "attributes") { if (mutation.attributeName === "tabindex") { updateQueue.push({ element: target, type: _moverUpdateAttr }); } } else { for (let i = 0; i < removed.length; i++) { updateQueue.push({ element: removed[i], type: _moverUpdateRemove }); } for (let i = 0; i < added.length; i++) { updateQueue.push({ element: added[i], type: _moverUpdateAdd }); } } } requestUpdate(); }); const setElement = (element2, remove) => { var _a, _b; const current = allElements.get(element2); if (current && remove) { (_a = this._intersectionObserver) === null || _a === void 0 ? void 0 : _a.unobserve(element2); allElements.delete(element2); } if (!current && !remove) { allElements.set(element2, this); (_b = this._intersectionObserver) === null || _b === void 0 ? void 0 : _b.observe(element2); } }; const updateElement = (element2) => { const isFocusable = tabsterFocusable.isFocusable(element2); const current = allElements.get(element2); if (current) { if (!isFocusable) { setElement(element2, true); } } else { if (isFocusable) { setElement(element2); } } }; const addNewElements = (element2) => { const { mover } = getMoverGroupper(element2); if (mover && mover !== this) { if (mover.getElement() === element2 && tabsterFocusable.isFocusable(element2)) { setElement(element2); } else { return; } } const walker = createElementTreeWalker(win.document, element2, (node) => { const { mover: mover2, groupper } = getMoverGroupper(node); if (mover2 && mover2 !== this) { return NodeFilter.FILTER_REJECT; } const groupperFirstFocusable = groupper === null || groupper === void 0 ? void 0 : groupper.getFirst(true); if (groupper && groupper.getElement() !== node && groupperFirstFocusable && groupperFirstFocusable !== node) { return NodeFilter.FILTER_REJECT; } if (tabsterFocusable.isFocusable(node)) { setElement(node); } return NodeFilter.FILTER_SKIP; }); if (walker) { walker.currentNode = element2; while (walker.nextNode()) { } } }; const removeWalk = (element2) => { const current = allElements.get(element2); if (current) { setElement(element2, true); } for (let el = dom.getFirstElementChild(element2); el; el = dom.getNextElementSibling(el)) { removeWalk(el); } }; const requestUpdate = () => { if (!this._updateTimer && updateQueue.length) { this._updateTimer = win.setTimeout(() => { delete this._updateTimer; for (const { element: element2, type } of updateQueue) { switch (type) { case _moverUpdateAttr: updateElement(element2); break; case _moverUpdateAdd: addNewElements(element2); break; case _moverUpdateRemove: removeWalk(element2); break; } } updateQueue = this._updateQueue = []; }, 0); } }; const getMoverGroupper = (element2) => { const ret = {}; for (let el = element2; el; el = dom.getParentElement(el)) { const toe = getTabsterOnElement(this._tabster, el); if (toe) { if (toe.groupper && !ret.groupper) { ret.groupper = toe.groupper; } if (toe.mover) { ret.mover = toe.mover; break; } } } return ret; }; updateQueue.push({ element, type: _moverUpdateAdd }); requestUpdate(); observer.observe(element, { childList: true, subtree: true, attributes: true, attributeFilter: ["tabindex"] }); this._unobserve = () => { observer.disconnect(); }; } getState(element) { const id = getElementUId(this._win, element); if (id in this._visible) { const visibility = this._visible[id] || Visibilities.Invisible; const isCurrent = this._current ? this._current.get() === element : void 0; return { isCurrent, visibility }; } return void 0; } }; function getDistance(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2) { const xDistance = ax2 < bx1 ? bx1 - ax2 : bx2 < ax1 ? ax1 - bx2 : 0; const yDistance = ay2 < by1 ? by1 - ay2 : by2 < ay1 ? ay1 - by2 : 0; return xDistance === 0 ? yDistance : yDistance === 0 ? xDistance : Math.sqrt(xDistance * xDistance + yDistance * yDistance); } var MoverAPI = class { constructor(tabster, getWindow2) { this._init = () => { const win = this._win(); win.addEventListener("keydown", this._onKeyDown, true); win.addEventListener(MoverMoveFocusEventName, this._onMoveFocus); win.addEventListener(MoverMemorizedElementEventName, this._onMemorizedElement); this._tabster.focusedElement.subscribe(this._onFocus); }; this._onMoverDispose = (mover) => { delete this._movers[mover.id]; }; this._onFocus = (element) => { var _a; let currentFocusableElement = element; let deepestFocusableElement = element; for (let el = dom.getParentElement(element); el; el = dom.getParentElement(el)) { const mover = (_a = getTabsterOnElement(this._tabster, el)) === null || _a === void 0 ? void 0 : _a.mover; if (mover) { mover.setCurrent(deepestFocusableElement); currentFocusableElement = void 0; } if (!currentFocusableElement && this._tabster.focusable.isFocusable(el)) { currentFocusableElement = deepestFocusableElement = el; } } }; this._onKeyDown = async (event) => { var _a; if (this._ignoredInputTimer) { this._win().clearTimeout(this._ignoredInputTimer); delete this._ignoredInputTimer; } (_a = this._ignoredInputResolve) === null || _a === void 0 ? void 0 : _a.call(this, false); if (event.ctrlKey || event.altKey || event.shiftKey || event.metaKey) { return; } const key = event.key; let moverKey; if (key === Keys.ArrowDown) { moverKey = MoverKeys.ArrowDown; } else if (key === Keys.ArrowRight) { moverKey = MoverKeys.ArrowRight; } else if (key === Keys.ArrowUp) { moverKey = MoverKeys.ArrowUp; } else if (key === Keys.ArrowLeft) { moverKey = MoverKeys.ArrowLeft; } else if (key === Keys.PageDown) { moverKey = MoverKeys.PageDown; } else if (key === Keys.PageUp) { moverKey = MoverKeys.PageUp; } else if (key === Keys.Home) { moverKey = MoverKeys.Home; } else if (key === Keys.End) { moverKey = MoverKeys.End; } if (!moverKey) { return; } const focused = this._tabster.focusedElement.getFocusedElement(); if (!focused || await this._isIgnoredInput(focused, key)) { return; } this._moveFocus(focused, moverKey, event); }; this._onMoveFocus = (e) => { var _a; const element = e.composedPath()[0]; const key = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.key; if (element && key !== void 0 && !e.defaultPrevented) { this._moveFocus(element, key); e.stopImmediatePropagation(); } }; this._onMemorizedElement = (e) => { var _a; const target = e.composedPath()[0]; let memorizedElement = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.memorizedElement; if (target) { const ctx = RootAPI.getTabsterContext(this._tabster, target); const mover = ctx === null || ctx === void 0 ? void 0 : ctx.mover; if (mover) { if (memorizedElement && !dom.nodeContains(mover.getElement(), memorizedElement)) { memorizedElement = void 0; } mover.setCurrent(memorizedElement); e.stopImmediatePropagation(); } } }; this._tabster = tabster; this._win = getWindow2; this._movers = {}; tabster.queueInit(this._init); } dispose() { var _a; const win = this._win(); this._tabster.focusedElement.unsubscribe(this._onFocus); (_a = this._ignoredInputResolve) === null || _a === void 0 ? void 0 : _a.call(this, false); if (this._ignoredInputTimer) { win.clearTimeout(this._ignoredInputTimer); delete this._ignoredInputTimer; } win.removeEventListener("keydown", this._onKeyDown, true); win.removeEventListener(MoverMoveFocusEventName, this._onMoveFocus); win.removeEventListener(MoverMemorizedElementEventName, this._onMemorizedElement); Object.keys(this._movers).forEach((moverId) => { if (this._movers[moverId]) { this._movers[moverId].dispose(); delete this._movers[moverId]; } }); } createMover(element, props, sys) { if (true) ; const newMover = new Mover(this._tabster, element, this._onMoverDispose, props, sys); this._movers[newMover.id] = newMover; return newMover; } moveFocus(fromElement, key) { return this._moveFocus(fromElement, key); } _moveFocus(fromElement, key, relatedEvent) { var _a, _b; const tabster = this._tabster; const ctx = RootAPI.getTabsterContext(tabster, fromElement, { checkRtl: true }); if (!ctx || !ctx.mover || ctx.excludedFromMover || relatedEvent && ctx.ignoreKeydown(relatedEvent)) { return null; } const mover = ctx.mover; const container = mover.getElement(); if (ctx.groupperBeforeMover) { const groupper = ctx.groupper; if (groupper && !groupper.isActive(true)) { for (let el = dom.getParentElement(groupper.getElement()); el && el !== container; el = dom.getParentElement(el)) { if ((_b = (_a = getTabsterOnElement(tabster, el)) === null || _a === void 0 ? void 0 : _a.groupper) === null || _b === void 0 ? void 0 : _b.isActive(true)) { return null; } } } else { return null; } } if (!container) { return null; } const focusable = tabster.focusable; const moverProps = mover.getProps(); const direction = moverProps.direction || MoverDirections.Both; const isBoth = direction === MoverDirections.Both; const isVertical = isBoth || direction === MoverDirections.Vertical; const isHorizontal = isBoth || direction === MoverDirections.Horizontal; const isGridLinear = direction === MoverDirections.GridLinear; const isGrid = isGridLinear || direction === MoverDirections.Grid; const isCyclic = moverProps.cyclic; let next; let scrollIntoViewArg; let focusedElementRect; let focusedElementX1 = 0; let focusedElementX2 = 0; if (isGrid) { focusedElementRect = fromElement.getBoundingClientRect(); focusedElementX1 = Math.ceil(focusedElementRect.left); focusedElementX2 = Math.floor(focusedElementRect.right); } if (ctx.rtl) { if (key === MoverKeys.ArrowRight) { key = MoverKeys.ArrowLeft; } else if (key === MoverKeys.ArrowLeft) { key = MoverKeys.ArrowRight; } } if (key === MoverKeys.ArrowDown && isVertical || key === MoverKeys.ArrowRight && (isHorizontal || isGrid)) { next = focusable.findNext({ currentElement: fromElement, container, useActiveModalizer: true }); if (next && isGrid) { const nextElementX1 = Math.ceil(next.getBoundingClientRect().left); if (!isGridLinear && focusedElementX2 > nextElementX1) { next = void 0; } } else if (!next && isCyclic) { next = focusable.findFirst({ container, useActiveModalizer: true }); } } else if (key === MoverKeys.ArrowUp && isVertical || key === MoverKeys.ArrowLeft && (isHorizontal || isGrid)) { next = focusable.findPrev({ currentElement: fromElement, container, useActiveModalizer: true }); if (next && isGrid) { const nextElementX2 = Math.floor(next.getBoundingClientRect().right); if (!isGridLinear && nextElementX2 > focusedElementX1) { next = void 0; } } else if (!next && isCyclic) { next = focusable.findLast({ container, useActiveModalizer: true }); } } else if (key === MoverKeys.Home) { if (isGrid) { focusable.findElement({ container, currentElement: fromElement, useActiveModalizer: true, isBackward: true, acceptCondition: (el) => { var _a2; if (!focusable.isFocusable(el)) { return false; } const nextElementX1 = Math.ceil((_a2 = el.getBoundingClientRect().left) !== null && _a2 !== void 0 ? _a2 : 0); if (el !== fromElement && focusedElementX1 <= nextElementX1) { return true; } next = el; return false; } }); } else { next = focusable.findFirst({ container, useActiveModalizer: true }); } } else if (key === MoverKeys.End) { if (isGrid) { focusable.findElement({ container, currentElement: fromElement, useActiveModalizer: true, acceptCondition: (el) => { var _a2; if (!focusable.isFocusable(el)) { return false; } const nextElementX1 = Math.ceil((_a2 = el.getBoundingClientRect().left) !== null && _a2 !== void 0 ? _a2 : 0); if (el !== fromElement && focusedElementX1 >= nextElementX1) { return true; } next = el; return false; } }); } else { next = focusable.findLast({ container, useActiveModalizer: true }); } } else if (key === MoverKeys.PageUp) { focusable.findElement({ currentElement: fromElement, container, useActiveModalizer: true, isBackward: true, acceptCondition: (el) => { if (!focusable.isFocusable(el)) { return false; } if (isElementVerticallyVisibleInContainer(this._win, el, mover.visibilityTolerance)) { next = el; return false; } return true; } }); if (isGrid && next) { const firstColumnX1 = Math.ceil(next.getBoundingClientRect().left); focusable.findElement({ currentElement: next, container, useActiveModalizer: true, acceptCondition: (el) => { if (!focusable.isFocusable(el)) { return false; } const nextElementX1 = Math.ceil(el.getBoundingClientRect().left); if (focusedElementX1 < nextElementX1 || firstColumnX1 >= nextElementX1) { return true; } next = el; return false; } }); } scrollIntoViewArg = false; } else if (key === MoverKeys.PageDown) { focusable.findElement({ currentElement: fromElement, container, useActiveModalizer: true, acceptCondition: (el) => { if (!focusable.isFocusable(el)) { return false; } if (isElementVerticallyVisibleInContainer(this._win, el, mover.visibilityTolerance)) { next = el; return false; } return true; } }); if (isGrid && next) { const lastColumnX1 = Math.ceil(next.getBoundingClientRect().left); focusable.findElement({ currentElement: next, container, useActiveModalizer: true, isBackward: true, acceptCondition: (el) => { if (!focusable.isFocusable(el)) { return false; } const nextElementX1 = Math.ceil(el.getBoundingClientRect().left); if (focusedElementX1 > nextElementX1 || lastColumnX1 <= nextElementX1) { return true; } next = el; return false; } }); } scrollIntoViewArg = true; } else if (isGrid) { const isBackward = key === MoverKeys.ArrowUp; const ax1 = focusedElementX1; const ay1 = Math.ceil(focusedElementRect.top); const ax2 = focusedElementX2; const ay2 = Math.floor(focusedElementRect.bottom); let targetElement; let lastDistance; let lastIntersection = 0; focusable.findAll({ container, currentElement: fromElement, isBackward, onElement: (el) => { const rect = el.getBoundingClientRect(); const bx1 = Math.ceil(rect.left); const by1 = Math.ceil(rect.top); const bx2 = Math.floor(rect.right); const by2 = Math.floor(rect.bottom); if (isBackward && ay1 < by2 || !isBackward && ay2 > by1) { return true; } const xIntersectionWidth = Math.ceil(Math.min(ax2, bx2)) - Math.floor(Math.max(ax1, bx1)); const minWidth = Math.ceil(Math.min(ax2 - ax1, bx2 - bx1)); if (xIntersectionWidth > 0 && minWidth >= xIntersectionWidth) { const intersection = xIntersectionWidth / minWidth; if (intersection > lastIntersection) { targetElement = el; lastIntersection = intersection; } } else if (lastIntersection === 0) { const distance = getDistance(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2); if (lastDistance === void 0 || distance < lastDistance) { lastDistance = distance; targetElement = el; } } else if (lastIntersection > 0) { return false; } return true; } }); next = targetElement; } if (next && (!relatedEvent || relatedEvent && container.dispatchEvent(new TabsterMoveFocusEvent({ by: "mover", owner: container, next, relatedEvent })))) { if (scrollIntoViewArg !== void 0) { scrollIntoView(this._win, next, scrollIntoViewArg); } if (relatedEvent) { relatedEvent.preventDefault(); relatedEvent.stopImmediatePropagation(); } nativeFocus(next); return next; } return null; } async _isIgnoredInput(element, key) { if (element.getAttribute("aria-expanded") === "true" && (element.hasAttribute("aria-activedescendant") || element.getAttribute("role") === "combobox")) { return true; } if (matchesSelector(element, _inputSelector)) { let selectionStart = 0; let selectionEnd = 0; let textLength = 0; let asyncRet; if (element.tagName === "INPUT" || element.tagName === "TEXTAREA") { const type = element.type; const value = element.value; textLength = (value || "").length; if (type === "email" || type === "number") { if (textLength) { const selection = dom.getSelection(element); if (selection) { const initialLength = selection.toString().length; const isBackward = key === Keys.ArrowLeft || key === Keys.ArrowUp; selection.modify("extend", isBackward ? "backward" : "forward", "character"); if (initialLength !== selection.toString().length) { selection.modify("extend", isBackward ? "forward" : "backward", "character"); return true; } else { textLength = 0; } } } } else { const selStart = element.selectionStart; if (selStart === null) { return type === "hidden"; } selectionStart = selStart || 0; selectionEnd = element.selectionEnd || 0; } } else if (element.contentEditable === "true") { asyncRet = new (getPromise(this._win))((resolve) => { this._ignoredInputResolve = (value) => { delete this._ignoredInputResolve; resolve(value); }; const win = this._win(); if (this._ignoredInputTimer) { win.clearTimeout(this._ignoredInputTimer); } const { anchorNode: prevAnchorNode, focusNode: prevFocusNode, anchorOffset: prevAnchorOffset, focusOffset: prevFocusOffset } = dom.getSelection(element) || {}; this._ignoredInputTimer = win.setTimeout(() => { var _a, _b, _c; delete this._ignoredInputTimer; const { anchorNode, focusNode, anchorOffset, focusOffset } = dom.getSelection(element) || {}; if (anchorNode !== prevAnchorNode || focusNode !== prevFocusNode || anchorOffset !== prevAnchorOffset || focusOffset !== prevFocusOffset) { (_a = this._ignoredInputResolve) === null || _a === void 0 ? void 0 : _a.call(this, false); return; } selectionStart = anchorOffset || 0; selectionEnd = focusOffset || 0; textLength = ((_b = element.textContent) === null || _b === void 0 ? void 0 : _b.length) || 0; if (anchorNode && focusNode) { if (dom.nodeContains(element, anchorNode) && dom.nodeContains(element, focusNode)) { if (anchorNode !== element) { let anchorFound = false; const addOffsets = (node) => { if (node === anchorNode) { anchorFound = true; } else if (node === focusNode) { return true; } const nodeText = node.textContent; if (nodeText && !dom.getFirstChild(node)) { const len = nodeText.length; if (anchorFound) { if (focusNode !== anchorNode) { selectionEnd += len; } } else { selectionStart += len; selectionEnd += len; } } let stop = false; for (let e = dom.getFirstChild(node); e && !stop; e = e.nextSibling) { stop = addOffsets(e); } return stop; }; addOffsets(element); } } } (_c = this._ignoredInputResolve) === null || _c === void 0 ? void 0 : _c.call(this, true); }, 0); }); } if (asyncRet && !await asyncRet) { return true; } if (selectionStart !== selectionEnd) { return true; } if (selectionStart > 0 && (key === Keys.ArrowLeft || key === Keys.ArrowUp || key === Keys.Home)) { return true; } if (selectionStart < textLength && (key === Keys.ArrowRight || key === Keys.ArrowDown || key === Keys.End)) { return true; } } return false; } }; function observeMutations(doc, tabster, updateTabsterByAttribute2, syncState) { if (typeof MutationObserver === "undefined") { return () => { }; } const getWindow2 = tabster.getWindow; let elementByUId; const onMutation = (mutations) => { var _a, _b, _c, _d, _e; const removedNodes = /* @__PURE__ */ new Set(); for (const mutation of mutations) { const target = mutation.target; const removed = mutation.removedNodes; const added = mutation.addedNodes; if (mutation.type === "attributes") { if (mutation.attributeName === TABSTER_ATTRIBUTE_NAME) { if (!removedNodes.has(target)) { updateTabsterByAttribute2(tabster, target); } } } else { for (let i = 0; i < removed.length; i++) { const removedNode = removed[i]; removedNodes.add(removedNode); updateTabsterElements(removedNode, true); (_b = (_a = tabster._dummyObserver).domChanged) === null || _b === void 0 ? void 0 : _b.call(_a, target); } for (let i = 0; i < added.length; i++) { updateTabsterElements(added[i]); (_d = (_c = tabster._dummyObserver).domChanged) === null || _d === void 0 ? void 0 : _d.call(_c, target); } } } removedNodes.clear(); (_e = tabster.modalizer) === null || _e === void 0 ? void 0 : _e.hiddenUpdate(); }; function updateTabsterElements(node, removed) { if (!elementByUId) { elementByUId = getInstanceContext(getWindow2).elementByUId; } processNode(node, removed); const walker = createElementTreeWalker(doc, node, (element) => { return processNode(element, removed); }); if (walker) { while (walker.nextNode()) { } } } function processNode(element, removed) { var _a; if (!element.getAttribute) { return NodeFilter.FILTER_SKIP; } const uid = element.__tabsterElementUID; if (uid && elementByUId) { if (removed) { delete elementByUId[uid]; } else { (_a = elementByUId[uid]) !== null && _a !== void 0 ? _a : elementByUId[uid] = new WeakHTMLElement(getWindow2, element); } } if (getTabsterOnElement(tabster, element) || element.hasAttribute(TABSTER_ATTRIBUTE_NAME)) { updateTabsterByAttribute2(tabster, element, removed); } return NodeFilter.FILTER_SKIP; } const observer = dom.createMutationObserver(onMutation); if (syncState) { updateTabsterElements(getWindow2().document.body); } observer.observe(doc, { childList: true, subtree: true, attributes: true, attributeFilter: [TABSTER_ATTRIBUTE_NAME] }); return () => { observer.disconnect(); }; } var _conditionCheckTimeout = 100; var ObservedElementAPI = class extends Subscribable { constructor(tabster) { super(); this._waiting = {}; this._lastRequestFocusId = 0; this._observedById = {}; this._observedByName = {}; this._currentRequestTimestamp = 0; this._onFocus = (e) => { if (e) { const current = this._currentRequest; if (current) { const delta = Date.now() - this._currentRequestTimestamp; const settleTime = 300; if (delta >= settleTime) { delete this._currentRequest; const elementRef = new WeakRef(e); current.diagnostics.getCancelTriggeringElement = () => { var _a; return (_a = elementRef.deref()) !== null && _a !== void 0 ? _a : null; }; current.diagnostics.reason = ObservedElementFailureReasons.CanceledFocusChange; current.cancel(); } } } }; this.onObservedElementUpdate = (element) => { var _a, _b; const observed = (_a = getTabsterOnElement(this._tabster, element)) === null || _a === void 0 ? void 0 : _a.observed; const uid = getElementUId(this._win, element); let info = this._observedById[uid]; if (observed && documentContains(element.ownerDocument, element)) { const isNewElement = !info; if (!info) { info = this._observedById[uid] = { element: new WeakHTMLElement(this._win, element) }; } observed.names.sort(); const observedNames = observed.names; const prevNames = info.prevNames; if (this._isObservedNamesUpdated(observedNames, prevNames)) { if (prevNames) { prevNames.forEach((prevName) => { const obn = this._observedByName[prevName]; if (obn && obn[uid]) { if (Object.keys(obn).length > 1) { delete obn[uid]; } else { delete this._observedByName[prevName]; } } }); } info.prevNames = observedNames; this._notifyObservedElementChange(element, observedNames, prevNames, isNewElement); } observedNames.forEach((observedName) => { let obn = this._observedByName[observedName]; if (!obn) { obn = this._observedByName[observedName] = {}; } obn[uid] = info; this._waitConditional(observedName); }); } else if (info) { const prevNames = info.prevNames; if (prevNames) { prevNames.forEach((prevName) => { const obn = this._observedByName[prevName]; if (obn && obn[uid]) { if (Object.keys(obn).length > 1) { delete obn[uid]; } else { delete this._observedByName[prevName]; } } }); (_b = this.onObservedElementChange) === null || _b === void 0 ? void 0 : _b.call(this, { element, type: "removed", names: [], removedNames: prevNames }); } delete this._observedById[uid]; } }; this._tabster = tabster; this._win = tabster.getWindow; tabster.queueInit(() => { this._tabster.focusedElement.subscribe(this._onFocus); }); } dispose() { this._tabster.focusedElement.unsubscribe(this._onFocus); for (const key of Object.keys(this._waiting)) { this._rejectWaiting(key); } this._observedById = {}; this._observedByName = {}; this.onObservedElementChange = void 0; } _rejectWaiting(key, shouldResolve) { const w = this._waiting[key]; if (w) { const win = this._win(); if (w.timer) { win.clearTimeout(w.timer); } if (w.conditionTimer) { win.clearTimeout(w.conditionTimer); } if (!shouldResolve && w.reject) { w.reject(); } else if (shouldResolve && w.resolve) { w.resolve(null); } delete this._waiting[key]; } } _populateTimeoutDiagnostics(request, observedName, timeout, startTime) { const elementInDOM = this.getElement(observedName); const inDOM = !!elementInDOM; let isAccessible; let isFocusable; let reason; if (!elementInDOM) { reason = ObservedElementFailureReasons.TimeoutElementNotInDOM; } else { isAccessible = this._tabster.focusable.isAccessible(elementInDOM); isFocusable = this._tabster.focusable.isFocusable(elementInDOM, true); if (!isAccessible) { reason = ObservedElementFailureReasons.TimeoutElementNotAccessible; } else if (!isFocusable) { reason = ObservedElementFailureReasons.TimeoutElementNotFocusable; } else { reason = ObservedElementFailureReasons.TimeoutElementNotReady; } } request.diagnostics.reason = reason; request.diagnostics.waitForElementDuration = Date.now() - startTime; request.diagnostics.targetState = { inDOM, isAccessible, isFocusable }; } _isObservedNamesUpdated(cur, prev) { if (!prev || cur.length !== prev.length) { return true; } for (let i = 0; i < cur.length; ++i) { if (cur[i] !== prev[i]) { return true; } } return false; } _notifyObservedElementChange(element, observedNames, prevNames, isNewElement) { if (!this.onObservedElementChange) { return; } const addedNames = observedNames.filter((name) => !prevNames || !prevNames.includes(name)); const removedNames = prevNames ? prevNames.filter((name) => !observedNames.includes(name)) : []; if (isNewElement) { this.onObservedElementChange({ element, type: "added", names: observedNames, addedNames: observedNames }); } else if (addedNames.length > 0 || removedNames.length > 0) { this.onObservedElementChange({ element, type: "updated", names: observedNames, addedNames: addedNames.length > 0 ? addedNames : void 0, removedNames: removedNames.length > 0 ? removedNames : void 0 }); } } /** * Returns all registered observed names with their respective elements and full names arrays * * @returns Map> A map where keys are observed names * and values are arrays of objects containing the element and its complete names array (in the order they were defined) */ getAllObservedElements() { const result = /* @__PURE__ */ new Map(); for (const name of Object.keys(this._observedByName)) { const elementsWithNames = []; const observed = this._observedByName[name]; for (const uid of Object.keys(observed)) { const el = observed[uid].element.get(); if (el) { const info = this._observedById[uid]; elementsWithNames.push({ element: el, names: (info === null || info === void 0 ? void 0 : info.prevNames) || [] }); } } if (elementsWithNames.length > 0) { result.set(name, elementsWithNames); } } return result; } /** * Returns existing element by observed name * * @param observedName An observed name * @param accessibility Optionally, return only if the element is accessible or focusable * @returns HTMLElement | null */ getElement(observedName, accessibility) { const o = this._observedByName[observedName]; if (o) { for (const uid of Object.keys(o)) { let el = o[uid].element.get() || null; if (el) { if (accessibility === ObservedElementAccessibilities.Accessible && !this._tabster.focusable.isAccessible(el) || accessibility === ObservedElementAccessibilities.Focusable && !this._tabster.focusable.isFocusable(el, true)) { el = null; } } else { delete o[uid]; delete this._observedById[uid]; } return el; } } return null; } /** * Waits for the element to appear in the DOM and returns it. * * @param observedName An observed name * @param timeout Wait no longer than this timeout * @param accessibility Optionally, wait for the element to also become accessible or focusable before returning it * @returns Promise */ waitElement(observedName, timeout, accessibility) { const startTime = Date.now(); const el = this.getElement(observedName, accessibility); if (el) { return { result: getPromise(this._win).resolve(el), cancel: () => { }, status: ObservedElementRequestStatuses.Succeeded, diagnostics: { waitForElementDuration: Date.now() - startTime } }; } let prefix; if (accessibility === ObservedElementAccessibilities.Accessible) { prefix = "a"; } else if (accessibility === ObservedElementAccessibilities.Focusable) { prefix = "f"; } else { prefix = "_"; } const key = prefix + observedName; let w = this._waiting[key]; if (w && w.request) { return w.request; } w = this._waiting[key] = { timer: this._win().setTimeout(() => { if (w.conditionTimer) { this._win().clearTimeout(w.conditionTimer); } delete this._waiting[key]; if (w.request) { w.request.status = ObservedElementRequestStatuses.TimedOut; this._populateTimeoutDiagnostics(w.request, observedName, timeout, startTime); } if (w.resolve) { w.resolve(null); } }, timeout) }; const promise = new (getPromise(this._win))((resolve, reject) => { w.resolve = resolve; w.reject = reject; }).catch(() => { return null; }); const request = { result: promise, cancel: () => { if (request.status === ObservedElementRequestStatuses.Waiting) { request.status = ObservedElementRequestStatuses.Canceled; request.diagnostics.waitForElementDuration = Date.now() - startTime; } this._rejectWaiting(key, true); }, status: ObservedElementRequestStatuses.Waiting, diagnostics: {} }; w.request = request; if (accessibility && this.getElement(observedName)) { this._waitConditional(observedName); } return request; } requestFocus(observedName, timeout, options = {}) { const requestId = ++this._lastRequestFocusId; const currentRequestFocus = this._currentRequest; if (currentRequestFocus) { currentRequestFocus.diagnostics.reason = ObservedElementFailureReasons.SupersededByNewRequest; currentRequestFocus.cancel(); } const request = this.waitElement(observedName, timeout, ObservedElementAccessibilities.Focusable); this._currentRequest = request; this._currentRequestTimestamp = Date.now(); const ret = { result: request.result.then((element) => { if (this._lastRequestFocusId !== requestId) { request.diagnostics.reason = ObservedElementFailureReasons.SupersededByNewRequest; return false; } if (!element) { if (request.diagnostics.reason === void 0) { request.diagnostics.reason = ObservedElementFailureReasons.TimeoutElementNotInDOM; } return false; } const focusResult = this._tabster.focusedElement.focus(element, true, void 0, options.preventScroll); if (!focusResult) { request.diagnostics.reason = ObservedElementFailureReasons.FocusCallFailed; } return focusResult; }), cancel: () => { request.cancel(); }, status: request.status, diagnostics: request.diagnostics }; request.result.finally(() => { if (this._currentRequest === request) { delete this._currentRequest; } ret.status = request.status; }); return ret; } _waitConditional(observedName) { const waitingElementKey = "_" + observedName; const waitingAccessibleElementKey = "a" + observedName; const waitingFocusableElementKey = "f" + observedName; const waitingElement = this._waiting[waitingElementKey]; const waitingAccessibleElement = this._waiting[waitingAccessibleElementKey]; const waitingFocusableElement = this._waiting[waitingFocusableElementKey]; const win = this._win(); const resolve = (element, key, waiting, accessibility) => { var _a; const observed = (_a = getTabsterOnElement(this._tabster, element)) === null || _a === void 0 ? void 0 : _a.observed; if (!observed || !observed.names.includes(observedName)) { return; } if (waiting.timer) { win.clearTimeout(waiting.timer); } delete this._waiting[key]; if (waiting.request) { waiting.request.status = ObservedElementRequestStatuses.Succeeded; } if (waiting.resolve) { waiting.resolve(element); } this.trigger(element, { names: [observedName], details: observed.details, accessibility }); }; if (waitingElement) { const element = this.getElement(observedName); if (element && documentContains(element.ownerDocument, element)) { resolve(element, waitingElementKey, waitingElement, ObservedElementAccessibilities.Any); } } if (waitingAccessibleElement && !waitingAccessibleElement.conditionTimer) { const resolveAccessible = () => { const element = this.getElement(observedName); if (element && documentContains(element.ownerDocument, element) && this._tabster.focusable.isAccessible(element)) { resolve(element, waitingAccessibleElementKey, waitingAccessibleElement, ObservedElementAccessibilities.Accessible); } else { waitingAccessibleElement.conditionTimer = win.setTimeout(resolveAccessible, _conditionCheckTimeout); } }; resolveAccessible(); } if (waitingFocusableElement && !waitingFocusableElement.conditionTimer) { const resolveFocusable = () => { const element = this.getElement(observedName); if (element && documentContains(element.ownerDocument, element) && this._tabster.focusable.isFocusable(element, true)) { resolve(element, waitingFocusableElementKey, waitingFocusableElement, ObservedElementAccessibilities.Focusable); } else { waitingFocusableElement.conditionTimer = win.setTimeout(resolveFocusable, _conditionCheckTimeout); } }; resolveFocusable(); } } }; var UncontrolledAPI = class { constructor(isUncontrolledCompletely) { this._isUncontrolledCompletely = isUncontrolledCompletely; } isUncontrolledCompletely(element, completely) { var _a; const isUncontrolledCompletely = (_a = this._isUncontrolledCompletely) === null || _a === void 0 ? void 0 : _a.call(this, element, completely); return isUncontrolledCompletely === void 0 ? completely : isUncontrolledCompletely; } }; var Restorer = class extends TabsterPart { constructor(tabster, element, props) { var _a; super(tabster, element, props); this._hasFocus = false; this._onFocusOut = (e) => { var _a2; const element2 = (_a2 = this._element) === null || _a2 === void 0 ? void 0 : _a2.get(); if (element2 && e.relatedTarget === null) { element2.dispatchEvent(new RestorerRestoreFocusEvent()); } if (element2 && !dom.nodeContains(element2, e.relatedTarget)) { this._hasFocus = false; } }; this._onFocusIn = () => { this._hasFocus = true; }; if (this._props.type === RestorerTypes.Source) { const element2 = (_a = this._element) === null || _a === void 0 ? void 0 : _a.get(); element2 === null || element2 === void 0 ? void 0 : element2.addEventListener("focusout", this._onFocusOut); element2 === null || element2 === void 0 ? void 0 : element2.addEventListener("focusin", this._onFocusIn); this._hasFocus = dom.nodeContains(element2, element2 && dom.getActiveElement(element2.ownerDocument)); } } dispose() { var _a; if (this._props.type === RestorerTypes.Source) { const element = (_a = this._element) === null || _a === void 0 ? void 0 : _a.get(); element === null || element === void 0 ? void 0 : element.removeEventListener("focusout", this._onFocusOut); element === null || element === void 0 ? void 0 : element.removeEventListener("focusin", this._onFocusIn); if (this._hasFocus) { const doc = this._tabster.getWindow().document; doc.body.dispatchEvent(new RestorerRestoreFocusEvent()); } } } }; var History = class _History { constructor(getWindow2) { this._stack = []; this._getWindow = getWindow2; } /** * Push a weak element to the top of the history stack. * If the stack is full, the bottom weak element is removed. * If the element is already at the top of the stack, it is not duplicated. */ push(element) { var _a; if (((_a = this._stack[this._stack.length - 1]) === null || _a === void 0 ? void 0 : _a.get()) === element) { return; } if (this._stack.length > _History.DEPTH) { this._stack.shift(); } this._stack.push(new WeakHTMLElement(this._getWindow, element)); } /** * Pop the first element from the history that satisfies the callback. * The history is searched from the top to the bottom (from the most recent to the least recent). * * If a weak reference to the element is broken, * or the element is no longer in the DOM, * the element is removed from the top of the stack while popping. * * If no matching element is found, undefined is returned. * If the stack is empty, undefined is returned. */ pop(filter = () => true) { var _a; const doc = this._getWindow().document; for (let index = this._stack.length - 1; index >= 0; index--) { const maybeElement = (_a = this._stack.pop()) === null || _a === void 0 ? void 0 : _a.get(); if (maybeElement && dom.nodeContains(doc.body, dom.getParentElement(maybeElement)) && filter(maybeElement)) { return maybeElement; } } return void 0; } }; History.DEPTH = 10; var RestorerAPI = class { constructor(tabster) { this._onRestoreFocus = (e) => { var _a, _b; this._focusedElementState.cancelAsyncFocus(AsyncFocusSources.Restorer); const source = e.composedPath()[0]; if (source) { const sourceId = (_b = (_a = getTabsterOnElement(this._tabster, source)) === null || _a === void 0 ? void 0 : _a.restorer) === null || _b === void 0 ? void 0 : _b.getProps().id; this._focusedElementState.requestAsyncFocus(AsyncFocusSources.Restorer, () => this._restoreFocus(source, sourceId), 0); } }; this._onFocusIn = (element) => { var _a; if (!element) { return; } const tabsterAttribute = getTabsterOnElement(this._tabster, element); if (((_a = tabsterAttribute === null || tabsterAttribute === void 0 ? void 0 : tabsterAttribute.restorer) === null || _a === void 0 ? void 0 : _a.getProps().type) !== RestorerTypes.Target) { return; } this._history.push(element); }; this._restoreFocus = (source, sourceId) => { var _a; const doc = this._getWindow().document; if (dom.getActiveElement(doc) !== doc.body) { return; } if ( // clicking on any empty space focuses body - this is can be a false positive !this._keyboardNavState.isNavigatingWithKeyboard() && // Source no longer exists on DOM - always restore focus dom.nodeContains(doc.body, source) ) { return; } const getId = (element) => { var _a2, _b; const restorerProps = (_b = (_a2 = getTabsterOnElement(this._tabster, element)) === null || _a2 === void 0 ? void 0 : _a2.restorer) === null || _b === void 0 ? void 0 : _b.getProps(); return restorerProps ? restorerProps.id : null; }; (_a = this._history.pop((target) => sourceId === getId(target))) === null || _a === void 0 ? void 0 : _a.focus(); }; this._tabster = tabster; this._getWindow = tabster.getWindow; this._getWindow().addEventListener(RestorerRestoreFocusEventName, this._onRestoreFocus); this._history = new History(this._getWindow); this._keyboardNavState = tabster.keyboardNavigation; this._focusedElementState = tabster.focusedElement; this._focusedElementState.subscribe(this._onFocusIn); } dispose() { const win = this._getWindow(); this._focusedElementState.unsubscribe(this._onFocusIn); this._focusedElementState.cancelAsyncFocus(AsyncFocusSources.Restorer); win.removeEventListener(RestorerRestoreFocusEventName, this._onRestoreFocus); } createRestorer(element, props) { const restorer = new Restorer(this._tabster, element, props); if (props.type === RestorerTypes.Target && dom.getActiveElement(element.ownerDocument) === element) { this._history.push(element); } return restorer; } }; function getActiveElement(doc) { var _a; let activeElement = doc.activeElement; while ((_a = activeElement === null || activeElement === void 0 ? void 0 : activeElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) { activeElement = activeElement.shadowRoot.activeElement; } return activeElement; } function nodeContains(node, otherNode) { var _a, _b; if (!node || !otherNode) { return false; } let currentNode = otherNode; while (currentNode) { if (currentNode === node) { return true; } if (typeof currentNode.assignedElements !== "function" && ((_a = currentNode.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentNode)) { currentNode = (_b = currentNode.assignedSlot) === null || _b === void 0 ? void 0 : _b.parentNode; } else if (currentNode.nodeType === document.DOCUMENT_FRAGMENT_NODE) { currentNode = currentNode.host; } else { currentNode = currentNode.parentNode; } } return false; } function getParentNode(node) { if (!node) { return null; } if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && node.host) { return node.host; } return node.parentNode; } function getParentElement(element) { for (let parentNode = getParentNode(element); parentNode; parentNode = getParentNode(parentNode)) { if (parentNode.nodeType === Node.ELEMENT_NODE) { return parentNode; } } return null; } function getFirstChild(node) { if (!node) { return null; } if (node.shadowRoot) { const child = getFirstChild(node.shadowRoot); if (child) { return child; } } return node.firstChild; } function getLastChild$1(node) { if (!node) { return null; } if (!node.lastChild && node.shadowRoot) { return getLastChild$1(node.shadowRoot); } return node.lastChild; } function getNextSibling(node) { return (node === null || node === void 0 ? void 0 : node.nextSibling) || null; } function getPreviousSibling(node) { var _a; if (!node) { return null; } let sibling = node.previousSibling; if (!sibling && ((_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.shadowRoot)) { sibling = getLastChild$1(node.parentElement.shadowRoot); } return sibling; } function getFirstElementChild(element) { let child = getFirstChild(element); while (child && child.nodeType !== Node.ELEMENT_NODE) { child = getNextSibling(child); } return child; } function getLastElementChild(element) { let child = getLastChild$1(element); while (child && child.nodeType !== Node.ELEMENT_NODE) { child = getPreviousSibling(child); } return child; } function getNextElementSibling(element) { let sibling = getNextSibling(element); while (sibling && sibling.nodeType !== Node.ELEMENT_NODE) { sibling = getNextSibling(sibling); } return sibling; } function getPreviousElementSibling(element) { let sibling = getPreviousSibling(element); while (sibling && sibling.nodeType !== Node.ELEMENT_NODE) { sibling = getPreviousSibling(sibling); } return sibling; } function appendChild(parent2, child) { const shadowRoot = parent2.shadowRoot; return shadowRoot ? shadowRoot.appendChild(child) : parent2.appendChild(child); } function insertBefore(parent2, child, referenceChild) { const shadowRoot = parent2.shadowRoot; return shadowRoot ? shadowRoot.insertBefore(child, referenceChild) : parent2.insertBefore(child, referenceChild); } function getSelection(ref) { var _a; const win = (_a = ref.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView; if (!win) { return null; } for (let el = ref; el; el = el.parentNode) { if (el.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { const tmp = el; if (tmp.getSelection) { return tmp.getSelection() || null; } break; } } return win.getSelection() || null; } function getElementsByName(referenceElement, name) { for (let el = referenceElement; el; el = el.parentNode) { if (el.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { return el.querySelectorAll(`[name=${name}]`); } } return referenceElement.ownerDocument.getElementsByName(name); } function getLastChild(container) { let lastChild = null; for (let i = getLastElementChild(container); i; i = getLastElementChild(i)) { lastChild = i; } return lastChild || void 0; } var ShadowTreeWalker = class { constructor(doc, root, whatToShow, filter) { this._walkerStack = []; this._currentSetFor = /* @__PURE__ */ new Set(); this._acceptNode = (node) => { var _a; if (node.nodeType === Node.ELEMENT_NODE) { const shadowRoot2 = node.shadowRoot; if (shadowRoot2) { const walker = this._doc.createTreeWalker(shadowRoot2, this.whatToShow, { acceptNode: this._acceptNode }); this._walkerStack.unshift(walker); return NodeFilter.FILTER_ACCEPT; } else { if (typeof this.filter === "function") { return this.filter(node); } else if ((_a = this.filter) === null || _a === void 0 ? void 0 : _a.acceptNode) { return this.filter.acceptNode(node); } else if (this.filter === null) { return NodeFilter.FILTER_ACCEPT; } } } return NodeFilter.FILTER_SKIP; }; this._doc = doc; this.root = root; this.filter = filter !== null && filter !== void 0 ? filter : null; this.whatToShow = whatToShow !== null && whatToShow !== void 0 ? whatToShow : NodeFilter.SHOW_ALL; this._currentNode = root; this._walkerStack.unshift(doc.createTreeWalker(root, whatToShow, this._acceptNode)); const shadowRoot = root.shadowRoot; if (shadowRoot) { const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, { acceptNode: this._acceptNode }); this._walkerStack.unshift(walker); } } get currentNode() { return this._currentNode; } set currentNode(node) { if (!nodeContains(this.root, node)) { throw new Error("Cannot set currentNode to a node that is not contained by the root node."); } const walkers = []; let curNode = node; let currentWalkerCurrentNode = node; this._currentNode = node; while (curNode && curNode !== this.root) { if (curNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { const shadowRoot = curNode; const walker2 = this._doc.createTreeWalker(shadowRoot, this.whatToShow, { acceptNode: this._acceptNode }); walkers.push(walker2); walker2.currentNode = currentWalkerCurrentNode; this._currentSetFor.add(walker2); curNode = currentWalkerCurrentNode = shadowRoot.host; } else { curNode = curNode.parentNode; } } const walker = this._doc.createTreeWalker(this.root, this.whatToShow, { acceptNode: this._acceptNode }); walkers.push(walker); walker.currentNode = currentWalkerCurrentNode; this._currentSetFor.add(walker); this._walkerStack = walkers; } firstChild() { if (true) { throw new Error("Method not implemented."); } return null; } lastChild() { if (true) { throw new Error("Method not implemented."); } return null; } nextNode() { var _a; const nextNode = this._walkerStack[0].nextNode(); if (nextNode) { const shadowRoot = nextNode.shadowRoot; if (shadowRoot) { let nodeResult; if (typeof this.filter === "function") { nodeResult = this.filter(nextNode); } else if ((_a = this.filter) === null || _a === void 0 ? void 0 : _a.acceptNode) { nodeResult = this.filter.acceptNode(nextNode); } if (nodeResult === NodeFilter.FILTER_ACCEPT) { return nextNode; } return this.nextNode(); } return nextNode; } else { if (this._walkerStack.length > 1) { this._walkerStack.shift(); return this.nextNode(); } else { return null; } } } previousNode() { var _a, _b; const currentWalker = this._walkerStack[0]; if (currentWalker.currentNode === currentWalker.root) { if (this._currentSetFor.has(currentWalker)) { this._currentSetFor.delete(currentWalker); if (this._walkerStack.length > 1) { this._walkerStack.shift(); return this.previousNode(); } else { return null; } } const lastChild = getLastChild(currentWalker.root); if (lastChild) { currentWalker.currentNode = lastChild; let nodeResult; if (typeof this.filter === "function") { nodeResult = this.filter(lastChild); } else if ((_a = this.filter) === null || _a === void 0 ? void 0 : _a.acceptNode) { nodeResult = this.filter.acceptNode(lastChild); } if (nodeResult === NodeFilter.FILTER_ACCEPT) { return lastChild; } } } const previousNode = currentWalker.previousNode(); if (previousNode) { const shadowRoot = previousNode.shadowRoot; if (shadowRoot) { let nodeResult; if (typeof this.filter === "function") { nodeResult = this.filter(previousNode); } else if ((_b = this.filter) === null || _b === void 0 ? void 0 : _b.acceptNode) { nodeResult = this.filter.acceptNode(previousNode); } if (nodeResult === NodeFilter.FILTER_ACCEPT) { return previousNode; } return this.previousNode(); } return previousNode; } else { if (this._walkerStack.length > 1) { this._walkerStack.shift(); return this.previousNode(); } else { return null; } } } nextSibling() { if (true) { throw new Error("Method not implemented."); } return null; } previousSibling() { if (true) { throw new Error("Method not implemented."); } return null; } parentNode() { if (true) { throw new Error("Method not implemented."); } return null; } }; function createShadowTreeWalker(doc, root, whatToShow, filter) { return new ShadowTreeWalker(doc, root, whatToShow, filter); } var ShadowMutationObserver = class _ShadowMutationObserver { static _overrideAttachShadow(win) { const origAttachShadow = win.Element.prototype.attachShadow; if (origAttachShadow.__origAttachShadow) { return; } Element.prototype.attachShadow = function(options) { const shadowRoot = origAttachShadow.call(this, options); for (const shadowObserver of _ShadowMutationObserver._shadowObservers) { shadowObserver._addSubObserver(shadowRoot); } return shadowRoot; }; Element.prototype.attachShadow.__origAttachShadow = origAttachShadow; } constructor(callback) { this._isObserving = false; this._callbackWrapper = (mutations, observer) => { for (const mutation of mutations) { if (mutation.type === "childList") { const removed = mutation.removedNodes; const added = mutation.addedNodes; for (let i = 0; i < removed.length; i++) { this._walkShadows(removed[i], true); } for (let i = 0; i < added.length; i++) { this._walkShadows(added[i]); } } } this._callback(mutations, observer); }; this._callback = callback; this._observer = new MutationObserver(this._callbackWrapper); this._subObservers = /* @__PURE__ */ new Map(); } _addSubObserver(shadowRoot) { if (!this._options || !this._callback || this._subObservers.has(shadowRoot)) { return; } if (this._options.subtree && nodeContains(this._root, shadowRoot)) { const subObserver = new MutationObserver(this._callbackWrapper); this._subObservers.set(shadowRoot, subObserver); if (this._isObserving) { subObserver.observe(shadowRoot, this._options); } this._walkShadows(shadowRoot); } } disconnect() { this._isObserving = false; delete this._options; _ShadowMutationObserver._shadowObservers.delete(this); for (const subObserver of this._subObservers.values()) { subObserver.disconnect(); } this._subObservers.clear(); this._observer.disconnect(); } observe(target, options) { const doc = target.nodeType === Node.DOCUMENT_NODE ? target : target.ownerDocument; const win = doc === null || doc === void 0 ? void 0 : doc.defaultView; if (!doc || !win) { return; } _ShadowMutationObserver._overrideAttachShadow(win); _ShadowMutationObserver._shadowObservers.add(this); this._root = target; this._options = options; this._isObserving = true; this._observer.observe(target, options); this._walkShadows(target); } _walkShadows(target, remove) { const doc = target.nodeType === Node.DOCUMENT_NODE ? target : target.ownerDocument; if (!doc) { return; } if (target === doc) { target = doc.body; } else { const shadowRoot = target.shadowRoot; if (shadowRoot) { this._addSubObserver(shadowRoot); return; } } const walker = doc.createTreeWalker(target, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => { if (node.nodeType === Node.ELEMENT_NODE) { if (remove) { const subObserver = this._subObservers.get(node); if (subObserver) { subObserver.disconnect(); this._subObservers.delete(node); } } else { const shadowRoot = node.shadowRoot; if (shadowRoot) { this._addSubObserver(shadowRoot); } } } return NodeFilter.FILTER_SKIP; } }); walker.nextNode(); } takeRecords() { const records = this._observer.takeRecords(); for (const subObserver of this._subObservers.values()) { records.push(...subObserver.takeRecords()); } return records; } }; ShadowMutationObserver._shadowObservers = /* @__PURE__ */ new Set(); function createShadowMutationObserver(callback) { return new ShadowMutationObserver(callback); } function shadowQuerySelector(node, selector, all) { const elements = []; walk(node, selector); return elements; function walk(from, selector2) { let el = null; const walker = document.createTreeWalker(from, NodeFilter.SHOW_ELEMENT, { acceptNode: (n) => { if (n.nodeType === Node.ELEMENT_NODE) { if (n.matches(selector2)) { el = n; elements.push(el); return all ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT; } const shadowRoot = n.shadowRoot; if (shadowRoot) { walk(shadowRoot, selector2); return !all && elements.length ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } } return NodeFilter.FILTER_SKIP; } }); walker.nextNode(); } } function querySelectorAll(node, selector) { return shadowQuerySelector(node, selector, true); } function querySelector(node, selector) { return shadowQuerySelector(node, selector, false)[0] || null; } function getElementById(doc, id) { return querySelector(doc, "#" + id); } var shadowDOMAPI = Object.freeze({ __proto__: null, appendChild, createMutationObserver: createShadowMutationObserver, createTreeWalker: createShadowTreeWalker, getActiveElement, getElementById, getElementsByName, getFirstChild, getFirstElementChild, getLastChild: getLastChild$1, getLastElementChild, getNextElementSibling, getNextSibling, getParentElement, getParentNode, getPreviousElementSibling, getPreviousSibling, getSelection, insertBefore, nodeContains, querySelector, querySelectorAll }); var Tabster = class { constructor(tabster) { this.keyboardNavigation = tabster.keyboardNavigation; this.focusedElement = tabster.focusedElement; this.focusable = tabster.focusable; this.root = tabster.root; this.uncontrolled = tabster.uncontrolled; this.core = tabster; } }; var TabsterCore = class { constructor(win, props) { var _a, _b; this._forgetMemorizedElements = []; this._wrappers = /* @__PURE__ */ new Set(); this._initQueue = []; this._version = "8.7.0"; this._noop = false; this.getWindow = () => { if (!this._win) { throw new Error("Using disposed Tabster."); } return this._win; }; this._storage = createWeakMap(win); this._win = win; const getWindow2 = this.getWindow; if (props === null || props === void 0 ? void 0 : props.DOMAPI) { setDOMAPI({ ...props.DOMAPI }); } this.keyboardNavigation = new KeyboardNavigationState(getWindow2); this.focusedElement = new FocusedElementState(this, getWindow2); this.focusable = new FocusableAPI(this); this.root = new RootAPI(this, props === null || props === void 0 ? void 0 : props.autoRoot); this.uncontrolled = new UncontrolledAPI( // TODO: Remove checkUncontrolledTrappingFocus in the next major version. (props === null || props === void 0 ? void 0 : props.checkUncontrolledCompletely) || (props === null || props === void 0 ? void 0 : props.checkUncontrolledTrappingFocus) ); this.controlTab = (_a = props === null || props === void 0 ? void 0 : props.controlTab) !== null && _a !== void 0 ? _a : true; this.rootDummyInputs = !!(props === null || props === void 0 ? void 0 : props.rootDummyInputs); this._dummyObserver = new DummyInputObserver(getWindow2); this.getParent = (_b = props === null || props === void 0 ? void 0 : props.getParent) !== null && _b !== void 0 ? _b : dom.getParentNode; this.internal = { stopObserver: () => { if (this._unobserve) { this._unobserve(); delete this._unobserve; } }, resumeObserver: (syncState) => { if (!this._unobserve) { const doc = getWindow2().document; this._unobserve = observeMutations(doc, this, updateTabsterByAttribute, syncState); } } }; startFakeWeakRefsCleanup(getWindow2); this.queueInit(() => { this.internal.resumeObserver(true); }); } /** * Merges external props with the current props. Not all * props can/should be mergeable, so let's add more as we move on. * @param props Tabster props */ _mergeProps(props) { var _a; if (!props) { return; } this.getParent = (_a = props.getParent) !== null && _a !== void 0 ? _a : this.getParent; } createTabster(noRefCount, props) { const wrapper = new Tabster(this); if (!noRefCount) { this._wrappers.add(wrapper); } this._mergeProps(props); return wrapper; } disposeTabster(wrapper, allInstances) { if (allInstances) { this._wrappers.clear(); } else { this._wrappers.delete(wrapper); } if (this._wrappers.size === 0) { this.dispose(); } } dispose() { var _a, _b, _c, _d, _e, _f, _g, _h; this.internal.stopObserver(); const win = this._win; win === null || win === void 0 ? void 0 : win.clearTimeout(this._initTimer); delete this._initTimer; this._initQueue = []; this._forgetMemorizedElements = []; if (win && this._forgetMemorizedTimer) { win.clearTimeout(this._forgetMemorizedTimer); delete this._forgetMemorizedTimer; } (_a = this.outline) === null || _a === void 0 ? void 0 : _a.dispose(); (_b = this.crossOrigin) === null || _b === void 0 ? void 0 : _b.dispose(); (_c = this.deloser) === null || _c === void 0 ? void 0 : _c.dispose(); (_d = this.groupper) === null || _d === void 0 ? void 0 : _d.dispose(); (_e = this.mover) === null || _e === void 0 ? void 0 : _e.dispose(); (_f = this.modalizer) === null || _f === void 0 ? void 0 : _f.dispose(); (_g = this.observedElement) === null || _g === void 0 ? void 0 : _g.dispose(); (_h = this.restorer) === null || _h === void 0 ? void 0 : _h.dispose(); this.keyboardNavigation.dispose(); this.focusable.dispose(); this.focusedElement.dispose(); this.root.dispose(); this._dummyObserver.dispose(); stopFakeWeakRefsCleanupAndClearStorage(this.getWindow); clearElementCache(this.getWindow); this._storage = /* @__PURE__ */ new WeakMap(); this._wrappers.clear(); if (win) { disposeInstanceContext(win); delete win.__tabsterInstance; delete this._win; } } storageEntry(element, addremove) { const storage = this._storage; let entry = storage.get(element); if (entry) { if (addremove === false && Object.keys(entry).length === 0) { storage.delete(element); } } else if (addremove === true) { entry = {}; storage.set(element, entry); } return entry; } forceCleanup() { if (!this._win) { return; } this._forgetMemorizedElements.push(this._win.document.body); if (this._forgetMemorizedTimer) { return; } this._forgetMemorizedTimer = this._win.setTimeout(() => { delete this._forgetMemorizedTimer; for (let el = this._forgetMemorizedElements.shift(); el; el = this._forgetMemorizedElements.shift()) { clearElementCache(this.getWindow, el); FocusedElementState.forgetMemorized(this.focusedElement, el); } }, 0); cleanupFakeWeakRefs(this.getWindow, true); } queueInit(callback) { var _a; if (!this._win) { return; } this._initQueue.push(callback); if (!this._initTimer) { this._initTimer = (_a = this._win) === null || _a === void 0 ? void 0 : _a.setTimeout(() => { delete this._initTimer; this.drainInitQueue(); }, 0); } } drainInitQueue() { if (!this._win) { return; } const queue = this._initQueue; this._initQueue = []; queue.forEach((callback) => callback()); } }; function createTabster(win, props) { let tabster = getCurrentTabster(win); if (tabster) { return tabster.createTabster(false, props); } tabster = new TabsterCore(win, props); win.__tabsterInstance = tabster; return tabster.createTabster(); } function getGroupper(tabster) { const tabsterCore = tabster.core; if (!tabsterCore.groupper) { tabsterCore.groupper = new GroupperAPI(tabsterCore, tabsterCore.getWindow); } return tabsterCore.groupper; } function getMover(tabster) { const tabsterCore = tabster.core; if (!tabsterCore.mover) { tabsterCore.mover = new MoverAPI(tabsterCore, tabsterCore.getWindow); } return tabsterCore.mover; } function getModalizer(tabster, alwaysAccessibleSelector, accessibleCheck) { const tabsterCore = tabster.core; if (!tabsterCore.modalizer) { tabsterCore.modalizer = new ModalizerAPI(tabsterCore, alwaysAccessibleSelector, accessibleCheck); } return tabsterCore.modalizer; } function getObservedElement(tabster) { const tabsterCore = tabster.core; if (!tabsterCore.observedElement) { tabsterCore.observedElement = new ObservedElementAPI(tabsterCore); } return tabsterCore.observedElement; } function getRestorer(tabster) { const tabsterCore = tabster.core; if (!tabsterCore.restorer) { tabsterCore.restorer = new RestorerAPI(tabsterCore); } return tabsterCore.restorer; } function disposeTabster(tabster, allInstances) { tabster.core.disposeTabster(tabster, allInstances); } function getCurrentTabster(win) { return win.__tabsterInstance; } var Types = Object.freeze({ __proto__: null }); var EventsTypes = Object.freeze({ __proto__: null }); // node_modules/@fluentui/react-tabster/lib/hooks/useTabster.js var React42 = __toESM(require_react()); var DEFAULT_FACTORY = (tabster) => { return tabster; }; function createTabsterWithConfig(targetDocument) { const defaultView = (targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView) || void 0; const shadowDOMAPI2 = defaultView === null || defaultView === void 0 ? void 0 : defaultView.__tabsterShadowDOMAPI; if (defaultView) { return createTabster(defaultView, { autoRoot: {}, controlTab: false, getParent, // The non-undefined return value of checkUncontrolledCompletely() dominates the value that the element might // have in its `uncontrolled: { completely: true }` part of the tabster attribute. We must make sure to return // undefined if we want the value from tabster attribute to be respected. checkUncontrolledCompletely: (element) => { var _element_firstElementChild; return ((_element_firstElementChild = element.firstElementChild) === null || _element_firstElementChild === void 0 ? void 0 : _element_firstElementChild.hasAttribute("data-is-focus-trap-zone-bumper")) === true || void 0; }, DOMAPI: shadowDOMAPI2 }); } } function useTabster(factory = DEFAULT_FACTORY) { const { targetDocument } = useFluent(); const factoryResultRef = React42.useRef(null); useIsomorphicLayoutEffect(() => { const tabster = createTabsterWithConfig(targetDocument); if (tabster) { factoryResultRef.current = factory(tabster); return () => { disposeTabster(tabster); factoryResultRef.current = null; }; } }, [ targetDocument, factory ]); if (true) { const previousFactory = usePrevious(factory); if (previousFactory !== null && previousFactory !== factory) { throw new Error([ "@fluentui/react-tabster: ", "The factory function passed to useTabster has changed. This should not ever happen." ].join("\n")); } } return factoryResultRef; } // node_modules/@fluentui/react-tabster/lib/hooks/useTabsterAttributes.js var React43 = __toESM(require_react()); var useTabsterAttributes = (props) => { useTabster(); const strAttr = getTabsterAttribute(props, true); return React43.useMemo(() => ({ [TABSTER_ATTRIBUTE_NAME]: strAttr }), [ strAttr ]); }; // node_modules/@fluentui/react-tabster/lib/hooks/useArrowNavigationGroup.js var useArrowNavigationGroup = (options = {}) => { const { circular, axis, memorizeCurrent = true, tabbable, ignoreDefaultKeydown, // eslint-disable-next-line @typescript-eslint/naming-convention unstable_hasDefault } = options; useTabster(getMover); return useTabsterAttributes({ mover: { cyclic: !!circular, direction: axisToMoverDirection(axis !== null && axis !== void 0 ? axis : "vertical"), memorizeCurrent, tabbable, hasDefault: unstable_hasDefault }, ...ignoreDefaultKeydown && { focusable: { ignoreKeydown: ignoreDefaultKeydown } } }); }; function axisToMoverDirection(axis) { switch (axis) { case "horizontal": return MoverDirections.Horizontal; case "grid": return MoverDirections.Grid; case "grid-linear": return MoverDirections.GridLinear; case "both": return MoverDirections.Both; case "vertical": default: return MoverDirections.Vertical; } } // node_modules/@fluentui/react-tabster/lib/hooks/useFocusableGroup.js var useFocusableGroup = (options) => { useTabster(getGroupper); return useTabsterAttributes({ groupper: { tabbability: getTabbability(options === null || options === void 0 ? void 0 : options.tabBehavior) }, focusable: { ignoreKeydown: options === null || options === void 0 ? void 0 : options.ignoreDefaultKeydown } }); }; var getTabbability = (tabBehavior) => { switch (tabBehavior) { case "unlimited": return GroupperTabbabilities.Unlimited; case "limited": return GroupperTabbabilities.Limited; case "limited-trap-focus": return GroupperTabbabilities.LimitedTrapFocus; default: return void 0; } }; // node_modules/@fluentui/react-tabster/lib/hooks/useFocusFinders.js var React44 = __toESM(require_react()); var useFocusFinders = () => { const tabsterRef = useTabster(); const { targetDocument } = useFluent(); const findAllFocusable = React44.useCallback((container, acceptCondition) => { var _tabsterRef_current; return container && ((_tabsterRef_current = tabsterRef.current) === null || _tabsterRef_current === void 0 ? void 0 : _tabsterRef_current.focusable.findAll({ container, acceptCondition })) || []; }, [ tabsterRef ]); const findFirstFocusable = React44.useCallback((container) => { var _tabsterRef_current; return container && ((_tabsterRef_current = tabsterRef.current) === null || _tabsterRef_current === void 0 ? void 0 : _tabsterRef_current.focusable.findFirst({ container })); }, [ tabsterRef ]); const findLastFocusable = React44.useCallback((container) => { var _tabsterRef_current; return container && ((_tabsterRef_current = tabsterRef.current) === null || _tabsterRef_current === void 0 ? void 0 : _tabsterRef_current.focusable.findLast({ container })); }, [ tabsterRef ]); const findNextFocusable = React44.useCallback((currentElement, options = {}) => { if (!tabsterRef.current || !targetDocument || !currentElement) { return null; } const { container = targetDocument.body } = options; return tabsterRef.current.focusable.findNext({ currentElement, container }); }, [ tabsterRef, targetDocument ]); const findPrevFocusable = React44.useCallback((currentElement, options = {}) => { if (!tabsterRef.current || !targetDocument || !currentElement) { return null; } const { container = targetDocument.body } = options; return tabsterRef.current.focusable.findPrev({ currentElement, container }); }, [ tabsterRef, targetDocument ]); return { findAllFocusable, findFirstFocusable, findLastFocusable, findNextFocusable, findPrevFocusable }; }; // node_modules/@fluentui/react-tabster/lib/hooks/useFocusVisible.js var React45 = __toESM(require_react()); // node_modules/@fluentui/react-tabster/lib/focus/constants.js var KEYBOARD_NAV_ATTRIBUTE = "data-keyboard-nav"; var KEYBOARD_NAV_SELECTOR = `:global([${KEYBOARD_NAV_ATTRIBUTE}])`; var FOCUS_VISIBLE_ATTR = "data-fui-focus-visible"; var FOCUS_WITHIN_ATTR = "data-fui-focus-within"; var defaultOptions = { style: {}, selector: "focus", customizeSelector: (selector) => selector }; // node_modules/@fluentui/react-tabster/lib/focus/focusVisiblePolyfill.js function applyFocusVisiblePolyfill(scope, targetWindow) { if (alreadyInScope(scope)) { return () => void 0; } const state = { current: void 0 }; const keyborg = createKeyborg(targetWindow); function registerElementIfNavigating(el) { if (keyborg.isNavigatingWithKeyboard() && isHTMLElement(el)) { state.current = el; el.setAttribute(FOCUS_VISIBLE_ATTR, ""); } } function disposeCurrentElement() { if (state.current) { state.current.removeAttribute(FOCUS_VISIBLE_ATTR); state.current = void 0; } } keyborg.subscribe((isNavigatingWithKeyboard) => { if (!isNavigatingWithKeyboard) { disposeCurrentElement(); } else { registerElementIfNavigating(targetWindow.document.activeElement); } }); const keyborgListener = (e) => { disposeCurrentElement(); const target = e.composedPath()[0]; registerElementIfNavigating(target); }; const blurListener = (e) => { if (!e.relatedTarget || isHTMLElement(e.relatedTarget) && !scope.contains(e.relatedTarget)) { disposeCurrentElement(); } }; scope.addEventListener(KEYBORG_FOCUSIN, keyborgListener); scope.addEventListener("focusout", blurListener); scope.focusVisible = true; if (scope.contains(targetWindow.document.activeElement)) { registerElementIfNavigating(targetWindow.document.activeElement); } return () => { disposeCurrentElement(); scope.removeEventListener(KEYBORG_FOCUSIN, keyborgListener); scope.removeEventListener("focusout", blurListener); scope.focusVisible = void 0; disposeKeyborg(keyborg); }; } function alreadyInScope(el) { if (!el) { return false; } if (el.focusVisible) { return true; } return alreadyInScope(el === null || el === void 0 ? void 0 : el.parentElement); } // node_modules/@fluentui/react-tabster/lib/hooks/useFocusVisible.js function useFocusVisible(options = {}) { const contextValue = useFluent(); const scopeRef = React45.useRef(null); var _options_targetDocument; const targetDocument = (_options_targetDocument = options.targetDocument) !== null && _options_targetDocument !== void 0 ? _options_targetDocument : contextValue.targetDocument; React45.useEffect(() => { if ((targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView) && scopeRef.current) { return applyFocusVisiblePolyfill(scopeRef.current, targetDocument.defaultView); } }, [ scopeRef, targetDocument ]); return scopeRef; } // node_modules/@fluentui/react-tabster/lib/hooks/useFocusWithin.js var React46 = __toESM(require_react()); // node_modules/@fluentui/react-tabster/lib/focus/focusWithinPolyfill.js function applyFocusWithinPolyfill(element, win) { const keyborg = createKeyborg(win); keyborg.subscribe((isNavigatingWithKeyboard) => { if (!isNavigatingWithKeyboard) { removeFocusWithinClass(element); } }); const keyborgListener = (e) => { if (keyborg.isNavigatingWithKeyboard() && isHTMLElement2(e.target)) { applyFocusWithinClass(element); } }; const blurListener = (e) => { if (!e.relatedTarget || isHTMLElement2(e.relatedTarget) && !element.contains(e.relatedTarget)) { removeFocusWithinClass(element); } }; element.addEventListener(KEYBORG_FOCUSIN, keyborgListener); element.addEventListener("focusout", blurListener); return () => { element.removeEventListener(KEYBORG_FOCUSIN, keyborgListener); element.removeEventListener("focusout", blurListener); disposeKeyborg(keyborg); }; } function applyFocusWithinClass(el) { el.setAttribute(FOCUS_WITHIN_ATTR, ""); } function removeFocusWithinClass(el) { el.removeAttribute(FOCUS_WITHIN_ATTR); } function isHTMLElement2(target) { if (!target) { return false; } return Boolean(target && typeof target === "object" && "classList" in target && "contains" in target); } // node_modules/@fluentui/react-tabster/lib/hooks/useFocusWithin.js function useFocusWithin() { const { targetDocument } = useFluent(); const elementRef = React46.useRef(null); React46.useEffect(() => { if ((targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView) && elementRef.current) { return applyFocusWithinPolyfill(elementRef.current, targetDocument.defaultView); } }, [ elementRef, targetDocument ]); return elementRef; } // node_modules/@fluentui/react-tabster/lib/hooks/useKeyboardNavAttribute.js var React47 = __toESM(require_react()); function useKeyboardNavAttribute() { const { targetDocument } = useFluent(); const keyborg = React47.useMemo(() => targetDocument && createKeyborg(targetDocument.defaultView), [ targetDocument ]); const ref = React47.useRef(null); React47.useEffect(() => { if (keyborg) { setBooleanAttribute(ref, KEYBOARD_NAV_ATTRIBUTE, keyborg.isNavigatingWithKeyboard()); const cb = (next) => { setBooleanAttribute(ref, KEYBOARD_NAV_ATTRIBUTE, next); }; keyborg.subscribe(cb); return () => keyborg.unsubscribe(cb); } }, [ keyborg ]); return ref; } function setBooleanAttribute(elementRef, attribute, value) { if (!elementRef.current) { return; } if (value) { elementRef.current.setAttribute(attribute, ""); } else { elementRef.current.removeAttribute(attribute); } } // node_modules/@fluentui/react-tabster/lib/hooks/useOnKeyboardNavigationChange.js var React49 = __toESM(require_react()); // node_modules/@fluentui/react-tabster/lib/hooks/useKeyborgRef.js var React48 = __toESM(require_react()); function useKeyborgRef() { const { targetDocument } = useFluent(); const keyborgRef = React48.useRef(null); React48.useEffect(() => { const targetWindow = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView; if (targetWindow) { const keyborg = createKeyborg(targetWindow); keyborgRef.current = keyborg; return () => { disposeKeyborg(keyborg); keyborgRef.current = null; }; } }, [ targetDocument ]); return keyborgRef; } // node_modules/@fluentui/react-tabster/lib/hooks/useOnKeyboardNavigationChange.js function useOnKeyboardNavigationChange(callback) { const keyborgRef = useKeyborgRef(); const eventCallback = useEventCallback(callback); React49.useEffect(() => { const keyborg = keyborgRef.current; if (keyborg) { const cb = (next) => { eventCallback(next); }; keyborg.subscribe(cb); cb(keyborg.isNavigatingWithKeyboard()); return () => { keyborg.unsubscribe(cb); }; } }, [ keyborgRef, eventCallback ]); } // node_modules/@fluentui/react-tabster/lib/hooks/useModalAttributes.js var DangerousNeverHiddenAttribute = "data-tabster-never-hide"; var DangerousNeverHiddenPropObject = { [DangerousNeverHiddenAttribute]: "" }; function useDangerousNeverHidden_unstable() { return DangerousNeverHiddenPropObject; } var tabsterAccessibleCheck = (element) => { return element.hasAttribute(DangerousNeverHiddenAttribute); }; function initTabsterModules(tabster) { getModalizer(tabster, void 0, tabsterAccessibleCheck); getRestorer(tabster); } var useModalAttributes = (options = {}) => { const { trapFocus, alwaysFocusable, legacyTrapFocus } = options; useTabster(initTabsterModules); const id = useId2("modal-", options.id); const modalAttributes = useTabsterAttributes({ restorer: { type: RestorerTypes.Source }, ...trapFocus && { modalizer: { id, isOthersAccessible: !trapFocus, isAlwaysAccessible: alwaysFocusable, isTrapped: legacyTrapFocus && trapFocus } } }); const triggerAttributes = useTabsterAttributes({ restorer: { type: RestorerTypes.Target } }); return { modalAttributes, triggerAttributes }; }; // node_modules/@fluentui/react-tabster/lib/hooks/useObservedElement.js function useObservedElement(name) { useTabster(getObservedElement); return useTabsterAttributes({ observed: { names: Array.isArray(name) ? name : [ name ] } }); } // node_modules/@fluentui/react-tabster/lib/hooks/useMergeTabsterAttributes.js var React50 = __toESM(require_react()); var useMergedTabsterAttributes_unstable = (...attributes) => { "use no memo"; const stringAttributes = attributes.reduce((acc, curr) => { if (curr === null || curr === void 0 ? void 0 : curr[TABSTER_ATTRIBUTE_NAME]) { acc.push(curr[TABSTER_ATTRIBUTE_NAME]); } return acc; }, []); if (true) { useWarnIfUnstableAttributes(stringAttributes); } return React50.useMemo( () => ({ [TABSTER_ATTRIBUTE_NAME]: stringAttributes.length > 0 ? stringAttributes.reduce(mergeJSONStrings) : void 0 }), // disable exhaustive-deps because we want to memoize the result of the reduction // this is safe because the collection of attributes is not expected to change at runtime // eslint-disable-next-line react-hooks/exhaustive-deps stringAttributes ); }; var mergeJSONStrings = (a, b) => JSON.stringify(Object.assign(safelyParseJSON(a), safelyParseJSON(b))); var safelyParseJSON = (json) => { try { return JSON.parse(json); } catch { return {}; } }; var useWarnIfUnstableAttributes = (attributes) => { "use no memo"; const initialAttributesRef = React50.useRef(attributes); let isStable = initialAttributesRef.current.length === attributes.length; if (initialAttributesRef.current !== attributes && isStable) { for (let i = 0; i < attributes.length; i++) { if (initialAttributesRef.current[i] !== attributes[i]) { isStable = false; break; } } } React50.useEffect(() => { if (!isStable) { const error = new Error(); console.warn( /** #__DE-INDENT__ */ ` @fluentui/react-tabster [useMergedTabsterAttributes]: The attributes passed to the hook changed at runtime. This might lead to unexpected behavior, please ensure that the attributes are stable. ${error.stack} ` ); } }, [ isStable ]); }; // node_modules/@fluentui/react-tabster/lib/hooks/useFocusObserved.js var React51 = __toESM(require_react()); function useFocusObserved(name, options = {}) { const { timeout = 1e3 } = options; const observedAPIRef = useTabster(getObservedElement); return React51.useCallback(() => { const observerAPI = observedAPIRef.current; if (observerAPI) { return observerAPI.requestFocus(name, timeout); } return { result: Promise.resolve(false), cancel: () => null }; }, [ observedAPIRef, name, timeout ]); } // node_modules/@fluentui/react-tabster/lib/hooks/useRestoreFocus.js function useRestoreFocusTarget() { useTabster(getRestorer); return getTabsterAttribute({ restorer: { type: RestorerTypes.Target } }); } function useRestoreFocusSource() { useTabster(getRestorer); return getTabsterAttribute({ restorer: { type: RestorerTypes.Source } }); } // node_modules/@fluentui/react-tabster/lib/hooks/useUncontrolledFocus.js function useUncontrolledFocus() { useTabster(); return getTabsterAttribute({ uncontrolled: {} }); } // node_modules/@fluentui/react-tabster/lib/hooks/useIsNavigatingWithKeyboard.js var React52 = __toESM(require_react()); function useIsNavigatingWithKeyboard() { const keyborgRef = useKeyborgRef(); return React52.useCallback(() => { var _keyborgRef_current; var _keyborgRef_current_isNavigatingWithKeyboard; return (_keyborgRef_current_isNavigatingWithKeyboard = (_keyborgRef_current = keyborgRef.current) === null || _keyborgRef_current === void 0 ? void 0 : _keyborgRef_current.isNavigatingWithKeyboard()) !== null && _keyborgRef_current_isNavigatingWithKeyboard !== void 0 ? _keyborgRef_current_isNavigatingWithKeyboard : false; }, [ keyborgRef ]); } // node_modules/@fluentui/react-tabster/lib/hooks/useSetKeyboardNavigation.js var React53 = __toESM(require_react()); function useSetKeyboardNavigation() { const keyborgRef = useKeyborgRef(); return React53.useCallback((isNavigatingWithKeyboard) => { var _keyborgRef_current; (_keyborgRef_current = keyborgRef.current) === null || _keyborgRef_current === void 0 ? void 0 : _keyborgRef_current.setVal(isNavigatingWithKeyboard); }, [ keyborgRef ]); } // node_modules/@fluentui/react-tabster/lib/hooks/useFocusedElementChange.js var React54 = __toESM(require_react()); function useFocusedElementChange(callback) { const { targetDocument } = useFluent(); const listener = useEventCallback(callback); React54.useEffect(() => { const tabster = createTabsterWithConfig(targetDocument); if (tabster) { tabster.focusedElement.subscribe(listener); return () => { tabster.focusedElement.unsubscribe(listener); disposeTabster(tabster); }; } }, [ listener, targetDocument ]); } // node_modules/@fluentui/react-tabster/lib/hooks/useActivateModal.js var React55 = __toESM(require_react()); function useActivateModal() { const modalizerRefAPI = useTabster(getModalizer); const [setActivateModalTimeout] = useTimeout(); const activateModal = React55.useCallback((elementFromModal) => { setActivateModalTimeout(() => { var _modalizerRefAPI_current; (_modalizerRefAPI_current = modalizerRefAPI.current) === null || _modalizerRefAPI_current === void 0 ? void 0 : _modalizerRefAPI_current.activate(elementFromModal); }, 0); }, [ modalizerRefAPI, setActivateModalTimeout ]); return activateModal; } // node_modules/@fluentui/react-tabster/lib/focus/createCustomFocusIndicatorStyle.js function createCustomFocusIndicatorStyle(style, { selector: selectorType = defaultOptions.selector, customizeSelector = defaultOptions.customizeSelector } = defaultOptions) { return { [customizeSelector(createBaseSelector(selectorType))]: style }; } function createBaseSelector(selectorType) { switch (selectorType) { case "focus": return `&[${FOCUS_VISIBLE_ATTR}]`; case "focus-within": return `&[${FOCUS_WITHIN_ATTR}]:focus-within`; } } // node_modules/@fluentui/tokens/lib/global/colors.js var grey = { "2": "#050505", "4": "#0a0a0a", "6": "#0f0f0f", "8": "#141414", "10": "#1a1a1a", "12": "#1f1f1f", "14": "#242424", "16": "#292929", "18": "#2e2e2e", "20": "#333333", "22": "#383838", "24": "#3d3d3d", "26": "#424242", "28": "#474747", "30": "#4d4d4d", "32": "#525252", "34": "#575757", "36": "#5c5c5c", "38": "#616161", "40": "#666666", "42": "#6b6b6b", "44": "#707070", "46": "#757575", "48": "#7a7a7a", "50": "#808080", "52": "#858585", "54": "#8a8a8a", "56": "#8f8f8f", "58": "#949494", "60": "#999999", "62": "#9e9e9e", "64": "#a3a3a3", "66": "#a8a8a8", "68": "#adadad", "70": "#b3b3b3", "72": "#b8b8b8", "74": "#bdbdbd", "76": "#c2c2c2", "78": "#c7c7c7", "80": "#cccccc", "82": "#d1d1d1", "84": "#d6d6d6", "86": "#dbdbdb", "88": "#e0e0e0", "90": "#e6e6e6", "92": "#ebebeb", "94": "#f0f0f0", "96": "#f5f5f5", "98": "#fafafa", "99": "#fcfcfc" }; var whiteAlpha = { "5": "rgba(255, 255, 255, 0.05)", "10": "rgba(255, 255, 255, 0.1)", "20": "rgba(255, 255, 255, 0.2)", "30": "rgba(255, 255, 255, 0.3)", "40": "rgba(255, 255, 255, 0.4)", "50": "rgba(255, 255, 255, 0.5)", "60": "rgba(255, 255, 255, 0.6)", "70": "rgba(255, 255, 255, 0.7)", "80": "rgba(255, 255, 255, 0.8)", "90": "rgba(255, 255, 255, 0.9)" }; var blackAlpha = { "5": "rgba(0, 0, 0, 0.05)", "10": "rgba(0, 0, 0, 0.1)", "20": "rgba(0, 0, 0, 0.2)", "30": "rgba(0, 0, 0, 0.3)", "40": "rgba(0, 0, 0, 0.4)", "50": "rgba(0, 0, 0, 0.5)", "60": "rgba(0, 0, 0, 0.6)", "70": "rgba(0, 0, 0, 0.7)", "80": "rgba(0, 0, 0, 0.8)", "90": "rgba(0, 0, 0, 0.9)" }; var grey10Alpha = { "5": "rgba(26, 26, 26, 0.05)", "10": "rgba(26, 26, 26, 0.1)", "20": "rgba(26, 26, 26, 0.2)", "30": "rgba(26, 26, 26, 0.3)", "40": "rgba(26, 26, 26, 0.4)", "50": "rgba(26, 26, 26, 0.5)", "60": "rgba(26, 26, 26, 0.6)", "70": "rgba(26, 26, 26, 0.7)", "80": "rgba(26, 26, 26, 0.8)", "90": "rgba(26, 26, 26, 0.9)" }; var grey12Alpha = { "5": "rgba(31, 31, 31, 0.05)", "10": "rgba(31, 31, 31, 0.1)", "20": "rgba(31, 31, 31, 0.2)", "30": "rgba(31, 31, 31, 0.3)", "40": "rgba(31, 31, 31, 0.4)", "50": "rgba(31, 31, 31, 0.5)", "60": "rgba(31, 31, 31, 0.6)", "70": "rgba(31, 31, 31, 0.7)", "80": "rgba(31, 31, 31, 0.8)", "90": "rgba(31, 31, 31, 0.9)" }; var grey14Alpha = { "5": "rgba(36, 36, 36, 0.05)", "10": "rgba(36, 36, 36, 0.1)", "20": "rgba(36, 36, 36, 0.2)", "30": "rgba(36, 36, 36, 0.3)", "40": "rgba(36, 36, 36, 0.4)", "50": "rgba(36, 36, 36, 0.5)", "60": "rgba(36, 36, 36, 0.6)", "70": "rgba(36, 36, 36, 0.7)", "80": "rgba(36, 36, 36, 0.8)", "90": "rgba(36, 36, 36, 0.9)" }; var white = "#ffffff"; var black = "#000000"; var hcHyperlink = "#ffff00"; var hcHighlight = "#1aebff"; var hcDisabled = "#3ff23f"; var hcCanvas = "#000000"; var hcCanvasText = "#ffffff"; var hcHighlightText = "#000000"; var hcButtonText = "#000000"; var hcButtonFace = "#ffffff"; var darkRed = { shade50: "#130204", shade40: "#230308", shade30: "#420610", shade20: "#590815", shade10: "#690a19", primary: "#750b1c", tint10: "#861b2c", tint20: "#962f3f", tint30: "#ac4f5e", tint40: "#d69ca5", tint50: "#e9c7cd", tint60: "#f9f0f2" }; var cranberry = { shade50: "#200205", shade40: "#3b0509", shade30: "#6e0811", shade20: "#960b18", shade10: "#b10e1c", primary: "#c50f1f", tint10: "#cc2635", tint20: "#d33f4c", tint30: "#dc626d", tint40: "#eeacb2", tint50: "#f6d1d5", tint60: "#fdf3f4" }; var red = { shade50: "#210809", shade40: "#3f1011", shade30: "#751d1f", shade20: "#9f282b", shade10: "#bc2f32", primary: "#d13438", tint10: "#d7494c", tint20: "#dc5e62", tint30: "#e37d80", tint40: "#f1bbbc", tint50: "#f8dadb", tint60: "#fdf6f6" }; var darkOrange = { shade50: "#230900", shade40: "#411200", shade30: "#7a2101", shade20: "#a62d01", shade10: "#c43501", primary: "#da3b01", tint10: "#de501c", tint20: "#e36537", tint30: "#e9835e", tint40: "#f4bfab", tint50: "#f9dcd1", tint60: "#fdf6f3" }; var pumpkin = { shade50: "#200d03", shade40: "#3d1805", shade30: "#712d09", shade20: "#9a3d0c", shade10: "#b6480e", primary: "#ca5010", tint10: "#d06228", tint20: "#d77440", tint30: "#df8e64", tint40: "#efc4ad", tint50: "#f7dfd2", tint60: "#fdf7f4" }; var orange = { shade50: "#271002", shade40: "#4a1e04", shade30: "#8a3707", shade20: "#bc4b09", shade10: "#de590b", primary: "#f7630c", tint10: "#f87528", tint20: "#f98845", tint30: "#faa06b", tint40: "#fdcfb4", tint50: "#fee5d7", tint60: "#fff9f5" }; var peach = { shade50: "#291600", shade40: "#4d2a00", shade30: "#8f4e00", shade20: "#c26a00", shade10: "#e67e00", primary: "#ff8c00", tint10: "#ff9a1f", tint20: "#ffa83d", tint30: "#ffba66", tint40: "#ffddb3", tint50: "#ffedd6", tint60: "#fffaf5" }; var marigold = { shade50: "#251a00", shade40: "#463100", shade30: "#835b00", shade20: "#b27c00", shade10: "#d39300", primary: "#eaa300", tint10: "#edad1c", tint20: "#efb839", tint30: "#f2c661", tint40: "#f9e2ae", tint50: "#fcefd3", tint60: "#fefbf4" }; var yellow = { shade50: "#282400", shade40: "#4c4400", shade30: "#817400", shade20: "#c0ad00", shade10: "#e4cc00", primary: "#fde300", tint10: "#fde61e", tint20: "#fdea3d", tint30: "#feee66", tint40: "#fef7b2", tint50: "#fffad6", tint60: "#fffef5" }; var gold = { shade50: "#1f1900", shade40: "#3a2f00", shade30: "#6c5700", shade20: "#937700", shade10: "#ae8c00", primary: "#c19c00", tint10: "#c8a718", tint20: "#d0b232", tint30: "#dac157", tint40: "#ecdfa5", tint50: "#f5eece", tint60: "#fdfbf2" }; var brass = { shade50: "#181202", shade40: "#2e2103", shade30: "#553e06", shade20: "#745408", shade10: "#89640a", primary: "#986f0b", tint10: "#a47d1e", tint20: "#b18c34", tint30: "#c1a256", tint40: "#e0cea2", tint50: "#efe4cb", tint60: "#fbf8f2" }; var brown = { shade50: "#170e07", shade40: "#2b1a0e", shade30: "#50301a", shade20: "#6c4123", shade10: "#804d29", primary: "#8e562e", tint10: "#9c663f", tint20: "#a97652", tint30: "#bb8f6f", tint40: "#ddc3b0", tint50: "#edded3", tint60: "#faf7f4" }; var forest = { shade50: "#0c1501", shade40: "#162702", shade30: "#294903", shade20: "#376304", shade10: "#427505", primary: "#498205", tint10: "#599116", tint20: "#6ba02b", tint30: "#85b44c", tint40: "#bdd99b", tint50: "#dbebc7", tint60: "#f6faf0" }; var seafoam = { shade50: "#002111", shade40: "#003d20", shade30: "#00723b", shade20: "#009b51", shade10: "#00b85f", primary: "#00cc6a", tint10: "#19d279", tint20: "#34d889", tint30: "#5ae0a0", tint40: "#a8f0cd", tint50: "#cff7e4", tint60: "#f3fdf8" }; var lightGreen = { shade50: "#031a02", shade40: "#063004", shade30: "#0b5a08", shade20: "#0e7a0b", shade10: "#11910d", primary: "#13a10e", tint10: "#27ac22", tint20: "#3db838", tint30: "#5ec75a", tint40: "#a7e3a5", tint50: "#cef0cd", tint60: "#f2fbf2" }; var green = { shade50: "#031403", shade40: "#052505", shade30: "#094509", shade20: "#0c5e0c", shade10: "#0e700e", primary: "#107c10", tint10: "#218c21", tint20: "#359b35", tint30: "#54b054", tint40: "#9fd89f", tint50: "#c9eac9", tint60: "#f1faf1" }; var darkGreen = { shade50: "#021102", shade40: "#032003", shade30: "#063b06", shade20: "#085108", shade10: "#0a5f0a", primary: "#0b6a0b", tint10: "#1a7c1a", tint20: "#2d8e2d", tint30: "#4da64d", tint40: "#9ad29a", tint50: "#c6e7c6", tint60: "#f0f9f0" }; var lightTeal = { shade50: "#001d1f", shade40: "#00373a", shade30: "#00666d", shade20: "#008b94", shade10: "#00a5af", primary: "#00b7c3", tint10: "#18bfca", tint20: "#32c8d1", tint30: "#58d3db", tint40: "#a6e9ed", tint50: "#cef3f5", tint60: "#f2fcfd" }; var teal = { shade50: "#001516", shade40: "#012728", shade30: "#02494c", shade20: "#026467", shade10: "#037679", primary: "#038387", tint10: "#159195", tint20: "#2aa0a4", tint30: "#4cb4b7", tint40: "#9bd9db", tint50: "#c7ebec", tint60: "#f0fafa" }; var steel = { shade50: "#000f12", shade40: "#001b22", shade30: "#00333f", shade20: "#004555", shade10: "#005265", primary: "#005b70", tint10: "#0f6c81", tint20: "#237d92", tint30: "#4496a9", tint40: "#94c8d4", tint50: "#c3e1e8", tint60: "#eff7f9" }; var blue = { shade50: "#001322", shade40: "#002440", shade30: "#004377", shade20: "#005ba1", shade10: "#006cbf", primary: "#0078d4", tint10: "#1a86d9", tint20: "#3595de", tint30: "#5caae5", tint40: "#a9d3f2", tint50: "#d0e7f8", tint60: "#f3f9fd" }; var royalBlue = { shade50: "#000c16", shade40: "#00172a", shade30: "#002c4e", shade20: "#003b6a", shade10: "#00467e", primary: "#004e8c", tint10: "#125e9a", tint20: "#286fa8", tint30: "#4a89ba", tint40: "#9abfdc", tint50: "#c7dced", tint60: "#f0f6fa" }; var cornflower = { shade50: "#0d1126", shade40: "#182047", shade30: "#2c3c85", shade20: "#3c51b4", shade10: "#4760d5", primary: "#4f6bed", tint10: "#637cef", tint20: "#778df1", tint30: "#93a4f4", tint40: "#c8d1fa", tint50: "#e1e6fc", tint60: "#f7f9fe" }; var navy = { shade50: "#00061d", shade40: "#000c36", shade30: "#001665", shade20: "#001e89", shade10: "#0023a2", primary: "#0027b4", tint10: "#173bbd", tint20: "#3050c6", tint30: "#546fd2", tint40: "#a3b2e8", tint50: "#ccd5f3", tint60: "#f2f4fc" }; var lavender = { shade50: "#120f25", shade40: "#221d46", shade30: "#3f3682", shade20: "#5649b0", shade10: "#6656d1", primary: "#7160e8", tint10: "#8172eb", tint20: "#9184ee", tint30: "#a79cf1", tint40: "#d2ccf8", tint50: "#e7e4fb", tint60: "#f9f8fe" }; var purple = { shade50: "#0f0717", shade40: "#1c0e2b", shade30: "#341a51", shade20: "#46236e", shade10: "#532982", primary: "#5c2e91", tint10: "#6b3f9e", tint20: "#7c52ab", tint30: "#9470bd", tint40: "#c6b1de", tint50: "#e0d3ed", tint60: "#f7f4fb" }; var grape = { shade50: "#160418", shade40: "#29072e", shade30: "#4c0d55", shade20: "#671174", shade10: "#7a1589", primary: "#881798", tint10: "#952aa4", tint20: "#a33fb1", tint30: "#b55fc1", tint40: "#d9a7e0", tint50: "#eaceef", tint60: "#faf2fb" }; var berry = { shade50: "#1f091d", shade40: "#3a1136", shade30: "#6d2064", shade20: "#932b88", shade10: "#af33a1", primary: "#c239b3", tint10: "#c94cbc", tint20: "#d161c4", tint30: "#da7ed0", tint40: "#edbbe7", tint50: "#f5daf2", tint60: "#fdf5fc" }; var lilac = { shade50: "#1c0b1f", shade40: "#35153a", shade30: "#63276d", shade20: "#863593", shade10: "#9f3faf", primary: "#b146c2", tint10: "#ba58c9", tint20: "#c36bd1", tint30: "#cf87da", tint40: "#e6bfed", tint50: "#f2dcf5", tint60: "#fcf6fd" }; var pink = { shade50: "#24091b", shade40: "#441232", shade30: "#80215d", shade20: "#ad2d7e", shade10: "#cd3595", primary: "#e43ba6", tint10: "#e750b0", tint20: "#ea66ba", tint30: "#ef85c8", tint40: "#f7c0e3", tint50: "#fbddf0", tint60: "#fef6fb" }; var magenta = { shade50: "#1f0013", shade40: "#390024", shade30: "#6b0043", shade20: "#91005a", shade10: "#ac006b", primary: "#bf0077", tint10: "#c71885", tint20: "#ce3293", tint30: "#d957a8", tint40: "#eca5d1", tint50: "#f5cee6", tint60: "#fcf2f9" }; var plum = { shade50: "#13000c", shade40: "#240017", shade30: "#43002b", shade20: "#5a003b", shade10: "#6b0045", primary: "#77004d", tint10: "#87105d", tint20: "#98246f", tint30: "#ad4589", tint40: "#d696c0", tint50: "#e9c4dc", tint60: "#faf0f6" }; var beige = { shade50: "#141313", shade40: "#252323", shade30: "#444241", shade20: "#5d5958", shade10: "#6e6968", primary: "#7a7574", tint10: "#8a8584", tint20: "#9a9594", tint30: "#afabaa", tint40: "#d7d4d4", tint50: "#eae8e8", tint60: "#faf9f9" }; var mink = { shade50: "#0f0e0e", shade40: "#1c1b1a", shade30: "#343231", shade20: "#474443", shade10: "#54514f", primary: "#5d5a58", tint10: "#706d6b", tint20: "#84817e", tint30: "#9e9b99", tint40: "#cecccb", tint50: "#e5e4e3", tint60: "#f8f8f8" }; var platinum = { shade50: "#111314", shade40: "#1f2426", shade30: "#3b4447", shade20: "#505c60", shade10: "#5f6d71", primary: "#69797e", tint10: "#79898d", tint20: "#89989d", tint30: "#a0adb2", tint40: "#cdd6d8", tint50: "#e4e9ea", tint60: "#f8f9fa" }; var anchor = { shade50: "#090a0b", shade40: "#111315", shade30: "#202427", shade20: "#2b3135", shade10: "#333a3f", primary: "#394146", tint10: "#4d565c", tint20: "#626c72", tint30: "#808a90", tint40: "#bcc3c7", tint50: "#dbdfe1", tint60: "#f6f7f8" }; // node_modules/@fluentui/tokens/lib/global/colorPalette.js var statusSharedColors = { red, green, darkOrange, yellow, berry, lightGreen, marigold }; var personaSharedColors = { darkRed, cranberry, pumpkin, peach, gold, brass, brown, forest, seafoam, darkGreen, lightTeal, teal, steel, blue, royalBlue, cornflower, navy, lavender, purple, grape, lilac, pink, magenta, plum, beige, mink, platinum, anchor }; var mappedStatusColors = { cranberry, green, orange }; // node_modules/@fluentui/tokens/lib/sharedColorNames.js var statusSharedColorNames = [ "red", "green", "darkOrange", "yellow", "berry", "lightGreen", "marigold" ]; var personaSharedColorNames = [ "darkRed", "cranberry", "pumpkin", "peach", "gold", "brass", "brown", "forest", "seafoam", "darkGreen", "lightTeal", "teal", "steel", "blue", "royalBlue", "cornflower", "navy", "lavender", "purple", "grape", "lilac", "pink", "magenta", "plum", "beige", "mink", "platinum", "anchor" ]; // node_modules/@fluentui/tokens/lib/statusColorMapping.js var statusColorMapping = { success: "green", warning: "orange", danger: "cranberry" }; // node_modules/@fluentui/tokens/lib/alias/lightColorPalette.js var statusColorPaletteTokens = statusSharedColorNames.reduce((acc, sharedColor) => { const color2 = sharedColor.slice(0, 1).toUpperCase() + sharedColor.slice(1); const sharedColorTokens = { [`colorPalette${color2}Background1`]: statusSharedColors[sharedColor].tint60, [`colorPalette${color2}Background2`]: statusSharedColors[sharedColor].tint40, [`colorPalette${color2}Background3`]: statusSharedColors[sharedColor].primary, [`colorPalette${color2}Foreground1`]: statusSharedColors[sharedColor].shade10, [`colorPalette${color2}Foreground2`]: statusSharedColors[sharedColor].shade30, [`colorPalette${color2}Foreground3`]: statusSharedColors[sharedColor].primary, [`colorPalette${color2}BorderActive`]: statusSharedColors[sharedColor].primary, [`colorPalette${color2}Border1`]: statusSharedColors[sharedColor].tint40, [`colorPalette${color2}Border2`]: statusSharedColors[sharedColor].primary }; return Object.assign(acc, sharedColorTokens); }, {}); statusColorPaletteTokens.colorPaletteYellowForeground1 = statusSharedColors.yellow.shade30; statusColorPaletteTokens.colorPaletteRedForegroundInverted = statusSharedColors.red.tint20; statusColorPaletteTokens.colorPaletteGreenForegroundInverted = statusSharedColors.green.tint20; statusColorPaletteTokens.colorPaletteYellowForegroundInverted = statusSharedColors.yellow.tint40; var personaColorPaletteTokens = personaSharedColorNames.reduce((acc, sharedColor) => { const color2 = sharedColor.slice(0, 1).toUpperCase() + sharedColor.slice(1); const sharedColorTokens = { [`colorPalette${color2}Background2`]: personaSharedColors[sharedColor].tint40, [`colorPalette${color2}Foreground2`]: personaSharedColors[sharedColor].shade30, [`colorPalette${color2}BorderActive`]: personaSharedColors[sharedColor].primary }; return Object.assign(acc, sharedColorTokens); }, {}); var colorPaletteTokens = { ...statusColorPaletteTokens, ...personaColorPaletteTokens }; var colorStatusTokens = Object.entries(statusColorMapping).reduce((acc, [statusColor, sharedColor]) => { const color2 = statusColor.slice(0, 1).toUpperCase() + statusColor.slice(1); const statusColorTokens = { [`colorStatus${color2}Background1`]: mappedStatusColors[sharedColor].tint60, [`colorStatus${color2}Background2`]: mappedStatusColors[sharedColor].tint40, [`colorStatus${color2}Background3`]: mappedStatusColors[sharedColor].primary, [`colorStatus${color2}Foreground1`]: mappedStatusColors[sharedColor].shade10, [`colorStatus${color2}Foreground2`]: mappedStatusColors[sharedColor].shade30, [`colorStatus${color2}Foreground3`]: mappedStatusColors[sharedColor].primary, [`colorStatus${color2}ForegroundInverted`]: mappedStatusColors[sharedColor].tint30, [`colorStatus${color2}BorderActive`]: mappedStatusColors[sharedColor].primary, [`colorStatus${color2}Border1`]: mappedStatusColors[sharedColor].tint40, [`colorStatus${color2}Border2`]: mappedStatusColors[sharedColor].primary }; return Object.assign(acc, statusColorTokens); }, {}); colorStatusTokens.colorStatusDangerBackground3Hover = mappedStatusColors[statusColorMapping.danger].shade10; colorStatusTokens.colorStatusDangerBackground3Pressed = mappedStatusColors[statusColorMapping.danger].shade20; colorStatusTokens.colorStatusWarningForeground1 = mappedStatusColors[statusColorMapping.warning].shade20; colorStatusTokens.colorStatusWarningForeground3 = mappedStatusColors[statusColorMapping.warning].shade20; colorStatusTokens.colorStatusWarningBorder2 = mappedStatusColors[statusColorMapping.warning].shade20; // node_modules/@fluentui/tokens/lib/alias/lightColor.js var generateColorTokens = (brand) => ({ colorNeutralForeground1: grey[14], colorNeutralForeground1Hover: grey[14], colorNeutralForeground1Pressed: grey[14], colorNeutralForeground1Selected: grey[14], colorNeutralForeground2: grey[26], colorNeutralForeground2Hover: grey[14], colorNeutralForeground2Pressed: grey[14], colorNeutralForeground2Selected: grey[14], colorNeutralForeground2BrandHover: brand[80], colorNeutralForeground2BrandPressed: brand[70], colorNeutralForeground2BrandSelected: brand[80], colorNeutralForeground3: grey[38], colorNeutralForeground3Hover: grey[26], colorNeutralForeground3Pressed: grey[26], colorNeutralForeground3Selected: grey[26], colorNeutralForeground3BrandHover: brand[80], colorNeutralForeground3BrandPressed: brand[70], colorNeutralForeground3BrandSelected: brand[80], colorNeutralForeground4: grey[44], colorNeutralForeground5: grey[38], colorNeutralForeground5Hover: grey[14], colorNeutralForeground5Pressed: grey[14], colorNeutralForeground5Selected: grey[14], colorNeutralForegroundDisabled: grey[74], colorNeutralForegroundInvertedDisabled: whiteAlpha[40], colorBrandForegroundLink: brand[70], colorBrandForegroundLinkHover: brand[60], colorBrandForegroundLinkPressed: brand[40], colorBrandForegroundLinkSelected: brand[70], colorNeutralForeground2Link: grey[26], colorNeutralForeground2LinkHover: grey[14], colorNeutralForeground2LinkPressed: grey[14], colorNeutralForeground2LinkSelected: grey[14], colorCompoundBrandForeground1: brand[80], colorCompoundBrandForeground1Hover: brand[70], colorCompoundBrandForeground1Pressed: brand[60], colorBrandForeground1: brand[80], colorBrandForeground2: brand[70], colorBrandForeground2Hover: brand[60], colorBrandForeground2Pressed: brand[30], colorNeutralForeground1Static: grey[14], colorNeutralForegroundStaticInverted: white, colorNeutralForegroundInverted: white, colorNeutralForegroundInvertedHover: white, colorNeutralForegroundInvertedPressed: white, colorNeutralForegroundInvertedSelected: white, colorNeutralForegroundInverted2: white, colorNeutralForegroundOnBrand: white, colorNeutralForegroundInvertedLink: white, colorNeutralForegroundInvertedLinkHover: white, colorNeutralForegroundInvertedLinkPressed: white, colorNeutralForegroundInvertedLinkSelected: white, colorBrandForegroundInverted: brand[100], colorBrandForegroundInvertedHover: brand[110], colorBrandForegroundInvertedPressed: brand[100], colorBrandForegroundOnLight: brand[80], colorBrandForegroundOnLightHover: brand[70], colorBrandForegroundOnLightPressed: brand[50], colorBrandForegroundOnLightSelected: brand[60], colorNeutralBackground1: white, colorNeutralBackground1Hover: grey[96], colorNeutralBackground1Pressed: grey[88], colorNeutralBackground1Selected: grey[92], colorNeutralBackground2: grey[98], colorNeutralBackground2Hover: grey[94], colorNeutralBackground2Pressed: grey[86], colorNeutralBackground2Selected: grey[90], colorNeutralBackground3: grey[96], colorNeutralBackground3Hover: grey[92], colorNeutralBackground3Pressed: grey[84], colorNeutralBackground3Selected: grey[88], colorNeutralBackground4: grey[94], colorNeutralBackground4Hover: grey[98], colorNeutralBackground4Pressed: grey[96], colorNeutralBackground4Selected: white, colorNeutralBackground5: grey[92], colorNeutralBackground5Hover: grey[96], colorNeutralBackground5Pressed: grey[94], colorNeutralBackground5Selected: grey[98], colorNeutralBackground6: grey[90], colorNeutralBackground7: "#00000000", colorNeutralBackground7Hover: grey[92], colorNeutralBackground7Pressed: grey[84], colorNeutralBackground7Selected: "#00000000", colorNeutralBackground8: grey[99], colorNeutralBackgroundInverted: grey[16], colorNeutralBackgroundInvertedHover: grey[24], colorNeutralBackgroundInvertedPressed: grey[12], colorNeutralBackgroundInvertedSelected: grey[22], colorNeutralBackgroundStatic: grey[20], colorNeutralBackgroundAlpha: whiteAlpha[50], colorNeutralBackgroundAlpha2: whiteAlpha[80], colorSubtleBackground: "transparent", colorSubtleBackgroundHover: grey[96], colorSubtleBackgroundPressed: grey[88], colorSubtleBackgroundSelected: grey[92], colorSubtleBackgroundLightAlphaHover: whiteAlpha[70], colorSubtleBackgroundLightAlphaPressed: whiteAlpha[50], colorSubtleBackgroundLightAlphaSelected: "transparent", colorSubtleBackgroundInverted: "transparent", colorSubtleBackgroundInvertedHover: blackAlpha[10], colorSubtleBackgroundInvertedPressed: blackAlpha[30], colorSubtleBackgroundInvertedSelected: blackAlpha[20], colorTransparentBackground: "transparent", colorTransparentBackgroundHover: "transparent", colorTransparentBackgroundPressed: "transparent", colorTransparentBackgroundSelected: "transparent", colorNeutralBackgroundDisabled: grey[94], colorNeutralBackgroundDisabled2: white, colorNeutralBackgroundInvertedDisabled: whiteAlpha[10], colorNeutralStencil1: grey[90], colorNeutralStencil2: grey[98], colorNeutralStencil1Alpha: blackAlpha[10], colorNeutralStencil2Alpha: blackAlpha[5], colorBackgroundOverlay: blackAlpha[40], colorScrollbarOverlay: blackAlpha[50], colorBrandBackground: brand[80], colorBrandBackgroundHover: brand[70], colorBrandBackgroundPressed: brand[40], colorBrandBackgroundSelected: brand[60], colorCompoundBrandBackground: brand[80], colorCompoundBrandBackgroundHover: brand[70], colorCompoundBrandBackgroundPressed: brand[60], colorBrandBackgroundStatic: brand[80], colorBrandBackground2: brand[160], colorBrandBackground2Hover: brand[150], colorBrandBackground2Pressed: brand[130], colorBrandBackground3Static: brand[60], colorBrandBackground4Static: brand[40], colorBrandBackgroundInverted: white, colorBrandBackgroundInvertedHover: brand[160], colorBrandBackgroundInvertedPressed: brand[140], colorBrandBackgroundInvertedSelected: brand[150], colorNeutralCardBackground: grey[98], colorNeutralCardBackgroundHover: white, colorNeutralCardBackgroundPressed: grey[96], colorNeutralCardBackgroundSelected: grey[92], colorNeutralCardBackgroundDisabled: grey[94], colorNeutralStrokeAccessible: grey[38], colorNeutralStrokeAccessibleHover: grey[34], colorNeutralStrokeAccessiblePressed: grey[30], colorNeutralStrokeAccessibleSelected: brand[80], colorNeutralStroke1: grey[82], colorNeutralStroke1Hover: grey[78], colorNeutralStroke1Pressed: grey[70], colorNeutralStroke1Selected: grey[74], colorNeutralStroke2: grey[88], colorNeutralStroke3: grey[94], colorNeutralStroke4: grey[92], colorNeutralStroke4Hover: grey[88], colorNeutralStroke4Pressed: grey[84], colorNeutralStroke4Selected: grey[92], colorNeutralStrokeSubtle: grey[88], colorNeutralStrokeOnBrand: white, colorNeutralStrokeOnBrand2: white, colorNeutralStrokeOnBrand2Hover: white, colorNeutralStrokeOnBrand2Pressed: white, colorNeutralStrokeOnBrand2Selected: white, colorBrandStroke1: brand[80], colorBrandStroke2: brand[140], colorBrandStroke2Hover: brand[120], colorBrandStroke2Pressed: brand[80], colorBrandStroke2Contrast: brand[140], colorCompoundBrandStroke: brand[80], colorCompoundBrandStrokeHover: brand[70], colorCompoundBrandStrokePressed: brand[60], colorNeutralStrokeDisabled: grey[88], colorNeutralStrokeDisabled2: grey[92], colorNeutralStrokeInvertedDisabled: whiteAlpha[40], colorTransparentStroke: "transparent", colorTransparentStrokeInteractive: "transparent", colorTransparentStrokeDisabled: "transparent", colorNeutralStrokeAlpha: blackAlpha[5], colorNeutralStrokeAlpha2: whiteAlpha[20], colorStrokeFocus1: white, colorStrokeFocus2: black, colorNeutralShadowAmbient: "rgba(0,0,0,0.12)", colorNeutralShadowKey: "rgba(0,0,0,0.14)", colorNeutralShadowAmbientLighter: "rgba(0,0,0,0.06)", colorNeutralShadowKeyLighter: "rgba(0,0,0,0.07)", colorNeutralShadowAmbientDarker: "rgba(0,0,0,0.20)", colorNeutralShadowKeyDarker: "rgba(0,0,0,0.24)", colorBrandShadowAmbient: "rgba(0,0,0,0.30)", colorBrandShadowKey: "rgba(0,0,0,0.25)" }); // node_modules/@fluentui/tokens/lib/global/borderRadius.js var borderRadius = { borderRadiusNone: "0", borderRadiusSmall: "2px", borderRadiusMedium: "4px", borderRadiusLarge: "6px", borderRadiusXLarge: "8px", borderRadius2XLarge: "12px", borderRadius3XLarge: "16px", borderRadius4XLarge: "24px", borderRadius5XLarge: "32px", borderRadius6XLarge: "40px", borderRadiusCircular: "10000px" }; // node_modules/@fluentui/tokens/lib/global/curves.js var curves = { curveAccelerateMax: "cubic-bezier(0.9,0.1,1,0.2)", curveAccelerateMid: "cubic-bezier(1,0,1,1)", curveAccelerateMin: "cubic-bezier(0.8,0,0.78,1)", curveDecelerateMax: "cubic-bezier(0.1,0.9,0.2,1)", curveDecelerateMid: "cubic-bezier(0,0,0,1)", curveDecelerateMin: "cubic-bezier(0.33,0,0.1,1)", curveEasyEaseMax: "cubic-bezier(0.8,0,0.2,1)", curveEasyEase: "cubic-bezier(0.33,0,0.67,1)", curveLinear: "cubic-bezier(0,0,1,1)" }; // node_modules/@fluentui/tokens/lib/global/durations.js var durations = { durationUltraFast: "50ms", durationFaster: "100ms", durationFast: "150ms", durationNormal: "200ms", durationGentle: "250ms", durationSlow: "300ms", durationSlower: "400ms", durationUltraSlow: "500ms" }; // node_modules/@fluentui/tokens/lib/global/fonts.js var fontSizes = { fontSizeBase100: "10px", fontSizeBase200: "12px", fontSizeBase300: "14px", fontSizeBase400: "16px", fontSizeBase500: "20px", fontSizeBase600: "24px", fontSizeHero700: "28px", fontSizeHero800: "32px", fontSizeHero900: "40px", fontSizeHero1000: "68px" }; var lineHeights = { lineHeightBase100: "14px", lineHeightBase200: "16px", lineHeightBase300: "20px", lineHeightBase400: "22px", lineHeightBase500: "28px", lineHeightBase600: "32px", lineHeightHero700: "36px", lineHeightHero800: "40px", lineHeightHero900: "52px", lineHeightHero1000: "92px" }; var fontWeights = { fontWeightRegular: 400, fontWeightMedium: 500, fontWeightSemibold: 600, fontWeightBold: 700 }; var fontFamilies = { fontFamilyBase: "'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif", fontFamilyMonospace: "Consolas, 'Courier New', Courier, monospace", fontFamilyNumeric: "Bahnschrift, 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif" }; // node_modules/@fluentui/tokens/lib/global/spacings.js var spacings = { none: "0", xxs: "2px", xs: "4px", sNudge: "6px", s: "8px", mNudge: "10px", m: "12px", l: "16px", xl: "20px", xxl: "24px", xxxl: "32px" }; var horizontalSpacings = { spacingHorizontalNone: spacings.none, spacingHorizontalXXS: spacings.xxs, spacingHorizontalXS: spacings.xs, spacingHorizontalSNudge: spacings.sNudge, spacingHorizontalS: spacings.s, spacingHorizontalMNudge: spacings.mNudge, spacingHorizontalM: spacings.m, spacingHorizontalL: spacings.l, spacingHorizontalXL: spacings.xl, spacingHorizontalXXL: spacings.xxl, spacingHorizontalXXXL: spacings.xxxl }; var verticalSpacings = { spacingVerticalNone: spacings.none, spacingVerticalXXS: spacings.xxs, spacingVerticalXS: spacings.xs, spacingVerticalSNudge: spacings.sNudge, spacingVerticalS: spacings.s, spacingVerticalMNudge: spacings.mNudge, spacingVerticalM: spacings.m, spacingVerticalL: spacings.l, spacingVerticalXL: spacings.xl, spacingVerticalXXL: spacings.xxl, spacingVerticalXXXL: spacings.xxxl }; // node_modules/@fluentui/tokens/lib/global/strokeWidths.js var strokeWidths = { strokeWidthThin: "1px", strokeWidthThick: "2px", strokeWidthThicker: "3px", strokeWidthThickest: "4px" }; // node_modules/@fluentui/tokens/lib/tokens.js var tokens = { // Color tokens colorNeutralForeground1: "var(--colorNeutralForeground1)", colorNeutralForeground1Hover: "var(--colorNeutralForeground1Hover)", colorNeutralForeground1Pressed: "var(--colorNeutralForeground1Pressed)", colorNeutralForeground1Selected: "var(--colorNeutralForeground1Selected)", colorNeutralForeground2: "var(--colorNeutralForeground2)", colorNeutralForeground2Hover: "var(--colorNeutralForeground2Hover)", colorNeutralForeground2Pressed: "var(--colorNeutralForeground2Pressed)", colorNeutralForeground2Selected: "var(--colorNeutralForeground2Selected)", colorNeutralForeground2BrandHover: "var(--colorNeutralForeground2BrandHover)", colorNeutralForeground2BrandPressed: "var(--colorNeutralForeground2BrandPressed)", colorNeutralForeground2BrandSelected: "var(--colorNeutralForeground2BrandSelected)", colorNeutralForeground3: "var(--colorNeutralForeground3)", colorNeutralForeground3Hover: "var(--colorNeutralForeground3Hover)", colorNeutralForeground3Pressed: "var(--colorNeutralForeground3Pressed)", colorNeutralForeground3Selected: "var(--colorNeutralForeground3Selected)", colorNeutralForeground3BrandHover: "var(--colorNeutralForeground3BrandHover)", colorNeutralForeground3BrandPressed: "var(--colorNeutralForeground3BrandPressed)", colorNeutralForeground3BrandSelected: "var(--colorNeutralForeground3BrandSelected)", colorNeutralForeground4: "var(--colorNeutralForeground4)", colorNeutralForeground5: "var(--colorNeutralForeground5)", colorNeutralForeground5Hover: "var(--colorNeutralForeground5Hover)", colorNeutralForeground5Pressed: "var(--colorNeutralForeground5Pressed)", colorNeutralForeground5Selected: "var(--colorNeutralForeground5Selected)", colorNeutralForegroundDisabled: "var(--colorNeutralForegroundDisabled)", colorBrandForegroundLink: "var(--colorBrandForegroundLink)", colorBrandForegroundLinkHover: "var(--colorBrandForegroundLinkHover)", colorBrandForegroundLinkPressed: "var(--colorBrandForegroundLinkPressed)", colorBrandForegroundLinkSelected: "var(--colorBrandForegroundLinkSelected)", colorNeutralForeground2Link: "var(--colorNeutralForeground2Link)", colorNeutralForeground2LinkHover: "var(--colorNeutralForeground2LinkHover)", colorNeutralForeground2LinkPressed: "var(--colorNeutralForeground2LinkPressed)", colorNeutralForeground2LinkSelected: "var(--colorNeutralForeground2LinkSelected)", colorCompoundBrandForeground1: "var(--colorCompoundBrandForeground1)", colorCompoundBrandForeground1Hover: "var(--colorCompoundBrandForeground1Hover)", colorCompoundBrandForeground1Pressed: "var(--colorCompoundBrandForeground1Pressed)", colorNeutralForegroundOnBrand: "var(--colorNeutralForegroundOnBrand)", colorNeutralForegroundInverted: "var(--colorNeutralForegroundInverted)", colorNeutralForegroundInvertedHover: "var(--colorNeutralForegroundInvertedHover)", colorNeutralForegroundInvertedPressed: "var(--colorNeutralForegroundInvertedPressed)", colorNeutralForegroundInvertedSelected: "var(--colorNeutralForegroundInvertedSelected)", colorNeutralForegroundInverted2: "var(--colorNeutralForegroundInverted2)", colorNeutralForegroundStaticInverted: "var(--colorNeutralForegroundStaticInverted)", colorNeutralForegroundInvertedLink: "var(--colorNeutralForegroundInvertedLink)", colorNeutralForegroundInvertedLinkHover: "var(--colorNeutralForegroundInvertedLinkHover)", colorNeutralForegroundInvertedLinkPressed: "var(--colorNeutralForegroundInvertedLinkPressed)", colorNeutralForegroundInvertedLinkSelected: "var(--colorNeutralForegroundInvertedLinkSelected)", colorNeutralForegroundInvertedDisabled: "var(--colorNeutralForegroundInvertedDisabled)", colorBrandForeground1: "var(--colorBrandForeground1)", colorBrandForeground2: "var(--colorBrandForeground2)", colorBrandForeground2Hover: "var(--colorBrandForeground2Hover)", colorBrandForeground2Pressed: "var(--colorBrandForeground2Pressed)", colorNeutralForeground1Static: "var(--colorNeutralForeground1Static)", colorBrandForegroundInverted: "var(--colorBrandForegroundInverted)", colorBrandForegroundInvertedHover: "var(--colorBrandForegroundInvertedHover)", colorBrandForegroundInvertedPressed: "var(--colorBrandForegroundInvertedPressed)", colorBrandForegroundOnLight: "var(--colorBrandForegroundOnLight)", colorBrandForegroundOnLightHover: "var(--colorBrandForegroundOnLightHover)", colorBrandForegroundOnLightPressed: "var(--colorBrandForegroundOnLightPressed)", colorBrandForegroundOnLightSelected: "var(--colorBrandForegroundOnLightSelected)", colorNeutralBackground1: "var(--colorNeutralBackground1)", colorNeutralBackground1Hover: "var(--colorNeutralBackground1Hover)", colorNeutralBackground1Pressed: "var(--colorNeutralBackground1Pressed)", colorNeutralBackground1Selected: "var(--colorNeutralBackground1Selected)", colorNeutralBackground2: "var(--colorNeutralBackground2)", colorNeutralBackground2Hover: "var(--colorNeutralBackground2Hover)", colorNeutralBackground2Pressed: "var(--colorNeutralBackground2Pressed)", colorNeutralBackground2Selected: "var(--colorNeutralBackground2Selected)", colorNeutralBackground3: "var(--colorNeutralBackground3)", colorNeutralBackground3Hover: "var(--colorNeutralBackground3Hover)", colorNeutralBackground3Pressed: "var(--colorNeutralBackground3Pressed)", colorNeutralBackground3Selected: "var(--colorNeutralBackground3Selected)", colorNeutralBackground4: "var(--colorNeutralBackground4)", colorNeutralBackground4Hover: "var(--colorNeutralBackground4Hover)", colorNeutralBackground4Pressed: "var(--colorNeutralBackground4Pressed)", colorNeutralBackground4Selected: "var(--colorNeutralBackground4Selected)", colorNeutralBackground5: "var(--colorNeutralBackground5)", colorNeutralBackground5Hover: "var(--colorNeutralBackground5Hover)", colorNeutralBackground5Pressed: "var(--colorNeutralBackground5Pressed)", colorNeutralBackground5Selected: "var(--colorNeutralBackground5Selected)", colorNeutralBackground6: "var(--colorNeutralBackground6)", colorNeutralBackground7: "var(--colorNeutralBackground7)", colorNeutralBackground7Hover: "var(--colorNeutralBackground7Hover)", colorNeutralBackground7Pressed: "var(--colorNeutralBackground7Pressed)", colorNeutralBackground7Selected: "var(--colorNeutralBackground7Selected)", colorNeutralBackground8: "var(--colorNeutralBackground8)", colorNeutralBackgroundInverted: "var(--colorNeutralBackgroundInverted)", colorNeutralBackgroundInvertedHover: "var(--colorNeutralBackgroundInvertedHover)", colorNeutralBackgroundInvertedPressed: "var(--colorNeutralBackgroundInvertedPressed)", colorNeutralBackgroundInvertedSelected: "var(--colorNeutralBackgroundInvertedSelected)", colorNeutralBackgroundStatic: "var(--colorNeutralBackgroundStatic)", colorNeutralBackgroundAlpha: "var(--colorNeutralBackgroundAlpha)", colorNeutralBackgroundAlpha2: "var(--colorNeutralBackgroundAlpha2)", colorSubtleBackground: "var(--colorSubtleBackground)", colorSubtleBackgroundHover: "var(--colorSubtleBackgroundHover)", colorSubtleBackgroundPressed: "var(--colorSubtleBackgroundPressed)", colorSubtleBackgroundSelected: "var(--colorSubtleBackgroundSelected)", colorSubtleBackgroundLightAlphaHover: "var(--colorSubtleBackgroundLightAlphaHover)", colorSubtleBackgroundLightAlphaPressed: "var(--colorSubtleBackgroundLightAlphaPressed)", colorSubtleBackgroundLightAlphaSelected: "var(--colorSubtleBackgroundLightAlphaSelected)", colorSubtleBackgroundInverted: "var(--colorSubtleBackgroundInverted)", colorSubtleBackgroundInvertedHover: "var(--colorSubtleBackgroundInvertedHover)", colorSubtleBackgroundInvertedPressed: "var(--colorSubtleBackgroundInvertedPressed)", colorSubtleBackgroundInvertedSelected: "var(--colorSubtleBackgroundInvertedSelected)", colorTransparentBackground: "var(--colorTransparentBackground)", colorTransparentBackgroundHover: "var(--colorTransparentBackgroundHover)", colorTransparentBackgroundPressed: "var(--colorTransparentBackgroundPressed)", colorTransparentBackgroundSelected: "var(--colorTransparentBackgroundSelected)", colorNeutralBackgroundDisabled: "var(--colorNeutralBackgroundDisabled)", colorNeutralBackgroundDisabled2: "var(--colorNeutralBackgroundDisabled2)", colorNeutralBackgroundInvertedDisabled: "var(--colorNeutralBackgroundInvertedDisabled)", colorNeutralStencil1: "var(--colorNeutralStencil1)", colorNeutralStencil2: "var(--colorNeutralStencil2)", colorNeutralStencil1Alpha: "var(--colorNeutralStencil1Alpha)", colorNeutralStencil2Alpha: "var(--colorNeutralStencil2Alpha)", colorBackgroundOverlay: "var(--colorBackgroundOverlay)", colorScrollbarOverlay: "var(--colorScrollbarOverlay)", colorBrandBackground: "var(--colorBrandBackground)", colorBrandBackgroundHover: "var(--colorBrandBackgroundHover)", colorBrandBackgroundPressed: "var(--colorBrandBackgroundPressed)", colorBrandBackgroundSelected: "var(--colorBrandBackgroundSelected)", colorCompoundBrandBackground: "var(--colorCompoundBrandBackground)", colorCompoundBrandBackgroundHover: "var(--colorCompoundBrandBackgroundHover)", colorCompoundBrandBackgroundPressed: "var(--colorCompoundBrandBackgroundPressed)", colorBrandBackgroundStatic: "var(--colorBrandBackgroundStatic)", colorBrandBackground2: "var(--colorBrandBackground2)", colorBrandBackground2Hover: "var(--colorBrandBackground2Hover)", colorBrandBackground2Pressed: "var(--colorBrandBackground2Pressed)", colorBrandBackground3Static: "var(--colorBrandBackground3Static)", colorBrandBackground4Static: "var(--colorBrandBackground4Static)", colorBrandBackgroundInverted: "var(--colorBrandBackgroundInverted)", colorBrandBackgroundInvertedHover: "var(--colorBrandBackgroundInvertedHover)", colorBrandBackgroundInvertedPressed: "var(--colorBrandBackgroundInvertedPressed)", colorBrandBackgroundInvertedSelected: "var(--colorBrandBackgroundInvertedSelected)", colorNeutralCardBackground: "var(--colorNeutralCardBackground)", colorNeutralCardBackgroundHover: "var(--colorNeutralCardBackgroundHover)", colorNeutralCardBackgroundPressed: "var(--colorNeutralCardBackgroundPressed)", colorNeutralCardBackgroundSelected: "var(--colorNeutralCardBackgroundSelected)", colorNeutralCardBackgroundDisabled: "var(--colorNeutralCardBackgroundDisabled)", colorNeutralStrokeAccessible: "var(--colorNeutralStrokeAccessible)", colorNeutralStrokeAccessibleHover: "var(--colorNeutralStrokeAccessibleHover)", colorNeutralStrokeAccessiblePressed: "var(--colorNeutralStrokeAccessiblePressed)", colorNeutralStrokeAccessibleSelected: "var(--colorNeutralStrokeAccessibleSelected)", colorNeutralStroke1: "var(--colorNeutralStroke1)", colorNeutralStroke1Hover: "var(--colorNeutralStroke1Hover)", colorNeutralStroke1Pressed: "var(--colorNeutralStroke1Pressed)", colorNeutralStroke1Selected: "var(--colorNeutralStroke1Selected)", colorNeutralStroke2: "var(--colorNeutralStroke2)", colorNeutralStroke3: "var(--colorNeutralStroke3)", colorNeutralStroke4: "var(--colorNeutralStroke4)", colorNeutralStroke4Hover: "var(--colorNeutralStroke4Hover)", colorNeutralStroke4Pressed: "var(--colorNeutralStroke4Pressed)", colorNeutralStroke4Selected: "var(--colorNeutralStroke4Selected)", colorNeutralStrokeSubtle: "var(--colorNeutralStrokeSubtle)", colorNeutralStrokeOnBrand: "var(--colorNeutralStrokeOnBrand)", colorNeutralStrokeOnBrand2: "var(--colorNeutralStrokeOnBrand2)", colorNeutralStrokeOnBrand2Hover: "var(--colorNeutralStrokeOnBrand2Hover)", colorNeutralStrokeOnBrand2Pressed: "var(--colorNeutralStrokeOnBrand2Pressed)", colorNeutralStrokeOnBrand2Selected: "var(--colorNeutralStrokeOnBrand2Selected)", colorBrandStroke1: "var(--colorBrandStroke1)", colorBrandStroke2: "var(--colorBrandStroke2)", colorBrandStroke2Hover: "var(--colorBrandStroke2Hover)", colorBrandStroke2Pressed: "var(--colorBrandStroke2Pressed)", colorBrandStroke2Contrast: "var(--colorBrandStroke2Contrast)", colorCompoundBrandStroke: "var(--colorCompoundBrandStroke)", colorCompoundBrandStrokeHover: "var(--colorCompoundBrandStrokeHover)", colorCompoundBrandStrokePressed: "var(--colorCompoundBrandStrokePressed)", colorNeutralStrokeDisabled: "var(--colorNeutralStrokeDisabled)", colorNeutralStrokeDisabled2: "var(--colorNeutralStrokeDisabled2)", colorNeutralStrokeInvertedDisabled: "var(--colorNeutralStrokeInvertedDisabled)", colorTransparentStroke: "var(--colorTransparentStroke)", colorTransparentStrokeInteractive: "var(--colorTransparentStrokeInteractive)", colorTransparentStrokeDisabled: "var(--colorTransparentStrokeDisabled)", colorNeutralStrokeAlpha: "var(--colorNeutralStrokeAlpha)", colorNeutralStrokeAlpha2: "var(--colorNeutralStrokeAlpha2)", colorStrokeFocus1: "var(--colorStrokeFocus1)", colorStrokeFocus2: "var(--colorStrokeFocus2)", colorNeutralShadowAmbient: "var(--colorNeutralShadowAmbient)", colorNeutralShadowKey: "var(--colorNeutralShadowKey)", colorNeutralShadowAmbientLighter: "var(--colorNeutralShadowAmbientLighter)", colorNeutralShadowKeyLighter: "var(--colorNeutralShadowKeyLighter)", colorNeutralShadowAmbientDarker: "var(--colorNeutralShadowAmbientDarker)", colorNeutralShadowKeyDarker: "var(--colorNeutralShadowKeyDarker)", colorBrandShadowAmbient: "var(--colorBrandShadowAmbient)", colorBrandShadowKey: "var(--colorBrandShadowKey)", // Color palette tokens // Color palette red tokens colorPaletteRedBackground1: "var(--colorPaletteRedBackground1)", colorPaletteRedBackground2: "var(--colorPaletteRedBackground2)", colorPaletteRedBackground3: "var(--colorPaletteRedBackground3)", colorPaletteRedBorderActive: "var(--colorPaletteRedBorderActive)", colorPaletteRedBorder1: "var(--colorPaletteRedBorder1)", colorPaletteRedBorder2: "var(--colorPaletteRedBorder2)", colorPaletteRedForeground1: "var(--colorPaletteRedForeground1)", colorPaletteRedForeground2: "var(--colorPaletteRedForeground2)", colorPaletteRedForeground3: "var(--colorPaletteRedForeground3)", colorPaletteRedForegroundInverted: "var(--colorPaletteRedForegroundInverted)", // Color palette green tokens colorPaletteGreenBackground1: "var(--colorPaletteGreenBackground1)", colorPaletteGreenBackground2: "var(--colorPaletteGreenBackground2)", colorPaletteGreenBackground3: "var(--colorPaletteGreenBackground3)", colorPaletteGreenBorderActive: "var(--colorPaletteGreenBorderActive)", colorPaletteGreenBorder1: "var(--colorPaletteGreenBorder1)", colorPaletteGreenBorder2: "var(--colorPaletteGreenBorder2)", colorPaletteGreenForeground1: "var(--colorPaletteGreenForeground1)", colorPaletteGreenForeground2: "var(--colorPaletteGreenForeground2)", colorPaletteGreenForeground3: "var(--colorPaletteGreenForeground3)", colorPaletteGreenForegroundInverted: "var(--colorPaletteGreenForegroundInverted)", // Color palette dark orange tokens colorPaletteDarkOrangeBackground1: "var(--colorPaletteDarkOrangeBackground1)", colorPaletteDarkOrangeBackground2: "var(--colorPaletteDarkOrangeBackground2)", colorPaletteDarkOrangeBackground3: "var(--colorPaletteDarkOrangeBackground3)", colorPaletteDarkOrangeBorderActive: "var(--colorPaletteDarkOrangeBorderActive)", colorPaletteDarkOrangeBorder1: "var(--colorPaletteDarkOrangeBorder1)", colorPaletteDarkOrangeBorder2: "var(--colorPaletteDarkOrangeBorder2)", colorPaletteDarkOrangeForeground1: "var(--colorPaletteDarkOrangeForeground1)", colorPaletteDarkOrangeForeground2: "var(--colorPaletteDarkOrangeForeground2)", colorPaletteDarkOrangeForeground3: "var(--colorPaletteDarkOrangeForeground3)", // Color palette yellow tokens colorPaletteYellowBackground1: "var(--colorPaletteYellowBackground1)", colorPaletteYellowBackground2: "var(--colorPaletteYellowBackground2)", colorPaletteYellowBackground3: "var(--colorPaletteYellowBackground3)", colorPaletteYellowBorderActive: "var(--colorPaletteYellowBorderActive)", colorPaletteYellowBorder1: "var(--colorPaletteYellowBorder1)", colorPaletteYellowBorder2: "var(--colorPaletteYellowBorder2)", colorPaletteYellowForeground1: "var(--colorPaletteYellowForeground1)", colorPaletteYellowForeground2: "var(--colorPaletteYellowForeground2)", colorPaletteYellowForeground3: "var(--colorPaletteYellowForeground3)", colorPaletteYellowForegroundInverted: "var(--colorPaletteYellowForegroundInverted)", // Color palette berry tokens colorPaletteBerryBackground1: "var(--colorPaletteBerryBackground1)", colorPaletteBerryBackground2: "var(--colorPaletteBerryBackground2)", colorPaletteBerryBackground3: "var(--colorPaletteBerryBackground3)", colorPaletteBerryBorderActive: "var(--colorPaletteBerryBorderActive)", colorPaletteBerryBorder1: "var(--colorPaletteBerryBorder1)", colorPaletteBerryBorder2: "var(--colorPaletteBerryBorder2)", colorPaletteBerryForeground1: "var(--colorPaletteBerryForeground1)", colorPaletteBerryForeground2: "var(--colorPaletteBerryForeground2)", colorPaletteBerryForeground3: "var(--colorPaletteBerryForeground3)", // Color palette marigold tokens colorPaletteMarigoldBackground1: "var(--colorPaletteMarigoldBackground1)", colorPaletteMarigoldBackground2: "var(--colorPaletteMarigoldBackground2)", colorPaletteMarigoldBackground3: "var(--colorPaletteMarigoldBackground3)", colorPaletteMarigoldBorderActive: "var(--colorPaletteMarigoldBorderActive)", colorPaletteMarigoldBorder1: "var(--colorPaletteMarigoldBorder1)", colorPaletteMarigoldBorder2: "var(--colorPaletteMarigoldBorder2)", colorPaletteMarigoldForeground1: "var(--colorPaletteMarigoldForeground1)", colorPaletteMarigoldForeground2: "var(--colorPaletteMarigoldForeground2)", colorPaletteMarigoldForeground3: "var(--colorPaletteMarigoldForeground3)", // Color palette light green tokens colorPaletteLightGreenBackground1: "var(--colorPaletteLightGreenBackground1)", colorPaletteLightGreenBackground2: "var(--colorPaletteLightGreenBackground2)", colorPaletteLightGreenBackground3: "var(--colorPaletteLightGreenBackground3)", colorPaletteLightGreenBorderActive: "var(--colorPaletteLightGreenBorderActive)", colorPaletteLightGreenBorder1: "var(--colorPaletteLightGreenBorder1)", colorPaletteLightGreenBorder2: "var(--colorPaletteLightGreenBorder2)", colorPaletteLightGreenForeground1: "var(--colorPaletteLightGreenForeground1)", colorPaletteLightGreenForeground2: "var(--colorPaletteLightGreenForeground2)", colorPaletteLightGreenForeground3: "var(--colorPaletteLightGreenForeground3)", // Color palette anchor tokens colorPaletteAnchorBackground2: "var(--colorPaletteAnchorBackground2)", colorPaletteAnchorBorderActive: "var(--colorPaletteAnchorBorderActive)", colorPaletteAnchorForeground2: "var(--colorPaletteAnchorForeground2)", // Color palette beige tokens colorPaletteBeigeBackground2: "var(--colorPaletteBeigeBackground2)", colorPaletteBeigeBorderActive: "var(--colorPaletteBeigeBorderActive)", colorPaletteBeigeForeground2: "var(--colorPaletteBeigeForeground2)", // Color palette blue tokens colorPaletteBlueBackground2: "var(--colorPaletteBlueBackground2)", colorPaletteBlueBorderActive: "var(--colorPaletteBlueBorderActive)", colorPaletteBlueForeground2: "var(--colorPaletteBlueForeground2)", // Color palette brass tokens colorPaletteBrassBackground2: "var(--colorPaletteBrassBackground2)", colorPaletteBrassBorderActive: "var(--colorPaletteBrassBorderActive)", colorPaletteBrassForeground2: "var(--colorPaletteBrassForeground2)", // Color palette brown tokens colorPaletteBrownBackground2: "var(--colorPaletteBrownBackground2)", colorPaletteBrownBorderActive: "var(--colorPaletteBrownBorderActive)", colorPaletteBrownForeground2: "var(--colorPaletteBrownForeground2)", // Color palette cornflower tokens colorPaletteCornflowerBackground2: "var(--colorPaletteCornflowerBackground2)", colorPaletteCornflowerBorderActive: "var(--colorPaletteCornflowerBorderActive)", colorPaletteCornflowerForeground2: "var(--colorPaletteCornflowerForeground2)", // Color palette cranberry tokens colorPaletteCranberryBackground2: "var(--colorPaletteCranberryBackground2)", colorPaletteCranberryBorderActive: "var(--colorPaletteCranberryBorderActive)", colorPaletteCranberryForeground2: "var(--colorPaletteCranberryForeground2)", // Color palette dark green tokens colorPaletteDarkGreenBackground2: "var(--colorPaletteDarkGreenBackground2)", colorPaletteDarkGreenBorderActive: "var(--colorPaletteDarkGreenBorderActive)", colorPaletteDarkGreenForeground2: "var(--colorPaletteDarkGreenForeground2)", // Color palette dark red tokens colorPaletteDarkRedBackground2: "var(--colorPaletteDarkRedBackground2)", colorPaletteDarkRedBorderActive: "var(--colorPaletteDarkRedBorderActive)", colorPaletteDarkRedForeground2: "var(--colorPaletteDarkRedForeground2)", // Color palette forest tokens colorPaletteForestBackground2: "var(--colorPaletteForestBackground2)", colorPaletteForestBorderActive: "var(--colorPaletteForestBorderActive)", colorPaletteForestForeground2: "var(--colorPaletteForestForeground2)", // Color palette gold tokens colorPaletteGoldBackground2: "var(--colorPaletteGoldBackground2)", colorPaletteGoldBorderActive: "var(--colorPaletteGoldBorderActive)", colorPaletteGoldForeground2: "var(--colorPaletteGoldForeground2)", // Color palette grape tokens colorPaletteGrapeBackground2: "var(--colorPaletteGrapeBackground2)", colorPaletteGrapeBorderActive: "var(--colorPaletteGrapeBorderActive)", colorPaletteGrapeForeground2: "var(--colorPaletteGrapeForeground2)", // Color palette lavender tokens colorPaletteLavenderBackground2: "var(--colorPaletteLavenderBackground2)", colorPaletteLavenderBorderActive: "var(--colorPaletteLavenderBorderActive)", colorPaletteLavenderForeground2: "var(--colorPaletteLavenderForeground2)", // Color palette light teal tokens colorPaletteLightTealBackground2: "var(--colorPaletteLightTealBackground2)", colorPaletteLightTealBorderActive: "var(--colorPaletteLightTealBorderActive)", colorPaletteLightTealForeground2: "var(--colorPaletteLightTealForeground2)", // Color palette lilac tokens colorPaletteLilacBackground2: "var(--colorPaletteLilacBackground2)", colorPaletteLilacBorderActive: "var(--colorPaletteLilacBorderActive)", colorPaletteLilacForeground2: "var(--colorPaletteLilacForeground2)", // Color palette magenta tokens colorPaletteMagentaBackground2: "var(--colorPaletteMagentaBackground2)", colorPaletteMagentaBorderActive: "var(--colorPaletteMagentaBorderActive)", colorPaletteMagentaForeground2: "var(--colorPaletteMagentaForeground2)", // Color palette mink tokens colorPaletteMinkBackground2: "var(--colorPaletteMinkBackground2)", colorPaletteMinkBorderActive: "var(--colorPaletteMinkBorderActive)", colorPaletteMinkForeground2: "var(--colorPaletteMinkForeground2)", // Color palette navy tokens colorPaletteNavyBackground2: "var(--colorPaletteNavyBackground2)", colorPaletteNavyBorderActive: "var(--colorPaletteNavyBorderActive)", colorPaletteNavyForeground2: "var(--colorPaletteNavyForeground2)", // Color palette peach tokens colorPalettePeachBackground2: "var(--colorPalettePeachBackground2)", colorPalettePeachBorderActive: "var(--colorPalettePeachBorderActive)", colorPalettePeachForeground2: "var(--colorPalettePeachForeground2)", // Color palette pink tokens colorPalettePinkBackground2: "var(--colorPalettePinkBackground2)", colorPalettePinkBorderActive: "var(--colorPalettePinkBorderActive)", colorPalettePinkForeground2: "var(--colorPalettePinkForeground2)", // Color palette platinum tokens colorPalettePlatinumBackground2: "var(--colorPalettePlatinumBackground2)", colorPalettePlatinumBorderActive: "var(--colorPalettePlatinumBorderActive)", colorPalettePlatinumForeground2: "var(--colorPalettePlatinumForeground2)", // Color palette plum tokens colorPalettePlumBackground2: "var(--colorPalettePlumBackground2)", colorPalettePlumBorderActive: "var(--colorPalettePlumBorderActive)", colorPalettePlumForeground2: "var(--colorPalettePlumForeground2)", // Color palette pumpkin tokens colorPalettePumpkinBackground2: "var(--colorPalettePumpkinBackground2)", colorPalettePumpkinBorderActive: "var(--colorPalettePumpkinBorderActive)", colorPalettePumpkinForeground2: "var(--colorPalettePumpkinForeground2)", // Color palette purple tokens colorPalettePurpleBackground2: "var(--colorPalettePurpleBackground2)", colorPalettePurpleBorderActive: "var(--colorPalettePurpleBorderActive)", colorPalettePurpleForeground2: "var(--colorPalettePurpleForeground2)", // Color palette royal blue tokens colorPaletteRoyalBlueBackground2: "var(--colorPaletteRoyalBlueBackground2)", colorPaletteRoyalBlueBorderActive: "var(--colorPaletteRoyalBlueBorderActive)", colorPaletteRoyalBlueForeground2: "var(--colorPaletteRoyalBlueForeground2)", // Color palette seafoam tokens colorPaletteSeafoamBackground2: "var(--colorPaletteSeafoamBackground2)", colorPaletteSeafoamBorderActive: "var(--colorPaletteSeafoamBorderActive)", colorPaletteSeafoamForeground2: "var(--colorPaletteSeafoamForeground2)", // Color palette steel tokens colorPaletteSteelBackground2: "var(--colorPaletteSteelBackground2)", colorPaletteSteelBorderActive: "var(--colorPaletteSteelBorderActive)", colorPaletteSteelForeground2: "var(--colorPaletteSteelForeground2)", // Color palette teal tokens colorPaletteTealBackground2: "var(--colorPaletteTealBackground2)", colorPaletteTealBorderActive: "var(--colorPaletteTealBorderActive)", colorPaletteTealForeground2: "var(--colorPaletteTealForeground2)", // Color status success tokens colorStatusSuccessBackground1: "var(--colorStatusSuccessBackground1)", colorStatusSuccessBackground2: "var(--colorStatusSuccessBackground2)", colorStatusSuccessBackground3: "var(--colorStatusSuccessBackground3)", colorStatusSuccessForeground1: "var(--colorStatusSuccessForeground1)", colorStatusSuccessForeground2: "var(--colorStatusSuccessForeground2)", colorStatusSuccessForeground3: "var(--colorStatusSuccessForeground3)", colorStatusSuccessForegroundInverted: "var(--colorStatusSuccessForegroundInverted)", colorStatusSuccessBorderActive: "var(--colorStatusSuccessBorderActive)", colorStatusSuccessBorder1: "var(--colorStatusSuccessBorder1)", colorStatusSuccessBorder2: "var(--colorStatusSuccessBorder2)", // Color status warning tokens colorStatusWarningBackground1: "var(--colorStatusWarningBackground1)", colorStatusWarningBackground2: "var(--colorStatusWarningBackground2)", colorStatusWarningBackground3: "var(--colorStatusWarningBackground3)", colorStatusWarningForeground1: "var(--colorStatusWarningForeground1)", colorStatusWarningForeground2: "var(--colorStatusWarningForeground2)", colorStatusWarningForeground3: "var(--colorStatusWarningForeground3)", colorStatusWarningForegroundInverted: "var(--colorStatusWarningForegroundInverted)", colorStatusWarningBorderActive: "var(--colorStatusWarningBorderActive)", colorStatusWarningBorder1: "var(--colorStatusWarningBorder1)", colorStatusWarningBorder2: "var(--colorStatusWarningBorder2)", // Color status danger tokens colorStatusDangerBackground1: "var(--colorStatusDangerBackground1)", colorStatusDangerBackground2: "var(--colorStatusDangerBackground2)", colorStatusDangerBackground3: "var(--colorStatusDangerBackground3)", colorStatusDangerBackground3Hover: "var(--colorStatusDangerBackground3Hover)", colorStatusDangerBackground3Pressed: "var(--colorStatusDangerBackground3Pressed)", colorStatusDangerForeground1: "var(--colorStatusDangerForeground1)", colorStatusDangerForeground2: "var(--colorStatusDangerForeground2)", colorStatusDangerForeground3: "var(--colorStatusDangerForeground3)", colorStatusDangerForegroundInverted: "var(--colorStatusDangerForegroundInverted)", colorStatusDangerBorderActive: "var(--colorStatusDangerBorderActive)", colorStatusDangerBorder1: "var(--colorStatusDangerBorder1)", colorStatusDangerBorder2: "var(--colorStatusDangerBorder2)", // Border radius tokens borderRadiusNone: "var(--borderRadiusNone)", borderRadiusSmall: "var(--borderRadiusSmall)", borderRadiusMedium: "var(--borderRadiusMedium)", borderRadiusLarge: "var(--borderRadiusLarge)", borderRadiusXLarge: "var(--borderRadiusXLarge)", borderRadius2XLarge: "var(--borderRadius2XLarge)", borderRadius3XLarge: "var(--borderRadius3XLarge)", borderRadius4XLarge: "var(--borderRadius4XLarge)", borderRadius5XLarge: "var(--borderRadius5XLarge)", borderRadius6XLarge: "var(--borderRadius6XLarge)", borderRadiusCircular: "var(--borderRadiusCircular)", // Font family tokens fontFamilyBase: "var(--fontFamilyBase)", fontFamilyMonospace: "var(--fontFamilyMonospace)", fontFamilyNumeric: "var(--fontFamilyNumeric)", // Font size tokens fontSizeBase100: "var(--fontSizeBase100)", fontSizeBase200: "var(--fontSizeBase200)", fontSizeBase300: "var(--fontSizeBase300)", fontSizeBase400: "var(--fontSizeBase400)", fontSizeBase500: "var(--fontSizeBase500)", fontSizeBase600: "var(--fontSizeBase600)", fontSizeHero700: "var(--fontSizeHero700)", fontSizeHero800: "var(--fontSizeHero800)", fontSizeHero900: "var(--fontSizeHero900)", fontSizeHero1000: "var(--fontSizeHero1000)", // Font weight tokens fontWeightRegular: "var(--fontWeightRegular)", fontWeightMedium: "var(--fontWeightMedium)", fontWeightSemibold: "var(--fontWeightSemibold)", fontWeightBold: "var(--fontWeightBold)", // Line height tokens lineHeightBase100: "var(--lineHeightBase100)", lineHeightBase200: "var(--lineHeightBase200)", lineHeightBase300: "var(--lineHeightBase300)", lineHeightBase400: "var(--lineHeightBase400)", lineHeightBase500: "var(--lineHeightBase500)", lineHeightBase600: "var(--lineHeightBase600)", lineHeightHero700: "var(--lineHeightHero700)", lineHeightHero800: "var(--lineHeightHero800)", lineHeightHero900: "var(--lineHeightHero900)", lineHeightHero1000: "var(--lineHeightHero1000)", // Shadow tokens shadow2: "var(--shadow2)", shadow4: "var(--shadow4)", shadow8: "var(--shadow8)", shadow16: "var(--shadow16)", shadow28: "var(--shadow28)", shadow64: "var(--shadow64)", // Shadow brand tokens shadow2Brand: "var(--shadow2Brand)", shadow4Brand: "var(--shadow4Brand)", shadow8Brand: "var(--shadow8Brand)", shadow16Brand: "var(--shadow16Brand)", shadow28Brand: "var(--shadow28Brand)", shadow64Brand: "var(--shadow64Brand)", // Stroke width tokens strokeWidthThin: "var(--strokeWidthThin)", strokeWidthThick: "var(--strokeWidthThick)", strokeWidthThicker: "var(--strokeWidthThicker)", strokeWidthThickest: "var(--strokeWidthThickest)", // Spacings spacingHorizontalNone: "var(--spacingHorizontalNone)", spacingHorizontalXXS: "var(--spacingHorizontalXXS)", spacingHorizontalXS: "var(--spacingHorizontalXS)", spacingHorizontalSNudge: "var(--spacingHorizontalSNudge)", spacingHorizontalS: "var(--spacingHorizontalS)", spacingHorizontalMNudge: "var(--spacingHorizontalMNudge)", spacingHorizontalM: "var(--spacingHorizontalM)", spacingHorizontalL: "var(--spacingHorizontalL)", spacingHorizontalXL: "var(--spacingHorizontalXL)", spacingHorizontalXXL: "var(--spacingHorizontalXXL)", spacingHorizontalXXXL: "var(--spacingHorizontalXXXL)", spacingVerticalNone: "var(--spacingVerticalNone)", spacingVerticalXXS: "var(--spacingVerticalXXS)", spacingVerticalXS: "var(--spacingVerticalXS)", spacingVerticalSNudge: "var(--spacingVerticalSNudge)", spacingVerticalS: "var(--spacingVerticalS)", spacingVerticalMNudge: "var(--spacingVerticalMNudge)", spacingVerticalM: "var(--spacingVerticalM)", spacingVerticalL: "var(--spacingVerticalL)", spacingVerticalXL: "var(--spacingVerticalXL)", spacingVerticalXXL: "var(--spacingVerticalXXL)", spacingVerticalXXXL: "var(--spacingVerticalXXXL)", // Durations durationUltraFast: "var(--durationUltraFast)", durationFaster: "var(--durationFaster)", durationFast: "var(--durationFast)", durationNormal: "var(--durationNormal)", durationGentle: "var(--durationGentle)", durationSlow: "var(--durationSlow)", durationSlower: "var(--durationSlower)", durationUltraSlow: "var(--durationUltraSlow)", // Curves curveAccelerateMax: "var(--curveAccelerateMax)", curveAccelerateMid: "var(--curveAccelerateMid)", curveAccelerateMin: "var(--curveAccelerateMin)", curveDecelerateMax: "var(--curveDecelerateMax)", curveDecelerateMid: "var(--curveDecelerateMid)", curveDecelerateMin: "var(--curveDecelerateMin)", curveEasyEaseMax: "var(--curveEasyEaseMax)", curveEasyEase: "var(--curveEasyEase)", curveLinear: "var(--curveLinear)", /** * ZIndexes * Special case where the tokens contain default values * ZIndexes are not mandatory, so they are not included in the theme, but can be used as tokens with default values */ /** * Elevation 0 * Can be used for background elements, like surfaces */ zIndexBackground: "var(--zIndexBackground, 0)", /** * Elevation 2 * Can be used content that is on top of the background, like cards */ zIndexContent: "var(--zIndexContent, 1)", /** * Elevation 4 * Can be used for overlays, like the backdrop of a modal */ zIndexOverlay: "var(--zIndexOverlay, 1000)", /** * Elevation 8 * Can be used for popups, like modals and drawers */ zIndexPopup: "var(--zIndexPopup, 2000)", /** * Elevation 16 * Can be used for messages, like snackbars and toasts */ zIndexMessages: "var(--zIndexMessages, 3000)", /** * Elevation 28 * Can be used for floating elements, like dropdowns */ zIndexFloating: "var(--zIndexFloating, 4000)", /** * Elevation 64 * Can be used for high priority floating elements, like tooltips */ zIndexPriority: "var(--zIndexPriority, 5000)", /** * Special elevation * Can be used for elements that need to be above everything else, like debug overlays */ zIndexDebug: "var(--zIndexDebug, 6000)" }; // node_modules/@fluentui/tokens/lib/global/typographyStyles.js var typographyStyles = { body1: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase300, fontWeight: tokens.fontWeightRegular, lineHeight: tokens.lineHeightBase300 }, body1Strong: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase300, fontWeight: tokens.fontWeightSemibold, lineHeight: tokens.lineHeightBase300 }, body1Stronger: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase300, fontWeight: tokens.fontWeightBold, lineHeight: tokens.lineHeightBase300 }, body2: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase400, fontWeight: tokens.fontWeightRegular, lineHeight: tokens.lineHeightBase400 }, caption1: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase200, fontWeight: tokens.fontWeightRegular, lineHeight: tokens.lineHeightBase200 }, caption1Strong: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase200, fontWeight: tokens.fontWeightSemibold, lineHeight: tokens.lineHeightBase200 }, caption1Stronger: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase200, fontWeight: tokens.fontWeightBold, lineHeight: tokens.lineHeightBase200 }, caption2: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase100, fontWeight: tokens.fontWeightRegular, lineHeight: tokens.lineHeightBase100 }, caption2Strong: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase100, fontWeight: tokens.fontWeightSemibold, lineHeight: tokens.lineHeightBase100 }, subtitle1: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase500, fontWeight: tokens.fontWeightSemibold, lineHeight: tokens.lineHeightBase500 }, subtitle2: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase400, fontWeight: tokens.fontWeightSemibold, lineHeight: tokens.lineHeightBase400 }, subtitle2Stronger: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase400, fontWeight: tokens.fontWeightBold, lineHeight: tokens.lineHeightBase400 }, title1: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeHero800, fontWeight: tokens.fontWeightSemibold, lineHeight: tokens.lineHeightHero800 }, title2: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeHero700, fontWeight: tokens.fontWeightSemibold, lineHeight: tokens.lineHeightHero700 }, title3: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeBase600, fontWeight: tokens.fontWeightSemibold, lineHeight: tokens.lineHeightBase600 }, largeTitle: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeHero900, fontWeight: tokens.fontWeightSemibold, lineHeight: tokens.lineHeightHero900 }, display: { fontFamily: tokens.fontFamilyBase, fontSize: tokens.fontSizeHero1000, fontWeight: tokens.fontWeightSemibold, lineHeight: tokens.lineHeightHero1000 } }; // node_modules/@fluentui/tokens/lib/utils/shadows.js function createShadowTokens(ambientColor, keyColor, tokenSuffix = "") { return { [`shadow2${tokenSuffix}`]: `0 0 2px ${ambientColor}, 0 1px 2px ${keyColor}`, [`shadow4${tokenSuffix}`]: `0 0 2px ${ambientColor}, 0 2px 4px ${keyColor}`, [`shadow8${tokenSuffix}`]: `0 0 2px ${ambientColor}, 0 4px 8px ${keyColor}`, [`shadow16${tokenSuffix}`]: `0 0 2px ${ambientColor}, 0 8px 16px ${keyColor}`, [`shadow28${tokenSuffix}`]: `0 0 8px ${ambientColor}, 0 14px 28px ${keyColor}`, [`shadow64${tokenSuffix}`]: `0 0 8px ${ambientColor}, 0 32px 64px ${keyColor}` }; } // node_modules/@fluentui/tokens/lib/utils/createLightTheme.js var createLightTheme = (brand) => { const colorTokens = generateColorTokens(brand); return { ...borderRadius, ...fontSizes, ...lineHeights, ...fontFamilies, ...fontWeights, ...strokeWidths, ...horizontalSpacings, ...verticalSpacings, ...durations, ...curves, ...colorTokens, ...colorPaletteTokens, ...colorStatusTokens, ...createShadowTokens(colorTokens.colorNeutralShadowAmbient, colorTokens.colorNeutralShadowKey), ...createShadowTokens(colorTokens.colorBrandShadowAmbient, colorTokens.colorBrandShadowKey, "Brand") }; }; // node_modules/@fluentui/tokens/lib/global/brandColors.js var brandWeb = { 10: `#061724`, 20: `#082338`, 30: `#0a2e4a`, 40: `#0c3b5e`, 50: `#0e4775`, 60: `#0f548c`, 70: `#115ea3`, 80: `#0f6cbd`, 90: `#2886de`, 100: `#479ef5`, 110: `#62abf5`, 120: `#77b7f7`, 130: `#96c6fa`, 140: `#b4d6fa`, 150: `#cfe4fa`, 160: `#ebf3fc` }; var brandTeams = { 10: `#2b2b40`, 20: `#2f2f4a`, 30: `#333357`, 40: `#383966`, 50: `#3d3e78`, 60: `#444791`, 70: `#4f52b2`, 80: `#5b5fc7`, 90: `#7579eb`, 100: `#7f85f5`, 110: `#9299f7`, 120: `#aab1fa`, 130: `#b6bcfa`, 140: `#c5cbfa`, 150: `#dce0fa`, 160: `#e8ebfa` }; var brandTeamsV21 = { 10: `#29274f`, 20: `#2f2a5e`, 30: `#352e70`, 40: `#3b3185`, 50: `#44359e`, 60: `#4d3aba`, 70: `#5a40db`, 80: `#654cf5`, 90: `#7769fa`, 100: `#887dff`, 110: `#9791ff`, 120: `#aba8ff`, 130: `#bab8ff`, 140: `#c8c7ff`, 150: `#dcdbff`, 160: `#e8e8ff` }; // node_modules/@fluentui/tokens/lib/alias/teamsFontFamilies.js var fontFamilies2 = { ...fontFamilies, fontFamilyBase: '-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Apple Color Emoji", "Segoe UI Emoji", sans-serif' }; // node_modules/@fluentui/tokens/lib/themes/teams/lightTheme.js var teamsLightTheme = { ...createLightTheme(brandTeams), ...fontFamilies2 }; var teamsLightV21Theme = { ...createLightTheme(brandTeamsV21), ...fontFamilies2 }; // node_modules/@fluentui/tokens/lib/alias/darkColorPalette.js var statusColorPaletteTokens2 = statusSharedColorNames.reduce((acc, sharedColor) => { const color2 = sharedColor.slice(0, 1).toUpperCase() + sharedColor.slice(1); const sharedColorTokens = { [`colorPalette${color2}Background1`]: statusSharedColors[sharedColor].shade40, [`colorPalette${color2}Background2`]: statusSharedColors[sharedColor].shade30, [`colorPalette${color2}Background3`]: statusSharedColors[sharedColor].primary, [`colorPalette${color2}Foreground1`]: statusSharedColors[sharedColor].tint30, [`colorPalette${color2}Foreground2`]: statusSharedColors[sharedColor].tint40, [`colorPalette${color2}Foreground3`]: statusSharedColors[sharedColor].tint20, [`colorPalette${color2}BorderActive`]: statusSharedColors[sharedColor].tint30, [`colorPalette${color2}Border1`]: statusSharedColors[sharedColor].primary, [`colorPalette${color2}Border2`]: statusSharedColors[sharedColor].tint20 }; return Object.assign(acc, sharedColorTokens); }, {}); statusColorPaletteTokens2.colorPaletteRedForeground3 = statusSharedColors.red.tint30; statusColorPaletteTokens2.colorPaletteRedBorder2 = statusSharedColors.red.tint30; statusColorPaletteTokens2.colorPaletteGreenForeground3 = statusSharedColors.green.tint40; statusColorPaletteTokens2.colorPaletteGreenBorder2 = statusSharedColors.green.tint40; statusColorPaletteTokens2.colorPaletteDarkOrangeForeground3 = statusSharedColors.darkOrange.tint30; statusColorPaletteTokens2.colorPaletteDarkOrangeBorder2 = statusSharedColors.darkOrange.tint30; statusColorPaletteTokens2.colorPaletteRedForegroundInverted = statusSharedColors.red.primary; statusColorPaletteTokens2.colorPaletteGreenForegroundInverted = statusSharedColors.green.primary; statusColorPaletteTokens2.colorPaletteYellowForegroundInverted = statusSharedColors.yellow.shade30; var personaColorPaletteTokens2 = personaSharedColorNames.reduce((acc, sharedColor) => { const color2 = sharedColor.slice(0, 1).toUpperCase() + sharedColor.slice(1); const sharedColorTokens = { [`colorPalette${color2}Background2`]: personaSharedColors[sharedColor].shade30, [`colorPalette${color2}Foreground2`]: personaSharedColors[sharedColor].tint40, [`colorPalette${color2}BorderActive`]: personaSharedColors[sharedColor].tint30 }; return Object.assign(acc, sharedColorTokens); }, {}); personaColorPaletteTokens2.colorPaletteDarkRedBackground2 = personaSharedColors.darkRed.shade20; personaColorPaletteTokens2.colorPalettePlumBackground2 = personaSharedColors.plum.shade20; var colorPaletteTokens2 = { ...statusColorPaletteTokens2, ...personaColorPaletteTokens2 }; var colorStatusTokens2 = Object.entries(statusColorMapping).reduce((acc, [statusColor, sharedColor]) => { const color2 = statusColor.slice(0, 1).toUpperCase() + statusColor.slice(1); const statusColorTokens = { [`colorStatus${color2}Background1`]: mappedStatusColors[sharedColor].shade40, [`colorStatus${color2}Background2`]: mappedStatusColors[sharedColor].shade30, [`colorStatus${color2}Background3`]: mappedStatusColors[sharedColor].primary, [`colorStatus${color2}Foreground1`]: mappedStatusColors[sharedColor].tint30, [`colorStatus${color2}Foreground2`]: mappedStatusColors[sharedColor].tint40, [`colorStatus${color2}Foreground3`]: mappedStatusColors[sharedColor].tint20, [`colorStatus${color2}BorderActive`]: mappedStatusColors[sharedColor].tint30, [`colorStatus${color2}ForegroundInverted`]: mappedStatusColors[sharedColor].shade10, [`colorStatus${color2}Border1`]: mappedStatusColors[sharedColor].primary, [`colorStatus${color2}Border2`]: mappedStatusColors[sharedColor].tint20 }; return Object.assign(acc, statusColorTokens); }, {}); colorStatusTokens2.colorStatusDangerBackground3Hover = mappedStatusColors[statusColorMapping.danger].shade10; colorStatusTokens2.colorStatusDangerBackground3Pressed = mappedStatusColors[statusColorMapping.danger].shade20; colorStatusTokens2.colorStatusDangerForeground3 = mappedStatusColors[statusColorMapping.danger].tint40; colorStatusTokens2.colorStatusDangerBorder2 = mappedStatusColors[statusColorMapping.danger].tint30; colorStatusTokens2.colorStatusSuccessForeground3 = mappedStatusColors[statusColorMapping.success].tint40; colorStatusTokens2.colorStatusSuccessBorder2 = mappedStatusColors[statusColorMapping.success].tint40; colorStatusTokens2.colorStatusWarningForegroundInverted = mappedStatusColors[statusColorMapping.warning].shade20; // node_modules/@fluentui/tokens/lib/alias/teamsDarkColor.js var generateColorTokens2 = (brand) => ({ colorNeutralForeground1: white, colorNeutralForeground1Hover: white, colorNeutralForeground1Pressed: white, colorNeutralForeground1Selected: white, colorNeutralForeground2: grey[84], colorNeutralForeground2Hover: white, colorNeutralForeground2Pressed: white, colorNeutralForeground2Selected: white, colorNeutralForeground2BrandHover: brand[100], colorNeutralForeground2BrandPressed: brand[90], colorNeutralForeground2BrandSelected: brand[100], colorNeutralForeground3: grey[68], colorNeutralForeground3Hover: grey[84], colorNeutralForeground3Pressed: grey[84], colorNeutralForeground3Selected: grey[84], colorNeutralForeground3BrandHover: brand[100], colorNeutralForeground3BrandPressed: brand[90], colorNeutralForeground3BrandSelected: brand[100], colorNeutralForeground4: grey[60], colorNeutralForeground5: grey[68], colorNeutralForeground5Hover: white, colorNeutralForeground5Pressed: white, colorNeutralForeground5Selected: white, colorNeutralForegroundDisabled: grey[36], colorNeutralForegroundInvertedDisabled: whiteAlpha[40], colorBrandForegroundLink: brand[100], colorBrandForegroundLinkHover: brand[110], colorBrandForegroundLinkPressed: brand[90], colorBrandForegroundLinkSelected: brand[100], colorNeutralForeground2Link: grey[84], colorNeutralForeground2LinkHover: white, colorNeutralForeground2LinkPressed: white, colorNeutralForeground2LinkSelected: white, colorCompoundBrandForeground1: brand[100], colorCompoundBrandForeground1Hover: brand[110], colorCompoundBrandForeground1Pressed: brand[90], colorBrandForeground1: brand[100], colorBrandForeground2: brand[120], colorBrandForeground2Hover: brand[130], colorBrandForeground2Pressed: brand[160], colorNeutralForeground1Static: grey[14], colorNeutralForegroundStaticInverted: white, colorNeutralForegroundInverted: grey[14], colorNeutralForegroundInvertedHover: grey[14], colorNeutralForegroundInvertedPressed: grey[14], colorNeutralForegroundInvertedSelected: grey[14], colorNeutralForegroundInverted2: grey[14], colorNeutralForegroundOnBrand: white, colorNeutralForegroundInvertedLink: white, colorNeutralForegroundInvertedLinkHover: white, colorNeutralForegroundInvertedLinkPressed: white, colorNeutralForegroundInvertedLinkSelected: white, colorBrandForegroundInverted: brand[80], colorBrandForegroundInvertedHover: brand[70], colorBrandForegroundInvertedPressed: brand[60], colorBrandForegroundOnLight: brand[80], colorBrandForegroundOnLightHover: brand[70], colorBrandForegroundOnLightPressed: brand[50], colorBrandForegroundOnLightSelected: brand[60], colorNeutralBackground1: grey[16], colorNeutralBackground1Hover: grey[24], colorNeutralBackground1Pressed: grey[12], colorNeutralBackground1Selected: grey[22], colorNeutralBackground2: grey[14], colorNeutralBackground2Hover: grey[22], colorNeutralBackground2Pressed: grey[10], colorNeutralBackground2Selected: grey[20], colorNeutralBackground3: grey[12], colorNeutralBackground3Hover: grey[20], colorNeutralBackground3Pressed: grey[8], colorNeutralBackground3Selected: grey[18], colorNeutralBackground4: grey[8], colorNeutralBackground4Hover: grey[16], colorNeutralBackground4Pressed: grey[4], colorNeutralBackground4Selected: grey[14], colorNeutralBackground5: grey[4], colorNeutralBackground5Hover: grey[12], colorNeutralBackground5Pressed: black, colorNeutralBackground5Selected: grey[10], colorNeutralBackground6: grey[20], colorNeutralBackground7: "#00000000", colorNeutralBackground7Hover: grey[10], colorNeutralBackground7Pressed: grey[4], colorNeutralBackground7Selected: "#00000000", colorNeutralBackground8: grey[16], colorNeutralBackgroundInverted: white, colorNeutralBackgroundInvertedHover: grey[96], colorNeutralBackgroundInvertedPressed: grey[88], colorNeutralBackgroundInvertedSelected: grey[92], colorNeutralBackgroundStatic: grey[24], colorNeutralBackgroundAlpha: grey10Alpha[50], colorNeutralBackgroundAlpha2: grey12Alpha[70], colorSubtleBackground: "transparent", colorSubtleBackgroundHover: grey[22], colorSubtleBackgroundPressed: grey[18], colorSubtleBackgroundSelected: grey[20], colorSubtleBackgroundLightAlphaHover: grey14Alpha[80], colorSubtleBackgroundLightAlphaPressed: grey14Alpha[50], colorSubtleBackgroundLightAlphaSelected: "transparent", colorSubtleBackgroundInverted: "transparent", colorSubtleBackgroundInvertedHover: blackAlpha[10], colorSubtleBackgroundInvertedPressed: blackAlpha[30], colorSubtleBackgroundInvertedSelected: blackAlpha[20], colorTransparentBackground: "transparent", colorTransparentBackgroundHover: "transparent", colorTransparentBackgroundPressed: "transparent", colorTransparentBackgroundSelected: "transparent", colorNeutralBackgroundDisabled: grey[8], colorNeutralBackgroundDisabled2: grey[16], colorNeutralBackgroundInvertedDisabled: whiteAlpha[10], colorNeutralStencil1: grey[34], colorNeutralStencil2: grey[20], colorNeutralStencil1Alpha: whiteAlpha[10], colorNeutralStencil2Alpha: whiteAlpha[5], colorBackgroundOverlay: blackAlpha[50], colorScrollbarOverlay: whiteAlpha[60], colorBrandBackground: brand[70], colorBrandBackgroundHover: brand[80], colorBrandBackgroundPressed: brand[40], colorBrandBackgroundSelected: brand[60], colorCompoundBrandBackground: brand[100], colorCompoundBrandBackgroundHover: brand[110], colorCompoundBrandBackgroundPressed: brand[90], colorBrandBackgroundStatic: brand[80], colorBrandBackground2: brand[20], colorBrandBackground2Hover: brand[40], colorBrandBackground2Pressed: brand[10], colorBrandBackground3Static: brand[60], colorBrandBackground4Static: brand[40], colorBrandBackgroundInverted: white, colorBrandBackgroundInvertedHover: brand[160], colorBrandBackgroundInvertedPressed: brand[140], colorBrandBackgroundInvertedSelected: brand[150], colorNeutralCardBackground: grey[20], colorNeutralCardBackgroundHover: grey[24], colorNeutralCardBackgroundPressed: grey[18], colorNeutralCardBackgroundSelected: grey[22], colorNeutralCardBackgroundDisabled: grey[8], colorNeutralStrokeAccessible: grey[68], colorNeutralStrokeAccessibleHover: grey[74], colorNeutralStrokeAccessiblePressed: grey[70], colorNeutralStrokeAccessibleSelected: brand[100], colorNeutralStroke1: grey[40], colorNeutralStroke1Hover: grey[46], colorNeutralStroke1Pressed: grey[42], colorNeutralStroke1Selected: grey[44], colorNeutralStroke2: grey[32], colorNeutralStroke3: grey[24], colorNeutralStroke4: grey[24], colorNeutralStroke4Hover: grey[18], colorNeutralStroke4Pressed: grey[14], colorNeutralStroke4Selected: grey[24], colorNeutralStrokeSubtle: grey[4], colorNeutralStrokeOnBrand: grey[16], colorNeutralStrokeOnBrand2: white, colorNeutralStrokeOnBrand2Hover: white, colorNeutralStrokeOnBrand2Pressed: white, colorNeutralStrokeOnBrand2Selected: white, colorBrandStroke1: brand[100], colorBrandStroke2: brand[50], colorBrandStroke2Hover: brand[50], colorBrandStroke2Pressed: brand[30], colorBrandStroke2Contrast: brand[50], colorCompoundBrandStroke: brand[90], colorCompoundBrandStrokeHover: brand[100], colorCompoundBrandStrokePressed: brand[80], colorNeutralStrokeDisabled: grey[26], colorNeutralStrokeDisabled2: grey[24], colorNeutralStrokeInvertedDisabled: whiteAlpha[40], colorTransparentStroke: "transparent", colorTransparentStrokeInteractive: "transparent", colorTransparentStrokeDisabled: "transparent", colorNeutralStrokeAlpha: whiteAlpha[10], colorNeutralStrokeAlpha2: whiteAlpha[20], colorStrokeFocus1: black, colorStrokeFocus2: white, colorNeutralShadowAmbient: "rgba(0,0,0,0.24)", colorNeutralShadowKey: "rgba(0,0,0,0.28)", colorNeutralShadowAmbientLighter: "rgba(0,0,0,0.12)", colorNeutralShadowKeyLighter: "rgba(0,0,0,0.14)", colorNeutralShadowAmbientDarker: "rgba(0,0,0,0.40)", colorNeutralShadowKeyDarker: "rgba(0,0,0,0.48)", colorBrandShadowAmbient: "rgba(0,0,0,0.30)", colorBrandShadowKey: "rgba(0,0,0,0.25)" }); // node_modules/@fluentui/tokens/lib/utils/createTeamsDarkTheme.js var createTeamsDarkTheme = (brand) => { const colorTokens = generateColorTokens2(brand); return { ...borderRadius, ...fontSizes, ...lineHeights, ...fontFamilies, ...fontWeights, ...strokeWidths, ...horizontalSpacings, ...verticalSpacings, ...durations, ...curves, ...colorTokens, ...colorPaletteTokens2, ...colorStatusTokens2, ...createShadowTokens(colorTokens.colorNeutralShadowAmbient, colorTokens.colorNeutralShadowKey), ...createShadowTokens(colorTokens.colorBrandShadowAmbient, colorTokens.colorBrandShadowKey, "Brand") }; }; // node_modules/@fluentui/tokens/lib/themes/teams/darkTheme.js var teamsDarkTheme = { ...createTeamsDarkTheme(brandTeams), ...fontFamilies2 }; var teamsDarkV21Theme = { ...createTeamsDarkTheme(brandTeamsV21), ...fontFamilies2 }; // node_modules/@fluentui/tokens/lib/alias/highContrastColorPalette.js var statusColorPaletteTokens3 = statusSharedColorNames.reduce((acc, sharedColor) => { const color2 = sharedColor.slice(0, 1).toUpperCase() + sharedColor.slice(1); const sharedColorTokens = { [`colorPalette${color2}Background1`]: hcCanvas, [`colorPalette${color2}Background2`]: hcCanvas, [`colorPalette${color2}Background3`]: hcCanvasText, [`colorPalette${color2}Foreground1`]: hcCanvasText, [`colorPalette${color2}Foreground2`]: hcCanvasText, [`colorPalette${color2}Foreground3`]: hcCanvasText, [`colorPalette${color2}BorderActive`]: hcHighlight, [`colorPalette${color2}Border1`]: hcCanvasText, [`colorPalette${color2}Border2`]: hcCanvasText }; return Object.assign(acc, sharedColorTokens); }, {}); statusColorPaletteTokens3.colorPaletteRedForegroundInverted = hcCanvasText; statusColorPaletteTokens3.colorPaletteGreenForegroundInverted = hcCanvasText; statusColorPaletteTokens3.colorPaletteYellowForegroundInverted = hcCanvasText; var personaColorPaletteTokens3 = personaSharedColorNames.reduce((acc, sharedColor) => { const color2 = sharedColor.slice(0, 1).toUpperCase() + sharedColor.slice(1); const sharedColorTokens = { [`colorPalette${color2}Background2`]: hcCanvas, [`colorPalette${color2}Foreground2`]: hcCanvasText, [`colorPalette${color2}BorderActive`]: hcHighlight }; return Object.assign(acc, sharedColorTokens); }, {}); var colorPaletteTokens3 = { ...statusColorPaletteTokens3, ...personaColorPaletteTokens3 }; var colorStatusTokens3 = Object.entries(statusColorMapping).reduce((acc, [statusColor, sharedColor]) => { const color2 = statusColor.slice(0, 1).toUpperCase() + statusColor.slice(1); const statusColorTokens = { [`colorStatus${color2}Background1`]: hcCanvas, [`colorStatus${color2}Background2`]: hcCanvas, [`colorStatus${color2}Background3`]: hcCanvasText, [`colorStatus${color2}Foreground1`]: hcCanvasText, [`colorStatus${color2}Foreground2`]: hcCanvasText, [`colorStatus${color2}Foreground3`]: hcCanvasText, [`colorStatus${color2}BorderActive`]: hcHighlight, [`colorStatus${color2}ForegroundInverted`]: hcCanvasText, [`colorStatus${color2}Border1`]: hcCanvasText, [`colorStatus${color2}Border2`]: hcCanvasText }; return Object.assign(acc, statusColorTokens); }, {}); colorStatusTokens3.colorStatusDangerBackground3Hover = hcHighlight; colorStatusTokens3.colorStatusDangerBackground3Pressed = hcHighlight; // node_modules/@fluentui/tokens/lib/alias/highContrastColor.js var generateColorTokens3 = () => ({ colorNeutralForeground1: hcCanvasText, colorNeutralForeground1Hover: hcHighlightText, colorNeutralForeground1Pressed: hcHighlightText, colorNeutralForeground1Selected: hcHighlightText, colorNeutralForeground2: hcCanvasText, colorNeutralForeground2Hover: hcHighlightText, colorNeutralForeground2Pressed: hcHighlightText, colorNeutralForeground2Selected: hcHighlightText, colorNeutralForeground2BrandHover: hcHighlightText, colorNeutralForeground2BrandPressed: hcHighlightText, colorNeutralForeground2BrandSelected: hcHighlightText, colorNeutralForeground3: hcCanvasText, colorNeutralForeground3Hover: hcHighlightText, colorNeutralForeground3Pressed: hcHighlightText, colorNeutralForeground3Selected: hcHighlightText, colorNeutralForeground3BrandHover: hcHighlightText, colorNeutralForeground3BrandPressed: hcHighlightText, colorNeutralForeground3BrandSelected: hcHighlightText, colorNeutralForeground4: hcCanvasText, colorNeutralForeground5: hcCanvasText, colorNeutralForeground5Hover: hcHighlightText, colorNeutralForeground5Pressed: hcHighlightText, colorNeutralForeground5Selected: hcHighlightText, colorNeutralForegroundDisabled: hcDisabled, colorNeutralForegroundInvertedDisabled: hcDisabled, colorBrandForegroundLink: hcHyperlink, colorBrandForegroundLinkHover: hcHyperlink, colorBrandForegroundLinkPressed: hcHyperlink, colorBrandForegroundLinkSelected: hcHyperlink, colorNeutralForeground2Link: hcHyperlink, colorNeutralForeground2LinkHover: hcHyperlink, colorNeutralForeground2LinkPressed: hcHyperlink, colorNeutralForeground2LinkSelected: hcHyperlink, colorCompoundBrandForeground1: hcHighlight, colorCompoundBrandForeground1Hover: hcHighlight, colorCompoundBrandForeground1Pressed: hcHighlight, colorBrandForeground1: hcCanvasText, colorBrandForeground2: hcCanvasText, colorBrandForeground2Hover: hcCanvasText, colorBrandForeground2Pressed: hcCanvasText, colorNeutralForeground1Static: hcCanvas, colorNeutralForegroundStaticInverted: hcCanvasText, colorNeutralForegroundInverted: hcHighlightText, colorNeutralForegroundInvertedHover: hcHighlightText, colorNeutralForegroundInvertedPressed: hcHighlightText, colorNeutralForegroundInvertedSelected: hcHighlightText, colorNeutralForegroundInverted2: hcCanvasText, colorNeutralForegroundOnBrand: hcButtonText, colorNeutralForegroundInvertedLink: hcHyperlink, colorNeutralForegroundInvertedLinkHover: hcHyperlink, colorNeutralForegroundInvertedLinkPressed: hcHyperlink, colorNeutralForegroundInvertedLinkSelected: hcHyperlink, colorBrandForegroundInverted: hcCanvasText, colorBrandForegroundInvertedHover: hcHighlightText, colorBrandForegroundInvertedPressed: hcHighlightText, colorBrandForegroundOnLight: hcButtonText, colorBrandForegroundOnLightHover: hcHighlightText, colorBrandForegroundOnLightPressed: hcHighlightText, colorBrandForegroundOnLightSelected: hcHighlightText, colorNeutralBackground1: hcCanvas, colorNeutralBackground1Hover: hcHighlight, colorNeutralBackground1Pressed: hcHighlight, colorNeutralBackground1Selected: hcHighlight, colorNeutralBackground2: hcCanvas, colorNeutralBackground2Hover: hcHighlight, colorNeutralBackground2Pressed: hcHighlight, colorNeutralBackground2Selected: hcHighlight, colorNeutralBackground3: hcCanvas, colorNeutralBackground3Hover: hcHighlight, colorNeutralBackground3Pressed: hcHighlight, colorNeutralBackground3Selected: hcHighlight, colorNeutralBackground4: hcCanvas, colorNeutralBackground4Hover: hcHighlight, colorNeutralBackground4Pressed: hcHighlight, colorNeutralBackground4Selected: hcHighlight, colorNeutralBackground5: hcCanvas, colorNeutralBackground5Hover: hcHighlight, colorNeutralBackground5Pressed: hcHighlight, colorNeutralBackground5Selected: hcHighlight, colorNeutralBackground6: hcCanvas, colorNeutralBackground7: hcCanvas, colorNeutralBackground7Hover: hcHighlight, colorNeutralBackground7Pressed: hcHighlight, colorNeutralBackground7Selected: hcHighlight, colorNeutralBackground8: hcCanvas, colorNeutralBackgroundInverted: hcCanvas, colorNeutralBackgroundInvertedHover: hcHighlight, colorNeutralBackgroundInvertedPressed: hcHighlight, colorNeutralBackgroundInvertedSelected: hcHighlight, colorNeutralBackgroundStatic: hcCanvas, colorNeutralBackgroundAlpha: hcCanvas, colorNeutralBackgroundAlpha2: hcCanvas, colorSubtleBackground: "transparent", colorSubtleBackgroundHover: hcHighlight, colorSubtleBackgroundPressed: hcHighlight, colorSubtleBackgroundSelected: hcHighlight, colorSubtleBackgroundLightAlphaHover: hcHighlight, colorSubtleBackgroundLightAlphaPressed: hcHighlight, colorSubtleBackgroundLightAlphaSelected: hcHighlight, colorSubtleBackgroundInverted: "transparent", colorSubtleBackgroundInvertedHover: hcHighlight, colorSubtleBackgroundInvertedPressed: hcHighlight, colorSubtleBackgroundInvertedSelected: hcHighlight, colorTransparentBackground: "transparent", colorTransparentBackgroundHover: hcHighlight, colorTransparentBackgroundPressed: hcHighlight, colorTransparentBackgroundSelected: hcHighlight, colorNeutralBackgroundDisabled: hcCanvas, colorNeutralBackgroundDisabled2: hcDisabled, colorNeutralBackgroundInvertedDisabled: hcCanvas, colorNeutralStencil1: hcCanvasText, colorNeutralStencil2: hcCanvasText, colorNeutralStencil1Alpha: hcCanvasText, colorNeutralStencil2Alpha: hcCanvasText, colorBackgroundOverlay: blackAlpha[50], colorScrollbarOverlay: hcButtonFace, colorBrandBackground: hcButtonFace, colorBrandBackgroundHover: hcHighlight, colorBrandBackgroundPressed: hcHighlight, colorBrandBackgroundSelected: hcHighlight, colorCompoundBrandBackground: hcHighlight, colorCompoundBrandBackgroundHover: hcHighlight, colorCompoundBrandBackgroundPressed: hcHighlight, colorBrandBackgroundStatic: hcCanvas, colorBrandBackground2: hcCanvas, colorBrandBackground2Hover: hcCanvas, colorBrandBackground2Pressed: hcCanvas, colorBrandBackground3Static: hcCanvas, colorBrandBackground4Static: hcCanvas, colorBrandBackgroundInverted: hcButtonFace, colorBrandBackgroundInvertedHover: hcHighlight, colorBrandBackgroundInvertedPressed: hcHighlight, colorBrandBackgroundInvertedSelected: hcHighlight, colorNeutralCardBackground: hcCanvas, colorNeutralCardBackgroundHover: hcHighlight, colorNeutralCardBackgroundPressed: hcHighlight, colorNeutralCardBackgroundSelected: hcHighlight, colorNeutralCardBackgroundDisabled: hcCanvas, colorNeutralStrokeAccessible: hcCanvasText, colorNeutralStrokeAccessibleHover: hcHighlight, colorNeutralStrokeAccessiblePressed: hcHighlight, colorNeutralStrokeAccessibleSelected: hcHighlight, colorNeutralStroke1: hcCanvasText, colorNeutralStroke1Hover: hcHighlight, colorNeutralStroke1Pressed: hcHighlight, colorNeutralStroke1Selected: hcHighlight, colorNeutralStroke2: hcCanvasText, colorNeutralStroke3: hcCanvasText, colorNeutralStroke4: hcCanvasText, colorNeutralStroke4Hover: hcHighlight, colorNeutralStroke4Pressed: hcHighlight, colorNeutralStroke4Selected: hcHighlight, colorNeutralStrokeSubtle: hcCanvasText, colorNeutralStrokeOnBrand: hcCanvas, colorNeutralStrokeOnBrand2: hcCanvasText, colorNeutralStrokeOnBrand2Hover: hcCanvasText, colorNeutralStrokeOnBrand2Pressed: hcCanvasText, colorNeutralStrokeOnBrand2Selected: hcCanvasText, colorBrandStroke1: hcCanvasText, colorBrandStroke2: hcCanvasText, colorBrandStroke2Hover: hcHighlight, colorBrandStroke2Pressed: hcHighlight, colorBrandStroke2Contrast: hcCanvas, colorCompoundBrandStroke: hcHighlight, colorCompoundBrandStrokeHover: hcHighlight, colorCompoundBrandStrokePressed: hcHighlight, colorNeutralStrokeDisabled: hcDisabled, colorNeutralStrokeDisabled2: hcDisabled, colorNeutralStrokeInvertedDisabled: hcDisabled, colorTransparentStroke: hcCanvasText, colorTransparentStrokeInteractive: hcHighlight, colorTransparentStrokeDisabled: hcDisabled, colorNeutralStrokeAlpha: hcCanvasText, colorNeutralStrokeAlpha2: hcCanvas, colorStrokeFocus1: hcCanvas, colorStrokeFocus2: hcHighlight, colorNeutralShadowAmbient: "rgba(0,0,0,0.24)", colorNeutralShadowKey: "rgba(0,0,0,0.28)", colorNeutralShadowAmbientLighter: "rgba(0,0,0,0.12)", colorNeutralShadowKeyLighter: "rgba(0,0,0,0.14)", colorNeutralShadowAmbientDarker: "rgba(0,0,0,0.40)", colorNeutralShadowKeyDarker: "rgba(0,0,0,0.48)", colorBrandShadowAmbient: "rgba(0,0,0,0.30)", colorBrandShadowKey: "rgba(0,0,0,0.25)" }); // node_modules/@fluentui/tokens/lib/utils/createHighContrastTheme.js var createHighContrastTheme = () => { const colorTokens = generateColorTokens3(); return { ...borderRadius, ...fontSizes, ...lineHeights, ...fontFamilies, ...fontWeights, ...strokeWidths, ...horizontalSpacings, ...verticalSpacings, ...durations, ...curves, ...colorTokens, ...colorPaletteTokens3, ...colorStatusTokens3, ...createShadowTokens(colorTokens.colorNeutralShadowAmbient, colorTokens.colorNeutralShadowKey), ...createShadowTokens(colorTokens.colorBrandShadowAmbient, colorTokens.colorBrandShadowKey, "Brand") }; }; // node_modules/@fluentui/tokens/lib/themes/teams/highContrastTheme.js var teamsHighContrastTheme = { ...createHighContrastTheme(), ...fontFamilies2 }; // node_modules/@fluentui/tokens/lib/themes/web/lightTheme.js var webLightTheme = createLightTheme(brandWeb); // node_modules/@fluentui/tokens/lib/alias/darkColor.js var generateColorTokens4 = (brand) => ({ colorNeutralForeground1: white, colorNeutralForeground1Hover: white, colorNeutralForeground1Pressed: white, colorNeutralForeground1Selected: white, colorNeutralForeground2: grey[84], colorNeutralForeground2Hover: white, colorNeutralForeground2Pressed: white, colorNeutralForeground2Selected: white, colorNeutralForeground2BrandHover: brand[100], colorNeutralForeground2BrandPressed: brand[90], colorNeutralForeground2BrandSelected: brand[100], colorNeutralForeground3: grey[68], colorNeutralForeground3Hover: grey[84], colorNeutralForeground3Pressed: grey[84], colorNeutralForeground3Selected: grey[84], colorNeutralForeground3BrandHover: brand[100], colorNeutralForeground3BrandPressed: brand[90], colorNeutralForeground3BrandSelected: brand[100], colorNeutralForeground4: grey[60], colorNeutralForeground5: grey[68], colorNeutralForeground5Hover: white, colorNeutralForeground5Pressed: white, colorNeutralForeground5Selected: white, colorNeutralForegroundDisabled: grey[36], colorNeutralForegroundInvertedDisabled: whiteAlpha[40], colorBrandForegroundLink: brand[100], colorBrandForegroundLinkHover: brand[110], colorBrandForegroundLinkPressed: brand[90], colorBrandForegroundLinkSelected: brand[100], colorNeutralForeground2Link: grey[84], colorNeutralForeground2LinkHover: white, colorNeutralForeground2LinkPressed: white, colorNeutralForeground2LinkSelected: white, colorCompoundBrandForeground1: brand[100], colorCompoundBrandForeground1Hover: brand[110], colorCompoundBrandForeground1Pressed: brand[90], colorBrandForeground1: brand[100], colorBrandForeground2: brand[110], colorBrandForeground2Hover: brand[130], colorBrandForeground2Pressed: brand[160], colorNeutralForeground1Static: grey[14], colorNeutralForegroundStaticInverted: white, colorNeutralForegroundInverted: grey[14], colorNeutralForegroundInvertedHover: grey[14], colorNeutralForegroundInvertedPressed: grey[14], colorNeutralForegroundInvertedSelected: grey[14], colorNeutralForegroundInverted2: grey[14], colorNeutralForegroundOnBrand: white, colorNeutralForegroundInvertedLink: white, colorNeutralForegroundInvertedLinkHover: white, colorNeutralForegroundInvertedLinkPressed: white, colorNeutralForegroundInvertedLinkSelected: white, colorBrandForegroundInverted: brand[80], colorBrandForegroundInvertedHover: brand[70], colorBrandForegroundInvertedPressed: brand[60], colorBrandForegroundOnLight: brand[80], colorBrandForegroundOnLightHover: brand[70], colorBrandForegroundOnLightPressed: brand[50], colorBrandForegroundOnLightSelected: brand[60], colorNeutralBackground1: grey[16], colorNeutralBackground1Hover: grey[24], colorNeutralBackground1Pressed: grey[12], colorNeutralBackground1Selected: grey[22], colorNeutralBackground2: grey[12], colorNeutralBackground2Hover: grey[20], colorNeutralBackground2Pressed: grey[8], colorNeutralBackground2Selected: grey[18], colorNeutralBackground3: grey[8], colorNeutralBackground3Hover: grey[16], colorNeutralBackground3Pressed: grey[4], colorNeutralBackground3Selected: grey[14], colorNeutralBackground4: grey[4], colorNeutralBackground4Hover: grey[12], colorNeutralBackground4Pressed: black, colorNeutralBackground4Selected: grey[10], colorNeutralBackground5: black, colorNeutralBackground5Hover: grey[8], colorNeutralBackground5Pressed: grey[2], colorNeutralBackground5Selected: grey[6], colorNeutralBackground6: grey[20], colorNeutralBackground7: "#00000000", colorNeutralBackground7Hover: grey[10], colorNeutralBackground7Pressed: grey[4], colorNeutralBackground7Selected: "#00000000", colorNeutralBackground8: grey[16], colorNeutralBackgroundInverted: white, colorNeutralBackgroundInvertedHover: grey[96], colorNeutralBackgroundInvertedPressed: grey[88], colorNeutralBackgroundInvertedSelected: grey[92], colorNeutralBackgroundStatic: grey[24], colorNeutralBackgroundAlpha: grey10Alpha[50], colorNeutralBackgroundAlpha2: grey12Alpha[70], colorSubtleBackground: "transparent", colorSubtleBackgroundHover: grey[22], colorSubtleBackgroundPressed: grey[18], colorSubtleBackgroundSelected: grey[20], colorSubtleBackgroundLightAlphaHover: grey14Alpha[80], colorSubtleBackgroundLightAlphaPressed: grey14Alpha[50], colorSubtleBackgroundLightAlphaSelected: "transparent", colorSubtleBackgroundInverted: "transparent", colorSubtleBackgroundInvertedHover: blackAlpha[10], colorSubtleBackgroundInvertedPressed: blackAlpha[30], colorSubtleBackgroundInvertedSelected: blackAlpha[20], colorTransparentBackground: "transparent", colorTransparentBackgroundHover: "transparent", colorTransparentBackgroundPressed: "transparent", colorTransparentBackgroundSelected: "transparent", colorNeutralBackgroundDisabled: grey[8], colorNeutralBackgroundDisabled2: grey[16], colorNeutralBackgroundInvertedDisabled: whiteAlpha[10], colorNeutralStencil1: grey[34], colorNeutralStencil2: grey[20], colorNeutralStencil1Alpha: whiteAlpha[10], colorNeutralStencil2Alpha: whiteAlpha[5], colorBackgroundOverlay: blackAlpha[50], colorScrollbarOverlay: whiteAlpha[60], colorBrandBackground: brand[70], colorBrandBackgroundHover: brand[80], colorBrandBackgroundPressed: brand[40], colorBrandBackgroundSelected: brand[60], colorCompoundBrandBackground: brand[100], colorCompoundBrandBackgroundHover: brand[110], colorCompoundBrandBackgroundPressed: brand[90], colorBrandBackgroundStatic: brand[80], colorBrandBackground2: brand[20], colorBrandBackground2Hover: brand[40], colorBrandBackground2Pressed: brand[10], colorBrandBackground3Static: brand[60], colorBrandBackground4Static: brand[40], colorBrandBackgroundInverted: white, colorBrandBackgroundInvertedHover: brand[160], colorBrandBackgroundInvertedPressed: brand[140], colorBrandBackgroundInvertedSelected: brand[150], colorNeutralCardBackground: grey[20], colorNeutralCardBackgroundHover: grey[24], colorNeutralCardBackgroundPressed: grey[18], colorNeutralCardBackgroundSelected: grey[22], colorNeutralCardBackgroundDisabled: grey[8], colorNeutralStrokeAccessible: grey[68], colorNeutralStrokeAccessibleHover: grey[74], colorNeutralStrokeAccessiblePressed: grey[70], colorNeutralStrokeAccessibleSelected: brand[100], colorNeutralStroke1: grey[40], colorNeutralStroke1Hover: grey[46], colorNeutralStroke1Pressed: grey[42], colorNeutralStroke1Selected: grey[44], colorNeutralStroke2: grey[32], colorNeutralStroke3: grey[24], colorNeutralStroke4: grey[24], colorNeutralStroke4Hover: grey[18], colorNeutralStroke4Pressed: grey[14], colorNeutralStroke4Selected: grey[24], colorNeutralStrokeSubtle: grey[4], colorNeutralStrokeOnBrand: grey[16], colorNeutralStrokeOnBrand2: white, colorNeutralStrokeOnBrand2Hover: white, colorNeutralStrokeOnBrand2Pressed: white, colorNeutralStrokeOnBrand2Selected: white, colorBrandStroke1: brand[100], colorBrandStroke2: brand[50], colorBrandStroke2Hover: brand[50], colorBrandStroke2Pressed: brand[30], colorBrandStroke2Contrast: brand[50], colorCompoundBrandStroke: brand[100], colorCompoundBrandStrokeHover: brand[110], colorCompoundBrandStrokePressed: brand[90], colorNeutralStrokeDisabled: grey[26], colorNeutralStrokeDisabled2: grey[24], colorNeutralStrokeInvertedDisabled: whiteAlpha[40], colorTransparentStroke: "transparent", colorTransparentStrokeInteractive: "transparent", colorTransparentStrokeDisabled: "transparent", colorNeutralStrokeAlpha: whiteAlpha[10], colorNeutralStrokeAlpha2: whiteAlpha[20], colorStrokeFocus1: black, colorStrokeFocus2: white, colorNeutralShadowAmbient: "rgba(0,0,0,0.24)", colorNeutralShadowKey: "rgba(0,0,0,0.28)", colorNeutralShadowAmbientLighter: "rgba(0,0,0,0.12)", colorNeutralShadowKeyLighter: "rgba(0,0,0,0.14)", colorNeutralShadowAmbientDarker: "rgba(0,0,0,0.40)", colorNeutralShadowKeyDarker: "rgba(0,0,0,0.48)", colorBrandShadowAmbient: "rgba(0,0,0,0.30)", colorBrandShadowKey: "rgba(0,0,0,0.25)" }); // node_modules/@fluentui/tokens/lib/utils/createDarkTheme.js var createDarkTheme = (brand) => { const colorTokens = generateColorTokens4(brand); return { ...borderRadius, ...fontSizes, ...lineHeights, ...fontFamilies, ...fontWeights, ...strokeWidths, ...horizontalSpacings, ...verticalSpacings, ...durations, ...curves, ...colorTokens, ...colorPaletteTokens2, ...colorStatusTokens2, ...createShadowTokens(colorTokens.colorNeutralShadowAmbient, colorTokens.colorNeutralShadowKey), ...createShadowTokens(colorTokens.colorBrandShadowAmbient, colorTokens.colorBrandShadowKey, "Brand") }; }; // node_modules/@fluentui/tokens/lib/themes/web/darkTheme.js var webDarkTheme = createDarkTheme(brandWeb); // node_modules/@fluentui/tokens/lib/themeToTokensObject.js function themeToTokensObject(theme) { const tokens2 = {}; const keys = Object.keys(theme); for (const key of keys) { tokens2[key] = `var(--${String(key)})`; } return tokens2; } // node_modules/@fluentui/react-tabster/lib/focus/createFocusOutlineStyle.js function getOutlinePosition({ outlineWidth, outlineOffset }, position) { const offsetValue = (outlineOffset === null || outlineOffset === void 0 ? void 0 : outlineOffset[position]) || outlineOffset; if (!outlineOffset) { return `calc(${outlineWidth} * -1)`; } return `calc(0px - ${outlineWidth} - ${offsetValue})`; } var getFocusOutlineStyles = (options) => { const { outlineRadius, outlineColor, outlineWidth } = options; return { ...shorthands.borderColor("transparent"), "@media (forced-colors: active)": { "::after": { ...shorthands.borderColor("Highlight") } }, "::after": { content: '""', position: "absolute", pointerEvents: "none", zIndex: 1, border: `${outlineWidth} solid ${outlineColor}`, borderRadius: outlineRadius, top: getOutlinePosition(options, "top"), right: getOutlinePosition(options, "right"), bottom: getOutlinePosition(options, "bottom"), left: getOutlinePosition(options, "left") } }; }; var createFocusOutlineStyle = ({ enableOutline = false, selector = defaultOptions.selector, customizeSelector, style = defaultOptions.style } = defaultOptions) => ({ ":focus": { outlineStyle: enableOutline ? void 0 : "none" }, ":focus-visible": { outlineStyle: enableOutline ? void 0 : "none" }, ...createCustomFocusIndicatorStyle(getFocusOutlineStyles({ outlineColor: tokens.colorStrokeFocus2, outlineRadius: tokens.borderRadiusMedium, // FIXME: tokens.strokeWidthThick causes some weird bugs outlineWidth: "2px", ...style }), { selector, customizeSelector }) }); // node_modules/@fluentui/react-tabster/lib/tabster-types-6.0.1-do-not-use.js var FocusableSelector = [ "a[href]", "button:not([disabled])", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])", "*[tabindex]", "*[contenteditable]" ].join(", "); // node_modules/@fluentui/react-provider/lib/components/FluentProvider/useFluentProvider.js var React57 = __toESM(require_react()); // node_modules/@fluentui/react-provider/lib/components/FluentProvider/useFluentProviderThemeStyleTag.js var React56 = __toESM(require_react()); // node_modules/@fluentui/react-provider/lib/components/FluentProvider/useFluentProviderStyles.styles.js var fluentProviderClassNames = { root: "fui-FluentProvider" }; var useStyles = __styles({ root: { sj55zd: "f19n0e5", De3pzq: "fxugw4r", fsow6f: ["f1o700av", "fes3tcz"], Bahqtrf: "fk6fouc", Be2twd7: "fkhj508", Bhrd7zp: "figsok6", Bg96gwp: "f1i3iumi" } }, { d: [".f19n0e5{color:var(--colorNeutralForeground1);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"] }); var useFluentProviderStyles_unstable = (state) => { "use no memo"; const renderer = useRenderer(); const styles = useStyles({ dir: state.dir, renderer }); state.root.className = mergeClasses(fluentProviderClassNames.root, state.themeClassName, styles.root, state.root.className); return state; }; // node_modules/@fluentui/react-provider/lib/components/FluentProvider/useFluentProviderThemeStyleTag.js var useInsertionEffect2 = React56["useInsertionEffect"] ? React56["useInsertionEffect"] : useIsomorphicLayoutEffect; var createStyleTag = (target, elementAttributes) => { if (!(target === null || target === void 0 ? void 0 : target.head)) { return void 0; } const tag = target.createElement("style"); Object.keys(elementAttributes).forEach((attrName) => { tag.setAttribute(attrName, elementAttributes[attrName]); }); target.head.appendChild(tag); return tag; }; var insertSheet = (tag, rule) => { const sheet = tag.sheet; if (sheet) { if (sheet.cssRules.length > 0) { sheet.deleteRule(0); } sheet.insertRule(rule, 0); } else if (true) { console.error("FluentProvider: No sheet available on styleTag, styles will not be inserted into DOM."); } }; var useFluentProviderThemeStyleTag = (options) => { "use no memo"; const { targetDocument, theme, rendererAttributes } = options; const styleTag = React56.useRef(void 0); const styleTagId = useId2(fluentProviderClassNames.root); const styleElementAttributes = rendererAttributes; const rule = React56.useMemo(() => createCSSRuleFromTheme(`.${styleTagId}`, theme), [ theme, styleTagId ]); if (true) { React56.useMemo(() => { if (targetDocument) { var _styleElement_textContent; const providerElementSelector = `.${fluentProviderClassNames.root}.${styleTagId}`; const providerElements = targetDocument.querySelectorAll(providerElementSelector); const styleElementSelector = `style[id="${styleTagId}"]`; const styleElements = targetDocument.querySelectorAll(styleElementSelector); if (styleElements.length > 1) { console.error([ "@fluentui/react-provider: We found multiple