import{j as i}from"./jsx-runtime-D_zvdyIk.js";import{j as k,h as v,i as j,o as G,B as m,r as w,q as L,v as S,s as x,p as V}from"./polymorphic-factory-EW0USS3V.js";import"./chunk-QMGIS6GS-CBZUm-7V.js";import{U as A,T as H,L as I}from"./Loader-1VreoqJz.js";var b={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const _={orientation:"horizontal"},J=G((o,{borderWidth:e})=>({group:{"--button-border-width":w(e)}})),R=k((o,e)=>{const t=v("ButtonGroup",_,o),{className:l,style:n,classNames:r,styles:s,unstyled:a,orientation:c,vars:u,borderWidth:g,variant:h,mod:y,...f}=v("ButtonGroup",_,o),d=j({name:"ButtonGroup",props:t,classes:b,className:l,style:n,classNames:r,styles:s,unstyled:a,vars:u,varsResolver:J,rootSelector:"group"});return i.jsx(m,{...d("group"),ref:e,variant:h,mod:[{"data-orientation":c},y],role:"group",...f})});R.classes=b;R.displayName="@mantine/core/ButtonGroup";const $={},K=G((o,{radius:e,color:t,gradient:l,variant:n,autoContrast:r,size:s})=>{const a=o.variantColorResolver({color:t||o.primaryColor,theme:o,gradient:l,variant:n||"filled",autoContrast:r});return{groupSection:{"--section-height":x(s,"section-height"),"--section-padding-x":x(s,"section-padding-x"),"--section-fz":s!=null&&s.includes("compact")?S(s.replace("compact-","")):S(s),"--section-radius":e===void 0?void 0:L(e),"--section-bg":t||n?a.background:void 0,"--section-color":a.color,"--section-bd":t||n?a.border:void 0}}}),N=k((o,e)=>{const t=v("ButtonGroupSection",$,o),{className:l,style:n,classNames:r,styles:s,unstyled:a,vars:c,variant:u,gradient:g,radius:h,autoContrast:y,...f}=v("ButtonGroupSection",$,o),d=j({name:"ButtonGroupSection",props:t,classes:b,className:l,style:n,classNames:r,styles:s,unstyled:a,vars:c,varsResolver:K,rootSelector:"groupSection"});return i.jsx(m,{...d("groupSection"),ref:e,variant:u,...f})});N.classes=b;N.displayName="@mantine/core/ButtonGroupSection";const M={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${w(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},Q={},X=G((o,{radius:e,color:t,gradient:l,variant:n,size:r,justify:s,autoContrast:a})=>{const c=o.variantColorResolver({color:t||o.primaryColor,theme:o,gradient:l,variant:n||"filled",autoContrast:a});return{root:{"--button-justify":s,"--button-height":x(r,"button-height"),"--button-padding-x":x(r,"button-padding-x"),"--button-fz":r!=null&&r.includes("compact")?S(r.replace("compact-","")):S(r),"--button-radius":e===void 0?void 0:L(e),"--button-bg":t||n?c.background:void 0,"--button-hover":t||n?c.hover:void 0,"--button-color":c.color,"--button-bd":t||n?c.border:void 0,"--button-hover-color":t||n?c.hoverColor:void 0}}}),B=V((o,e)=>{const t=v("Button",Q,o),{style:l,vars:n,className:r,color:s,disabled:a,children:c,leftSection:u,rightSection:g,fullWidth:h,variant:y,radius:f,loading:d,loaderProps:T,gradient:Y,classNames:F,styles:U,unstyled:C,"data-disabled":P,autoContrast:Z,mod:W,...q}=t,p=j({name:"Button",props:t,classes:b,className:r,style:l,classNames:F,styles:U,unstyled:C,vars:n,varsResolver:X}),D=!!u,E=!!g;return i.jsxs(A,{ref:e,...p("root",{active:!a&&!d&&!P}),unstyled:C,variant:y,disabled:a||d,mod:[{disabled:a||P,loading:d,block:h,"with-left-section":D,"with-right-section":E},W],...q,children:[i.jsx(H,{mounted:!!d,transition:M,duration:150,children:O=>i.jsx(m,{component:"span",...p("loader",{style:O}),"aria-hidden":!0,children:i.jsx(I,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...T})})}),i.jsxs("span",{...p("inner"),children:[u&&i.jsx(m,{component:"span",...p("section"),mod:{position:"left"},children:u}),i.jsx(m,{component:"span",mod:{loading:d},...p("label"),children:c}),g&&i.jsx(m,{component:"span",...p("section"),mod:{position:"right"},children:g})]})]})});B.classes=b;B.displayName="@mantine/core/Button";B.Group=R;B.GroupSection=N;export{B};
