v-float 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -175
- package/dist/index.d.mts +688 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2038 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +74 -75
- package/dist/composables/index.d.ts +0 -4
- package/dist/composables/index.d.ts.map +0 -1
- package/dist/composables/interactions/index.d.ts +0 -7
- package/dist/composables/interactions/index.d.ts.map +0 -1
- package/dist/composables/interactions/polygon.d.ts +0 -38
- package/dist/composables/interactions/polygon.d.ts.map +0 -1
- package/dist/composables/interactions/use-click.d.ts +0 -120
- package/dist/composables/interactions/use-click.d.ts.map +0 -1
- package/dist/composables/interactions/use-escape-key.d.ts +0 -57
- package/dist/composables/interactions/use-escape-key.d.ts.map +0 -1
- package/dist/composables/interactions/use-focus-trap.d.ts +0 -78
- package/dist/composables/interactions/use-focus-trap.d.ts.map +0 -1
- package/dist/composables/interactions/use-focus.d.ts +0 -60
- package/dist/composables/interactions/use-focus.d.ts.map +0 -1
- package/dist/composables/interactions/use-hover.d.ts +0 -78
- package/dist/composables/interactions/use-hover.d.ts.map +0 -1
- package/dist/composables/interactions/use-list-navigation.d.ts +0 -144
- package/dist/composables/interactions/use-list-navigation.d.ts.map +0 -1
- package/dist/composables/middlewares/arrow.d.ts +0 -25
- package/dist/composables/middlewares/arrow.d.ts.map +0 -1
- package/dist/composables/middlewares/index.d.ts +0 -4
- package/dist/composables/middlewares/index.d.ts.map +0 -1
- package/dist/composables/positioning/index.d.ts +0 -5
- package/dist/composables/positioning/index.d.ts.map +0 -1
- package/dist/composables/positioning/use-arrow.d.ts +0 -55
- package/dist/composables/positioning/use-arrow.d.ts.map +0 -1
- package/dist/composables/positioning/use-client-point.d.ts +0 -218
- package/dist/composables/positioning/use-client-point.d.ts.map +0 -1
- package/dist/composables/positioning/use-floating-tree.d.ts +0 -240
- package/dist/composables/positioning/use-floating-tree.d.ts.map +0 -1
- package/dist/composables/positioning/use-floating.d.ts +0 -162
- package/dist/composables/positioning/use-floating.d.ts.map +0 -1
- package/dist/composables/utils/is-using-keyboard.d.ts +0 -2
- package/dist/composables/utils/is-using-keyboard.d.ts.map +0 -1
- package/dist/composables/utils/use-active-descendant.d.ts +0 -8
- package/dist/composables/utils/use-active-descendant.d.ts.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/types.d.ts +0 -18
- package/dist/types.d.ts.map +0 -1
- package/dist/utils.d.ts +0 -92
- package/dist/utils.d.ts.map +0 -1
- package/dist/v-float.es.js +0 -3827
- package/dist/v-float.umd.js +0 -8
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { AutoUpdateOptions, Middleware, MiddlewareData, Placement, Strategy } from '@floating-ui/dom';
|
|
2
|
-
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
3
|
-
import { OpenChangeReason, VirtualElement } from '../../types';
|
|
4
|
-
/**
|
|
5
|
-
* Type for anchor element in floating UI
|
|
6
|
-
*/
|
|
7
|
-
export type AnchorElement = HTMLElement | VirtualElement | null;
|
|
8
|
-
/**
|
|
9
|
-
* Type for floating element in floating UI
|
|
10
|
-
*/
|
|
11
|
-
export type FloatingElement = HTMLElement | null;
|
|
12
|
-
/**
|
|
13
|
-
* CSS styles for positioning floating elements
|
|
14
|
-
*/
|
|
15
|
-
export type FloatingStyles = {
|
|
16
|
-
/**
|
|
17
|
-
* CSS position property
|
|
18
|
-
*/
|
|
19
|
-
position: Strategy;
|
|
20
|
-
/**
|
|
21
|
-
* CSS top property
|
|
22
|
-
*/
|
|
23
|
-
top: string;
|
|
24
|
-
/**
|
|
25
|
-
* CSS left property
|
|
26
|
-
*/
|
|
27
|
-
left: string;
|
|
28
|
-
/**
|
|
29
|
-
* CSS transform property
|
|
30
|
-
*/
|
|
31
|
-
transform?: string;
|
|
32
|
-
/**
|
|
33
|
-
* CSS will-change property
|
|
34
|
-
*/
|
|
35
|
-
"will-change"?: string;
|
|
36
|
-
} & {
|
|
37
|
-
[key: `--${string}`]: any;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Options for configuring floating element behavior
|
|
41
|
-
*/
|
|
42
|
-
export interface UseFloatingOptions {
|
|
43
|
-
/**
|
|
44
|
-
* Optional stable identifier for this floating context.
|
|
45
|
-
* Only relevant for tree-aware behavior and typically generated by `useFloatingTree().addNode(...)`.
|
|
46
|
-
* Standalone usage should omit this.
|
|
47
|
-
*/
|
|
48
|
-
id?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Where to place the floating element relative to its anchor element.
|
|
51
|
-
* @default 'bottom'
|
|
52
|
-
*/
|
|
53
|
-
placement?: MaybeRefOrGetter<Placement | undefined>;
|
|
54
|
-
/**
|
|
55
|
-
* The type of CSS positioning to use.
|
|
56
|
-
* @default 'absolute'
|
|
57
|
-
*/
|
|
58
|
-
strategy?: MaybeRefOrGetter<Strategy | undefined>;
|
|
59
|
-
/**
|
|
60
|
-
* Whether to use CSS transform instead of top/left positioning.
|
|
61
|
-
* @default true
|
|
62
|
-
*/
|
|
63
|
-
transform?: MaybeRefOrGetter<boolean | undefined>;
|
|
64
|
-
/**
|
|
65
|
-
* Middlewares modify the positioning coordinates in some fashion, or provide useful data for the consumer to use.
|
|
66
|
-
*/
|
|
67
|
-
middlewares?: MaybeRefOrGetter<Middleware[]>;
|
|
68
|
-
/**
|
|
69
|
-
* Whether to automatically update the position of the floating element.
|
|
70
|
-
* @default true
|
|
71
|
-
*/
|
|
72
|
-
autoUpdate?: boolean | AutoUpdateOptions;
|
|
73
|
-
/**
|
|
74
|
-
* Whether the floating element is open.
|
|
75
|
-
* @default false
|
|
76
|
-
*/
|
|
77
|
-
open?: Ref<boolean>;
|
|
78
|
-
/**
|
|
79
|
-
* Callback invoked whenever the open state changes via setOpen.
|
|
80
|
-
* Provides the new state, the reason, and the triggering DOM event (if any).
|
|
81
|
-
*/
|
|
82
|
-
onOpenChange?: (open: boolean, reason: OpenChangeReason, event?: Event) => void;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Context object returned by useFloating containing all necessary data and methods
|
|
86
|
-
*/
|
|
87
|
-
export interface FloatingContext {
|
|
88
|
-
/**
|
|
89
|
-
* Stable identifier for this floating context. Used for tree-aware interactions.
|
|
90
|
-
*/
|
|
91
|
-
id?: string;
|
|
92
|
-
/**
|
|
93
|
-
* The x-coordinate of the floating element
|
|
94
|
-
*/
|
|
95
|
-
x: Readonly<Ref<number>>;
|
|
96
|
-
/**
|
|
97
|
-
* The y-coordinate of the floating element
|
|
98
|
-
*/
|
|
99
|
-
y: Readonly<Ref<number>>;
|
|
100
|
-
/**
|
|
101
|
-
* The strategy used for positioning
|
|
102
|
-
*/
|
|
103
|
-
strategy: Readonly<Ref<Strategy>>;
|
|
104
|
-
/**
|
|
105
|
-
* The placement of the floating element
|
|
106
|
-
*/
|
|
107
|
-
placement: Readonly<Ref<Placement>>;
|
|
108
|
-
/**
|
|
109
|
-
* Data from middleware for additional customization
|
|
110
|
-
*/
|
|
111
|
-
middlewareData: Readonly<Ref<MiddlewareData>>;
|
|
112
|
-
/**
|
|
113
|
-
* Whether the floating element has been positioned
|
|
114
|
-
*/
|
|
115
|
-
isPositioned: Readonly<Ref<boolean>>;
|
|
116
|
-
/**
|
|
117
|
-
* Reactive styles to apply to the floating element
|
|
118
|
-
*/
|
|
119
|
-
floatingStyles: Readonly<Ref<FloatingStyles>>;
|
|
120
|
-
/**
|
|
121
|
-
* Function to manually update the position
|
|
122
|
-
*/
|
|
123
|
-
update: () => void;
|
|
124
|
-
/**
|
|
125
|
-
* The refs object containing references to anchor and floating elements
|
|
126
|
-
*/
|
|
127
|
-
refs: {
|
|
128
|
-
anchorEl: Ref<AnchorElement>;
|
|
129
|
-
floatingEl: Ref<FloatingElement>;
|
|
130
|
-
arrowEl: Ref<HTMLElement | null>;
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* Whether the floating element is open
|
|
134
|
-
*/
|
|
135
|
-
open: Readonly<Ref<boolean>>;
|
|
136
|
-
/**
|
|
137
|
-
* Function to explicitly set the open state of the floating element.
|
|
138
|
-
*/
|
|
139
|
-
setOpen: (open: boolean, reason?: OpenChangeReason, event?: Event) => void;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Composable function that provides positioning for a floating element relative to an anchor element
|
|
143
|
-
*
|
|
144
|
-
* This composable handles the positioning logic for floating elements (like tooltips, popovers, etc.)
|
|
145
|
-
* relative to their anchor elements. It uses Floating UI under the hood and provides reactive
|
|
146
|
-
* positioning data and styles.
|
|
147
|
-
*
|
|
148
|
-
* @param anchorEl - The anchor element or a reactive reference to it
|
|
149
|
-
* @param floatingEl - The floating element or a reactive reference to it
|
|
150
|
-
* @param options - Additional options for the floating behavior
|
|
151
|
-
* @returns A FloatingContext object containing positioning data and methods
|
|
152
|
-
*
|
|
153
|
-
* @example
|
|
154
|
-
* ```ts
|
|
155
|
-
* const { floatingStyles, refs } = useFloating(anchorEl, floatingEl, {
|
|
156
|
-
* placement: 'bottom',
|
|
157
|
-
* strategy: 'absolute'
|
|
158
|
-
* })
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
|
-
export declare function useFloating(anchorEl: Ref<AnchorElement>, floatingEl: Ref<FloatingElement>, options?: UseFloatingOptions): FloatingContext;
|
|
162
|
-
//# sourceMappingURL=use-floating.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-floating.d.ts","sourceRoot":"","sources":["../../../src/composables/positioning/use-floating.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,SAAS,EACT,QAAQ,EACT,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAA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EAChC,OAAO,GAAE,kBAAuB,GAC/B,eAAe,CAmKjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-using-keyboard.d.ts","sourceRoot":"","sources":["../../../src/composables/utils/is-using-keyboard.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,eAAe,+CAAuB,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
-
export interface UseActiveDescendantOptions {
|
|
3
|
-
virtual: MaybeRefOrGetter<boolean>;
|
|
4
|
-
open: Ref<boolean>;
|
|
5
|
-
virtualItemRef?: Ref<HTMLElement | null>;
|
|
6
|
-
}
|
|
7
|
-
export declare function useActiveDescendant(anchorEl: ComputedRef<HTMLElement | null>, listRef: Ref<Array<HTMLElement | null>>, activeIndex: MaybeRefOrGetter<number | null>, options: UseActiveDescendantOptions): void;
|
|
8
|
-
//# sourceMappingURL=use-active-descendant.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-active-descendant.d.ts","sourceRoot":"","sources":["../../../src/composables/utils/use-active-descendant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAkB,MAAM,KAAK,CAAA;AAEjG,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAClC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAClB,cAAc,CAAC,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CACzC;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC,EACzC,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,EACvC,WAAW,EAAE,gBAAgB,CAAC,MAAM,GAAG,IAAI,CAAC,EAC5C,OAAO,EAAE,0BAA0B,GAClC,IAAI,CAmBN"}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type AnyFn<T extends unknown[] = unknown[], U = unknown> = (...args: T) => U;
|
|
2
|
-
export type Fn = () => void;
|
|
3
|
-
/**
|
|
4
|
-
* Minimal VirtualElement interface compatible with Floating UI expectations.
|
|
5
|
-
* Provides a bounding client rect and an optional context element for layout.
|
|
6
|
-
*/
|
|
7
|
-
export interface VirtualElement {
|
|
8
|
-
getBoundingClientRect: () => DOMRect;
|
|
9
|
-
/**
|
|
10
|
-
* Optional context element used by Floating UI to resolve layout metrics.
|
|
11
|
-
*/
|
|
12
|
-
contextElement?: Element;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Primary interaction reasons for open state changes. Minimal and extensible.
|
|
16
|
-
*/
|
|
17
|
-
export type OpenChangeReason = "anchor-click" | "keyboard-activate" | "outside-pointer" | "focus" | "blur" | "hover" | "escape-key" | "tree-ancestor-close" | "programmatic";
|
|
18
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,CAAC,GAAG,OAAO,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAA;AACnF,MAAM,MAAM,EAAE,GAAG,MAAM,IAAI,CAAA;AAE3B;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,qBAAqB,EAAE,MAAM,OAAO,CAAA;IACpC;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,mBAAmB,GACnB,iBAAiB,GACjB,OAAO,GACP,MAAM,GACN,OAAO,GACP,YAAY,GACZ,qBAAqB,GACrB,cAAc,CAAA"}
|
package/dist/utils.d.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { AnyFn, VirtualElement } from './types';
|
|
2
|
-
import { FloatingContext } from './composables/positioning/use-floating';
|
|
3
|
-
import { TreeNode } from './composables/positioning/use-floating-tree';
|
|
4
|
-
/**
|
|
5
|
-
* Wrapper around Vue's useId that provides a fallback counter-based ID generator.
|
|
6
|
-
* This ensures unique IDs even when useId() returns empty strings (e.g., in test environments).
|
|
7
|
-
*/
|
|
8
|
-
export declare function useId(): string;
|
|
9
|
-
/**
|
|
10
|
-
* Checks if a value is a function
|
|
11
|
-
*/
|
|
12
|
-
export declare function isFunction(value: unknown): value is AnyFn;
|
|
13
|
-
/**
|
|
14
|
-
* Type guard for HTMLElement
|
|
15
|
-
*/
|
|
16
|
-
export declare function isHTMLElement(value: unknown | null): value is HTMLElement;
|
|
17
|
-
/**
|
|
18
|
-
* Checks if the user agent is on a Mac.
|
|
19
|
-
*/
|
|
20
|
-
export declare function isMac(): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Checks if the browser is Safari.
|
|
23
|
-
*/
|
|
24
|
-
export declare function isSafari(): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* A simple utility to check if an element matches `:focus-visible`.
|
|
27
|
-
*/
|
|
28
|
-
export declare function matchesFocusVisible(element: Element): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Checks if the pointer type is mouse-like (mouse or pen).
|
|
31
|
-
*/
|
|
32
|
-
export declare function isMouseLikePointerType(pointerType: string | undefined, strict?: boolean): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Checks if the element is an input, textarea, or contenteditable element.
|
|
35
|
-
*/
|
|
36
|
-
export declare function isTypeableElement(element: Element | null): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Checks if the event target is a button-like element.
|
|
39
|
-
*/
|
|
40
|
-
export declare function isButtonTarget(event: KeyboardEvent): boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Checks if the Space key press should be ignored for the given element.
|
|
43
|
-
*/
|
|
44
|
-
export declare function isSpaceIgnored(element: Element | null): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Checks if the value is a VirtualElement.
|
|
47
|
-
*/
|
|
48
|
-
export declare function isVirtualElement(el: unknown): el is VirtualElement;
|
|
49
|
-
/**
|
|
50
|
-
* Checks if the event target is within the given element.
|
|
51
|
-
*/
|
|
52
|
-
export declare function isEventTargetWithin(event: Event, element: Element | null | undefined): boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Checks if a click event occurred on a scrollbar.
|
|
55
|
-
*/
|
|
56
|
-
export declare function isClickOnScrollbar(event: MouseEvent, target: HTMLElement): boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Simple element containment wrapper.
|
|
59
|
-
*/
|
|
60
|
-
export declare function contains(el: HTMLElement, target: Element | null): boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Event target extraction utility.
|
|
63
|
-
*/
|
|
64
|
-
export declare function getTarget(event: MouseEvent | TouchEvent): Element | null;
|
|
65
|
-
/**
|
|
66
|
-
* Safe performance timing that handles environments without performance API.
|
|
67
|
-
*/
|
|
68
|
-
export declare function getCurrentTime(): number;
|
|
69
|
-
/**
|
|
70
|
-
* Centralized timeout management to prevent memory leaks.
|
|
71
|
-
*/
|
|
72
|
-
export declare function clearTimeoutIfSet(timeoutId: number): void;
|
|
73
|
-
/**
|
|
74
|
-
* Type guard to determine if the context parameter is a TreeNode.
|
|
75
|
-
*/
|
|
76
|
-
export declare function isTreeNode(context: FloatingContext | TreeNode<FloatingContext>): context is TreeNode<FloatingContext>;
|
|
77
|
-
/**
|
|
78
|
-
* Extracts floating context and tree context from the parameter.
|
|
79
|
-
*/
|
|
80
|
-
export declare function getContextFromParameter(context: FloatingContext | TreeNode<FloatingContext>): {
|
|
81
|
-
floatingContext: FloatingContext;
|
|
82
|
-
treeContext: TreeNode<FloatingContext> | null;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Checks if a target node is within an anchor or floating element, handling VirtualElement.
|
|
86
|
-
*/
|
|
87
|
-
export declare function isTargetWithinElement(target: Node, element: unknown): boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Finds a descendant node that contains the target element.
|
|
90
|
-
*/
|
|
91
|
-
export declare function findDescendantContainingTarget(node: TreeNode<FloatingContext>, target: Node): TreeNode<FloatingContext> | null;
|
|
92
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAKpC;;;GAGG;AACH,wBAAgB,KAAK,IAAI,MAAM,CAI9B;AAED,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAA;AAM3E;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAEzD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,KAAK,IAAI,WAAW,CAEzE;AAMD;;GAEG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAG/B;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAGlC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAA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