2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
import{b as J,a as K,r as u,d as Q,P as po,j as r,s as b,c as L,h as X,m as j}from"./index-CuLfHvEh.js";import{b as uo,j as mo,u as ho,e as $,P as go,l as fo,c as to}from"./Layout-BwmFxbkK.js";import{T as xo,g as eo,u as yo}from"./utils-D0Kc04Qe.js";function bo(o){return J("MuiCollapse",o)}K("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const Co=o=>{const{orientation:t,classes:e}=o,s={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return X(s,bo,e)},vo=b("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:e}=o;return[t.root,t[e.orientation],e.state==="entered"&&t.entered,e.state==="exited"&&!e.in&&e.collapsedSize==="0px"&&t.hidden]}})(j(({theme:o})=>({height:0,overflow:"hidden",transition:o.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:o.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),So=b("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),wo=b("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),oo=u.forwardRef(function(t,e){const s=Q({props:t,name:"MuiCollapse"}),{addEndListener:d,children:x,className:y,collapsedSize:p="0px",component:C,easing:H,in:v,onEnter:A,onEntered:P,onEntering:D,onExit:z,onExited:I,onExiting:N,orientation:i="vertical",style:m,timeout:c=po.standard,TransitionComponent:E=xo,...F}=s,S={...s,orientation:i,collapsedSize:p},l=Co(S),w=uo(),G=mo(),a=u.useRef(null),h=u.useRef(),W=typeof p=="number"?`${p}px`:p,M=i==="horizontal",T=M?"width":"height",V=u.useRef(null),Y=ho(e,V),R=n=>g=>{if(n){const f=V.current;g===void 0?n(f):n(f,g)}},B=()=>a.current?a.current[M?"clientWidth":"clientHeight"]:0,Z=R((n,g)=>{a.current&&M&&(a.current.style.position="absolute"),n.style[T]=W,A&&A(n,g)}),_=R((n,g)=>{const f=B();a.current&&M&&(a.current.style.position="");const{duration:U,easing:q}=eo({style:m,timeout:c,easing:H},{mode:"enter"});if(c==="auto"){const no=w.transitions.getAutoHeightDuration(f);n.style.transitionDuration=`${no}ms`,h.current=no}else n.style.transitionDuration=typeof U=="string"?U:`${U}ms`;n.style[T]=`${f}px`,n.style.transitionTimingFunction=q,D&&D(n,g)}),ro=R((n,g)=>{n.style[T]="auto",P&&P(n,g)}),io=R(n=>{n.style[T]=`${B()}px`,z&&z(n)}),ao=R(I),co=R(n=>{const g=B(),{duration:f,easing:U}=eo({style:m,timeout:c,easing:H},{mode:"exit"});if(c==="auto"){const q=w.transitions.getAutoHeightDuration(g);n.style.transitionDuration=`${q}ms`,h.current=q}else n.style.transitionDuration=typeof f=="string"?f:`${f}ms`;n.style[T]=W,n.style.transitionTimingFunction=U,N&&N(n)}),lo=n=>{c==="auto"&&G.start(h.current||0,n),d&&d(V.current,n)};return r.jsx(E,{in:v,onEnter:Z,onEntered:ro,onEntering:_,onExit:io,onExited:ao,onExiting:co,addEndListener:lo,nodeRef:V,timeout:c==="auto"?null:c,...F,children:(n,{ownerState:g,...f})=>r.jsx(vo,{as:C,className:L(l.root,y,{entered:l.entered,exited:!v&&W==="0px"&&l.hidden}[n]),style:{[M?"minWidth":"minHeight"]:W,...m},ref:Y,ownerState:{...S,state:n},...f,children:r.jsx(So,{ownerState:{...S,state:n},className:l.wrapper,ref:a,children:r.jsx(wo,{ownerState:{...S,state:n},className:l.wrapperInner,children:x})})})})});oo&&(oo.muiSupportAuto=!0);const so=u.createContext({});function Ro(o){return J("MuiAccordion",o)}const O=K("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),Ao=o=>{const{classes:t,square:e,expanded:s,disabled:d,disableGutters:x}=o;return X({root:["root",!e&&"rounded",s&&"expanded",d&&"disabled",!x&&"gutters"],heading:["heading"],region:["region"]},Ro,t)},Po=b(go,{name:"MuiAccordion",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:e}=o;return[{[`& .${O.region}`]:t.region},t.root,!e.square&&t.rounded,!e.disableGutters&&t.gutters]}})(j(({theme:o})=>{const t={duration:o.transitions.duration.shortest};return{position:"relative",transition:o.transitions.create(["margin"],t),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(o.vars||o).palette.divider,transition:o.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${O.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${O.disabled}`]:{backgroundColor:(o.vars||o).palette.action.disabledBackground}}}),j(({theme:o})=>({variants:[{props:t=>!t.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(o.vars||o).shape.borderRadius,borderTopRightRadius:(o.vars||o).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(o.vars||o).shape.borderRadius,borderBottomRightRadius:(o.vars||o).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:t=>!t.disableGutters,style:{[`&.${O.expanded}`]:{margin:"16px 0"}}}]}))),zo=b("h3",{name:"MuiAccordion",slot:"Heading"})({all:"unset"}),Eo=b("div",{name:"MuiAccordion",slot:"Region"})({}),Fo=u.forwardRef(function(t,e){const s=Q({props:t,name:"MuiAccordion"}),{children:d,className:x,defaultExpanded:y=!1,disabled:p=!1,disableGutters:C=!1,expanded:H,onChange:v,square:A=!1,slots:P={},slotProps:D={},TransitionComponent:z,TransitionProps:I,...N}=s,[i,m]=yo({controlled:H,default:y,name:"Accordion",state:"expanded"}),c=u.useCallback(_=>{m(!i),v&&v(_,!i)},[i,v,m]),[E,...F]=u.Children.toArray(d),S=u.useMemo(()=>({expanded:i,disabled:p,disableGutters:C,toggle:c}),[i,p,C,c]),l={...s,square:A,disabled:p,disableGutters:C,expanded:i},w=Ao(l),G={transition:z,...P},a={transition:I,...D},h={slots:G,slotProps:a},[W,M]=$("root",{elementType:Po,externalForwardedProps:{...h,...N},className:L(w.root,x),shouldForwardComponentProp:!0,ownerState:l,ref:e,additionalProps:{square:A}}),[T,V]=$("heading",{elementType:zo,externalForwardedProps:h,className:w.heading,ownerState:l}),[Y,R]=$("transition",{elementType:oo,externalForwardedProps:h,ownerState:l}),[B,Z]=$("region",{elementType:Eo,externalForwardedProps:h,ownerState:l,className:w.region,additionalProps:{"aria-labelledby":E.props.id,id:E.props["aria-controls"],role:"region"}});return r.jsxs(W,{...M,children:[r.jsx(T,{...V,children:r.jsx(so.Provider,{value:S,children:E})}),r.jsx(Y,{in:i,timeout:"auto",...R,children:r.jsx(B,{...Z,children:F})})]})});function Mo(o){return J("MuiAccordionDetails",o)}K("MuiAccordionDetails",["root"]);const To=o=>{const{classes:t}=o;return X({root:["root"]},Mo,t)},$o=b("div",{name:"MuiAccordionDetails",slot:"Root"})(j(({theme:o})=>({padding:o.spacing(1,2,2)}))),Go=u.forwardRef(function(t,e){const s=Q({props:t,name:"MuiAccordionDetails"}),{className:d,...x}=s,y=s,p=To(y);return r.jsx($o,{className:L(p.root,d),ref:e,ownerState:y,...x})});function jo(o){return J("MuiAccordionSummary",o)}const k=K("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),Ho=o=>{const{classes:t,expanded:e,disabled:s,disableGutters:d}=o;return X({root:["root",e&&"expanded",s&&"disabled",!d&&"gutters"],focusVisible:["focusVisible"],content:["content",e&&"expanded",!d&&"contentGutters"],expandIconWrapper:["expandIconWrapper",e&&"expanded"]},jo,t)},Do=b(fo,{name:"MuiAccordionSummary",slot:"Root"})(j(({theme:o})=>{const t={duration:o.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:o.spacing(0,2),transition:o.transitions.create(["min-height","background-color"],t),[`&.${k.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},[`&.${k.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity},[`&:hover:not(.${k.disabled})`]:{cursor:"pointer"},variants:[{props:e=>!e.disableGutters,style:{[`&.${k.expanded}`]:{minHeight:64}}}]}})),Io=b("span",{name:"MuiAccordionSummary",slot:"Content"})(j(({theme:o})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:t=>!t.disableGutters,style:{transition:o.transitions.create(["margin"],{duration:o.transitions.duration.shortest}),[`&.${k.expanded}`]:{margin:"20px 0"}}}]}))),No=b("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper"})(j(({theme:o})=>({display:"flex",color:(o.vars||o).palette.action.active,transform:"rotate(0deg)",transition:o.transitions.create("transform",{duration:o.transitions.duration.shortest}),[`&.${k.expanded}`]:{transform:"rotate(180deg)"}}))),Bo=u.forwardRef(function(t,e){const s=Q({props:t,name:"MuiAccordionSummary"}),{children:d,className:x,expandIcon:y,focusVisibleClassName:p,onClick:C,slots:H,slotProps:v,...A}=s,{disabled:P=!1,disableGutters:D,expanded:z,toggle:I}=u.useContext(so),N=a=>{I&&I(a),C&&C(a)},i={...s,expanded:z,disabled:P,disableGutters:D},m=Ho(i),c={slots:H,slotProps:v},[E,F]=$("root",{ref:e,shouldForwardComponentProp:!0,className:L(m.root,x),elementType:Do,externalForwardedProps:{...c,...A},ownerState:i,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:P,"aria-expanded":z,focusVisibleClassName:L(m.focusVisible,p)},getSlotProps:a=>({...a,onClick:h=>{a.onClick?.(h),N(h)}})}),[S,l]=$("content",{className:m.content,elementType:Io,externalForwardedProps:c,ownerState:i}),[w,G]=$("expandIconWrapper",{className:m.expandIconWrapper,elementType:No,externalForwardedProps:c,ownerState:i});return r.jsxs(E,{...F,children:[r.jsx(S,{...l,children:d}),y&&r.jsx(w,{...G,children:y})]})}),Uo=to(r.jsx("path",{d:"M12 7V3H2v18h20V7zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8zm-2-8h-2v2h2zm0 4h-2v2h2z"})),Lo=to(r.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),qo=to(r.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}));export{Fo as A,Uo as B,Lo as E,qo as L,Bo as a,Go as b};
|