import{b3 as T,aw as N,ax as I,j as s,be as J,bl as L,V as C,bm as M,bn as Q,bo as V,ay as X,bp as W,bq as U,aA as Y,aC as Z,aB as oo,br as eo}from"./index-DTC0Ed21.js";const[no,R]=T("Accordion component was not found in the tree"),[to,q]=T("Accordion.Item component was not found in the tree");var b={root:"m_9bdbb667",panel:"m_df78851f",content:"m_4ba554d4",itemTitle:"m_8fa820a0",control:"m_4ba585b8","control--default":"m_6939a5e9","control--contained":"m_4271d21b",label:"m_df3ffa0f",chevron:"m_3f35ae96",icon:"m_9bd771fe",item:"m_9bd7b098","item--default":"m_fe19b709","item--contained":"m_1f921b3b","item--filled":"m_2cdf939a","item--separated":"m_9f59b069"};const so={},$=N((r,a)=>{const{classNames:e,className:i,style:h,styles:t,vars:y,chevron:d,icon:m,onClick:c,onKeyDown:n,children:P,disabled:A,mod:_,...S}=I("AccordionControl",so,r),{value:p}=q(),o=R(),f=o.isItemActive(p),H=typeof o.order=="number",j=`h${o.order}`,g=s.jsxs(J,{...S,...o.getStyles("control",{className:i,classNames:e,style:h,styles:t,variant:o.variant}),unstyled:o.unstyled,mod:["accordion-control",{active:f,"chevron-position":o.chevronPosition,disabled:A},_],ref:a,onClick:x=>{c==null||c(x),o.onChange(p)},type:"button",disabled:A,"aria-expanded":f,"aria-controls":o.getRegionId(p),id:o.getControlId(p),onKeyDown:L({siblingSelector:"[data-accordion-control]",parentSelector:"[data-accordion]",activateOnFocus:!1,loop:o.loop,orientation:"vertical",onKeyDown:n}),children:[s.jsx(C,{component:"span",mod:{rotate:!o.disableChevronRotation&&f,position:o.chevronPosition},...o.getStyles("chevron",{classNames:e,styles:t}),children:d||o.chevron}),s.jsx("span",{...o.getStyles("label",{classNames:e,styles:t}),children:P}),m&&s.jsx(C,{component:"span",mod:{"chevron-position":o.chevronPosition},...o.getStyles("icon",{classNames:e,styles:t}),children:m})]});return H?s.jsx(j,{...o.getStyles("itemTitle",{classNames:e,styles:t}),children:g}):g});$.displayName="@mantine/core/AccordionControl";$.classes=b;const ao={},D=N((r,a)=>{const{classNames:e,className:i,style:h,styles:t,vars:y,value:d,mod:m,...c}=I("AccordionItem",ao,r),n=R();return s.jsx(to,{value:{value:d},children:s.jsx(C,{ref:a,mod:[{active:n.isItemActive(d)},m],...n.getStyles("item",{className:i,classNames:e,styles:t,style:h,variant:n.variant}),...c})})});D.displayName="@mantine/core/AccordionItem";D.classes=b;const co={},B=N((r,a)=>{const{classNames:e,className:i,style:h,styles:t,vars:y,children:d,...m}=I("AccordionPanel",co,r),{value:c}=q(),n=R();return s.jsx(M,{ref:a,...n.getStyles("panel",{className:i,classNames:e,style:h,styles:t}),...m,in:n.isItemActive(c),transitionDuration:n.transitionDuration??200,role:"region",id:n.getRegionId(c),"aria-labelledby":n.getControlId(c),children:s.jsx("div",{...n.getStyles("content",{classNames:e,styles:t}),children:d})})});B.displayName="@mantine/core/AccordionPanel";B.classes=b;const ro={multiple:!1,disableChevronRotation:!1,chevronPosition:"right",variant:"default",chevron:s.jsx(U,{})},io=Y((r,{transitionDuration:a,chevronSize:e,radius:i})=>({root:{"--accordion-transition-duration":a===void 0?void 0:`${a}ms`,"--accordion-chevron-size":e===void 0?void 0:oo(e),"--accordion-radius":i===void 0?void 0:Z(i)}}));function l(r){const a=I("Accordion",ro,r),{classNames:e,className:i,style:h,styles:t,unstyled:y,vars:d,children:m,multiple:c,value:n,defaultValue:P,onChange:A,id:_,loop:S,transitionDuration:p,disableChevronRotation:o,chevronPosition:f,chevronSize:H,order:j,chevron:g,variant:x,radius:mo,...z}=a,w=Q(_),[v,E]=V({value:n,defaultValue:P,finalValue:c?[]:null,onChange:A}),F=u=>Array.isArray(v)?v.includes(u):u===v,O=u=>{const k=Array.isArray(v)?v.includes(u)?v.filter(G=>G!==u):[...v,u]:u===v?null:u;E(k)},K=X({name:"Accordion",classes:b,props:a,className:i,style:h,classNames:e,styles:t,unstyled:y,vars:d,varsResolver:io});return s.jsx(no,{value:{isItemActive:F,onChange:O,getControlId:W(`${w}-control`,"Accordion.Item component was rendered with invalid value or without value"),getRegionId:W(`${w}-panel`,"Accordion.Item component was rendered with invalid value or without value"),transitionDuration:p,disableChevronRotation:o,chevronPosition:f,order:j,chevron:g,loop:S,getStyles:K,variant:x,unstyled:y},children:s.jsx(C,{...K("root"),id:w,...z,variant:x,"data-accordion":!0,children:m})})}const lo=r=>r;l.extend=lo;l.withProps=eo(l);l.classes=b;l.displayName="@mantine/core/Accordion";l.Item=D;l.Panel=B;l.Control=$;l.Chevron=U;export{l as A};
