@atom-learning/components 2.32.2-beta.0 → 2.32.3-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ae=require("@radix-ui/react-accordion"),Y=require("react"),tr=require("@atom-learning/theme"),ya=require("@stitches/react"),v=require("@atom-learning/icons"),O=require("color2k"),Ct=require("@radix-ui/react-slot"),ar=require("invariant"),oe=require("@radix-ui/react-alert-dialog"),or=require("@radix-ui/react-visually-hidden"),rr=require("uid"),ge=require("pure-react-carousel"),nr=require("@radix-ui/react-checkbox"),H=require("react-hook-form"),ir=require("@radix-ui/react-radio-group"),lr=require("react-hook-form-persist"),sr=require("dlv"),cr=require("@radix-ui/react-toggle-group"),De=require("@reach/combobox"),se=require("@tanstack/react-table"),dr=require("use-deep-compare-effect"),et=require("throttle-debounce"),fe=require("@dnd-kit/core"),mr=require("@dnd-kit/modifiers"),qe=require("@dnd-kit/sortable"),ur=require("@dnd-kit/utilities"),ze=require("@radix-ui/react-tooltip"),pr=require("dayzed"),$e=require("@radix-ui/react-popover"),hr=require("dayjs"),gr=require("dayjs/plugin/customParseFormat"),q=require("@radix-ui/react-dialog"),Ie=require("@radix-ui/react-dropdown-menu"),fr=require("mdast-util-directive"),$r=require("mdast-util-from-markdown"),br=require("micromark-extension-directive"),vr=require("@radix-ui/react-navigation-menu"),yr=require("@radix-ui/react-progress"),tt=require("@radix-ui/react-slider"),xr=require("@radix-ui/react-switch"),at=require("@radix-ui/react-tabs"),St=require("react-hot-toast"),wr=require("react-player/vimeo");function U(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}function ee(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if(o!=="default"){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}}),t.default=e,Object.freeze(t)}var a=ee(Y),u=U(Y),Er=ee(tr),Te=U(ar),kt=ee(or),xa=ee(nr),Re=ee(ir),Cr=U(lr),Sr=U(sr),ot=ee(cr),kr=U(dr),_e=U(hr),Dr=U(gr),zr=ee(q),Ir=U(fr),Tr=U($r),Rr=U(br),ce=ee(vr),wa=ee(yr),Ea=ee(xr),Fr=U(St),Nr=U(wr);const Dt={bg:e=>({background:e}),size:e=>({height:e,width:e}),p:e=>({padding:e}),pt:e=>({paddingTop:e}),pr:e=>({paddingRight:e}),pb:e=>({paddingBottom:e}),pl:e=>({paddingLeft:e}),px:e=>({paddingLeft:e,paddingRight:e}),py:e=>({paddingTop:e,paddingBottom:e}),m:e=>({margin:e}),mt:e=>({marginTop:e}),mr:e=>({marginRight:e}),mb:e=>({marginBottom:e}),ml:e=>({marginLeft:e}),mx:e=>({marginLeft:e,marginRight:e}),my:e=>({marginTop:e,marginBottom:e})},zt={sm:"(min-width: 550px)",md:"(min-width: 800px)",lg:"(min-width: 1100px)",xl:"(min-width: 1350px)",reducedMotion:"(prefers-reduced-motion)",allowMotion:"(prefers-reduced-motion: no-preference)",hover:"(hover: hover)"},Mr=ya.createStitches({theme:Er,utils:Dt,media:zt}),{css:Ar,getCssText:Lr,createTheme:Pr,globalCss:Ca,keyframes:D,styled:l,theme:_}=Mr,It=(e,t)=>Object.keys(_[e]).reduce((o,r)=>({...o,[r]:JSON.parse(JSON.stringify(t).replace(/\$key/g,`$${e}$${r}`))}),{}),w=l("div",{});w.displayName="Box";const Fe=({css:e,children:t})=>e?a.createElement(w,{css:e},t):a.createElement(a.Fragment,null,t);Fe.displayName="CSSWrapper";const Q=(e,t)=>({"&::before":{content:"''",mb:`-${e}em`,display:"table"},"&::after":{content:"''",mt:`-${t||e}em`,display:"table"}}),Wr={chevron:e=>`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" stroke="${e}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" color="${e}"><polyline points="6 10 12 16 18 10"/></svg>`,search:e=>`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" stroke="${e}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" color="${e}"><path d="M14.4121122,14.4121122 L20,20"></path><circle cx="10" cy="10" r="6"></circle></svg>`},Sa=(e,t)=>`url(data:image/svg+xml;charset=US-ASCII,${encodeURIComponent(Wr[t](O.toHex(e)))})`,be=({position:e="relative",zIndex:t=1}={})=>({outline:"none",position:["relative","absolute","fixed","sticky"].includes(e)?e:"relative",zIndex:t>1?t:1,boxShadow:"white 0px 0px 0px 2px, $colors$primary 0px 0px 0px 4px"}),Tt=D({"0%":{opacity:0,transform:"translateY(2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Rt=D({"0%":{opacity:0,transform:"translateX(-2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Ft=D({"0%":{opacity:0,transform:"translateY(-2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Nt=D({"0%":{opacity:0,transform:"translateX(2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Mt=D({"0%":{opacity:0},"100%":{opacity:1}}),rt=D({"0%":{opacity:1},"100%":{opacity:0}}),Br=D({"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(0)"}}),Or=D({"0%":{transform:"translateX(0)"},"100%":{transform:"translateX(-100%)"}}),Hr=D({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Vr=D({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),qr=l(ae.Content,{border:0,width:"100%",bg:"$background",overflow:"hidden",'&[data-state="open"]':{borderRadius:"0 0 $0 $0"},"@allowMotion":{'&[data-state="open"]':{animation:`${Hr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Vr} 300ms ease-out`}}}),_r=({children:e,css:t,...o})=>u.default.createElement(qr,{...o},u.default.createElement(Fe,{css:t},e)),Gr=l(ae.Item,{width:"100%","&:not(:last-child)":{mb:"$1"}}),jr=({children:e,value:t,...o})=>u.default.createElement(Gr,{value:t,...o},e),ka=l("svg",{display:"inline-block",fill:"none",stroke:"currentcolor",strokeLinecap:"round",strokeLinejoin:"round",verticalAlign:"middle",variants:{size:{sm:{size:"$1",strokeWidth:"1.5"},md:{size:"$2",strokeWidth:"1.75"},lg:{size:"$3",strokeWidth:"2"}}}}),b=a.forwardRef(({is:e,size:t="md",...o},r)=>a.createElement(ka,{size:t,"aria-hidden":"true",...o,as:e,ref:r}));var Yr="#F3F8FF",Ur="#E5F1FF",Xr="#D6EAFF",Jr="#C2DEFF",Kr="#B3D4FA",Qr="#057AFF",Zr="#0F67F5",en="#194DCC",tn="#102DA3",an="#15235E",Da={blue1:Yr,blue2:Ur,blue3:Xr,blue4:Jr,blue5:Kr,blue6:Qr,blue7:Zr,blue8:en,blue9:tn,blue10:an},on="#F6F6F6",rn="#EBEBEB",nn="#E0E0E0",ln="#CECECE",sn="#C2C2C2",cn="#757575",dn="#545454",mn="#333333",un="#1F1F1F",pn="#1C1C1C",At={slate1:on,slate2:rn,slate3:nn,slate4:ln,slate5:sn,slate6:cn,slate7:dn,slate8:mn,slate9:un,slate10:pn};const hn=[255,255,255,1],nt=[.05,.1,.15,.2,.27,.35,.5,.7,.8,.95],Lt=e=>Math.round(Math.max(Math.min(e,255),0)),za=(e,t)=>{const o={};return Object.entries(t).forEach(([r,n],i)=>{const[s,c,d]=O.parseToRgba(n),[m,p,h]=hn,g=[Lt((s-m)/nt[i]+m),Lt((c-p)/nt[i]+p),Lt((d-h)/nt[i]+h),nt[i]];o[`${e}A${i+1}`]=`rgba(${g.join(",")})`}),o},re={},Ia=(e,t)=>{const o={};for(let r=1;r<=10;r++)o[`${e}${r}`]=`$${t}${r}`,o[`${e}A${r}`]=`$${t}A${r}`;return o},{styled:gn,createTheme:Ne}=ya.createStitches({theme:{colors:{background:"white",foreground:At.slate9,foreground6plus:"white",...Da,...za("blue",Da),...At,...za("slate",At)}},utils:Dt,media:zt});re["interactive-loContrast1"]=Ne("interactive-loContrast1",{colors:{interactiveForeground:"$foreground",interactive1:"white",interactive2:"$accent1",interactive3:"$accent2"}}),re["interactive-loContrast2"]=Ne("interactive-loContrast2",{colors:{interactiveForeground:"$foreground",interactive1:"$accent1",interactive2:"$accent2",interactive3:"$accent3"}}),re["interactive-hiContrast1"]=Ne("interactive-hiContrast1",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent7",interactive2:"$accent8",interactive3:"$accent9"}}),re["interactive-hiContrast2"]=Ne("interactive-hiContrast2",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent8",interactive2:"$accent9",interactive3:"$accent10"}});const fn={slate:"slate"},$n=()=>{Object.entries(fn).forEach(([e,t])=>{const o=`base-${e}`;re[o]=Ne(o,{colors:Ia("base",t)})})},bn={slate:"slate",blue:"blue"},vn=()=>{Object.entries(bn).forEach(([e,t])=>{const o=`accent-${e}`;re[o]=Ne(o,{colors:Ia("accent",t)})})};$n(),vn();const yn=gn("div"),Pt=a.forwardRef(({base:e="",accent:t="",interactive:o="",className:r,asChild:n=!1,...i},s)=>{const c=[r,re[`interactive-${o}`],re[`accent-${t}`],re[`base-${e}`]].filter(Boolean).join(" ");return a.createElement(n?Ct.Slot:yn,{ref:s,className:c,...i})});Pt.displayName="ColorScheme";const xn=l(b,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"},'[data-state="closed"] > &':{transform:"rotate(0deg)"}}),wn=l(ae.Trigger,{border:0,py:"$3",px:"$4",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",bg:"$interactive2",color:"$interactiveForeground","&[data-disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([data-disabled])":{"&:active, &:hover, &:focus-visible":{bg:"$interactive3"},"&:focus-visible":{...be()}},'&[data-state="open"]':{borderRadius:"$0 $0 0 0"},'&[data-state="closed"]':{borderRadius:"$0"}}),En=({children:e,colorScheme:t={},...o})=>u.default.createElement(Pt,{asChild:!0,accent:"slate",interactive:"loContrast1",...t},u.default.createElement(wn,{...o},e,u.default.createElement(xn,{is:v.ChevronDown}))),Cn=l(ae.Root,{width:"100%"}),Ge=u.default.forwardRef(({type:e="single",children:t,...o},r)=>u.default.createElement(Cn,{ref:r,type:e,...o},t));Ge.Item=jr,Ge.Content=_r,Ge.Trigger=En,Ge.displayName="Accordion";const Sn={xs:"sm",sm:"sm",md:"md",lg:"lg"},Me=(e,t,o)=>({bg:"transparent",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:t},"&:not(:disabled):active":{color:o},"&[disabled]":{color:"$tonal400",cursor:"not-allowed"}}),je=(e,t,o)=>({bg:e,color:"white","&:not(:disabled):hover, &:not(:disabled):focus":{bg:t,color:"white"},"&:not(:disabled):active":{bg:o},"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"}}),Ye=(e,t,o)=>({border:"1px solid",borderColor:"currentColor",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:t},"&:not(:disabled):active":{color:o},"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"}}),kn=l("button",{alignItems:"center",appearance:"none",bg:"white",border:"unset",borderRadius:"$0",boxSizing:"border-box",cursor:"pointer",display:"flex",justifyContent:"center",p:"unset",transition:"all 100ms ease-out",variants:{theme:{neutral:{},primary:{},success:{},warning:{},danger:{}},appearance:{simple:{},outline:{},solid:{}},size:{xs:{size:"$2"},sm:{size:"$3"},md:{size:"$4"},lg:{size:"$5"}},isRounded:{true:{borderRadius:"$round"}}},compoundVariants:[{theme:"neutral",appearance:"simple",css:Me("$tonal300","$primaryMid","$primaryDark")},{theme:"primary",appearance:"simple",css:Me("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"simple",css:Me("$primaryDark",O.darken(_.colors.primaryDark.value,.1),O.darken(_.colors.primaryDark.value,.15))},{theme:"success",appearance:"simple",css:Me("$success","$successMid","$successDark")},{theme:"warning",appearance:"simple",css:Me("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"simple",css:Me("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"solid",css:je("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"solid",css:je("$primaryDark",O.darken(_.colors.primaryDark.value,.1),O.darken(_.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:je("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:je("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"solid",css:je("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"outline",css:Ye("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"outline",css:Ye("$primaryDark",O.darken(_.colors.primaryDark.value,.1),O.darken(_.colors.primaryDark.value,.15))},{theme:"success",appearance:"outline",css:Ye("$success","$successMid","$successDark")},{theme:"warning",appearance:"outline",css:Ye("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"outline",css:Ye("$danger","$dangerMid","$dangerDark")}]}),M=a.forwardRef(({children:e,theme:t="primary",appearance:o="simple",size:r="sm",label:n,href:i,disabled:s,...c},d)=>{const m=`A single ${b.displayName} component is permitted as a child of ${M.displayName}`;return Te.default(a.Children.count(e)===1,m),a.createElement(kn,{...c,...i?{as:"a",href:s?null:i,onClick:void 0,"aria-disabled":!!s}:{type:"button"},"aria-label":n,theme:t,appearance:o,size:r,ref:d,disabled:s},a.Children.map(e,p=>{if(!a.isValidElement(p))throw new Error(m);return Te.default(p.type===b,`Children of type ${p==null?void 0:p.type} aren't permitted. Only an ${b.displayName} component is allowed in ${M.displayName}`),a.cloneElement(p,{size:Sn[r],css:{...p.props.css?p.props.css:{}}})}))});M.displayName="ActionIcon";const it=2147483647,Ue=1147483646,Dn=10,zn=10,In=10,Wt="translate3d(-50%, -50%, 0)",Ta="translate3d(-50%, 50vh, 0)",Tn=D({"0%":{transform:Ta},"100%":{transform:Wt}}),Rn=D({"0%":{transform:Wt},"100%":{transform:Ta}}),Fn=l(oe.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${Mt} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),Nn=l(oe.Content,{bg:"white",borderRadius:"$1",boxShadow:"$3",boxSizing:"border-box",left:"50%",maxWidth:"90vw",p:"$5",position:"fixed",top:"50%",transform:Wt,"&:focus":{outline:"none"},zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${Tn} 550ms cubic-bezier(0.22, 1, 0.36, 1)`},'&[data-state="closed"]':{animation:`${Rn} 550ms cubic-bezier(0.22, 1, 0.36, 1)`}},variants:{size:{sm:{width:"380px"},md:{width:"480px"},lg:{width:"600px"}}}}),Mn=({size:e="sm",...t})=>a.createElement(oe.Portal,null,a.createElement(Fn,null),a.createElement(Nn,{size:e,...t})),An=l(oe.Root,{}),G=e=>a.createElement(An,{...e});G.Description=oe.Description,G.Title=oe.Title,G.Action=oe.Action,G.Cancel=oe.Cancel,G.Content=Mn,G.Trigger=oe.Trigger,G.displayName="AlertDialog";const Ln=()=>{const e=Y.useRef();return Y.useEffect(()=>(e.current=!0,()=>{e.current=!1})),e},z=l("div",{display:"flex"});z.displayName="Flex";const Pn=D({"0%":{opacity:0},"30%":{opacity:1},"50%":{opacity:1},"80%":{opacity:0},"100%":{opacity:0}}),Bt=l("div",{animationName:`${Pn}`,animationDuration:"1s",animationFillMode:"both",animationIterationCount:"infinite",animationTimingFunction:"linear",backgroundColor:"currentColor",borderRadius:"$round","&:nth-child(1)":{animationDelay:"-300ms"},"&:nth-child(2)":{animationDelay:"-150ms"},"&:nth-child(3)":{animationDelay:0},variants:{size:{sm:{size:"4px",mx:"2px"},md:{size:"6px",mx:"2px"},lg:{size:"8px",mx:"3px"}}}}),lt=({css:e={},message:t="Loading",size:o="md",...r})=>a.createElement(z,{css:{justifyContent:"center",...e},role:"alert",...r},a.createElement(kt.Root,null,t),a.createElement(Bt,{size:o}),a.createElement(Bt,{size:o}),a.createElement(Bt,{size:o})),Ot=(e,t,o)=>({border:"1px solid",borderColor:"currentColor",color:e,"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{textDecoration:"none",color:t},"&:not([disabled]):active":{color:o}}),Ae=(e,t,o,r="white")=>({bg:e,color:r,"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{bg:t,color:r},"&:not([disabled]):active":{bg:o}}),Ra=l("button",{alignItems:"center",bg:"unset",border:"unset",borderRadius:"$0",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:600,justifyContent:"center",p:"unset",textDecoration:"none",transition:"all 100ms ease-out",whiteSpace:"nowrap",width:"max-content",variants:{theme:{primary:{},secondary:{},success:{},warning:{},danger:{},neutral:{}},appearance:{solid:{},outline:{}},size:{sm:{fontSize:"$sm",lineHeight:1.53,height:"$3",px:"$4"},md:{fontSize:"$md",lineHeight:1.5,height:"$4",px:"$5"},lg:{fontSize:"$lg",lineHeight:1.5,height:"$5",px:"$5"}},isLoading:{true:{cursor:"not-allowed",opacity:.6,pointerEvents:"none"}},fullWidth:{false:{width:"max-content"},true:{width:"100%"}}},compoundVariants:[{theme:"primary",appearance:"solid",css:Ae("$primary","$primaryMid","$primaryDark")},{theme:"secondary",appearance:"solid",css:Ae("$primaryDark",O.darken(_.colors.primaryDark.value,.1),O.darken(_.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:Ae("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:Ae("$warning","$warningMid","$warningDark","$tonal500")},{theme:"danger",appearance:"solid",css:Ae("$danger","$dangerMid","$dangerDark")},{theme:"neutral",appearance:"solid",css:Ae("white",O.opacify("white",-.1),O.opacify("white",-.25),"$primary")},{theme:"primary",appearance:"outline",css:Ot("$primary","$primaryMid","$primaryDark")},{theme:"neutral",appearance:"outline",css:Ot("white",O.opacify("white",-.2),O.opacify("white",-.35))},{theme:"secondary",appearance:"outline",css:Ot("$primaryDark",O.darken(_.colors.primaryDark.value,.1),O.darken(_.colors.primaryDark.value,.15))}]}),Wn=({isLoading:e,children:t})=>a.createElement(a.Fragment,null,a.createElement(lt,{css:{opacity:e?1:0,position:"absolute",transition:"opacity 150ms"}}),a.createElement(w,{as:"span",css:e?{opacity:0,transition:"opacity 150ms"}:{}},t)),Bn=e=>{switch(e){case"lg":return 22;case"md":return 20;case"sm":default:return 16}},Fa=(e,t)=>a.Children.map(e,(o,r)=>(o==null?void 0:o.type)===b?a.cloneElement(o,{css:{[r===0?"mr":"ml"]:t==="sm"?"$2":"$3",size:Bn(t),...o.props.css?o.props.css:{}}}):o),ne=a.forwardRef(({children:e,isLoading:t,onClick:o,href:r,appearance:n="solid",size:i="md",theme:s="primary",type:c="button",...d},m)=>a.createElement(Ra,{isLoading:t||!1,onClick:t?void 0:o,appearance:n,size:i,theme:s,...d,...r?{as:"a",href:r,onClick:void 0}:{},...r?{}:{type:c},ref:m},typeof t=="boolean"?a.createElement(Wn,{isLoading:t},Fa(e,i)):Fa(e,i)));ne.displayName="Button";const Ht=l("h2",{fontFamily:"$display",fontWeight:700,m:0,variants:{size:{xs:{fontFamily:"$body",fontWeight:600,fontSize:"$md",lineHeight:1.5,...Q(.3864)},sm:{fontSize:"$lg",lineHeight:1.14,...Q(.2174,.2254)},md:{fontSize:"$xl",lineHeight:1.14,...Q(.2174,.2254)},lg:{fontSize:"$2xl",lineHeight:1.08,...Q(.1865,.1945)},xl:{fontSize:"$3xl",lineHeight:1.12,...Q(.206,.214)},xxl:{fontSize:"$4xl",lineHeight:1.06,...Q(.1793,.1873)}},noCapsize:{true:{"&::before, &::after":{display:"none"}}}}}),st=a.forwardRef(({size:e="md",...t},o)=>a.createElement(Ht,{ref:o,size:e,...t}));st.displayName="Heading";const On=l("div",{display:"flex","& > *":{m:0},variants:{direction:{row:{flexDirection:"row"},"row-reverse":{flexDirection:"row-reverse"},column:{flexDirection:"column"}},wrap:{wrap:{flexWrap:"wrap"},"no-wrap":{flexWrap:"no-wrap"},"wrap-reverse":{flexWrap:"wrap-reverse"}},justify:{start:{justifyContent:"flex-start"},center:{justifyContent:"center"},end:{justifyContent:"flex-end"},false:{}},align:{start:{alignItems:"flex-start"},center:{alignItems:"center"},end:{alignItems:"flex-end"},false:{}},gap:{...It("space",{mt:"-$key",ml:"-$key","& > *":{mt:"$key",ml:"$key"}}),false:{}}}}),Le=a.forwardRef(({css:e,gap:t=2,direction:o="row",wrap:r="wrap",justify:n="start",align:i,...s},c)=>a.createElement(Fe,{css:e},a.createElement(On,{ref:c,direction:o,gap:t,wrap:r,justify:n,align:typeof i>"u"&&o!=="column"?"center":i,...s})));Le.displayName="Stack";const Xe={size:{xs:{fontSize:"$xs",lineHeight:1.6,...Q(.4364)},sm:{fontSize:"$sm",lineHeight:1.53,...Q(.4056)},md:{fontSize:"$md",lineHeight:1.5,...Q(.3864)},lg:{fontSize:"$lg",lineHeight:1.52,...Q(.3983)},xl:{fontSize:"$xl",lineHeight:1.42,...Q(.3506)}},noCapsize:{true:{"&::before, &::after":{display:"none"}}}},Je=({size:e,noCapsize:t})=>({...Xe.size[e],...Xe.noCapsize[`${t}`]}),Vt=l("p",{fontFamily:"$body",fontWeight:400,margin:0,"& > &":{"&:before, &:after":{display:"none"}},variants:Xe}),L=a.forwardRef(({size:e="md",...t},o)=>a.createElement(Vt,{size:e,...t,ref:o}));L.displayName="Text";const Hn=({title:e,description:t,onAction:o,cancelActionText:r,confirmActionText:n,onClose:i,...s})=>a.createElement(G,{defaultOpen:!0},a.createElement(G.Content,{onEscapeKeyDown:c=>c.preventDefault(),onCloseAutoFocus:i,...s},a.createElement(st,{as:G.Title,size:"sm",css:{mb:"$5"}},e),t&&a.createElement(L,{as:G.Description,css:{mb:"$5"}},t),a.createElement(Le,{gap:"2",justify:"end"},r&&a.createElement(ne,{appearance:"outline",as:G.Cancel,onClick:()=>o(!1),size:"sm"},r),a.createElement(ne,{as:G.Action,onClick:()=>o(!0),size:"sm"},n)))),Vn=[],qn=(e,t)=>{switch(t.type){case"ADD":return[...e,{...t.payload,id:rr.uid()}];case"REMOVE":return e.filter(({id:o})=>o!==t.payload);default:return e}},Na=a.createContext({showAlert:()=>null}),_n=({children:e})=>{const[t,o]=a.useReducer(qn,Vn),r=Ln();return a.createElement(Na.Provider,{value:{showAlert:n=>o({payload:n,type:"ADD"})}},Boolean(t.length)&&a.createElement(Hn,{...t[0],key:t[0].id,onClose:()=>{r.current&&o({payload:t[0].id,type:"REMOVE"})}}),e)},Gn=()=>{const e=a.useContext(Na);if(e===void 0)throw new Error("useAlert must be used within a AlertProvider");return e},qt=(e,t)=>{let o;switch(typeof e){case"object":o={},Object.keys(e).forEach(r=>{const n=e[r];o[r]=n&&t(n)});break;default:o=t(e)}return o},jn={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg",xxl:"lg"},Yn=({is:e})=>{const t=a.useContext(_t),{size:o}=t,r=a.useMemo(()=>qt(o,n=>jn[n]),[o]);return a.createElement(b,{size:r,is:e})},Ma=l("img",{verticalAlign:"middle",maxWidth:"100%",variants:{fluid:{true:{"&[width]":{width:"auto"},"&[width][height]":{height:"auto"},'&[src$=".svg"]':{width:"100%",height:"auto",maxWidth:"none"}}}}}),Pe=Ma;Pe.displayName="Image";const Aa=()=>a.createElement(w,{css:{position:"relative",size:"100%"}},a.createElement(b,{is:v.User,css:{size:"100%"}})),Un={xs:"xs",sm:"sm",md:"sm",lg:"md",xl:"md",xxl:"lg"},La=()=>{const e=a.useContext(_t),{name:t,size:o}=e,r=a.useMemo(()=>qt(o,n=>Un[n]),[o]);return t?a.createElement(L,{size:r,css:{color:"$tonal400"}},t[0].toUpperCase()):a.createElement(Aa,null)},Xn=l(Pe,{size:"100%",objectFit:"cover"}),Jn=({src:e,alt:t})=>e?a.createElement(Xn,{src:e,alt:t}):a.createElement(La,null),Pa={display:"flex",justifyContent:"center",alignItems:"center",color:"$tonal400",borderRadius:"$round",border:"2px solid $tonal100",backgroundColor:"$white",overflow:"hidden",variants:{size:{xs:{size:"$2"},sm:{size:"$3"},md:{size:"$4"},lg:{size:"$5"},xl:{size:"$6"},xxl:{size:"$7"}}}},Kn=l("div",Pa),Qn=l("button",{all:"unset",...Pa,"&:not([disabled])":{"&:hover":{borderColor:"$tonal400",backgroundColor:"$tonal50"},"&:active":{borderColor:"$primary",backgroundColor:"$tonal100"},"&:focus-visible":be()},"&[disabled]":{opacity:"30%",cursor:"not-allowed"}}),_t=a.createContext({name:void 0,size:"lg"}),Zn=({children:e,name:t,size:o})=>{const r=a.useMemo(()=>({name:t,size:o}),[t,o]);return a.createElement(_t.Provider,{value:r},e)},ei=({children:e,size:t="lg",name:o,disabled:r=!1,onClick:n})=>a.createElement(Zn,{name:o,size:t},n?a.createElement(Qn,{size:t,disabled:r,onClick:r?void 0:n,css:{cursor:r?"auto":"pointer"}},e):a.createElement(Kn,{size:t},e)),We=ei;We.Image=Jn,We.Initial=La,We.Placeholder=Aa,We.Icon=Yn,We.displayName="Avatar";const ti=l(z,{justifyContent:"center",alignItems:"center",borderRadius:"$0",minWidth:0,border:"1px solid #FFFFFF",fontFamily:"$body","& > *:not(:last-child)":{mr:"$1"},variants:{theme:{success:{bg:"$successLight",color:"$successMid"},warning:{bg:"$warningLight",color:"$warningText"},danger:{bg:"$dangerLight",color:"$dangerMid"},neutral:{bg:"$tonal50",color:"$tonal400"},info:{bg:"$primaryLight",color:"$primaryMid"}},size:{xs:{fontSize:"$sm",px:"$1",height:"$2"},sm:{fontSize:"$md",px:"$1",height:"$3"},md:{fontSize:"$md",px:"$2",height:"$4"}}}}),Wa=({theme:e="info",size:t="sm",children:o,...r})=>a.createElement(ti,{role:"status",theme:e,size:t,...r},a.Children.map(o,n=>{if(typeof n=="string"||typeof n=="number")return a.createElement(w,{css:{whiteSpace:"nowrap",overflowX:"hidden",textOverflow:"ellipsis",py:"$0"}},n);if(a.isValidElement(n)&&n.type===b)return a.cloneElement(n,{size:"sm",css:{...n.props.css,flexShrink:0}})}));Wa.displayName="Badge";const Ba={alignItems:"center",bg:"unset",border:"unset",color:"$primary",cursor:"pointer",display:"flex",justifyContent:"center",p:"unset",size:"$5",top:"50%",transform:"translateY(-50%)",transition:"color 0.15s ease-in-out","&:hover":{color:"$primaryMid"},"&:active":{color:"$primaryDark"},"&:disabled":{color:"$tonal100"}},ai=l(ge.ButtonBack,Ba),oi=l(ge.ButtonNext,Ba),ri=e=>a.createElement(ai,{...e},a.createElement(b,{is:v.ChevronLeft})),ni=e=>a.createElement(oi,{...e},a.createElement(b,{is:v.ChevronRight})),ii=l(ge.DotGroup,{justifyContent:"center","& button":{bg:"$tonal200",border:"none",borderRadius:"50%",cursor:"pointer",mx:"$1",p:"$1",size:"$space$3",transition:"all 100ms ease-in",'&[class*="selected"]':{bg:"$primary"},"&:hover, &:focus":{bg:"$primaryMid"}}}),li=l(ge.Slide,{}),si=({children:e,...t})=>a.createElement(li,{...t,tag:"div"},a.createElement(w,{css:{px:"$3"}},e)),ci=l(ge.Slider,{cursor:"grab",ml:"50%",overflow:"hidden",transform:"translateX(-50%)",'& [class*="sliderTray_"]':{p:"unset",m:"unset",transition:"transform .5s cubic-bezier(.645,.045,.355,1)"},'& [class*="slide_"]':{float:"left",pb:"0 !important"},'& [class*="slideInner"]':{display:"flex",justifyContent:"center"},variants:{overflow:{true:{overflow:"visible"}}}}),ve=({children:e,css:t,slideHeight:o,slideWidth:r,numSlides:n,...i})=>a.createElement(Fe,{css:t},a.createElement(ge.CarouselProvider,{naturalSlideWidth:r,naturalSlideHeight:o,totalSlides:n,...i},e)),di=()=>a.useContext(ge.CarouselContext);ve.ArrowNext=ni,ve.ArrowPrevious=ri,ve.Pagination=ii,ve.Slide=si,ve.Slider=ci,ve.displayName="Carousel";const mi=l(xa.Indicator,{display:"flex",alignItems:"center",justifyContent:"center"}),ui=l(xa.Root,{appearance:"none",backgroundColor:"transparent",border:"1px solid $colors$tonal400",borderRadius:"3px",color:"white",cursor:"pointer",size:"$1",p:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 50ms ease-out",'&[data-state="checked"]':{backgroundColor:"$primary",borderColor:"$primary"},'&[data-state="indeterminate"]':{backgroundColor:"$primary",borderColor:"$primary"},"&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},"&[disabled]":{backgroundColor:"$tonal100",borderColor:"$tonal400",cursor:"not-allowed",color:"$tonal400"},variants:{state:{error:{borderColor:"$danger"}}}}),ct=a.forwardRef((e,t)=>a.createElement(ui,{...e,ref:t},a.createElement(mi,null,a.createElement(b,{is:e.checked==="indeterminate"?v.Minus:v.Ok,css:{pointerEvents:"none",position:"absolute",strokeWidth:"3",size:14}}))));ct.displayName="Checkbox";const pi={success:{color:"$success"},warning:{color:"$warningText","& svg":{color:"$warningDark"}},info:{color:"$primary"},neutral:{color:"$tonal400"},error:{color:"$danger"}},hi={success:v.OkCircle,warning:v.Danger,info:v.Info,neutral:v.Info,error:v.Error},gi=l(z,{variants:{theme:pi}}),fi=l(b,{flexShrink:"0",mr:"$2"}),dt=({css:e,showIcon:t=!0,theme:o="error",size:r="sm",children:n,...i})=>a.createElement(gi,{theme:o,css:e,...i},t&&a.createElement(fi,{size:"sm",is:hi[o]}),a.createElement(L,{as:"span",size:r,css:{transform:"translateY($space$0)"}},n)),$i=l("label",{color:"$tonal500",fontFamily:"$body",m:0,variants:{size:{sm:Je({size:"sm"}),md:Je({size:"md"})},type:{block:{display:"block",fontWeight:600},inline:{display:"flex",fontWeight:400,maxWidth:"max-content"}},align:{start:{},center:{}},direction:{reverse:{},row:{}}},compoundVariants:[{type:"inline",align:"start",css:{alignItems:"flex-start"}},{type:"inline",align:"center",css:{alignItems:"center"}},{type:"inline",direction:"reverse",css:{flexDirection:"row-reverse"}},{type:"inline",direction:"row",css:{flexDirection:"row"}}]}),bi=l("span",{color:"$danger",ml:"$1",fontWeight:400}),Be=({align:e="start",as:t="label",direction:o="row",size:r="md",type:n="block",children:i,required:s,...c})=>a.createElement($i,{as:t,size:r,type:n,align:e,direction:o,...c},i,s&&a.createElement(bi,{"aria-hidden":!0},"*"));Be.displayName="Label";const Oe=l("li",{}),Oa=l("ul",{fontFamily:"$body",m:"unset",p:"unset",[`& > ${Oe}`]:{"&:not(:last-child)":{mb:"$2"},"&:last-child":{mb:0}},variants:{...Xe,as:{ol:{pl:"$4",listStyle:"decimal",[`& > ${Oe}`]:{pl:"$1","&::marker":{fontSize:"$sm",fontWeight:"bold"}}},ul:{pl:"$3",[`& > ${Oe}`]:{pl:"$2","&::marker":{content:"\u2022",fontWeight:"bold"}}}},theme:{primary:{[`& > ${Oe}`]:{"&::marker":{color:"$primary"}}}}}}),mt=a.forwardRef(({size:e="md",noCapsize:t=!0,ordered:o,...r},n)=>a.createElement(Oa,{ref:n,as:o?"ol":"ul",size:e,noCapsize:t,...r}));mt.Item=Oe;const vi=l(w,{bg:"$tonal100",borderRadius:"$1",color:"$tonal600",fontFamily:"$mono",fontSize:"$sm",lineHeight:1.4,my:"$4",p:"$3"}),yi=({node:e})=>a.createElement(vi,{as:"pre"},e.value),Ha=l("em",{fontStyle:"italic"}),xi=({node:e,handleNode:t})=>{var o;return a.createElement(Ha,null,(o=e.children)==null?void 0:o.map(t))},wi=e=>{switch(e){case 1:return{size:"xl",as:"h1"};case 2:return{size:"lg",as:"h2"};case 3:return{size:"md",as:"h3"};case 4:return{size:"sm",as:"h4"};case 5:return{size:"xs",as:"h5"};default:return{size:"xs",as:"h6"}}},Ei=({node:e,handleNode:t,...o})=>{var r;const{as:n,size:i}=wi(e.depth);return a.createElement(st,{as:n,size:i,...o},(r=e.children)==null?void 0:r.map(t))},Ci=l(w,{bg:"$tonal100",borderRadius:"$0",color:"$tonal600",display:"inline-block",fontFamily:"$mono",fontSize:"85%",p:"$0 $1"}),Si=({node:e})=>a.createElement(Ci,{as:"code"},e.value),ki=({node:e,css:t})=>{var o;return a.createElement(Pe,{src:e.url,alt:(o=e.alt)!=null?o:void 0,css:t})},Di=({node:e,handleNode:t})=>{var o,r;return a.createElement(ut,{title:(o=e.title)!=null?o:void 0,href:e.url},(r=e.children)==null?void 0:r.map(t))},zi=({node:e,handleNode:t,css:o})=>{var r;return a.createElement(mt,{css:{"& p:before, & p:after":{display:"none"},...o},ordered:e.ordered||void 0},(r=e.children)==null?void 0:r.map(t))},Ii=({node:e,handleNode:t})=>{var o;return a.createElement(mt.Item,null,(o=e.children)==null?void 0:o.map(t))},Ti=({node:e,handleNode:t,...o})=>{var r;return a.createElement(L,{...o},(r=e.children)==null?void 0:r.map(t))},Ri=l("strong",{fontWeight:600}),Fi=({node:e,handleNode:t})=>{var o;return a.createElement(Ri,null,(o=e.children)==null?void 0:o.map(t))},Ni=({node:e})=>e.value,Va=l("hr",{border:0,bg:"$tonal100",variants:{orientation:{horizontal:{height:1,width:"100%"},vertical:{height:"100%",width:1,minHeight:"$3"}}}}),Gt=u.default.forwardRef(({orientation:e="horizontal",...t},o)=>u.default.createElement(Va,{ref:o,orientation:e,...t})),Mi=({css:e})=>a.createElement(Gt,{css:{width:"100%",...e}}),qa=l("a",{bg:"unset",border:"unset",p:"unset",color:"$primary",cursor:"pointer",fontFamily:"$body",textDecoration:"none","&:focus, &:hover":{color:"$primaryMid",textDecoration:"underline"},"&:active":{color:"$primaryDark"},[`${Vt} > &, ${Ht} > &, ${Oe} > &, ${Ha} > &`]:{fontSize:"100%",lineHeight:1,"&::before, &::after":{content:"none"}},variants:Xe}),ut=a.forwardRef(({size:e="md",href:t,...o},r)=>a.createElement(qa,{...!t&&{as:"button",noCapsize:!0},size:e,href:t,...o,ref:r}));ut.displayName="Link";const jt=({children:e,css:t})=>a.createElement(L,{size:"sm",css:{color:"$tonal300",maxWidth:"80ch",...t}},e),te=({css:e,children:t,error:o,fieldId:r,label:n,prompt:i,description:s,required:c,hideLabel:d})=>{const m=d?kt.Root:z;return a.createElement(w,{css:e},a.createElement(m,{css:{justifyContent:"space-between",alignItems:"center",mb:"$3"}},a.createElement(Be,{htmlFor:r,required:c},n),i&&a.createElement(ut,{href:i.link,size:"sm"},i.label)),s&&a.createElement(jt,{css:{mb:"$3"}},s),t,o&&a.createElement(dt,{css:{mt:"$2"}},o))};te.displayName="FieldWrapper";const Ai=l(Re.Item,{alignItems:"center",appearance:"none",backgroundColor:"transparent",border:"1px solid $tonal400",borderRadius:"$round",color:"white",cursor:"pointer",display:"flex",justifyContent:"center",p:0,size:"$1",transition:"all 50ms ease-out","&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},'&[data-state="checked"]':{backgroundColor:"$primary",borderColor:"$primary"},"&[disabled]":{backgroundColor:"$tonal100",borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"}}),Li=l(Re.Indicator,{size:"6px",borderRadius:"$round",backgroundColor:"currentcolor",position:"absolute"}),pt=e=>a.createElement(Ai,{...e},a.createElement(Li,null));pt.displayName="RadioButton";const Yt=l(Re.Root,{display:"flex",flexWrap:"wrap",variants:{direction:{row:{flexDirection:"row","& > *:not(:last-child)":{mr:"$5"}},column:{flexDirection:"column"}}}});Yt.displayName="RadioButtonGroup";const ht=({align:e="start",children:t,css:o,description:r,direction:n="row",error:i,label:s,required:c})=>a.createElement(w,{css:o},a.createElement(Be,{align:e,direction:n,required:c,type:"inline"},a.Children.map(t,d=>a.createElement(w,{css:{[n==="reverse"?"ml":"mr"]:"$3",...((d==null?void 0:d.type)===ct||(d==null?void 0:d.type)===pt)&&{transform:"translateY($space$1)"}}},d)),s),i&&a.createElement(dt,{css:{mt:"$2"}},i),r&&a.createElement(jt,{css:{mt:"$2",[n==="reverse"?"mr":"ml"]:"calc($space$3 + $sizes$1)"}},r));ht.displayName="InlineFieldWrapper";var _a=(e=>(e.LOCAL="local",e.SESSION="session",e))(_a||{});const Pi=l("form",{}),Wi=({persist:e,watch:t,setValue:o,children:r})=>{const{id:n,...i}=e;let s={...i,storage:i.storage===_a.LOCAL?window.localStorage:window.sessionStorage};if(i.exclude){const{exclude:c,...d}=s,m=t(),p=Object.keys(m).filter(h=>{var g;if(!((g=i.exclude)!=null&&g.includes(h)))return h});s={...d,include:p}}return Cr.default(n,{watch:t,setValue:o},s),r},Ga=({formMethods:e,handleSubmit:t,onSubmit:o,onError:r,children:n,...i})=>a.createElement(H.FormProvider,{...e},a.createElement(Pi,{"aria-label":"form",...i,onSubmit:t(o,r)},n)),ja=({children:e,defaultValues:t={},onSubmit:o,onError:r,validationMode:n="onBlur",render:i,persist:s,...c})=>{Te.default(!(e&&i),"`Form` should only be given one of `children` or `render`. When both are provided, `render` will be used and `children` will be ignored.");const d=H.useForm({defaultValues:t,mode:n}),{handleSubmit:m,watch:p,setValue:h}=d,g=i?i(d):e,f={formMethods:d,handleSubmit:m,onSubmit:o,onError:r,...c};return s?a.createElement(Wi,{persist:s,watch:p,setValue:h},a.createElement(Ga,{...f},g)):a.createElement(Ga,{...f},g)};ja.displayName="Form";const ie=e=>{var t;const{errors:o}=H.useFormContext(),r=e.split(/[,[\].]+?/).filter(Boolean);return{error:(t=(()=>Sr.default(o,r))())==null?void 0:t.message}};var Bi=(e=>(e.ON="on",e.OFF="off",e))(Bi||{});const Ya=({css:e,defaultChecked:t=!1,label:o,name:r,validation:n,description:i,...s})=>{const{control:c}=H.useFormContext(),{error:d}=ie(r);return a.createElement(H.Controller,{control:c,name:r,defaultValue:t,rules:n,render:({onChange:m,value:p,name:h})=>a.createElement(ht,{css:e,description:i,error:d,label:o,required:Boolean(n==null?void 0:n.required)},a.createElement(ct,{defaultChecked:t,defaultValue:t?"on":"off",checked:p,name:h,onCheckedChange:m,value:p?"on":"off",...d&&{state:"error"},...s}))})};Ya.displayName="CheckboxField";const Ua={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Oi=l("span",{display:"inline-flex",alignItems:"center",px:"$1",flexGrow:1,...Ua,"& > *:not(:last-child)":{mr:"$1"}}),Hi={sm:"sm",md:"sm",lg:"md"},Vi=l(b,{flexShrink:0}),Xa=({...e})=>{const t=a.useContext(Ja),{size:o}=t,r=a.useMemo(()=>qt(o,n=>Hi[n]),[o]);return a.createElement(Vi,{...e,size:r})},qi=({children:e,...t})=>{const o=a.Children.toArray(e),r=o.length<=1;return a.createElement(Oi,{...t},o.map(n=>!r&&typeof n=="string"?a.createElement(w,{as:"span",css:Ua,key:n},n):a.isValidElement(n)&&n.type===b?a.createElement(Xa,{...n.props}):n))},_i=l(z,{px:"$2",border:"1px solid",borderRadius:"$0",alignItems:"center",fontFamily:"$body",maxWidth:"100%",borderColor:"$primary",color:"$primaryMid",bg:"$primaryLight","&[data-disabled]":{opacity:"0.3",pointerEvents:"none"},variants:{size:{sm:{height:"$2",...Je({size:"sm"})},md:{height:"$3",...Je({size:"sm"})},lg:{height:"$4",...Je({size:"md"})}}}}),Ja=a.createContext({}),Gi=({size:e,children:t})=>{const o=a.useMemo(()=>({size:e}),[e]);return a.createElement(Ja.Provider,{value:o},t)},ji=a.forwardRef(({asWorkaround:e,size:t="md",...o},r)=>a.createElement(Gi,{size:t},a.createElement(_i,{ref:r,as:e,size:t,...o}))),de=ji;de.Content=qi,de.Icon=Xa,de.displayName="Chip";const Ut=a.forwardRef(({gap:e=2,...t},o)=>a.createElement(Le,{ref:o,direction:"row",gap:e,align:!1,...t})),Xt=a.createContext({isDismissed:!1,setIsDismissed:()=>null}),Yi=({children:e,disabled:t})=>{const[o,r]=a.useState(!1),n=a.useMemo(()=>({disabled:t,isDismissed:o,setIsDismissed:r}),[t,o]);return a.createElement(Xt.Provider,{value:n},e)},Ui=({asChild:e=!1,value:t,onDismiss:o,...r})=>{const n=a.useContext(Xt),{isDismissed:i,disabled:s}=n;if(a.useEffect(()=>{i&&(o==null||o(t))},[i]),i)return null;const c={...s&&{["data-disabled"]:""},...r};return a.createElement(e?Ct.Slot:"div",{...c})},Xi=({disabled:e=!1,...t})=>a.createElement(Yi,{disabled:e},a.createElement(Ui,{...t})),Ji=e=>a.createElement("button",{type:"button",...e},"Dismiss"),Ka=({asChild:e=!1,...t})=>{const o=a.useContext(Xt);if(o===void 0)throw new Error("Dismissible.Trigger can only be used within a Dismissible.Item");const{setIsDismissed:r,disabled:n}=o,i={disabled:n,onClick:()=>{r(!0)},...t};return a.createElement(e?Ct.Slot:Ji,{...i})},gt=Xi;gt.Trigger=Ka,gt.displayName="Dismissible";const Qa=a.createContext({onDismiss:()=>null}),Ki=({children:e,disabled:t,onDismiss:o})=>{const r=a.useMemo(()=>({disabled:t,onDismiss:o}),[t,o]);return a.createElement(Qa.Provider,{value:r},e)},Qi=({as:e="div",disabled:t,onDismiss:o,...r})=>a.createElement(Ki,{disabled:t,onDismiss:o},a.createElement(e,{...r})),Zi=({children:e,disabled:t=!1,...o})=>{const r=a.useContext(Qa);if(r===void 0)throw new Error("DismissibleGroup.Item can only be used within a DismissibleGroup");const{onDismiss:n,disabled:i}=r;return a.createElement(gt,{disabled:i||t,onDismiss:n,...o},e)},ye=Qi;ye.Item=Zi,ye.Trigger=Ka,ye.displayName="DismissibleGroup";const el=l(de,{px:"$1"}),tl=({size:e="md",children:t,dismissActionLabel:o="Dismiss",...r})=>a.createElement(ye.Item,{asChild:!0,...r},a.createElement(el,{size:e},a.createElement(de.Content,null,t),a.createElement(ye.Trigger,{asChild:!0},a.createElement(M,{label:o,css:{color:"$tonal200"},size:e==="sm"?"xs":"sm"},a.createElement(b,{is:v.Close}))))),al=a.forwardRef((e,t)=>a.createElement(Ut,{as:ye,ref:t,...e})),Jt=al;Jt.Item=tl,Jt.displayName="ChipDismissibleGroup";const Za=l(b,{display:"none"}),ol=l(de,{"&:not([disabled])":{cursor:"pointer","&:hover":{bg:"$tonal100",color:"$tonal600",borderColor:"currentColor"},"&:focus-visible":{...be()},'&[data-state="on"]':{"&:hover":{bg:"$white",color:"$primaryDark"}}},'&[data-state="off"]':{color:"$tonal400",bg:"$tonal50",borderColor:"$tonal200"},'&[data-state="on"]':{[`& ${Za}`]:{display:"block"}}}),rl=({size:e="md",children:t,...o})=>a.createElement(ot.Item,{...o,asChild:!0},a.createElement(ol,{asWorkaround:"button"},a.createElement(Za,{is:v.Ok,size:e==="lg"?"md":"sm"}),a.createElement(de.Content,null,t))),nl=a.forwardRef((e,t)=>a.createElement(Ut,{ref:t,as:ot.Root,orientation:"horizontal",...e})),Kt=nl;Kt.Item=rl,Kt.displayName="ChipToggleGroupItem";const il=l(De.ComboboxInput,{boxShadow:"none",fontSize:"$md",appearance:"none",backgroundImage:Sa(_.colors.tonal300.value,"chevron"),backgroundPosition:"right $space$3 top 50%, 0 0",backgroundRepeat:"no-repeat, repeat",backgroundSize:"20px auto, 100%",border:"1px solid $tonal300",borderRadius:"$0",boxSizing:"border-box",color:"$tonal600",cursor:"text",display:"block",fontFamily:"$body",height:"$4",pl:"$3",pr:"$6",transition:"all 100ms ease-out",width:"100%","&::placeholder":{color:"$tonal300",opacity:1},"&:focus-within":{borderColor:"$primary",outline:"none"},"&[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},variants:{state:{error:{border:"1px solid $danger"}}}}),ll=l(De.ComboboxList,{listStyle:"none",m:0,p:0,userSelect:"none"}),sl=l(De.ComboboxOption,{color:"$tonal500",cursor:"pointer",m:0,p:"$2",'&:hover, &[aria-selected="true"]':{bg:"$tonal50",borderRadius:"$0"},"[data-user-value]":{color:"$primary"}}),cl=l(De.ComboboxPopover,{bg:"white",border:"solid 1px $tonal100",borderRadius:"$0",boxShadow:"$1",boxSizing:"border-box",fontFamily:"$body",fontSize:"$md",outline:"none",p:"$1",transform:"translateY($space$2)"});Ca({":root":{"--reach-combobox":1}})();const dl=l(De.Combobox,{}),xe=e=>a.createElement(dl,{...e});xe.displayName="Combobox",xe.Option=sl,xe.Input=il,xe.Popover=cl,xe.List=ll,xe.OptionText=De.ComboboxOptionText;var X=(e=>(e.NONE="none",e.PENDING="pending",e.FULFILLED="fulfilled",e.REJECTED="rejected",e))(X||{});const ml=e=>{if(e[0])return e[0].desc?"desc":"asc"},ul=async(e,t,o,r,n)=>{var i,s,c,d,m,p;const{pageIndex:h,pageSize:g}=o,f={pageIndex:(i=t==null?void 0:t.pageIndex)!=null?i:h,pageSize:(s=t==null?void 0:t.pageSize)!=null?s:g,sortBy:(d=t==null?void 0:t.sortBy)!=null?d:(c=r[0])==null?void 0:c.id,sortDirection:(m=t==null?void 0:t.sortDirection)!=null?m:ml(r),globalFilter:(p=t.globalFilter)!=null?p:n},$=await e(f);return Te.default(Array.isArray($==null?void 0:$.results),"The getAsyncData function must return an object with a property `result` which must be an array"),Te.default($&&Number.isInteger($.total)&&$.total>=0,"The getAsyncData function must return an object with a property `total` which must be a positive integer or zero"),$},pl={pageIndex:0,pageSize:10},hl=e=>{const[t,o]=u.default.useState(!!e),[r,n]=u.default.useState({...pl,...e||{}}),i=u.default.useCallback(()=>{o(!0)},[]);return{isPaginated:t,paginationState:r,setPaginationState:n,applyPagination:i}},gl=e=>{const[t,o]=u.default.useState(!1),[r,n]=u.default.useState(e?[{id:e.column,desc:e.direction==="desc"}]:[]);return{isSortable:t,setIsSortable:o,sorting:r,setSorting:n}},eo=a.createContext(null),fl=({columns:e,data:t=[],getAsyncData:o,defaultSort:r,initialState:n=void 0,children:i})=>{var s;const[c,d]=a.useState({results:t!=null?t:[],total:(s=t==null?void 0:t.length)!=null?s:0}),{isPaginated:m,applyPagination:p,paginationState:h,setPaginationState:g}=hl(n==null?void 0:n.pagination),[f,$]=a.useState(X.NONE),[y,C]=a.useState(""),{setIsSortable:E,isSortable:T,sorting:x,setSorting:S}=gl(r),F=a.useCallback(async N=>{if(o)try{$(X.PENDING);const V=await ul(o,N,h,x,y);d(V),$(X.FULFILLED)}catch{$(X.REJECTED)}},[o,h==null?void 0:h.pageIndex,h==null?void 0:h.pageSize,x,y]);a.useEffect(()=>{F({})},[F]),kr.default(()=>{!t||d({results:t,total:t.length})},[t]);const A=()=>c.total,P=se.useReactTable({columns:e,data:c.results,pageCount:h?Math.ceil(A()/h.pageSize):-1,initialState:n,state:{sorting:x,globalFilter:y,pagination:h},manualPagination:o&&m,manualSorting:o&&m,enableSorting:f!==X.PENDING,enableGlobalFilter:!o,getCoreRowModel:se.getCoreRowModel(),getPaginationRowModel:m?se.getPaginationRowModel():void 0,getSortedRowModel:T||x.length?se.getSortedRowModel():void 0,getFilteredRowModel:se.getFilteredRowModel(),onPaginationChange:m?g:void 0,onSortingChange:S,onGlobalFilterChange:C}),R=a.useMemo(()=>({...P,data:c,setData:d,setIsSortable:E,applyPagination:p,getTotalRows:A,isSortable:T,asyncDataState:f,runAsyncData:F}),[P,p,A,T]);return a.createElement(eo.Provider,{value:R},i)},J=()=>{const e=a.useContext(eo);if(!e)throw new Error("useDataTable can only be called from inside a DataTableProvider");return e},ft=l("tr",{bg:"unset"}),to=a.forwardRef((e,t)=>a.createElement(ft,{...e,ref:t}));to.displayName="TableRow";const ao=(e,t,o)=>{const[r,n]=a.useState([]),[i,s]=a.useState({});return a.useEffect(()=>{let c=0;s(r.reduce((d,m,p)=>{var h,g;const f={...d,[`& ${t}:nth-of-type(${p+1})`]:{position:"sticky",left:c,zIndex:"2"}};return c+=(((g=(h=o==null?void 0:o.current)==null?void 0:h.querySelectorAll(t))==null?void 0:g.item(p).clientWidth)||0)+.3,f},{}))},[r,o,t]),a.useLayoutEffect(()=>{const c=()=>{var d;const m=[];(d=o==null?void 0:o.current)==null||d.querySelectorAll(t).forEach(p=>m.push(p)),n(m.slice(0,e))};c(),window.addEventListener("resize",c)},[o,e,t]),{columnsCss:i}},$l=l("tbody",{variants:{striped:{true:{[`${ft}`]:{"&:nth-child(odd)":{bg:"white"},"&:nth-child(even)":{bg:"$tonal50"}}},false:{[`${ft}`]:{bg:"white"}}}}}),oo=({striped:e=!0,numOfStickyColumns:t=0,css:o,...r})=>{const n=a.useRef(null),{columnsCss:i}=ao(t,"td",n);return a.createElement($l,{striped:e,ref:n,css:{...i,...o,"& td":{bg:"inherit"}},...r})};oo.displayName="TableBody";const He=l("td",{borderBottom:"1px solid $tonal100",boxSizing:"border-box",color:"$tonal400",fontFamily:"$body",lineHeight:1.5,p:"$2 $3",textAlign:"left",verticalAlign:"middle","&:first-child":{fontWeight:"bold"}});He.displayName="TableCell";const ro=l("tfoot",{});ro.displayName="TableFooter";const $t=l("td",{color:"$tonal400",fontFamily:"$body",fontWeight:600,p:"$2 $3",textAlign:"left",verticalAlign:"middle"});$t.displayName="TableFooterCell";const me=l("th",{color:"white",fontFamily:"$body",fontWeight:600,lineHeight:1.5,p:"$2 $3",textAlign:"left",verticalAlign:"middle"});me.displayName="TableHeaderCell";const Qt={PRIMARY:"primary",PRIMARY_DARK:"primaryDark",LIGHT:"light"},bl=l("thead",{variants:{theme:{[Qt.PRIMARY]:{[`${me}`]:{bg:"$primary"}},[Qt.PRIMARY_DARK]:{[`${me}`]:{bg:"$primaryDark"}},[Qt.LIGHT]:{[`${me}`]:{bg:"$tonal50",color:"$tonal600"}}}}}),no=({theme:e="primaryDark",numOfStickyColumns:t=0,css:o,...r})=>{const n=u.default.useRef(null),{columnsCss:i}=ao(t,"th",n);return u.default.createElement(bl,{theme:e,ref:n,css:{...i,...o},...r})};no.displayName="TableHeader";const io=({children:e,numOfStickyColumns:t=0,css:o,...r})=>{const[n,i]=u.default.useState(!1);return u.default.createElement(w,{onScroll:s=>{i(s.currentTarget.scrollLeft>0)},role:"scrollbar",css:{overflow:"auto",maxWidth:"100%",...n&&{[`& th,td:nth-of-type(${t})`]:{boxShadow:"$colors$alpha200 -2px -3px 9px 1px",clipPath:"inset(0px -10px 0px 0px)"}},...o},...r},e)},vl=l("table",{borderCollapse:"separate",borderSpacing:0,fontFamily:"$sans",fontSize:"$sm",width:"100%",variants:{size:{md:{[`${He}, ${me}, ${$t}`]:{height:"$4"}},lg:{[`${He}, ${me}, ${$t}`]:{height:"$5"}}},corners:{round:{[`${me}`]:{"&:first-of-type":{borderTopLeftRadius:"$0"},"&:last-of-type":{borderTopRightRadius:"$0"}},[`${ft}:last-child`]:{[`${He}:first-child`]:{borderBottomLeftRadius:"$0"},[`${He}:last-child`]:{borderBottomRightRadius:"$0"}}},square:{}}}}),I=({size:e="md",corners:t="round",numOfStickyColumns:o=0,...r})=>{const n=a.createElement(vl,{size:e,corners:t,...r});return o?a.createElement(io,{numOfStickyColumns:o},n):n};I.Body=oo,I.Cell=He,I.Footer=ro,I.FooterCell=$t,I.Header=no,I.HeaderCell=me,I.Row=to,I.StickyColumnsContainer=io,I.displayName="Table";const yl=({striped:e=!1,...t})=>{const{getRowModel:o}=J();return a.createElement(I.Body,{...t,striped:e},o().rows.map(r=>a.createElement(W.Row,{row:r,key:r.id})))},Zt=({cell:e})=>a.createElement(I.Cell,{key:e.id},se.flexRender(e.column.columnDef.cell,e.getContext())),xl=({children:e})=>{const{asyncDataState:t,runAsyncData:o}=J();return t!==X.REJECTED?null:e(o)},wl=({children:e,hidden:t=!1})=>t?a.createElement(kt.Root,null,e):e?a.createElement(a.Fragment,null,e):null,lo=l("input",{appearance:"none",border:"1px solid $tonal400",borderRadius:"$0",boxShadow:"none",boxSizing:"border-box",color:"$tonal600",cursor:"text",display:"block",fontFamily:"$body",px:"$3",transition:"all 100ms ease-out",width:"100%","&:focus":{borderColor:"$primary",outline:"none"},"&[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&::placeholder":{color:"$tonal300",opacity:1},variants:{size:{sm:{height:"$3",fontSize:"$sm"},md:{height:"$4",fontSize:"$md"}},state:{error:{border:"1px solid $danger"}}}}),we=a.forwardRef(({type:e="text",size:t="md",...o},r)=>e==="number"?a.createElement(lo,{type:"text",inputMode:"numeric",pattern:"[0-9]*",size:t,...o,ref:r}):a.createElement(lo,{type:e,size:t,...o,ref:r}));we.displayName="Input";const El=()=>{const e=a.useRef(null),t=a.useCallback(o=>{o&&(e.current=o)},[]);return[e,t]},Cl=()=>{const[e,t]=a.useState(null),o=a.useCallback(r=>{r&&t(r)},[]);return[e,o]};var Sl=(e=>(e.SEARCH="SEARCH",e.CLEAR="CLEAR",e))(Sl||{});const kl=l(b,{color:"$tonal300",position:"absolute",pointerEvents:"none",variants:{size:{sm:{top:"$2",right:"$2",size:"$1"},md:{top:10,right:10,size:20}}}}),Dl=l(we,{'&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, & input[type="search"]::-webkit-search-results-decoration':{display:"none"}}),bt=a.forwardRef(({size:e="md",css:t,value:o,clearText:r="Clear",onChange:n,...i},s)=>{const[c,d]=El(),[m,p]=a.useState(o||""),[h,g]=a.useState(o?"CLEAR":"SEARCH");a.useImperativeHandle(s,()=>c.current);const f=()=>{var C,E;const T=c.current;if(!T)return;const x=(C=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:C.set;(E=x==null?void 0:x.call)==null||E.call(x,T,"");const S=new Event("input",{bubbles:!0});T.dispatchEvent(S),T.focus()},$=C=>{p(C.target.value),g(C.target.value?"CLEAR":"SEARCH"),n==null||n(C)},y=()=>h==="SEARCH"?a.createElement(kl,{is:v.Search,size:e,css:{size:e=="sm"?"$1":20}}):a.createElement(M,{label:r,theme:"neutral",size:e,css:{position:"absolute",top:"0",right:"$1"},onClick:f},a.createElement(b,{is:v.Close}));return a.createElement(w,{css:{position:"relative",...t}},a.createElement(Dl,{ref:d,size:e,type:"search",...i,value:m,onChange:$,css:{pr:e==="sm"?"$5":"$6"}}),y())});bt.displayName="SearchInput";const zl=({onChange:e,label:t,hideLabel:o=!1,...r})=>{const{setGlobalFilter:n,getState:i,resetPagination:s}=J(),{globalFilter:c}=i(),d=et.debounce(250,m=>{const{target:{value:p}}=m;e==null||e(m),s(),n(p)});return a.createElement(a.Fragment,null,a.createElement(wl,{hidden:o},a.createElement(Be,{css:{mb:"$3"},htmlFor:t},t)),a.createElement(bt,{...r,value:c,onChange:d,name:t}))},Il=({sortable:e=!0,theme:t="light",...o})=>{const{getHeaderGroups:r,setIsSortable:n}=J();return a.useEffect(()=>{n(e)},[e,n]),a.createElement(I.Header,{theme:t,...o},r().map(i=>a.createElement(I.Row,{key:i.id},i.headers.map(s=>a.createElement(W.HeaderCell,{header:s,key:s.id})))))},Tl={asc:v.SortUp,desc:v.SortDown},Rl=({direction:e})=>a.createElement(b,{is:Tl[e],size:"sm",css:{position:"absolute",left:"$1"}}),Fl=({header:e,children:t,css:o,...r})=>{const n=e.column.getIsSorted(),{isSortable:i}=J(),s=e.column.getCanSort();return a.createElement(I.HeaderCell,{onClick:i&&s?e.column.getToggleSortingHandler():void 0,css:{cursor:i&&s?"pointer":"initial",...o},...r},a.createElement(z,{css:{alignItems:"center"}},se.flexRender(e.column.columnDef.header,e.getContext()),n&&i&&a.createElement(z,{css:{position:"relative",alignItems:"center"}},a.createElement(Rl,{direction:n}))))},Nl=l(lt,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:1}),ea=e=>{const{asyncDataState:t}=J();return t!==X.PENDING?null:a.createElement(Nl,{...e})},Ml=({row:e})=>a.createElement(I.Row,null,e.getVisibleCells().map((t,o)=>a.createElement(Zt,{key:t.id,cell:t}))),Al=({sortable:e,striped:t,theme:o,css:r,numOfStickyColumns:n=0,...i})=>{const{asyncDataState:s}=J(),c=s===X.PENDING;return a.createElement(a.Fragment,null,a.createElement(ea,null),a.createElement(I,{...i,numOfStickyColumns:n,css:{...r,...c&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},a.createElement(W.Head,{theme:o,sortable:e,numOfStickyColumns:n}),a.createElement(W.Body,{striped:t,numOfStickyColumns:n})))},so=a.createContext({idColumn:"id"}),Ll=()=>{const e=a.useContext(so);if(!e)throw new Error("useDragAndDropTable can only be called within a DragAndDropContainer");return e},Pl=(e,t,o,r,n)=>{const{active:i,over:s}=e,c=o.indexOf(i.id),d=o.indexOf(s==null?void 0:s.id),m=qe.arrayMove(t.results,c,d);return n==null||n(c,d,m),{results:m,total:m.length}},Wl=(e,t)=>e.results.map(o=>{const r=o[t];if(r===void 0)throw new Error("To ensure drag-and-drop works correctly, please ensure that each row has a unique ID. Use the `id` property or pass DataTable an `idColumn` prop that defines the ID property on the rows.");return r}),Bl=({idColumn:e="id",onChange:t=void 0,children:o})=>{const{data:r,setData:n}=J(),i=a.useMemo(()=>Wl(r,e),[r]),s=fe.useSensors(fe.useSensor(fe.PointerSensor),fe.useSensor(fe.KeyboardSensor,{coordinateGetter:qe.sortableKeyboardCoordinates}));return a.createElement(fe.DndContext,{sensors:s,collisionDetection:fe.closestCenter,onDragEnd:c=>{const{active:d,over:m}=c;d.id&&(m==null?void 0:m.id)&&d.id!==(m==null?void 0:m.id)&&n(p=>Pl({active:d,over:m},p,i,e,t))},modifiers:[mr.restrictToVerticalAxis]},a.createElement(qe.SortableContext,{items:i,strategy:qe.verticalListSortingStrategy},a.createElement(so.Provider,{value:{idColumn:e}},o)))},Ol=({row:e})=>{const{idColumn:t}=Ll(),{attributes:o,listeners:r,transform:n,setNodeRef:i,isDragging:s}=qe.useSortable({id:e.original[t]});return a.createElement(I.Row,{ref:i,css:{transform:ur.CSS.Transform.toString(n),zIndex:s?5:void 0}},e.getVisibleCells().map((c,d)=>d===0?a.createElement(I.Cell,{key:c.id},a.createElement(Vl,{...o,...r,isDragging:s,css:{display:"inline-block"},label:"drag and drop"}),se.flexRender(c.column.columnDef.cell,c.getContext())):a.createElement(Zt,{key:c.id,cell:c})))},Hl=l(M,{color:"inherit !important",fill:"currentColor",variants:{isDragging:{true:{cursor:"grabbing"},false:{cursor:"grab"}}}}),Vl=a.forwardRef(({isDragging:e,size:t,...o},r)=>a.createElement(Hl,{ref:r,isDragging:e,appearance:"simple",size:t,...o},a.createElement(b,{is:v.DragHandle,size:t}))),ql=({striped:e=!1,...t})=>{const{getRowModel:o}=J();return a.createElement(I.Body,{...t,striped:e},o().rows.map(r=>a.createElement(Ol,{row:r,key:r.id})))},_l=({idColumn:e,onDragAndDrop:t,sortable:o,striped:r,theme:n,css:i,...s})=>{const{asyncDataState:c}=J(),d=c===X.PENDING;return a.createElement(Bl,{onChange:t,idColumn:e},a.createElement(ea,null),a.createElement(I,{...s,css:{...i,...d&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},a.createElement(W.Head,{theme:n,sortable:o}),a.createElement(ql,{striped:r})))},Gl=l("select",{appearance:"none",backgroundColor:"white",backgroundImage:Sa(_.colors.tonal300.value,"chevron"),backgroundRepeat:"no-repeat, repeat",border:"1px solid $tonal300",borderRadius:"$0",color:"$tonal600",display:"block",fontFamily:"$body",fontWeight:400,lineHeight:1.4,transition:"all 75ms ease-out",width:"100%","&:hover":{cursor:"pointer"},"&:focus":{borderColor:"$primary",outline:"none"},"&::-ms-expand":{display:"none"},"&[disabled], > option[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},variants:{size:{sm:{backgroundPosition:"right $space$2 top 50%, 0 0",backgroundSize:"18px auto, 100%",fontSize:"$sm",height:"$3",pl:"$2",pr:"$5"},md:{backgroundPosition:"right $space$3 top 50%, 0 0",backgroundSize:"20px auto, 100%",fontSize:"$md",height:"$4",pl:"$3",pr:"$6"}},state:{error:{border:"1px solid $danger"}}}}),vt=a.forwardRef(({placeholder:e,children:t,size:o="md",...r},n)=>{const i={size:o,ref:n,...r};return[r.value,r.defaultValue].every(s=>s===void 0)&&(i.defaultValue=""),a.createElement(Gl,{...i},e&&a.createElement("option",{disabled:!0,hidden:!0,value:""},e),t)});vt.displayName="Select";const jl=l(ze.Content,{backgroundColor:"$tonal500",borderRadius:"$0",boxShadow:"$0",color:"white",fontFamily:"$body",fontSize:"$sm",lineHeight:1.5,whiteSpace:"normal",px:"$3",py:"$2",zIndex:zn,"@allowMotion":{animationDuration:"75ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="delayed-open"]':{'&[data-side="top"]':{animationName:Ft},'&[data-side="right"]':{animationName:Nt},'&[data-side="bottom"]':{animationName:Tt},'&[data-side="left"]':{animationName:Rt}}},variants:{size:{sm:{maxWidth:"100px"},md:{maxWidth:"250px"},lg:{maxWidth:"400px"}}}}),Yl=l(ze.Arrow,{fill:"$tonal500",'[data-align="end"] &':{mr:"$2"},'[data-align="start"] &':{ml:"$2"}}),Ul=({children:e,side:t="top",sideOffset:o=4,size:r="md",...n})=>a.createElement(jl,{side:t,sideOffset:o,size:r,...n},e,a.createElement(Yl,null)),K=({children:e,delayDuration:t=350,...o})=>a.createElement(ze.Root,{delayDuration:t,...o},e);K.Content=Ul,K.Trigger=l(ze.Trigger,{}),K.Portal=ze.Portal,K.Provider=ze.Provider,K.displayName="Tooltip";const co=({direction:e,...t})=>{const o=e==="next";return u.default.createElement(Jl,{appearance:"outline",icon:o?v.ChevronRight:v.ChevronLeft,isRounded:!0,label:o?"Next page":"Previous page",name:o?"Next page":"Previous page",size:"md",...t})},Xl=({gotoPage:e,pageCount:t,pageIndex:o,disabled:r})=>u.default.createElement(z,{css:{alignItems:"center"}},u.default.createElement(vt,{value:o,size:"sm",css:{mr:"$3"},disabled:r,onChange:n=>{e(Number(n.target.value))}},Array.from({length:t},(n,i)=>i).map(n=>u.default.createElement("option",{key:n,value:n},n+1))),u.default.createElement(L,{size:"sm",css:{flex:"none"}},`of ${t} ${t>1?"pages":"page"}`)),Jl=({icon:e,label:t,...o})=>u.default.createElement(K,null,u.default.createElement(K.Trigger,{asChild:!0},u.default.createElement(M,{label:t,...o},u.default.createElement(b,{is:e}))),u.default.createElement(K.Content,null,t)),Kl=l("nav",{display:"flex",justifyContent:"space-between",alignItems:"center",fontVariantNumeric:"tabular-nums"}),Ql=e=>{const{applyPagination:t,getState:o,getRowModel:r,getPageCount:n,previousPage:i,nextPage:s,setPageIndex:c,getTotalRows:d,asyncDataState:m}=J();a.useEffect(()=>{t()},[t]);const{pagination:p}=o(),h=p.pageIndex*p.pageSize+1,g=h+r().rows.length-1,f=m===X.PENDING||m===X.REJECTED;return a.createElement(Kl,{...e},a.createElement(L,{size:"sm"},`${h.toString()} - ${g.toString()} of ${d()} items`),a.createElement(Xl,{gotoPage:c,pageCount:n(),pageIndex:p.pageIndex,disabled:f}),a.createElement(z,{css:{justifyContent:"flex-end"}},a.createElement(co,{direction:"previous",disabled:p.pageIndex===0||f,onClick:i,css:{mr:"$4"}}),a.createElement(co,{direction:"next",disabled:p.pageIndex===n()-1||f,onClick:s})))},W=e=>a.createElement(fl,{...e});W.Body=yl,W.DataCell=Zt,W.DragAndDropTable=_l,W.Head=Il,W.HeaderCell=Fl,W.Pagination=Ql,W.Row=Ml,W.GlobalFilter=zl,W.Table=Al,W.Loading=ea,W.Error=xl;const Zl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],es=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mo={open:"Open calendar",next:"Next month",previous:"Previous month",nextYear:"Next year",previousYear:"Previous year"},ts=l("button",{bg:"transparent",border:"none",borderRadius:"$round",color:"$tonal900",cursor:"pointer",fontFamily:"$body",fontSize:"$sm",size:"$3",p:0,transition:"all 75ms","&:hover":{bg:"$tonal100"},"&:active":{color:"white",bg:"$primary"},"&:focus":{outline:"2px solid $primary",outlineOffset:"2px"},variants:{isSelected:{true:{bg:"$primary",color:"white","&:hover":{bg:"$primary"}}},isToday:{true:{bg:"$tonal100"}},isOutsideMonth:{true:{color:"$tonal200"}}}}),ta=l("div",{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gridGap:"$1 $2"}),as=l(ne,{color:"$tonal600",p:"$3",width:"$6",variants:{selected:{false:{color:"$tonal600 !important",fontWeight:"400","&:hover":{bg:"$tonal100 !important",color:"$tonal600 !important"},"&[disabled]":{bg:"white !important"}}}}}),os=(e,t)=>{const o=e.slice(0,t);return e.slice(t).concat(o)},uo=({css:e,refDateSelected:t,refDateToday:o,firstDayOfWeek:r=0,monthNames:n=Zl,weekdayNames:i=es,labels:s=mo,date:c=new Date,minDate:d,maxDate:m,setYear:p,...h})=>{const[g,f]=a.useState(!1),[$,y]=a.useState(c==null?void 0:c.getFullYear()),C=R=>{const N=c;N.setFullYear(R),p(N),f(!1)},E=d&&$-16<=d.getFullYear(),T=m&&$>=m.getFullYear(),x=Array.from({length:16},(R,N)=>{const V=$-N;return m&&V>m.getFullYear()||d&&V<d.getFullYear()?0:V}),{calendars:S,getBackProps:F,getForwardProps:A,getDateProps:P}=pr.useDayzed({firstDayOfWeek:r,showOutsideDays:!0,date:c,minDate:d,maxDate:m,...h});return S.length?a.createElement(w,{css:{position:"relative",width:"min-content",mt:"-$1",...e}},a.createElement(z,{css:{position:"absolute",top:0,right:"-$1"}},a.createElement(M,{label:s[g?"previousYear":"previous"],theme:"neutral",size:"md",...!g&&F({calendars:S}),...g&&{onClick:()=>y($-16)},disabled:g&&E},a.createElement(b,{is:v.ChevronLeft})),a.createElement(M,{label:s[g?"nextYear":"next"],theme:"neutral",size:"md",...!g&&A({calendars:S}),...g&&{onClick:()=>y($+16)},disabled:g&&T},a.createElement(b,{is:v.ChevronRight}))),g&&a.createElement(ta,{css:{gridTemplateColumns:"repeat(4, 1fr)",pt:"$7",direction:"rtl",gridGap:"$3 $1"}},x.map((R,N)=>{const V=R===c.getFullYear();return R?a.createElement(as,{key:`${R}${N}`,theme:V?"primary":"neutral",onClick:()=>C(R),selected:V},R):a.createElement(w,{key:N,css:{width:"$6",height:"$4"}})})),!g&&S.map(({month:R,year:N,weeks:V})=>a.createElement(w,{key:`${R}${N}`},a.createElement(z,{css:{height:"$4",alignItems:"center",mb:"$4"}},a.createElement(ne,{theme:"neutral",css:{px:"0",color:"$tonal600"},onClick:()=>f(!0)},n[R]," ",N)),a.createElement(ta,{css:{mb:"$3"}},os(i,r).map(ke=>a.createElement(L,{as:"span",size:"sm",key:`${R}${N}${ke}`,css:{fontWeight:600,textAlign:"center"}},ke))),a.createElement(ta,null,V.map((ke,Et)=>ke.map((k,j)=>{const Ve=`${R}${N}${Et}${j}`;if(!k)return a.createElement("div",{key:Ve});const{date:Qo,selected:ba,today:va,prevMonth:Zo,nextMonth:er}=k;return a.createElement(ts,{isOutsideMonth:Zo||er,isSelected:ba,isToday:va,key:Ve,ref:ba?t:va?o:null,...P({dateObj:k}),type:"button"},Qo.getDate())})))))):null};uo.displayName="Calendar";const rs=l($e.Content,{bg:"white",borderRadius:"$1",boxShadow:"$2",maxWidth:"90vw",p:"$sizes$2",pr:"$6",position:"relative",zIndex:In,"@allowMotion":{animationDuration:"75ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="open"]':{'&[data-side="top"]':{animationName:Ft},'&[data-side="right"]':{animationName:Nt},'&[data-side="bottom"]':{animationName:Tt},'&[data-side="left"]':{animationName:Rt}}},variants:{size:{sm:{maxWidth:"200px"},md:{maxWidth:"400px"},lg:{maxWidth:"600px"}}}}),ns=l($e.Arrow,{fill:"white",zIndex:1,'[data-align="end"] &':{mr:"$sizes$2"},'[data-align="start"] &':{ml:"$sizes$2"}}),is=({children:e,side:t="top",sideOffset:o=8,closePopoverText:r="Close popover",showCloseButton:n=!0,size:i="md",...s})=>a.createElement(rs,{size:i,side:t,sideOffset:o,...s},n&&a.createElement(M,{as:$e.Close,css:{position:"absolute",right:"$0",top:"$0"},label:r,size:"md",theme:"neutral"},a.createElement(b,{is:v.Close})),e,a.createElement(ns,{width:16,height:8}));l($e.Root,{});const le=e=>a.createElement($e.Root,{...e});le.Content=is,le.Portal=$e.Portal,le.Trigger=$e.Trigger,le.displayName="Popover";const po="DD/MM/YYYY";_e.default.extend(Dr.default);const ls=(e,t=po)=>{const[o,r]=Y.useState(e?_e.default(e).toDate():void 0),[n,i]=Y.useState(e?_e.default(e).format(t):"");return{dateString:n,date:o,setDate:(s,c=!1)=>{const d=c?_e.default(s,t,!0):_e.default(s);r(d.isValid()?d.toDate():void 0),i(c?s:d.format(t))}}},aa=a.forwardRef(({initialDate:e,dateFormat:t=po,firstDayOfWeek:o=1,disabled:r,monthNames:n,weekdayNames:i,size:s="md",labels:c,revalidate:d,onChange:m,minDate:p,maxDate:h,...g},f)=>{const{date:$,dateString:y,setDate:C}=ls(e,t),E={...mo,...c},[T,x]=a.useState(!1),S=a.useRef(null),F=a.useRef(null);return a.useEffect(()=>{m==null||m($)},[$,m]),a.createElement(w,{css:{position:"relative"}},a.createElement(we,{name:"date",disabled:r,size:s,...g,onChange:A=>C(A.target.value,!0),value:y,ref:f}),a.createElement(le,{modal:!0,open:T,onOpenChange:x},a.createElement(le.Trigger,{asChild:!0},a.createElement(M,{css:{position:"absolute",top:"0",right:"0"},disabled:r,label:E.open,size:s,theme:"neutral"},a.createElement(b,{is:v.CalendarEvent}))),a.createElement(le.Portal,null,a.createElement(le.Content,{css:{pr:"$sizes$2",zIndex:Ue},side:"bottom",align:"end",showCloseButton:!1,onOpenAutoFocus:A=>{var P,R;A.preventDefault(),$?(P=F.current)==null||P.focus():(R=S.current)==null||R.focus()}},a.createElement(uo,{date:$||new Date,selected:$,onDateSelected:async A=>{x(!1),await C(A.date,!1),d&&d()},setYear:async A=>{await C(A,!1),d&&d()},minDate:p,maxDate:h,refDateToday:S,refDateSelected:F,firstDayOfWeek:o,monthNames:n,weekdayNames:i,labels:E})))))});aa.displayName="DateInput";const ho=({css:e,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c,trigger:d}=H.useFormContext(),{error:m}=ie(o),p=r?c(r):c;return a.createElement(te,{css:e,description:i,error:m,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(aa,{id:o,name:o,ref:p,...m&&{state:"error"},...s,revalidate:d}))};ho.displayName="DateField";const oa=l(w,{width:"100vw",height:"100vh"}),ss=l(q.Close,{}),ra="translate3d(-50%, -50%, 0)",go="translate3d(-50%, 50vh, 0)",fo="modal_overlay",cs=D({"0%":{transform:go},"100%":{transform:ra}}),ds=D({"0%":{transform:ra},"100%":{transform:go}}),ms=l(q.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",overflowY:"auto",zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${Mt} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),us=l(q.Content,{bg:"white",borderRadius:"$1",boxShadow:"$3",boxSizing:"border-box",left:"50%",maxWidth:"90vw",maxHeight:"90vh",overflowY:"auto",p:"$5",position:"fixed",top:"50%",transform:ra,zIndex:Ue,"&:focus":{outline:"none"},"@allowMotion":{'&[data-state="open"]':{animation:`${cs} 550ms cubic-bezier(0.22, 1, 0.36, 1)`},'&[data-state="closed"]':{animation:`${ds} 550ms cubic-bezier(0.22, 1, 0.36, 1)`}},variants:{size:{xs:{width:"380px"},sm:{width:"480px"},md:{width:"600px"},lg:{width:"800px"},xl:{width:"1100px"}}}}),ps=({size:e="sm",children:t,closeDialogText:o="Close dialog",showCloseButton:r=!0,...n})=>a.createElement(q.Portal,null,a.createElement(ms,{id:fo},a.Children.map(t,i=>(i==null?void 0:i.type)===oa&&i),a.createElement(us,{size:e,"aria-label":"Dialog",onPointerDownOutside:i=>{const s=i.target;(s==null?void 0:s.id)!==fo&&i.preventDefault()},...n},r&&a.createElement(M,{as:q.Close,css:{position:"absolute",right:"$4",top:"$4"},label:o,size:"md",theme:"neutral"},a.createElement(b,{is:v.Close})),a.Children.map(t,i=>(i==null?void 0:i.type)!==oa&&i)))),hs=l(q.Root,{}),ue=e=>a.createElement(hs,{...e});ue.Background=oa,ue.Close=ss,ue.Content=ps,ue.Description=q.Description,ue.Title=q.Title,ue.Trigger=q.Trigger,ue.displayName="Dialog";const gs=l(Ie.Content,{bg:"white",borderRadius:"$0",boxShadow:"$0",py:"$2",zIndex:Dn,"@allowMotion":{animationDuration:"250ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="open"]':{'&[data-side="top"]':{animationName:Ft},'&[data-side="right"]':{animationName:Nt},'&[data-side="bottom"]':{animationName:Tt},'&[data-side="left"]':{animationName:Rt}}}}),fs={alignItems:"center",color:"$tonal600",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:400,position:"relative",px:"$3",py:"$2","&[data-disabled]":{color:"$tonal200",pointerEvents:"none"},'&[aria-current="page"], &:focus':{"&::before":{borderLeft:"2px solid currentColor",content:"",height:"$2",left:0,outline:"none",position:"absolute",transform:"scale(1)"}},"&:focus":{color:"$primaryMid",outline:"none"},"&:hover":{textDecoration:"underline"}},$o=l(Ie.Item,fs),$s=l("a",{textDecoration:"none"}),bs=({children:e,href:t,...o})=>u.default.createElement($o,{...o,asChild:!0},u.default.createElement($s,{href:t,role:"menuitem"},e)),vs=l(Ie.Separator,{height:"1px",backgroundColor:"$tonal200",my:"$2"}),ys=l(Ie.Trigger,{}),xs=l(Ie.Root,{}),Ee=e=>u.default.createElement(xs,{...e});Ee.Content=gs,Ee.Item=$o,Ee.LinkItem=bs,Ee.Portal=Ie.Portal,Ee.Separator=vs,Ee.Trigger=ys;const bo=l(L,{color:"$tonal400",fontWeight:"400",variants:{size:{xs:{fontSize:"$sm",mb:"$4"},sm:{fontSize:"$sm",mb:"$4"},md:{fontSize:"$sm",mb:"$4"},lg:{fontSize:"$md",mb:"calc($4 + $2)"},xl:{fontSize:"$md",mb:"calc($4 + $2)"}}}}),ws=l(Pe,{variants:{size:{xs:{maxWidth:"56px",maxHeight:"32px",mb:"$4"},sm:{maxWidth:"84px",maxHeight:"48px",mb:"$4"},md:{maxWidth:"126px",maxHeight:"72px",mb:"$4"},lg:{maxWidth:"190px",maxHeight:"142px",mb:"calc($4 + $2)"},xl:{maxWidth:"285px",maxHeight:"213px",mb:"calc($4 + $2)"}}}}),vo=e=>u.default.createElement(ws,{...e}),yo=l("h2",{color:"$tonal400",fontFamily:"$body",fontWeight:"600",m:0,variants:{size:{xs:{fontSize:"$md",mb:"$3"},sm:{fontSize:"$md",mb:"$3"},md:{fontSize:"$md",mb:"$3"},lg:{fontSize:"$lg",mb:"$4"},xl:{fontSize:"$lg",mb:"$4"}}}}),Es=l(z,{flexDirection:"column",alignItems:"center",textAlign:"center","& > *:last-child":{mb:0},variants:{size:{xs:{p:"$2"},sm:{p:"$3"},md:{p:"$4"},lg:{p:"$5"},xl:{p:"$6"}}}}),Ke=({size:e="sm",children:t,...o})=>a.createElement(Es,{size:e,...o},a.Children.map(t,r=>a.isValidElement(r)&&(r.type===vo||r.type===yo||r.type===bo)?a.cloneElement(r,{...r.props,size:e}):r));Ke.displayName="EmptyState",Ke.Image=vo,Ke.Title=yo,Ke.Body=bo;const xo=({accept:e,children:t,multiple:o=!1,onFileSelect:r,...n})=>{const i=s=>{const{files:c}=s.target;r(c)};return a.createElement(ne,{as:"label",...n},a.createElement(b,{is:v.Upload}),t,a.createElement("input",{type:"file",onChange:i,accept:e,multiple:o,hidden:!0}))};xo.displayName="FileInput";const Cs=l("div",{display:"grid",variants:{gap:It("space",{gap:"$key"})}}),wo=({css:e,gap:t=2,minItemSize:o,maxItemSize:r="1fr",...n})=>a.createElement(Cs,{css:{...o&&{gridTemplateColumns:`repeat(auto-fit, minmax(${o}, ${r}))`},...e},gap:t,...n});wo.displayName="Grid";const Eo=({css:e,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return a.createElement(te,{css:e,description:i,error:d,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(we,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Eo.displayName="InputField";const Ss=l("div",{"& > *":{"&:not(:first-child)":{mt:"$5"},"&:not(:last-child)":{mb:"$5"}},[`& > ${Ht}`]:{maxWidth:"65ch"},[`& > ${Vt}`]:{maxWidth:"75ch"},[`& > ${Oa}`]:{maxWidth:"75ch"},[`& > ${Va}`]:{my:"$5"},[`& > ${Ma}`]:{display:"block","&:not(:first-child)":{mt:"$6"},"&:not(:last-child)":{mb:"$6"}}}),na=a.forwardRef((e,t)=>a.createElement(Ss,{ref:t,...e}));na.displayName="StackContent";const ks={code:yi,emphasis:xi,heading:Ei,inlineCode:Si,image:ki,link:Di,list:zi,listItem:Ii,paragraph:Ti,strong:Fi,text:Ni,thematicBreak:Mi},Ds=e=>{var t,o;if((t=e.position)!=null&&t.start){const{line:r,column:n,offset:i}=(o=e.position)==null?void 0:o.start;return`${e.type}${r}${n}${i}`}return`${e.type}${+new Date}`},Co=({content:e,customComponents:t={},css:o})=>{const r=Tr.default(e,{extensions:[Rr.default()],mdastExtensions:[Ir.default.fromMarkdown]}),n={...ks,...t},i=s=>{const c=n[s.type];return c?a.createElement(c,{key:Ds(s),node:s,handleNode:i}):null};return a.createElement(na,{css:o},r.children.map(i))};Co.displayName="MarkdownContent";const So=u.default.createContext(void 0),zs=()=>{const e=u.default.useContext(So);if(e===void 0)throw new Error("useNavigationMenuContext must be used within a NavigationMenuContextProvider");return e},yt=e=>{e.preventDefault()},Is=l("ul",{listStyle:"none",m:0,p:0}),Ts=l(ce.Content,{p:"$3",bg:"white",mt:"4px",boxShadow:"$1",borderRadius:"$1"}),ia=({children:e})=>u.default.createElement(Ts,{onPointerMove:yt,onPointerLeave:yt},u.default.createElement(Is,null,e));ia.displayName="NavigationMenuDropdownContent";const ko={background:"none",color:"$tonal400",opacity:"30%",cursor:"default"},la={all:"unset",position:"relative",color:"$tonal400",outline:"none",cursor:"pointer",fontFamily:"$body",userSelect:"none",padding:"$3",borderRadius:"$1","&:hover":{background:"$tonal50",color:"$tonal600"},"&:active":{background:"$tonal100",color:"$tonal600"},"&:focus-visible":{boxShadow:"inset 0 0 0 2px $colors$primary"},"&:disabled":{...ko}},Do={fontWeight:"600",color:"$tonal500","&::after":{backgroundColor:"$tonal500",borderRadius:"$1",bottom:0,content:"",display:"block",height:"2px",left:"50%",position:"absolute",transform:"translate(-50%,0)",width:"$2"}},Rs=l(ce.Trigger,la,{display:"flex",alignItems:"center",borderRadius:"$1",justifyContent:"space-between",'&[data-state="open"]':{background:"$tonal100"},variants:{active:{true:{...Do}}}}),sa=u.default.forwardRef(({children:e,active:t,...o},r)=>u.default.createElement(Rs,{active:t,...o,ref:r,onPointerMove:yt,onPointerLeave:yt},e,u.default.createElement(b,{is:v.ChevronDown,css:{ml:"$1","[data-state=open] &":{transform:"rotate(-180deg)"},"@media (prefers-reduced-motion: no-preference)":{transition:"transform .2s ease"}},size:"sm"})));sa.displayName="NavigationMenuDropdownTrigger";const zo=({children:e,id:t,...o})=>{const{onNodeUpdate:r}=zs();return u.default.createElement(ce.Item,{value:t},u.default.Children.map(e,n=>{const i=u.default.isValidElement(n)&&n.type===sa,s=u.default.isValidElement(n)&&n.type===ia;if(!i&&!s)throw new Error('Only NavigationMenu.Trigger and NavigationMenu.Content can be the passed as a "children" of NavigationMenu.Dropdown');return i?u.default.cloneElement(n,{...o,ref:c=>r(c,t)}):n}))};zo.displayName="NavigationMenuDropdown";const Fs=l("button",{...la,...ko}),Ns=l(ce.Item),Ms=l(ce.Link,la,{display:"block",textDecoration:"none",lineHeight:1,variants:{elementType:{dropdownItem:{"&[data-active]":{background:"$primaryLight",color:"$primary","*":{color:"$primary"},"&:hover":{background:"$tonal50"},"&:active":{background:"$tonal100"},"&:focus-visible":{boxShadow:"0 0 0 2px $colors$primary"}}},link:{"&[data-active]":{...Do}}}}}),ca=u.default.forwardRef(({children:e,href:t,disabled:o,css:r,variant:n="link",...i},s)=>u.default.createElement(Ns,null,o?u.default.createElement(Fs,{disabled:!0,...i},e):u.default.createElement(Ms,{href:t,ref:s,elementType:n,css:r,...i},e)));ca.displayName="NavigationMenuLink";const Io=u.default.forwardRef((e,t)=>u.default.createElement(ca,{ref:t,variant:"dropdownItem",...e})),To=l(L,{color:"$tonal500",fontWeight:600});Io.displayName="NavigationMenuDropdownItem",To.displayName="NavigationMenuDropdownItemTitle";const As=D({"0%, 50%":{opacity:0},"100%":{opacity:1}}),Ls=l(ce.Root,{display:"flex",justifyContent:"center",position:"relative"}),Ps=l(ce.List,{all:"unset",display:"flex",justifyContent:"center",alignItems:"center",gap:"$1",listStyle:"none"}),Ws=l(ce.Viewport,{zIndex:it}),Bs=l("div",{position:"absolute",left:0,top:"100%",width:"100%",display:"flex",justifyContent:"center"}),pe=({children:e,css:t})=>{const[o,r]=u.default.useState(),[n,i]=u.default.useState(),[s,c]=u.default.useState(0),d=u.default.useRef(null),m=200;u.default.useLayoutEffect(()=>{d.current&&c(d.current.offsetWidth)},[]),u.default.useEffect(()=>{let h;return n===""&&(h=setTimeout(()=>r(null),m)),()=>{h!==null&&clearTimeout(h)}},[n]);const p=(h,g)=>{if(h&&s&&n===g){const f=s/2,$=s-h.offsetLeft-h.offsetWidth+h.offsetWidth/2;r(Math.round(f-$))}return h};return u.default.createElement(So.Provider,{value:{onNodeUpdate:p}},u.default.createElement(Ls,{onValueChange:i,css:t},u.default.createElement(Ps,{ref:d},e),u.default.createElement(Bs,null,u.default.createElement(Ws,{css:{transform:`translateX(${o||0}px)`,'&[data-state="open"]':{animation:`${As} ${m}ms ease`},'&[data-state="closed"]':{animation:`${rt} ${m}ms ease-out`}}}))))};pe.Link=ca,pe.Dropdown=zo,pe.DropdownContent=ia,pe.DropdownItem=Io,pe.DropdownItemTitle=To,pe.DropdownTrigger=sa,pe.displayName="NavigationMenu";const Os=l(w,{position:"relative"}),Hs=l(z,{fontFamily:"$body",fontSize:"$sm",flexDirection:"column",justifyContent:"center",position:"absolute",top:"0",right:"0",transform:"translate(calc($sizes$2 / 2), -50%)",borderRadius:"$round",p:"$2",height:"$2",minWidth:"$2",textAlign:"center",color:"#fff",bg:"$primary"}),Vs=({value:e,children:t})=>u.default.createElement(Os,null,!!e&&u.default.createElement(Hs,{role:"status"},e),t),qs=l("span",{zIndex:1}),_s=l(M,{borderColor:"$tonal400 !important",zIndex:1,"&:hover":{bg:"$tonal50",svg:{color:"$tonal400"}},svg:{color:"$tonal300"},"&:active":{bg:"$tonal100",svg:{color:"$tonal500"}},"&:disabled":{opacity:.3,pointerEvents:"none"}}),Ro=a.forwardRef((e,t)=>{const{icon:o,disabledTooltipContent:r,showTooltip:n,...i}=e;return a.createElement(K,null,a.createElement(K.Trigger,{asChild:!0},a.createElement(qs,{tabIndex:-1},a.createElement(_s,{tabIndex:-1,appearance:"outline",ref:t,...i},a.createElement(b,{is:o})))),n&&a.createElement(K.Content,null,r))}),da=a.forwardRef((e,t)=>{const{name:o,min:r=0,max:n=Number.MAX_SAFE_INTEGER,step:i=1,initialValue:s=0,disabled:c=!1,readonly:d=!1,size:m="md",onChange:p,stepperButtonLabels:h,disabledTooltipContent:g,css:f,...$}=e,[y,C]=a.useState(s),E=a.useRef(null);a.useImperativeHandle(t,()=>E.current);const T={increment:"increment",decrement:"decrement",...h},x={decrement:`Cannot enter values below ${r}`,increment:`Cannot enter values above ${n}`,...g},S=y>=n,F=y<=r,A=a.useCallback(k=>Math.min(Math.max(k,r),n),[n,r]),P=a.useCallback(k=>{C(k),p==null||p(Number(k))},[p]),R=a.useCallback(k=>{const j=k.target.value.replace(/\D/g,"");P(j)},[P]),N=a.useCallback(()=>{var k;if(S||d)return;(k=E==null?void 0:E.current)==null||k.focus();let j;y===""?j=i:j=Number(y)+i,P(A(j))},[A,S,d,i,P,y]),V=a.useCallback(()=>{var k;if(F||d)return;(k=E==null?void 0:E.current)==null||k.focus();let j;y===""?j=r:j=Number(y)-i,P(A(j))},[A,F,d,r,i,P,y]),ke=a.useCallback(k=>{if(k.nativeEvent.isComposing)return;const j=k.key,Ve={ArrowUp:N,ArrowRight:N,ArrowDown:V,ArrowLeft:V,Home:()=>P(r),End:()=>P(n)}[j];Ve&&(k.preventDefault(),Ve(k))},[N,V,P,r,n]),Et={name:o,type:"number",value:y,...$,onChange:R,onKeyDown:ke,size:m,css:{borderRadius:"0px",width:"$6","&:disabled":{opacity:.3,pointerEvents:"none"}},ref:E,readOnly:d,disabled:c,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":Number(y),role:"spinbutton"};return a.createElement(z,{css:f},a.createElement(Ro,{onClick:V,icon:v.Minus,css:{borderRight:"none",borderTopRightRadius:"0px",borderBottomRightRadius:"0px"},size:m,disabled:F||c,showTooltip:F&&!c,disabledTooltipContent:x.decrement,label:T.decrement}),a.createElement(we,{...Et}),a.createElement(Ro,{onClick:N,icon:v.Plus,css:{borderLeft:"none",borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px"},size:m,disabled:S||c,showTooltip:S&&!c,disabledTooltipContent:x.increment,label:T.increment}))});da.displayName="NumberInput";const Fo=({css:e,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c,trigger:d}=H.useFormContext(),{error:m}=ie(o),p=r?c(r):c;return a.createElement(te,{css:e,description:i,error:m,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(da,{id:o,name:o,ref:p,...m&&{state:"error","aria-invalid":!0},...s,onChange:d}))};Fo.displayName="NumberInputField";const ma=a.forwardRef(({css:e,hidePasswordText:t="Hide password",showPasswordText:o="Show password",size:r="md",...n},i)=>{const[s,c]=Y.useState(!1),d=()=>c(m=>!m);return a.createElement(w,{css:{position:"relative",...e}},a.createElement(we,{...n,size:r,type:s?"text":"password",ref:i,css:{pr:"$sizes$2"}}),a.createElement(M,{appearance:"simple",theme:"neutral",css:{bottom:0,position:"absolute",right:0},label:s?t:o,onClick:d,onMouseDown:m=>m.preventDefault(),size:r},a.createElement(b,{is:s?v.Eye:v.EyeCrossed})))});ma.displayName="PasswordInput";const No=({css:e={},label:t="Password",name:o,prompt:r=void 0,description:n,validation:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=i?c(i):c;return a.createElement(te,{css:{...e,position:"relative"},description:n,error:d,fieldId:o,label:t,prompt:r,required:Boolean(i==null?void 0:i.required)},a.createElement(ma,{autoComplete:"current-password",name:o,id:o,ref:m,...s}))};No.displayName="PasswordField";const Gs=l(wa.Root,{borderRadius:"$round",background:"$tonal100",height:"$0",position:"relative",overflow:"hidden",width:"100%",variants:{theme:{primary:{color:"$primary"},success:{color:"$success"},warning:{color:"$warning"},danger:{color:"$danger"}}}}),js=l(wa.Indicator,{backgroundColor:"currentcolor",borderRadius:"$round",boxSizing:"border-box",height:"100%",position:"absolute",transition:"all 300ms ease-out"}),Mo=({value:e,max:t=100,theme:o="primary",...r})=>a.createElement(Gs,{value:e,max:t,theme:o,...r},a.createElement(js,{style:{width:"100%",transform:`translateX(-${100-(e||0)/t*100}%)`}}));Mo.displayName="ProgressBar";const Ao=({css:e,label:t,value:o,...r})=>a.createElement(ht,{css:e,label:t},a.createElement(pt,{value:o,...r}));Ao.displayName="RadioField";const Ys=l("fieldset",{all:"unset"}),ua=({children:e,css:t,direction:o="column",defaultValue:r,description:n,label:i,name:s,validation:c,onValueChange:d,...m})=>{const{control:p}=H.useFormContext(),{error:h}=ie(s);return a.createElement(Ys,{css:t},a.createElement(Be,{as:"legend",css:{p:0,mb:"$3"},required:Boolean(c==null?void 0:c.required)},i),n&&a.createElement(jt,{css:{mb:"$3"}},n),a.createElement(H.Controller,{control:p,name:s,rules:c,defaultValue:r,render:({onChange:g,value:f})=>a.createElement(Yt,{direction:o,defaultValue:r,onValueChange:$=>{g($),d==null||d($)},value:f,...m},e)}),h&&a.createElement(dt,{css:{mt:"$2"}},h))};ua.Item=Ao,ua.displayName="RadioButtonField";const Us=l(Re.Item,{alignItems:"center",bg:"white",border:"1px solid $tonal200",borderRadius:"$0",cursor:"pointer",display:"flex",textAlign:"left",'&[data-state="checked"]':{outline:"2px solid $primary",outlineOffset:"-2px"},variants:{align:{left:{flexDirection:"row"},right:{flexDirection:"row-reverse"}},size:{md:{px:"$4",py:"$3"},lg:{px:"$5",py:"$4"}},isFullWidth:{true:{width:"100%"},false:{width:"max-content"}}}}),Xs=l("div",{alignItems:"center",appearance:"none",backgroundColor:"transparent",border:"1px solid $tonal500",borderRadius:"$round",display:"flex",flexShrink:0,justifyContent:"center",p:0,size:"$1",transition:"all 50ms ease-out",'[data-state="checked"] &':{backgroundColor:"$primary",borderColor:"$primary"},variants:{containerIsFullWidth:{true:{},false:{}},align:{left:{mr:"$4"},right:{}}},compoundVariants:[{containerIsFullWidth:!0,align:"right",css:{ml:"auto"}},{containerIsFullWidth:!1,align:"right",css:{ml:"$4"}}]}),Js=l(Re.Indicator,{backgroundColor:"white",borderRadius:"$round",position:"absolute",size:"6px"}),Lo=({children:e,isFullWidth:t=!1,size:o="md",align:r="left",...n})=>a.createElement(Us,{...n,align:r,isFullWidth:t,size:o},a.createElement(Xs,{align:r,containerIsFullWidth:t},a.createElement(Js,null)),a.createElement(w,null,e)),Ks=({css:e,children:t,size:o,isFullWidth:r,align:n,gap:i="3",justify:s,...c})=>a.createElement(Re.Root,{...c},a.createElement(Le,{direction:"row",justify:s,gap:i,css:e},a.Children.map(t,d=>a.isValidElement(d)&&(d==null?void 0:d.type)===Lo?a.cloneElement(d,{size:o,isFullWidth:r,align:n}):d))),Po=({css:e,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return a.createElement(te,{css:e,description:i,error:d,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(bt,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Po.displayName="SearchField";const Wo=({css:e=void 0,children:t,name:o,label:r,validation:n,prompt:i,description:s,hideLabel:c,...d})=>{const{register:m}=H.useFormContext(),{error:p}=ie(o),h=n?m(n):m;return a.createElement(te,{css:e,description:s,error:p,fieldId:o,label:r,prompt:i,required:Boolean(n==null?void 0:n.required),hideLabel:c},a.createElement(vt,{name:o,id:o,...d,ref:h,...p&&{state:"error"}},t))};Wo.displayName="SelectField";const Bo=l(ae.Root,{width:"100%"});Bo.displayName="SidedrawerAccordionRoot";const Qs=D({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Zs=D({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),ec=l(ae.Content,{bg:"white",overflow:"hidden","@allowMotion":{'&[data-state="open"]':{animation:`${Qs} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Zs} 300ms ease-out`}}}),tc=({children:e,...t})=>u.default.createElement(ec,{...t},u.default.Children.map(e,o=>u.default.createElement(w,{css:{"> a":{px:"$6"},"> button":{px:"$6"}}},o))),ac=l(ae.Item,{}),pa={alignItems:"center",bg:"white",border:"unset",borderLeft:"4px solid transparent",color:"$tonal600",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:"400",fontSize:"$md",margin:0,minHeight:"48px",outline:"unset",outlineOffset:"unset",py:"$3",px:"$4",width:"100%",textDecoration:"none","&:hover":{bg:"$tonal50"},"&:active":{bg:"$tonal100"},"&:focus-visible":{boxShadow:"inset 0 0 0 2px $colors$primary"},"&[disabled]":{opacity:"0.3",pointerEvents:"none",cursor:"default"},variants:{active:{true:{bg:"$primaryLight",borderLeft:"4px solid $primary",color:"$primary",fontWeight:"600"}}}},oc=l(ae.Trigger,{justifyContent:"space-between",m:0,p:0,"&[data-state=open]":{fontWeight:"600"},...pa}),rc=l(b,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"}}),nc=({children:e,...t})=>u.default.createElement(ae.Header,null,u.default.createElement(oc,{...t},u.default.createElement(z,{css:{alignItems:"center"}},e),u.default.createElement(rc,{is:v.ChevronDown,size:"sm"}))),ic=({children:e})=>{let t=!1;return u.default.Children.forEach(e,o=>{var r;Y.isValidElement(o)&&((r=o.props)==null?void 0:r.value)&&(t=!0)}),u.default.createElement(w,{css:{flexGrow:1,width:"100%",overflowY:"auto"}},t?u.default.createElement(Bo,{type:"single"},e):e)},lc=({appearance:e="simple",label:t="close",size:o="md",theme:r="neutral",...n})=>u.default.createElement(q.Close,{asChild:!0},u.default.createElement(M,{theme:r,appearance:e,size:o,label:t,...n},u.default.createElement(b,{is:v.Close}))),sc=l(q.Overlay,{animationFillMode:"forwards",bg:"$alpha600",cursor:"pointer",height:"100vh",left:"0",position:"fixed",top:"0",width:"100vw",zIndex:it-1,"@allowMotion":{'&[data-state="open"]':{animation:`${Mt} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),cc=l(q.Content,{bg:"white",boxShadow:"$2",display:"flex",flexDirection:"column",position:"fixed",top:0,left:0,height:"100%",maxWidth:"304px",width:"100%",zIndex:it,"@allowMotion":{'&[data-state="open"]':{animation:`${Br} 250ms ease-out`},'&[data-state="closed"]':{animation:`${Or} 250ms ease-out`}}}),dc=({children:e,...t})=>u.default.createElement(q.Portal,null,u.default.createElement(sc,{"data-testid":"sidedrawer_overlay"}),u.default.createElement(cc,{role:"navigation",...t},e)),mc=l("footer",{alignItems:"center",borderTop:"1px solid $tonal100",bottom:0,boxShadow:"$3",display:"flex",height:"$6",justifyContent:"center",p:"$3",width:"100%"}),uc=({delay:e=500,delayMethod:t="throttle"}={})=>{const[o,r]=Y.useState({x:0,y:0}),n=Y.useMemo(()=>{if(t==="throttle")return et.throttle;if(t==="debounce")return et.debounce},[t]);return Y.useEffect(()=>{const i=n(e,()=>{r({x:window.scrollX,y:window.scrollY})});return window.addEventListener("scroll",i),()=>{window.removeEventListener("scroll",i)}},[n,e]),o},pc=u.default.forwardRef(({icon:e,...t},o)=>u.default.createElement(M,{size:"md",appearance:"simple",theme:"neutral",ref:o,...t},u.default.createElement(b,{is:e}))),xt=({src:e,alt:t="Atom Learning logo",css:o})=>u.default.createElement(Pe,{className:"topbar-brand-logo",src:e,alt:t,css:{mr:"$3",mb:"5px",...o}});xt.toString=()=>".topbar-brand-logo";const hc=l(L,{color:"$tonal400"}),gc=l("a",{display:"flex",alignItems:"center",textDecoration:"none",color:"$tonal400","&:hover, &:focus":{textDecoration:"none"}}),fc=()=>u.default.createElement(Gt,{orientation:"vertical",css:{height:"$2",bg:"$tonal100"}}),$c=l("div",{bg:"white",position:"sticky",display:"flex",alignItems:"center",width:"100vw",top:"0",zIndex:1,borderBottom:"1px solid $tonal100",transition:"box-shadow .2s ease-out",variants:{hasScrolled:{true:{boxShadow:"0px 4px 4px -2px rgba(31, 31, 31, 0.1);"}},size:{md:{height:"$6",[`& ${xt}`]:{'&[src$=".svg"]':{height:24,width:"auto"}}},lg:{height:"$7",[`& ${xt}`]:{'&[src$=".svg"]':{height:32,width:"auto"}}}}}}),bc=l(z,{alignItems:"center",height:"$4",mx:"$4",width:"100%","@md":{mx:"$5"}}),he=({size:e="md",...t})=>{const{y:o}=uc();return u.default.createElement($c,{hasScrolled:!!o,size:e},u.default.createElement(bc,{...t}))};he.Brand=gc,he.BrandLogo=xt,he.BrandName=hc,he.ActionIcon=pc,he.Divider=fc,he.displayName="TopBar";const vc=l("header",{"> div":{width:"100%"}}),yc=({children:e,...t})=>u.default.createElement(vc,{...t},u.default.createElement(he,{css:{mx:"$3"}},e)),xc=l("a",pa),wc=l("button",pa),Ec=({active:e,children:t,disabled:o,href:r,onClick:n,...i})=>r?u.default.createElement(xc,{active:e,href:r,onClick:n,...i},t):u.default.createElement(wc,{active:e,disabled:o,onClick:n,...i},t),Cc=l(q.Trigger,{}),Z=({children:e,...t})=>u.default.createElement(zr.Root,{...t},e);Z.Accordion=ac,Z.AccordionContent=tc,Z.AccordionTrigger=nc,Z.Body=ic,Z.Close=lc,Z.Content=dc,Z.Footer=mc,Z.Header=yc,Z.Item=Ec,Z.Trigger=Cc;const Sc=l("div",{height:"$space$3",mt:"$3",position:"relative",width:"100%"}),Oo=(e,t,o)=>(e-t)/(o-t)*100,kc=(e,t,o)=>{const r=Oo(e,t,o);return r<=10?0:r>=90?100:50},Dc=({min:e,max:t,steps:o=[]})=>o.length===0?null:a.createElement(Sc,null,o.map(r=>a.createElement(L,{as:"span",key:r.value,css:{position:"absolute",color:"$tonal300"},style:{left:`${Oo(r.value,e,t)}%`,transform:`translateX(-${kc(r.value,e,t)}%)`}},r.label))),zc=({value:e=[],outputLabel:t=o=>`Current value is ${o}`})=>a.createElement(L,{css:{mt:"$4",color:"$tonal300",width:"100%"}},t(e.length===1?e[0]:e)),ha=l(tt.Track,{borderRadius:"$round",flexGrow:1,position:"relative",'&[data-orientation="horizontal"]':{height:"$space$1"},'&[data-orientation="vertical"]':{width:"$space$1"}}),Ic=l(tt.Root,{alignItems:"center",display:"flex",position:"relative",touchAction:"none",userSelect:"none",cursor:"pointer",'&[data-orientation="horizontal"]':{height:"$1"},'&[data-orientation="vertical"]':{flexDirection:"column",width:"$1"},"&[data-disabled]":{cursor:"not-allowed",bg:"$tonal100"},variants:{theme:{light:{[`${ha}`]:{bg:"#fff"}},tonal:{[`${ha}`]:{bg:"$tonal200"}}}}}),Tc=l(tt.Range,{bg:"$primary",borderRadius:"$round",height:"100%",position:"absolute","&[data-disabled]":{bg:"$tonal200",cursor:"not-allowed"}}),Rc=l(tt.Thumb,{bg:"$primaryMid",borderRadius:"$round",display:"block",size:"$1","&:hover":{bg:"$primaryDark"},"&:focus":{outline:"2px solid $primaryMid",outlineOffset:"2px"},"&[data-disabled]":{bg:"$tonal200",cursor:"not-allowed"}}),Ce=({value:e,defaultValue:t,min:o=0,max:r=100,theme:n="tonal",css:i,children:s,...c})=>{const d=e||t;return a.createElement(Fe,{css:i},a.createElement(Ic,{theme:n,defaultValue:t,value:e,min:o,max:r,...c},a.createElement(ha,null,a.createElement(Tc,null)),(d==null?void 0:d.length)&&d.map((m,p)=>a.createElement(Rc,{key:`thumb${p}`}))),s)};Ce.Value=zc,Ce.Steps=Dc,Ce.displayName="Slider";const Ho=({css:e,label:t,name:o,defaultValue:r,outputLabel:n,min:i=0,max:s=100,steps:c=[],...d})=>{const{control:m}=H.useFormContext();return u.default.createElement(te,{css:e,fieldId:o,label:t},u.default.createElement(H.Controller,{control:m,name:o,defaultValue:r,render:({onChange:p,value:h})=>u.default.createElement(Ce,{name:o,defaultValue:r,onValueChange:p,value:h,min:i,max:s,...d},u.default.createElement(Ce.Steps,{min:i,max:s,steps:c}),u.default.createElement(Ce.Value,{value:h||r,outputLabel:n}))}))};Ho.displayName="SliderField";const Vo=a.createContext({steps:[],goToPreviousStep:()=>null,goToNextStep:()=>null,goToStep:()=>null,activeStep:0,viewedSteps:[],allowSkip:!1,direction:"horizontal",hideLabels:!1,completedSteps:[],showCompletedIcons:!1}),Fc=({children:e,stepCount:t,allowSkip:o,onComplete:r,onStepChange:n,direction:i,steps:s,hideLabels:c,showCompletedIcons:d})=>{const[m,p]=a.useState(0),[h,g]=a.useState([0]),[f,$]=a.useState([]),y=!t;a.useEffect(()=>{g(x=>x.includes(m)?x:[...x,m]),n==null||n(m)},[m,n]);const C=()=>{const x=r&&m===t-1,S=m<t-1;if((r||S)&&$(F=>F.includes(m)?F:[...F,m]),x)return r==null?void 0:r();if(S)return p(F=>F+1)},E=()=>{p(x=>x-1)},T=x=>{p(x)};return a.createElement(Vo.Provider,{value:{steps:s||Array(t).fill(""),goToPreviousStep:y?void 0:E,goToNextStep:y?void 0:C,goToStep:y?void 0:T,activeStep:m,viewedSteps:h,completedSteps:f,allowSkip:o,direction:i,hideLabels:c,showCompletedIcons:d}},e)},ga=()=>{const e=a.useContext(Vo);if(!e)throw new Error("Ensure that you wrap any components with the root component Stepper");return e},Nc=({label:e,children:t,...o})=>{const{activeStep:r,goToPreviousStep:n}=ga();return a.createElement(ne,{size:"sm",appearance:"outline",...o,disabled:r===0,onClick:n},t||(e==null?void 0:e(r)))},Mc=({label:e,children:t,onClick:o,...r})=>{const{goToNextStep:n,activeStep:i}=ga();return a.createElement(ne,{size:"sm",...r,onClick:()=>{if(o)return o(n);n==null||n()},css:{ml:"auto"}},t||(e==null?void 0:e(i)))},Ac=l(z,{position:"relative",p:"$2",justifyContent:"center",alignItems:"center",size:"$3",borderRadius:"50%",border:"none",bg:"$tonal100",zIndex:1,flex:"none",variants:{status:{default:{bg:"$tonal100",color:"$tonal300"},active:{bg:"white",color:"$primaryMid",border:"2px solid",borderColor:"currentColor"},viewed:{bg:"white",border:"2px solid $tonal200",color:"$tonal600"},completed:{bg:"$primary",color:"white"},reviewed:{bg:"$primaryMid",color:"white"},success:{bg:"$success",color:"white"}}}}),Lc=l(z,{position:"relative",fontFamily:"$body",fontWeight:600,fontSize:"$md",alignItems:"center","&:not(:last-child)::after":{content:"",position:"absolute"},"&:focus-visible":{outline:"none"},variants:{canInteract:{true:{}},direction:{vertical:{py:"$3",flexDirection:"row","&:not(:last-child)::after":{height:"100%",width:"4px",left:"14px",top:"50%"}},horizontal:{px:"$2",flexDirection:"column","&:not(:last-child)::after":{width:"100%",height:"4px",left:"50%",top:"14px"}}},separator:{default:{"&:not(:last-child)::after":{bg:"$tonal100"}},active:{"&:not(:last-child)::after":{bg:"$primary"}},success:{"&:not(:last-child)::after":{bg:"$success"}},viewed:{"&:not(:last-child)::after":{bg:"$tonal200"}}},status:{completed:{},active:{},default:{},viewed:{},success:{},reviewed:{}}},compoundVariants:[{canInteract:!0,status:"completed",css:{"&:hover":{"& :first-child":{bg:"$primaryMid",color:"white !important"},"& :last-child":{color:"$primaryMid"}},"&:focus-visible":{"& :first-child":{outline:"2px solid $primary",outlineOffset:"2px"}}}},{canInteract:!0,status:"active",css:{"&:hover":{"& :first-child":{borderColor:"$tonal400",color:"$tonal600"},"& :last-child":{color:"$tonal600"}},"&:focus-visible":{"& :first-child":{outline:"2px solid $primary",outlineOffset:"2px"}}}},{canInteract:!0,status:"viewed",css:{"&:hover":{"& :first-child":{borderColor:"$tonal400",color:"$tonal600"},"& :last-child":{color:"$tonal600"}},"&:focus-visible":{"& :first-child":{outline:"2px solid $primary !important",outlineOffset:"2px !important"}}}},{canInteract:!0,status:"reviewed",css:{"&:focus-visible":{"& :first-child":{outline:"2px solid $primary !important",outlineOffset:"2px !important"}}}}]}),Pc=l(L,{fontWeight:600,variants:{direction:{vertical:{ml:"$3",textAlign:"left"},horizontal:{mt:"$3",textAlign:"center"}},status:{default:{color:"$tonal300",fontWeight:400},active:{color:"$primaryMid"},viewed:{color:"$tonal600"},completed:{color:"$primary"},success:{color:"$success"},reviewed:{}}}});var B=(e=>(e.ACTIVE="active",e.VIEWED="viewed",e.SUCCESS="success",e.DEFAULT="default",e.COMPLETED="completed",e.REVIEWED="reviewed",e))(B||{});const Wc=l(z,{justifyContent:"space-between",variants:{direction:{vertical:{flexDirection:"column"},horizontal:{flexDirection:"row"}}}}),Bc=({css:e})=>{const{steps:t,goToStep:o,activeStep:r,viewedSteps:n,allowSkip:i,direction:s,hideLabels:c,completedSteps:d,showCompletedIcons:m}=ga(),p=g=>{const f=t[g];return f.status?f.status:d.length===t.length?B.SUCCESS:r===g&&d.includes(r)?B.REVIEWED:r===g?B.ACTIVE:d.includes(g)?B.COMPLETED:n.includes(g)?B.VIEWED:B.DEFAULT},h=g=>{var f;const $=(f=t[g])==null?void 0:f.status;return d.length===t.length||$===B.SUCCESS?B.SUCCESS:$===B.COMPLETED||g<Math.max(...n)?B.ACTIVE:$===B.VIEWED?B.VIEWED:B.DEFAULT};return a.createElement(Wc,{css:e,direction:s},t.map((g,f)=>{const $=p(f),y=h(f);return a.createElement(Lc,{tabIndex:0,key:`step_${f}`,direction:s,separator:y,status:$,css:s==="horizontal"?{width:`calc(100% / ${t.length})`}:{height:`calc(100% / ${t.length})`},canInteract:i},a.createElement(Ac,{as:i?"button":"div",onClick:()=>i&&n.includes(f)?o==null?void 0:o(f):void 0,status:$,"aria-current":f===r?"step":void 0,"aria-label":g.label?"":`step ${f+1}`,"aria-labelledby":g.label?`step-${f}`:void 0,css:{cursor:i&&n.includes(f)?"pointer":"auto"}},g.status===B.SUCCESS||m&&$===B.COMPLETED?a.createElement(b,{is:v.Ok}):f+1),g.label&&!c&&a.createElement(Pc,{as:"span",id:`step-${f}`,direction:s,status:$},g.label))}))},Qe=({children:e,stepCount:t,allowSkip:o,onComplete:r,onStepChange:n,direction:i="horizontal",steps:s,hideLabels:c=!1,showCompletedIcons:d=!1,css:m})=>{Te.default(!(t&&s),"`Stepper` should only be given one of `stepCount` or `steps`. When both are provided, `steps` will be used and `stepCount` will be ignored.");const p=(s==null?void 0:s.length)||t||0;return a.createElement(Fc,{stepCount:p,allowSkip:o,onComplete:r,onStepChange:t?n:void 0,direction:i,steps:s||Array(p).fill(""),hideLabels:c,showCompletedIcons:d},a.createElement(w,{"aria-label":"progress",css:{width:"100%",...m}},e))};Qe.StepBack=Nc,Qe.StepForward=Mc,Qe.Steps=Bc,Qe.displayName="Stepper";const Oc=l(Ea.Root,{appearance:"none",backgroundColor:"$tonal200",border:"none",borderRadius:"$round",cursor:"pointer",display:"flex",overflow:"hidden",p:"$0",position:"relative",transition:"all 50ms ease-out",width:"$4","&:hover":{backgroundColor:"$tonal300"},"&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},'&[data-state="checked"]':{backgroundColor:"$primary"},'&[data-state="checked"]:hover':{backgroundColor:"$primaryMid"}}),Hc=l(Ea.Thumb,{backgroundColor:"white",borderRadius:"$round",display:"block",size:"$1",transition:"transform 50ms",willChange:"transform",'&[data-state="checked"]':{transform:"translateX(calc($sizes$2 - $space$1))"}}),qo=e=>a.createElement(Oc,{...e},a.createElement(Hc,null));qo.displayName="Switch";const Vc=({delay:e=500}={})=>{const[t,o]=Y.useState({width:void 0,height:void 0});return Y.useEffect(()=>{const r=et.debounce(e,()=>{o({width:window.innerWidth,height:window.innerHeight})});return window.addEventListener("resize",r),r(),()=>window.removeEventListener("resize",r)},[e]),t},qc=l(Pt,{position:"relative",borderBottom:"1px solid $base3",width:"100%"}),_c=l(at.List,{flexShrink:0,display:"flex",width:"100%",overflowX:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}),_o=l(M,{height:"100% !important",position:"absolute",top:"50%",transform:"translateY(-50%)",cursor:"pointer",background:"$background !important",color:"$interactive1 !important",borderRadius:0,opacity:.9}),Gc=10,Go=({children:e,colorScheme:t={},...o})=>{const[r,n]=Cl(),{width:i}=Vc(),[s,c]=u.default.useState(!1),[d,m]=u.default.useState(!1),p=u.default.useCallback(h=>{if(!r)return;const{scrollWidth:g,scrollLeft:f,offsetWidth:$}=r,y=Math.round(g*(Gc/100));let C=f;if(h==="right"){const E=f+y;C=E+$<=g?E:g-$}else{const E=f-y;C=E>0?E:0}r.scroll({left:C,behavior:"smooth"}),setTimeout(()=>{const{scrollWidth:E,scrollLeft:T,offsetWidth:x}=r,S=E-(T+x);T===0?(c(!1),m(!0)):S<5?(m(!1),c(!0)):(c(!0),m(!0))},500)},[r]);return u.default.useEffect(()=>{var h;if(!r)return;const{offsetWidth:g,scrollWidth:f}=r,$=f>g;(h=r.scroll)==null||h.call(r,{left:0}),c(!1),m($)},[r,i]),u.default.createElement(qc,{base:"slate",accent:"blue",interactive:"hiContrast1",...t,...o},s&&u.default.createElement(_o,{label:"scroll left",size:"md",css:{left:0},onClick:()=>p("left")},u.default.createElement(b,{is:v.ChevronLeft})),u.default.createElement(_c,{ref:n},e),d&&u.default.createElement(_o,{label:"scroll right",size:"md",css:{right:0},onClick:()=>p("right")},u.default.createElement(b,{is:v.ChevronRight})))};Go.displayName="TabsTriggerList";const jc=l(at.Trigger,{background:"none",border:"none",cursor:"pointer",flexShrink:0,p:"$4",userSelect:"none",borderBottom:"2px solid transparent",'&[data-state="active"]':{color:"$interactive1",fontWeight:600,letterSpacing:"-0.005em",borderColor:"currentColor"},"&[data-disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([data-disabled])":{"&:hover, &:focus-visible":{color:"$interactive2",bg:"$accentA1"},"&:active":{color:"$interactive3"},"&:focus-visible":{...be()}}}),jo=({children:e,...t})=>a.createElement(jc,{asChild:!0,...t},a.createElement(L,{size:"sm",as:"button"},e));jo.displayName="TabsTrigger";const Yc=l(at.Content,{flexGrow:1,fontFamily:"$body"}),Yo=Yc;Yo.displayName="TabsContent";const Uc=l(at.Root,{width:"100%"}),Ze=({children:e,...t})=>a.createElement(Uc,{...t},e);Ze.TriggerList=Go,Ze.Trigger=jo,Ze.Content=Yo,Ze.displayName="Tabs";const Xc=l("textarea",{boxShadow:"none",fontSize:"$md",appearance:"none",border:"1px solid $tonal400",borderRadius:"$0",boxSizing:"border-box",color:"$tonal600",fontFamily:"$body",fontWeight:400,lineHeight:1.4,minHeight:"$7",px:"$3",py:"calc($2 + $1)",resize:"vertical",transition:"all 75ms ease-out",width:"100%","&:focus":{borderColor:"$primary",outline:"none"},"&[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&::placeholder":{color:"$tonal300",opacity:1},variants:{state:{error:{border:"1px solid $danger"}}}}),fa=a.forwardRef((e,t)=>a.createElement(Xc,{...e,ref:t}));fa.displayName="Textarea";const Uo=({css:e=void 0,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return a.createElement(te,{css:e,description:i,error:d,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(fa,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Uo.displayName="TextareaField";const Xo=400,Jc=D({"0%":{transform:"translate3d(0,-100%,0)",opacity:0},"100%":{transform:"translate3d(0,0,0)",opacity:1}}),Kc=D({"0%":{transform:"translate3d(0,0,0)",opacity:1},"100%":{transform:"translate3d(0,-100%,0)",opacity:0}}),Qc=l("div",{position:"absolute",width:"100%",variants:{visible:{true:{"@allowMotion":{animation:`${Jc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}},false:{opacity:0,"@allowMotion":{animation:`${Kc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}}}}}),Zc=l("div",{pointerEvents:"auto",alignItems:"center",borderRadius:"$0",boxShadow:"$1",boxSizing:"border-box",color:"white",display:"flex",minHeight:"$5",pl:"$4",position:"relative",pr:"$6",py:"$4",transition:"background-color 50ms ease-out",width:"100%","@sm":{width:Xo},"@allowMotion":{transition:"background-color 50ms ease-out, transform 150ms ease-out"},variants:{status:{blank:{bg:"$primary"},error:{bg:"$danger"},loading:{bg:"$primary"},success:{bg:"$success"}}}}),ed=a.memo(({ariaLive:e,height:t,id:o,message:r,role:n,type:i="blank",visible:s,calculateOffset:c,updateHeight:d})=>{const m=c(o,{reverseOrder:!0,margin:8});return a.createElement(Qc,{visible:s},a.createElement(Zc,{ref:p=>{p&&t===void 0&&d(o,p.getBoundingClientRect().height)},status:i,role:n,"aria-live":e,style:{transform:`translateY(${m}px)`}},i==="error"&&a.createElement(b,{size:"sm",css:{mr:"$3",flex:"0 0 auto"},is:v.Error}),a.createElement(L,null,r),i==="loading"?a.createElement(lt,{css:{flex:"0 0 auto",ml:"auto"}}):a.createElement(M,{css:{position:"absolute",top:"$2",right:"$2",color:"white","&:hover,&:focus":{color:"white",opacity:.5}},label:"Close alert",onClick:()=>St.toast.dismiss(o)},a.createElement(b,{is:v.Close}))))}),td=l("div",{left:"$2",position:"fixed",top:"$2",right:"$2",zIndex:it,"@sm":{top:"$3",right:"auto",left:`calc(50% - ${Xo/2}px)`}}),Jo=({children:e})=>{const{toasts:t,handlers:o}=St.useToaster(),{startPause:r,endPause:n,calculateOffset:i,updateHeight:s}=o;return a.createElement(a.Fragment,null,a.createElement(td,{onMouseEnter:r,onMouseLeave:n},t.map(c=>a.createElement(ed,{key:c.id,calculateOffset:i,updateHeight:s,...c}))),e)};Jo.displayName="ToastProvider";const Se=l(ot.Item,{bg:"white",color:"$tonal400",border:"1px solid $tonal200",cursor:"pointer","&::before":{background:"$tonal200"},"&:not([disabled])":{'&:hover, &:focus-visible, &[data-state="on"]':{"&::before":{background:"none"}},"&:hover":{borderColor:"currentColor !important",color:"$primaryMid"},"&:focus-visible":{...be(),'&[data-state="off"]':{borderColor:"$tonal200 !important"},'&[data-state="on"]':{boxShadow:`inset currentColor 0px 0px 0px 1px, ${be().boxShadow}`}}},"&[disabled]":{opacity:.3,cursor:"not-allowed"},'&[data-state="on"]':{color:"$primary",borderColor:"currentColor !important",boxShadow:"inset currentColor 0px 0px 0px 1px"}}),ad=Se,wt={sm:"32px",md:"40px",lg:"48px"},od={sm:"$4",md:"$5",lg:"$5"},rd={sm:"$2",md:"$3",lg:"$3"},$a=e=>({fontSize:`$${e}`,px:od[e],minHeight:wt[e],"& > *:not(:last-child)":{mr:rd[e]}}),nd=l(Se,{flexGrow:1,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,lineHeight:1,py:"$1",[`& ${ka}`]:{flexShrink:0},variants:{size:{sm:$a("sm"),md:$a("md"),lg:$a("lg")},isIconOnly:{true:{}}},compoundVariants:[{isIconOnly:!0,size:"sm",css:{minWidth:wt.sm,p:0}},{isIconOnly:!0,size:"md",css:{minWidth:wt.md,p:0}},{isIconOnly:!0,size:"lg",css:{minWidth:wt.lg,p:0}}]}),id=a.forwardRef(({size:e="md",children:t,...o},r)=>{var n;const i=a.Children.toArray(t),s=i.length<=1,c=s&&a.isValidElement(i[0])&&((n=i[0])==null?void 0:n.type)===b;return a.createElement(nd,{ref:r,size:e,isIconOnly:c,...o},i.map(d=>!s&&(typeof d=="string"||typeof d=="number")?a.createElement("span",{key:d},d):a.isValidElement(d)&&(d==null?void 0:d.type)===b?a.cloneElement(d,{...d.props,size:e}):d))}),ld=l(ot.Root,{width:"fit-content",variants:{isFullWidth:{true:{width:"100%",[`& ${Se}`]:{flexBasis:0,flexGrow:1}}},hasGap:{true:{[`& ${Se}`]:{borderRadius:"$0"}},false:{borderRadius:"$0",bg:"white",[`& ${Se}`]:{bg:"transparent",borderRadius:0,position:"relative","&:not(:last-child)::before":{content:"",position:"absolute"}}}},direction:{column:{},row:{}}},compoundVariants:[{hasGap:!1,direction:"row",css:{[`& ${Se}`]:{"&:not(:last-child)::before":{top:"-1px",height:"calc(100% + 2px)",width:"1px",right:"0",transform:"translateX(150%)"},"&:not(:first-child)":{borderLeftColor:"transparent"},"&:not(:last-child)":{borderRightColor:"transparent"},"&:first-child":{borderTopLeftRadius:"$0",borderBottomLeftRadius:"$0"},"&:last-child":{borderTopRightRadius:"$0",borderBottomRightRadius:"$0"}}}},{hasGap:!1,direction:"column",css:{[`& ${Se}`]:{"&:not(:last-child)::before":{bottom:0,left:"-1px",height:"1px",width:"calc(100% + 2px)",transform:"translateY(150%)"},"&:first-child":{borderTopLeftRadius:"$0",borderTopRightRadius:"$0"},"&:last-child":{borderBottomLeftRadius:"$0",borderBottomRightRadius:"$0"},"&:not(:first-child)":{borderTopColor:"transparent"},"&:not(:last-child)":{borderBottomColor:"transparent"}}}}]}),sd=e=>e==="horizontal"?"row":"column",cd=a.forwardRef(({orientation:e="horizontal",gap:t=!1,isFullWidth:o,children:r,wrap:n="no-wrap",...i},s)=>{const c=typeof t=="number",d=sd(e);return a.createElement(ld,{ref:s,direction:d,hasGap:c,isFullWidth:o,orientation:e,...i},a.createElement(Le,{direction:d,gap:c&&t,align:!1,wrap:n},r))}),dd={Item:ad,Button:id,Root:cd},md=l(Nr.default,{}),Ko=a.forwardRef(({id:e,ratio:t=9/16,css:o,...r},n)=>a.createElement(Fe,{css:o},a.createElement(w,{css:{borderRadius:"$0",position:"relative",paddingTop:`${t*100}%`,overflow:"hidden",height:0,width:"100%"}},a.createElement(md,{...r,role:"figure",url:`https://player.vimeo.com/video/${e}`,height:"100%",width:"100%",css:{position:"absolute",top:0,left:0},ref:n}))));Ko.displayName="Video",Object.defineProperty(exports,"toast",{enumerable:!0,get:function(){return Fr.default}}),exports.Accordion=Ge,exports.ActionIcon=M,exports.AlertDialog=G,exports.AlertProvider=_n,exports.Avatar=We,exports.Badge=Wa,exports.Box=w,exports.Button=ne,exports.Carousel=ve,exports.Checkbox=ct,exports.CheckboxField=Ya,exports.Chip=de,exports.ChipDismissibleGroup=Jt,exports.ChipGroup=Ut,exports.ChipToggleGroup=Kt,exports.Combobox=xe,exports.DataTable=W,exports.DateField=ho,exports.DateInput=aa,exports.Dialog=ue,exports.Dismissible=gt,exports.DismissibleGroup=ye,exports.Divider=Gt,exports.DropdownMenu=Ee,exports.EmptyState=Ke,exports.FieldWrapper=te,exports.FileInput=xo,exports.Flex=z,exports.Form=ja,exports.Grid=wo,exports.Heading=st,exports.Icon=b,exports.Image=Pe,exports.InlineFieldWrapper=ht,exports.InlineMessage=dt,exports.Input=we,exports.InputField=Eo,exports.Label=Be,exports.Link=ut,exports.List=mt,exports.Loader=lt,exports.MarkdownContent=Co,exports.NavigationMenu=pe,exports.NotificationBadge=Vs,exports.NumberInput=da,exports.NumberInputField=Fo,exports.PasswordField=No,exports.PasswordInput=ma,exports.Popover=le,exports.ProgressBar=Mo,exports.RadioButton=pt,exports.RadioButtonField=ua,exports.RadioButtonGroup=Yt,exports.RadioCard=Lo,exports.RadioCardGroup=Ks,exports.SearchField=Po,exports.SearchInput=bt,exports.Select=vt,exports.SelectField=Wo,exports.Sidedrawer=Z,exports.Slider=Ce,exports.SliderField=Ho,exports.Stack=Le,exports.StackContent=na,exports.Stepper=Qe,exports.StyledButton=Ra,exports.StyledLink=qa,exports.Switch=qo,exports.Table=I,exports.Tabs=Ze,exports.Text=L,exports.Textarea=fa,exports.TextareaField=Uo,exports.ToastProvider=Jo,exports.ToggleGroup=dd,exports.Tooltip=K,exports.TopBar=he,exports.Video=Ko,exports.createTheme=Pr,exports.createThemeVariants=It,exports.css=Ar,exports.focusVisibleStyleBlock=be,exports.getCssText=Lr,exports.globalCss=Ca,exports.keyframes=D,exports.media=zt,exports.styled=l,exports.theme=_,exports.useAlert=Gn,exports.useCarousel=di,exports.useDataTable=J,exports.utils=Dt;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ae=require("@radix-ui/react-accordion"),Y=require("react"),er=require("@atom-learning/theme"),ya=require("@stitches/react"),v=require("@atom-learning/icons"),O=require("color2k"),Ct=require("@radix-ui/react-slot"),tr=require("invariant"),oe=require("@radix-ui/react-alert-dialog"),ar=require("@radix-ui/react-visually-hidden"),or=require("uid"),ge=require("pure-react-carousel"),rr=require("@radix-ui/react-checkbox"),H=require("react-hook-form"),nr=require("@radix-ui/react-radio-group"),ir=require("react-hook-form-persist"),lr=require("dlv"),sr=require("@radix-ui/react-toggle-group"),De=require("@reach/combobox"),se=require("@tanstack/react-table"),cr=require("use-deep-compare-effect"),et=require("throttle-debounce"),fe=require("@dnd-kit/core"),dr=require("@dnd-kit/modifiers"),_e=require("@dnd-kit/sortable"),mr=require("@dnd-kit/utilities"),ze=require("@radix-ui/react-tooltip"),ur=require("dayzed"),$e=require("@radix-ui/react-popover"),pr=require("dayjs"),hr=require("dayjs/plugin/customParseFormat"),_=require("@radix-ui/react-dialog"),Ie=require("@radix-ui/react-dropdown-menu"),gr=require("mdast-util-directive"),fr=require("mdast-util-from-markdown"),$r=require("micromark-extension-directive"),br=require("@radix-ui/react-navigation-menu"),vr=require("@radix-ui/react-progress"),tt=require("@radix-ui/react-slider"),yr=require("@radix-ui/react-switch"),at=require("@radix-ui/react-tabs"),St=require("react-hot-toast"),xr=require("react-player/vimeo");function U(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}function ee(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if(o!=="default"){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}}),t.default=e,Object.freeze(t)}var a=ee(Y),u=U(Y),wr=ee(er),Te=U(tr),kt=ee(ar),xa=ee(rr),Re=ee(nr),Er=U(ir),Cr=U(lr),ot=ee(sr),Sr=U(cr),qe=U(pr),kr=U(hr),Dr=ee(_),zr=U(gr),Ir=U(fr),Tr=U($r),ce=ee(br),wa=ee(vr),Ea=ee(yr),Rr=U(St),Fr=U(xr);const Dt={bg:e=>({background:e}),size:e=>({height:e,width:e}),p:e=>({padding:e}),pt:e=>({paddingTop:e}),pr:e=>({paddingRight:e}),pb:e=>({paddingBottom:e}),pl:e=>({paddingLeft:e}),px:e=>({paddingLeft:e,paddingRight:e}),py:e=>({paddingTop:e,paddingBottom:e}),m:e=>({margin:e}),mt:e=>({marginTop:e}),mr:e=>({marginRight:e}),mb:e=>({marginBottom:e}),ml:e=>({marginLeft:e}),mx:e=>({marginLeft:e,marginRight:e}),my:e=>({marginTop:e,marginBottom:e})},zt={sm:"(min-width: 550px)",md:"(min-width: 800px)",lg:"(min-width: 1100px)",xl:"(min-width: 1350px)",reducedMotion:"(prefers-reduced-motion)",allowMotion:"(prefers-reduced-motion: no-preference)",hover:"(hover: hover)"},Nr=ya.createStitches({theme:wr,utils:Dt,media:zt}),{css:Mr,getCssText:Ar,createTheme:Lr,globalCss:Ca,keyframes:D,styled:l,theme:q}=Nr,It=(e,t)=>Object.keys(q[e]).reduce((o,r)=>({...o,[r]:JSON.parse(JSON.stringify(t).replace(/\$key/g,`$${e}$${r}`))}),{}),w=l("div",{});w.displayName="Box";const Fe=({css:e,children:t})=>e?a.createElement(w,{css:e},t):a.createElement(a.Fragment,null,t);Fe.displayName="CSSWrapper";const Q=(e,t)=>({"&::before":{content:"''",mb:`-${e}em`,display:"table"},"&::after":{content:"''",mt:`-${t||e}em`,display:"table"}}),Pr={chevron:e=>`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" stroke="${e}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" color="${e}"><polyline points="6 10 12 16 18 10"/></svg>`,search:e=>`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" stroke="${e}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" color="${e}"><path d="M14.4121122,14.4121122 L20,20"></path><circle cx="10" cy="10" r="6"></circle></svg>`},Sa=(e,t)=>`url(data:image/svg+xml;charset=US-ASCII,${encodeURIComponent(Pr[t](O.toHex(e)))})`,be=({position:e="relative",zIndex:t=1}={})=>({outline:"none",position:["relative","absolute","fixed","sticky"].includes(e)?e:"relative",zIndex:t>1?t:1,boxShadow:"white 0px 0px 0px 2px, $colors$primary 0px 0px 0px 4px"}),Tt=D({"0%":{opacity:0,transform:"translateY(2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Rt=D({"0%":{opacity:0,transform:"translateX(-2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Ft=D({"0%":{opacity:0,transform:"translateY(-2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Nt=D({"0%":{opacity:0,transform:"translateX(2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Mt=D({"0%":{opacity:0},"100%":{opacity:1}}),rt=D({"0%":{opacity:1},"100%":{opacity:0}}),Wr=D({"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(0)"}}),Br=D({"0%":{transform:"translateX(0)"},"100%":{transform:"translateX(-100%)"}}),Or=D({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Hr=D({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),Vr=l(ae.Content,{border:0,width:"100%",bg:"$background",overflow:"hidden",'&[data-state="open"]':{borderRadius:"0 0 $0 $0"},"@allowMotion":{'&[data-state="open"]':{animation:`${Or} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Hr} 300ms ease-out`}}}),_r=({children:e,css:t,...o})=>u.default.createElement(Vr,{...o},u.default.createElement(Fe,{css:t},e)),qr=l(ae.Item,{width:"100%","&:not(:last-child)":{mb:"$1"}}),Gr=({children:e,value:t,...o})=>u.default.createElement(qr,{value:t,...o},e),ka=l("svg",{display:"inline-block",fill:"none",stroke:"currentcolor",strokeLinecap:"round",strokeLinejoin:"round",verticalAlign:"middle",variants:{size:{sm:{size:"$1",strokeWidth:"1.5"},md:{size:"$2",strokeWidth:"1.75"},lg:{size:"$3",strokeWidth:"2"}}}}),b=a.forwardRef(({is:e,size:t="md",...o},r)=>a.createElement(ka,{size:t,"aria-hidden":"true",...o,as:e,ref:r}));var jr="#F3F8FF",Yr="#E5F1FF",Ur="#D6EAFF",Xr="#C2DEFF",Jr="#B3D4FA",Kr="#057AFF",Qr="#0F67F5",Zr="#194DCC",en="#102DA3",tn="#15235E",Da={blue1:jr,blue2:Yr,blue3:Ur,blue4:Xr,blue5:Jr,blue6:Kr,blue7:Qr,blue8:Zr,blue9:en,blue10:tn},an="#F6F6F6",on="#EBEBEB",rn="#E0E0E0",nn="#CECECE",ln="#C2C2C2",sn="#757575",cn="#545454",dn="#333333",mn="#1F1F1F",un="#1C1C1C",At={slate1:an,slate2:on,slate3:rn,slate4:nn,slate5:ln,slate6:sn,slate7:cn,slate8:dn,slate9:mn,slate10:un};const pn=[255,255,255,1],nt=[.05,.1,.15,.2,.27,.35,.5,.7,.8,.95],Lt=e=>Math.round(Math.max(Math.min(e,255),0)),za=(e,t)=>{const o={};return Object.entries(t).forEach(([r,n],i)=>{const[s,c,d]=O.parseToRgba(n),[m,p,h]=pn,g=[Lt((s-m)/nt[i]+m),Lt((c-p)/nt[i]+p),Lt((d-h)/nt[i]+h),nt[i]];o[`${e}A${i+1}`]=`rgba(${g.join(",")})`}),o},re={},Ia=(e,t)=>{const o={};for(let r=1;r<=10;r++)o[`${e}${r}`]=`$${t}${r}`,o[`${e}A${r}`]=`$${t}A${r}`;return o},{styled:hn,createTheme:Ne}=ya.createStitches({theme:{colors:{background:"white",foreground:At.slate9,foreground6plus:"white",...Da,...za("blue",Da),...At,...za("slate",At)}},utils:Dt,media:zt});re["interactive-loContrast1"]=Ne("interactive-loContrast1",{colors:{interactiveForeground:"$foreground",interactive1:"white",interactive2:"$accent1",interactive3:"$accent2"}}),re["interactive-loContrast2"]=Ne("interactive-loContrast2",{colors:{interactiveForeground:"$foreground",interactive1:"$accent1",interactive2:"$accent2",interactive3:"$accent3"}}),re["interactive-hiContrast1"]=Ne("interactive-hiContrast1",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent7",interactive2:"$accent8",interactive3:"$accent9"}}),re["interactive-hiContrast2"]=Ne("interactive-hiContrast2",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent8",interactive2:"$accent9",interactive3:"$accent10"}});const gn={slate:"slate"},fn=()=>{Object.entries(gn).forEach(([e,t])=>{const o=`base-${e}`;re[o]=Ne(o,{colors:Ia("base",t)})})},$n={slate:"slate",blue:"blue"},bn=()=>{Object.entries($n).forEach(([e,t])=>{const o=`accent-${e}`;re[o]=Ne(o,{colors:Ia("accent",t)})})};fn(),bn();const vn=hn("div"),Pt=a.forwardRef(({base:e="",accent:t="",interactive:o="",className:r,asChild:n=!1,...i},s)=>{const c=[r,re[`interactive-${o}`],re[`accent-${t}`],re[`base-${e}`]].filter(Boolean).join(" ");return a.createElement(n?Ct.Slot:vn,{ref:s,className:c,...i})});Pt.displayName="ColorScheme";const yn=l(b,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"},'[data-state="closed"] > &':{transform:"rotate(0deg)"}}),xn=l(ae.Trigger,{border:0,py:"$3",px:"$4",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",bg:"$interactive2",color:"$interactiveForeground","&[data-disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([data-disabled])":{"&:active, &:hover, &:focus-visible":{bg:"$interactive3"},"&:focus-visible":{...be()}},'&[data-state="open"]':{borderRadius:"$0 $0 0 0"},'&[data-state="closed"]':{borderRadius:"$0"}}),wn=({children:e,colorScheme:t={},...o})=>u.default.createElement(Pt,{asChild:!0,accent:"slate",interactive:"loContrast1",...t},u.default.createElement(xn,{...o},e,u.default.createElement(yn,{is:v.ChevronDown}))),En=l(ae.Root,{width:"100%"}),Ge=u.default.forwardRef(({type:e="single",children:t,...o},r)=>u.default.createElement(En,{ref:r,type:e,...o},t));Ge.Item=Gr,Ge.Content=_r,Ge.Trigger=wn,Ge.displayName="Accordion";const Cn={xs:"sm",sm:"sm",md:"md",lg:"lg"},Me=(e,t,o)=>({bg:"transparent",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:t},"&:not(:disabled):active":{color:o},"&[disabled]":{color:"$tonal400",cursor:"not-allowed"}}),je=(e,t,o)=>({bg:e,color:"white","&:not(:disabled):hover, &:not(:disabled):focus":{bg:t,color:"white"},"&:not(:disabled):active":{bg:o},"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"}}),Ye=(e,t,o)=>({border:"1px solid",borderColor:"currentColor",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:t},"&:not(:disabled):active":{color:o},"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"}}),Sn=l("button",{alignItems:"center",appearance:"none",bg:"white",border:"unset",borderRadius:"$0",boxSizing:"border-box",cursor:"pointer",display:"flex",justifyContent:"center",p:"unset",transition:"all 100ms ease-out",variants:{theme:{neutral:{},primary:{},success:{},warning:{},danger:{}},appearance:{simple:{},outline:{},solid:{}},size:{xs:{size:"$2"},sm:{size:"$3"},md:{size:"$4"},lg:{size:"$5"}},isRounded:{true:{borderRadius:"$round"}}},compoundVariants:[{theme:"neutral",appearance:"simple",css:Me("$tonal300","$primaryMid","$primaryDark")},{theme:"primary",appearance:"simple",css:Me("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"simple",css:Me("$primaryDark",O.darken(q.colors.primaryDark.value,.1),O.darken(q.colors.primaryDark.value,.15))},{theme:"success",appearance:"simple",css:Me("$success","$successMid","$successDark")},{theme:"warning",appearance:"simple",css:Me("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"simple",css:Me("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"solid",css:je("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"solid",css:je("$primaryDark",O.darken(q.colors.primaryDark.value,.1),O.darken(q.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:je("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:je("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"solid",css:je("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"outline",css:Ye("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"outline",css:Ye("$primaryDark",O.darken(q.colors.primaryDark.value,.1),O.darken(q.colors.primaryDark.value,.15))},{theme:"success",appearance:"outline",css:Ye("$success","$successMid","$successDark")},{theme:"warning",appearance:"outline",css:Ye("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"outline",css:Ye("$danger","$dangerMid","$dangerDark")}]}),M=a.forwardRef(({children:e,theme:t="primary",appearance:o="simple",size:r="sm",label:n,href:i,disabled:s,...c},d)=>{const m=`A single ${b.displayName} component is permitted as a child of ${M.displayName}`;return Te.default(a.Children.count(e)===1,m),a.createElement(Sn,{...c,...i?{as:"a",href:s?null:i,onClick:void 0,"aria-disabled":!!s}:{type:"button"},"aria-label":n,theme:t,appearance:o,size:r,ref:d,disabled:s},a.Children.map(e,p=>{if(!a.isValidElement(p))throw new Error(m);return Te.default(p.type===b,`Children of type ${p==null?void 0:p.type} aren't permitted. Only an ${b.displayName} component is allowed in ${M.displayName}`),a.cloneElement(p,{size:Cn[r],css:{...p.props.css?p.props.css:{}}})}))});M.displayName="ActionIcon";const it=2147483647,Ue=1147483646,kn=10,Dn=10,zn=10,Wt="translate3d(-50%, -50%, 0)",Ta="translate3d(-50%, 50vh, 0)",In=D({"0%":{transform:Ta},"100%":{transform:Wt}}),Tn=D({"0%":{transform:Wt},"100%":{transform:Ta}}),Rn=l(oe.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${Mt} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),Fn=l(oe.Content,{bg:"white",borderRadius:"$1",boxShadow:"$3",boxSizing:"border-box",left:"50%",maxWidth:"90vw",p:"$5",position:"fixed",top:"50%",transform:Wt,"&:focus":{outline:"none"},zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${In} 550ms cubic-bezier(0.22, 1, 0.36, 1)`},'&[data-state="closed"]':{animation:`${Tn} 550ms cubic-bezier(0.22, 1, 0.36, 1)`}},variants:{size:{sm:{width:"380px"},md:{width:"480px"},lg:{width:"600px"}}}}),Nn=({size:e="sm",...t})=>a.createElement(oe.Portal,null,a.createElement(Rn,null),a.createElement(Fn,{size:e,...t})),Mn=l(oe.Root,{}),G=e=>a.createElement(Mn,{...e});G.Description=oe.Description,G.Title=oe.Title,G.Action=oe.Action,G.Cancel=oe.Cancel,G.Content=Nn,G.Trigger=oe.Trigger,G.displayName="AlertDialog";const An=()=>{const e=Y.useRef();return Y.useEffect(()=>(e.current=!0,()=>{e.current=!1})),e},z=l("div",{display:"flex"});z.displayName="Flex";const Ln=D({"0%":{opacity:0},"30%":{opacity:1},"50%":{opacity:1},"80%":{opacity:0},"100%":{opacity:0}}),Bt=l("div",{animationName:`${Ln}`,animationDuration:"1s",animationFillMode:"both",animationIterationCount:"infinite",animationTimingFunction:"linear",backgroundColor:"currentColor",borderRadius:"$round","&:nth-child(1)":{animationDelay:"-300ms"},"&:nth-child(2)":{animationDelay:"-150ms"},"&:nth-child(3)":{animationDelay:0},variants:{size:{sm:{size:"4px",mx:"2px"},md:{size:"6px",mx:"2px"},lg:{size:"8px",mx:"3px"}}}}),lt=({css:e={},message:t="Loading",size:o="md",...r})=>a.createElement(z,{css:{justifyContent:"center",...e},role:"alert",...r},a.createElement(kt.Root,null,t),a.createElement(Bt,{size:o}),a.createElement(Bt,{size:o}),a.createElement(Bt,{size:o})),Ot=(e,t,o)=>({border:"1px solid",borderColor:"currentColor",color:e,"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{textDecoration:"none",color:t},"&:not([disabled]):active":{color:o}}),Ae=(e,t,o,r="white")=>({bg:e,color:r,"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{bg:t,color:r},"&:not([disabled]):active":{bg:o}}),Ra=l("button",{alignItems:"center",bg:"unset",border:"unset",borderRadius:"$0",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:600,justifyContent:"center",p:"unset",textDecoration:"none",transition:"all 100ms ease-out",whiteSpace:"nowrap",width:"max-content",variants:{theme:{primary:{},secondary:{},success:{},warning:{},danger:{},neutral:{}},appearance:{solid:{},outline:{}},size:{sm:{fontSize:"$sm",lineHeight:1.53,height:"$3",px:"$4"},md:{fontSize:"$md",lineHeight:1.5,height:"$4",px:"$5"},lg:{fontSize:"$lg",lineHeight:1.5,height:"$5",px:"$5"}},isLoading:{true:{cursor:"not-allowed",opacity:.6,pointerEvents:"none"}},fullWidth:{false:{width:"max-content"},true:{width:"100%"}}},compoundVariants:[{theme:"primary",appearance:"solid",css:Ae("$primary","$primaryMid","$primaryDark")},{theme:"secondary",appearance:"solid",css:Ae("$primaryDark",O.darken(q.colors.primaryDark.value,.1),O.darken(q.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:Ae("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:Ae("$warning","$warningMid","$warningDark","$tonal500")},{theme:"danger",appearance:"solid",css:Ae("$danger","$dangerMid","$dangerDark")},{theme:"neutral",appearance:"solid",css:Ae("white",O.opacify("white",-.1),O.opacify("white",-.25),"$primary")},{theme:"primary",appearance:"outline",css:Ot("$primary","$primaryMid","$primaryDark")},{theme:"neutral",appearance:"outline",css:Ot("white",O.opacify("white",-.2),O.opacify("white",-.35))},{theme:"secondary",appearance:"outline",css:Ot("$primaryDark",O.darken(q.colors.primaryDark.value,.1),O.darken(q.colors.primaryDark.value,.15))}]}),Pn=({isLoading:e,children:t})=>a.createElement(a.Fragment,null,a.createElement(lt,{css:{opacity:e?1:0,position:"absolute",transition:"opacity 150ms"}}),a.createElement(w,{as:"span",css:e?{opacity:0,transition:"opacity 150ms"}:{}},t)),Wn=e=>{switch(e){case"lg":return 22;case"md":return 20;case"sm":default:return 16}},Fa=(e,t)=>a.Children.map(e,(o,r)=>(o==null?void 0:o.type)===b?a.cloneElement(o,{css:{[r===0?"mr":"ml"]:t==="sm"?"$2":"$3",size:Wn(t),...o.props.css?o.props.css:{}}}):o),ne=a.forwardRef(({children:e,isLoading:t,onClick:o,href:r,appearance:n="solid",size:i="md",theme:s="primary",type:c="button",...d},m)=>a.createElement(Ra,{isLoading:t||!1,onClick:t?void 0:o,appearance:n,size:i,theme:s,...d,...r?{as:"a",href:r,onClick:void 0}:{},...r?{}:{type:c},ref:m},typeof t=="boolean"?a.createElement(Pn,{isLoading:t},Fa(e,i)):Fa(e,i)));ne.displayName="Button";const Ht=l("h2",{fontFamily:"$display",fontWeight:700,m:0,variants:{size:{xs:{fontFamily:"$body",fontWeight:600,fontSize:"$md",lineHeight:1.5,...Q(.3864)},sm:{fontSize:"$lg",lineHeight:1.14,...Q(.2174,.2254)},md:{fontSize:"$xl",lineHeight:1.14,...Q(.2174,.2254)},lg:{fontSize:"$2xl",lineHeight:1.08,...Q(.1865,.1945)},xl:{fontSize:"$3xl",lineHeight:1.12,...Q(.206,.214)},xxl:{fontSize:"$4xl",lineHeight:1.06,...Q(.1793,.1873)}},noCapsize:{true:{"&::before, &::after":{display:"none"}}}}}),st=a.forwardRef(({size:e="md",...t},o)=>a.createElement(Ht,{ref:o,size:e,...t}));st.displayName="Heading";const Bn=l("div",{display:"flex","& > *":{m:0},variants:{direction:{row:{flexDirection:"row"},"row-reverse":{flexDirection:"row-reverse"},column:{flexDirection:"column"}},wrap:{wrap:{flexWrap:"wrap"},"no-wrap":{flexWrap:"no-wrap"},"wrap-reverse":{flexWrap:"wrap-reverse"}},justify:{start:{justifyContent:"flex-start"},center:{justifyContent:"center"},end:{justifyContent:"flex-end"},false:{}},align:{start:{alignItems:"flex-start"},center:{alignItems:"center"},end:{alignItems:"flex-end"},false:{}},gap:{...It("space",{mt:"-$key",ml:"-$key","& > *":{mt:"$key",ml:"$key"}}),false:{}}}}),Le=a.forwardRef(({css:e,gap:t=2,direction:o="row",wrap:r="wrap",justify:n="start",align:i,...s},c)=>a.createElement(Fe,{css:e},a.createElement(Bn,{ref:c,direction:o,gap:t,wrap:r,justify:n,align:typeof i>"u"&&o!=="column"?"center":i,...s})));Le.displayName="Stack";const Xe={size:{xs:{fontSize:"$xs",lineHeight:1.6,...Q(.4364)},sm:{fontSize:"$sm",lineHeight:1.53,...Q(.4056)},md:{fontSize:"$md",lineHeight:1.5,...Q(.3864)},lg:{fontSize:"$lg",lineHeight:1.52,...Q(.3983)},xl:{fontSize:"$xl",lineHeight:1.42,...Q(.3506)}},noCapsize:{true:{"&::before, &::after":{display:"none"}}}},Je=({size:e,noCapsize:t})=>({...Xe.size[e],...Xe.noCapsize[`${t}`]}),Vt=l("p",{fontFamily:"$body",fontWeight:400,margin:0,"& > &":{"&:before, &:after":{display:"none"}},variants:Xe}),L=a.forwardRef(({size:e="md",...t},o)=>a.createElement(Vt,{size:e,...t,ref:o}));L.displayName="Text";const On=({title:e,description:t,onAction:o,cancelActionText:r,confirmActionText:n,onClose:i,...s})=>a.createElement(G,{defaultOpen:!0},a.createElement(G.Content,{onEscapeKeyDown:c=>c.preventDefault(),onCloseAutoFocus:i,...s},a.createElement(st,{as:G.Title,size:"sm",css:{mb:"$5"}},e),t&&a.createElement(L,{as:G.Description,css:{mb:"$5"}},t),a.createElement(Le,{gap:"2",justify:"end"},r&&a.createElement(ne,{appearance:"outline",as:G.Cancel,onClick:()=>o(!1),size:"sm"},r),a.createElement(ne,{as:G.Action,onClick:()=>o(!0),size:"sm"},n)))),Hn=[],Vn=(e,t)=>{switch(t.type){case"ADD":return[...e,{...t.payload,id:or.uid()}];case"REMOVE":return e.filter(({id:o})=>o!==t.payload);default:return e}},Na=a.createContext({showAlert:()=>null}),_n=({children:e})=>{const[t,o]=a.useReducer(Vn,Hn),r=An();return a.createElement(Na.Provider,{value:{showAlert:n=>o({payload:n,type:"ADD"})}},Boolean(t.length)&&a.createElement(On,{...t[0],key:t[0].id,onClose:()=>{r.current&&o({payload:t[0].id,type:"REMOVE"})}}),e)},qn=()=>{const e=a.useContext(Na);if(e===void 0)throw new Error("useAlert must be used within a AlertProvider");return e},_t=(e,t)=>{let o;switch(typeof e){case"object":o={},Object.keys(e).forEach(r=>{const n=e[r];o[r]=n&&t(n)});break;default:o=t(e)}return o},Gn={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg",xxl:"lg"},jn=({is:e})=>{const t=a.useContext(qt),{size:o}=t,r=a.useMemo(()=>_t(o,n=>Gn[n]),[o]);return a.createElement(b,{size:r,is:e})},Ma=l("img",{verticalAlign:"middle",maxWidth:"100%",variants:{fluid:{true:{"&[width]":{width:"auto"},"&[width][height]":{height:"auto"},'&[src$=".svg"]':{width:"100%",height:"auto",maxWidth:"none"}}}}}),Pe=Ma;Pe.displayName="Image";const Aa=()=>a.createElement(w,{css:{position:"relative",size:"100%"}},a.createElement(b,{is:v.User,css:{size:"100%"}})),Yn={xs:"xs",sm:"sm",md:"sm",lg:"md",xl:"md",xxl:"lg"},La=()=>{const e=a.useContext(qt),{name:t,size:o}=e,r=a.useMemo(()=>_t(o,n=>Yn[n]),[o]);return t?a.createElement(L,{size:r,css:{color:"$tonal400"}},t[0].toUpperCase()):a.createElement(Aa,null)},Un=l(Pe,{size:"100%",objectFit:"cover"}),Xn=({src:e,alt:t})=>e?a.createElement(Un,{src:e,alt:t}):a.createElement(La,null),Pa={display:"flex",justifyContent:"center",alignItems:"center",color:"$tonal400",borderRadius:"$round",border:"2px solid $tonal100",backgroundColor:"$white",overflow:"hidden",variants:{size:{xs:{size:"$2"},sm:{size:"$3"},md:{size:"$4"},lg:{size:"$5"},xl:{size:"$6"},xxl:{size:"$7"}}}},Jn=l("div",Pa),Kn=l("button",{all:"unset",...Pa,"&:not([disabled])":{"&:hover":{borderColor:"$tonal400",backgroundColor:"$tonal50"},"&:active":{borderColor:"$primary",backgroundColor:"$tonal100"},"&:focus-visible":be()},"&[disabled]":{opacity:"30%",cursor:"not-allowed"}}),qt=a.createContext({name:void 0,size:"lg"}),Qn=({children:e,name:t,size:o})=>{const r=a.useMemo(()=>({name:t,size:o}),[t,o]);return a.createElement(qt.Provider,{value:r},e)},Zn=({children:e,size:t="lg",name:o,disabled:r=!1,onClick:n})=>a.createElement(Qn,{name:o,size:t},n?a.createElement(Kn,{size:t,disabled:r,onClick:r?void 0:n,css:{cursor:r?"auto":"pointer"}},e):a.createElement(Jn,{size:t},e)),We=Zn;We.Image=Xn,We.Initial=La,We.Placeholder=Aa,We.Icon=jn,We.displayName="Avatar";const ei=l(z,{justifyContent:"center",alignItems:"center",borderRadius:"$0",minWidth:0,border:"1px solid #FFFFFF",fontFamily:"$body","& > *:not(:last-child)":{mr:"$1"},variants:{theme:{success:{bg:"$successLight",color:"$successMid"},warning:{bg:"$warningLight",color:"$warningText"},danger:{bg:"$dangerLight",color:"$dangerMid"},neutral:{bg:"$tonal50",color:"$tonal400"},info:{bg:"$primaryLight",color:"$primaryMid"}},size:{xs:{fontSize:"$sm",px:"$1",height:"$2"},sm:{fontSize:"$md",px:"$1",height:"$3"},md:{fontSize:"$md",px:"$2",height:"$4"}}}}),Wa=({theme:e="info",size:t="sm",children:o,...r})=>a.createElement(ei,{role:"status",theme:e,size:t,...r},a.Children.map(o,n=>{if(typeof n=="string"||typeof n=="number")return a.createElement(w,{css:{whiteSpace:"nowrap",overflowX:"hidden",textOverflow:"ellipsis",py:"$0"}},n);if(a.isValidElement(n)&&n.type===b)return a.cloneElement(n,{size:"sm",css:{...n.props.css,flexShrink:0}})}));Wa.displayName="Badge";const Ba={alignItems:"center",bg:"unset",border:"unset",color:"$primary",cursor:"pointer",display:"flex",justifyContent:"center",p:"unset",size:"$5",top:"50%",transform:"translateY(-50%)",transition:"color 0.15s ease-in-out","&:hover":{color:"$primaryMid"},"&:active":{color:"$primaryDark"},"&:disabled":{color:"$tonal100"}},ti=l(ge.ButtonBack,Ba),ai=l(ge.ButtonNext,Ba),oi=e=>a.createElement(ti,{...e},a.createElement(b,{is:v.ChevronLeft})),ri=e=>a.createElement(ai,{...e},a.createElement(b,{is:v.ChevronRight})),ni=l(ge.DotGroup,{justifyContent:"center","& button":{bg:"$tonal200",border:"none",borderRadius:"50%",cursor:"pointer",mx:"$1",p:"$1",size:"$space$3",transition:"all 100ms ease-in",'&[class*="selected"]':{bg:"$primary"},"&:hover, &:focus":{bg:"$primaryMid"}}}),ii=l(ge.Slide,{}),li=({children:e,...t})=>a.createElement(ii,{...t,tag:"div"},a.createElement(w,{css:{px:"$3"}},e)),si=l(ge.Slider,{cursor:"grab",ml:"50%",overflow:"hidden",transform:"translateX(-50%)",'& [class*="sliderTray_"]':{p:"unset",m:"unset",transition:"transform .5s cubic-bezier(.645,.045,.355,1)"},'& [class*="slide_"]':{float:"left",pb:"0 !important"},'& [class*="slideInner"]':{display:"flex",justifyContent:"center"},variants:{overflow:{true:{overflow:"visible"}}}}),ve=({children:e,css:t,slideHeight:o,slideWidth:r,numSlides:n,...i})=>a.createElement(Fe,{css:t},a.createElement(ge.CarouselProvider,{naturalSlideWidth:r,naturalSlideHeight:o,totalSlides:n,...i},e)),ci=()=>a.useContext(ge.CarouselContext);ve.ArrowNext=ri,ve.ArrowPrevious=oi,ve.Pagination=ni,ve.Slide=li,ve.Slider=si,ve.displayName="Carousel";const di=l(xa.Indicator,{display:"flex",alignItems:"center",justifyContent:"center"}),mi=l(xa.Root,{appearance:"none",backgroundColor:"transparent",border:"1px solid $colors$tonal400",borderRadius:"3px",color:"white",cursor:"pointer",size:"$1",p:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 50ms ease-out",'&[data-state="checked"]':{backgroundColor:"$primary",borderColor:"$primary"},'&[data-state="indeterminate"]':{backgroundColor:"$primary",borderColor:"$primary"},"&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},"&[disabled]":{backgroundColor:"$tonal100",borderColor:"$tonal400",cursor:"not-allowed",color:"$tonal400"},variants:{state:{error:{borderColor:"$danger"}}}}),ct=a.forwardRef((e,t)=>a.createElement(mi,{...e,ref:t},a.createElement(di,null,a.createElement(b,{is:e.checked==="indeterminate"?v.Minus:v.Ok,css:{pointerEvents:"none",position:"absolute",strokeWidth:"3",size:14}}))));ct.displayName="Checkbox";const ui={success:{color:"$success"},warning:{color:"$warningText","& svg":{color:"$warningDark"}},info:{color:"$primary"},neutral:{color:"$tonal400"},error:{color:"$danger"}},pi={success:v.OkCircle,warning:v.Danger,info:v.Info,neutral:v.Info,error:v.Error},hi=l(z,{variants:{theme:ui}}),gi=l(b,{flexShrink:"0",mr:"$2"}),dt=({css:e,showIcon:t=!0,theme:o="error",size:r="sm",children:n,...i})=>a.createElement(hi,{theme:o,css:e,...i},t&&a.createElement(gi,{size:"sm",is:pi[o]}),a.createElement(L,{as:"span",size:r,css:{transform:"translateY($space$0)"}},n)),fi=l("label",{color:"$tonal500",fontFamily:"$body",m:0,variants:{size:{sm:Je({size:"sm"}),md:Je({size:"md"})},type:{block:{display:"block",fontWeight:600},inline:{display:"flex",fontWeight:400,maxWidth:"max-content"}},align:{start:{},center:{}},direction:{reverse:{},row:{}}},compoundVariants:[{type:"inline",align:"start",css:{alignItems:"flex-start"}},{type:"inline",align:"center",css:{alignItems:"center"}},{type:"inline",direction:"reverse",css:{flexDirection:"row-reverse"}},{type:"inline",direction:"row",css:{flexDirection:"row"}}]}),$i=l("span",{color:"$danger",ml:"$1",fontWeight:400}),Be=({align:e="start",as:t="label",direction:o="row",size:r="md",type:n="block",children:i,required:s,...c})=>a.createElement(fi,{as:t,size:r,type:n,align:e,direction:o,...c},i,s&&a.createElement($i,{"aria-hidden":!0},"*"));Be.displayName="Label";const Oe=l("li",{}),Oa=l("ul",{fontFamily:"$body",m:"unset",p:"unset",[`& > ${Oe}`]:{"&:not(:last-child)":{mb:"$2"},"&:last-child":{mb:0}},variants:{...Xe,as:{ol:{pl:"$4",listStyle:"decimal",[`& > ${Oe}`]:{pl:"$1","&::marker":{fontSize:"$sm",fontWeight:"bold"}}},ul:{pl:"$3",[`& > ${Oe}`]:{pl:"$2","&::marker":{content:"\u2022",fontWeight:"bold"}}}},theme:{primary:{[`& > ${Oe}`]:{"&::marker":{color:"$primary"}}}}}}),mt=a.forwardRef(({size:e="md",noCapsize:t=!0,ordered:o,...r},n)=>a.createElement(Oa,{ref:n,as:o?"ol":"ul",size:e,noCapsize:t,...r}));mt.Item=Oe;const bi=l(w,{bg:"$tonal100",borderRadius:"$1",color:"$tonal600",fontFamily:"$mono",fontSize:"$sm",lineHeight:1.4,my:"$4",p:"$3"}),vi=({node:e})=>a.createElement(bi,{as:"pre"},e.value),Ha=l("em",{fontStyle:"italic"}),yi=({node:e,handleNode:t})=>{var o;return a.createElement(Ha,null,(o=e.children)==null?void 0:o.map(t))},xi=e=>{switch(e){case 1:return{size:"xl",as:"h1"};case 2:return{size:"lg",as:"h2"};case 3:return{size:"md",as:"h3"};case 4:return{size:"sm",as:"h4"};case 5:return{size:"xs",as:"h5"};default:return{size:"xs",as:"h6"}}},wi=({node:e,handleNode:t,...o})=>{var r;const{as:n,size:i}=xi(e.depth);return a.createElement(st,{as:n,size:i,...o},(r=e.children)==null?void 0:r.map(t))},Ei=l(w,{bg:"$tonal100",borderRadius:"$0",color:"$tonal600",display:"inline-block",fontFamily:"$mono",fontSize:"85%",p:"$0 $1"}),Ci=({node:e})=>a.createElement(Ei,{as:"code"},e.value),Si=({node:e,css:t})=>{var o;return a.createElement(Pe,{src:e.url,alt:(o=e.alt)!=null?o:void 0,css:t})},ki=({node:e,handleNode:t})=>{var o,r;return a.createElement(ut,{title:(o=e.title)!=null?o:void 0,href:e.url},(r=e.children)==null?void 0:r.map(t))},Di=({node:e,handleNode:t,css:o})=>{var r;return a.createElement(mt,{css:{"& p:before, & p:after":{display:"none"},...o},ordered:e.ordered||void 0},(r=e.children)==null?void 0:r.map(t))},zi=({node:e,handleNode:t})=>{var o;return a.createElement(mt.Item,null,(o=e.children)==null?void 0:o.map(t))},Ii=({node:e,handleNode:t,...o})=>{var r;return a.createElement(L,{...o},(r=e.children)==null?void 0:r.map(t))},Ti=l("strong",{fontWeight:600}),Ri=({node:e,handleNode:t})=>{var o;return a.createElement(Ti,null,(o=e.children)==null?void 0:o.map(t))},Fi=({node:e})=>e.value,Va=l("hr",{border:0,bg:"$tonal100",variants:{orientation:{horizontal:{height:1,width:"100%"},vertical:{height:"100%",width:1,minHeight:"$3"}}}}),Gt=u.default.forwardRef(({orientation:e="horizontal",...t},o)=>u.default.createElement(Va,{ref:o,orientation:e,...t})),Ni=({css:e})=>a.createElement(Gt,{css:{width:"100%",...e}}),_a=l("a",{bg:"unset",border:"unset",p:"unset",color:"$primary",cursor:"pointer",fontFamily:"$body",textDecoration:"none","&:focus, &:hover":{color:"$primaryMid",textDecoration:"underline"},"&:active":{color:"$primaryDark"},[`${Vt} > &, ${Ht} > &, ${Oe} > &, ${Ha} > &`]:{fontSize:"100%",lineHeight:1,"&::before, &::after":{content:"none"}},variants:Xe}),ut=a.forwardRef(({size:e="md",href:t,...o},r)=>a.createElement(_a,{...!t&&{as:"button",noCapsize:!0},size:e,href:t,...o,ref:r}));ut.displayName="Link";const jt=({children:e,css:t})=>a.createElement(L,{size:"sm",css:{color:"$tonal300",maxWidth:"80ch",...t}},e),te=({css:e,children:t,error:o,fieldId:r,label:n,prompt:i,description:s,required:c,hideLabel:d})=>{const m=d?kt.Root:z;return a.createElement(w,{css:e},a.createElement(m,{css:{justifyContent:"space-between",alignItems:"center",mb:"$3"}},a.createElement(Be,{htmlFor:r,required:c},n),i&&a.createElement(ut,{href:i.link,size:"sm"},i.label)),s&&a.createElement(jt,{css:{mb:"$3"}},s),t,o&&a.createElement(dt,{css:{mt:"$2"}},o))};te.displayName="FieldWrapper";const Mi=l(Re.Item,{alignItems:"center",appearance:"none",backgroundColor:"transparent",border:"1px solid $tonal400",borderRadius:"$round",color:"white",cursor:"pointer",display:"flex",justifyContent:"center",p:0,size:"$1",transition:"all 50ms ease-out","&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},'&[data-state="checked"]':{backgroundColor:"$primary",borderColor:"$primary"},"&[disabled]":{backgroundColor:"$tonal100",borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"}}),Ai=l(Re.Indicator,{size:"6px",borderRadius:"$round",backgroundColor:"currentcolor",position:"absolute"}),pt=e=>a.createElement(Mi,{...e},a.createElement(Ai,null));pt.displayName="RadioButton";const Yt=l(Re.Root,{display:"flex",flexWrap:"wrap",variants:{direction:{row:{flexDirection:"row","& > *:not(:last-child)":{mr:"$5"}},column:{flexDirection:"column"}}}});Yt.displayName="RadioButtonGroup";const ht=({align:e="start",children:t,css:o,description:r,direction:n="row",error:i,label:s,required:c})=>a.createElement(w,{css:o},a.createElement(Be,{align:e,direction:n,required:c,type:"inline"},a.Children.map(t,d=>a.createElement(w,{css:{[n==="reverse"?"ml":"mr"]:"$3",...((d==null?void 0:d.type)===ct||(d==null?void 0:d.type)===pt)&&{transform:"translateY($space$1)"}}},d)),s),i&&a.createElement(dt,{css:{mt:"$2"}},i),r&&a.createElement(jt,{css:{mt:"$2",[n==="reverse"?"mr":"ml"]:"calc($space$3 + $sizes$1)"}},r));ht.displayName="InlineFieldWrapper";var qa=(e=>(e.LOCAL="local",e.SESSION="session",e))(qa||{});const Li=l("form",{}),Pi=({persist:e,watch:t,setValue:o,children:r})=>{const{id:n,...i}=e;let s={...i,storage:i.storage===qa.LOCAL?window.localStorage:window.sessionStorage};if(i.exclude){const{exclude:c,...d}=s,m=t(),p=Object.keys(m).filter(h=>{var g;if(!((g=i.exclude)!=null&&g.includes(h)))return h});s={...d,include:p}}return Er.default(n,{watch:t,setValue:o},s),r},Ga=({formMethods:e,handleSubmit:t,onSubmit:o,onError:r,children:n,...i})=>a.createElement(H.FormProvider,{...e},a.createElement(Li,{"aria-label":"form",...i,onSubmit:t(o,r)},n)),ja=({children:e,defaultValues:t={},onSubmit:o,onError:r,validationMode:n="onBlur",render:i,persist:s,...c})=>{Te.default(!(e&&i),"`Form` should only be given one of `children` or `render`. When both are provided, `render` will be used and `children` will be ignored.");const d=H.useForm({defaultValues:t,mode:n}),{handleSubmit:m,watch:p,setValue:h}=d,g=i?i(d):e,f={formMethods:d,handleSubmit:m,onSubmit:o,onError:r,...c};return s?a.createElement(Pi,{persist:s,watch:p,setValue:h},a.createElement(Ga,{...f},g)):a.createElement(Ga,{...f},g)};ja.displayName="Form";const ie=e=>{var t;const{errors:o}=H.useFormContext(),r=e.split(/[,[\].]+?/).filter(Boolean);return{error:(t=(()=>Cr.default(o,r))())==null?void 0:t.message}};var Wi=(e=>(e.ON="on",e.OFF="off",e))(Wi||{});const Ya=({css:e,defaultChecked:t=!1,label:o,name:r,validation:n,description:i,...s})=>{const{control:c}=H.useFormContext(),{error:d}=ie(r);return a.createElement(H.Controller,{control:c,name:r,defaultValue:t,rules:n,render:({onChange:m,value:p,name:h})=>a.createElement(ht,{css:e,description:i,error:d,label:o,required:Boolean(n==null?void 0:n.required)},a.createElement(ct,{defaultChecked:t,defaultValue:t?"on":"off",checked:p,name:h,onCheckedChange:m,value:p?"on":"off",...d&&{state:"error"},...s}))})};Ya.displayName="CheckboxField";const Ua={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Bi=l("span",{display:"inline-flex",alignItems:"center",px:"$1",flexGrow:1,...Ua,"& > *:not(:last-child)":{mr:"$1"}}),Oi={sm:"sm",md:"sm",lg:"md"},Hi=l(b,{flexShrink:0}),Xa=({...e})=>{const t=a.useContext(Ja),{size:o}=t,r=a.useMemo(()=>_t(o,n=>Oi[n]),[o]);return a.createElement(Hi,{...e,size:r})},Vi=({children:e,...t})=>{const o=a.Children.toArray(e),r=o.length<=1;return a.createElement(Bi,{...t},o.map(n=>!r&&typeof n=="string"?a.createElement(w,{as:"span",css:Ua,key:n},n):a.isValidElement(n)&&n.type===b?a.createElement(Xa,{...n.props}):n))},_i=l(z,{px:"$2",border:"1px solid",borderRadius:"$0",alignItems:"center",fontFamily:"$body",maxWidth:"100%",borderColor:"$primary",color:"$primaryMid",bg:"$primaryLight","&[data-disabled]":{opacity:"0.3",pointerEvents:"none"},variants:{size:{sm:{height:"$2",...Je({size:"sm"})},md:{height:"$3",...Je({size:"sm"})},lg:{height:"$4",...Je({size:"md"})}}}}),Ja=a.createContext({}),qi=({size:e,children:t})=>{const o=a.useMemo(()=>({size:e}),[e]);return a.createElement(Ja.Provider,{value:o},t)},Gi=a.forwardRef(({asWorkaround:e,size:t="md",...o},r)=>a.createElement(qi,{size:t},a.createElement(_i,{ref:r,as:e,size:t,...o}))),de=Gi;de.Content=Vi,de.Icon=Xa,de.displayName="Chip";const Ut=a.forwardRef(({gap:e=2,...t},o)=>a.createElement(Le,{ref:o,direction:"row",gap:e,align:!1,...t})),Xt=a.createContext({isDismissed:!1,setIsDismissed:()=>null}),ji=({children:e,disabled:t})=>{const[o,r]=a.useState(!1),n=a.useMemo(()=>({disabled:t,isDismissed:o,setIsDismissed:r}),[t,o]);return a.createElement(Xt.Provider,{value:n},e)},Yi=({asChild:e=!1,value:t,onDismiss:o,...r})=>{const n=a.useContext(Xt),{isDismissed:i,disabled:s}=n;if(a.useEffect(()=>{i&&(o==null||o(t))},[i]),i)return null;const c={...s&&{["data-disabled"]:""},...r};return a.createElement(e?Ct.Slot:"div",{...c})},Ui=({disabled:e=!1,...t})=>a.createElement(ji,{disabled:e},a.createElement(Yi,{...t})),Xi=e=>a.createElement("button",{type:"button",...e},"Dismiss"),Ka=({asChild:e=!1,...t})=>{const o=a.useContext(Xt);if(o===void 0)throw new Error("Dismissible.Trigger can only be used within a Dismissible.Item");const{setIsDismissed:r,disabled:n}=o,i={disabled:n,onClick:()=>{r(!0)},...t};return a.createElement(e?Ct.Slot:Xi,{...i})},gt=Ui;gt.Trigger=Ka,gt.displayName="Dismissible";const Qa=a.createContext({onDismiss:()=>null}),Ji=({children:e,disabled:t,onDismiss:o})=>{const r=a.useMemo(()=>({disabled:t,onDismiss:o}),[t,o]);return a.createElement(Qa.Provider,{value:r},e)},Ki=({as:e="div",disabled:t,onDismiss:o,...r})=>a.createElement(Ji,{disabled:t,onDismiss:o},a.createElement(e,{...r})),Qi=({children:e,disabled:t=!1,...o})=>{const r=a.useContext(Qa);if(r===void 0)throw new Error("DismissibleGroup.Item can only be used within a DismissibleGroup");const{onDismiss:n,disabled:i}=r;return a.createElement(gt,{disabled:i||t,onDismiss:n,...o},e)},ye=Ki;ye.Item=Qi,ye.Trigger=Ka,ye.displayName="DismissibleGroup";const Zi=l(de,{px:"$1"}),el=({size:e="md",children:t,dismissActionLabel:o="Dismiss",...r})=>a.createElement(ye.Item,{asChild:!0,...r},a.createElement(Zi,{size:e},a.createElement(de.Content,null,t),a.createElement(ye.Trigger,{asChild:!0},a.createElement(M,{label:o,css:{color:"$tonal200"},size:e==="sm"?"xs":"sm"},a.createElement(b,{is:v.Close}))))),tl=a.forwardRef((e,t)=>a.createElement(Ut,{as:ye,ref:t,...e})),Jt=tl;Jt.Item=el,Jt.displayName="ChipDismissibleGroup";const Za=l(b,{display:"none"}),al=l(de,{"&:not([disabled])":{cursor:"pointer","&:hover":{bg:"$tonal100",color:"$tonal600",borderColor:"currentColor"},"&:focus-visible":{...be()},'&[data-state="on"]':{"&:hover":{bg:"$white",color:"$primaryDark"}}},'&[data-state="off"]':{color:"$tonal400",bg:"$tonal50",borderColor:"$tonal200"},'&[data-state="on"]':{[`& ${Za}`]:{display:"block"}}}),ol=({size:e="md",children:t,...o})=>a.createElement(ot.Item,{...o,asChild:!0},a.createElement(al,{asWorkaround:"button"},a.createElement(Za,{is:v.Ok,size:e==="lg"?"md":"sm"}),a.createElement(de.Content,null,t))),rl=a.forwardRef((e,t)=>a.createElement(Ut,{ref:t,as:ot.Root,orientation:"horizontal",...e})),Kt=rl;Kt.Item=ol,Kt.displayName="ChipToggleGroupItem";const nl=l(De.ComboboxInput,{boxShadow:"none",fontSize:"$md",appearance:"none",backgroundImage:Sa(q.colors.tonal300.value,"chevron"),backgroundPosition:"right $space$3 top 50%, 0 0",backgroundRepeat:"no-repeat, repeat",backgroundSize:"20px auto, 100%",border:"1px solid $tonal300",borderRadius:"$0",boxSizing:"border-box",color:"$tonal600",cursor:"text",display:"block",fontFamily:"$body",height:"$4",pl:"$3",pr:"$6",transition:"all 100ms ease-out",width:"100%","&::placeholder":{color:"$tonal300",opacity:1},"&:focus-within":{borderColor:"$primary",outline:"none"},"&[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},variants:{state:{error:{border:"1px solid $danger"}}}}),il=l(De.ComboboxList,{listStyle:"none",m:0,p:0,userSelect:"none"}),ll=l(De.ComboboxOption,{color:"$tonal500",cursor:"pointer",m:0,p:"$2",'&:hover, &[aria-selected="true"]':{bg:"$tonal50",borderRadius:"$0"},"[data-user-value]":{color:"$primary"}}),sl=l(De.ComboboxPopover,{bg:"white",border:"solid 1px $tonal100",borderRadius:"$0",boxShadow:"$1",boxSizing:"border-box",fontFamily:"$body",fontSize:"$md",outline:"none",p:"$1",transform:"translateY($space$2)"});Ca({":root":{"--reach-combobox":1}})();const cl=l(De.Combobox,{}),xe=e=>a.createElement(cl,{...e});xe.displayName="Combobox",xe.Option=ll,xe.Input=nl,xe.Popover=sl,xe.List=il,xe.OptionText=De.ComboboxOptionText;var X=(e=>(e.NONE="none",e.PENDING="pending",e.FULFILLED="fulfilled",e.REJECTED="rejected",e))(X||{});const dl=e=>{if(e[0])return e[0].desc?"desc":"asc"},ml=async(e,t,o,r,n)=>{var i,s,c,d,m,p;const{pageIndex:h,pageSize:g}=o,f={pageIndex:(i=t==null?void 0:t.pageIndex)!=null?i:h,pageSize:(s=t==null?void 0:t.pageSize)!=null?s:g,sortBy:(d=t==null?void 0:t.sortBy)!=null?d:(c=r[0])==null?void 0:c.id,sortDirection:(m=t==null?void 0:t.sortDirection)!=null?m:dl(r),globalFilter:(p=t.globalFilter)!=null?p:n},$=await e(f);return Te.default(Array.isArray($==null?void 0:$.results),"The getAsyncData function must return an object with a property `result` which must be an array"),Te.default($&&Number.isInteger($.total)&&$.total>=0,"The getAsyncData function must return an object with a property `total` which must be a positive integer or zero"),$},ul={pageIndex:0,pageSize:10},pl=e=>{const[t,o]=u.default.useState(!!e),[r,n]=u.default.useState({...ul,...e||{}}),i=u.default.useCallback(()=>{o(!0)},[]);return{isPaginated:t,paginationState:r,setPaginationState:n,applyPagination:i}},hl=e=>{const[t,o]=u.default.useState(!1),[r,n]=u.default.useState(e?[{id:e.column,desc:e.direction==="desc"}]:[]);return{isSortable:t,setIsSortable:o,sorting:r,setSorting:n}},eo=a.createContext(null),gl=({columns:e,data:t=[],getAsyncData:o,defaultSort:r,initialState:n=void 0,children:i})=>{var s;const[c,d]=a.useState({results:t!=null?t:[],total:(s=t==null?void 0:t.length)!=null?s:0}),{isPaginated:m,applyPagination:p,paginationState:h,setPaginationState:g}=pl(n==null?void 0:n.pagination),[f,$]=a.useState(X.NONE),[y,C]=a.useState(""),{setIsSortable:E,isSortable:T,sorting:x,setSorting:S}=hl(r),F=a.useCallback(async N=>{if(o)try{$(X.PENDING);const V=await ml(o,N,h,x,y);d(V),$(X.FULFILLED)}catch{$(X.REJECTED)}},[o,h==null?void 0:h.pageIndex,h==null?void 0:h.pageSize,x,y]);a.useEffect(()=>{F({})},[F]),Sr.default(()=>{!t||d({results:t,total:t.length})},[t]);const A=()=>c.total,P=se.useReactTable({columns:e,data:c.results,pageCount:h?Math.ceil(A()/h.pageSize):-1,initialState:n,state:{sorting:x,globalFilter:y,pagination:h},manualPagination:o&&m,manualSorting:o&&m,enableSorting:f!==X.PENDING,enableGlobalFilter:!o,getCoreRowModel:se.getCoreRowModel(),getPaginationRowModel:m?se.getPaginationRowModel():void 0,getSortedRowModel:T||x.length?se.getSortedRowModel():void 0,getFilteredRowModel:se.getFilteredRowModel(),onPaginationChange:m?g:void 0,onSortingChange:S,onGlobalFilterChange:C}),R=a.useMemo(()=>({...P,data:c,setData:d,setIsSortable:E,applyPagination:p,getTotalRows:A,isSortable:T,asyncDataState:f,runAsyncData:F}),[P,p,A,T]);return a.createElement(eo.Provider,{value:R},i)},J=()=>{const e=a.useContext(eo);if(!e)throw new Error("useDataTable can only be called from inside a DataTableProvider");return e},ft=l("tr",{bg:"unset"}),to=a.forwardRef((e,t)=>a.createElement(ft,{...e,ref:t}));to.displayName="TableRow";const fl=l("tbody",{variants:{striped:{true:{[`${ft}`]:{"&:nth-child(odd)":{bg:"white"},"&:nth-child(even)":{bg:"$tonal50"}}},false:{[`${ft}`]:{bg:"white"}}}}}),ao=({striped:e=!0,...t})=>a.createElement(fl,{striped:e,...t});ao.displayName="TableBody";const He=l("td",{borderBottom:"1px solid $tonal100",boxSizing:"border-box",color:"$tonal400",fontFamily:"$body",lineHeight:1.5,p:"$2 $3",textAlign:"left",verticalAlign:"middle","&:first-child":{fontWeight:"bold"}});He.displayName="TableCell";const oo=l("tfoot",{});oo.displayName="TableFooter";const $t=l("td",{color:"$tonal400",fontFamily:"$body",fontWeight:600,p:"$2 $3",textAlign:"left",verticalAlign:"middle"});$t.displayName="TableFooterCell";const me=l("th",{color:"white",fontFamily:"$body",fontWeight:600,lineHeight:1.5,p:"$2 $3",textAlign:"left",verticalAlign:"middle"});me.displayName="TableHeaderCell";const Qt={PRIMARY:"primary",PRIMARY_DARK:"primaryDark",LIGHT:"light"},$l=l("thead",{variants:{theme:{[Qt.PRIMARY]:{[`${me}`]:{bg:"$primary"}},[Qt.PRIMARY_DARK]:{[`${me}`]:{bg:"$primaryDark"}},[Qt.LIGHT]:{[`${me}`]:{bg:"$tonal50",color:"$tonal600"}}}}}),ro=({theme:e="primaryDark",...t})=>u.default.createElement($l,{theme:e,...t});ro.displayName="TableHeader";const no=({children:e,numberOfStickyColumns:t=0,css:o,...r})=>{const[n,i]=u.default.useState(!1);return u.default.createElement(w,{onScroll:s=>{const c=s.currentTarget.scrollLeft>0;c!==n&&i(c)},role:"scrollbar",css:{overflow:"auto",maxWidth:"100%",[`& td:nth-of-type(${t}), th:nth-of-type(${t})`]:{...n&&{boxShadow:"$colors$alpha200 -2px -3px 9px 1px",clipPath:"inset(0px -10px 0px 0px)"},...t===1&&{position:"sticky",left:"0",zIndex:"2"}},"& td":{bg:"inherit"},...o},...r},e)},bl=l("table",{borderCollapse:"separate",borderSpacing:0,fontFamily:"$sans",fontSize:"$sm",width:"100%",variants:{size:{md:{[`${He}, ${me}, ${$t}`]:{height:"$4"}},lg:{[`${He}, ${me}, ${$t}`]:{height:"$5"}}},corners:{round:{[`${me}`]:{"&:first-of-type":{borderTopLeftRadius:"$0"},"&:last-of-type":{borderTopRightRadius:"$0"}},[`${ft}:last-child`]:{[`${He}:first-child`]:{borderBottomLeftRadius:"$0"},[`${He}:last-child`]:{borderBottomRightRadius:"$0"}}},square:{}}}}),I=({size:e="md",corners:t="round",numberOfStickyColumns:o=0,...r})=>{const n=a.createElement(bl,{size:e,corners:t,...r});return o?a.createElement(no,{numberOfStickyColumns:o},n):n};I.Body=ao,I.Cell=He,I.Footer=oo,I.FooterCell=$t,I.Header=ro,I.HeaderCell=me,I.Row=to,I.StickyColumnsContainer=no,I.displayName="Table";const vl=({striped:e=!1,...t})=>{const{getRowModel:o}=J();return a.createElement(I.Body,{...t,striped:e},o().rows.map(r=>a.createElement(W.Row,{row:r,key:r.id})))},Zt=({cell:e})=>a.createElement(I.Cell,{key:e.id},se.flexRender(e.column.columnDef.cell,e.getContext())),yl=({children:e})=>{const{asyncDataState:t,runAsyncData:o}=J();return t!==X.REJECTED?null:e(o)},xl=({children:e,hidden:t=!1})=>t?a.createElement(kt.Root,null,e):e?a.createElement(a.Fragment,null,e):null,io=l("input",{appearance:"none",border:"1px solid $tonal400",borderRadius:"$0",boxShadow:"none",boxSizing:"border-box",color:"$tonal600",cursor:"text",display:"block",fontFamily:"$body",px:"$3",transition:"all 100ms ease-out",width:"100%","&:focus":{borderColor:"$primary",outline:"none"},"&[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&::placeholder":{color:"$tonal300",opacity:1},variants:{size:{sm:{height:"$3",fontSize:"$sm"},md:{height:"$4",fontSize:"$md"}},state:{error:{border:"1px solid $danger"}}}}),we=a.forwardRef(({type:e="text",size:t="md",...o},r)=>e==="number"?a.createElement(io,{type:"text",inputMode:"numeric",pattern:"[0-9]*",size:t,...o,ref:r}):a.createElement(io,{type:e,size:t,...o,ref:r}));we.displayName="Input";const wl=()=>{const e=a.useRef(null),t=a.useCallback(o=>{o&&(e.current=o)},[]);return[e,t]},El=()=>{const[e,t]=a.useState(null),o=a.useCallback(r=>{r&&t(r)},[]);return[e,o]};var Cl=(e=>(e.SEARCH="SEARCH",e.CLEAR="CLEAR",e))(Cl||{});const Sl=l(b,{color:"$tonal300",position:"absolute",pointerEvents:"none",variants:{size:{sm:{top:"$2",right:"$2",size:"$1"},md:{top:10,right:10,size:20}}}}),kl=l(we,{'&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, & input[type="search"]::-webkit-search-results-decoration':{display:"none"}}),bt=a.forwardRef(({size:e="md",css:t,value:o,clearText:r="Clear",onChange:n,...i},s)=>{const[c,d]=wl(),[m,p]=a.useState(o||""),[h,g]=a.useState(o?"CLEAR":"SEARCH");a.useImperativeHandle(s,()=>c.current);const f=()=>{var C,E;const T=c.current;if(!T)return;const x=(C=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:C.set;(E=x==null?void 0:x.call)==null||E.call(x,T,"");const S=new Event("input",{bubbles:!0});T.dispatchEvent(S),T.focus()},$=C=>{p(C.target.value),g(C.target.value?"CLEAR":"SEARCH"),n==null||n(C)},y=()=>h==="SEARCH"?a.createElement(Sl,{is:v.Search,size:e,css:{size:e=="sm"?"$1":20}}):a.createElement(M,{label:r,theme:"neutral",size:e,css:{position:"absolute",top:"0",right:"$1"},onClick:f},a.createElement(b,{is:v.Close}));return a.createElement(w,{css:{position:"relative",...t}},a.createElement(kl,{ref:d,size:e,type:"search",...i,value:m,onChange:$,css:{pr:e==="sm"?"$5":"$6"}}),y())});bt.displayName="SearchInput";const Dl=({onChange:e,label:t,hideLabel:o=!1,...r})=>{const{setGlobalFilter:n,getState:i,resetPagination:s}=J(),{globalFilter:c}=i(),d=et.debounce(250,m=>{const{target:{value:p}}=m;e==null||e(m),s(),n(p)});return a.createElement(a.Fragment,null,a.createElement(xl,{hidden:o},a.createElement(Be,{css:{mb:"$3"},htmlFor:t},t)),a.createElement(bt,{...r,value:c,onChange:d,name:t}))},zl=({sortable:e=!0,theme:t="light",...o})=>{const{getHeaderGroups:r,setIsSortable:n}=J();return a.useEffect(()=>{n(e)},[e,n]),a.createElement(I.Header,{theme:t,...o},r().map(i=>a.createElement(I.Row,{key:i.id},i.headers.map(s=>a.createElement(W.HeaderCell,{header:s,key:s.id})))))},Il={asc:v.SortUp,desc:v.SortDown},Tl=({direction:e})=>a.createElement(b,{is:Il[e],size:"sm",css:{position:"absolute",left:"$1"}}),Rl=({header:e,children:t,css:o,...r})=>{const n=e.column.getIsSorted(),{isSortable:i}=J(),s=e.column.getCanSort();return a.createElement(I.HeaderCell,{onClick:i&&s?e.column.getToggleSortingHandler():void 0,css:{cursor:i&&s?"pointer":"initial",...o},...r},a.createElement(z,{css:{alignItems:"center"}},se.flexRender(e.column.columnDef.header,e.getContext()),n&&i&&a.createElement(z,{css:{position:"relative",alignItems:"center"}},a.createElement(Tl,{direction:n}))))},Fl=l(lt,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:1}),ea=e=>{const{asyncDataState:t}=J();return t!==X.PENDING?null:a.createElement(Fl,{...e})},Nl=({row:e})=>a.createElement(I.Row,null,e.getVisibleCells().map((t,o)=>a.createElement(Zt,{key:t.id,cell:t}))),Ml=({sortable:e,striped:t,theme:o,css:r,numberOfStickyColumns:n=0,...i})=>{const{asyncDataState:s}=J(),c=s===X.PENDING;return a.createElement(a.Fragment,null,a.createElement(ea,null),a.createElement(I,{...i,numberOfStickyColumns:n,css:{...r,...c&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},a.createElement(W.Head,{theme:o,sortable:e}),a.createElement(W.Body,{striped:t})))},lo=a.createContext({idColumn:"id"}),Al=()=>{const e=a.useContext(lo);if(!e)throw new Error("useDragAndDropTable can only be called within a DragAndDropContainer");return e},Ll=(e,t,o,r,n)=>{const{active:i,over:s}=e,c=o.indexOf(i.id),d=o.indexOf(s==null?void 0:s.id),m=_e.arrayMove(t.results,c,d);return n==null||n(c,d,m),{results:m,total:m.length}},Pl=(e,t)=>e.results.map(o=>{const r=o[t];if(r===void 0)throw new Error("To ensure drag-and-drop works correctly, please ensure that each row has a unique ID. Use the `id` property or pass DataTable an `idColumn` prop that defines the ID property on the rows.");return r}),Wl=({idColumn:e="id",onChange:t=void 0,children:o})=>{const{data:r,setData:n}=J(),i=a.useMemo(()=>Pl(r,e),[r]),s=fe.useSensors(fe.useSensor(fe.PointerSensor),fe.useSensor(fe.KeyboardSensor,{coordinateGetter:_e.sortableKeyboardCoordinates}));return a.createElement(fe.DndContext,{sensors:s,collisionDetection:fe.closestCenter,onDragEnd:c=>{const{active:d,over:m}=c;d.id&&(m==null?void 0:m.id)&&d.id!==(m==null?void 0:m.id)&&n(p=>Ll({active:d,over:m},p,i,e,t))},modifiers:[dr.restrictToVerticalAxis]},a.createElement(_e.SortableContext,{items:i,strategy:_e.verticalListSortingStrategy},a.createElement(lo.Provider,{value:{idColumn:e}},o)))},Bl=({row:e})=>{const{idColumn:t}=Al(),{attributes:o,listeners:r,transform:n,setNodeRef:i,isDragging:s}=_e.useSortable({id:e.original[t]});return a.createElement(I.Row,{ref:i,css:{transform:mr.CSS.Transform.toString(n),zIndex:s?5:void 0}},e.getVisibleCells().map((c,d)=>d===0?a.createElement(I.Cell,{key:c.id},a.createElement(Hl,{...o,...r,isDragging:s,css:{display:"inline-block"},label:"drag and drop"}),se.flexRender(c.column.columnDef.cell,c.getContext())):a.createElement(Zt,{key:c.id,cell:c})))},Ol=l(M,{color:"inherit !important",fill:"currentColor",variants:{isDragging:{true:{cursor:"grabbing"},false:{cursor:"grab"}}}}),Hl=a.forwardRef(({isDragging:e,size:t,...o},r)=>a.createElement(Ol,{ref:r,isDragging:e,appearance:"simple",size:t,...o},a.createElement(b,{is:v.DragHandle,size:t}))),Vl=({striped:e=!1,...t})=>{const{getRowModel:o}=J();return a.createElement(I.Body,{...t,striped:e},o().rows.map(r=>a.createElement(Bl,{row:r,key:r.id})))},_l=({idColumn:e,onDragAndDrop:t,sortable:o,striped:r,theme:n,css:i,...s})=>{const{asyncDataState:c}=J(),d=c===X.PENDING;return a.createElement(Wl,{onChange:t,idColumn:e},a.createElement(ea,null),a.createElement(I,{...s,css:{...i,...d&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},a.createElement(W.Head,{theme:n,sortable:o}),a.createElement(Vl,{striped:r})))},ql=l("select",{appearance:"none",backgroundColor:"white",backgroundImage:Sa(q.colors.tonal300.value,"chevron"),backgroundRepeat:"no-repeat, repeat",border:"1px solid $tonal300",borderRadius:"$0",color:"$tonal600",display:"block",fontFamily:"$body",fontWeight:400,lineHeight:1.4,transition:"all 75ms ease-out",width:"100%","&:hover":{cursor:"pointer"},"&:focus":{borderColor:"$primary",outline:"none"},"&::-ms-expand":{display:"none"},"&[disabled], > option[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},variants:{size:{sm:{backgroundPosition:"right $space$2 top 50%, 0 0",backgroundSize:"18px auto, 100%",fontSize:"$sm",height:"$3",pl:"$2",pr:"$5"},md:{backgroundPosition:"right $space$3 top 50%, 0 0",backgroundSize:"20px auto, 100%",fontSize:"$md",height:"$4",pl:"$3",pr:"$6"}},state:{error:{border:"1px solid $danger"}}}}),vt=a.forwardRef(({placeholder:e,children:t,size:o="md",...r},n)=>{const i={size:o,ref:n,...r};return[r.value,r.defaultValue].every(s=>s===void 0)&&(i.defaultValue=""),a.createElement(ql,{...i},e&&a.createElement("option",{disabled:!0,hidden:!0,value:""},e),t)});vt.displayName="Select";const Gl=l(ze.Content,{backgroundColor:"$tonal500",borderRadius:"$0",boxShadow:"$0",color:"white",fontFamily:"$body",fontSize:"$sm",lineHeight:1.5,whiteSpace:"normal",px:"$3",py:"$2",zIndex:Dn,"@allowMotion":{animationDuration:"75ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="delayed-open"]':{'&[data-side="top"]':{animationName:Ft},'&[data-side="right"]':{animationName:Nt},'&[data-side="bottom"]':{animationName:Tt},'&[data-side="left"]':{animationName:Rt}}},variants:{size:{sm:{maxWidth:"100px"},md:{maxWidth:"250px"},lg:{maxWidth:"400px"}}}}),jl=l(ze.Arrow,{fill:"$tonal500",'[data-align="end"] &':{mr:"$2"},'[data-align="start"] &':{ml:"$2"}}),Yl=({children:e,side:t="top",sideOffset:o=4,size:r="md",...n})=>a.createElement(Gl,{side:t,sideOffset:o,size:r,...n},e,a.createElement(jl,null)),K=({children:e,delayDuration:t=350,...o})=>a.createElement(ze.Root,{delayDuration:t,...o},e);K.Content=Yl,K.Trigger=l(ze.Trigger,{}),K.Portal=ze.Portal,K.Provider=ze.Provider,K.displayName="Tooltip";const so=({direction:e,...t})=>{const o=e==="next";return u.default.createElement(Xl,{appearance:"outline",icon:o?v.ChevronRight:v.ChevronLeft,isRounded:!0,label:o?"Next page":"Previous page",name:o?"Next page":"Previous page",size:"md",...t})},Ul=({gotoPage:e,pageCount:t,pageIndex:o,disabled:r})=>u.default.createElement(z,{css:{alignItems:"center"}},u.default.createElement(vt,{value:o,size:"sm",css:{mr:"$3"},disabled:r,onChange:n=>{e(Number(n.target.value))}},Array.from({length:t},(n,i)=>i).map(n=>u.default.createElement("option",{key:n,value:n},n+1))),u.default.createElement(L,{size:"sm",css:{flex:"none"}},`of ${t} ${t>1?"pages":"page"}`)),Xl=({icon:e,label:t,...o})=>u.default.createElement(K,null,u.default.createElement(K.Trigger,{asChild:!0},u.default.createElement(M,{label:t,...o},u.default.createElement(b,{is:e}))),u.default.createElement(K.Content,null,t)),Jl=l("nav",{display:"flex",justifyContent:"space-between",alignItems:"center",fontVariantNumeric:"tabular-nums"}),Kl=e=>{const{applyPagination:t,getState:o,getRowModel:r,getPageCount:n,previousPage:i,nextPage:s,setPageIndex:c,getTotalRows:d,asyncDataState:m}=J();a.useEffect(()=>{t()},[t]);const{pagination:p}=o(),h=p.pageIndex*p.pageSize+1,g=h+r().rows.length-1,f=m===X.PENDING||m===X.REJECTED;return a.createElement(Jl,{...e},a.createElement(L,{size:"sm"},`${h.toString()} - ${g.toString()} of ${d()} items`),a.createElement(Ul,{gotoPage:c,pageCount:n(),pageIndex:p.pageIndex,disabled:f}),a.createElement(z,{css:{justifyContent:"flex-end"}},a.createElement(so,{direction:"previous",disabled:p.pageIndex===0||f,onClick:i,css:{mr:"$4"}}),a.createElement(so,{direction:"next",disabled:p.pageIndex===n()-1||f,onClick:s})))},W=e=>a.createElement(gl,{...e});W.Body=vl,W.DataCell=Zt,W.DragAndDropTable=_l,W.Head=zl,W.HeaderCell=Rl,W.Pagination=Kl,W.Row=Nl,W.GlobalFilter=Dl,W.Table=Ml,W.Loading=ea,W.Error=yl;const Ql=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Zl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],co={open:"Open calendar",next:"Next month",previous:"Previous month",nextYear:"Next year",previousYear:"Previous year"},es=l("button",{bg:"transparent",border:"none",borderRadius:"$round",color:"$tonal900",cursor:"pointer",fontFamily:"$body",fontSize:"$sm",size:"$3",p:0,transition:"all 75ms","&:hover":{bg:"$tonal100"},"&:active":{color:"white",bg:"$primary"},"&:focus":{outline:"2px solid $primary",outlineOffset:"2px"},variants:{isSelected:{true:{bg:"$primary",color:"white","&:hover":{bg:"$primary"}}},isToday:{true:{bg:"$tonal100"}},isOutsideMonth:{true:{color:"$tonal200"}}}}),ta=l("div",{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gridGap:"$1 $2"}),ts=l(ne,{color:"$tonal600",p:"$3",width:"$6",variants:{selected:{false:{color:"$tonal600 !important",fontWeight:"400","&:hover":{bg:"$tonal100 !important",color:"$tonal600 !important"},"&[disabled]":{bg:"white !important"}}}}}),as=(e,t)=>{const o=e.slice(0,t);return e.slice(t).concat(o)},mo=({css:e,refDateSelected:t,refDateToday:o,firstDayOfWeek:r=0,monthNames:n=Ql,weekdayNames:i=Zl,labels:s=co,date:c=new Date,minDate:d,maxDate:m,setYear:p,...h})=>{const[g,f]=a.useState(!1),[$,y]=a.useState(c==null?void 0:c.getFullYear()),C=R=>{const N=c;N.setFullYear(R),p(N),f(!1)},E=d&&$-16<=d.getFullYear(),T=m&&$>=m.getFullYear(),x=Array.from({length:16},(R,N)=>{const V=$-N;return m&&V>m.getFullYear()||d&&V<d.getFullYear()?0:V}),{calendars:S,getBackProps:F,getForwardProps:A,getDateProps:P}=ur.useDayzed({firstDayOfWeek:r,showOutsideDays:!0,date:c,minDate:d,maxDate:m,...h});return S.length?a.createElement(w,{css:{position:"relative",width:"min-content",mt:"-$1",...e}},a.createElement(z,{css:{position:"absolute",top:0,right:"-$1"}},a.createElement(M,{label:s[g?"previousYear":"previous"],theme:"neutral",size:"md",...!g&&F({calendars:S}),...g&&{onClick:()=>y($-16)},disabled:g&&E},a.createElement(b,{is:v.ChevronLeft})),a.createElement(M,{label:s[g?"nextYear":"next"],theme:"neutral",size:"md",...!g&&A({calendars:S}),...g&&{onClick:()=>y($+16)},disabled:g&&T},a.createElement(b,{is:v.ChevronRight}))),g&&a.createElement(ta,{css:{gridTemplateColumns:"repeat(4, 1fr)",pt:"$7",direction:"rtl",gridGap:"$3 $1"}},x.map((R,N)=>{const V=R===c.getFullYear();return R?a.createElement(ts,{key:`${R}${N}`,theme:V?"primary":"neutral",onClick:()=>C(R),selected:V},R):a.createElement(w,{key:N,css:{width:"$6",height:"$4"}})})),!g&&S.map(({month:R,year:N,weeks:V})=>a.createElement(w,{key:`${R}${N}`},a.createElement(z,{css:{height:"$4",alignItems:"center",mb:"$4"}},a.createElement(ne,{theme:"neutral",css:{px:"0",color:"$tonal600"},onClick:()=>f(!0)},n[R]," ",N)),a.createElement(ta,{css:{mb:"$3"}},as(i,r).map(ke=>a.createElement(L,{as:"span",size:"sm",key:`${R}${N}${ke}`,css:{fontWeight:600,textAlign:"center"}},ke))),a.createElement(ta,null,V.map((ke,Et)=>ke.map((k,j)=>{const Ve=`${R}${N}${Et}${j}`;if(!k)return a.createElement("div",{key:Ve});const{date:Ko,selected:ba,today:va,prevMonth:Qo,nextMonth:Zo}=k;return a.createElement(es,{isOutsideMonth:Qo||Zo,isSelected:ba,isToday:va,key:Ve,ref:ba?t:va?o:null,...P({dateObj:k}),type:"button"},Ko.getDate())})))))):null};mo.displayName="Calendar";const os=l($e.Content,{bg:"white",borderRadius:"$1",boxShadow:"$2",maxWidth:"90vw",p:"$sizes$2",pr:"$6",position:"relative",zIndex:zn,"@allowMotion":{animationDuration:"75ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="open"]':{'&[data-side="top"]':{animationName:Ft},'&[data-side="right"]':{animationName:Nt},'&[data-side="bottom"]':{animationName:Tt},'&[data-side="left"]':{animationName:Rt}}},variants:{size:{sm:{maxWidth:"200px"},md:{maxWidth:"400px"},lg:{maxWidth:"600px"}}}}),rs=l($e.Arrow,{fill:"white",zIndex:1,'[data-align="end"] &':{mr:"$sizes$2"},'[data-align="start"] &':{ml:"$sizes$2"}}),ns=({children:e,side:t="top",sideOffset:o=8,closePopoverText:r="Close popover",showCloseButton:n=!0,size:i="md",...s})=>a.createElement(os,{size:i,side:t,sideOffset:o,...s},n&&a.createElement(M,{as:$e.Close,css:{position:"absolute",right:"$0",top:"$0"},label:r,size:"md",theme:"neutral"},a.createElement(b,{is:v.Close})),e,a.createElement(rs,{width:16,height:8}));l($e.Root,{});const le=e=>a.createElement($e.Root,{...e});le.Content=ns,le.Portal=$e.Portal,le.Trigger=$e.Trigger,le.displayName="Popover";const uo="DD/MM/YYYY";qe.default.extend(kr.default);const is=(e,t=uo)=>{const[o,r]=Y.useState(e?qe.default(e).toDate():void 0),[n,i]=Y.useState(e?qe.default(e).format(t):"");return{dateString:n,date:o,setDate:(s,c=!1)=>{const d=c?qe.default(s,t,!0):qe.default(s);r(d.isValid()?d.toDate():void 0),i(c?s:d.format(t))}}},aa=a.forwardRef(({initialDate:e,dateFormat:t=uo,firstDayOfWeek:o=1,disabled:r,monthNames:n,weekdayNames:i,size:s="md",labels:c,revalidate:d,onChange:m,minDate:p,maxDate:h,...g},f)=>{const{date:$,dateString:y,setDate:C}=is(e,t),E={...co,...c},[T,x]=a.useState(!1),S=a.useRef(null),F=a.useRef(null);return a.useEffect(()=>{m==null||m($)},[$,m]),a.createElement(w,{css:{position:"relative"}},a.createElement(we,{name:"date",disabled:r,size:s,...g,onChange:A=>C(A.target.value,!0),value:y,ref:f}),a.createElement(le,{modal:!0,open:T,onOpenChange:x},a.createElement(le.Trigger,{asChild:!0},a.createElement(M,{css:{position:"absolute",top:"0",right:"0"},disabled:r,label:E.open,size:s,theme:"neutral"},a.createElement(b,{is:v.CalendarEvent}))),a.createElement(le.Portal,null,a.createElement(le.Content,{css:{pr:"$sizes$2",zIndex:Ue},side:"bottom",align:"end",showCloseButton:!1,onOpenAutoFocus:A=>{var P,R;A.preventDefault(),$?(P=F.current)==null||P.focus():(R=S.current)==null||R.focus()}},a.createElement(mo,{date:$||new Date,selected:$,onDateSelected:async A=>{x(!1),await C(A.date,!1),d&&d()},setYear:async A=>{await C(A,!1),d&&d()},minDate:p,maxDate:h,refDateToday:S,refDateSelected:F,firstDayOfWeek:o,monthNames:n,weekdayNames:i,labels:E})))))});aa.displayName="DateInput";const po=({css:e,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c,trigger:d}=H.useFormContext(),{error:m}=ie(o),p=r?c(r):c;return a.createElement(te,{css:e,description:i,error:m,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(aa,{id:o,name:o,ref:p,...m&&{state:"error"},...s,revalidate:d}))};po.displayName="DateField";const oa=l(w,{width:"100vw",height:"100vh"}),ls=l(_.Close,{}),ra="translate3d(-50%, -50%, 0)",ho="translate3d(-50%, 50vh, 0)",go="modal_overlay",ss=D({"0%":{transform:ho},"100%":{transform:ra}}),cs=D({"0%":{transform:ra},"100%":{transform:ho}}),ds=l(_.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",overflowY:"auto",zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${Mt} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),ms=l(_.Content,{bg:"white",borderRadius:"$1",boxShadow:"$3",boxSizing:"border-box",left:"50%",maxWidth:"90vw",maxHeight:"90vh",overflowY:"auto",p:"$5",position:"fixed",top:"50%",transform:ra,zIndex:Ue,"&:focus":{outline:"none"},"@allowMotion":{'&[data-state="open"]':{animation:`${ss} 550ms cubic-bezier(0.22, 1, 0.36, 1)`},'&[data-state="closed"]':{animation:`${cs} 550ms cubic-bezier(0.22, 1, 0.36, 1)`}},variants:{size:{xs:{width:"380px"},sm:{width:"480px"},md:{width:"600px"},lg:{width:"800px"},xl:{width:"1100px"}}}}),us=({size:e="sm",children:t,closeDialogText:o="Close dialog",showCloseButton:r=!0,...n})=>a.createElement(_.Portal,null,a.createElement(ds,{id:go},a.Children.map(t,i=>(i==null?void 0:i.type)===oa&&i),a.createElement(ms,{size:e,"aria-label":"Dialog",onPointerDownOutside:i=>{const s=i.target;(s==null?void 0:s.id)!==go&&i.preventDefault()},...n},r&&a.createElement(M,{as:_.Close,css:{position:"absolute",right:"$4",top:"$4"},label:o,size:"md",theme:"neutral"},a.createElement(b,{is:v.Close})),a.Children.map(t,i=>(i==null?void 0:i.type)!==oa&&i)))),ps=l(_.Root,{}),ue=e=>a.createElement(ps,{...e});ue.Background=oa,ue.Close=ls,ue.Content=us,ue.Description=_.Description,ue.Title=_.Title,ue.Trigger=_.Trigger,ue.displayName="Dialog";const hs=l(Ie.Content,{bg:"white",borderRadius:"$0",boxShadow:"$0",py:"$2",zIndex:kn,"@allowMotion":{animationDuration:"250ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="open"]':{'&[data-side="top"]':{animationName:Ft},'&[data-side="right"]':{animationName:Nt},'&[data-side="bottom"]':{animationName:Tt},'&[data-side="left"]':{animationName:Rt}}}}),gs={alignItems:"center",color:"$tonal600",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:400,position:"relative",px:"$3",py:"$2","&[data-disabled]":{color:"$tonal200",pointerEvents:"none"},'&[aria-current="page"], &:focus':{"&::before":{borderLeft:"2px solid currentColor",content:"",height:"$2",left:0,outline:"none",position:"absolute",transform:"scale(1)"}},"&:focus":{color:"$primaryMid",outline:"none"},"&:hover":{textDecoration:"underline"}},fo=l(Ie.Item,gs),fs=l("a",{textDecoration:"none"}),$s=({children:e,href:t,...o})=>u.default.createElement(fo,{...o,asChild:!0},u.default.createElement(fs,{href:t,role:"menuitem"},e)),bs=l(Ie.Separator,{height:"1px",backgroundColor:"$tonal200",my:"$2"}),vs=l(Ie.Trigger,{}),ys=l(Ie.Root,{}),Ee=e=>u.default.createElement(ys,{...e});Ee.Content=hs,Ee.Item=fo,Ee.LinkItem=$s,Ee.Portal=Ie.Portal,Ee.Separator=bs,Ee.Trigger=vs;const $o=l(L,{color:"$tonal400",fontWeight:"400",variants:{size:{xs:{fontSize:"$sm",mb:"$4"},sm:{fontSize:"$sm",mb:"$4"},md:{fontSize:"$sm",mb:"$4"},lg:{fontSize:"$md",mb:"calc($4 + $2)"},xl:{fontSize:"$md",mb:"calc($4 + $2)"}}}}),xs=l(Pe,{variants:{size:{xs:{maxWidth:"56px",maxHeight:"32px",mb:"$4"},sm:{maxWidth:"84px",maxHeight:"48px",mb:"$4"},md:{maxWidth:"126px",maxHeight:"72px",mb:"$4"},lg:{maxWidth:"190px",maxHeight:"142px",mb:"calc($4 + $2)"},xl:{maxWidth:"285px",maxHeight:"213px",mb:"calc($4 + $2)"}}}}),bo=e=>u.default.createElement(xs,{...e}),vo=l("h2",{color:"$tonal400",fontFamily:"$body",fontWeight:"600",m:0,variants:{size:{xs:{fontSize:"$md",mb:"$3"},sm:{fontSize:"$md",mb:"$3"},md:{fontSize:"$md",mb:"$3"},lg:{fontSize:"$lg",mb:"$4"},xl:{fontSize:"$lg",mb:"$4"}}}}),ws=l(z,{flexDirection:"column",alignItems:"center",textAlign:"center","& > *:last-child":{mb:0},variants:{size:{xs:{p:"$2"},sm:{p:"$3"},md:{p:"$4"},lg:{p:"$5"},xl:{p:"$6"}}}}),Ke=({size:e="sm",children:t,...o})=>a.createElement(ws,{size:e,...o},a.Children.map(t,r=>a.isValidElement(r)&&(r.type===bo||r.type===vo||r.type===$o)?a.cloneElement(r,{...r.props,size:e}):r));Ke.displayName="EmptyState",Ke.Image=bo,Ke.Title=vo,Ke.Body=$o;const yo=({accept:e,children:t,multiple:o=!1,onFileSelect:r,...n})=>{const i=s=>{const{files:c}=s.target;r(c)};return a.createElement(ne,{as:"label",...n},a.createElement(b,{is:v.Upload}),t,a.createElement("input",{type:"file",onChange:i,accept:e,multiple:o,hidden:!0}))};yo.displayName="FileInput";const Es=l("div",{display:"grid",variants:{gap:It("space",{gap:"$key"})}}),xo=({css:e,gap:t=2,minItemSize:o,maxItemSize:r="1fr",...n})=>a.createElement(Es,{css:{...o&&{gridTemplateColumns:`repeat(auto-fit, minmax(${o}, ${r}))`},...e},gap:t,...n});xo.displayName="Grid";const wo=({css:e,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return a.createElement(te,{css:e,description:i,error:d,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(we,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};wo.displayName="InputField";const Cs=l("div",{"& > *":{"&:not(:first-child)":{mt:"$5"},"&:not(:last-child)":{mb:"$5"}},[`& > ${Ht}`]:{maxWidth:"65ch"},[`& > ${Vt}`]:{maxWidth:"75ch"},[`& > ${Oa}`]:{maxWidth:"75ch"},[`& > ${Va}`]:{my:"$5"},[`& > ${Ma}`]:{display:"block","&:not(:first-child)":{mt:"$6"},"&:not(:last-child)":{mb:"$6"}}}),na=a.forwardRef((e,t)=>a.createElement(Cs,{ref:t,...e}));na.displayName="StackContent";const Ss={code:vi,emphasis:yi,heading:wi,inlineCode:Ci,image:Si,link:ki,list:Di,listItem:zi,paragraph:Ii,strong:Ri,text:Fi,thematicBreak:Ni},ks=e=>{var t,o;if((t=e.position)!=null&&t.start){const{line:r,column:n,offset:i}=(o=e.position)==null?void 0:o.start;return`${e.type}${r}${n}${i}`}return`${e.type}${+new Date}`},Eo=({content:e,customComponents:t={},css:o})=>{const r=Ir.default(e,{extensions:[Tr.default()],mdastExtensions:[zr.default.fromMarkdown]}),n={...Ss,...t},i=s=>{const c=n[s.type];return c?a.createElement(c,{key:ks(s),node:s,handleNode:i}):null};return a.createElement(na,{css:o},r.children.map(i))};Eo.displayName="MarkdownContent";const Co=u.default.createContext(void 0),Ds=()=>{const e=u.default.useContext(Co);if(e===void 0)throw new Error("useNavigationMenuContext must be used within a NavigationMenuContextProvider");return e},yt=e=>{e.preventDefault()},zs=l("ul",{listStyle:"none",m:0,p:0}),Is=l(ce.Content,{p:"$3",bg:"white",mt:"4px",boxShadow:"$1",borderRadius:"$1"}),ia=({children:e})=>u.default.createElement(Is,{onPointerMove:yt,onPointerLeave:yt},u.default.createElement(zs,null,e));ia.displayName="NavigationMenuDropdownContent";const So={background:"none",color:"$tonal400",opacity:"30%",cursor:"default"},la={all:"unset",position:"relative",color:"$tonal400",outline:"none",cursor:"pointer",fontFamily:"$body",userSelect:"none",padding:"$3",borderRadius:"$1","&:hover":{background:"$tonal50",color:"$tonal600"},"&:active":{background:"$tonal100",color:"$tonal600"},"&:focus-visible":{boxShadow:"inset 0 0 0 2px $colors$primary"},"&:disabled":{...So}},ko={fontWeight:"600",color:"$tonal500","&::after":{backgroundColor:"$tonal500",borderRadius:"$1",bottom:0,content:"",display:"block",height:"2px",left:"50%",position:"absolute",transform:"translate(-50%,0)",width:"$2"}},Ts=l(ce.Trigger,la,{display:"flex",alignItems:"center",borderRadius:"$1",justifyContent:"space-between",'&[data-state="open"]':{background:"$tonal100"},variants:{active:{true:{...ko}}}}),sa=u.default.forwardRef(({children:e,active:t,...o},r)=>u.default.createElement(Ts,{active:t,...o,ref:r,onPointerMove:yt,onPointerLeave:yt},e,u.default.createElement(b,{is:v.ChevronDown,css:{ml:"$1","[data-state=open] &":{transform:"rotate(-180deg)"},"@media (prefers-reduced-motion: no-preference)":{transition:"transform .2s ease"}},size:"sm"})));sa.displayName="NavigationMenuDropdownTrigger";const Do=({children:e,id:t,...o})=>{const{onNodeUpdate:r}=Ds();return u.default.createElement(ce.Item,{value:t},u.default.Children.map(e,n=>{const i=u.default.isValidElement(n)&&n.type===sa,s=u.default.isValidElement(n)&&n.type===ia;if(!i&&!s)throw new Error('Only NavigationMenu.Trigger and NavigationMenu.Content can be the passed as a "children" of NavigationMenu.Dropdown');return i?u.default.cloneElement(n,{...o,ref:c=>r(c,t)}):n}))};Do.displayName="NavigationMenuDropdown";const Rs=l("button",{...la,...So}),Fs=l(ce.Item),Ns=l(ce.Link,la,{display:"block",textDecoration:"none",lineHeight:1,variants:{elementType:{dropdownItem:{"&[data-active]":{background:"$primaryLight",color:"$primary","*":{color:"$primary"},"&:hover":{background:"$tonal50"},"&:active":{background:"$tonal100"},"&:focus-visible":{boxShadow:"0 0 0 2px $colors$primary"}}},link:{"&[data-active]":{...ko}}}}}),ca=u.default.forwardRef(({children:e,href:t,disabled:o,css:r,variant:n="link",...i},s)=>u.default.createElement(Fs,null,o?u.default.createElement(Rs,{disabled:!0,...i},e):u.default.createElement(Ns,{href:t,ref:s,elementType:n,css:r,...i},e)));ca.displayName="NavigationMenuLink";const zo=u.default.forwardRef((e,t)=>u.default.createElement(ca,{ref:t,variant:"dropdownItem",...e})),Io=l(L,{color:"$tonal500",fontWeight:600});zo.displayName="NavigationMenuDropdownItem",Io.displayName="NavigationMenuDropdownItemTitle";const Ms=D({"0%, 50%":{opacity:0},"100%":{opacity:1}}),As=l(ce.Root,{display:"flex",justifyContent:"center",position:"relative"}),Ls=l(ce.List,{all:"unset",display:"flex",justifyContent:"center",alignItems:"center",gap:"$1",listStyle:"none"}),Ps=l(ce.Viewport,{zIndex:it}),Ws=l("div",{position:"absolute",left:0,top:"100%",width:"100%",display:"flex",justifyContent:"center"}),pe=({children:e,css:t})=>{const[o,r]=u.default.useState(),[n,i]=u.default.useState(),[s,c]=u.default.useState(0),d=u.default.useRef(null),m=200;u.default.useLayoutEffect(()=>{d.current&&c(d.current.offsetWidth)},[]),u.default.useEffect(()=>{let h;return n===""&&(h=setTimeout(()=>r(null),m)),()=>{h!==null&&clearTimeout(h)}},[n]);const p=(h,g)=>{if(h&&s&&n===g){const f=s/2,$=s-h.offsetLeft-h.offsetWidth+h.offsetWidth/2;r(Math.round(f-$))}return h};return u.default.createElement(Co.Provider,{value:{onNodeUpdate:p}},u.default.createElement(As,{onValueChange:i,css:t},u.default.createElement(Ls,{ref:d},e),u.default.createElement(Ws,null,u.default.createElement(Ps,{css:{transform:`translateX(${o||0}px)`,'&[data-state="open"]':{animation:`${Ms} ${m}ms ease`},'&[data-state="closed"]':{animation:`${rt} ${m}ms ease-out`}}}))))};pe.Link=ca,pe.Dropdown=Do,pe.DropdownContent=ia,pe.DropdownItem=zo,pe.DropdownItemTitle=Io,pe.DropdownTrigger=sa,pe.displayName="NavigationMenu";const Bs=l(w,{position:"relative"}),Os=l(z,{fontFamily:"$body",fontSize:"$sm",flexDirection:"column",justifyContent:"center",position:"absolute",top:"0",right:"0",transform:"translate(calc($sizes$2 / 2), -50%)",borderRadius:"$round",p:"$2",height:"$2",minWidth:"$2",textAlign:"center",color:"#fff",bg:"$primary"}),Hs=({value:e,children:t})=>u.default.createElement(Bs,null,!!e&&u.default.createElement(Os,{role:"status"},e),t),Vs=l("span",{zIndex:1}),_s=l(M,{borderColor:"$tonal400 !important",zIndex:1,"&:hover":{bg:"$tonal50",svg:{color:"$tonal400"}},svg:{color:"$tonal300"},"&:active":{bg:"$tonal100",svg:{color:"$tonal500"}},"&:disabled":{opacity:.3,pointerEvents:"none"}}),To=a.forwardRef((e,t)=>{const{icon:o,disabledTooltipContent:r,showTooltip:n,...i}=e;return a.createElement(K,null,a.createElement(K.Trigger,{asChild:!0},a.createElement(Vs,{tabIndex:-1},a.createElement(_s,{tabIndex:-1,appearance:"outline",ref:t,...i},a.createElement(b,{is:o})))),n&&a.createElement(K.Content,null,r))}),da=a.forwardRef((e,t)=>{const{name:o,min:r=0,max:n=Number.MAX_SAFE_INTEGER,step:i=1,initialValue:s=0,disabled:c=!1,readonly:d=!1,size:m="md",onChange:p,stepperButtonLabels:h,disabledTooltipContent:g,css:f,...$}=e,[y,C]=a.useState(s),E=a.useRef(null);a.useImperativeHandle(t,()=>E.current);const T={increment:"increment",decrement:"decrement",...h},x={decrement:`Cannot enter values below ${r}`,increment:`Cannot enter values above ${n}`,...g},S=y>=n,F=y<=r,A=a.useCallback(k=>Math.min(Math.max(k,r),n),[n,r]),P=a.useCallback(k=>{C(k),p==null||p(Number(k))},[p]),R=a.useCallback(k=>{const j=k.target.value.replace(/\D/g,"");P(j)},[P]),N=a.useCallback(()=>{var k;if(S||d)return;(k=E==null?void 0:E.current)==null||k.focus();let j;y===""?j=i:j=Number(y)+i,P(A(j))},[A,S,d,i,P,y]),V=a.useCallback(()=>{var k;if(F||d)return;(k=E==null?void 0:E.current)==null||k.focus();let j;y===""?j=r:j=Number(y)-i,P(A(j))},[A,F,d,r,i,P,y]),ke=a.useCallback(k=>{if(k.nativeEvent.isComposing)return;const j=k.key,Ve={ArrowUp:N,ArrowRight:N,ArrowDown:V,ArrowLeft:V,Home:()=>P(r),End:()=>P(n)}[j];Ve&&(k.preventDefault(),Ve(k))},[N,V,P,r,n]),Et={name:o,type:"number",value:y,...$,onChange:R,onKeyDown:ke,size:m,css:{borderRadius:"0px",width:"$6","&:disabled":{opacity:.3,pointerEvents:"none"}},ref:E,readOnly:d,disabled:c,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":Number(y),role:"spinbutton"};return a.createElement(z,{css:f},a.createElement(To,{onClick:V,icon:v.Minus,css:{borderRight:"none",borderTopRightRadius:"0px",borderBottomRightRadius:"0px"},size:m,disabled:F||c,showTooltip:F&&!c,disabledTooltipContent:x.decrement,label:T.decrement}),a.createElement(we,{...Et}),a.createElement(To,{onClick:N,icon:v.Plus,css:{borderLeft:"none",borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px"},size:m,disabled:S||c,showTooltip:S&&!c,disabledTooltipContent:x.increment,label:T.increment}))});da.displayName="NumberInput";const Ro=({css:e,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c,trigger:d}=H.useFormContext(),{error:m}=ie(o),p=r?c(r):c;return a.createElement(te,{css:e,description:i,error:m,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(da,{id:o,name:o,ref:p,...m&&{state:"error","aria-invalid":!0},...s,onChange:d}))};Ro.displayName="NumberInputField";const ma=a.forwardRef(({css:e,hidePasswordText:t="Hide password",showPasswordText:o="Show password",size:r="md",...n},i)=>{const[s,c]=Y.useState(!1),d=()=>c(m=>!m);return a.createElement(w,{css:{position:"relative",...e}},a.createElement(we,{...n,size:r,type:s?"text":"password",ref:i,css:{pr:"$sizes$2"}}),a.createElement(M,{appearance:"simple",theme:"neutral",css:{bottom:0,position:"absolute",right:0},label:s?t:o,onClick:d,onMouseDown:m=>m.preventDefault(),size:r},a.createElement(b,{is:s?v.Eye:v.EyeCrossed})))});ma.displayName="PasswordInput";const Fo=({css:e={},label:t="Password",name:o,prompt:r=void 0,description:n,validation:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=i?c(i):c;return a.createElement(te,{css:{...e,position:"relative"},description:n,error:d,fieldId:o,label:t,prompt:r,required:Boolean(i==null?void 0:i.required)},a.createElement(ma,{autoComplete:"current-password",name:o,id:o,ref:m,...s}))};Fo.displayName="PasswordField";const qs=l(wa.Root,{borderRadius:"$round",background:"$tonal100",height:"$0",position:"relative",overflow:"hidden",width:"100%",variants:{theme:{primary:{color:"$primary"},success:{color:"$success"},warning:{color:"$warning"},danger:{color:"$danger"}}}}),Gs=l(wa.Indicator,{backgroundColor:"currentcolor",borderRadius:"$round",boxSizing:"border-box",height:"100%",position:"absolute",transition:"all 300ms ease-out"}),No=({value:e,max:t=100,theme:o="primary",...r})=>a.createElement(qs,{value:e,max:t,theme:o,...r},a.createElement(Gs,{style:{width:"100%",transform:`translateX(-${100-(e||0)/t*100}%)`}}));No.displayName="ProgressBar";const Mo=({css:e,label:t,value:o,...r})=>a.createElement(ht,{css:e,label:t},a.createElement(pt,{value:o,...r}));Mo.displayName="RadioField";const js=l("fieldset",{all:"unset"}),ua=({children:e,css:t,direction:o="column",defaultValue:r,description:n,label:i,name:s,validation:c,onValueChange:d,...m})=>{const{control:p}=H.useFormContext(),{error:h}=ie(s);return a.createElement(js,{css:t},a.createElement(Be,{as:"legend",css:{p:0,mb:"$3"},required:Boolean(c==null?void 0:c.required)},i),n&&a.createElement(jt,{css:{mb:"$3"}},n),a.createElement(H.Controller,{control:p,name:s,rules:c,defaultValue:r,render:({onChange:g,value:f})=>a.createElement(Yt,{direction:o,defaultValue:r,onValueChange:$=>{g($),d==null||d($)},value:f,...m},e)}),h&&a.createElement(dt,{css:{mt:"$2"}},h))};ua.Item=Mo,ua.displayName="RadioButtonField";const Ys=l(Re.Item,{alignItems:"center",bg:"white",border:"1px solid $tonal200",borderRadius:"$0",cursor:"pointer",display:"flex",textAlign:"left",'&[data-state="checked"]':{outline:"2px solid $primary",outlineOffset:"-2px"},variants:{align:{left:{flexDirection:"row"},right:{flexDirection:"row-reverse"}},size:{md:{px:"$4",py:"$3"},lg:{px:"$5",py:"$4"}},isFullWidth:{true:{width:"100%"},false:{width:"max-content"}}}}),Us=l("div",{alignItems:"center",appearance:"none",backgroundColor:"transparent",border:"1px solid $tonal500",borderRadius:"$round",display:"flex",flexShrink:0,justifyContent:"center",p:0,size:"$1",transition:"all 50ms ease-out",'[data-state="checked"] &':{backgroundColor:"$primary",borderColor:"$primary"},variants:{containerIsFullWidth:{true:{},false:{}},align:{left:{mr:"$4"},right:{}}},compoundVariants:[{containerIsFullWidth:!0,align:"right",css:{ml:"auto"}},{containerIsFullWidth:!1,align:"right",css:{ml:"$4"}}]}),Xs=l(Re.Indicator,{backgroundColor:"white",borderRadius:"$round",position:"absolute",size:"6px"}),Ao=({children:e,isFullWidth:t=!1,size:o="md",align:r="left",...n})=>a.createElement(Ys,{...n,align:r,isFullWidth:t,size:o},a.createElement(Us,{align:r,containerIsFullWidth:t},a.createElement(Xs,null)),a.createElement(w,null,e)),Js=({css:e,children:t,size:o,isFullWidth:r,align:n,gap:i="3",justify:s,...c})=>a.createElement(Re.Root,{...c},a.createElement(Le,{direction:"row",justify:s,gap:i,css:e},a.Children.map(t,d=>a.isValidElement(d)&&(d==null?void 0:d.type)===Ao?a.cloneElement(d,{size:o,isFullWidth:r,align:n}):d))),Lo=({css:e,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return a.createElement(te,{css:e,description:i,error:d,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(bt,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Lo.displayName="SearchField";const Po=({css:e=void 0,children:t,name:o,label:r,validation:n,prompt:i,description:s,hideLabel:c,...d})=>{const{register:m}=H.useFormContext(),{error:p}=ie(o),h=n?m(n):m;return a.createElement(te,{css:e,description:s,error:p,fieldId:o,label:r,prompt:i,required:Boolean(n==null?void 0:n.required),hideLabel:c},a.createElement(vt,{name:o,id:o,...d,ref:h,...p&&{state:"error"}},t))};Po.displayName="SelectField";const Wo=l(ae.Root,{width:"100%"});Wo.displayName="SidedrawerAccordionRoot";const Ks=D({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Qs=D({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),Zs=l(ae.Content,{bg:"white",overflow:"hidden","@allowMotion":{'&[data-state="open"]':{animation:`${Ks} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Qs} 300ms ease-out`}}}),ec=({children:e,...t})=>u.default.createElement(Zs,{...t},u.default.Children.map(e,o=>u.default.createElement(w,{css:{"> a":{px:"$6"},"> button":{px:"$6"}}},o))),tc=l(ae.Item,{}),pa={alignItems:"center",bg:"white",border:"unset",borderLeft:"4px solid transparent",color:"$tonal600",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:"400",fontSize:"$md",margin:0,minHeight:"48px",outline:"unset",outlineOffset:"unset",py:"$3",px:"$4",width:"100%",textDecoration:"none","&:hover":{bg:"$tonal50"},"&:active":{bg:"$tonal100"},"&:focus-visible":{boxShadow:"inset 0 0 0 2px $colors$primary"},"&[disabled]":{opacity:"0.3",pointerEvents:"none",cursor:"default"},variants:{active:{true:{bg:"$primaryLight",borderLeft:"4px solid $primary",color:"$primary",fontWeight:"600"}}}},ac=l(ae.Trigger,{justifyContent:"space-between",m:0,p:0,"&[data-state=open]":{fontWeight:"600"},...pa}),oc=l(b,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"}}),rc=({children:e,...t})=>u.default.createElement(ae.Header,null,u.default.createElement(ac,{...t},u.default.createElement(z,{css:{alignItems:"center"}},e),u.default.createElement(oc,{is:v.ChevronDown,size:"sm"}))),nc=({children:e})=>{let t=!1;return u.default.Children.forEach(e,o=>{var r;Y.isValidElement(o)&&((r=o.props)==null?void 0:r.value)&&(t=!0)}),u.default.createElement(w,{css:{flexGrow:1,width:"100%",overflowY:"auto"}},t?u.default.createElement(Wo,{type:"single"},e):e)},ic=({appearance:e="simple",label:t="close",size:o="md",theme:r="neutral",...n})=>u.default.createElement(_.Close,{asChild:!0},u.default.createElement(M,{theme:r,appearance:e,size:o,label:t,...n},u.default.createElement(b,{is:v.Close}))),lc=l(_.Overlay,{animationFillMode:"forwards",bg:"$alpha600",cursor:"pointer",height:"100vh",left:"0",position:"fixed",top:"0",width:"100vw",zIndex:it-1,"@allowMotion":{'&[data-state="open"]':{animation:`${Mt} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),sc=l(_.Content,{bg:"white",boxShadow:"$2",display:"flex",flexDirection:"column",position:"fixed",top:0,left:0,height:"100%",maxWidth:"304px",width:"100%",zIndex:it,"@allowMotion":{'&[data-state="open"]':{animation:`${Wr} 250ms ease-out`},'&[data-state="closed"]':{animation:`${Br} 250ms ease-out`}}}),cc=({children:e,...t})=>u.default.createElement(_.Portal,null,u.default.createElement(lc,{"data-testid":"sidedrawer_overlay"}),u.default.createElement(sc,{role:"navigation",...t},e)),dc=l("footer",{alignItems:"center",borderTop:"1px solid $tonal100",bottom:0,boxShadow:"$3",display:"flex",height:"$6",justifyContent:"center",p:"$3",width:"100%"}),mc=({delay:e=500,delayMethod:t="throttle"}={})=>{const[o,r]=Y.useState({x:0,y:0}),n=Y.useMemo(()=>{if(t==="throttle")return et.throttle;if(t==="debounce")return et.debounce},[t]);return Y.useEffect(()=>{const i=n(e,()=>{r({x:window.scrollX,y:window.scrollY})});return window.addEventListener("scroll",i),()=>{window.removeEventListener("scroll",i)}},[n,e]),o},uc=u.default.forwardRef(({icon:e,...t},o)=>u.default.createElement(M,{size:"md",appearance:"simple",theme:"neutral",ref:o,...t},u.default.createElement(b,{is:e}))),xt=({src:e,alt:t="Atom Learning logo",css:o})=>u.default.createElement(Pe,{className:"topbar-brand-logo",src:e,alt:t,css:{mr:"$3",mb:"5px",...o}});xt.toString=()=>".topbar-brand-logo";const pc=l(L,{color:"$tonal400"}),hc=l("a",{display:"flex",alignItems:"center",textDecoration:"none",color:"$tonal400","&:hover, &:focus":{textDecoration:"none"}}),gc=()=>u.default.createElement(Gt,{orientation:"vertical",css:{height:"$2",bg:"$tonal100"}}),fc=l("div",{bg:"white",position:"sticky",display:"flex",alignItems:"center",width:"100vw",top:"0",zIndex:1,borderBottom:"1px solid $tonal100",transition:"box-shadow .2s ease-out",variants:{hasScrolled:{true:{boxShadow:"0px 4px 4px -2px rgba(31, 31, 31, 0.1);"}},size:{md:{height:"$6",[`& ${xt}`]:{'&[src$=".svg"]':{height:24,width:"auto"}}},lg:{height:"$7",[`& ${xt}`]:{'&[src$=".svg"]':{height:32,width:"auto"}}}}}}),$c=l(z,{alignItems:"center",height:"$4",mx:"$4",width:"100%","@md":{mx:"$5"}}),he=({size:e="md",...t})=>{const{y:o}=mc();return u.default.createElement(fc,{hasScrolled:!!o,size:e},u.default.createElement($c,{...t}))};he.Brand=hc,he.BrandLogo=xt,he.BrandName=pc,he.ActionIcon=uc,he.Divider=gc,he.displayName="TopBar";const bc=l("header",{"> div":{width:"100%"}}),vc=({children:e,...t})=>u.default.createElement(bc,{...t},u.default.createElement(he,{css:{mx:"$3"}},e)),yc=l("a",pa),xc=l("button",pa),wc=({active:e,children:t,disabled:o,href:r,onClick:n,...i})=>r?u.default.createElement(yc,{active:e,href:r,onClick:n,...i},t):u.default.createElement(xc,{active:e,disabled:o,onClick:n,...i},t),Ec=l(_.Trigger,{}),Z=({children:e,...t})=>u.default.createElement(Dr.Root,{...t},e);Z.Accordion=tc,Z.AccordionContent=ec,Z.AccordionTrigger=rc,Z.Body=nc,Z.Close=ic,Z.Content=cc,Z.Footer=dc,Z.Header=vc,Z.Item=wc,Z.Trigger=Ec;const Cc=l("div",{height:"$space$3",mt:"$3",position:"relative",width:"100%"}),Bo=(e,t,o)=>(e-t)/(o-t)*100,Sc=(e,t,o)=>{const r=Bo(e,t,o);return r<=10?0:r>=90?100:50},kc=({min:e,max:t,steps:o=[]})=>o.length===0?null:a.createElement(Cc,null,o.map(r=>a.createElement(L,{as:"span",key:r.value,css:{position:"absolute",color:"$tonal300"},style:{left:`${Bo(r.value,e,t)}%`,transform:`translateX(-${Sc(r.value,e,t)}%)`}},r.label))),Dc=({value:e=[],outputLabel:t=o=>`Current value is ${o}`})=>a.createElement(L,{css:{mt:"$4",color:"$tonal300",width:"100%"}},t(e.length===1?e[0]:e)),ha=l(tt.Track,{borderRadius:"$round",flexGrow:1,position:"relative",'&[data-orientation="horizontal"]':{height:"$space$1"},'&[data-orientation="vertical"]':{width:"$space$1"}}),zc=l(tt.Root,{alignItems:"center",display:"flex",position:"relative",touchAction:"none",userSelect:"none",cursor:"pointer",'&[data-orientation="horizontal"]':{height:"$1"},'&[data-orientation="vertical"]':{flexDirection:"column",width:"$1"},"&[data-disabled]":{cursor:"not-allowed",bg:"$tonal100"},variants:{theme:{light:{[`${ha}`]:{bg:"#fff"}},tonal:{[`${ha}`]:{bg:"$tonal200"}}}}}),Ic=l(tt.Range,{bg:"$primary",borderRadius:"$round",height:"100%",position:"absolute","&[data-disabled]":{bg:"$tonal200",cursor:"not-allowed"}}),Tc=l(tt.Thumb,{bg:"$primaryMid",borderRadius:"$round",display:"block",size:"$1","&:hover":{bg:"$primaryDark"},"&:focus":{outline:"2px solid $primaryMid",outlineOffset:"2px"},"&[data-disabled]":{bg:"$tonal200",cursor:"not-allowed"}}),Ce=({value:e,defaultValue:t,min:o=0,max:r=100,theme:n="tonal",css:i,children:s,...c})=>{const d=e||t;return a.createElement(Fe,{css:i},a.createElement(zc,{theme:n,defaultValue:t,value:e,min:o,max:r,...c},a.createElement(ha,null,a.createElement(Ic,null)),(d==null?void 0:d.length)&&d.map((m,p)=>a.createElement(Tc,{key:`thumb${p}`}))),s)};Ce.Value=Dc,Ce.Steps=kc,Ce.displayName="Slider";const Oo=({css:e,label:t,name:o,defaultValue:r,outputLabel:n,min:i=0,max:s=100,steps:c=[],...d})=>{const{control:m}=H.useFormContext();return u.default.createElement(te,{css:e,fieldId:o,label:t},u.default.createElement(H.Controller,{control:m,name:o,defaultValue:r,render:({onChange:p,value:h})=>u.default.createElement(Ce,{name:o,defaultValue:r,onValueChange:p,value:h,min:i,max:s,...d},u.default.createElement(Ce.Steps,{min:i,max:s,steps:c}),u.default.createElement(Ce.Value,{value:h||r,outputLabel:n}))}))};Oo.displayName="SliderField";const Ho=a.createContext({steps:[],goToPreviousStep:()=>null,goToNextStep:()=>null,goToStep:()=>null,activeStep:0,viewedSteps:[],allowSkip:!1,direction:"horizontal",hideLabels:!1,completedSteps:[],showCompletedIcons:!1}),Rc=({children:e,stepCount:t,allowSkip:o,onComplete:r,onStepChange:n,direction:i,steps:s,hideLabels:c,showCompletedIcons:d})=>{const[m,p]=a.useState(0),[h,g]=a.useState([0]),[f,$]=a.useState([]),y=!t;a.useEffect(()=>{g(x=>x.includes(m)?x:[...x,m]),n==null||n(m)},[m,n]);const C=()=>{const x=r&&m===t-1,S=m<t-1;if((r||S)&&$(F=>F.includes(m)?F:[...F,m]),x)return r==null?void 0:r();if(S)return p(F=>F+1)},E=()=>{p(x=>x-1)},T=x=>{p(x)};return a.createElement(Ho.Provider,{value:{steps:s||Array(t).fill(""),goToPreviousStep:y?void 0:E,goToNextStep:y?void 0:C,goToStep:y?void 0:T,activeStep:m,viewedSteps:h,completedSteps:f,allowSkip:o,direction:i,hideLabels:c,showCompletedIcons:d}},e)},ga=()=>{const e=a.useContext(Ho);if(!e)throw new Error("Ensure that you wrap any components with the root component Stepper");return e},Fc=({label:e,children:t,...o})=>{const{activeStep:r,goToPreviousStep:n}=ga();return a.createElement(ne,{size:"sm",appearance:"outline",...o,disabled:r===0,onClick:n},t||(e==null?void 0:e(r)))},Nc=({label:e,children:t,onClick:o,...r})=>{const{goToNextStep:n,activeStep:i}=ga();return a.createElement(ne,{size:"sm",...r,onClick:()=>{if(o)return o(n);n==null||n()},css:{ml:"auto"}},t||(e==null?void 0:e(i)))},Mc=l(z,{position:"relative",p:"$2",justifyContent:"center",alignItems:"center",size:"$3",borderRadius:"50%",border:"none",bg:"$tonal100",zIndex:1,flex:"none",variants:{status:{default:{bg:"$tonal100",color:"$tonal300"},active:{bg:"white",color:"$primaryMid",border:"2px solid",borderColor:"currentColor"},viewed:{bg:"white",border:"2px solid $tonal200",color:"$tonal600"},completed:{bg:"$primary",color:"white"},reviewed:{bg:"$primaryMid",color:"white"},success:{bg:"$success",color:"white"}}}}),Ac=l(z,{position:"relative",fontFamily:"$body",fontWeight:600,fontSize:"$md",alignItems:"center","&:not(:last-child)::after":{content:"",position:"absolute"},"&:focus-visible":{outline:"none"},variants:{canInteract:{true:{}},direction:{vertical:{py:"$3",flexDirection:"row","&:not(:last-child)::after":{height:"100%",width:"4px",left:"14px",top:"50%"}},horizontal:{px:"$2",flexDirection:"column","&:not(:last-child)::after":{width:"100%",height:"4px",left:"50%",top:"14px"}}},separator:{default:{"&:not(:last-child)::after":{bg:"$tonal100"}},active:{"&:not(:last-child)::after":{bg:"$primary"}},success:{"&:not(:last-child)::after":{bg:"$success"}},viewed:{"&:not(:last-child)::after":{bg:"$tonal200"}}},status:{completed:{},active:{},default:{},viewed:{},success:{},reviewed:{}}},compoundVariants:[{canInteract:!0,status:"completed",css:{"&:hover":{"& :first-child":{bg:"$primaryMid",color:"white !important"},"& :last-child":{color:"$primaryMid"}},"&:focus-visible":{"& :first-child":{outline:"2px solid $primary",outlineOffset:"2px"}}}},{canInteract:!0,status:"active",css:{"&:hover":{"& :first-child":{borderColor:"$tonal400",color:"$tonal600"},"& :last-child":{color:"$tonal600"}},"&:focus-visible":{"& :first-child":{outline:"2px solid $primary",outlineOffset:"2px"}}}},{canInteract:!0,status:"viewed",css:{"&:hover":{"& :first-child":{borderColor:"$tonal400",color:"$tonal600"},"& :last-child":{color:"$tonal600"}},"&:focus-visible":{"& :first-child":{outline:"2px solid $primary !important",outlineOffset:"2px !important"}}}},{canInteract:!0,status:"reviewed",css:{"&:focus-visible":{"& :first-child":{outline:"2px solid $primary !important",outlineOffset:"2px !important"}}}}]}),Lc=l(L,{fontWeight:600,variants:{direction:{vertical:{ml:"$3",textAlign:"left"},horizontal:{mt:"$3",textAlign:"center"}},status:{default:{color:"$tonal300",fontWeight:400},active:{color:"$primaryMid"},viewed:{color:"$tonal600"},completed:{color:"$primary"},success:{color:"$success"},reviewed:{}}}});var B=(e=>(e.ACTIVE="active",e.VIEWED="viewed",e.SUCCESS="success",e.DEFAULT="default",e.COMPLETED="completed",e.REVIEWED="reviewed",e))(B||{});const Pc=l(z,{justifyContent:"space-between",variants:{direction:{vertical:{flexDirection:"column"},horizontal:{flexDirection:"row"}}}}),Wc=({css:e})=>{const{steps:t,goToStep:o,activeStep:r,viewedSteps:n,allowSkip:i,direction:s,hideLabels:c,completedSteps:d,showCompletedIcons:m}=ga(),p=g=>{const f=t[g];return f.status?f.status:d.length===t.length?B.SUCCESS:r===g&&d.includes(r)?B.REVIEWED:r===g?B.ACTIVE:d.includes(g)?B.COMPLETED:n.includes(g)?B.VIEWED:B.DEFAULT},h=g=>{var f;const $=(f=t[g])==null?void 0:f.status;return d.length===t.length||$===B.SUCCESS?B.SUCCESS:$===B.COMPLETED||g<Math.max(...n)?B.ACTIVE:$===B.VIEWED?B.VIEWED:B.DEFAULT};return a.createElement(Pc,{css:e,direction:s},t.map((g,f)=>{const $=p(f),y=h(f);return a.createElement(Ac,{tabIndex:0,key:`step_${f}`,direction:s,separator:y,status:$,css:s==="horizontal"?{width:`calc(100% / ${t.length})`}:{height:`calc(100% / ${t.length})`},canInteract:i},a.createElement(Mc,{as:i?"button":"div",onClick:()=>i&&n.includes(f)?o==null?void 0:o(f):void 0,status:$,"aria-current":f===r?"step":void 0,"aria-label":g.label?"":`step ${f+1}`,"aria-labelledby":g.label?`step-${f}`:void 0,css:{cursor:i&&n.includes(f)?"pointer":"auto"}},g.status===B.SUCCESS||m&&$===B.COMPLETED?a.createElement(b,{is:v.Ok}):f+1),g.label&&!c&&a.createElement(Lc,{as:"span",id:`step-${f}`,direction:s,status:$},g.label))}))},Qe=({children:e,stepCount:t,allowSkip:o,onComplete:r,onStepChange:n,direction:i="horizontal",steps:s,hideLabels:c=!1,showCompletedIcons:d=!1,css:m})=>{Te.default(!(t&&s),"`Stepper` should only be given one of `stepCount` or `steps`. When both are provided, `steps` will be used and `stepCount` will be ignored.");const p=(s==null?void 0:s.length)||t||0;return a.createElement(Rc,{stepCount:p,allowSkip:o,onComplete:r,onStepChange:t?n:void 0,direction:i,steps:s||Array(p).fill(""),hideLabels:c,showCompletedIcons:d},a.createElement(w,{"aria-label":"progress",css:{width:"100%",...m}},e))};Qe.StepBack=Fc,Qe.StepForward=Nc,Qe.Steps=Wc,Qe.displayName="Stepper";const Bc=l(Ea.Root,{appearance:"none",backgroundColor:"$tonal200",border:"none",borderRadius:"$round",cursor:"pointer",display:"flex",overflow:"hidden",p:"$0",position:"relative",transition:"all 50ms ease-out",width:"$4","&:hover":{backgroundColor:"$tonal300"},"&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},'&[data-state="checked"]':{backgroundColor:"$primary"},'&[data-state="checked"]:hover':{backgroundColor:"$primaryMid"}}),Oc=l(Ea.Thumb,{backgroundColor:"white",borderRadius:"$round",display:"block",size:"$1",transition:"transform 50ms",willChange:"transform",'&[data-state="checked"]':{transform:"translateX(calc($sizes$2 - $space$1))"}}),Vo=e=>a.createElement(Bc,{...e},a.createElement(Oc,null));Vo.displayName="Switch";const Hc=({delay:e=500}={})=>{const[t,o]=Y.useState({width:void 0,height:void 0});return Y.useEffect(()=>{const r=et.debounce(e,()=>{o({width:window.innerWidth,height:window.innerHeight})});return window.addEventListener("resize",r),r(),()=>window.removeEventListener("resize",r)},[e]),t},Vc=l(Pt,{position:"relative",borderBottom:"1px solid $base3",width:"100%"}),_c=l(at.List,{flexShrink:0,display:"flex",width:"100%",overflowX:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}),_o=l(M,{height:"100% !important",position:"absolute",top:"50%",transform:"translateY(-50%)",cursor:"pointer",background:"$background !important",color:"$interactive1 !important",borderRadius:0,opacity:.9}),qc=10,qo=({children:e,colorScheme:t={},...o})=>{const[r,n]=El(),{width:i}=Hc(),[s,c]=u.default.useState(!1),[d,m]=u.default.useState(!1),p=u.default.useCallback(h=>{if(!r)return;const{scrollWidth:g,scrollLeft:f,offsetWidth:$}=r,y=Math.round(g*(qc/100));let C=f;if(h==="right"){const E=f+y;C=E+$<=g?E:g-$}else{const E=f-y;C=E>0?E:0}r.scroll({left:C,behavior:"smooth"}),setTimeout(()=>{const{scrollWidth:E,scrollLeft:T,offsetWidth:x}=r,S=E-(T+x);T===0?(c(!1),m(!0)):S<5?(m(!1),c(!0)):(c(!0),m(!0))},500)},[r]);return u.default.useEffect(()=>{var h;if(!r)return;const{offsetWidth:g,scrollWidth:f}=r,$=f>g;(h=r.scroll)==null||h.call(r,{left:0}),c(!1),m($)},[r,i]),u.default.createElement(Vc,{base:"slate",accent:"blue",interactive:"hiContrast1",...t,...o},s&&u.default.createElement(_o,{label:"scroll left",size:"md",css:{left:0},onClick:()=>p("left")},u.default.createElement(b,{is:v.ChevronLeft})),u.default.createElement(_c,{ref:n},e),d&&u.default.createElement(_o,{label:"scroll right",size:"md",css:{right:0},onClick:()=>p("right")},u.default.createElement(b,{is:v.ChevronRight})))};qo.displayName="TabsTriggerList";const Gc=l(at.Trigger,{background:"none",border:"none",cursor:"pointer",flexShrink:0,p:"$4",userSelect:"none",borderBottom:"2px solid transparent",'&[data-state="active"]':{color:"$interactive1",fontWeight:600,letterSpacing:"-0.005em",borderColor:"currentColor"},"&[data-disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([data-disabled])":{"&:hover, &:focus-visible":{color:"$interactive2",bg:"$accentA1"},"&:active":{color:"$interactive3"},"&:focus-visible":{...be()}}}),Go=({children:e,...t})=>a.createElement(Gc,{asChild:!0,...t},a.createElement(L,{size:"sm",as:"button"},e));Go.displayName="TabsTrigger";const jc=l(at.Content,{flexGrow:1,fontFamily:"$body"}),jo=jc;jo.displayName="TabsContent";const Yc=l(at.Root,{width:"100%"}),Ze=({children:e,...t})=>a.createElement(Yc,{...t},e);Ze.TriggerList=qo,Ze.Trigger=Go,Ze.Content=jo,Ze.displayName="Tabs";const Uc=l("textarea",{boxShadow:"none",fontSize:"$md",appearance:"none",border:"1px solid $tonal400",borderRadius:"$0",boxSizing:"border-box",color:"$tonal600",fontFamily:"$body",fontWeight:400,lineHeight:1.4,minHeight:"$7",px:"$3",py:"calc($2 + $1)",resize:"vertical",transition:"all 75ms ease-out",width:"100%","&:focus":{borderColor:"$primary",outline:"none"},"&[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&::placeholder":{color:"$tonal300",opacity:1},variants:{state:{error:{border:"1px solid $danger"}}}}),fa=a.forwardRef((e,t)=>a.createElement(Uc,{...e,ref:t}));fa.displayName="Textarea";const Yo=({css:e=void 0,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return a.createElement(te,{css:e,description:i,error:d,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(fa,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Yo.displayName="TextareaField";const Uo=400,Xc=D({"0%":{transform:"translate3d(0,-100%,0)",opacity:0},"100%":{transform:"translate3d(0,0,0)",opacity:1}}),Jc=D({"0%":{transform:"translate3d(0,0,0)",opacity:1},"100%":{transform:"translate3d(0,-100%,0)",opacity:0}}),Kc=l("div",{position:"absolute",width:"100%",variants:{visible:{true:{"@allowMotion":{animation:`${Xc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}},false:{opacity:0,"@allowMotion":{animation:`${Jc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}}}}}),Qc=l("div",{pointerEvents:"auto",alignItems:"center",borderRadius:"$0",boxShadow:"$1",boxSizing:"border-box",color:"white",display:"flex",minHeight:"$5",pl:"$4",position:"relative",pr:"$6",py:"$4",transition:"background-color 50ms ease-out",width:"100%","@sm":{width:Uo},"@allowMotion":{transition:"background-color 50ms ease-out, transform 150ms ease-out"},variants:{status:{blank:{bg:"$primary"},error:{bg:"$danger"},loading:{bg:"$primary"},success:{bg:"$success"}}}}),Zc=a.memo(({ariaLive:e,height:t,id:o,message:r,role:n,type:i="blank",visible:s,calculateOffset:c,updateHeight:d})=>{const m=c(o,{reverseOrder:!0,margin:8});return a.createElement(Kc,{visible:s},a.createElement(Qc,{ref:p=>{p&&t===void 0&&d(o,p.getBoundingClientRect().height)},status:i,role:n,"aria-live":e,style:{transform:`translateY(${m}px)`}},i==="error"&&a.createElement(b,{size:"sm",css:{mr:"$3",flex:"0 0 auto"},is:v.Error}),a.createElement(L,null,r),i==="loading"?a.createElement(lt,{css:{flex:"0 0 auto",ml:"auto"}}):a.createElement(M,{css:{position:"absolute",top:"$2",right:"$2",color:"white","&:hover,&:focus":{color:"white",opacity:.5}},label:"Close alert",onClick:()=>St.toast.dismiss(o)},a.createElement(b,{is:v.Close}))))}),ed=l("div",{left:"$2",position:"fixed",top:"$2",right:"$2",zIndex:it,"@sm":{top:"$3",right:"auto",left:`calc(50% - ${Uo/2}px)`}}),Xo=({children:e})=>{const{toasts:t,handlers:o}=St.useToaster(),{startPause:r,endPause:n,calculateOffset:i,updateHeight:s}=o;return a.createElement(a.Fragment,null,a.createElement(ed,{onMouseEnter:r,onMouseLeave:n},t.map(c=>a.createElement(Zc,{key:c.id,calculateOffset:i,updateHeight:s,...c}))),e)};Xo.displayName="ToastProvider";const Se=l(ot.Item,{bg:"white",color:"$tonal400",border:"1px solid $tonal200",cursor:"pointer","&::before":{background:"$tonal200"},"&:not([disabled])":{'&:hover, &:focus-visible, &[data-state="on"]':{"&::before":{background:"none"}},"&:hover":{borderColor:"currentColor !important",color:"$primaryMid"},"&:focus-visible":{...be(),'&[data-state="off"]':{borderColor:"$tonal200 !important"},'&[data-state="on"]':{boxShadow:`inset currentColor 0px 0px 0px 1px, ${be().boxShadow}`}}},"&[disabled]":{opacity:.3,cursor:"not-allowed"},'&[data-state="on"]':{color:"$primary",borderColor:"currentColor !important",boxShadow:"inset currentColor 0px 0px 0px 1px"}}),td=Se,wt={sm:"32px",md:"40px",lg:"48px"},ad={sm:"$4",md:"$5",lg:"$5"},od={sm:"$2",md:"$3",lg:"$3"},$a=e=>({fontSize:`$${e}`,px:ad[e],minHeight:wt[e],"& > *:not(:last-child)":{mr:od[e]}}),rd=l(Se,{flexGrow:1,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,lineHeight:1,py:"$1",[`& ${ka}`]:{flexShrink:0},variants:{size:{sm:$a("sm"),md:$a("md"),lg:$a("lg")},isIconOnly:{true:{}}},compoundVariants:[{isIconOnly:!0,size:"sm",css:{minWidth:wt.sm,p:0}},{isIconOnly:!0,size:"md",css:{minWidth:wt.md,p:0}},{isIconOnly:!0,size:"lg",css:{minWidth:wt.lg,p:0}}]}),nd=a.forwardRef(({size:e="md",children:t,...o},r)=>{var n;const i=a.Children.toArray(t),s=i.length<=1,c=s&&a.isValidElement(i[0])&&((n=i[0])==null?void 0:n.type)===b;return a.createElement(rd,{ref:r,size:e,isIconOnly:c,...o},i.map(d=>!s&&(typeof d=="string"||typeof d=="number")?a.createElement("span",{key:d},d):a.isValidElement(d)&&(d==null?void 0:d.type)===b?a.cloneElement(d,{...d.props,size:e}):d))}),id=l(ot.Root,{width:"fit-content",variants:{isFullWidth:{true:{width:"100%",[`& ${Se}`]:{flexBasis:0,flexGrow:1}}},hasGap:{true:{[`& ${Se}`]:{borderRadius:"$0"}},false:{borderRadius:"$0",bg:"white",[`& ${Se}`]:{bg:"transparent",borderRadius:0,position:"relative","&:not(:last-child)::before":{content:"",position:"absolute"}}}},direction:{column:{},row:{}}},compoundVariants:[{hasGap:!1,direction:"row",css:{[`& ${Se}`]:{"&:not(:last-child)::before":{top:"-1px",height:"calc(100% + 2px)",width:"1px",right:"0",transform:"translateX(150%)"},"&:not(:first-child)":{borderLeftColor:"transparent"},"&:not(:last-child)":{borderRightColor:"transparent"},"&:first-child":{borderTopLeftRadius:"$0",borderBottomLeftRadius:"$0"},"&:last-child":{borderTopRightRadius:"$0",borderBottomRightRadius:"$0"}}}},{hasGap:!1,direction:"column",css:{[`& ${Se}`]:{"&:not(:last-child)::before":{bottom:0,left:"-1px",height:"1px",width:"calc(100% + 2px)",transform:"translateY(150%)"},"&:first-child":{borderTopLeftRadius:"$0",borderTopRightRadius:"$0"},"&:last-child":{borderBottomLeftRadius:"$0",borderBottomRightRadius:"$0"},"&:not(:first-child)":{borderTopColor:"transparent"},"&:not(:last-child)":{borderBottomColor:"transparent"}}}}]}),ld=e=>e==="horizontal"?"row":"column",sd=a.forwardRef(({orientation:e="horizontal",gap:t=!1,isFullWidth:o,children:r,wrap:n="no-wrap",...i},s)=>{const c=typeof t=="number",d=ld(e);return a.createElement(id,{ref:s,direction:d,hasGap:c,isFullWidth:o,orientation:e,...i},a.createElement(Le,{direction:d,gap:c&&t,align:!1,wrap:n},r))}),cd={Item:td,Button:nd,Root:sd},dd=l(Fr.default,{}),Jo=a.forwardRef(({id:e,ratio:t=9/16,css:o,...r},n)=>a.createElement(Fe,{css:o},a.createElement(w,{css:{borderRadius:"$0",position:"relative",paddingTop:`${t*100}%`,overflow:"hidden",height:0,width:"100%"}},a.createElement(dd,{...r,role:"figure",url:`https://player.vimeo.com/video/${e}`,height:"100%",width:"100%",css:{position:"absolute",top:0,left:0},ref:n}))));Jo.displayName="Video",Object.defineProperty(exports,"toast",{enumerable:!0,get:function(){return Rr.default}}),exports.Accordion=Ge,exports.ActionIcon=M,exports.AlertDialog=G,exports.AlertProvider=_n,exports.Avatar=We,exports.Badge=Wa,exports.Box=w,exports.Button=ne,exports.Carousel=ve,exports.Checkbox=ct,exports.CheckboxField=Ya,exports.Chip=de,exports.ChipDismissibleGroup=Jt,exports.ChipGroup=Ut,exports.ChipToggleGroup=Kt,exports.Combobox=xe,exports.DataTable=W,exports.DateField=po,exports.DateInput=aa,exports.Dialog=ue,exports.Dismissible=gt,exports.DismissibleGroup=ye,exports.Divider=Gt,exports.DropdownMenu=Ee,exports.EmptyState=Ke,exports.FieldWrapper=te,exports.FileInput=yo,exports.Flex=z,exports.Form=ja,exports.Grid=xo,exports.Heading=st,exports.Icon=b,exports.Image=Pe,exports.InlineFieldWrapper=ht,exports.InlineMessage=dt,exports.Input=we,exports.InputField=wo,exports.Label=Be,exports.Link=ut,exports.List=mt,exports.Loader=lt,exports.MarkdownContent=Eo,exports.NavigationMenu=pe,exports.NotificationBadge=Hs,exports.NumberInput=da,exports.NumberInputField=Ro,exports.PasswordField=Fo,exports.PasswordInput=ma,exports.Popover=le,exports.ProgressBar=No,exports.RadioButton=pt,exports.RadioButtonField=ua,exports.RadioButtonGroup=Yt,exports.RadioCard=Ao,exports.RadioCardGroup=Js,exports.SearchField=Lo,exports.SearchInput=bt,exports.Select=vt,exports.SelectField=Po,exports.Sidedrawer=Z,exports.Slider=Ce,exports.SliderField=Oo,exports.Stack=Le,exports.StackContent=na,exports.Stepper=Qe,exports.StyledButton=Ra,exports.StyledLink=_a,exports.Switch=Vo,exports.Table=I,exports.Tabs=Ze,exports.Text=L,exports.Textarea=fa,exports.TextareaField=Yo,exports.ToastProvider=Xo,exports.ToggleGroup=cd,exports.Tooltip=K,exports.TopBar=he,exports.Video=Jo,exports.createTheme=Lr,exports.createThemeVariants=It,exports.css=Mr,exports.focusVisibleStyleBlock=be,exports.getCssText=Ar,exports.globalCss=Ca,exports.keyframes=D,exports.media=zt,exports.styled=l,exports.theme=q,exports.useAlert=qn,exports.useCarousel=ci,exports.useDataTable=J,exports.utils=Dt;