import{u as k,h as r}from"./OdysseyThemeProvider-Bh0Bu-2o.js";import{r as o}from"./index-NdkWRN8K.js";import{b as j,a as D}from"./Typography-Cz6D417Y.js";import{u as M}from"./useMountLifecycleEffect-CjsUCFhB.js";import{j as i}from"./jsx-runtime-CnH95YSl.js";import{L as P}from"./Link-DNIf0luC.js";import{M as F}from"./Documentation-DF3oo39e.js";/*!
 * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const H="data-unified-ui-shell",L=()=>{const[e,s]=o.useState(!1);return o.useEffect(()=>{s(!!document.querySelector(`[${H}]`))},[]),e},b=({children:e,href:s,icon:n,target:a})=>i.jsxs(P,{href:s,target:a,children:[n&&i.jsx("span",{className:"Link-icon",children:n}),e]}),g=o.memo(b);g.displayName="DocumentationLink";/*!
 * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const v=r("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="hasUiShell"&&e!=="isFullWidth"})(({hasUiShell:e,isFullWidth:s,odysseyDesignTokens:n})=>({maxWidth:s?"100%":`calc(1440px + ${n.Spacing6} + ${n.Spacing6})`,marginInline:s&&!e?n.Spacing6:"auto",padding:e?0:n.Spacing6})),R=r("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"})(({odysseyDesignTokens:e})=>({display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:e.Spacing4})),w=r("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"})(({odysseyDesignTokens:e})=>({maxWidth:e.TypographyLineLengthMax,".MuiTypography-root:last-child":{marginBlockEnd:"0"}})),z=r("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"})(({odysseyDesignTokens:e})=>({alignItems:"flex-end",display:"flex",flexDirection:"column",gap:e.Spacing4,minHeight:e.Spacing7,justifyContent:"center",whiteSpace:"nowrap"})),C=r("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"})(({odysseyDesignTokens:e})=>({display:"flex",gap:e.Spacing2})),E=r("div",{shouldForwardProp:e=>!["drawerVariant","isDrawerOpen","isFirstRender","odysseyDesignTokens"].includes(e)})(({drawerVariant:e,isDrawerOpen:s,isFirstRender:n,odysseyDesignTokens:a})=>({"@keyframes animate-drawer-open":{"0%":{gridTemplateColumns:"minmax(0, 1fr) 0"},"100%":{gridTemplateColumns:"minmax(0, 1fr) 360px"}},"@keyframes animate-drawer-close":{"0%":{gridTemplateColumns:"minmax(0, 1fr) 360px"},"100%":{gridTemplateColumns:"minmax(0, 1fr) 0"}},display:"grid",gridGap:e==="persistent"&&!s?0:a.Spacing4,gap:e==="persistent"&&!s?0:a.Spacing4,marginBlock:a.Spacing4,gridTemplateColumns:e==="persistent"?s?"minmax(0, 1fr) 360px":"minmax(0, 1fr) 0":"minmax(0, 1fr)",animation:e==="persistent"&&(!n||s)?`animate-drawer-${s?"open":"close"} 225ms cubic-bezier(0, 0, 0.2, 1)`:void 0})),U=({children:e,description:s,documentationLink:n,documentationText:a,drawer:l,isFullWidth:h=!1,primaryCallToActionComponent:m,secondaryCallToActionComponent:d,tertiaryCallToActionComponent:c,title:p})=>{const t=k(),{isOpen:f,variant:x}=(l==null?void 0:l.props)??{},y=L(),u=o.useRef(!0),S=u.current,T=o.useCallback(()=>{u.current=!1},[]);return M({onMount:T}),i.jsxs(v,{hasUiShell:y,isFullWidth:h,odysseyDesignTokens:t,children:[i.jsxs(R,{odysseyDesignTokens:t,children:[i.jsxs(w,{odysseyDesignTokens:t,children:[p&&i.jsx(j,{children:p}),s&&i.jsx(D,{children:s})]}),i.jsxs(z,{odysseyDesignTokens:t,children:[n&&i.jsx(g,{href:n,icon:i.jsx(F,{}),target:"_blank",children:a}),(m||d||c)&&i.jsxs(C,{odysseyDesignTokens:t,children:[c,d,m]})]})]}),i.jsxs(E,{drawerVariant:x,isDrawerOpen:f,isFirstRender:S,odysseyDesignTokens:t,children:[e,l]})]})},B=o.memo(U);B.displayName="PageTemplate";export{B as M,H as u};
