import{au as y,j as a,z as i,d as g,D as j,bW as P}from"./index-CzUo07dn.js";const p={instanceSummary:"instance-summary",imageImport:"image-import",profileSummary:"profile-summary",identityGroups:"identity-groups",createGroup:"create-groups",editGroup:"edit-groups",groupIdentities:"group-identities",createIdpGroup:"create-idp-groups",editIdpGroup:"edit-idp-groups"},x=()=>{const[e,r]=y(),l=()=>{setTimeout(()=>window.dispatchEvent(new Event("resize")),100)},s=(t,n={})=>{const o=new URLSearchParams;o.set("panel",t);for(const[c,u]of Object.entries(n))u&&o.set(c,u);r(o),l()},m=()=>{const t=new URLSearchParams(e);t.delete("group"),t.delete("identity"),t.delete("idp-group"),t.delete("instance"),t.delete("panel"),t.delete("profile"),t.delete("project"),t.delete("sub-form"),r(t),l()};return{panel:e.get("panel"),instance:e.get("instance"),profile:e.get("profile"),project:e.get("project")??"default",identity:e.get("identity"),group:e.get("group"),idpGroup:e.get("idp-group"),subForm:e.get("sub-form"),clear:()=>{m()},openInstanceSummary:(t,n)=>{s(p.instanceSummary,{instance:t,project:n})},openImageImport:()=>{s(p.imageImport)},openProfileSummary:(t,n)=>{s(p.profileSummary,{profile:t,project:n})},openIdentityGroups:t=>{const n=new URLSearchParams(e);n.append("identity",t||""),s(p.identityGroups,Object.fromEntries(n))},openCreateGroup:()=>{s(p.createGroup)},openEditGroup:(t,n)=>{const o={group:t||""};n&&(o["sub-form"]=n),s(p.editGroup,o)},openGroupIdentities:t=>{s(p.groupIdentities,{group:t||""})},openCreateIdpGroup:()=>{s(p.createIdpGroup)},openEditIdpGroup:t=>{s(p.editIdpGroup,{"idp-group":t||""})}}},G=({children:e,className:r})=>a.jsx("div",{className:i("p-panel__controls",r),children:e}),S=({children:e,className:r})=>a.jsx("h2",{className:i("p-panel__title",r),children:e}),I=({children:e,className:r})=>a.jsx("div",{className:i("sticky-wrapper",r),children:e}),w=({children:e,className:r})=>a.jsx("div",{className:i("p-panel__header",r),children:e}),h=({children:e,className:r})=>a.jsx(g.Panel,{className:r,children:e}),v=({children:e,className:r})=>a.jsx("div",{className:i("p-panel__content",r),children:e}),E=({children:e,className:r})=>a.jsxs("div",{className:i("panel-footer",r),id:"panel-footer",children:[a.jsx("hr",{}),e]}),N=({children:e,isOverlay:r,isSplit:l=!1,loading:s=!1,hasError:m,className:t,pinned:n,width:o,onClose:c})=>{const u=x();return j("keydown",f=>{f.code==="Escape"&&(c==null||c(),u.clear())}),P.createPortal(a.jsx(g.AppAside,{className:i(t,{"is-split":l,"is-overlay":r}),"aria-label":"Side panel",pinned:n,narrow:o==="narrow",wide:o==="wide",children:s?a.jsx("div",{className:"loading",children:a.jsx(g.Spinner,{})}):a.jsx(a.Fragment,{children:m?a.jsx(a.Fragment,{children:"Loading failed"}):e})}),document.getElementById("l-application"))},d=N;d.Header=w;d.HeaderTitle=S;d.HeaderControls=G;d.Sticky=I;d.Container=h;d.Content=v;d.Footer=E;export{d as S,p,x as u};
