@televet/kibble-ui 3.0.6-franklin-2 → 3.0.6-franklin-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,7 +15,7 @@ export interface KSelectProps extends WithFormControlProps {
|
|
|
15
15
|
placeholder?: string;
|
|
16
16
|
emptyStateText?: string;
|
|
17
17
|
selectedOptionContainerProps?: FlexProps;
|
|
18
|
-
renderCustomSelectedOption?: (props:
|
|
18
|
+
renderCustomSelectedOption?: (props: SelectOptionProps) => JSX.Element;
|
|
19
19
|
}
|
|
20
20
|
export type SelectProps = KSelectProps & Omit<CSelectProps, 'onSelect'>;
|
|
21
21
|
declare const WrappedSelect: React.FC<KSelectProps & Omit<CSelectProps, "onSelect">>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.component-e9c7db8b.js","sources":["../src/components/Select/components/SelectList/selectList.component.tsx","../src/components/Select/components/SelectContainer/selectContainer.component.tsx","../src/components/Select/select.component.tsx"],"sourcesContent":["import React from 'react';\nimport { MenuList, KMenuListProps, MenuListProps } from '../../../Menu/components/MenuList/menuList.component';\nimport { SelectOptionProps } from '../SelectOption/selectOption.types';\n\nexport interface KSelectListProps\n extends Omit<\n KMenuListProps,\n | 'canSelectAll'\n | 'canSelectGroups'\n | 'isMultiSelect'\n | 'onSelectAll'\n | 'menuItems'\n | 'shouldRetainSelection'\n | 'isMatchWidthSet'\n | 'isLoading'\n > {\n options?: SelectOptionProps[];\n}\n\nexport type SelectListProps = KSelectListProps & MenuListProps;\n\nexport const SelectList = (props: SelectListProps): JSX.Element => {\n const { options, ...rest } = props;\n\n return <MenuList shouldRetainSelection={true} menuItems={options} isMatchWidthSet={true} {...rest} />;\n};\n","import React, { ReactNode } from 'react';\nimport { Flex, FlexProps } from '@chakra-ui/react';\nimport { Text } from '../../../Text/text.component';\nimport { SelectOptionProps } from '../SelectOption/selectOption.types';\n\nexport interface SelectContainerProps extends FlexProps {\n selectedOption: SelectOptionProps;\n defaultLeftElement: ReactNode;\n shouldTruncateText?: boolean;\n}\n\nexport const SelectContainer = ({\n selectedOption,\n defaultLeftElement,\n shouldTruncateText = true,\n ...rest\n}: SelectContainerProps): JSX.Element => {\n return (\n <Flex\n data-testid=\"dropdown-container\"\n className=\"Select__Container\"\n justify=\"flex-start\"\n align=\"center\"\n textAlign=\"left\"\n color={selectedOption.variant ? `text.${selectedOption.variant}` : 'text.default'}\n {...rest}\n >\n {selectedOption?.leftElement ? (\n <Flex align=\"center\" className=\"Select__LeftElement\" pr={2}>\n {selectedOption.leftElement}\n </Flex>\n ) : defaultLeftElement ? (\n <Flex align=\"center\" className=\"Select__LeftElement\" pr={2}>\n {defaultLeftElement}\n </Flex>\n ) : null}\n {typeof selectedOption.label === 'string' ? (\n <Text className=\"Select__Text\" isTruncated={shouldTruncateText} variant={selectedOption.variant || 'default'}>\n {selectedOption.label}\n </Text>\n ) : (\n selectedOption.label\n )}\n </Flex>\n );\n};\n","import React, { useMemo, ReactNode, useRef, useState, useCallback, useEffect } from 'react';\nimport { Select as CSelect, SelectProps as CSelectProps, MenuButton, FlexProps } from '@chakra-ui/react';\nimport { MenuContainer, MenuContainerProps } from '../Menu/components/MenuContainer/menuContainer.component';\nimport { WithFormControlProps, withFormControl } from 'shared/hocs/FormControl/withFormControl';\nimport { MenuProvider } from '../Menu/context/menu.context';\nimport { SelectList, SelectListProps } from './components/SelectList/selectList.component';\nimport { SelectContainer } from './components/SelectContainer/selectContainer.component';\nimport { Icon } from '../Icon/icon.component';\nimport { IconSize } from '../Icon/icon.types';\nimport { FormControlSize } from 'shared/types/formControl';\nimport { SelectOptionProps } from './components/SelectOption/selectOption.types';\n\nexport interface KSelectProps extends WithFormControlProps {\n defaultLeftElement?: ReactNode;\n listProps?: SelectListProps;\n containerProps?: MenuContainerProps;\n options: SelectOptionProps[];\n size?: FormControlSize;\n isOnContrast?: boolean;\n placeholder?: string;\n emptyStateText?: string;\n selectedOptionContainerProps?: FlexProps;\n renderCustomSelectedOption?: (props: unknown) => JSX.Element;\n}\n\nexport type SelectProps = KSelectProps & Omit<CSelectProps, 'onSelect'>;\n\nconst Select = ({\n defaultLeftElement,\n isFieldInline,\n listProps,\n options,\n placeholder,\n size = 'md',\n value,\n maxW = '100%',\n isOnContrast,\n emptyStateText,\n containerProps,\n selectedOptionContainerProps,\n renderCustomSelectedOption,\n ...rest\n}: SelectProps): JSX.Element => {\n // TODO: Need to add full support for isOnContrast, currently menu list still renders white\n const _computedVariant = isOnContrast ? 'onContrast' : 'default';\n const selectRef = useRef<HTMLSelectElement>(null);\n const placeholderOption: SelectOptionProps = useMemo(\n () => ({\n label: placeholder,\n value: '',\n variant: isOnContrast ? 'placeholderOnContrast' : 'placeholder',\n leftElement: null,\n isSelected: false,\n isPlaceholder: true,\n }),\n [placeholder, isOnContrast],\n );\n\n const [allOptions, setAllOptions] = useState<SelectOptionProps[]>([]);\n\n const selectedOption: SelectOptionProps = useMemo(() => {\n const selectedItem = allOptions.find((option) => option.isSelected);\n\n return selectedItem ? selectedItem : placeholderOption;\n }, [allOptions, placeholderOption]);\n\n const handleSelect = useCallback(\n (selectedItem: SelectOptionProps) => {\n if (!allOptions) return;\n\n const updatedOptions = allOptions.map((option) => {\n return {\n ...option,\n isSelected: option.value === selectedItem.value,\n };\n });\n setAllOptions(updatedOptions);\n\n if (listProps?.onSelect) {\n listProps.onSelect(selectedItem);\n }\n },\n [allOptions, listProps],\n );\n\n // If the text is not being truncated it should grow to fit the content\n const flexibleHeightProps = !listProps?.shouldTruncateText ? { height: 'max-content', minH: 10 } : {};\n\n const selectWidth = useMemo(() => {\n if (!selectRef.current) {\n return '320px';\n }\n\n return `${selectRef?.current?.clientWidth}px`;\n\n // Disables the warning for not including unused dependency in the hook array. This dependency is needed to rerender the menu list with the correct width\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectRef?.current]);\n\n // Set default selected state\n useEffect(() => {\n const mappedOptions = options.map((option) => ({\n ...option,\n isSelected: option.value === value,\n }));\n\n // A timeout is used in MenuProvider->handleOnClose to modify `filteredMenuItems` with a delay of 200 ms.\n // This was introduced to prevent a jumpy menu effect during closure.\n // Internally, selecting a menu item triggers updates to `menuItems`.\n // However, for this component, we rely on `setAllOptions` as the main source of truth.\n // The additional timeout ensures that the menu items update correctly without conflicts,\n // addressing an issue where the options wouldn't reflect the latest changes.\n setTimeout(() => {\n setAllOptions([...mappedOptions, placeholderOption]);\n }, 250);\n }, [options, placeholderOption, value]);\n\n return (\n <MenuProvider menuItems={allOptions}>\n <MenuContainer matchWidth={true} isLazy={true} {...containerProps}>\n <CSelect\n icon={\n <Icon\n name=\"chevronDown\"\n size={size as IconSize}\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n />\n }\n as={MenuButton}\n ref={selectRef}\n onClick={(event: React.MouseEvent): void => event.stopPropagation()}\n type=\"button\"\n className=\"Select__MenuButton\"\n variant={_computedVariant}\n maxW={maxW}\n {...flexibleHeightProps}\n {...rest}\n >\n {renderCustomSelectedOption ? (\n renderCustomSelectedOption(selectedOption)\n ) : (\n <SelectContainer\n selectedOption={selectedOption}\n defaultLeftElement={defaultLeftElement}\n shouldTruncateText={listProps?.shouldTruncateText}\n {...selectedOptionContainerProps}\n />\n )}\n </CSelect>\n <SelectList\n {...listProps}\n onSelect={handleSelect}\n options={allOptions}\n maxW={selectWidth || maxW}\n emptyStateText={emptyStateText}\n />\n </MenuContainer>\n </MenuProvider>\n );\n};\n\nSelect.displayName = 'Select';\n\nconst WrappedSelect = withFormControl(Select);\n\nexport { WrappedSelect as Select };\n"],"names":["SelectList","props","options","rest","__rest","React","MenuList","Object","assign","shouldRetainSelection","menuItems","isMatchWidthSet","SelectContainer","_a","selectedOption","defaultLeftElement","shouldTruncateText","createElement","Flex","className","justify","align","textAlign","color","variant","leftElement","pr","label","Text","isTruncated","Select","isFieldInline","listProps","placeholder","size","value","maxW","isOnContrast","emptyStateText","containerProps","selectedOptionContainerProps","renderCustomSelectedOption","_computedVariant","selectRef","useRef","placeholderOption","useMemo","isSelected","isPlaceholder","allOptions","setAllOptions","useState","selectedItem","find","option","handleSelect","useCallback","updatedOptions","map","onSelect","flexibleHeightProps","height","minH","selectWidth","current","clientWidth","useEffect","mappedOptions","setTimeout","MenuProvider","MenuContainer","matchWidth","isLazy","CSelect","icon","Icon","name","display","justifyContent","alignItems","as","MenuButton","ref","onClick","event","stopPropagation","type","displayName","WrappedSelect","withFormControl"],"mappings":"kjBAqBO,MAAMA,EAAcC,IACzB,MAAMC,QAAEA,GAAqBD,EAATE,EAAIC,EAAAA,OAAKH,EAAvB,CAAoB,YAE1B,OAAOI,EAAAA,sBAACC,EAAAA,SAAQC,OAAAC,OAAA,CAACC,uBAAuB,EAAMC,UAAWR,EAASS,iBAAiB,GAAUR,KCblFS,EAAmBC,IAAA,IAAAC,eAC9BA,EAAcC,mBACdA,EAAkBC,mBAClBA,GAAqB,GAAIH,EACtBV,EAJ2BC,EAAAA,OAAAS,EAAA,CAAA,iBAAA,qBAAA,uBAM9B,OACER,UAACY,cAAAC,EAAIA,kCACS,qBACZC,UAAU,oBACVC,QAAQ,aACRC,MAAM,SACNC,UAAU,OACVC,MAAOT,EAAeU,QAAU,QAAQV,EAAeU,UAAY,gBAC/DrB,IAEHW,MAAAA,OAAc,EAAdA,EAAgBW,aACfpB,EAAA,QAAAY,cAACC,OAAI,CAACG,MAAM,SAASF,UAAU,sBAAsBO,GAAI,GACtDZ,EAAeW,aAEhBV,EACFV,EAAA,QAAAY,cAACC,OAAI,CAACG,MAAM,SAASF,UAAU,sBAAsBO,GAAI,GACtDX,GAED,KAC6B,iBAAzBD,EAAea,MACrBtB,wBAACuB,cAAI,CAACT,UAAU,eAAeU,YAAab,EAAoBQ,QAASV,EAAeU,SAAW,WAChGV,EAAea,OAGlBb,EAAoB,QCdtBgB,EAAUjB,IAAA,IAAAE,mBACdA,EAAkBgB,cAClBA,EAAaC,UACbA,EAAS9B,QACTA,EAAO+B,YACPA,EAAWC,KAC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B,MAChC,OACF,CAAC3C,EAAS2C,EAAmBV,IAG9B9B,EAAC,QAAAY,cAAAoD,EAAYA,aAAC,CAAA3D,UAAWuC,GACvB5C,EAAAA,QAACY,cAAAqD,gBAAc/D,OAAAC,OAAA,CAAA+D,YAAY,EAAMC,QAAQ,GAAUjC,GACjDlC,EAAC,QAAAY,cAAAwD,EAAO3C,sBACN4C,KACErE,EAAAA,sBAACsE,EAAAA,KAAI,CACHC,KAAK,cACL1C,KAAMA,EACN2C,QAAQ,OACRC,eAAe,SACfC,WAAW,WAGfC,GAAIC,EAAAA,WACJC,IAAKvC,EACLwC,QAAUC,GAAkCA,EAAMC,kBAClDC,KAAK,SACLnE,UAAU,qBACVK,QAASkB,EACTN,KAAMA,GACFwB,EACAzD,GAEHsC,EACCA,EAA2B3B,GAE3BT,EAAAA,QAAAY,cAACL,EAAeL,OAAAC,OAAA,CACdM,eAAgBA,EAChBC,mBAAoBA,EACpBC,mBAAoBgB,MAAAA,OAAS,EAATA,EAAWhB,oBAC3BwB,KAIVnC,UAACY,cAAAjB,EACKO,OAAAC,OAAA,GAAAwB,EACJ,CAAA2B,SAAUJ,EACVrD,QAAS+C,EACTb,KAAM2B,GAAe3B,EACrBE,eAAgBA,QAO1BR,EAAOyD,YAAc,SAErB,MAAMC,EAAgBC,EAAeA,gBAAC3D"}
|
|
1
|
+
{"version":3,"file":"select.component-e9c7db8b.js","sources":["../src/components/Select/components/SelectList/selectList.component.tsx","../src/components/Select/components/SelectContainer/selectContainer.component.tsx","../src/components/Select/select.component.tsx"],"sourcesContent":["import React from 'react';\nimport { MenuList, KMenuListProps, MenuListProps } from '../../../Menu/components/MenuList/menuList.component';\nimport { SelectOptionProps } from '../SelectOption/selectOption.types';\n\nexport interface KSelectListProps\n extends Omit<\n KMenuListProps,\n | 'canSelectAll'\n | 'canSelectGroups'\n | 'isMultiSelect'\n | 'onSelectAll'\n | 'menuItems'\n | 'shouldRetainSelection'\n | 'isMatchWidthSet'\n | 'isLoading'\n > {\n options?: SelectOptionProps[];\n}\n\nexport type SelectListProps = KSelectListProps & MenuListProps;\n\nexport const SelectList = (props: SelectListProps): JSX.Element => {\n const { options, ...rest } = props;\n\n return <MenuList shouldRetainSelection={true} menuItems={options} isMatchWidthSet={true} {...rest} />;\n};\n","import React, { ReactNode } from 'react';\nimport { Flex, FlexProps } from '@chakra-ui/react';\nimport { Text } from '../../../Text/text.component';\nimport { SelectOptionProps } from '../SelectOption/selectOption.types';\n\nexport interface SelectContainerProps extends FlexProps {\n selectedOption: SelectOptionProps;\n defaultLeftElement: ReactNode;\n shouldTruncateText?: boolean;\n}\n\nexport const SelectContainer = ({\n selectedOption,\n defaultLeftElement,\n shouldTruncateText = true,\n ...rest\n}: SelectContainerProps): JSX.Element => {\n return (\n <Flex\n data-testid=\"dropdown-container\"\n className=\"Select__Container\"\n justify=\"flex-start\"\n align=\"center\"\n textAlign=\"left\"\n color={selectedOption.variant ? `text.${selectedOption.variant}` : 'text.default'}\n {...rest}\n >\n {selectedOption?.leftElement ? (\n <Flex align=\"center\" className=\"Select__LeftElement\" pr={2}>\n {selectedOption.leftElement}\n </Flex>\n ) : defaultLeftElement ? (\n <Flex align=\"center\" className=\"Select__LeftElement\" pr={2}>\n {defaultLeftElement}\n </Flex>\n ) : null}\n {typeof selectedOption.label === 'string' ? (\n <Text className=\"Select__Text\" isTruncated={shouldTruncateText} variant={selectedOption.variant || 'default'}>\n {selectedOption.label}\n </Text>\n ) : (\n selectedOption.label\n )}\n </Flex>\n );\n};\n","import React, { useMemo, ReactNode, useRef, useState, useCallback, useEffect } from 'react';\nimport { Select as CSelect, SelectProps as CSelectProps, MenuButton, FlexProps } from '@chakra-ui/react';\nimport { MenuContainer, MenuContainerProps } from '../Menu/components/MenuContainer/menuContainer.component';\nimport { WithFormControlProps, withFormControl } from 'shared/hocs/FormControl/withFormControl';\nimport { MenuProvider } from '../Menu/context/menu.context';\nimport { SelectList, SelectListProps } from './components/SelectList/selectList.component';\nimport { SelectContainer } from './components/SelectContainer/selectContainer.component';\nimport { Icon } from '../Icon/icon.component';\nimport { IconSize } from '../Icon/icon.types';\nimport { FormControlSize } from 'shared/types/formControl';\nimport { SelectOptionProps } from './components/SelectOption/selectOption.types';\n\nexport interface KSelectProps extends WithFormControlProps {\n defaultLeftElement?: ReactNode;\n listProps?: SelectListProps;\n containerProps?: MenuContainerProps;\n options: SelectOptionProps[];\n size?: FormControlSize;\n isOnContrast?: boolean;\n placeholder?: string;\n emptyStateText?: string;\n selectedOptionContainerProps?: FlexProps;\n renderCustomSelectedOption?: (props: SelectOptionProps) => JSX.Element;\n}\n\nexport type SelectProps = KSelectProps & Omit<CSelectProps, 'onSelect'>;\n\nconst Select = ({\n defaultLeftElement,\n isFieldInline,\n listProps,\n options,\n placeholder,\n size = 'md',\n value,\n maxW = '100%',\n isOnContrast,\n emptyStateText,\n containerProps,\n selectedOptionContainerProps,\n renderCustomSelectedOption,\n ...rest\n}: SelectProps): JSX.Element => {\n // TODO: Need to add full support for isOnContrast, currently menu list still renders white\n const _computedVariant = isOnContrast ? 'onContrast' : 'default';\n const selectRef = useRef<HTMLSelectElement>(null);\n const placeholderOption: SelectOptionProps = useMemo(\n () => ({\n label: placeholder,\n value: '',\n variant: isOnContrast ? 'placeholderOnContrast' : 'placeholder',\n leftElement: null,\n isSelected: false,\n isPlaceholder: true,\n }),\n [placeholder, isOnContrast],\n );\n\n const [allOptions, setAllOptions] = useState<SelectOptionProps[]>([]);\n\n const selectedOption: SelectOptionProps = useMemo(() => {\n const selectedItem = allOptions.find((option) => option.isSelected);\n\n return selectedItem ? selectedItem : placeholderOption;\n }, [allOptions, placeholderOption]);\n\n const handleSelect = useCallback(\n (selectedItem: SelectOptionProps) => {\n if (!allOptions) return;\n\n const updatedOptions = allOptions.map((option) => {\n return {\n ...option,\n isSelected: option.value === selectedItem.value,\n };\n });\n setAllOptions(updatedOptions);\n\n if (listProps?.onSelect) {\n listProps.onSelect(selectedItem);\n }\n },\n [allOptions, listProps],\n );\n\n // If the text is not being truncated it should grow to fit the content\n const flexibleHeightProps = !listProps?.shouldTruncateText ? { height: 'max-content', minH: 10 } : {};\n\n const selectWidth = useMemo(() => {\n if (!selectRef.current) {\n return '320px';\n }\n\n return `${selectRef?.current?.clientWidth}px`;\n\n // Disables the warning for not including unused dependency in the hook array. This dependency is needed to rerender the menu list with the correct width\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectRef?.current]);\n\n // Set default selected state\n useEffect(() => {\n const mappedOptions = options.map((option) => ({\n ...option,\n isSelected: option.value === value,\n }));\n\n // A timeout is used in MenuProvider->handleOnClose to modify `filteredMenuItems` with a delay of 200 ms.\n // This was introduced to prevent a jumpy menu effect during closure.\n // Internally, selecting a menu item triggers updates to `menuItems`.\n // However, for this component, we rely on `setAllOptions` as the main source of truth.\n // The additional timeout ensures that the menu items update correctly without conflicts,\n // addressing an issue where the options wouldn't reflect the latest changes.\n setTimeout(() => {\n setAllOptions([...mappedOptions, placeholderOption]);\n }, 250);\n }, [options, placeholderOption, value]);\n\n return (\n <MenuProvider menuItems={allOptions}>\n <MenuContainer matchWidth={true} isLazy={true} {...containerProps}>\n <CSelect\n icon={\n <Icon\n name=\"chevronDown\"\n size={size as IconSize}\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n />\n }\n as={MenuButton}\n ref={selectRef}\n onClick={(event: React.MouseEvent): void => event.stopPropagation()}\n type=\"button\"\n className=\"Select__MenuButton\"\n variant={_computedVariant}\n maxW={maxW}\n {...flexibleHeightProps}\n {...rest}\n >\n {renderCustomSelectedOption ? (\n renderCustomSelectedOption(selectedOption)\n ) : (\n <SelectContainer\n selectedOption={selectedOption}\n defaultLeftElement={defaultLeftElement}\n shouldTruncateText={listProps?.shouldTruncateText}\n {...selectedOptionContainerProps}\n />\n )}\n </CSelect>\n <SelectList\n {...listProps}\n onSelect={handleSelect}\n options={allOptions}\n maxW={selectWidth || maxW}\n emptyStateText={emptyStateText}\n />\n </MenuContainer>\n </MenuProvider>\n );\n};\n\nSelect.displayName = 'Select';\n\nconst WrappedSelect = withFormControl(Select);\n\nexport { WrappedSelect as Select };\n"],"names":["SelectList","props","options","rest","__rest","React","MenuList","Object","assign","shouldRetainSelection","menuItems","isMatchWidthSet","SelectContainer","_a","selectedOption","defaultLeftElement","shouldTruncateText","createElement","Flex","className","justify","align","textAlign","color","variant","leftElement","pr","label","Text","isTruncated","Select","isFieldInline","listProps","placeholder","size","value","maxW","isOnContrast","emptyStateText","containerProps","selectedOptionContainerProps","renderCustomSelectedOption","_computedVariant","selectRef","useRef","placeholderOption","useMemo","isSelected","isPlaceholder","allOptions","setAllOptions","useState","selectedItem","find","option","handleSelect","useCallback","updatedOptions","map","onSelect","flexibleHeightProps","height","minH","selectWidth","current","clientWidth","useEffect","mappedOptions","setTimeout","MenuProvider","MenuContainer","matchWidth","isLazy","CSelect","icon","Icon","name","display","justifyContent","alignItems","as","MenuButton","ref","onClick","event","stopPropagation","type","displayName","WrappedSelect","withFormControl"],"mappings":"kjBAqBO,MAAMA,EAAcC,IACzB,MAAMC,QAAEA,GAAqBD,EAATE,EAAIC,EAAAA,OAAKH,EAAvB,CAAoB,YAE1B,OAAOI,EAAAA,sBAACC,EAAAA,SAAQC,OAAAC,OAAA,CAACC,uBAAuB,EAAMC,UAAWR,EAASS,iBAAiB,GAAUR,KCblFS,EAAmBC,IAAA,IAAAC,eAC9BA,EAAcC,mBACdA,EAAkBC,mBAClBA,GAAqB,GAAIH,EACtBV,EAJ2BC,EAAAA,OAAAS,EAAA,CAAA,iBAAA,qBAAA,uBAM9B,OACER,UAACY,cAAAC,EAAIA,kCACS,qBACZC,UAAU,oBACVC,QAAQ,aACRC,MAAM,SACNC,UAAU,OACVC,MAAOT,EAAeU,QAAU,QAAQV,EAAeU,UAAY,gBAC/DrB,IAEHW,MAAAA,OAAc,EAAdA,EAAgBW,aACfpB,EAAA,QAAAY,cAACC,OAAI,CAACG,MAAM,SAASF,UAAU,sBAAsBO,GAAI,GACtDZ,EAAe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