{"version":3,"file":"useUiShellBreakpoints.cjs","names":["_useMediaQuery","require","defaultUiShellBreakpointConfig","exports","narrow","medium","wide","adminAppUiShellBreakpoints","useUiShellBreakpoints","breakpointConfig","isNarrowView","useMediaQuery","isMediumView","isWideView"],"sources":["../../../src/ui-shell/useUiShellBreakpoints.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-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 { useMediaQuery } from \"../theme/useMediaQuery.js\";\n\nexport type UiShellBreakpointConfig = {\n  medium: number;\n  narrow: number;\n  wide: number;\n};\n\nexport const defaultUiShellBreakpointConfig = {\n  narrow: 0,\n  medium: 600,\n  wide: 800,\n} as const satisfies UiShellBreakpointConfig;\n\nexport const adminAppUiShellBreakpoints = {\n  narrow: 0,\n  medium: 600,\n  wide: 1304,\n} as const satisfies UiShellBreakpointConfig;\n\nexport const useUiShellBreakpoints = (\n  breakpointConfig: UiShellBreakpointConfig = defaultUiShellBreakpointConfig,\n): keyof UiShellBreakpointConfig | \"none\" => {\n  const isNarrowView = useMediaQuery(\n    `(min-width: ${breakpointConfig.narrow}px)`,\n  );\n\n  const isMediumView = useMediaQuery(\n    `(min-width: ${breakpointConfig.medium}px)`,\n  );\n\n  const isWideView = useMediaQuery(`(min-width: ${breakpointConfig.wide}px)`);\n\n  if (isWideView) {\n    return \"wide\";\n  }\n\n  if (isMediumView) {\n    return \"medium\";\n  }\n\n  if (isNarrowView) {\n    return \"narrow\";\n  }\n\n  // This is a failsafe in case we don't have any media queries on page load or if media queries were improperly defined (no `0` case). With the default breakpoints, it will never be `\"none\"`.\n  return \"none\";\n};\n"],"mappings":";;;;;;AAYA,IAAAA,cAAA,GAAAC,OAAA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUO,MAAMC,8BAA8B,GAAAC,OAAA,CAAAD,8BAAA,GAAG;EAC5CE,MAAM,EAAE,CAAC;EACTC,MAAM,EAAE,GAAG;EACXC,IAAI,EAAE;AACR,CAA4C;AAErC,MAAMC,0BAA0B,GAAAJ,OAAA,CAAAI,0BAAA,GAAG;EACxCH,MAAM,EAAE,CAAC;EACTC,MAAM,EAAE,GAAG;EACXC,IAAI,EAAE;AACR,CAA4C;AAErC,MAAME,qBAAqB,GAAGA,CACnCC,gBAAyC,GAAGP,8BAA8B,KAC/B;EAC3C,MAAMQ,YAAY,GAAG,IAAAC,4BAAa,EAChC,eAAeF,gBAAgB,CAACL,MAAM,KACxC,CAAC;EAED,MAAMQ,YAAY,GAAG,IAAAD,4BAAa,EAChC,eAAeF,gBAAgB,CAACJ,MAAM,KACxC,CAAC;EAED,MAAMQ,UAAU,GAAG,IAAAF,4BAAa,EAAC,eAAeF,gBAAgB,CAACH,IAAI,KAAK,CAAC;EAE3E,IAAIO,UAAU,EAAE;IACd,OAAO,MAAM;EACf;EAEA,IAAID,YAAY,EAAE;IAChB,OAAO,QAAQ;EACjB;EAEA,IAAIF,YAAY,EAAE;IAChB,OAAO,QAAQ;EACjB;EAGA,OAAO,MAAM;AACf,CAAC;AAACP,OAAA,CAAAK,qBAAA,GAAAA,qBAAA","ignoreList":[]}