{"version":3,"file":"UserProfileMenuButton.cjs","names":["_styled","_interopRequireDefault","require","_react","_BaseMenuButton","_index","_OdysseyDesignTokensContext","_UserProfile","_jsxRuntime","e","__esModule","default","StyledUnsetButtonHeightContainer","styled","shouldForwardProp","prop","odysseyDesignTokens","button","height","paddingBlock","Spacing2","textAlign","UserProfileMenuButton","profileIcon","orgName","translate","userNameEndIcon","userName","menuButtonProps","useOdysseyDesignTokens","jsx","children","BaseMenuButton","buttonChildren","UserProfile","ChevronDownIcon","buttonVariant","omitEndIcon","MemoizedUserProfileMenuButton","exports","memo","displayName"],"sources":["../../../src/labs/UserProfileMenuButton.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { memo } from \"react\";\n\nimport {\n  AdditionalBaseMenuButtonProps,\n  BaseMenuButton,\n  BaseMenuButtonProps,\n} from \"../Buttons/BaseMenuButton.js\";\nimport { ChevronDownIcon } from \"../icons.generated/index.js\";\nimport {\n  DesignTokens,\n  useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { UserProfile, UserProfileProps } from \"./UserProfile.js\";\n\nconst StyledUnsetButtonHeightContainer = styled(\"div\", {\n  shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n  odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n  button: {\n    height: \"unset\",\n    paddingBlock: odysseyDesignTokens.Spacing2,\n    textAlign: \"unset\",\n  },\n}));\n\nexport type UserProfileMenuButtonProps = Omit<\n  BaseMenuButtonProps,\n  \"endIcon\" | \"variant\"\n> &\n  AdditionalBaseMenuButtonProps &\n  UserProfileProps & {\n    /**\n     *\n     * NOTE: In this case, attribute only applies to user name and org name\n     */\n    translate?: string;\n  };\n\nconst UserProfileMenuButton = ({\n  profileIcon,\n  orgName,\n  translate,\n  userNameEndIcon,\n  userName,\n  ...menuButtonProps\n}: UserProfileMenuButtonProps) => {\n  const odysseyDesignTokens = useOdysseyDesignTokens();\n\n  return (\n    <StyledUnsetButtonHeightContainer odysseyDesignTokens={odysseyDesignTokens}>\n      <BaseMenuButton\n        {...menuButtonProps}\n        buttonChildren={\n          <UserProfile\n            orgName={orgName}\n            profileIcon={profileIcon}\n            translate={translate}\n            userName={userName}\n            userNameEndIcon={userNameEndIcon ?? <ChevronDownIcon />}\n          />\n        }\n        buttonVariant=\"floating\"\n        omitEndIcon={true}\n      />\n    </StyledUnsetButtonHeightContainer>\n  );\n};\n\nconst MemoizedUserProfileMenuButton = memo(UserProfileMenuButton);\nMemoizedUserProfileMenuButton.displayName = \"UserProfileMenuButton\";\n\nexport { MemoizedUserProfileMenuButton as UserProfileMenuButton };\n"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,2BAAA,GAAAJ,OAAA;AAIA,IAAAK,YAAA,GAAAL,OAAA;AAAiE,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAzBjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA,MAAMG,gCAAgC,GAAG,IAAAC,eAAM,EAAC,KAAK,EAAE;EACrDC,iBAAiB,EAAGC,IAAI,IAAKA,IA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