import{i as e,n as t,t as n}from"./jsx-runtime-DIhQqKhG.js";import{n as r,t as i}from"./index-CvD27sEa.js";import{F as a,I as o,K as s,N as c,P as l,T as u,a as d,c as f,et as p,h as m,m as h,n as g,nt as _,r as v,t as y,tt as b}from"./Toolbar-Ds5JbX8Q.js";function x(e){return b(`MuiAppBar`,e)}p(`MuiAppBar`,[`root`,`positionFixed`,`positionAbsolute`,`positionSticky`,`positionStatic`,`positionRelative`,`colorDefault`,`colorPrimary`,`colorSecondary`,`colorInherit`,`colorTransparent`,`colorError`,`colorInfo`,`colorSuccess`,`colorWarning`]);var S=e(t(),1),C=n(),w=e=>{let{color:t,position:n,classes:r}=e,i={root:[`root`,`color${c(t)}`,`position${c(n)}`]};return s(i,x,r)},T=(e,t)=>e?`${e.replace(`)`,``)}, ${t})`:t,E=o(h,{name:`MuiAppBar`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`position${c(n.position)}`],t[`color${c(n.color)}`]]}})(a(({theme:e})=>({display:`flex`,flexDirection:`column`,width:`100%`,boxSizing:`border-box`,flexShrink:0,variants:[{props:{position:`fixed`},style:{position:`fixed`,zIndex:(e.vars||e).zIndex.appBar,top:0,left:`auto`,right:0,"@media print":{position:`absolute`}}},{props:{position:`absolute`},style:{position:`absolute`,zIndex:(e.vars||e).zIndex.appBar,top:0,left:`auto`,right:0}},{props:{position:`sticky`},style:{position:`sticky`,zIndex:(e.vars||e).zIndex.appBar,top:0,left:`auto`,right:0}},{props:{position:`static`},style:{position:`static`}},{props:{position:`relative`},style:{position:`relative`}},{props:{color:`inherit`},style:{"--AppBar-color":`inherit`,color:`var(--AppBar-color)`}},{props:{color:`default`},style:{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[100],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[100]),...e.applyStyles(`dark`,{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[900],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[900])})}},...Object.entries(e.palette).filter(f([`contrastText`])).map(([t])=>({props:{color:t},style:{"--AppBar-background":(e.vars??e).palette[t].main,"--AppBar-color":(e.vars??e).palette[t].contrastText}})),{props:e=>e.enableColorOnDark===!0&&![`inherit`,`transparent`].includes(e.color),style:{backgroundColor:`var(--AppBar-background)`,color:`var(--AppBar-color)`}},{props:e=>e.enableColorOnDark===!1&&![`inherit`,`transparent`].includes(e.color),style:{backgroundColor:`var(--AppBar-background)`,color:`var(--AppBar-color)`,...e.applyStyles(`dark`,{backgroundColor:e.vars?T(e.vars.palette.AppBar.darkBg,`var(--AppBar-background)`):null,color:e.vars?T(e.vars.palette.AppBar.darkColor,`var(--AppBar-color)`):null})}},{props:{color:`transparent`},style:{"--AppBar-background":`transparent`,"--AppBar-color":`inherit`,backgroundColor:`var(--AppBar-background)`,color:`var(--AppBar-color)`,...e.applyStyles(`dark`,{backgroundImage:`none`})}}]}))),D=S.forwardRef(function(e,t){let n=l({props:e,name:`MuiAppBar`}),{className:r,color:i=`primary`,enableColorOnDark:a=!1,position:o=`fixed`,...s}=n,c={...n,color:i,position:o,enableColorOnDark:a},u=w(c);return(0,C.jsx)(E,{square:!0,component:`header`,ownerState:c,elevation:4,className:_(u.root,r,o===`fixed`&&`mui-fixed`),ref:t,...s})}),O=u((0,C.jsx)(`path`,{d:`M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z`}),`Person`);function k(e){return b(`MuiAvatar`,e)}p(`MuiAvatar`,[`root`,`colorDefault`,`circular`,`rounded`,`square`,`img`,`fallback`]);var A=e=>{let{classes:t,variant:n,colorDefault:r}=e;return s({root:[`root`,n,r&&`colorDefault`],img:[`img`],fallback:[`fallback`]},k,t)},j=o(`div`,{name:`MuiAvatar`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],n.colorDefault&&t.colorDefault]}})(a(({theme:e})=>({position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:`50%`,overflow:`hidden`,userSelect:`none`,variants:[{props:{variant:`rounded`},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:{variant:`square`},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(e.vars||e).palette.background.default,"@media (forced-colors: active)":{boxSizing:`border-box`,border:`1px solid ButtonBorder`},...e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:e.palette.grey[400],...e.applyStyles(`dark`,{backgroundColor:e.palette.grey[600]})}}}]}))),M=o(`img`,{name:`MuiAvatar`,slot:`Img`})({width:`100%`,height:`100%`,textAlign:`center`,objectFit:`cover`,color:`transparent`,textIndent:1e4}),N=o(O,{name:`MuiAvatar`,slot:`Fallback`})({width:`75%`,height:`75%`});function P(e,t,n,r){let[i,a]=S.useState(!1);return S.useEffect(()=>{if(!e&&!t)return;a(!1);let i=!0,o=new Image;return o.onload=()=>{i&&a(`loaded`)},o.onerror=()=>{i&&a(`error`)},o.crossOrigin=n,o.referrerPolicy=r,o.src=e,t&&(o.srcset=t),()=>{i=!1}},[n,r,e,t]),i}var F=S.forwardRef(function(e,t){let n=l({props:e,name:`MuiAvatar`}),{alt:r,children:i,className:a,component:o=`div`,slots:s={},slotProps:c={},sizes:u,src:d,srcSet:f,variant:p=`circular`,...h}=n,g=null,v={...n,component:o,variant:p},{crossOrigin:y,referrerPolicy:b}=(typeof c.img==`function`?c.img(v):c.img)??{},x=P(d,f,y,b),S=d||f,w=S&&x!==`error`;v.colorDefault=!w,delete v.ownerState;let T=A(v),E={slots:s,slotProps:c},[D,O]=m(`root`,{ref:t,className:_(T.root,a),elementType:j,externalForwardedProps:{...E,component:o,...h},ownerState:v}),[k,F]=m(`img`,{className:T.img,elementType:M,externalForwardedProps:E,additionalProps:{alt:r,src:d,srcSet:f,sizes:u},ownerState:v}),[I,L]=m(`fallback`,{className:T.fallback,elementType:N,externalForwardedProps:E,shouldForwardComponentProp:!0,ownerState:v});return g=w?(0,C.jsx)(k,{...F}):i||i===0?i:S&&r?r[0]:(0,C.jsx)(I,{...L}),(0,C.jsx)(D,{...O,children:g})}),I=`/assets/SimplyCPQ_Logo-CyAEjPYv.svg`;function L(e){let t=0,n;for(n=0;n>n*11&255;r+=`00${e.toString(16)}`.slice(-2)}return r}function R(e){return{sx:{bgcolor:L(e)},children:`${e.split(` `)[0][0]}${e.split(` `)[1][0]}`}}function z(){return(0,C.jsx)(D,{position:`static`,children:(0,C.jsxs)(y,{variant:`dense`,children:[(0,C.jsx)(d,{edge:`start`,color:`inherit`,"aria-label":`SimplyCPQ Logo`,children:(0,C.jsx)(`img`,{src:I,alt:`SimplyCPQ Logo`,style:{width:`28px`,height:`28px`}})}),(0,C.jsx)(v,{variant:`h6`,component:`div`,sx:{flexGrow:1},children:`Simply CPQ Material Editor`}),(0,C.jsxs)(g,{direction:`row`,spacing:2,children:[(0,C.jsxs)(v,{variant:`body1`,children:[`logged in: `,i.tokenParsed?.name]}),(0,C.jsx)(F,{...R(i.tokenParsed?.name),sx:{width:22,height:22,bgcolor:`#d27519`}})]})]})})}function B(){return(0,C.jsx)(D,{position:`static`,children:(0,C.jsx)(y,{variant:`dense`,children:(0,C.jsx)(v,{variant:`body2`,component:`div`,sx:{flexGrow:1},children:`Simply CPQ Material Editor (c) 2026 Dr. Thomas Sindt`})})})}function V(){return(0,C.jsxs)(`div`,{children:[(0,C.jsx)(z,{}),(0,C.jsx)(`main`,{children:(0,C.jsx)(r,{})}),(0,C.jsx)(B,{})]})}export{V as default};