"use client";
import{b as d}from"./chunk-3NQOMOHD.js";import{c as x,d as A,e as v}from"./chunk-CLTGASR6.js";import{a as C,d as w,m as y,n as k}from"./chunk-3CHPBNY2.js";import{s as l}from"./chunk-KEPQUAOX.js";import{forwardRef as z}from"react";import{faArrowRight as H,faCheckCircle as q,faInfoCircle as F,faWarning as h}from"@fortawesome/free-solid-svg-icons";import{FontAwesomeIcon as N}from"@fortawesome/react-fontawesome";import a from"clsx";var U=C("EulAlert",["active","clickable","contained","disabled","error","errorContained","errorOutlined","focusVisible","info","infoContained","infoOutlined","note","noteContained","noteOutlined","outlined","root","startIcon","success","successContained","successOutlined","uppercase","warning","warningContained","warningOutlined","header","title","description","action","body"]),I=t=>v("EulAlert",{action:["action"],body:["body"],description:["description"],header:["header"],root:["root",t.severity,t.variant,t.variant&&t.severity&&`${t.severity}${w(t.variant)}`,t.uppercase&&"uppercase",t.onClick&&"clickable",t.active&&"active",t.disabled&&"disabled",t.focusVisible&&"focusVisible"],startIcon:["startIcon"],title:["title"]}),r=U;import{css as b}from"@emotion/react";var n=(t,o,e=!1)=>({error:e?t.palette.redOpaque:t.palette.red,info:e?t.palette.tealOpaque:t.palette.teal,note:t.palette.background,success:e?t.palette.greenOpaque:t.palette.green,warning:e?t.palette.yellowOpaque:t.palette.yellow})[o],c=(t,o)=>b`
    &.${r[o]} {
      color: ${n(t,o,!1)[1e3]};
    }

    &.${r[`${o}Contained`]} {
      background: ${n(t,o,!0)[200]};
      border: 1px solid ${n(t,o,!0)[500]};

      .${r.header} {
        background: ${n(t,o,!0)[300]};
      }

      .${r.body}, .${r.action} {
        border-top: 1px solid ${n(t,o,!0)[500]};
      }
    }

    &.${r[`${o}Outlined`]} {
      border: 1px solid ${n(t,o,!0)[500]};

      .${r.body}, .${r.action} {
        border-top: 1px solid ${n(t,o,!0)[500]};
      }
    }
  `,S=y("div")(({theme:t})=>b`
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: left;
    width: 100%;
    font-size: ${t.typography.body1.fontSize};
    line-height: ${t.typography.body1.lineHeight};
    background-color: transparent;
    border-radius: ${t.spacing(2)};
    outline: 0;

    .${r.header} {
      display: flex;
      flex-direction: row;
      gap: ${t.spacing(2)};
      width: 100%;
      padding: ${t.spacing(3)};
      border-top-left-radius: ${t.spacing(2)};
      border-top-right-radius: ${t.spacing(2)};
    }

    .${r.body}, .${r.action} {
      width: 100%;
      padding: ${t.spacing(3)};
      padding-left: ${t.spacing(10)};
      border-bottom-right-radius: ${t.spacing(2)};
      border-bottom-left-radius: ${t.spacing(2)};
    }

    .${r.action} {
      display: flex;
      align-items: center;
      justify-content: space-between;
      color: inherit;
      background: none;
      border: none;
      cursor: pointer;
    }

    &.${r.uppercase} {
      text-transform: uppercase;
    }

    &.${r.clickable} {
      cursor: pointer;
    }

    ${c(t,"error")}
    ${c(t,"info")}
    ${c(t,"note")}
    ${c(t,"success")}
    ${c(t,"warning")}
  `),T=y("div")(({theme:t})=>b`
    display: flex;
    align-items: center;
    justify-content: center;
    width: ${t.spacing(5)};
    height: ${t.spacing(5)};
  `);import{jsx as s,jsxs as u}from"react/jsx-runtime";var O={error:h,info:F,success:q,warning:h},$=z((t,o)=>{let{action:e,description:f,severity:B="info",startIcon:W,title:p,...g}=t,{children:m,className:P}=g,{getRootProps:V,...R}=x({...g,ref:o}),M=A(g),i=I({...t,...R}),E=k();return u(S,{...V(),...M,className:a(P,i.root),role:"alert",children:[p&&u(l,{className:a(i.header),children:[W||s(T,{className:a(i.startIcon),children:s(N,{icon:O[B]||O.info})}),u(l,{children:[typeof p=="string"?s(d,{className:a(i.title),color:"inherit",fontWeight:E.typography.fontWeightMedium,variant:"body1",children:p}):p,typeof f=="string"?s(d,{className:a(i.description),color:"inherit",variant:"body1",children:f}):f]})]}),m?s(l,{className:a(i.body),children:m}):null,e?u(l,{className:a(i.action),component:"button",onClick:e?.onClick,children:[s(d,{className:a(i.description),color:"inherit",variant:"body1",children:e?.title}),s(N,{icon:H})]}):null]})});$.defaultProps={severity:"info",variant:"contained"};$.displayName="Alert";var L=$;export{r as a,L as b};
