@instructure/ui-toggle-details 8.24.4 → 8.24.6-snapshot.8

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.
@@ -1,40 +1,42 @@
1
1
  /** @jsx jsx */
2
- import { Component } from 'react';
2
+ import React, { Component } from 'react';
3
3
  import { IconArrowOpenEndSolid, IconArrowOpenDownSolid } from '@instructure/ui-icons';
4
4
  import { jsx } from '@instructure/emotion';
5
5
  import type { ToggleDetailsProps } from './props';
6
+ import type { ExpandableToggleProps } from '@instructure/ui-expandable';
6
7
  /**
7
8
  ---
8
9
  category: components
9
10
  ---
11
+ @tsProps
10
12
  **/
11
13
  declare class ToggleDetails extends Component<ToggleDetailsProps> {
12
14
  static readonly componentId = "ToggleDetails";
13
15
  static allowedProps: readonly (keyof {
14
16
  variant?: "default" | "filled" | undefined;
15
- summary: import("react").ReactNode;
17
+ summary: React.ReactNode;
16
18
  expanded?: boolean | undefined;
17
19
  defaultExpanded?: boolean | undefined;
18
- onToggle?: ((...args: any[]) => any) | undefined;
19
- icon?: ((...args: any[]) => any) | undefined;
20
- iconExpanded?: ((...args: any[]) => any) | undefined;
20
+ onToggle?: ((event: React.MouseEvent<Element, MouseEvent>, expanded: boolean) => void) | undefined;
21
+ icon?: ((...args: any[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
22
+ iconExpanded?: ((...args: any[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
21
23
  iconPosition?: "start" | "end" | undefined;
22
24
  fluidWidth?: boolean | undefined;
23
25
  size?: "small" | "medium" | "large" | undefined;
24
- children?: import("react").ReactNode;
26
+ children?: React.ReactNode;
25
27
  })[];
26
28
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
27
29
  variant?: "default" | "filled" | undefined;
28
- summary: import("react").ReactNode;
30
+ summary: React.ReactNode;
29
31
  expanded?: boolean | undefined;
30
32
  defaultExpanded?: boolean | undefined;
31
- onToggle?: ((...args: any[]) => any) | undefined;
32
- icon?: ((...args: any[]) => any) | undefined;
33
- iconExpanded?: ((...args: any[]) => any) | undefined;
33
+ onToggle?: ((event: React.MouseEvent<Element, MouseEvent>, expanded: boolean) => void) | undefined;
34
+ icon?: ((...args: any[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
35
+ iconExpanded?: ((...args: any[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
34
36
  iconPosition?: "start" | "end" | undefined;
35
37
  fluidWidth?: boolean | undefined;
36
38
  size?: "small" | "medium" | "large" | undefined;
37
- children?: import("react").ReactNode;
39
+ children?: React.ReactNode;
38
40
  }>;
39
41
  static defaultProps: {
40
42
  variant: string;
@@ -44,21 +46,23 @@ declare class ToggleDetails extends Component<ToggleDetailsProps> {
44
46
  iconExpanded: typeof IconArrowOpenDownSolid;
45
47
  iconPosition: string;
46
48
  defaultExpanded: boolean;
47
- onToggle: (event: any, expanded: any) => void;
48
49
  children: null;
49
50
  };
50
51
  ref: Element | null;
52
+ _button: HTMLElement | null;
51
53
  get focused(): boolean;
52
54
  focus(): void;
53
55
  componentDidMount(): void;
54
56
  componentDidUpdate(): void;
55
- getButtonRef: (el: any) => any;
56
- renderSummary(expanded: any): jsx.JSX.Element;
57
- renderToggle(toggleProps: any, expanded: any): jsx.JSX.Element;
58
- renderIcon(expanded: any): jsx.JSX.Element | null;
59
- renderDetails(expanded: any, detailsProps: any): jsx.JSX.Element;
57
+ getButtonRef: (el: Element | null) => HTMLElement;
58
+ renderSummary(expanded: boolean): jsx.JSX.Element;
59
+ renderToggle(toggleProps: ReturnType<ExpandableToggleProps>, expanded: boolean): jsx.JSX.Element;
60
+ renderIcon(expanded: boolean): jsx.JSX.Element | null;
61
+ renderDetails(expanded: boolean, detailsProps: {
62
+ id: string;
63
+ }): jsx.JSX.Element;
60
64
  renderContent(): jsx.JSX.Element;
61
- handleToggle: (event: any, expanded: any) => void;
65
+ handleToggle: (event: React.MouseEvent, expanded: boolean) => void;
62
66
  render(): jsx.JSX.Element;
63
67
  }
64
68
  export default ToggleDetails;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ToggleDetails/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,uBAAuB,CAAA;AAM9B,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,kBAAkB,EAA2B,MAAM,SAAS,CAAA;AAG1E;;;;GAIG;AACH,cAEM,aAAc,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IACvD,MAAM,CAAC,QAAQ,CAAC,WAAW,mBAAkB;IAC7C,MAAM,CAAC,YAAY;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;;MAWlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,IAAI,OAAO,YAGV;IAED,KAAK;IAKL,iBAAiB;IAIjB,kBAAkB;IAKlB,YAAY,mBAA8B;IAG1C,aAAa,CAAC,QAAQ,KAAA;IAatB,YAAY,CAAC,WAAW,KAAA,EAAE,QAAQ,KAAA;IA4ClC,UAAU,CAAC,QAAQ,KAAA;IAYnB,aAAa,CAAC,QAAQ,KAAA,EAAE,YAAY,KAAA;IAUpC,aAAa;IAKb,YAAY,sCAIX;IAED,MAAM;CAsBP;AAED,eAAe,aAAa,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ToggleDetails/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAExC,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,uBAAuB,CAAA;AAM9B,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAGrD,OAAO,KAAK,EAAE,kBAAkB,EAA2B,MAAM,SAAS,CAAA;AAE1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAEvE;;;;;GAKG;AACH,cAEM,aAAc,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IACvD,MAAM,CAAC,QAAQ,CAAC,WAAW,mBAAkB;IAC7C,MAAM,CAAC,YAAY;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;MASlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAC1B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAO;IAElC,IAAI,OAAO,YAEV;IAED,KAAK;IAIL,iBAAiB;IAIjB,kBAAkB;IAIlB,YAAY,OAAQ,OAAO,GAAG,IAAI,iBAAuC;IAEzE,aAAa,CAAC,QAAQ,EAAE,OAAO;IAY/B,YAAY,CACV,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC,EAC9C,QAAQ,EAAE,OAAO;IA2CnB,UAAU,CAAC,QAAQ,EAAE,OAAO;IAU5B,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;IAU7D,aAAa;IAIb,YAAY,UAAW,gBAAgB,YAAY,OAAO,UAKzD;IAED,MAAM;CAsBP;AAED,eAAe,aAAa,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -3,15 +3,42 @@ import type { OtherHTMLAttributes, PropValidators, ToggleDetailsTheme } from '@i
3
3
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
4
4
  declare type ToggleDetailsOwnProps = {
5
5
  variant?: 'default' | 'filled';
6
+ /**
7
+ * The summary that displays and can be interacted with
8
+ */
6
9
  summary: React.ReactNode;
10
+ /**
11
+ * Whether the content is expanded or hidden
12
+ */
7
13
  expanded?: boolean;
14
+ /**
15
+ * Whether the content is initially expanded or hidden (uncontrolled)
16
+ */
8
17
  defaultExpanded?: boolean;
9
- onToggle?: (...args: any[]) => any;
10
- icon?: (...args: any[]) => any;
11
- iconExpanded?: (...args: any[]) => any;
18
+ onToggle?: (event: React.MouseEvent, expanded: boolean) => void;
19
+ /**
20
+ * The icon to display next to the summary text when content is hidden
21
+ */
22
+ icon?: (...args: any[]) => React.ReactElement;
23
+ /**
24
+ * The icon to display when content is expanded
25
+ */
26
+ iconExpanded?: (...args: any[]) => React.ReactElement;
27
+ /**
28
+ * Icon position at the start or end of the summary text
29
+ */
12
30
  iconPosition?: 'start' | 'end';
31
+ /**
32
+ * should the summary fill the width of its container
33
+ */
13
34
  fluidWidth?: boolean;
35
+ /**
36
+ * Choose a size for the expand/collapse icon
37
+ */
14
38
  size?: 'small' | 'medium' | 'large';
39
+ /**
40
+ * The toggleable content passed inside the ToggleDetails component
41
+ */
15
42
  children?: React.ReactNode;
16
43
  };
17
44
  declare type PropKeys = keyof ToggleDetailsOwnProps;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/ToggleDetails/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EACnB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,qBAAqB,GAAG;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC9B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,CAAC,GAAG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R,MAAM,GACN,SAAS,GACT,SAAS,CACZ,CAAA;AAED,aAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAYvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAYnB,CAAA;AAED,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,40 +1,42 @@
1
1
  import React, { Component } from 'react';
2
+ import type { ExpandableToggleProps } from '@instructure/ui-expandable';
2
3
  import { IconArrowOpenEndSolid, IconArrowOpenDownSolid } from '@instructure/ui-icons';
3
4
  import type { ToggleGroupProps } from './props';
4
5
  /**
5
6
  ---
6
7
  category: components
7
8
  ---
9
+ @tsProps
8
10
  **/
9
11
  declare class ToggleGroup extends Component<ToggleGroupProps> {
10
12
  static readonly componentId = "ToggleGroup";
11
13
  static allowedProps: readonly (keyof {
12
14
  children: React.ReactNode;
13
15
  summary: React.ReactNode;
14
- toggleLabel: React.ReactNode | ((...args: any[]) => any);
16
+ toggleLabel: React.ReactNode | ((expanded: boolean) => React.ReactNode);
15
17
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
16
18
  elementRef?: ((element: Element | null) => void) | undefined;
17
19
  size?: "small" | "medium" | "large" | undefined;
18
- expanded?: any;
20
+ expanded?: boolean | undefined;
19
21
  defaultExpanded?: boolean | undefined;
20
- onToggle?: ((...args: any[]) => any) | undefined;
21
- icon?: React.ReactNode | ((...args: any[]) => any);
22
- iconExpanded?: React.ReactNode | ((...args: any[]) => any);
22
+ onToggle?: ((event: React.MouseEvent<Element, MouseEvent>, expanded: boolean) => void) | undefined;
23
+ icon?: React.ReactNode | ((...args: any[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>);
24
+ iconExpanded?: React.ReactNode | ((...args: any[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>);
23
25
  transition?: boolean | undefined;
24
26
  border?: boolean | undefined;
25
27
  })[];
26
28
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
27
29
  children: React.ReactNode;
28
30
  summary: React.ReactNode;
29
- toggleLabel: React.ReactNode | ((...args: any[]) => any);
31
+ toggleLabel: React.ReactNode | ((expanded: boolean) => React.ReactNode);
30
32
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
31
33
  elementRef?: ((element: Element | null) => void) | undefined;
32
34
  size?: "small" | "medium" | "large" | undefined;
33
- expanded?: any;
35
+ expanded?: boolean | undefined;
34
36
  defaultExpanded?: boolean | undefined;
35
- onToggle?: ((...args: any[]) => any) | undefined;
36
- icon?: React.ReactNode | ((...args: any[]) => any);
37
- iconExpanded?: React.ReactNode | ((...args: any[]) => any);
37
+ onToggle?: ((event: React.MouseEvent<Element, MouseEvent>, expanded: boolean) => void) | undefined;
38
+ icon?: React.ReactNode | ((...args: any[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>);
39
+ iconExpanded?: React.ReactNode | ((...args: any[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>);
38
40
  transition?: boolean | undefined;
39
41
  border?: boolean | undefined;
40
42
  }>;
@@ -43,23 +45,23 @@ declare class ToggleGroup extends Component<ToggleGroupProps> {
43
45
  readonly icon: typeof IconArrowOpenEndSolid;
44
46
  readonly iconExpanded: typeof IconArrowOpenDownSolid;
45
47
  readonly defaultExpanded: false;
46
- readonly onToggle: (event: any, expanded: any) => void;
47
48
  readonly transition: true;
48
49
  readonly as: "span";
49
- readonly elementRef: (el: any) => void;
50
50
  readonly border: true;
51
51
  };
52
52
  ref: Element | null;
53
- _button: Element | null;
53
+ _button: HTMLElement | null;
54
54
  _shouldTransition: boolean;
55
55
  handleRef: (el: Element | null) => void;
56
56
  handleButtonRef: (el: Element | null) => void;
57
57
  get focused(): boolean;
58
58
  focus(): void;
59
59
  componentDidMount(): void;
60
- renderIcon(expanded: any): JSX.Element;
61
- renderToggle(toggleProps: any, expanded: any): JSX.Element;
62
- renderDetails(detailsProps: any): JSX.Element;
60
+ renderIcon(expanded: boolean): any;
61
+ renderToggle(toggleProps: ReturnType<ExpandableToggleProps>, expanded: boolean): JSX.Element;
62
+ renderDetails(detailsProps: {
63
+ id: string;
64
+ }): JSX.Element;
63
65
  render(): JSX.Element;
64
66
  }
65
67
  export default ToggleGroup;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ToggleGroup/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAaxC,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG/C;;;;GAIG;AACH,cACM,WAAY,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IACnD,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,YAAY;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;;MAYT;IAEV,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAC1B,OAAO,EAAE,OAAO,GAAG,IAAI,CAAO;IAC9B,iBAAiB,UAAQ;IAEzB,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,eAAe,OAAQ,OAAO,GAAG,IAAI,UAEpC;IAED,IAAI,OAAO,YAEV;IAED,KAAK;IAKL,iBAAiB;IAKjB,UAAU,CAAC,QAAQ,KAAA;IAOnB,YAAY,CAAC,WAAW,KAAA,EAAE,QAAQ,KAAA;IAuBlC,aAAa,CAAC,YAAY,KAAA;IAkB1B,MAAM;CAyCP;AAED,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ToggleGroup/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAWxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAIvE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG/C;;;;;GAKG;AACH,cACM,WAAY,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IACnD,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,YAAY;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;MAQT;IAEV,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAC1B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAO;IAClC,iBAAiB,UAAQ;IAEzB,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,eAAe,OAAQ,OAAO,GAAG,IAAI,UAEpC;IAED,IAAI,OAAO,YAEV;IAED,KAAK;IAIL,iBAAiB;IAIjB,UAAU,CAAC,QAAQ,EAAE,OAAO;IAK5B,YAAY,CACV,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC,EAC9C,QAAQ,EAAE,OAAO;IAyBnB,aAAa,CAAC,YAAY,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;IAkB1C,MAAM;CAyCP;AAED,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -1,18 +1,55 @@
1
1
  import React from 'react';
2
2
  import { AsElementType, OtherHTMLAttributes, PropValidators } from '@instructure/shared-types';
3
3
  declare type ToggleGroupOwnProps = {
4
+ /**
5
+ * the content to show and hide
6
+ */
4
7
  children: React.ReactNode;
8
+ /**
9
+ * the content area next to the toggle button
10
+ */
5
11
  summary: React.ReactNode;
6
- toggleLabel: React.ReactNode | ((...args: any[]) => any);
12
+ /**
13
+ * provides a screenreader label for the toggle button
14
+ * (takes `expanded` as an argument if a function)
15
+ */
16
+ toggleLabel: React.ReactNode | ((expanded: boolean) => React.ReactNode);
17
+ /**
18
+ * the element type to render as
19
+ */
7
20
  as?: AsElementType;
21
+ /**
22
+ * provides a reference to the underlying html root element
23
+ */
8
24
  elementRef?: (element: Element | null) => void;
9
25
  size?: 'small' | 'medium' | 'large';
10
- expanded?: any;
26
+ /**
27
+ * Whether the content is expanded or hidden
28
+ */
29
+ expanded?: boolean;
30
+ /**
31
+ * Whether the content is initially expanded or hidden (uncontrolled)
32
+ */
11
33
  defaultExpanded?: boolean;
12
- onToggle?: (...args: any[]) => any;
13
- icon?: React.ReactNode | ((...args: any[]) => any);
14
- iconExpanded?: React.ReactNode | ((...args: any[]) => any);
34
+ /**
35
+ * Fired when the content display is toggled
36
+ */
37
+ onToggle?: (event: React.MouseEvent, expanded: boolean) => void;
38
+ /**
39
+ * The icon displayed in the toggle button when the content is hidden
40
+ */
41
+ icon?: React.ReactNode | ((...args: any[]) => React.ReactElement);
42
+ /**
43
+ * The icon displayed in the toggle button when the content is showing
44
+ */
45
+ iconExpanded?: React.ReactNode | ((...args: any[]) => React.ReactElement);
46
+ /**
47
+ * Transition content into view
48
+ */
15
49
  transition?: boolean;
50
+ /**
51
+ * Toggle the border around the component
52
+ */
16
53
  border?: boolean;
17
54
  };
18
55
  declare type PropKeys = keyof ToggleGroupOwnProps;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/ToggleGroup/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,cAAc,EACf,MAAM,2BAA2B,CAAA;AAElC,aAAK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