import{b1 as U,aB as N,aC as I,j as s,bb as J,bd as L,C,be as M,bf as Q,bg as V,aD as X,bh as T,bi as W,aT as Y,aV as Z,aU as oo,bj as eo}from"./index-n-59FgrC.js";const[no,R]=U("Accordion component was not found in the tree"),[to,z]=U("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:_,...j}=I("AccordionControl",so,r),{value:p}=z(),o=R(),f=o.isItemActive(p),H=typeof o.order=="number",S=`h${o.order}`,g=s.jsxs(J,{...j,...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(S,{...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}=z(),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(W,{})},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:j,transitionDuration:p,disableChevronRotation:o,chevronPosition:f,chevronSize:H,order:S,chevron:g,variant:x,radius:mo,...E}=a,w=Q(_),[v,F]=V({value:n,defaultValue:P,finalValue:c?[]:null,onChange:A}),O=u=>Array.isArray(v)?v.includes(u):u===v,k=u=>{const q=Array.isArray(v)?v.includes(u)?v.filter(G=>G!==u):[...v,u]:u===v?null:u;F(q)},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:O,onChange:k,getControlId:T(`${w}-control`,"Accordion.Item component was rendered with invalid value or without value"),getRegionId:T(`${w}-panel`,"Accordion.Item component was rendered with invalid value or without value"),transitionDuration:p,disableChevronRotation:o,chevronPosition:f,order:S,chevron:g,loop:j,getStyles:K,variant:x,unstyled:y},children:s.jsx(C,{...K("root"),id:w,...E,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=W;export{l as A};
