@atom-learning/components 2.38.1 → 2.39.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/CHANGELOG.md +5 -4
- package/dist/components/accordion/AccordionTrigger.js +1 -1
- package/dist/components/accordion/AccordionTrigger.js.map +1 -1
- package/dist/components/action-icon/ActionIcon.js +1 -1
- package/dist/components/action-icon/ActionIcon.js.map +1 -1
- package/dist/components/chip/Chip.d.ts +1 -1
- package/dist/components/chip-dismissible-group/ChipDismissibleGroupItem.d.ts +1 -1
- package/dist/components/chip-dismissible-group/ChipDismissibleGroupItem.js +1 -1
- package/dist/components/chip-dismissible-group/ChipDismissibleGroupItem.js.map +1 -1
- package/dist/components/chip-toggle-group/ChipToggleGroupItem.d.ts +1 -1
- package/dist/components/data-table/pagination/PaginationButtons.d.ts +1 -1
- package/dist/components/data-table/pagination/PaginationButtons.js +1 -1
- package/dist/components/data-table/pagination/PaginationButtons.js.map +1 -1
- package/dist/components/date-field/DateField.js.map +1 -1
- package/dist/components/navigation/NavigationMenuDropdownContent.js +1 -1
- package/dist/components/navigation/NavigationMenuDropdownContent.js.map +1 -1
- package/dist/components/navigation/NavigationMenuDropdownTrigger.js +1 -1
- package/dist/components/navigation/NavigationMenuDropdownTrigger.js.map +1 -1
- package/dist/components/number-input/NumberInputStepper.js +1 -1
- package/dist/components/number-input/NumberInputStepper.js.map +1 -1
- package/dist/components/password-field/PasswordField.js.map +1 -1
- package/dist/components/search-field/SearchField.js.map +1 -1
- package/dist/components/tabs/Tabs.d.ts +2 -2
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tabs/TabsContent.js.map +1 -1
- package/dist/components/tabs/TabsTrigger.js.map +1 -1
- package/dist/components/tabs/TabsTriggerList.js +1 -1
- package/dist/components/tabs/TabsTriggerList.js.map +1 -1
- package/dist/experiments/color-scheme/ColorScheme.d.ts +1 -1
- package/dist/experiments/color-scheme/ColorScheme.js +1 -1
- package/dist/experiments/color-scheme/ColorScheme.js.map +1 -1
- package/dist/experiments/color-scheme/stitches.colorscheme.config.js +1 -1
- package/dist/experiments/color-scheme/stitches.colorscheme.config.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/utilities/hooks/useScrollPosition.js.map +1 -1
- package/dist/utilities/hooks/useSize.js.map +1 -1
- package/dist/utilities/hooks/useWindowScrollPosition.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ae=require("@radix-ui/react-accordion"),P=require("react"),tr=require("@atom-learning/theme"),ya=require("@stitches/react"),v=require("@atom-learning/icons"),H=require("color2k"),St=require("@radix-ui/react-slot"),ar=require("invariant"),De=require("@radix-ui/react-tooltip"),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"),V=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"),ze=require("@reach/combobox"),se=require("@tanstack/react-table"),dr=require("use-deep-compare-effect"),Ie=require("throttle-debounce"),fe=require("@dnd-kit/core"),mr=require("@dnd-kit/modifiers"),qe=require("@dnd-kit/sortable"),ur=require("@dnd-kit/utilities"),pr=require("dayzed"),$e=require("@radix-ui/react-popover"),hr=require("dayjs"),gr=require("dayjs/plugin/customParseFormat"),q=require("@radix-ui/react-dialog"),Te=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"),kt=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 a=Object.create(null);return e&&Object.keys(e).forEach(function(o){if(o!=="default"){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(a,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}}),a.default=e,Object.freeze(a)}var t=ee(P),u=U(P),Er=ee(tr),Re=U(ar),Dt=ee(or),xa=ee(nr),Fe=ee(ir),Cr=U(lr),Sr=U(sr),ot=ee(cr),kr=U(dr),Ge=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(kt),Nr=U(wr);const zt={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})},It={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:zt,media:It}),{css:Ar,getCssText:Lr,createTheme:Pr,globalCss:Ca,keyframes:k,styled:l,theme:G}=Mr,Tt=(e,a)=>Object.keys(G[e]).reduce((o,r)=>({...o,[r]:JSON.parse(JSON.stringify(a).replace(/\$key/g,`$${e}$${r}`))}),{}),w=l("div",{});w.displayName="Box";const Ne=({css:e,children:a})=>e?t.createElement(w,{css:e},a):t.createElement(t.Fragment,null,a);Ne.displayName="CSSWrapper";const Q=(e,a)=>({"&::before":{content:"''",mb:`-${e}em`,display:"table"},"&::after":{content:"''",mt:`-${a||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,a)=>`url(data:image/svg+xml;charset=US-ASCII,${encodeURIComponent(Wr[a](H.toHex(e)))})`,be=({position:e="relative",zIndex:a=1}={})=>({outline:"none",position:["relative","absolute","fixed","sticky"].includes(e)?e:"relative",zIndex:a>1?a:1,boxShadow:"white 0px 0px 0px 2px, $colors$primary 0px 0px 0px 4px"}),Rt=k({"0%":{opacity:0,transform:"translateY(2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Ft=k({"0%":{opacity:0,transform:"translateX(-2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Nt=k({"0%":{opacity:0,transform:"translateY(-2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Mt=k({"0%":{opacity:0,transform:"translateX(2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),At=k({"0%":{opacity:0},"100%":{opacity:1}}),rt=k({"0%":{opacity:1},"100%":{opacity:0}}),Br=k({"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(0)"}}),Or=k({"0%":{transform:"translateX(0)"},"100%":{transform:"translateX(-100%)"}}),Hr=k({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Vr=k({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),_r=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`}}}),qr=({children:e,css:a,...o})=>u.default.createElement(_r,{...o},u.default.createElement(Ne,{css:a},e)),Gr=l(ae.Item,{width:"100%","&:not(:last-child)":{mb:"$1"}}),jr=({children:e,value:a,...o})=>u.default.createElement(Gr,{value:a,...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=t.forwardRef(({is:e,size:a="md",...o},r)=>t.createElement(ka,{size:a,"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",Lt={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],Pt=e=>Math.round(Math.max(Math.min(e,255),0)),za=(e,a)=>{const o={};return Object.entries(a).forEach(([r,n],i)=>{const[s,c,d]=H.parseToRgba(n),[m,p,g]=hn,h=[Pt((s-m)/nt[i]+m),Pt((c-p)/nt[i]+p),Pt((d-g)/nt[i]+g),nt[i]];o[`${e}A${i+1}`]=`rgba(${h.join(",")})`}),o},re={},Ia=(e,a)=>{const o={};for(let r=1;r<=10;r++)o[`${e}${r}`]=`$${a}${r}`,o[`${e}A${r}`]=`$${a}A${r}`;return o},{styled:gn,createTheme:Me}=ya.createStitches({theme:{colors:{background:"white",foreground:Lt.slate9,foreground6plus:"white",...Da,...za("blue",Da),...Lt,...za("slate",Lt)}},utils:zt,media:It});re["interactive-loContrast1"]=Me("interactive-loContrast1",{colors:{interactiveForeground:"$foreground",interactive1:"white",interactive2:"$accent1",interactive3:"$accent2"}}),re["interactive-loContrast2"]=Me("interactive-loContrast2",{colors:{interactiveForeground:"$foreground",interactive1:"$accent1",interactive2:"$accent2",interactive3:"$accent3"}}),re["interactive-hiContrast1"]=Me("interactive-hiContrast1",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent7",interactive2:"$accent8",interactive3:"$accent9"}}),re["interactive-hiContrast2"]=Me("interactive-hiContrast2",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent8",interactive2:"$accent9",interactive3:"$accent10"}});const fn={slate:"slate"},$n=()=>{Object.entries(fn).forEach(([e,a])=>{const o=`base-${e}`;re[o]=Me(o,{colors:Ia("base",a)})})},bn={slate:"slate",blue:"blue"},vn=()=>{Object.entries(bn).forEach(([e,a])=>{const o=`accent-${e}`;re[o]=Me(o,{colors:Ia("accent",a)})})};$n(),vn();const yn=gn("div"),it=t.forwardRef(({base:e="",accent:a="",interactive:o="",className:r,asChild:n=!1,...i},s)=>{const c=[r,re[`interactive-${o}`],re[`accent-${a}`],re[`base-${e}`]].filter(Boolean).join(" ");return t.createElement(n?St.Slot:yn,{ref:s,className:c,...i})});it.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:a={},...o})=>u.default.createElement(it,{asChild:!0,accent:"slate",interactive:"loContrast1",...a},u.default.createElement(wn,{...o},e,u.default.createElement(xn,{is:v.ChevronDown}))),Cn=l(ae.Root,{width:"100%"}),je=u.default.forwardRef(({type:e="single",children:a,...o},r)=>u.default.createElement(Cn,{ref:r,type:e,...o},a));je.Item=jr,je.Content=qr,je.Trigger=En,je.displayName="Accordion";const Sn={xs:"sm",sm:"sm",md:"md",lg:"lg"},lt=2147483647,Ye=1147483646,kn=10,Dn=10,zn=10,In=l(De.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:Nt},'&[data-side="right"]':{animationName:Mt},'&[data-side="bottom"]':{animationName:Rt},'&[data-side="left"]':{animationName:Ft}}},variants:{size:{sm:{maxWidth:"100px"},md:{maxWidth:"250px"},lg:{maxWidth:"400px"}}}}),Tn=l(De.Arrow,{fill:"$tonal500",'[data-align="end"] &':{mr:"$2"},'[data-align="start"] &':{ml:"$2"}}),Rn=({children:e,side:a="top",sideOffset:o=4,size:r="md",...n})=>t.createElement(In,{side:a,sideOffset:o,size:r,...n},e,t.createElement(Tn,null)),X=({children:e,delayDuration:a=350,...o})=>t.createElement(De.Root,{delayDuration:a,...o},e);X.Content=Rn,X.Trigger=l(De.Trigger,{}),X.Portal=De.Portal,X.Provider=De.Provider,X.displayName="Tooltip";const Ae=(e,a,o)=>({bg:"transparent",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:a},"&:not(:disabled):active":{color:o},"&[disabled]":{color:"$tonal400",cursor:"not-allowed"}}),Ue=(e,a,o)=>({bg:e,color:"white","&:not(:disabled):hover, &:not(:disabled):focus":{bg:a,color:"white"},"&:not(:disabled):active":{bg:o},"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"}}),Xe=(e,a,o)=>({border:"1px solid",borderColor:"currentColor",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:a},"&:not(:disabled):active":{color:o},"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"}}),Fn=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:Ae("$tonal300","$primaryMid","$primaryDark")},{theme:"primary",appearance:"simple",css:Ae("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"simple",css:Ae("$primaryDark",H.darken(G.colors.primaryDark.value,.1),H.darken(G.colors.primaryDark.value,.15))},{theme:"success",appearance:"simple",css:Ae("$success","$successMid","$successDark")},{theme:"warning",appearance:"simple",css:Ae("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"simple",css:Ae("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"solid",css:Ue("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"solid",css:Ue("$primaryDark",H.darken(G.colors.primaryDark.value,.1),H.darken(G.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:Ue("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:Ue("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"solid",css:Ue("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"outline",css:Xe("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"outline",css:Xe("$primaryDark",H.darken(G.colors.primaryDark.value,.1),H.darken(G.colors.primaryDark.value,.15))},{theme:"success",appearance:"outline",css:Xe("$success","$successMid","$successDark")},{theme:"warning",appearance:"outline",css:Xe("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"outline",css:Xe("$danger","$dangerMid","$dangerDark")}]}),Nn=({hasTooltip:e,label:a,tooltipSide:o,children:r})=>e?t.createElement(X,null,t.createElement(X.Trigger,{asChild:!0},r),t.createElement(X.Content,{side:o},a)):t.createElement(t.Fragment,null,r),N=t.forwardRef(({children:e,theme:a="primary",appearance:o="simple",size:r="sm",label:n,href:i,disabled:s,hasTooltip:c=!0,tooltipSide:d,...m},p)=>{const g=`A single ${b.displayName} component is permitted as a child of ${N.displayName}`;return Re.default(t.Children.count(e)===1,g),t.createElement(Nn,{hasTooltip:c,label:n,tooltipSide:d},t.createElement(Fn,{...m,...i?{as:"a",href:s?null:i,onClick:void 0,"aria-disabled":!!s}:{type:"button"},"aria-label":n,theme:a,appearance:o,size:r,ref:p,disabled:s},t.Children.map(e,h=>{if(!t.isValidElement(h))throw new Error(g);return Re.default(h.type===b,`Children of type ${h==null?void 0:h.type} aren't permitted. Only an ${b.displayName} component is allowed in ${N.displayName}`),t.cloneElement(h,{size:Sn[r],css:{...h.props.css?h.props.css:{}}})})))});N.displayName="ActionIcon";const Wt="translate3d(-50%, -50%, 0)",Ta="translate3d(-50%, 50vh, 0)",Mn=k({"0%":{transform:Ta},"100%":{transform:Wt}}),An=k({"0%":{transform:Wt},"100%":{transform:Ta}}),Ln=l(oe.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",zIndex:Ye,"@allowMotion":{'&[data-state="open"]':{animation:`${At} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),Pn=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:Ye,"@allowMotion":{'&[data-state="open"]':{animation:`${Mn} 550ms cubic-bezier(0.22, 1, 0.36, 1)`},'&[data-state="closed"]':{animation:`${An} 550ms cubic-bezier(0.22, 1, 0.36, 1)`}},variants:{size:{sm:{width:"380px"},md:{width:"480px"},lg:{width:"600px"}}}}),Wn=({size:e="sm",...a})=>t.createElement(oe.Portal,null,t.createElement(Ln,null),t.createElement(Pn,{size:e,...a})),Bn=l(oe.Root,{}),j=e=>t.createElement(Bn,{...e});j.Description=oe.Description,j.Title=oe.Title,j.Action=oe.Action,j.Cancel=oe.Cancel,j.Content=Wn,j.Trigger=oe.Trigger,j.displayName="AlertDialog";const On=()=>{const e=P.useRef();return P.useEffect(()=>(e.current=!0,()=>{e.current=!1})),e},D=l("div",{display:"flex"});D.displayName="Flex";const Hn=k({"0%":{opacity:0},"30%":{opacity:1},"50%":{opacity:1},"80%":{opacity:0},"100%":{opacity:0}}),Bt=l("div",{animationName:`${Hn}`,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"}}}}),st=({css:e={},message:a="Loading",size:o="md",...r})=>t.createElement(D,{css:{justifyContent:"center",...e},role:"alert",...r},t.createElement(Dt.Root,null,a),t.createElement(Bt,{size:o}),t.createElement(Bt,{size:o}),t.createElement(Bt,{size:o})),Ot=(e,a,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:a},"&:not([disabled]):active":{color:o}}),Le=(e,a,o,r="white")=>({bg:e,color:r,"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{bg:a,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:Le("$primary","$primaryMid","$primaryDark")},{theme:"secondary",appearance:"solid",css:Le("$primaryDark",H.darken(G.colors.primaryDark.value,.1),H.darken(G.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:Le("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:Le("$warning","$warningMid","$warningDark","$tonal500")},{theme:"danger",appearance:"solid",css:Le("$danger","$dangerMid","$dangerDark")},{theme:"neutral",appearance:"solid",css:Le("white",H.opacify("white",-.1),H.opacify("white",-.25),"$primary")},{theme:"primary",appearance:"outline",css:Ot("$primary","$primaryMid","$primaryDark")},{theme:"neutral",appearance:"outline",css:Ot("white",H.opacify("white",-.2),H.opacify("white",-.35))},{theme:"secondary",appearance:"outline",css:Ot("$primaryDark",H.darken(G.colors.primaryDark.value,.1),H.darken(G.colors.primaryDark.value,.15))}]}),Vn=({isLoading:e,children:a})=>t.createElement(t.Fragment,null,t.createElement(st,{css:{opacity:e?1:0,position:"absolute",transition:"opacity 150ms"}}),t.createElement(w,{as:"span",css:e?{opacity:0,transition:"opacity 150ms"}:{}},a)),_n=e=>{switch(e){case"lg":return 22;case"md":return 20;case"sm":default:return 16}},Fa=(e,a)=>t.Children.map(e,(o,r)=>(o==null?void 0:o.type)===b?t.cloneElement(o,{css:{[r===0?"mr":"ml"]:a==="sm"?"$2":"$3",size:_n(a),...o.props.css?o.props.css:{}}}):o),ne=t.forwardRef(({children:e,isLoading:a,onClick:o,href:r,appearance:n="solid",size:i="md",theme:s="primary",type:c="button",...d},m)=>t.createElement(Ra,{isLoading:a||!1,onClick:a?void 0:o,appearance:n,size:i,theme:s,...d,...r?{as:"a",href:r,onClick:void 0}:{},...r?{}:{type:c},ref:m},typeof a=="boolean"?t.createElement(Vn,{isLoading:a},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 !important"}}}}}),ct=t.forwardRef(({size:e="md",...a},o)=>t.createElement(Ht,{ref:o,size:e,...a}));ct.displayName="Heading";const qn=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:{...Tt("space",{mt:"-$key",ml:"-$key","& > *":{mt:"$key",ml:"$key"}}),false:{}}}}),Pe=t.forwardRef(({css:e,gap:a=2,direction:o="row",wrap:r="wrap",justify:n="start",align:i,...s},c)=>t.createElement(Ne,{css:e},t.createElement(qn,{ref:c,direction:o,gap:a,wrap:r,justify:n,align:typeof i>"u"&&o!=="column"?"center":i,...s})));Pe.displayName="Stack";const Je={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 !important"}}}},Ke=({size:e,noCapsize:a})=>({...Je.size[e],...Je.noCapsize[`${a}`]}),Vt=l("p",{fontFamily:"$body",fontWeight:400,margin:0,"& > &":{"&:before, &:after":{display:"none"}},variants:Je}),A=t.forwardRef(({size:e="md",...a},o)=>t.createElement(Vt,{size:e,...a,ref:o}));A.displayName="Text";const Gn=({title:e,description:a,onAction:o,cancelActionText:r,confirmActionText:n,onClose:i,...s})=>t.createElement(j,{defaultOpen:!0},t.createElement(j.Content,{onEscapeKeyDown:c=>c.preventDefault(),onCloseAutoFocus:i,...s},t.createElement(ct,{as:j.Title,size:"sm",css:{mb:"$5"}},e),a&&t.createElement(A,{as:j.Description,css:{mb:"$5"}},a),t.createElement(Pe,{gap:"2",justify:"end"},r&&t.createElement(ne,{appearance:"outline",as:j.Cancel,onClick:()=>o(!1),size:"sm"},r),t.createElement(ne,{as:j.Action,onClick:()=>o(!0),size:"sm"},n)))),jn=[],Yn=(e,a)=>{switch(a.type){case"ADD":return[...e,{...a.payload,id:rr.uid()}];case"REMOVE":return e.filter(({id:o})=>o!==a.payload);default:return e}},Na=t.createContext({showAlert:()=>null}),Un=({children:e})=>{const[a,o]=t.useReducer(Yn,jn),r=On();return t.createElement(Na.Provider,{value:{showAlert:n=>o({payload:n,type:"ADD"})}},Boolean(a.length)&&t.createElement(Gn,{...a[0],key:a[0].id,onClose:()=>{r.current&&o({payload:a[0].id,type:"REMOVE"})}}),e)},Xn=()=>{const e=t.useContext(Na);if(e===void 0)throw new Error("useAlert must be used within a AlertProvider");return e},_t=(e,a)=>{let o;switch(typeof e){case"object":o={},Object.keys(e).forEach(r=>{const n=e[r];o[r]=n&&a(n)});break;default:o=a(e)}return o},Jn={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg",xxl:"lg"},Kn=({is:e})=>{const a=t.useContext(qt),{size:o}=a,r=t.useMemo(()=>_t(o,n=>Jn[n]),[o]);return t.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"}}}}}),We=Ma;We.displayName="Image";const Aa=()=>t.createElement(w,{css:{position:"relative",size:"100%"}},t.createElement(b,{is:v.User,css:{size:"100%"}})),Qn={xs:"xs",sm:"sm",md:"sm",lg:"md",xl:"md",xxl:"lg"},La=()=>{const e=t.useContext(qt),{name:a,size:o}=e,r=t.useMemo(()=>_t(o,n=>Qn[n]),[o]);return a?t.createElement(A,{size:r,css:{color:"$tonal400"}},a[0].toUpperCase()):t.createElement(Aa,null)},Zn=l(We,{size:"100%",objectFit:"cover"}),ei=({src:e,alt:a})=>e?t.createElement(Zn,{src:e,alt:a}):t.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"}}}},ti=l("div",Pa),ai=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=t.createContext({name:void 0,size:"lg"}),oi=({children:e,name:a,size:o})=>{const r=t.useMemo(()=>({name:a,size:o}),[a,o]);return t.createElement(qt.Provider,{value:r},e)},ri=({children:e,size:a="lg",name:o,disabled:r=!1,onClick:n})=>t.createElement(oi,{name:o,size:a},n?t.createElement(ai,{size:a,disabled:r,onClick:r?void 0:n,css:{cursor:r?"auto":"pointer"}},e):t.createElement(ti,{size:a},e)),Be=ri;Be.Image=ei,Be.Initial=La,Be.Placeholder=Aa,Be.Icon=Kn,Be.displayName="Avatar";const ni=l(D,{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:a="sm",children:o,...r})=>t.createElement(ni,{role:"status",theme:e,size:a,...r},t.Children.map(o,n=>{if(typeof n=="string"||typeof n=="number")return t.createElement(w,{css:{whiteSpace:"nowrap",overflowX:"hidden",textOverflow:"ellipsis",py:"$0"}},n);if(t.isValidElement(n)&&n.type===b)return t.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"}},ii=l(ge.ButtonBack,Ba),li=l(ge.ButtonNext,Ba),si=e=>t.createElement(ii,{...e},t.createElement(b,{is:v.ChevronLeft})),ci=e=>t.createElement(li,{...e},t.createElement(b,{is:v.ChevronRight})),di=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"}}}),mi=l(ge.Slide,{}),ui=({children:e,...a})=>t.createElement(mi,{...a,tag:"div"},t.createElement(w,{css:{px:"$3"}},e)),pi=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:a,slideHeight:o,slideWidth:r,numSlides:n,...i})=>t.createElement(Ne,{css:a},t.createElement(ge.CarouselProvider,{naturalSlideWidth:r,naturalSlideHeight:o,totalSlides:n,...i},e)),hi=()=>t.useContext(ge.CarouselContext);ve.ArrowNext=ci,ve.ArrowPrevious=si,ve.Pagination=di,ve.Slide=ui,ve.Slider=pi,ve.displayName="Carousel";const gi=l(xa.Indicator,{display:"flex",alignItems:"center",justifyContent:"center"}),fi=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"}}}}),dt=t.forwardRef((e,a)=>t.createElement(fi,{...e,ref:a},t.createElement(gi,null,t.createElement(b,{is:e.checked==="indeterminate"?v.Minus:v.Ok,css:{pointerEvents:"none",position:"absolute",strokeWidth:"3",size:14}}))));dt.displayName="Checkbox";const $i={success:{color:"$success"},warning:{color:"$warningText","& svg":{color:"$warningDark"}},info:{color:"$primary"},neutral:{color:"$tonal400"},error:{color:"$danger"}},bi={success:v.OkCircle,warning:v.Danger,info:v.Info,neutral:v.Info,error:v.Error},vi=l(D,{variants:{theme:$i}}),yi=l(b,{flexShrink:"0",mr:"$2"}),mt=({css:e,showIcon:a=!0,theme:o="error",size:r="sm",children:n,...i})=>t.createElement(vi,{theme:o,css:e,...i},a&&t.createElement(yi,{size:"sm",is:bi[o]}),t.createElement(A,{as:"span",size:r,css:{transform:"translateY($space$0)"}},n)),xi=l("label",{color:"$tonal500",fontFamily:"$body",m:0,variants:{size:{sm:Ke({size:"sm"}),md:Ke({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"}}]}),wi=l("span",{color:"$danger",ml:"$1",fontWeight:400}),Oe=({align:e="start",as:a="label",direction:o="row",size:r="md",type:n="block",children:i,required:s,...c})=>t.createElement(xi,{as:a,size:r,type:n,align:e,direction:o,...c},i,s&&t.createElement(wi,{"aria-hidden":!0},"*"));Oe.displayName="Label";const He=l("li",{}),Oa=l("ul",{fontFamily:"$body",m:"unset",p:"unset",[`& > ${He}`]:{"&:not(:last-child)":{mb:"$2"},"&:last-child":{mb:0}},variants:{...Je,as:{ol:{pl:"$4",listStyle:"decimal",[`& > ${He}`]:{pl:"$1","&::marker":{fontSize:"$sm",fontWeight:"bold"}}},ul:{pl:"$3",[`& > ${He}`]:{pl:"$2","&::marker":{content:"\u2022",fontWeight:"bold"}}}},theme:{primary:{[`& > ${He}`]:{"&::marker":{color:"$primary"}}}}}}),ut=t.forwardRef(({size:e="md",noCapsize:a=!0,ordered:o,...r},n)=>t.createElement(Oa,{ref:n,as:o?"ol":"ul",size:e,noCapsize:a,...r}));ut.Item=He;const Ei=l(w,{bg:"$tonal100",borderRadius:"$1",color:"$tonal600",fontFamily:"$mono",fontSize:"$sm",lineHeight:1.4,my:"$4",p:"$3"}),Ci=({node:e})=>t.createElement(Ei,{as:"pre"},e.value),Ha=l("em",{fontStyle:"italic"}),Si=({node:e,handleNode:a})=>{var o;return t.createElement(Ha,null,(o=e.children)==null?void 0:o.map(a))},ki=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"}}},Di=({node:e,handleNode:a,...o})=>{var r;const{as:n,size:i}=ki(e.depth);return t.createElement(ct,{as:n,size:i,...o},(r=e.children)==null?void 0:r.map(a))},zi=l(w,{bg:"$tonal100",borderRadius:"$0",color:"$tonal600",display:"inline-block",fontFamily:"$mono",fontSize:"85%",p:"$0 $1"}),Ii=({node:e})=>t.createElement(zi,{as:"code"},e.value),Ti=({node:e,css:a})=>{var o;return t.createElement(We,{src:e.url,alt:(o=e.alt)!=null?o:void 0,css:a})},Ri=({node:e,handleNode:a})=>{var o,r;return t.createElement(pt,{title:(o=e.title)!=null?o:void 0,href:e.url},(r=e.children)==null?void 0:r.map(a))},Fi=({node:e,handleNode:a,css:o})=>{var r;return t.createElement(ut,{css:{"& p:before, & p:after":{display:"none"},...o},ordered:e.ordered||void 0},(r=e.children)==null?void 0:r.map(a))},Ni=({node:e,handleNode:a})=>{var o;return t.createElement(ut.Item,null,(o=e.children)==null?void 0:o.map(a))},Mi=({node:e,handleNode:a,...o})=>{var r;return t.createElement(A,{...o},(r=e.children)==null?void 0:r.map(a))},Ai=l("strong",{fontWeight:600}),Li=({node:e,handleNode:a})=>{var o;return t.createElement(Ai,null,(o=e.children)==null?void 0:o.map(a))},Pi=({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",...a},o)=>u.default.createElement(Va,{ref:o,orientation:e,...a})),Wi=({css:e})=>t.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} > &, ${He} > &, ${Ha} > &`]:{fontSize:"100%",lineHeight:1,"&::before, &::after":{content:"none"}},variants:Je}),pt=t.forwardRef(({size:e="md",href:a,...o},r)=>t.createElement(_a,{...!a&&{as:"button",noCapsize:!0},size:e,href:a,...o,ref:r}));pt.displayName="Link";const jt=({children:e,css:a})=>t.createElement(A,{size:"sm",css:{color:"$tonal300",maxWidth:"80ch",...a}},e),te=({css:e,children:a,error:o,fieldId:r,label:n,prompt:i,description:s,required:c,hideLabel:d})=>{const m=d?Dt.Root:D;return t.createElement(w,{css:e},t.createElement(m,{css:{justifyContent:"space-between",alignItems:"center",mb:"$3"}},t.createElement(Oe,{htmlFor:r,required:c},n),i&&t.createElement(pt,{href:i.link,size:"sm"},i.label)),s&&t.createElement(jt,{css:{mb:"$3"}},s),a,o&&t.createElement(mt,{css:{mt:"$2"}},o))};te.displayName="FieldWrapper";const Bi=l(Fe.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"}}),Oi=l(Fe.Indicator,{size:"6px",borderRadius:"$round",backgroundColor:"currentcolor",position:"absolute"}),ht=e=>t.createElement(Bi,{...e},t.createElement(Oi,null));ht.displayName="RadioButton";const Yt=l(Fe.Root,{display:"flex",flexWrap:"wrap",variants:{direction:{row:{flexDirection:"row","& > *:not(:last-child)":{mr:"$5"}},column:{flexDirection:"column"}}}});Yt.displayName="RadioButtonGroup";const gt=({align:e="start",children:a,css:o,description:r,direction:n="row",error:i,label:s,required:c})=>t.createElement(w,{css:o},t.createElement(Oe,{align:e,direction:n,required:c,type:"inline"},t.Children.map(a,d=>t.createElement(w,{css:{[n==="reverse"?"ml":"mr"]:"$3",...((d==null?void 0:d.type)===dt||(d==null?void 0:d.type)===ht)&&{transform:"translateY($space$1)"}}},d)),s),i&&t.createElement(mt,{css:{mt:"$2"}},i),r&&t.createElement(jt,{css:{mt:"$2",[n==="reverse"?"mr":"ml"]:"calc($space$3 + $sizes$1)"}},r));gt.displayName="InlineFieldWrapper";var qa=(e=>(e.LOCAL="local",e.SESSION="session",e))(qa||{});const Hi=l("form",{}),Vi=({persist:e,watch:a,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=a(),p=Object.keys(m).filter(g=>{var h;if(!((h=i.exclude)!=null&&h.includes(g)))return g});s={...d,include:p}}return Cr.default(n,{watch:a,setValue:o},s),r},Ga=({formMethods:e,handleSubmit:a,onSubmit:o,onError:r,children:n,...i})=>t.createElement(V.FormProvider,{...e},t.createElement(Hi,{"aria-label":"form",...i,onSubmit:a(o,r)},n)),ja=({children:e,defaultValues:a={},onSubmit:o,onError:r,validationMode:n="onBlur",render:i,persist:s,...c})=>{Re.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=V.useForm({defaultValues:a,mode:n}),{handleSubmit:m,watch:p,setValue:g}=d,h=i?i(d):e,f={formMethods:d,handleSubmit:m,onSubmit:o,onError:r,...c};return s?t.createElement(Vi,{persist:s,watch:p,setValue:g},t.createElement(Ga,{...f},h)):t.createElement(Ga,{...f},h)};ja.displayName="Form";const ie=e=>{var a;const{errors:o}=V.useFormContext(),r=e.split(/[,[\].]+?/).filter(Boolean);return{error:(a=(()=>Sr.default(o,r))())==null?void 0:a.message}};var _i=(e=>(e.ON="on",e.OFF="off",e))(_i||{});const Ya=({css:e,label:a,name:o,validation:r,description:n,defaultChecked:i=!1,checked:s,...c})=>{const{control:d}=V.useFormContext(),{error:m}=ie(o),{field:{ref:p,onChange:g,value:h,name:f}}=V.useController({name:o,control:d,rules:r,defaultValue:i});return t.useEffect(()=>{typeof s<"u"&&g(s)},[s]),t.createElement(gt,{css:e,description:n,error:m,label:a,required:Boolean(r==null?void 0:r.required)},t.createElement(dt,{ref:p,name:f,...c,onCheckedChange:g,value:h?"on":"off",checked:h,...m&&{state:"error"}}))};Ya.displayName="CheckboxField";const Ua={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},qi=l("span",{display:"inline-flex",alignItems:"center",px:"$1",flexGrow:1,...Ua,"& > *:not(:last-child)":{mr:"$1"}}),Gi={sm:"sm",md:"sm",lg:"md"},ji=l(b,{flexShrink:0}),Xa=({...e})=>{const a=t.useContext(Ja),{size:o}=a,r=t.useMemo(()=>_t(o,n=>Gi[n]),[o]);return t.createElement(ji,{...e,size:r})},Yi=({children:e,...a})=>{const o=t.Children.toArray(e),r=o.length<=1;return t.createElement(qi,{...a},o.map((n,i)=>!r&&typeof n=="string"?t.createElement(w,{as:"span",css:Ua,key:n},n):t.isValidElement(n)&&n.type===b?t.createElement(Xa,{key:`icon-${i}`,...n.props}):n))},Ui=l(D,{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",...Ke({size:"sm"})},md:{height:"$3",...Ke({size:"sm"})},lg:{height:"$4",...Ke({size:"md"})}}}}),Ja=t.createContext({}),Xi=({size:e,children:a})=>{const o=t.useMemo(()=>({size:e}),[e]);return t.createElement(Ja.Provider,{value:o},a)},Ji=t.forwardRef(({asWorkaround:e,size:a="md",...o},r)=>t.createElement(Xi,{size:a},t.createElement(Ui,{ref:r,as:e,size:a,...o}))),de=Ji;de.Content=Yi,de.Icon=Xa,de.displayName="Chip";const Ut=t.forwardRef(({gap:e=2,...a},o)=>t.createElement(Pe,{ref:o,direction:"row",gap:e,align:!1,...a})),Xt=t.createContext({isDismissed:!1,setIsDismissed:()=>null}),Ki=({children:e,disabled:a})=>{const[o,r]=t.useState(!1),n=t.useMemo(()=>({disabled:a,isDismissed:o,setIsDismissed:r}),[a,o]);return t.createElement(Xt.Provider,{value:n},e)},Qi=({asChild:e=!1,value:a,onDismiss:o,...r})=>{const n=t.useContext(Xt),{isDismissed:i,disabled:s}=n;if(t.useEffect(()=>{i&&(o==null||o(a))},[i]),i)return null;const c={...s&&{["data-disabled"]:""},...r};return t.createElement(e?St.Slot:"div",{...c})},Zi=({disabled:e=!1,...a})=>t.createElement(Ki,{disabled:e},t.createElement(Qi,{...a})),el=e=>t.createElement("button",{type:"button",...e},"Dismiss"),Ka=({asChild:e=!1,...a})=>{const o=t.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)},...a};return t.createElement(e?St.Slot:el,{...i})},ft=Zi;ft.Trigger=Ka,ft.displayName="Dismissible";const Qa=t.createContext({onDismiss:()=>null}),tl=({children:e,disabled:a,onDismiss:o})=>{const r=t.useMemo(()=>({disabled:a,onDismiss:o}),[a,o]);return t.createElement(Qa.Provider,{value:r},e)},al=({as:e="div",disabled:a,onDismiss:o,...r})=>t.createElement(tl,{disabled:a,onDismiss:o},t.createElement(e,{...r})),ol=({children:e,disabled:a=!1,...o})=>{const r=t.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 t.createElement(ft,{disabled:i||a,onDismiss:n,...o},e)},ye=al;ye.Item=ol,ye.Trigger=Ka,ye.displayName="DismissibleGroup";const rl=l(de,{px:"$1"}),nl=({size:e="md",children:a,dismissActionLabel:o="Dismiss",...r})=>t.createElement(ye.Item,{asChild:!0,...r},t.createElement(rl,{size:e},t.createElement(de.Content,null,a),t.createElement(ye.Trigger,{asChild:!0},t.createElement(N,{label:o,css:{color:"$tonal200"},size:e==="sm"?"xs":"sm"},t.createElement(b,{is:v.Close}))))),il=t.forwardRef((e,a)=>t.createElement(Ut,{as:ye,ref:a,...e})),Jt=il;Jt.Item=nl,Jt.displayName="ChipDismissibleGroup";const Za=l(b,{display:"none"}),ll=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"}}}),sl=({size:e="md",children:a,...o})=>t.createElement(ot.Item,{...o,asChild:!0},t.createElement(ll,{asWorkaround:"button"},t.createElement(Za,{is:v.Ok,size:e==="lg"?"md":"sm"}),t.createElement(de.Content,null,a))),cl=t.forwardRef((e,a)=>t.createElement(Ut,{ref:a,as:ot.Root,orientation:"horizontal",...e})),Kt=cl;Kt.Item=sl,Kt.displayName="ChipToggleGroupItem";const dl=l(ze.ComboboxInput,{boxShadow:"none",fontSize:"$md",appearance:"none",backgroundImage:Sa(G.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"}}}}),ml=l(ze.ComboboxList,{listStyle:"none",m:0,p:0,userSelect:"none"}),ul=l(ze.ComboboxOption,{color:"$tonal500",cursor:"pointer",m:0,p:"$2",'&:hover, &[aria-selected="true"]':{bg:"$tonal50",borderRadius:"$0"},"[data-user-value]":{color:"$primary"}}),pl=l(ze.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 hl=l(ze.Combobox,{}),xe=e=>t.createElement(hl,{...e});xe.displayName="Combobox",xe.Option=ul,xe.Input=dl,xe.Popover=pl,xe.List=ml,xe.OptionText=ze.ComboboxOptionText;var J=(e=>(e.NONE="none",e.PENDING="pending",e.FULFILLED="fulfilled",e.REJECTED="rejected",e))(J||{});const gl=e=>{if(e[0])return e[0].desc?"desc":"asc"},fl=async(e,a,o,r,n)=>{var i,s,c,d,m,p;const{pageIndex:g,pageSize:h}=o,f={pageIndex:(i=a==null?void 0:a.pageIndex)!=null?i:g,pageSize:(s=a==null?void 0:a.pageSize)!=null?s:h,sortBy:(d=a==null?void 0:a.sortBy)!=null?d:(c=r[0])==null?void 0:c.id,sortDirection:(m=a==null?void 0:a.sortDirection)!=null?m:gl(r),globalFilter:(p=a.globalFilter)!=null?p:n},$=await e(f);return Re.default(Array.isArray($==null?void 0:$.results),"The getAsyncData function must return an object with a property `result` which must be an array"),Re.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"),$},$l={pageIndex:0,pageSize:10},bl=e=>{const[a,o]=u.default.useState(!!e),[r,n]=u.default.useState({...$l,...e||{}}),i=u.default.useCallback(()=>{o(!0)},[]);return{isPaginated:a,paginationState:r,setPaginationState:n,applyPagination:i}},vl=e=>{const[a,o]=u.default.useState(!1),[r,n]=u.default.useState(e?[{id:e.column,desc:e.direction==="desc"}]:[]);return{isSortable:a,setIsSortable:o,sorting:r,setSorting:n}},eo=t.createContext(null),yl=({columns:e,data:a=[],getAsyncData:o,defaultSort:r,initialState:n=void 0,children:i})=>{var s;const[c,d]=t.useState({results:a!=null?a:[],total:(s=a==null?void 0:a.length)!=null?s:0}),{isPaginated:m,applyPagination:p,paginationState:g,setPaginationState:h}=bl(n==null?void 0:n.pagination),[f,$]=t.useState(J.NONE),[y,O]=t.useState(""),{setIsSortable:I,isSortable:M,sorting:x,setSorting:C}=vl(r),E=t.useCallback(async F=>{if(o)try{$(J.PENDING);const _=await fl(o,F,g,x,y);d(_),$(J.FULFILLED)}catch{$(J.REJECTED)}},[o,g==null?void 0:g.pageIndex,g==null?void 0:g.pageSize,x,y]);t.useEffect(()=>{E({})},[E]),kr.default(()=>{!a||d({results:a,total:a.length})},[a]);const T=()=>c.total,L=se.useReactTable({columns:e,data:c.results,pageCount:g?Math.ceil(T()/g.pageSize):-1,initialState:n,state:{sorting:x,globalFilter:y,pagination:g},manualPagination:o&&m,manualSorting:o&&m,enableSorting:f!==J.PENDING,enableGlobalFilter:!o,getCoreRowModel:se.getCoreRowModel(),getPaginationRowModel:m?se.getPaginationRowModel():void 0,getSortedRowModel:M||x.length?se.getSortedRowModel():void 0,getFilteredRowModel:se.getFilteredRowModel(),onPaginationChange:m?h:void 0,onSortingChange:C,onGlobalFilterChange:O}),R=t.useMemo(()=>({...L,data:c,setData:d,setIsSortable:I,applyPagination:p,getTotalRows:T,isSortable:M,asyncDataState:f,runAsyncData:E}),[L,p,T,M]);return t.createElement(eo.Provider,{value:R},i)},K=()=>{const e=t.useContext(eo);if(!e)throw new Error("useDataTable can only be called from inside a DataTableProvider");return e},$t=l("tr",{bg:"unset"}),to=t.forwardRef((e,a)=>t.createElement($t,{...e,ref:a}));to.displayName="TableRow";const xl=l("tbody",{variants:{striped:{true:{[`${$t}`]:{"&:nth-child(odd)":{bg:"white"},"&:nth-child(even)":{bg:"$tonal50"}}},false:{[`${$t}`]:{bg:"white"}}}}}),ao=({striped:e=!0,...a})=>t.createElement(xl,{striped:e,...a});ao.displayName="TableBody";const Ve=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"}});Ve.displayName="TableCell";const oo=l("tfoot",{});oo.displayName="TableFooter";const bt=l("td",{color:"$tonal400",fontFamily:"$body",fontWeight:600,p:"$2 $3",textAlign:"left",verticalAlign:"middle"});bt.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"},wl=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",...a})=>u.default.createElement(wl,{theme:e,...a});ro.displayName="TableHeader";const no=({children:e,numberOfStickyColumns:a=0,css:o,...r})=>{const[n,i]=u.default.useState(!1);return u.default.createElement(w,{onScroll:s=>{const c=s.currentTarget.scrollWidth>s.currentTarget.clientWidth;c!==n&&i(c)},role:"scrollbar",css:{overflow:"auto",maxWidth:"100%",[`& td:nth-of-type(${a}), th:nth-of-type(${a})`]:{...n&&{boxShadow:"$colors$alpha200 -2px -3px 9px 1px",clipPath:"inset(0px -10px 0px 0px)"},...a===1&&{position:"sticky",left:"0",zIndex:"2"}},"& td":{bg:"inherit"},...o},...r},e)},El=l("table",{borderCollapse:"separate",borderSpacing:0,fontFamily:"$sans",fontSize:"$sm",width:"100%",variants:{size:{md:{[`${Ve}, ${me}, ${bt}`]:{height:"$4"}},lg:{[`${Ve}, ${me}, ${bt}`]:{height:"$5"}}},corners:{round:{[`${me}`]:{"&:first-of-type":{borderTopLeftRadius:"$0"},"&:last-of-type":{borderTopRightRadius:"$0"}},[`${$t}:last-child`]:{[`${Ve}:first-child`]:{borderBottomLeftRadius:"$0"},[`${Ve}:last-child`]:{borderBottomRightRadius:"$0"}}},square:{}}}}),z=({size:e="md",corners:a="round",numberOfStickyColumns:o=0,...r})=>{const n=t.createElement(El,{size:e,corners:a,...r});return o?t.createElement(no,{numberOfStickyColumns:o},n):n};z.Body=ao,z.Cell=Ve,z.Footer=oo,z.FooterCell=bt,z.Header=ro,z.HeaderCell=me,z.Row=to,z.StickyColumnsContainer=no,z.displayName="Table";const Cl=({striped:e=!1,...a})=>{const{getRowModel:o}=K();return t.createElement(z.Body,{...a,striped:e},o().rows.map(r=>t.createElement(W.Row,{row:r,key:r.id})))},Zt=({cell:e})=>t.createElement(z.Cell,{key:e.id},se.flexRender(e.column.columnDef.cell,e.getContext())),Sl=({children:e})=>{const{asyncDataState:a,runAsyncData:o}=K();return a!==J.REJECTED?null:e(o)},kl=({children:e,hidden:a=!1})=>a?t.createElement(Dt.Root,null,e):e?t.createElement(t.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=t.forwardRef(({type:e="text",size:a="md",...o},r)=>e==="number"?t.createElement(io,{type:"text",inputMode:"numeric",pattern:"[0-9]*",size:a,...o,ref:r}):t.createElement(io,{type:e,size:a,...o,ref:r}));we.displayName="Input";const Dl=()=>{const e=t.useRef(null),a=t.useCallback(o=>{o&&(e.current=o)},[]);return[e,a]},zl=()=>{const[e,a]=t.useState(null),o=t.useCallback(r=>{r&&a(r)},[]);return[e,o]};var Il=(e=>(e.SEARCH="SEARCH",e.CLEAR="CLEAR",e))(Il||{});const Tl=l(b,{color:"$tonal300",position:"absolute",pointerEvents:"none",variants:{size:{sm:{top:"$2",right:"$2",size:"$1"},md:{top:10,right:10,size:20}}}}),Rl=l(we,{'&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, & input[type="search"]::-webkit-search-results-decoration':{display:"none"}}),vt=t.forwardRef(({size:e="md",css:a,value:o,defaultValue:r="",onValueChange:n,clearText:i="Clear",onChange:s,...c},d)=>{const[m,p]=Dl(),[g,h]=t.useState(r),[f,$]=t.useState(r?"CLEAR":"SEARCH");t.useEffect(()=>{typeof o>"u"||(h(o),$(o?"CLEAR":"SEARCH"))},[o]),t.useImperativeHandle(d,()=>m.current);const y=()=>{var M,x;const C=m.current;if(!C)return;const E=(M=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:M.set;(x=E==null?void 0:E.call)==null||x.call(E,C,"");const T=new Event("input",{bubbles:!0});C.dispatchEvent(T),C.focus(),n==null||n("")},O=M=>{s==null||s(M);const x=M.target.value;h(x),n==null||n(x),$(x?"CLEAR":"SEARCH")},I=()=>f==="SEARCH"?t.createElement(Tl,{is:v.Search,size:e,css:{size:e=="sm"?"$1":20}}):t.createElement(N,{label:i,theme:"neutral",size:e,css:{position:"absolute",top:"0",right:"$1"},onClick:y},t.createElement(b,{is:v.Close}));return t.createElement(w,{css:{position:"relative",...a}},t.createElement(Rl,{ref:p,size:e,type:"search",...c,value:g,onChange:O,css:{pr:e==="sm"?"$5":"$6"}}),I())});vt.displayName="SearchInput";const Fl=({onChange:e,label:a,hideLabel:o=!1,...r})=>{const{setGlobalFilter:n,getState:i,resetPagination:s}=K(),{globalFilter:c}=i(),d=Ie.debounce(250,m=>{const{target:{value:p}}=m;e==null||e(m),s(),n(p)});return t.createElement(t.Fragment,null,t.createElement(kl,{hidden:o},t.createElement(Oe,{css:{mb:"$3"},htmlFor:a},a)),t.createElement(vt,{...r,defaultValue:c,onChange:d,name:a}))},Nl=({sortable:e=!0,theme:a="light",...o})=>{const{getHeaderGroups:r,setIsSortable:n}=K();return t.useEffect(()=>{n(e)},[e,n]),t.createElement(z.Header,{theme:a,...o},r().map(i=>t.createElement(z.Row,{key:i.id},i.headers.map(s=>t.createElement(W.HeaderCell,{header:s,key:s.id})))))},Ml={asc:v.SortUp,desc:v.SortDown},Al=({direction:e})=>t.createElement(b,{is:Ml[e],size:"sm",css:{position:"absolute",left:"$1"}}),Ll=({header:e,children:a,css:o,...r})=>{const n=e.column.getIsSorted(),{isSortable:i}=K(),s=e.column.getCanSort();return t.createElement(z.HeaderCell,{onClick:i&&s?e.column.getToggleSortingHandler():void 0,css:{cursor:i&&s?"pointer":"initial",...o},...r},t.createElement(D,{css:{alignItems:"center"}},se.flexRender(e.column.columnDef.header,e.getContext()),n&&i&&t.createElement(D,{css:{position:"relative",alignItems:"center"}},t.createElement(Al,{direction:n}))))},Pl=l(st,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:1}),ea=e=>{const{asyncDataState:a}=K();return a!==J.PENDING?null:t.createElement(Pl,{...e})},Wl=({row:e})=>t.createElement(z.Row,null,e.getVisibleCells().map((a,o)=>t.createElement(Zt,{key:a.id,cell:a}))),Bl=({sortable:e,striped:a,theme:o,css:r,numberOfStickyColumns:n=0,...i})=>{const{asyncDataState:s}=K(),c=s===J.PENDING;return t.createElement(t.Fragment,null,t.createElement(ea,null),t.createElement(z,{...i,numberOfStickyColumns:n,css:{...r,...c&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},t.createElement(W.Head,{theme:o,sortable:e}),t.createElement(W.Body,{striped:a})))},lo=t.createContext({idColumn:"id"}),Ol=()=>{const e=t.useContext(lo);if(!e)throw new Error("useDragAndDropTable can only be called within a DragAndDropContainer");return e},Hl=(e,a,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(a.results,c,d);return n==null||n(c,d,m),{results:m,total:m.length}},Vl=(e,a)=>e.results.map(o=>{const r=o[a];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}),_l=({idColumn:e="id",onChange:a=void 0,children:o})=>{const{data:r,setData:n}=K(),i=t.useMemo(()=>Vl(r,e),[r]),s=fe.useSensors(fe.useSensor(fe.PointerSensor),fe.useSensor(fe.KeyboardSensor,{coordinateGetter:qe.sortableKeyboardCoordinates}));return t.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=>Hl({active:d,over:m},p,i,e,a))},modifiers:[mr.restrictToVerticalAxis]},t.createElement(qe.SortableContext,{items:i,strategy:qe.verticalListSortingStrategy},t.createElement(lo.Provider,{value:{idColumn:e}},o)))},ql=({row:e})=>{const{idColumn:a}=Ol(),{attributes:o,listeners:r,transform:n,setNodeRef:i,isDragging:s}=qe.useSortable({id:e.original[a]});return t.createElement(z.Row,{ref:i,css:{transform:ur.CSS.Transform.toString(n),zIndex:s?5:void 0}},e.getVisibleCells().map((c,d)=>d===0?t.createElement(z.Cell,{key:c.id},t.createElement(jl,{...o,...r,isDragging:s,css:{display:"inline-block"},label:"drag and drop"}),se.flexRender(c.column.columnDef.cell,c.getContext())):t.createElement(Zt,{key:c.id,cell:c})))},Gl=l(N,{color:"inherit !important",fill:"currentColor",variants:{isDragging:{true:{cursor:"grabbing"},false:{cursor:"grab"}}}}),jl=t.forwardRef(({isDragging:e,size:a,...o},r)=>t.createElement(Gl,{ref:r,isDragging:e,appearance:"simple",size:a,...o},t.createElement(b,{is:v.DragHandle,size:a}))),Yl=({striped:e=!1,...a})=>{const{getRowModel:o}=K();return t.createElement(z.Body,{...a,striped:e},o().rows.map(r=>t.createElement(ql,{row:r,key:r.id})))},Ul=({idColumn:e,onDragAndDrop:a,sortable:o,striped:r,theme:n,css:i,...s})=>{const{asyncDataState:c}=K(),d=c===J.PENDING;return t.createElement(_l,{onChange:a,idColumn:e},t.createElement(ea,null),t.createElement(z,{...s,css:{...i,...d&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},t.createElement(W.Head,{theme:n,sortable:o}),t.createElement(Yl,{striped:r})))},Xl=l("select",{appearance:"none",backgroundColor:"white",backgroundImage:Sa(G.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"}}}}),yt=t.forwardRef(({placeholder:e,children:a,size:o="md",...r},n)=>{const i={size:o,ref:n,...r};return[r.value,r.defaultValue].every(s=>s===void 0)&&(i.defaultValue=""),t.createElement(Xl,{...i},e&&t.createElement("option",{disabled:!0,hidden:!0,value:""},e),a)});yt.displayName="Select";const so=({direction:e,...a})=>{const o=e==="next";return u.default.createElement(N,{appearance:"outline",isRounded:!0,label:o?"Next page":"Previous page",name:o?"Next page":"Previous page",size:"md",...a},u.default.createElement(b,{is:o?v.ChevronRight:v.ChevronLeft}))},Jl=({gotoPage:e,pageCount:a,pageIndex:o,disabled:r})=>u.default.createElement(D,{css:{alignItems:"center"}},u.default.createElement(yt,{value:o,size:"sm",css:{mr:"$3"},disabled:r,onChange:n=>{e(Number(n.target.value))}},Array.from({length:a},(n,i)=>i).map(n=>u.default.createElement("option",{key:n,value:n},n+1))),u.default.createElement(A,{size:"sm",css:{flex:"none"}},`of ${a} ${a>1?"pages":"page"}`)),Kl=l("nav",{display:"flex",justifyContent:"space-between",alignItems:"center",fontVariantNumeric:"tabular-nums"}),Ql=e=>{const{applyPagination:a,getState:o,getRowModel:r,getPageCount:n,previousPage:i,nextPage:s,setPageIndex:c,getTotalRows:d,asyncDataState:m}=K();t.useEffect(()=>{a()},[a]);const{pagination:p}=o(),g=p.pageIndex*p.pageSize+1,h=g+r().rows.length-1,f=m===J.PENDING||m===J.REJECTED;return t.createElement(Kl,{...e},t.createElement(A,{size:"sm"},`${g.toString()} - ${h.toString()} of ${d()} items`),t.createElement(Jl,{gotoPage:c,pageCount:n(),pageIndex:p.pageIndex,disabled:f}),t.createElement(D,{css:{justifyContent:"flex-end"}},t.createElement(so,{direction:"previous",disabled:p.pageIndex===0||f,onClick:i,css:{mr:"$4"}}),t.createElement(so,{direction:"next",disabled:p.pageIndex===n()-1||f,onClick:s})))},W=e=>t.createElement(yl,{...e});W.Body=Cl,W.DataCell=Zt,W.DragAndDropTable=Ul,W.Head=Nl,W.HeaderCell=Ll,W.Pagination=Ql,W.Row=Wl,W.GlobalFilter=Fl,W.Table=Bl,W.Loading=ea,W.Error=Sl;const Zl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],es=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],co={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,a)=>{const o=e.slice(0,a);return e.slice(a).concat(o)},mo=({css:e,refDateSelected:a,refDateToday:o,firstDayOfWeek:r=0,monthNames:n=Zl,weekdayNames:i=es,labels:s=co,date:c=new Date,minDate:d,maxDate:m,setYear:p,...g})=>{const[h,f]=t.useState(!1),[$,y]=t.useState(c==null?void 0:c.getFullYear()),O=R=>{const F=c;F.setFullYear(R),p(F),f(!1)},I=d&&$-16<=d.getFullYear(),M=m&&$>=m.getFullYear(),x=Array.from({length:16},(R,F)=>{const _=$-F;return m&&_>m.getFullYear()||d&&_<d.getFullYear()?0:_}),{calendars:C,getBackProps:E,getForwardProps:T,getDateProps:L}=pr.useDayzed({firstDayOfWeek:r,showOutsideDays:!0,date:c,minDate:d,maxDate:m,...g});return C.length?t.createElement(w,{css:{position:"relative",width:"min-content",mt:"-$1",...e}},t.createElement(D,{css:{position:"absolute",top:0,right:"-$1"}},t.createElement(N,{label:s[h?"previousYear":"previous"],theme:"neutral",size:"md",...!h&&E({calendars:C}),...h&&{onClick:()=>y($-16)},disabled:h&&I},t.createElement(b,{is:v.ChevronLeft})),t.createElement(N,{label:s[h?"nextYear":"next"],theme:"neutral",size:"md",...!h&&T({calendars:C}),...h&&{onClick:()=>y($+16)},disabled:h&&M},t.createElement(b,{is:v.ChevronRight}))),h&&t.createElement(ta,{css:{gridTemplateColumns:"repeat(4, 1fr)",pt:"$7",direction:"rtl",gridGap:"$3 $1"}},x.map((R,F)=>{const _=R===c.getFullYear();return R?t.createElement(as,{key:`${R}${F}`,theme:_?"primary":"neutral",onClick:()=>O(R),selected:_},R):t.createElement(w,{key:F,css:{width:"$6",height:"$4"}})})),!h&&C.map(({month:R,year:F,weeks:_})=>t.createElement(w,{key:`${R}${F}`},t.createElement(D,{css:{height:"$4",alignItems:"center",mb:"$4"}},t.createElement(ne,{theme:"neutral",css:{px:"0",color:"$tonal600"},onClick:()=>f(!0)},n[R]," ",F)),t.createElement(ta,{css:{mb:"$3"}},os(i,r).map(ke=>t.createElement(A,{as:"span",size:"sm",key:`${R}${F}${ke}`,css:{fontWeight:600,textAlign:"center"}},ke))),t.createElement(ta,null,_.map((ke,Ct)=>ke.map((S,Y)=>{const _e=`${R}${F}${Ct}${Y}`;if(!S)return t.createElement("div",{key:_e});const{date:Qo,selected:ba,today:va,prevMonth:Zo,nextMonth:er}=S;return t.createElement(ts,{isOutsideMonth:Zo||er,isSelected:ba,isToday:va,key:_e,ref:ba?a:va?o:null,...L({dateObj:S}),type:"button"},Qo.getDate())})))))):null};mo.displayName="Calendar";const rs=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:Nt},'&[data-side="right"]':{animationName:Mt},'&[data-side="bottom"]':{animationName:Rt},'&[data-side="left"]':{animationName:Ft}}},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:a="top",sideOffset:o=8,closePopoverText:r="Close popover",showCloseButton:n=!0,size:i="md",...s})=>t.createElement(rs,{size:i,side:a,sideOffset:o,...s},n&&t.createElement(N,{as:$e.Close,css:{position:"absolute",right:"$0",top:"$0"},label:r,size:"md",hasTooltip:!1,theme:"neutral"},t.createElement(b,{is:v.Close})),e,t.createElement(ns,{width:16,height:8}));l($e.Root,{});const le=e=>t.createElement($e.Root,{...e});le.Content=is,le.Portal=$e.Portal,le.Trigger=$e.Trigger,le.displayName="Popover";const uo="DD/MM/YYYY";Ge.default.extend(Dr.default);const ls=(e,a=uo)=>{const[o,r]=P.useState(e?Ge.default(e).toDate():void 0),[n,i]=P.useState(e?Ge.default(e).format(a):"");return{dateString:n,date:o,setDate:(s,c=!1)=>{const d=c?Ge.default(s,a,!0):Ge.default(s);r(d.isValid()?d.toDate():void 0),i(c?s:d.format(a))}}},aa=t.forwardRef(({initialDate:e,dateFormat:a=uo,firstDayOfWeek:o=1,disabled:r,monthNames:n,weekdayNames:i,size:s="md",labels:c,revalidate:d,onChange:m,minDate:p,maxDate:g,...h},f)=>{const{date:$,dateString:y,setDate:O}=ls(e,a),I={...co,...c},[M,x]=t.useState(!1),C=t.useRef(null),E=t.useRef(null);return t.useEffect(()=>{m==null||m($)},[$,m]),t.createElement(w,{css:{position:"relative"}},t.createElement(we,{name:"date",disabled:r,size:s,...h,onChange:T=>O(T.target.value,!0),value:y,ref:f}),t.createElement(le,{modal:!0,open:M,onOpenChange:x},t.createElement(le.Trigger,{asChild:!0},t.createElement(N,{css:{position:"absolute",top:"0",right:"0"},disabled:r,label:I.open,size:s,theme:"neutral",hasTooltip:!1},t.createElement(b,{is:v.CalendarEvent}))),t.createElement(le.Portal,null,t.createElement(le.Content,{css:{pr:"$sizes$2",zIndex:Ye},side:"bottom",align:"end",showCloseButton:!1,onOpenAutoFocus:T=>{var L,R;T.preventDefault(),$?(L=E.current)==null||L.focus():(R=C.current)==null||R.focus()}},t.createElement(mo,{date:$||new Date,selected:$,onDateSelected:async T=>{x(!1),await O(T.date,!1),d&&d()},setYear:async T=>{await O(T,!1),d&&d()},minDate:p,maxDate:g,refDateToday:C,refDateSelected:E,firstDayOfWeek:o,monthNames:n,weekdayNames:i,labels:I})))))});aa.displayName="DateInput";const po=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c,trigger:d}=V.useFormContext(),{error:m}=ie(o),p=r?c(r):c;return t.createElement(te,{css:e,description:i,error:m,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.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"}),ss=l(q.Close,{}),ra="translate3d(-50%, -50%, 0)",ho="translate3d(-50%, 50vh, 0)",go="modal_overlay",cs=k({"0%":{transform:ho},"100%":{transform:ra}}),ds=k({"0%":{transform:ra},"100%":{transform:ho}}),ms=l(q.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",overflowY:"auto",zIndex:Ye,"@allowMotion":{'&[data-state="open"]':{animation:`${At} 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:Ye,"&: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:a,closeDialogText:o="Close dialog",showCloseButton:r=!0,...n})=>t.createElement(q.Portal,null,t.createElement(ms,{id:go},t.Children.map(a,i=>(i==null?void 0:i.type)===oa&&i),t.createElement(us,{size:e,"aria-label":"Dialog",onPointerDownOutside:i=>{const s=i.target;(s==null?void 0:s.id)!==go&&i.preventDefault()},...n},r&&t.createElement(N,{as:q.Close,css:{position:"absolute",right:"$4",top:"$4"},label:o,hasTooltip:!1,size:"md",theme:"neutral"},t.createElement(b,{is:v.Close})),t.Children.map(a,i=>(i==null?void 0:i.type)!==oa&&i)))),hs=l(q.Root,{}),ue=e=>t.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(Te.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:Nt},'&[data-side="right"]':{animationName:Mt},'&[data-side="bottom"]':{animationName:Rt},'&[data-side="left"]':{animationName:Ft}}}}),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"}},fo=l(Te.Item,fs),$s=l("a",{textDecoration:"none"}),bs=({children:e,href:a,...o})=>u.default.createElement(fo,{...o,asChild:!0},u.default.createElement($s,{href:a,role:"menuitem"},e)),vs=l(Te.Separator,{height:"1px",backgroundColor:"$tonal200",my:"$2"}),ys=l(Te.Trigger,{}),xs=l(Te.Root,{}),Ee=e=>u.default.createElement(xs,{...e});Ee.Content=gs,Ee.Item=fo,Ee.LinkItem=bs,Ee.Portal=Te.Portal,Ee.Separator=vs,Ee.Trigger=ys;const $o=l(A,{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(We,{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(ws,{...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"}}}}),Es=l(D,{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"}}}}),Qe=({size:e="sm",children:a,...o})=>t.createElement(Es,{size:e,...o},t.Children.map(a,r=>t.isValidElement(r)&&(r.type===bo||r.type===vo||r.type===$o)?t.cloneElement(r,{...r.props,size:e}):r));Qe.displayName="EmptyState",Qe.Image=bo,Qe.Title=vo,Qe.Body=$o;const yo=({accept:e,children:a,multiple:o=!1,onFileSelect:r,...n})=>{const i=s=>{const{files:c}=s.target;r(c)};return t.createElement(ne,{as:"label",...n},t.createElement(b,{is:v.Upload}),a,t.createElement("input",{type:"file",onChange:i,accept:e,multiple:o,hidden:!0}))};yo.displayName="FileInput";const Cs=l("div",{display:"grid",variants:{gap:Tt("space",{gap:"$key"})}}),xo=({css:e,gap:a=2,minItemSize:o,maxItemSize:r="1fr",...n})=>t.createElement(Cs,{css:{...o&&{gridTemplateColumns:`repeat(auto-fit, minmax(${o}, ${r}))`},...e},gap:a,...n});xo.displayName="Grid";const wo=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=V.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return t.createElement(te,{css:e,description:i,error:d,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(we,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};wo.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=t.forwardRef((e,a)=>t.createElement(Ss,{ref:a,...e}));na.displayName="StackContent";const ks={code:Ci,emphasis:Si,heading:Di,inlineCode:Ii,image:Ti,link:Ri,list:Fi,listItem:Ni,paragraph:Mi,strong:Li,text:Pi,thematicBreak:Wi},Ds=e=>{var a,o;if((a=e.position)!=null&&a.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:a={},css:o})=>{const r=Tr.default(e,{extensions:[Rr.default()],mdastExtensions:[Ir.default.fromMarkdown]}),n={...ks,...a},i=s=>{const c=n[s.type];return c?t.createElement(c,{key:Ds(s),node:s,handleNode:i}):null};return t.createElement(na,{css:o},r.children.map(i))};Eo.displayName="MarkdownContent";const Co=u.default.createContext(void 0),zs=()=>{const e=u.default.useContext(Co);if(e===void 0)throw new Error("useNavigationMenuContext must be used within a NavigationMenuContextProvider");return e},xt=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:xt,onPointerLeave:xt},u.default.createElement(Is,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"}},Rs=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:a,...o},r)=>u.default.createElement(Rs,{active:a,...o,ref:r,onPointerMove:xt,onPointerLeave:xt},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:a,...o})=>{const{onNodeUpdate:r}=zs();return u.default.createElement(ce.Item,{value:a},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,a)}):n}))};Do.displayName="NavigationMenuDropdown";const Fs=l("button",{...la,...So}),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]":{...ko}}}}}),ca=u.default.forwardRef(({children:e,href:a,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:a,ref:s,elementType:n,css:r,...i},e)));ca.displayName="NavigationMenuLink";const zo=u.default.forwardRef((e,a)=>u.default.createElement(ca,{ref:a,variant:"dropdownItem",...e})),Io=l(A,{color:"$tonal500",fontWeight:600});zo.displayName="NavigationMenuDropdownItem",Io.displayName="NavigationMenuDropdownItemTitle";const As=k({"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:lt}),Bs=l("div",{position:"absolute",left:0,top:"100%",width:"100%",display:"flex",justifyContent:"center"}),pe=({children:e,css:a})=>{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 g;return n===""&&(g=setTimeout(()=>r(null),m)),()=>{g!==null&&clearTimeout(g)}},[n]);const p=(g,h)=>{if(g&&s&&n===h){const f=s/2,$=s-g.offsetLeft-g.offsetWidth+g.offsetWidth/2;r(Math.round(f-$))}return g};return u.default.createElement(Co.Provider,{value:{onNodeUpdate:p}},u.default.createElement(Ls,{onValueChange:i,css:a},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=Do,pe.DropdownContent=ia,pe.DropdownItem=zo,pe.DropdownItemTitle=Io,pe.DropdownTrigger=sa,pe.displayName="NavigationMenu";const Os=l(w,{position:"relative"}),Hs=l(D,{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:a})=>u.default.createElement(Os,null,!!e&&u.default.createElement(Hs,{role:"status"},e),a),_s=l("span",{zIndex:1}),qs=l(N,{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=t.forwardRef((e,a)=>{const{icon:o,disabledTooltipContent:r,showTooltip:n,...i}=e;return t.createElement(X,null,t.createElement(X.Trigger,{asChild:!0},t.createElement(_s,{tabIndex:-1},t.createElement(qs,{hasTooltip:!1,tabIndex:-1,appearance:"outline",ref:a,...i},t.createElement(b,{is:o})))),n&&t.createElement(X.Content,null,r))}),da=t.forwardRef((e,a)=>{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:g,disabledTooltipContent:h,css:f,...$}=e,[y,O]=t.useState(s),I=t.useRef(null);t.useImperativeHandle(a,()=>I.current);const M={increment:"increment",decrement:"decrement",...g},x={decrement:`Cannot enter values below ${r}`,increment:`Cannot enter values above ${n}`,...h},C=y>=n,E=y<=r,T=t.useCallback(S=>Math.min(Math.max(S,r),n),[n,r]),L=t.useCallback(S=>{O(S),p==null||p(Number(S))},[p]),R=t.useCallback(S=>{const Y=S.target.value.replace(/\D/g,"");L(Y)},[L]),F=t.useCallback(()=>{var S;if(C||d)return;(S=I==null?void 0:I.current)==null||S.focus();let Y;y===""?Y=i:Y=Number(y)+i,L(T(Y))},[T,C,d,i,L,y]),_=t.useCallback(()=>{var S;if(E||d)return;(S=I==null?void 0:I.current)==null||S.focus();let Y;y===""?Y=r:Y=Number(y)-i,L(T(Y))},[T,E,d,r,i,L,y]),ke=t.useCallback(S=>{if(S.nativeEvent.isComposing)return;const Y=S.key,_e={ArrowUp:F,ArrowRight:F,ArrowDown:_,ArrowLeft:_,Home:()=>L(r),End:()=>L(n)}[Y];_e&&(S.preventDefault(),_e(S))},[F,_,L,r,n]),Ct={name:o,type:"number",value:y,...$,onChange:R,onKeyDown:ke,size:m,css:{borderRadius:"0px",width:"$6","&:disabled":{opacity:.3,pointerEvents:"none"}},ref:I,readOnly:d,disabled:c,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":Number(y),role:"spinbutton"};return t.createElement(D,{css:f},t.createElement(To,{onClick:_,icon:v.Minus,css:{borderRight:"none",borderTopRightRadius:"0px",borderBottomRightRadius:"0px"},size:m,disabled:E||c,showTooltip:E&&!c,disabledTooltipContent:x.decrement,label:M.decrement}),t.createElement(we,{...Ct}),t.createElement(To,{onClick:F,icon:v.Plus,css:{borderLeft:"none",borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px"},size:m,disabled:C||c,showTooltip:C&&!c,disabledTooltipContent:x.increment,label:M.increment}))});da.displayName="NumberInput";const Ro=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c,trigger:d}=V.useFormContext(),{error:m}=ie(o),p=r?c(r):c;return t.createElement(te,{css:e,description:i,error:m,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(da,{id:o,name:o,ref:p,...m&&{state:"error","aria-invalid":!0},...s,onChange:d}))};Ro.displayName="NumberInputField";const ma=t.forwardRef(({css:e,hidePasswordText:a="Hide password",showPasswordText:o="Show password",size:r="md",...n},i)=>{const[s,c]=P.useState(!1),d=()=>c(m=>!m);return t.createElement(w,{css:{position:"relative",...e}},t.createElement(we,{...n,size:r,type:s?"text":"password",ref:i,css:{pr:"$sizes$2"}}),t.createElement(N,{appearance:"simple",theme:"neutral",css:{bottom:0,position:"absolute",right:0},label:s?a:o,onClick:d,onMouseDown:m=>m.preventDefault(),size:r},t.createElement(b,{is:s?v.Eye:v.EyeCrossed})))});ma.displayName="PasswordInput";const Fo=({css:e={},label:a="Password",name:o,prompt:r=void 0,description:n,validation:i,...s})=>{const{register:c}=V.useFormContext(),{error:d}=ie(o),m=i?c(i):c;return t.createElement(te,{css:{...e,position:"relative"},description:n,error:d,fieldId:o,label:a,prompt:r,required:Boolean(i==null?void 0:i.required)},t.createElement(ma,{autoComplete:"current-password",name:o,id:o,ref:m,...s}))};Fo.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"}),No=({value:e,max:a=100,theme:o="primary",...r})=>t.createElement(Gs,{value:e,max:a,theme:o,...r},t.createElement(js,{style:{width:"100%",transform:`translateX(-${100-(e||0)/a*100}%)`}}));No.displayName="ProgressBar";const Mo=({css:e,label:a,value:o,...r})=>t.createElement(gt,{css:e,label:a},t.createElement(ht,{value:o,...r}));Mo.displayName="RadioField";const Ys=l("fieldset",{all:"unset"}),ua=({children:e,css:a,direction:o="column",defaultValue:r,value:n,description:i,label:s,name:c,validation:d,onValueChange:m,...p})=>{const{control:g}=V.useFormContext(),{field:{ref:h,onChange:f,value:$,name:y}}=V.useController({name:c,control:g,rules:d,defaultValue:r}),{error:O}=ie(c);return t.useEffect(()=>{typeof n<"u"&&f(n)},[n]),t.createElement(Ys,{css:a},t.createElement(Oe,{as:"legend",css:{p:0,mb:"$3"},required:Boolean(d==null?void 0:d.required)},s),i&&t.createElement(jt,{css:{mb:"$3"}},i),t.createElement(Yt,{ref:h,direction:o,defaultValue:r,onValueChange:I=>{f(I),m==null||m(I)},value:$,...p},e),O&&t.createElement(mt,{css:{mt:"$2"}},O))};ua.Item=Mo,ua.displayName="RadioButtonField";const Us=l(Fe.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(Fe.Indicator,{backgroundColor:"white",borderRadius:"$round",position:"absolute",size:"6px"}),Ao=({children:e,isFullWidth:a=!1,size:o="md",align:r="left",...n})=>t.createElement(Us,{...n,align:r,isFullWidth:a,size:o},t.createElement(Xs,{align:r,containerIsFullWidth:a},t.createElement(Js,null)),t.createElement(w,null,e)),Ks=({css:e,children:a,size:o,isFullWidth:r,align:n,gap:i="3",justify:s,...c})=>t.createElement(Fe.Root,{...c},t.createElement(Pe,{direction:"row",justify:s,gap:i,css:e},t.Children.map(a,d=>t.isValidElement(d)&&(d==null?void 0:d.type)===Ao?t.cloneElement(d,{size:o,isFullWidth:r,align:n}):d))),Lo=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=V.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return t.createElement(te,{css:e,description:i,error:d,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(vt,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Lo.displayName="SearchField";const Po=({css:e=void 0,children:a,name:o,label:r,validation:n,prompt:i,description:s,hideLabel:c,...d})=>{const{register:m}=V.useFormContext(),{error:p}=ie(o),g=n?m(n):m;return t.createElement(te,{css:e,description:s,error:p,fieldId:o,label:r,prompt:i,required:Boolean(n==null?void 0:n.required),hideLabel:c},t.createElement(yt,{name:o,id:o,...d,ref:g,...p&&{state:"error"}},a))};Po.displayName="SelectField";const Wo=l(ae.Root,{width:"100%"});Wo.displayName="SidedrawerAccordionRoot";const Qs=k({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Zs=k({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,...a})=>u.default.createElement(ec,{...a},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,...a})=>u.default.createElement(ae.Header,null,u.default.createElement(oc,{...a},u.default.createElement(D,{css:{alignItems:"center"}},e),u.default.createElement(rc,{is:v.ChevronDown,size:"sm"}))),ic=({children:e})=>{let a=!1;return u.default.Children.forEach(e,o=>{var r;P.isValidElement(o)&&((r=o.props)==null?void 0:r.value)&&(a=!0)}),u.default.createElement(w,{css:{flexGrow:1,width:"100%",overflowY:"auto"}},a?u.default.createElement(Wo,{type:"single"},e):e)},lc=({appearance:e="simple",label:a="close",size:o="md",theme:r="neutral",...n})=>u.default.createElement(q.Close,{asChild:!0},u.default.createElement(N,{theme:r,appearance:e,size:o,label:a,...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:lt-1,"@allowMotion":{'&[data-state="open"]':{animation:`${At} 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:lt,"@allowMotion":{'&[data-state="open"]':{animation:`${Br} 250ms ease-out`},'&[data-state="closed"]':{animation:`${Or} 250ms ease-out`}}}),dc=({children:e,...a})=>u.default.createElement(q.Portal,null,u.default.createElement(sc,{"data-testid":"sidedrawer_overlay"}),u.default.createElement(cc,{role:"navigation",...a},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:a="throttle"}={})=>{const[o,r]=P.useState({x:0,y:0}),n=P.useMemo(()=>{if(a==="throttle")return Ie.throttle;if(a==="debounce")return Ie.debounce},[a]);return P.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,...a},o)=>u.default.createElement(N,{size:"md",appearance:"simple",theme:"neutral",ref:o,...a},u.default.createElement(b,{is:e}))),wt=({src:e,alt:a="Atom Learning logo",css:o})=>u.default.createElement(We,{className:"topbar-brand-logo",src:e,alt:a,css:{mr:"$3",mb:"5px",...o}});wt.toString=()=>".topbar-brand-logo";const hc=l(A,{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",[`& ${wt}`]:{'&[src$=".svg"]':{height:24,width:"auto"}}},lg:{height:"$7",[`& ${wt}`]:{'&[src$=".svg"]':{height:32,width:"auto"}}}}}}),bc=l(D,{alignItems:"center",height:"$4",mx:"$4",width:"100%","@md":{mx:"$5"}}),he=({size:e="md",...a})=>{const{y:o}=uc();return u.default.createElement($c,{hasScrolled:!!o,size:e},u.default.createElement(bc,{...a}))};he.Brand=gc,he.BrandLogo=wt,he.BrandName=hc,he.ActionIcon=pc,he.Divider=fc,he.displayName="TopBar";const vc=l("header",{"> div":{width:"100%"}}),yc=({children:e,...a})=>u.default.createElement(vc,{...a},u.default.createElement(he,{css:{mx:"$3"}},e)),xc=l("a",pa),wc=l("button",pa),Ec=({active:e,children:a,disabled:o,href:r,onClick:n,...i})=>r?u.default.createElement(xc,{active:e,href:r,onClick:n,...i},a):u.default.createElement(wc,{active:e,disabled:o,onClick:n,...i},a),Cc=l(q.Trigger,{}),Z=({children:e,...a})=>u.default.createElement(zr.Root,{...a},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%"}),Bo=(e,a,o)=>(e-a)/(o-a)*100,kc=(e,a,o)=>{const r=Bo(e,a,o);return r<=10?0:r>=90?100:50},Dc=({min:e,max:a,steps:o=[]})=>o.length===0?null:t.createElement(Sc,null,o.map(r=>t.createElement(A,{as:"span",key:r.value,css:{position:"absolute",color:"$tonal300"},style:{left:`${Bo(r.value,e,a)}%`,transform:`translateX(-${kc(r.value,e,a)}%)`}},r.label))),zc=({value:e=[],outputLabel:a=o=>`Current value is ${o}`})=>t.createElement(A,{css:{mt:"$4",color:"$tonal300",width:"100%"}},a(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=t.forwardRef(({value:e,defaultValue:a,min:o=0,max:r=100,theme:n="tonal",css:i,children:s,...c},d)=>{const m=e||a;return t.createElement(Ne,{css:i},t.createElement(Ic,{theme:n,defaultValue:a,value:e,min:o,max:r,ref:d,...c},t.createElement(ha,null,t.createElement(Tc,null)),(m==null?void 0:m.length)&&m.map((p,g)=>t.createElement(Rc,{key:`thumb${g}`}))),s)});Ce.Value=zc,Ce.Steps=Dc,Ce.displayName="Slider";const Oo=({css:e,label:a,name:o,defaultValue:r,value:n,validation:i,outputLabel:s,min:c=0,max:d=100,steps:m=[],...p})=>{const{control:g}=V.useFormContext(),{field:{ref:h,onChange:f,value:$,name:y}}=V.useController({name:o,control:g,rules:i,defaultValue:r});return u.default.useEffect(()=>{n!=null&&n.length&&f(n)},[JSON.stringify(n)]),u.default.createElement(te,{css:e,fieldId:o,label:a},u.default.createElement(Ce,{ref:h,name:y,onValueChange:f,value:$,min:c,max:d,...p},u.default.createElement(Ce.Steps,{min:c,max:d,steps:m}),u.default.createElement(Ce.Value,{value:$,outputLabel:s})))};Oo.displayName="SliderField";const Ho=t.createContext({steps:[],goToPreviousStep:()=>null,goToNextStep:()=>null,goToStep:()=>null,activeStep:0,viewedSteps:[],allowSkip:!1,direction:"horizontal",hideLabels:!1,completedSteps:[],showCompletedIcons:!1}),Fc=({children:e,stepCount:a,allowSkip:o,onComplete:r,onStepChange:n,direction:i,steps:s,hideLabels:c,showCompletedIcons:d})=>{const[m,p]=t.useState(0),[g,h]=t.useState([0]),[f,$]=t.useState([]),y=!a;t.useEffect(()=>{h(x=>x.includes(m)?x:[...x,m]),n==null||n(m)},[m,n]);const O=()=>{const x=r&&m===a-1,C=m<a-1;if((r||C)&&$(E=>E.includes(m)?E:[...E,m]),x)return r==null?void 0:r();if(C)return p(E=>E+1)},I=()=>{p(x=>x-1)},M=x=>{p(x)};return t.createElement(Ho.Provider,{value:{steps:s||Array(a).fill(""),goToPreviousStep:y?void 0:I,goToNextStep:y?void 0:O,goToStep:y?void 0:M,activeStep:m,viewedSteps:g,completedSteps:f,allowSkip:o,direction:i,hideLabels:c,showCompletedIcons:d}},e)},ga=()=>{const e=t.useContext(Ho);if(!e)throw new Error("Ensure that you wrap any components with the root component Stepper");return e},Nc=({label:e,children:a,...o})=>{const{activeStep:r,goToPreviousStep:n}=ga();return t.createElement(ne,{size:"sm",appearance:"outline",...o,disabled:r===0,onClick:n},a||(e==null?void 0:e(r)))},Mc=({label:e,children:a,onClick:o,...r})=>{const{goToNextStep:n,activeStep:i}=ga();return t.createElement(ne,{size:"sm",...r,onClick:()=>{if(o)return o(n);n==null||n()},css:{ml:"auto"}},a||(e==null?void 0:e(i)))},Ac=l(D,{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(D,{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(A,{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(D,{justifyContent:"space-between",variants:{direction:{vertical:{flexDirection:"column"},horizontal:{flexDirection:"row"}}}}),Bc=({css:e})=>{const{steps:a,goToStep:o,activeStep:r,viewedSteps:n,allowSkip:i,direction:s,hideLabels:c,completedSteps:d,showCompletedIcons:m}=ga(),p=h=>{const f=a[h];return f.status?f.status:d.length===a.length?B.SUCCESS:r===h&&d.includes(r)?B.REVIEWED:r===h?B.ACTIVE:d.includes(h)?B.COMPLETED:n.includes(h)?B.VIEWED:B.DEFAULT},g=h=>{var f;const $=(f=a[h])==null?void 0:f.status;return d.length===a.length||$===B.SUCCESS?B.SUCCESS:$===B.COMPLETED||h<Math.max(...n)?B.ACTIVE:$===B.VIEWED?B.VIEWED:B.DEFAULT};return t.createElement(Wc,{css:e,direction:s},a.map((h,f)=>{const $=p(f),y=g(f);return t.createElement(Lc,{tabIndex:0,key:`step_${f}`,direction:s,separator:y,status:$,css:s==="horizontal"?{width:`calc(100% / ${a.length})`}:{height:`calc(100% / ${a.length})`},canInteract:i},t.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":h.label?"":`step ${f+1}`,"aria-labelledby":h.label?`step-${f}`:void 0,css:{cursor:i&&n.includes(f)?"pointer":"auto"}},h.status===B.SUCCESS||m&&$===B.COMPLETED?t.createElement(b,{is:v.Ok}):f+1),h.label&&!c&&t.createElement(Pc,{as:"span",id:`step-${f}`,direction:s,status:$},h.label))}))},Ze=({children:e,stepCount:a,allowSkip:o,onComplete:r,onStepChange:n,direction:i="horizontal",steps:s,hideLabels:c=!1,showCompletedIcons:d=!1,css:m})=>{Re.default(!(a&&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)||a||0;return t.createElement(Fc,{stepCount:p,allowSkip:o,onComplete:r,onStepChange:a?n:void 0,direction:i,steps:s||Array(p).fill(""),hideLabels:c,showCompletedIcons:d},t.createElement(w,{"aria-label":"progress",css:{width:"100%",...m}},e))};Ze.StepBack=Nc,Ze.StepForward=Mc,Ze.Steps=Bc,Ze.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))"}}),Vo=e=>t.createElement(Oc,{...e},t.createElement(Hc,null));Vo.displayName="Switch";const Vc=e=>{try{return new ResizeObserver(e)}catch{return null}},_c=({delay:e=500,elements:a,onResize:o})=>{const r=t.useMemo(()=>Vc(Ie.debounce(e,o)),[e,o]);return t.useEffect(()=>(a.forEach(n=>{n&&(r==null||r.observe(n))}),()=>{a.forEach(n=>n&&(r==null?void 0:r.unobserve(n)))}),[r,a]),r},qc=({element:e,delay:a=500})=>{const[o,r]=P.useState({width:void 0,height:void 0}),n=P.useCallback(()=>{r({width:e==null?void 0:e.clientWidth,height:e==null?void 0:e.clientHeight})},[e]),i=P.useMemo(()=>[e],[e]);return _c({delay:a,elements:i,onResize:n}),o},Gc=({element:e,delay:a=500,delayMethod:o="throttle"})=>{const[r,n]=P.useState({left:0,top:0}),i=P.useMemo(()=>{if(o==="throttle")return Ie.throttle;if(o==="debounce")return Ie.debounce},[o]);return P.useEffect(()=>{if(!e)return;const s=i(a,()=>{n({left:e.scrollLeft,top:e.scrollTop})});return e.addEventListener("scroll",s),()=>{e.removeEventListener("scroll",s)}},[e,i,a]),r},jc=l(it,{position:"relative",borderBottom:"1px solid $base3",width:"100%"}),Yc=l(at.List,{flexShrink:0,display:"flex",width:"100%",overflowX:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}),_o=l(N,{height:"100% !important",position:"absolute",top:"50%",transform:"translateY(-50%)",cursor:"pointer",background:"$background !important",color:"$interactive1 !important",borderRadius:0,opacity:.9}),qo=.8,Go=({children:e,colorScheme:a={},...o})=>{const[r,n]=zl(),{width:i}=qc({element:r,delay:500}),{left:s}=Gc({element:r,delay:100,delayMethod:"debounce"}),c=u.default.useMemo(()=>r?r.scrollWidth>r.clientWidth:!1,[i,r]),d=u.default.useMemo(()=>c?s>0:!1,[s,c]),m=u.default.useMemo(()=>!r||!c?!1:r.scrollWidth-s-r.clientWidth>1,[r,s,c]),p=u.default.useCallback(g=>{!r||r.scroll({left:r.scrollLeft+r.clientWidth*g,behavior:"smooth"})},[r]);return u.default.createElement(jc,{base:"slate",accent:"blue",interactive:"hiContrast1",...a,...o},d&&u.default.createElement(_o,{label:"scroll left",size:"md",css:{left:0},onClick:()=>p(-qo)},u.default.createElement(b,{is:v.ChevronLeft})),u.default.createElement(Yc,{ref:n},e),m&&u.default.createElement(_o,{label:"scroll right",size:"md",css:{right:0},onClick:()=>p(qo)},u.default.createElement(b,{is:v.ChevronRight})))};Go.displayName="TabsTriggerList";const Uc=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,...a})=>t.createElement(Uc,{asChild:!0,...a},t.createElement(A,{size:"sm",as:"button"},e));jo.displayName="TabsTrigger";const Xc=l(at.Content,{flexGrow:1,fontFamily:"$body"}),Yo=Xc;Yo.displayName="TabsContent";const Jc=l(at.Root,{width:"100%"}),et=({children:e,...a})=>t.createElement(Jc,{...a},e);et.TriggerList=Go,et.Trigger=jo,et.Content=Yo,et.displayName="Tabs";const Kc=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=t.forwardRef((e,a)=>t.createElement(Kc,{...e,ref:a}));fa.displayName="Textarea";const Uo=({css:e=void 0,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=V.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return t.createElement(te,{css:e,description:i,error:d,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(fa,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Uo.displayName="TextareaField";const Xo=400,Qc=k({"0%":{transform:"translate3d(0,-100%,0)",opacity:0},"100%":{transform:"translate3d(0,0,0)",opacity:1}}),Zc=k({"0%":{transform:"translate3d(0,0,0)",opacity:1},"100%":{transform:"translate3d(0,-100%,0)",opacity:0}}),ed=l("div",{position:"absolute",width:"100%",variants:{visible:{true:{"@allowMotion":{animation:`${Qc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}},false:{opacity:0,"@allowMotion":{animation:`${Zc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}}}}}),td=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"}}}}),ad=t.memo(({ariaLive:e,height:a,id:o,message:r,role:n,type:i="blank",visible:s,calculateOffset:c,updateHeight:d})=>{const m=c(o,{reverseOrder:!0,margin:8});return t.createElement(ed,{visible:s},t.createElement(td,{ref:p=>{p&&a===void 0&&d(o,p.getBoundingClientRect().height)},status:i,role:n,"aria-live":e,style:{transform:`translateY(${m}px)`}},i==="error"&&t.createElement(b,{size:"sm",css:{mr:"$3",flex:"0 0 auto"},is:v.Error}),t.createElement(A,null,r),i==="loading"?t.createElement(st,{css:{flex:"0 0 auto",ml:"auto"}}):t.createElement(N,{css:{position:"absolute",top:"$2",right:"$2",color:"white","&:hover,&:focus":{color:"white",opacity:.5}},label:"Close alert",onClick:()=>kt.toast.dismiss(o)},t.createElement(b,{is:v.Close}))))}),od=l("div",{left:"$2",position:"fixed",top:"$2",right:"$2",zIndex:lt,"@sm":{top:"$3",right:"auto",left:`calc(50% - ${Xo/2}px)`}}),Jo=({children:e})=>{const{toasts:a,handlers:o}=kt.useToaster(),{startPause:r,endPause:n,calculateOffset:i,updateHeight:s}=o;return t.createElement(t.Fragment,null,t.createElement(od,{onMouseEnter:r,onMouseLeave:n},a.map(c=>t.createElement(ad,{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"}}),rd=Se,Et={sm:"32px",md:"40px",lg:"48px"},nd={sm:"$4",md:"$5",lg:"$5"},id={sm:"$2",md:"$3",lg:"$3"},$a=e=>({fontSize:`$${e}`,px:nd[e],minHeight:Et[e],"& > *:not(:last-child)":{mr:id[e]}}),ld=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:Et.sm,p:0}},{isIconOnly:!0,size:"md",css:{minWidth:Et.md,p:0}},{isIconOnly:!0,size:"lg",css:{minWidth:Et.lg,p:0}}]}),sd=t.forwardRef(({size:e="md",children:a,...o},r)=>{var n;const i=t.Children.toArray(a),s=i.length<=1,c=s&&t.isValidElement(i[0])&&((n=i[0])==null?void 0:n.type)===b;return t.createElement(ld,{ref:r,size:e,isIconOnly:c,...o},i.map(d=>!s&&(typeof d=="string"||typeof d=="number")?t.createElement("span",{key:d},d):t.isValidElement(d)&&(d==null?void 0:d.type)===b?t.cloneElement(d,{...d.props,size:e}):d))}),cd=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"}}}}]}),dd=e=>e==="horizontal"?"row":"column",md=t.forwardRef(({orientation:e="horizontal",gap:a=!1,isFullWidth:o,children:r,wrap:n="no-wrap",...i},s)=>{const c=typeof a=="number",d=dd(e);return t.createElement(cd,{ref:s,direction:d,hasGap:c,isFullWidth:o,orientation:e,...i},t.createElement(Pe,{direction:d,gap:c&&a,align:!1,wrap:n},r))}),ud={Item:rd,Button:sd,Root:md},pd=l(Nr.default,{}),Ko=t.forwardRef(({id:e,ratio:a=9/16,css:o,...r},n)=>t.createElement(Ne,{css:o},t.createElement(w,{css:{borderRadius:"$0",position:"relative",paddingTop:`${a*100}%`,overflow:"hidden",height:0,width:"100%"}},t.createElement(pd,{...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=je,exports.ActionIcon=N,exports.AlertDialog=j,exports.AlertProvider=Un,exports.Avatar=Be,exports.Badge=Wa,exports.Box=w,exports.Button=ne,exports.Carousel=ve,exports.Checkbox=dt,exports.CheckboxField=Ya,exports.Chip=de,exports.ChipDismissibleGroup=Jt,exports.ChipGroup=Ut,exports.ChipToggleGroup=Kt,exports.ColorScheme=it,exports.Combobox=xe,exports.DataTable=W,exports.DateField=po,exports.DateInput=aa,exports.Dialog=ue,exports.Dismissible=ft,exports.DismissibleGroup=ye,exports.Divider=Gt,exports.DropdownMenu=Ee,exports.EmptyState=Qe,exports.FieldWrapper=te,exports.FileInput=yo,exports.Flex=D,exports.Form=ja,exports.Grid=xo,exports.Heading=ct,exports.Icon=b,exports.Image=We,exports.InlineFieldWrapper=gt,exports.InlineMessage=mt,exports.Input=we,exports.InputField=wo,exports.Label=Oe,exports.Link=pt,exports.List=ut,exports.Loader=st,exports.MarkdownContent=Eo,exports.NavigationMenu=pe,exports.NotificationBadge=Vs,exports.NumberInput=da,exports.NumberInputField=Ro,exports.PasswordField=Fo,exports.PasswordInput=ma,exports.Popover=le,exports.ProgressBar=No,exports.RadioButton=ht,exports.RadioButtonField=ua,exports.RadioButtonGroup=Yt,exports.RadioCard=Ao,exports.RadioCardGroup=Ks,exports.SearchField=Lo,exports.SearchInput=vt,exports.Select=yt,exports.SelectField=Po,exports.Sidedrawer=Z,exports.Slider=Ce,exports.SliderField=Oo,exports.Stack=Pe,exports.StackContent=na,exports.Stepper=Ze,exports.StyledButton=Ra,exports.StyledLink=_a,exports.Switch=Vo,exports.Table=z,exports.Tabs=et,exports.Text=A,exports.Textarea=fa,exports.TextareaField=Uo,exports.ToastProvider=Jo,exports.ToggleGroup=ud,exports.Tooltip=X,exports.TopBar=he,exports.Video=Ko,exports.createTheme=Pr,exports.createThemeVariants=Tt,exports.css=Ar,exports.focusVisibleStyleBlock=be,exports.getCssText=Lr,exports.globalCss=Ca,exports.keyframes=k,exports.media=It,exports.styled=l,exports.theme=G,exports.useAlert=Xn,exports.useCarousel=hi,exports.useDataTable=K,exports.utils=zt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ae=require("@radix-ui/react-accordion"),P=require("react"),tr=require("@atom-learning/theme"),ya=require("@stitches/react"),v=require("@atom-learning/icons"),St=require("@radix-ui/react-slot"),H=require("color2k"),ar=require("invariant"),De=require("@radix-ui/react-tooltip"),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"),V=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"),ze=require("@reach/combobox"),se=require("@tanstack/react-table"),dr=require("use-deep-compare-effect"),Ie=require("throttle-debounce"),fe=require("@dnd-kit/core"),mr=require("@dnd-kit/modifiers"),qe=require("@dnd-kit/sortable"),ur=require("@dnd-kit/utilities"),pr=require("dayzed"),$e=require("@radix-ui/react-popover"),hr=require("dayjs"),gr=require("dayjs/plugin/customParseFormat"),q=require("@radix-ui/react-dialog"),Te=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"),kt=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 a=Object.create(null);return e&&Object.keys(e).forEach(function(o){if(o!=="default"){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(a,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}}),a.default=e,Object.freeze(a)}var t=ee(P),u=U(P),Er=ee(tr),Re=U(ar),Dt=ee(or),xa=ee(nr),Fe=ee(ir),Cr=U(lr),Sr=U(sr),ot=ee(cr),kr=U(dr),Ge=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(kt),Nr=U(wr);const zt={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})},It={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:zt,media:It}),{css:Ar,getCssText:Lr,createTheme:Pr,globalCss:Ca,keyframes:k,styled:l,theme:G}=Mr,Tt=(e,a)=>Object.keys(G[e]).reduce((o,r)=>({...o,[r]:JSON.parse(JSON.stringify(a).replace(/\$key/g,`$${e}$${r}`))}),{}),w=l("div",{});w.displayName="Box";const Ne=({css:e,children:a})=>e?t.createElement(w,{css:e},a):t.createElement(t.Fragment,null,a);Ne.displayName="CSSWrapper";const Q=(e,a)=>({"&::before":{content:"''",mb:`-${e}em`,display:"table"},"&::after":{content:"''",mt:`-${a||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,a)=>`url(data:image/svg+xml;charset=US-ASCII,${encodeURIComponent(Wr[a](H.toHex(e)))})`,be=({position:e="relative",zIndex:a=1}={})=>({outline:"none",position:["relative","absolute","fixed","sticky"].includes(e)?e:"relative",zIndex:a>1?a:1,boxShadow:"white 0px 0px 0px 2px, $colors$primary 0px 0px 0px 4px"}),Rt=k({"0%":{opacity:0,transform:"translateY(2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Ft=k({"0%":{opacity:0,transform:"translateX(-2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Nt=k({"0%":{opacity:0,transform:"translateY(-2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Mt=k({"0%":{opacity:0,transform:"translateX(2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),At=k({"0%":{opacity:0},"100%":{opacity:1}}),rt=k({"0%":{opacity:1},"100%":{opacity:0}}),Br=k({"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(0)"}}),Or=k({"0%":{transform:"translateX(0)"},"100%":{transform:"translateX(-100%)"}}),Hr=k({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Vr=k({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),_r=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`}}}),qr=({children:e,css:a,...o})=>u.default.createElement(_r,{...o},u.default.createElement(Ne,{css:a},e)),Gr=l(ae.Item,{width:"100%","&:not(:last-child)":{mb:"$1"}}),jr=({children:e,value:a,...o})=>u.default.createElement(Gr,{value:a,...o},e);var Yr="#F3F8FF",Ur="#E5F1FF",Xr="#D6EAFF",Jr="#C2DEFF",Kr="#B3D4FA",Qr="#057AFF",Zr="#0F67F5",en="#194DCC",tn="#102DA3",an="#15235E",ka={blue1:Yr,blue2:Ur,blue3:Xr,blue4:Jr,blue5:Kr,blue6:Qr,blue7:Zr,blue8:en,blue9:tn,blue10:an};const on=[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)),Da=(e,a)=>{const o={};return Object.entries(a).forEach(([r,n],i)=>{const[s,c,d]=H.parseToRgba(n),[m,p,g]=on,h=[Lt((s-m)/nt[i]+m),Lt((c-p)/nt[i]+p),Lt((d-g)/nt[i]+g),nt[i]];o[`${e}A${i+1}`]=`rgba(${h.join(",")})`}),o};var rn="#F6F6F6",nn="#EBEBEB",ln="#E0E0E0",sn="#CECECE",cn="#C2C2C2",dn="#757575",mn="#545454",un="#333333",pn="#1F1F1F",hn="#1C1C1C",Pt={slate1:rn,slate2:nn,slate3:ln,slate4:sn,slate5:cn,slate6:dn,slate7:mn,slate8:un,slate9:pn,slate10:hn};const re={},za=(e,a)=>{const o={};for(let r=1;r<=10;r++)o[`${e}${r}`]=`$${a}${r}`,o[`${e}A${r}`]=`$${a}A${r}`;return o},{styled:gn,createTheme:Me}=ya.createStitches({theme:{colors:{background:"white",foreground:Pt.slate9,foreground6plus:"white",...ka,...Da("blue",ka),...Pt,...Da("slate",Pt)}},utils:zt,media:It});re["interactive-loContrast1"]=Me("interactive-loContrast1",{colors:{interactiveForeground:"$foreground",interactive1:"white",interactive2:"$accent1",interactive3:"$accent2"}}),re["interactive-loContrast2"]=Me("interactive-loContrast2",{colors:{interactiveForeground:"$foreground",interactive1:"$accent1",interactive2:"$accent2",interactive3:"$accent3"}}),re["interactive-hiContrast1"]=Me("interactive-hiContrast1",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent7",interactive2:"$accent8",interactive3:"$accent9"}}),re["interactive-hiContrast2"]=Me("interactive-hiContrast2",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent8",interactive2:"$accent9",interactive3:"$accent10"}});const fn={slate:"slate"},$n=()=>{Object.entries(fn).forEach(([e,a])=>{const o=`base-${e}`;re[o]=Me(o,{colors:za("base",a)})})},bn={slate:"slate",blue:"blue"},vn=()=>{Object.entries(bn).forEach(([e,a])=>{const o=`accent-${e}`;re[o]=Me(o,{colors:za("accent",a)})})};$n(),vn();const yn=gn("div"),it=t.forwardRef(({base:e="",accent:a="",interactive:o="",className:r,asChild:n=!1,...i},s)=>{const c=[r,re[`interactive-${o}`],re[`accent-${a}`],re[`base-${e}`]].filter(Boolean).join(" ");return t.createElement(n?St.Slot:yn,{ref:s,className:c,...i})});it.displayName="ColorScheme";const Ia=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=t.forwardRef(({is:e,size:a="md",...o},r)=>t.createElement(Ia,{size:a,"aria-hidden":"true",...o,as:e,ref:r})),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:a={},...o})=>u.default.createElement(it,{asChild:!0,accent:"slate",interactive:"loContrast1",...a},u.default.createElement(wn,{...o},e,u.default.createElement(xn,{is:v.ChevronDown}))),Cn=l(ae.Root,{width:"100%"}),je=u.default.forwardRef(({type:e="single",children:a,...o},r)=>u.default.createElement(Cn,{ref:r,type:e,...o},a));je.Item=jr,je.Content=qr,je.Trigger=En,je.displayName="Accordion";const lt=2147483647,Ye=1147483646,Sn=10,kn=10,Dn=10,zn=l(De.Content,{backgroundColor:"$tonal500",borderRadius:"$0",boxShadow:"$0",color:"white",fontFamily:"$body",fontSize:"$sm",lineHeight:1.5,whiteSpace:"normal",px:"$3",py:"$2",zIndex:kn,"@allowMotion":{animationDuration:"75ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="delayed-open"]':{'&[data-side="top"]':{animationName:Nt},'&[data-side="right"]':{animationName:Mt},'&[data-side="bottom"]':{animationName:Rt},'&[data-side="left"]':{animationName:Ft}}},variants:{size:{sm:{maxWidth:"100px"},md:{maxWidth:"250px"},lg:{maxWidth:"400px"}}}}),In=l(De.Arrow,{fill:"$tonal500",'[data-align="end"] &':{mr:"$2"},'[data-align="start"] &':{ml:"$2"}}),Tn=({children:e,side:a="top",sideOffset:o=4,size:r="md",...n})=>t.createElement(zn,{side:a,sideOffset:o,size:r,...n},e,t.createElement(In,null)),X=({children:e,delayDuration:a=350,...o})=>t.createElement(De.Root,{delayDuration:a,...o},e);X.Content=Tn,X.Trigger=l(De.Trigger,{}),X.Portal=De.Portal,X.Provider=De.Provider,X.displayName="Tooltip";const Rn={xs:"sm",sm:"sm",md:"md",lg:"lg"},Ae=(e,a,o)=>({bg:"transparent",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:a},"&:not(:disabled):active":{color:o},"&[disabled]":{color:"$tonal400",cursor:"not-allowed"}}),Ue=(e,a,o)=>({bg:e,color:"white","&:not(:disabled):hover, &:not(:disabled):focus":{bg:a,color:"white"},"&:not(:disabled):active":{bg:o},"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"}}),Xe=(e,a,o)=>({border:"1px solid",borderColor:"currentColor",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:a},"&:not(:disabled):active":{color:o},"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"}}),Fn=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:Ae("$tonal300","$primaryMid","$primaryDark")},{theme:"primary",appearance:"simple",css:Ae("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"simple",css:Ae("$primaryDark",H.darken(G.colors.primaryDark.value,.1),H.darken(G.colors.primaryDark.value,.15))},{theme:"success",appearance:"simple",css:Ae("$success","$successMid","$successDark")},{theme:"warning",appearance:"simple",css:Ae("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"simple",css:Ae("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"solid",css:Ue("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"solid",css:Ue("$primaryDark",H.darken(G.colors.primaryDark.value,.1),H.darken(G.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:Ue("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:Ue("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"solid",css:Ue("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"outline",css:Xe("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"outline",css:Xe("$primaryDark",H.darken(G.colors.primaryDark.value,.1),H.darken(G.colors.primaryDark.value,.15))},{theme:"success",appearance:"outline",css:Xe("$success","$successMid","$successDark")},{theme:"warning",appearance:"outline",css:Xe("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"outline",css:Xe("$danger","$dangerMid","$dangerDark")}]}),Nn=({hasTooltip:e,label:a,tooltipSide:o,children:r})=>e?t.createElement(X,null,t.createElement(X.Trigger,{asChild:!0},r),t.createElement(X.Content,{side:o},a)):t.createElement(t.Fragment,null,r),N=t.forwardRef(({children:e,theme:a="primary",appearance:o="simple",size:r="sm",label:n,href:i,disabled:s,hasTooltip:c=!0,tooltipSide:d,...m},p)=>{const g=`A single ${b.displayName} component is permitted as a child of ${N.displayName}`;return Re.default(t.Children.count(e)===1,g),t.createElement(Nn,{hasTooltip:c,label:n,tooltipSide:d},t.createElement(Fn,{...m,...i?{as:"a",href:s?null:i,onClick:void 0,"aria-disabled":!!s}:{type:"button"},"aria-label":n,theme:a,appearance:o,size:r,ref:p,disabled:s},t.Children.map(e,h=>{if(!t.isValidElement(h))throw new Error(g);return Re.default(h.type===b,`Children of type ${h==null?void 0:h.type} aren't permitted. Only an ${b.displayName} component is allowed in ${N.displayName}`),t.cloneElement(h,{size:Rn[r],css:{...h.props.css?h.props.css:{}}})})))});N.displayName="ActionIcon";const Wt="translate3d(-50%, -50%, 0)",Ta="translate3d(-50%, 50vh, 0)",Mn=k({"0%":{transform:Ta},"100%":{transform:Wt}}),An=k({"0%":{transform:Wt},"100%":{transform:Ta}}),Ln=l(oe.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",zIndex:Ye,"@allowMotion":{'&[data-state="open"]':{animation:`${At} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),Pn=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:Ye,"@allowMotion":{'&[data-state="open"]':{animation:`${Mn} 550ms cubic-bezier(0.22, 1, 0.36, 1)`},'&[data-state="closed"]':{animation:`${An} 550ms cubic-bezier(0.22, 1, 0.36, 1)`}},variants:{size:{sm:{width:"380px"},md:{width:"480px"},lg:{width:"600px"}}}}),Wn=({size:e="sm",...a})=>t.createElement(oe.Portal,null,t.createElement(Ln,null),t.createElement(Pn,{size:e,...a})),Bn=l(oe.Root,{}),j=e=>t.createElement(Bn,{...e});j.Description=oe.Description,j.Title=oe.Title,j.Action=oe.Action,j.Cancel=oe.Cancel,j.Content=Wn,j.Trigger=oe.Trigger,j.displayName="AlertDialog";const On=()=>{const e=P.useRef();return P.useEffect(()=>(e.current=!0,()=>{e.current=!1})),e},D=l("div",{display:"flex"});D.displayName="Flex";const Hn=k({"0%":{opacity:0},"30%":{opacity:1},"50%":{opacity:1},"80%":{opacity:0},"100%":{opacity:0}}),Bt=l("div",{animationName:`${Hn}`,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"}}}}),st=({css:e={},message:a="Loading",size:o="md",...r})=>t.createElement(D,{css:{justifyContent:"center",...e},role:"alert",...r},t.createElement(Dt.Root,null,a),t.createElement(Bt,{size:o}),t.createElement(Bt,{size:o}),t.createElement(Bt,{size:o})),Ot=(e,a,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:a},"&:not([disabled]):active":{color:o}}),Le=(e,a,o,r="white")=>({bg:e,color:r,"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{bg:a,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:Le("$primary","$primaryMid","$primaryDark")},{theme:"secondary",appearance:"solid",css:Le("$primaryDark",H.darken(G.colors.primaryDark.value,.1),H.darken(G.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:Le("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:Le("$warning","$warningMid","$warningDark","$tonal500")},{theme:"danger",appearance:"solid",css:Le("$danger","$dangerMid","$dangerDark")},{theme:"neutral",appearance:"solid",css:Le("white",H.opacify("white",-.1),H.opacify("white",-.25),"$primary")},{theme:"primary",appearance:"outline",css:Ot("$primary","$primaryMid","$primaryDark")},{theme:"neutral",appearance:"outline",css:Ot("white",H.opacify("white",-.2),H.opacify("white",-.35))},{theme:"secondary",appearance:"outline",css:Ot("$primaryDark",H.darken(G.colors.primaryDark.value,.1),H.darken(G.colors.primaryDark.value,.15))}]}),Vn=({isLoading:e,children:a})=>t.createElement(t.Fragment,null,t.createElement(st,{css:{opacity:e?1:0,position:"absolute",transition:"opacity 150ms"}}),t.createElement(w,{as:"span",css:e?{opacity:0,transition:"opacity 150ms"}:{}},a)),_n=e=>{switch(e){case"lg":return 22;case"md":return 20;case"sm":default:return 16}},Fa=(e,a)=>t.Children.map(e,(o,r)=>(o==null?void 0:o.type)===b?t.cloneElement(o,{css:{[r===0?"mr":"ml"]:a==="sm"?"$2":"$3",size:_n(a),...o.props.css?o.props.css:{}}}):o),ne=t.forwardRef(({children:e,isLoading:a,onClick:o,href:r,appearance:n="solid",size:i="md",theme:s="primary",type:c="button",...d},m)=>t.createElement(Ra,{isLoading:a||!1,onClick:a?void 0:o,appearance:n,size:i,theme:s,...d,...r?{as:"a",href:r,onClick:void 0}:{},...r?{}:{type:c},ref:m},typeof a=="boolean"?t.createElement(Vn,{isLoading:a},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 !important"}}}}}),ct=t.forwardRef(({size:e="md",...a},o)=>t.createElement(Ht,{ref:o,size:e,...a}));ct.displayName="Heading";const qn=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:{...Tt("space",{mt:"-$key",ml:"-$key","& > *":{mt:"$key",ml:"$key"}}),false:{}}}}),Pe=t.forwardRef(({css:e,gap:a=2,direction:o="row",wrap:r="wrap",justify:n="start",align:i,...s},c)=>t.createElement(Ne,{css:e},t.createElement(qn,{ref:c,direction:o,gap:a,wrap:r,justify:n,align:typeof i>"u"&&o!=="column"?"center":i,...s})));Pe.displayName="Stack";const Je={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 !important"}}}},Ke=({size:e,noCapsize:a})=>({...Je.size[e],...Je.noCapsize[`${a}`]}),Vt=l("p",{fontFamily:"$body",fontWeight:400,margin:0,"& > &":{"&:before, &:after":{display:"none"}},variants:Je}),A=t.forwardRef(({size:e="md",...a},o)=>t.createElement(Vt,{size:e,...a,ref:o}));A.displayName="Text";const Gn=({title:e,description:a,onAction:o,cancelActionText:r,confirmActionText:n,onClose:i,...s})=>t.createElement(j,{defaultOpen:!0},t.createElement(j.Content,{onEscapeKeyDown:c=>c.preventDefault(),onCloseAutoFocus:i,...s},t.createElement(ct,{as:j.Title,size:"sm",css:{mb:"$5"}},e),a&&t.createElement(A,{as:j.Description,css:{mb:"$5"}},a),t.createElement(Pe,{gap:"2",justify:"end"},r&&t.createElement(ne,{appearance:"outline",as:j.Cancel,onClick:()=>o(!1),size:"sm"},r),t.createElement(ne,{as:j.Action,onClick:()=>o(!0),size:"sm"},n)))),jn=[],Yn=(e,a)=>{switch(a.type){case"ADD":return[...e,{...a.payload,id:rr.uid()}];case"REMOVE":return e.filter(({id:o})=>o!==a.payload);default:return e}},Na=t.createContext({showAlert:()=>null}),Un=({children:e})=>{const[a,o]=t.useReducer(Yn,jn),r=On();return t.createElement(Na.Provider,{value:{showAlert:n=>o({payload:n,type:"ADD"})}},Boolean(a.length)&&t.createElement(Gn,{...a[0],key:a[0].id,onClose:()=>{r.current&&o({payload:a[0].id,type:"REMOVE"})}}),e)},Xn=()=>{const e=t.useContext(Na);if(e===void 0)throw new Error("useAlert must be used within a AlertProvider");return e},_t=(e,a)=>{let o;switch(typeof e){case"object":o={},Object.keys(e).forEach(r=>{const n=e[r];o[r]=n&&a(n)});break;default:o=a(e)}return o},Jn={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg",xxl:"lg"},Kn=({is:e})=>{const a=t.useContext(qt),{size:o}=a,r=t.useMemo(()=>_t(o,n=>Jn[n]),[o]);return t.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"}}}}}),We=Ma;We.displayName="Image";const Aa=()=>t.createElement(w,{css:{position:"relative",size:"100%"}},t.createElement(b,{is:v.User,css:{size:"100%"}})),Qn={xs:"xs",sm:"sm",md:"sm",lg:"md",xl:"md",xxl:"lg"},La=()=>{const e=t.useContext(qt),{name:a,size:o}=e,r=t.useMemo(()=>_t(o,n=>Qn[n]),[o]);return a?t.createElement(A,{size:r,css:{color:"$tonal400"}},a[0].toUpperCase()):t.createElement(Aa,null)},Zn=l(We,{size:"100%",objectFit:"cover"}),ei=({src:e,alt:a})=>e?t.createElement(Zn,{src:e,alt:a}):t.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"}}}},ti=l("div",Pa),ai=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=t.createContext({name:void 0,size:"lg"}),oi=({children:e,name:a,size:o})=>{const r=t.useMemo(()=>({name:a,size:o}),[a,o]);return t.createElement(qt.Provider,{value:r},e)},ri=({children:e,size:a="lg",name:o,disabled:r=!1,onClick:n})=>t.createElement(oi,{name:o,size:a},n?t.createElement(ai,{size:a,disabled:r,onClick:r?void 0:n,css:{cursor:r?"auto":"pointer"}},e):t.createElement(ti,{size:a},e)),Be=ri;Be.Image=ei,Be.Initial=La,Be.Placeholder=Aa,Be.Icon=Kn,Be.displayName="Avatar";const ni=l(D,{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:a="sm",children:o,...r})=>t.createElement(ni,{role:"status",theme:e,size:a,...r},t.Children.map(o,n=>{if(typeof n=="string"||typeof n=="number")return t.createElement(w,{css:{whiteSpace:"nowrap",overflowX:"hidden",textOverflow:"ellipsis",py:"$0"}},n);if(t.isValidElement(n)&&n.type===b)return t.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"}},ii=l(ge.ButtonBack,Ba),li=l(ge.ButtonNext,Ba),si=e=>t.createElement(ii,{...e},t.createElement(b,{is:v.ChevronLeft})),ci=e=>t.createElement(li,{...e},t.createElement(b,{is:v.ChevronRight})),di=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"}}}),mi=l(ge.Slide,{}),ui=({children:e,...a})=>t.createElement(mi,{...a,tag:"div"},t.createElement(w,{css:{px:"$3"}},e)),pi=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:a,slideHeight:o,slideWidth:r,numSlides:n,...i})=>t.createElement(Ne,{css:a},t.createElement(ge.CarouselProvider,{naturalSlideWidth:r,naturalSlideHeight:o,totalSlides:n,...i},e)),hi=()=>t.useContext(ge.CarouselContext);ve.ArrowNext=ci,ve.ArrowPrevious=si,ve.Pagination=di,ve.Slide=ui,ve.Slider=pi,ve.displayName="Carousel";const gi=l(xa.Indicator,{display:"flex",alignItems:"center",justifyContent:"center"}),fi=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"}}}}),dt=t.forwardRef((e,a)=>t.createElement(fi,{...e,ref:a},t.createElement(gi,null,t.createElement(b,{is:e.checked==="indeterminate"?v.Minus:v.Ok,css:{pointerEvents:"none",position:"absolute",strokeWidth:"3",size:14}}))));dt.displayName="Checkbox";const $i={success:{color:"$success"},warning:{color:"$warningText","& svg":{color:"$warningDark"}},info:{color:"$primary"},neutral:{color:"$tonal400"},error:{color:"$danger"}},bi={success:v.OkCircle,warning:v.Danger,info:v.Info,neutral:v.Info,error:v.Error},vi=l(D,{variants:{theme:$i}}),yi=l(b,{flexShrink:"0",mr:"$2"}),mt=({css:e,showIcon:a=!0,theme:o="error",size:r="sm",children:n,...i})=>t.createElement(vi,{theme:o,css:e,...i},a&&t.createElement(yi,{size:"sm",is:bi[o]}),t.createElement(A,{as:"span",size:r,css:{transform:"translateY($space$0)"}},n)),xi=l("label",{color:"$tonal500",fontFamily:"$body",m:0,variants:{size:{sm:Ke({size:"sm"}),md:Ke({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"}}]}),wi=l("span",{color:"$danger",ml:"$1",fontWeight:400}),Oe=({align:e="start",as:a="label",direction:o="row",size:r="md",type:n="block",children:i,required:s,...c})=>t.createElement(xi,{as:a,size:r,type:n,align:e,direction:o,...c},i,s&&t.createElement(wi,{"aria-hidden":!0},"*"));Oe.displayName="Label";const He=l("li",{}),Oa=l("ul",{fontFamily:"$body",m:"unset",p:"unset",[`& > ${He}`]:{"&:not(:last-child)":{mb:"$2"},"&:last-child":{mb:0}},variants:{...Je,as:{ol:{pl:"$4",listStyle:"decimal",[`& > ${He}`]:{pl:"$1","&::marker":{fontSize:"$sm",fontWeight:"bold"}}},ul:{pl:"$3",[`& > ${He}`]:{pl:"$2","&::marker":{content:"\u2022",fontWeight:"bold"}}}},theme:{primary:{[`& > ${He}`]:{"&::marker":{color:"$primary"}}}}}}),ut=t.forwardRef(({size:e="md",noCapsize:a=!0,ordered:o,...r},n)=>t.createElement(Oa,{ref:n,as:o?"ol":"ul",size:e,noCapsize:a,...r}));ut.Item=He;const Ei=l(w,{bg:"$tonal100",borderRadius:"$1",color:"$tonal600",fontFamily:"$mono",fontSize:"$sm",lineHeight:1.4,my:"$4",p:"$3"}),Ci=({node:e})=>t.createElement(Ei,{as:"pre"},e.value),Ha=l("em",{fontStyle:"italic"}),Si=({node:e,handleNode:a})=>{var o;return t.createElement(Ha,null,(o=e.children)==null?void 0:o.map(a))},ki=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"}}},Di=({node:e,handleNode:a,...o})=>{var r;const{as:n,size:i}=ki(e.depth);return t.createElement(ct,{as:n,size:i,...o},(r=e.children)==null?void 0:r.map(a))},zi=l(w,{bg:"$tonal100",borderRadius:"$0",color:"$tonal600",display:"inline-block",fontFamily:"$mono",fontSize:"85%",p:"$0 $1"}),Ii=({node:e})=>t.createElement(zi,{as:"code"},e.value),Ti=({node:e,css:a})=>{var o;return t.createElement(We,{src:e.url,alt:(o=e.alt)!=null?o:void 0,css:a})},Ri=({node:e,handleNode:a})=>{var o,r;return t.createElement(pt,{title:(o=e.title)!=null?o:void 0,href:e.url},(r=e.children)==null?void 0:r.map(a))},Fi=({node:e,handleNode:a,css:o})=>{var r;return t.createElement(ut,{css:{"& p:before, & p:after":{display:"none"},...o},ordered:e.ordered||void 0},(r=e.children)==null?void 0:r.map(a))},Ni=({node:e,handleNode:a})=>{var o;return t.createElement(ut.Item,null,(o=e.children)==null?void 0:o.map(a))},Mi=({node:e,handleNode:a,...o})=>{var r;return t.createElement(A,{...o},(r=e.children)==null?void 0:r.map(a))},Ai=l("strong",{fontWeight:600}),Li=({node:e,handleNode:a})=>{var o;return t.createElement(Ai,null,(o=e.children)==null?void 0:o.map(a))},Pi=({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",...a},o)=>u.default.createElement(Va,{ref:o,orientation:e,...a})),Wi=({css:e})=>t.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} > &, ${He} > &, ${Ha} > &`]:{fontSize:"100%",lineHeight:1,"&::before, &::after":{content:"none"}},variants:Je}),pt=t.forwardRef(({size:e="md",href:a,...o},r)=>t.createElement(_a,{...!a&&{as:"button",noCapsize:!0},size:e,href:a,...o,ref:r}));pt.displayName="Link";const jt=({children:e,css:a})=>t.createElement(A,{size:"sm",css:{color:"$tonal300",maxWidth:"80ch",...a}},e),te=({css:e,children:a,error:o,fieldId:r,label:n,prompt:i,description:s,required:c,hideLabel:d})=>{const m=d?Dt.Root:D;return t.createElement(w,{css:e},t.createElement(m,{css:{justifyContent:"space-between",alignItems:"center",mb:"$3"}},t.createElement(Oe,{htmlFor:r,required:c},n),i&&t.createElement(pt,{href:i.link,size:"sm"},i.label)),s&&t.createElement(jt,{css:{mb:"$3"}},s),a,o&&t.createElement(mt,{css:{mt:"$2"}},o))};te.displayName="FieldWrapper";const Bi=l(Fe.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"}}),Oi=l(Fe.Indicator,{size:"6px",borderRadius:"$round",backgroundColor:"currentcolor",position:"absolute"}),ht=e=>t.createElement(Bi,{...e},t.createElement(Oi,null));ht.displayName="RadioButton";const Yt=l(Fe.Root,{display:"flex",flexWrap:"wrap",variants:{direction:{row:{flexDirection:"row","& > *:not(:last-child)":{mr:"$5"}},column:{flexDirection:"column"}}}});Yt.displayName="RadioButtonGroup";const gt=({align:e="start",children:a,css:o,description:r,direction:n="row",error:i,label:s,required:c})=>t.createElement(w,{css:o},t.createElement(Oe,{align:e,direction:n,required:c,type:"inline"},t.Children.map(a,d=>t.createElement(w,{css:{[n==="reverse"?"ml":"mr"]:"$3",...((d==null?void 0:d.type)===dt||(d==null?void 0:d.type)===ht)&&{transform:"translateY($space$1)"}}},d)),s),i&&t.createElement(mt,{css:{mt:"$2"}},i),r&&t.createElement(jt,{css:{mt:"$2",[n==="reverse"?"mr":"ml"]:"calc($space$3 + $sizes$1)"}},r));gt.displayName="InlineFieldWrapper";var qa=(e=>(e.LOCAL="local",e.SESSION="session",e))(qa||{});const Hi=l("form",{}),Vi=({persist:e,watch:a,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=a(),p=Object.keys(m).filter(g=>{var h;if(!((h=i.exclude)!=null&&h.includes(g)))return g});s={...d,include:p}}return Cr.default(n,{watch:a,setValue:o},s),r},Ga=({formMethods:e,handleSubmit:a,onSubmit:o,onError:r,children:n,...i})=>t.createElement(V.FormProvider,{...e},t.createElement(Hi,{"aria-label":"form",...i,onSubmit:a(o,r)},n)),ja=({children:e,defaultValues:a={},onSubmit:o,onError:r,validationMode:n="onBlur",render:i,persist:s,...c})=>{Re.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=V.useForm({defaultValues:a,mode:n}),{handleSubmit:m,watch:p,setValue:g}=d,h=i?i(d):e,f={formMethods:d,handleSubmit:m,onSubmit:o,onError:r,...c};return s?t.createElement(Vi,{persist:s,watch:p,setValue:g},t.createElement(Ga,{...f},h)):t.createElement(Ga,{...f},h)};ja.displayName="Form";const ie=e=>{var a;const{errors:o}=V.useFormContext(),r=e.split(/[,[\].]+?/).filter(Boolean);return{error:(a=(()=>Sr.default(o,r))())==null?void 0:a.message}};var _i=(e=>(e.ON="on",e.OFF="off",e))(_i||{});const Ya=({css:e,label:a,name:o,validation:r,description:n,defaultChecked:i=!1,checked:s,...c})=>{const{control:d}=V.useFormContext(),{error:m}=ie(o),{field:{ref:p,onChange:g,value:h,name:f}}=V.useController({name:o,control:d,rules:r,defaultValue:i});return t.useEffect(()=>{typeof s<"u"&&g(s)},[s]),t.createElement(gt,{css:e,description:n,error:m,label:a,required:Boolean(r==null?void 0:r.required)},t.createElement(dt,{ref:p,name:f,...c,onCheckedChange:g,value:h?"on":"off",checked:h,...m&&{state:"error"}}))};Ya.displayName="CheckboxField";const Ua={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},qi=l("span",{display:"inline-flex",alignItems:"center",px:"$1",flexGrow:1,...Ua,"& > *:not(:last-child)":{mr:"$1"}}),Gi={sm:"sm",md:"sm",lg:"md"},ji=l(b,{flexShrink:0}),Xa=({...e})=>{const a=t.useContext(Ja),{size:o}=a,r=t.useMemo(()=>_t(o,n=>Gi[n]),[o]);return t.createElement(ji,{...e,size:r})},Yi=({children:e,...a})=>{const o=t.Children.toArray(e),r=o.length<=1;return t.createElement(qi,{...a},o.map((n,i)=>!r&&typeof n=="string"?t.createElement(w,{as:"span",css:Ua,key:n},n):t.isValidElement(n)&&n.type===b?t.createElement(Xa,{key:`icon-${i}`,...n.props}):n))},Ui=l(D,{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",...Ke({size:"sm"})},md:{height:"$3",...Ke({size:"sm"})},lg:{height:"$4",...Ke({size:"md"})}}}}),Ja=t.createContext({}),Xi=({size:e,children:a})=>{const o=t.useMemo(()=>({size:e}),[e]);return t.createElement(Ja.Provider,{value:o},a)},Ji=t.forwardRef(({asWorkaround:e,size:a="md",...o},r)=>t.createElement(Xi,{size:a},t.createElement(Ui,{ref:r,as:e,size:a,...o}))),de=Ji;de.Content=Yi,de.Icon=Xa,de.displayName="Chip";const Ut=t.forwardRef(({gap:e=2,...a},o)=>t.createElement(Pe,{ref:o,direction:"row",gap:e,align:!1,...a})),Xt=t.createContext({isDismissed:!1,setIsDismissed:()=>null}),Ki=({children:e,disabled:a})=>{const[o,r]=t.useState(!1),n=t.useMemo(()=>({disabled:a,isDismissed:o,setIsDismissed:r}),[a,o]);return t.createElement(Xt.Provider,{value:n},e)},Qi=({asChild:e=!1,value:a,onDismiss:o,...r})=>{const n=t.useContext(Xt),{isDismissed:i,disabled:s}=n;if(t.useEffect(()=>{i&&(o==null||o(a))},[i]),i)return null;const c={...s&&{["data-disabled"]:""},...r};return t.createElement(e?St.Slot:"div",{...c})},Zi=({disabled:e=!1,...a})=>t.createElement(Ki,{disabled:e},t.createElement(Qi,{...a})),el=e=>t.createElement("button",{type:"button",...e},"Dismiss"),Ka=({asChild:e=!1,...a})=>{const o=t.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)},...a};return t.createElement(e?St.Slot:el,{...i})},ft=Zi;ft.Trigger=Ka,ft.displayName="Dismissible";const Qa=t.createContext({onDismiss:()=>null}),tl=({children:e,disabled:a,onDismiss:o})=>{const r=t.useMemo(()=>({disabled:a,onDismiss:o}),[a,o]);return t.createElement(Qa.Provider,{value:r},e)},al=({as:e="div",disabled:a,onDismiss:o,...r})=>t.createElement(tl,{disabled:a,onDismiss:o},t.createElement(e,{...r})),ol=({children:e,disabled:a=!1,...o})=>{const r=t.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 t.createElement(ft,{disabled:i||a,onDismiss:n,...o},e)},ye=al;ye.Item=ol,ye.Trigger=Ka,ye.displayName="DismissibleGroup";const rl=l(de,{px:"$1"}),nl=({size:e="md",children:a,dismissActionLabel:o="Dismiss",...r})=>t.createElement(ye.Item,{asChild:!0,...r},t.createElement(rl,{size:e},t.createElement(de.Content,null,a),t.createElement(ye.Trigger,{asChild:!0},t.createElement(N,{label:o,css:{color:"$tonal200"},size:e==="sm"?"xs":"sm"},t.createElement(b,{is:v.Close}))))),il=t.forwardRef((e,a)=>t.createElement(Ut,{as:ye,ref:a,...e})),Jt=il;Jt.Item=nl,Jt.displayName="ChipDismissibleGroup";const Za=l(b,{display:"none"}),ll=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"}}}),sl=({size:e="md",children:a,...o})=>t.createElement(ot.Item,{...o,asChild:!0},t.createElement(ll,{asWorkaround:"button"},t.createElement(Za,{is:v.Ok,size:e==="lg"?"md":"sm"}),t.createElement(de.Content,null,a))),cl=t.forwardRef((e,a)=>t.createElement(Ut,{ref:a,as:ot.Root,orientation:"horizontal",...e})),Kt=cl;Kt.Item=sl,Kt.displayName="ChipToggleGroupItem";const dl=l(ze.ComboboxInput,{boxShadow:"none",fontSize:"$md",appearance:"none",backgroundImage:Sa(G.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"}}}}),ml=l(ze.ComboboxList,{listStyle:"none",m:0,p:0,userSelect:"none"}),ul=l(ze.ComboboxOption,{color:"$tonal500",cursor:"pointer",m:0,p:"$2",'&:hover, &[aria-selected="true"]':{bg:"$tonal50",borderRadius:"$0"},"[data-user-value]":{color:"$primary"}}),pl=l(ze.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 hl=l(ze.Combobox,{}),xe=e=>t.createElement(hl,{...e});xe.displayName="Combobox",xe.Option=ul,xe.Input=dl,xe.Popover=pl,xe.List=ml,xe.OptionText=ze.ComboboxOptionText;var J=(e=>(e.NONE="none",e.PENDING="pending",e.FULFILLED="fulfilled",e.REJECTED="rejected",e))(J||{});const gl=e=>{if(e[0])return e[0].desc?"desc":"asc"},fl=async(e,a,o,r,n)=>{var i,s,c,d,m,p;const{pageIndex:g,pageSize:h}=o,f={pageIndex:(i=a==null?void 0:a.pageIndex)!=null?i:g,pageSize:(s=a==null?void 0:a.pageSize)!=null?s:h,sortBy:(d=a==null?void 0:a.sortBy)!=null?d:(c=r[0])==null?void 0:c.id,sortDirection:(m=a==null?void 0:a.sortDirection)!=null?m:gl(r),globalFilter:(p=a.globalFilter)!=null?p:n},$=await e(f);return Re.default(Array.isArray($==null?void 0:$.results),"The getAsyncData function must return an object with a property `result` which must be an array"),Re.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"),$},$l={pageIndex:0,pageSize:10},bl=e=>{const[a,o]=u.default.useState(!!e),[r,n]=u.default.useState({...$l,...e||{}}),i=u.default.useCallback(()=>{o(!0)},[]);return{isPaginated:a,paginationState:r,setPaginationState:n,applyPagination:i}},vl=e=>{const[a,o]=u.default.useState(!1),[r,n]=u.default.useState(e?[{id:e.column,desc:e.direction==="desc"}]:[]);return{isSortable:a,setIsSortable:o,sorting:r,setSorting:n}},eo=t.createContext(null),yl=({columns:e,data:a=[],getAsyncData:o,defaultSort:r,initialState:n=void 0,children:i})=>{var s;const[c,d]=t.useState({results:a!=null?a:[],total:(s=a==null?void 0:a.length)!=null?s:0}),{isPaginated:m,applyPagination:p,paginationState:g,setPaginationState:h}=bl(n==null?void 0:n.pagination),[f,$]=t.useState(J.NONE),[y,O]=t.useState(""),{setIsSortable:I,isSortable:M,sorting:x,setSorting:C}=vl(r),E=t.useCallback(async F=>{if(o)try{$(J.PENDING);const _=await fl(o,F,g,x,y);d(_),$(J.FULFILLED)}catch{$(J.REJECTED)}},[o,g==null?void 0:g.pageIndex,g==null?void 0:g.pageSize,x,y]);t.useEffect(()=>{E({})},[E]),kr.default(()=>{!a||d({results:a,total:a.length})},[a]);const T=()=>c.total,L=se.useReactTable({columns:e,data:c.results,pageCount:g?Math.ceil(T()/g.pageSize):-1,initialState:n,state:{sorting:x,globalFilter:y,pagination:g},manualPagination:o&&m,manualSorting:o&&m,enableSorting:f!==J.PENDING,enableGlobalFilter:!o,getCoreRowModel:se.getCoreRowModel(),getPaginationRowModel:m?se.getPaginationRowModel():void 0,getSortedRowModel:M||x.length?se.getSortedRowModel():void 0,getFilteredRowModel:se.getFilteredRowModel(),onPaginationChange:m?h:void 0,onSortingChange:C,onGlobalFilterChange:O}),R=t.useMemo(()=>({...L,data:c,setData:d,setIsSortable:I,applyPagination:p,getTotalRows:T,isSortable:M,asyncDataState:f,runAsyncData:E}),[L,p,T,M]);return t.createElement(eo.Provider,{value:R},i)},K=()=>{const e=t.useContext(eo);if(!e)throw new Error("useDataTable can only be called from inside a DataTableProvider");return e},$t=l("tr",{bg:"unset"}),to=t.forwardRef((e,a)=>t.createElement($t,{...e,ref:a}));to.displayName="TableRow";const xl=l("tbody",{variants:{striped:{true:{[`${$t}`]:{"&:nth-child(odd)":{bg:"white"},"&:nth-child(even)":{bg:"$tonal50"}}},false:{[`${$t}`]:{bg:"white"}}}}}),ao=({striped:e=!0,...a})=>t.createElement(xl,{striped:e,...a});ao.displayName="TableBody";const Ve=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"}});Ve.displayName="TableCell";const oo=l("tfoot",{});oo.displayName="TableFooter";const bt=l("td",{color:"$tonal400",fontFamily:"$body",fontWeight:600,p:"$2 $3",textAlign:"left",verticalAlign:"middle"});bt.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"},wl=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",...a})=>u.default.createElement(wl,{theme:e,...a});ro.displayName="TableHeader";const no=({children:e,numberOfStickyColumns:a=0,css:o,...r})=>{const[n,i]=u.default.useState(!1);return u.default.createElement(w,{onScroll:s=>{const c=s.currentTarget.scrollWidth>s.currentTarget.clientWidth;c!==n&&i(c)},role:"scrollbar",css:{overflow:"auto",maxWidth:"100%",[`& td:nth-of-type(${a}), th:nth-of-type(${a})`]:{...n&&{boxShadow:"$colors$alpha200 -2px -3px 9px 1px",clipPath:"inset(0px -10px 0px 0px)"},...a===1&&{position:"sticky",left:"0",zIndex:"2"}},"& td":{bg:"inherit"},...o},...r},e)},El=l("table",{borderCollapse:"separate",borderSpacing:0,fontFamily:"$sans",fontSize:"$sm",width:"100%",variants:{size:{md:{[`${Ve}, ${me}, ${bt}`]:{height:"$4"}},lg:{[`${Ve}, ${me}, ${bt}`]:{height:"$5"}}},corners:{round:{[`${me}`]:{"&:first-of-type":{borderTopLeftRadius:"$0"},"&:last-of-type":{borderTopRightRadius:"$0"}},[`${$t}:last-child`]:{[`${Ve}:first-child`]:{borderBottomLeftRadius:"$0"},[`${Ve}:last-child`]:{borderBottomRightRadius:"$0"}}},square:{}}}}),z=({size:e="md",corners:a="round",numberOfStickyColumns:o=0,...r})=>{const n=t.createElement(El,{size:e,corners:a,...r});return o?t.createElement(no,{numberOfStickyColumns:o},n):n};z.Body=ao,z.Cell=Ve,z.Footer=oo,z.FooterCell=bt,z.Header=ro,z.HeaderCell=me,z.Row=to,z.StickyColumnsContainer=no,z.displayName="Table";const Cl=({striped:e=!1,...a})=>{const{getRowModel:o}=K();return t.createElement(z.Body,{...a,striped:e},o().rows.map(r=>t.createElement(W.Row,{row:r,key:r.id})))},Zt=({cell:e})=>t.createElement(z.Cell,{key:e.id},se.flexRender(e.column.columnDef.cell,e.getContext())),Sl=({children:e})=>{const{asyncDataState:a,runAsyncData:o}=K();return a!==J.REJECTED?null:e(o)},kl=({children:e,hidden:a=!1})=>a?t.createElement(Dt.Root,null,e):e?t.createElement(t.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=t.forwardRef(({type:e="text",size:a="md",...o},r)=>e==="number"?t.createElement(io,{type:"text",inputMode:"numeric",pattern:"[0-9]*",size:a,...o,ref:r}):t.createElement(io,{type:e,size:a,...o,ref:r}));we.displayName="Input";const Dl=()=>{const e=t.useRef(null),a=t.useCallback(o=>{o&&(e.current=o)},[]);return[e,a]},zl=()=>{const[e,a]=t.useState(null),o=t.useCallback(r=>{r&&a(r)},[]);return[e,o]};var Il=(e=>(e.SEARCH="SEARCH",e.CLEAR="CLEAR",e))(Il||{});const Tl=l(b,{color:"$tonal300",position:"absolute",pointerEvents:"none",variants:{size:{sm:{top:"$2",right:"$2",size:"$1"},md:{top:10,right:10,size:20}}}}),Rl=l(we,{'&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, & input[type="search"]::-webkit-search-results-decoration':{display:"none"}}),vt=t.forwardRef(({size:e="md",css:a,value:o,defaultValue:r="",onValueChange:n,clearText:i="Clear",onChange:s,...c},d)=>{const[m,p]=Dl(),[g,h]=t.useState(r),[f,$]=t.useState(r?"CLEAR":"SEARCH");t.useEffect(()=>{typeof o>"u"||(h(o),$(o?"CLEAR":"SEARCH"))},[o]),t.useImperativeHandle(d,()=>m.current);const y=()=>{var M,x;const C=m.current;if(!C)return;const E=(M=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:M.set;(x=E==null?void 0:E.call)==null||x.call(E,C,"");const T=new Event("input",{bubbles:!0});C.dispatchEvent(T),C.focus(),n==null||n("")},O=M=>{s==null||s(M);const x=M.target.value;h(x),n==null||n(x),$(x?"CLEAR":"SEARCH")},I=()=>f==="SEARCH"?t.createElement(Tl,{is:v.Search,size:e,css:{size:e=="sm"?"$1":20}}):t.createElement(N,{label:i,theme:"neutral",size:e,css:{position:"absolute",top:"0",right:"$1"},onClick:y},t.createElement(b,{is:v.Close}));return t.createElement(w,{css:{position:"relative",...a}},t.createElement(Rl,{ref:p,size:e,type:"search",...c,value:g,onChange:O,css:{pr:e==="sm"?"$5":"$6"}}),I())});vt.displayName="SearchInput";const Fl=({onChange:e,label:a,hideLabel:o=!1,...r})=>{const{setGlobalFilter:n,getState:i,resetPagination:s}=K(),{globalFilter:c}=i(),d=Ie.debounce(250,m=>{const{target:{value:p}}=m;e==null||e(m),s(),n(p)});return t.createElement(t.Fragment,null,t.createElement(kl,{hidden:o},t.createElement(Oe,{css:{mb:"$3"},htmlFor:a},a)),t.createElement(vt,{...r,defaultValue:c,onChange:d,name:a}))},Nl=({sortable:e=!0,theme:a="light",...o})=>{const{getHeaderGroups:r,setIsSortable:n}=K();return t.useEffect(()=>{n(e)},[e,n]),t.createElement(z.Header,{theme:a,...o},r().map(i=>t.createElement(z.Row,{key:i.id},i.headers.map(s=>t.createElement(W.HeaderCell,{header:s,key:s.id})))))},Ml={asc:v.SortUp,desc:v.SortDown},Al=({direction:e})=>t.createElement(b,{is:Ml[e],size:"sm",css:{position:"absolute",left:"$1"}}),Ll=({header:e,children:a,css:o,...r})=>{const n=e.column.getIsSorted(),{isSortable:i}=K(),s=e.column.getCanSort();return t.createElement(z.HeaderCell,{onClick:i&&s?e.column.getToggleSortingHandler():void 0,css:{cursor:i&&s?"pointer":"initial",...o},...r},t.createElement(D,{css:{alignItems:"center"}},se.flexRender(e.column.columnDef.header,e.getContext()),n&&i&&t.createElement(D,{css:{position:"relative",alignItems:"center"}},t.createElement(Al,{direction:n}))))},Pl=l(st,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:1}),ea=e=>{const{asyncDataState:a}=K();return a!==J.PENDING?null:t.createElement(Pl,{...e})},Wl=({row:e})=>t.createElement(z.Row,null,e.getVisibleCells().map((a,o)=>t.createElement(Zt,{key:a.id,cell:a}))),Bl=({sortable:e,striped:a,theme:o,css:r,numberOfStickyColumns:n=0,...i})=>{const{asyncDataState:s}=K(),c=s===J.PENDING;return t.createElement(t.Fragment,null,t.createElement(ea,null),t.createElement(z,{...i,numberOfStickyColumns:n,css:{...r,...c&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},t.createElement(W.Head,{theme:o,sortable:e}),t.createElement(W.Body,{striped:a})))},lo=t.createContext({idColumn:"id"}),Ol=()=>{const e=t.useContext(lo);if(!e)throw new Error("useDragAndDropTable can only be called within a DragAndDropContainer");return e},Hl=(e,a,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(a.results,c,d);return n==null||n(c,d,m),{results:m,total:m.length}},Vl=(e,a)=>e.results.map(o=>{const r=o[a];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}),_l=({idColumn:e="id",onChange:a=void 0,children:o})=>{const{data:r,setData:n}=K(),i=t.useMemo(()=>Vl(r,e),[r]),s=fe.useSensors(fe.useSensor(fe.PointerSensor),fe.useSensor(fe.KeyboardSensor,{coordinateGetter:qe.sortableKeyboardCoordinates}));return t.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=>Hl({active:d,over:m},p,i,e,a))},modifiers:[mr.restrictToVerticalAxis]},t.createElement(qe.SortableContext,{items:i,strategy:qe.verticalListSortingStrategy},t.createElement(lo.Provider,{value:{idColumn:e}},o)))},ql=({row:e})=>{const{idColumn:a}=Ol(),{attributes:o,listeners:r,transform:n,setNodeRef:i,isDragging:s}=qe.useSortable({id:e.original[a]});return t.createElement(z.Row,{ref:i,css:{transform:ur.CSS.Transform.toString(n),zIndex:s?5:void 0}},e.getVisibleCells().map((c,d)=>d===0?t.createElement(z.Cell,{key:c.id},t.createElement(jl,{...o,...r,isDragging:s,css:{display:"inline-block"},label:"drag and drop"}),se.flexRender(c.column.columnDef.cell,c.getContext())):t.createElement(Zt,{key:c.id,cell:c})))},Gl=l(N,{color:"inherit !important",fill:"currentColor",variants:{isDragging:{true:{cursor:"grabbing"},false:{cursor:"grab"}}}}),jl=t.forwardRef(({isDragging:e,size:a,...o},r)=>t.createElement(Gl,{ref:r,isDragging:e,appearance:"simple",size:a,...o},t.createElement(b,{is:v.DragHandle,size:a}))),Yl=({striped:e=!1,...a})=>{const{getRowModel:o}=K();return t.createElement(z.Body,{...a,striped:e},o().rows.map(r=>t.createElement(ql,{row:r,key:r.id})))},Ul=({idColumn:e,onDragAndDrop:a,sortable:o,striped:r,theme:n,css:i,...s})=>{const{asyncDataState:c}=K(),d=c===J.PENDING;return t.createElement(_l,{onChange:a,idColumn:e},t.createElement(ea,null),t.createElement(z,{...s,css:{...i,...d&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},t.createElement(W.Head,{theme:n,sortable:o}),t.createElement(Yl,{striped:r})))},Xl=l("select",{appearance:"none",backgroundColor:"white",backgroundImage:Sa(G.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"}}}}),yt=t.forwardRef(({placeholder:e,children:a,size:o="md",...r},n)=>{const i={size:o,ref:n,...r};return[r.value,r.defaultValue].every(s=>s===void 0)&&(i.defaultValue=""),t.createElement(Xl,{...i},e&&t.createElement("option",{disabled:!0,hidden:!0,value:""},e),a)});yt.displayName="Select";const so=({direction:e,...a})=>{const o=e==="next";return u.default.createElement(N,{appearance:"outline",isRounded:!0,label:o?"Next page":"Previous page",name:o?"Next page":"Previous page",size:"md",...a},u.default.createElement(b,{is:o?v.ChevronRight:v.ChevronLeft}))},Jl=({gotoPage:e,pageCount:a,pageIndex:o,disabled:r})=>u.default.createElement(D,{css:{alignItems:"center"}},u.default.createElement(yt,{value:o,size:"sm",css:{mr:"$3"},disabled:r,onChange:n=>{e(Number(n.target.value))}},Array.from({length:a},(n,i)=>i).map(n=>u.default.createElement("option",{key:n,value:n},n+1))),u.default.createElement(A,{size:"sm",css:{flex:"none"}},`of ${a} ${a>1?"pages":"page"}`)),Kl=l("nav",{display:"flex",justifyContent:"space-between",alignItems:"center",fontVariantNumeric:"tabular-nums"}),Ql=e=>{const{applyPagination:a,getState:o,getRowModel:r,getPageCount:n,previousPage:i,nextPage:s,setPageIndex:c,getTotalRows:d,asyncDataState:m}=K();t.useEffect(()=>{a()},[a]);const{pagination:p}=o(),g=p.pageIndex*p.pageSize+1,h=g+r().rows.length-1,f=m===J.PENDING||m===J.REJECTED;return t.createElement(Kl,{...e},t.createElement(A,{size:"sm"},`${g.toString()} - ${h.toString()} of ${d()} items`),t.createElement(Jl,{gotoPage:c,pageCount:n(),pageIndex:p.pageIndex,disabled:f}),t.createElement(D,{css:{justifyContent:"flex-end"}},t.createElement(so,{direction:"previous",disabled:p.pageIndex===0||f,onClick:i,css:{mr:"$4"}}),t.createElement(so,{direction:"next",disabled:p.pageIndex===n()-1||f,onClick:s})))},W=e=>t.createElement(yl,{...e});W.Body=Cl,W.DataCell=Zt,W.DragAndDropTable=Ul,W.Head=Nl,W.HeaderCell=Ll,W.Pagination=Ql,W.Row=Wl,W.GlobalFilter=Fl,W.Table=Bl,W.Loading=ea,W.Error=Sl;const Zl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],es=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],co={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,a)=>{const o=e.slice(0,a);return e.slice(a).concat(o)},mo=({css:e,refDateSelected:a,refDateToday:o,firstDayOfWeek:r=0,monthNames:n=Zl,weekdayNames:i=es,labels:s=co,date:c=new Date,minDate:d,maxDate:m,setYear:p,...g})=>{const[h,f]=t.useState(!1),[$,y]=t.useState(c==null?void 0:c.getFullYear()),O=R=>{const F=c;F.setFullYear(R),p(F),f(!1)},I=d&&$-16<=d.getFullYear(),M=m&&$>=m.getFullYear(),x=Array.from({length:16},(R,F)=>{const _=$-F;return m&&_>m.getFullYear()||d&&_<d.getFullYear()?0:_}),{calendars:C,getBackProps:E,getForwardProps:T,getDateProps:L}=pr.useDayzed({firstDayOfWeek:r,showOutsideDays:!0,date:c,minDate:d,maxDate:m,...g});return C.length?t.createElement(w,{css:{position:"relative",width:"min-content",mt:"-$1",...e}},t.createElement(D,{css:{position:"absolute",top:0,right:"-$1"}},t.createElement(N,{label:s[h?"previousYear":"previous"],theme:"neutral",size:"md",...!h&&E({calendars:C}),...h&&{onClick:()=>y($-16)},disabled:h&&I},t.createElement(b,{is:v.ChevronLeft})),t.createElement(N,{label:s[h?"nextYear":"next"],theme:"neutral",size:"md",...!h&&T({calendars:C}),...h&&{onClick:()=>y($+16)},disabled:h&&M},t.createElement(b,{is:v.ChevronRight}))),h&&t.createElement(ta,{css:{gridTemplateColumns:"repeat(4, 1fr)",pt:"$7",direction:"rtl",gridGap:"$3 $1"}},x.map((R,F)=>{const _=R===c.getFullYear();return R?t.createElement(as,{key:`${R}${F}`,theme:_?"primary":"neutral",onClick:()=>O(R),selected:_},R):t.createElement(w,{key:F,css:{width:"$6",height:"$4"}})})),!h&&C.map(({month:R,year:F,weeks:_})=>t.createElement(w,{key:`${R}${F}`},t.createElement(D,{css:{height:"$4",alignItems:"center",mb:"$4"}},t.createElement(ne,{theme:"neutral",css:{px:"0",color:"$tonal600"},onClick:()=>f(!0)},n[R]," ",F)),t.createElement(ta,{css:{mb:"$3"}},os(i,r).map(ke=>t.createElement(A,{as:"span",size:"sm",key:`${R}${F}${ke}`,css:{fontWeight:600,textAlign:"center"}},ke))),t.createElement(ta,null,_.map((ke,Ct)=>ke.map((S,Y)=>{const _e=`${R}${F}${Ct}${Y}`;if(!S)return t.createElement("div",{key:_e});const{date:Qo,selected:ba,today:va,prevMonth:Zo,nextMonth:er}=S;return t.createElement(ts,{isOutsideMonth:Zo||er,isSelected:ba,isToday:va,key:_e,ref:ba?a:va?o:null,...L({dateObj:S}),type:"button"},Qo.getDate())})))))):null};mo.displayName="Calendar";const rs=l($e.Content,{bg:"white",borderRadius:"$1",boxShadow:"$2",maxWidth:"90vw",p:"$sizes$2",pr:"$6",position:"relative",zIndex:Dn,"@allowMotion":{animationDuration:"75ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="open"]':{'&[data-side="top"]':{animationName:Nt},'&[data-side="right"]':{animationName:Mt},'&[data-side="bottom"]':{animationName:Rt},'&[data-side="left"]':{animationName:Ft}}},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:a="top",sideOffset:o=8,closePopoverText:r="Close popover",showCloseButton:n=!0,size:i="md",...s})=>t.createElement(rs,{size:i,side:a,sideOffset:o,...s},n&&t.createElement(N,{as:$e.Close,css:{position:"absolute",right:"$0",top:"$0"},label:r,size:"md",hasTooltip:!1,theme:"neutral"},t.createElement(b,{is:v.Close})),e,t.createElement(ns,{width:16,height:8}));l($e.Root,{});const le=e=>t.createElement($e.Root,{...e});le.Content=is,le.Portal=$e.Portal,le.Trigger=$e.Trigger,le.displayName="Popover";const uo="DD/MM/YYYY";Ge.default.extend(Dr.default);const ls=(e,a=uo)=>{const[o,r]=P.useState(e?Ge.default(e).toDate():void 0),[n,i]=P.useState(e?Ge.default(e).format(a):"");return{dateString:n,date:o,setDate:(s,c=!1)=>{const d=c?Ge.default(s,a,!0):Ge.default(s);r(d.isValid()?d.toDate():void 0),i(c?s:d.format(a))}}},aa=t.forwardRef(({initialDate:e,dateFormat:a=uo,firstDayOfWeek:o=1,disabled:r,monthNames:n,weekdayNames:i,size:s="md",labels:c,revalidate:d,onChange:m,minDate:p,maxDate:g,...h},f)=>{const{date:$,dateString:y,setDate:O}=ls(e,a),I={...co,...c},[M,x]=t.useState(!1),C=t.useRef(null),E=t.useRef(null);return t.useEffect(()=>{m==null||m($)},[$,m]),t.createElement(w,{css:{position:"relative"}},t.createElement(we,{name:"date",disabled:r,size:s,...h,onChange:T=>O(T.target.value,!0),value:y,ref:f}),t.createElement(le,{modal:!0,open:M,onOpenChange:x},t.createElement(le.Trigger,{asChild:!0},t.createElement(N,{css:{position:"absolute",top:"0",right:"0"},disabled:r,label:I.open,size:s,theme:"neutral",hasTooltip:!1},t.createElement(b,{is:v.CalendarEvent}))),t.createElement(le.Portal,null,t.createElement(le.Content,{css:{pr:"$sizes$2",zIndex:Ye},side:"bottom",align:"end",showCloseButton:!1,onOpenAutoFocus:T=>{var L,R;T.preventDefault(),$?(L=E.current)==null||L.focus():(R=C.current)==null||R.focus()}},t.createElement(mo,{date:$||new Date,selected:$,onDateSelected:async T=>{x(!1),await O(T.date,!1),d&&d()},setYear:async T=>{await O(T,!1),d&&d()},minDate:p,maxDate:g,refDateToday:C,refDateSelected:E,firstDayOfWeek:o,monthNames:n,weekdayNames:i,labels:I})))))});aa.displayName="DateInput";const po=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c,trigger:d}=V.useFormContext(),{error:m}=ie(o),p=r?c(r):c;return t.createElement(te,{css:e,description:i,error:m,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.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"}),ss=l(q.Close,{}),ra="translate3d(-50%, -50%, 0)",ho="translate3d(-50%, 50vh, 0)",go="modal_overlay",cs=k({"0%":{transform:ho},"100%":{transform:ra}}),ds=k({"0%":{transform:ra},"100%":{transform:ho}}),ms=l(q.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",overflowY:"auto",zIndex:Ye,"@allowMotion":{'&[data-state="open"]':{animation:`${At} 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:Ye,"&: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:a,closeDialogText:o="Close dialog",showCloseButton:r=!0,...n})=>t.createElement(q.Portal,null,t.createElement(ms,{id:go},t.Children.map(a,i=>(i==null?void 0:i.type)===oa&&i),t.createElement(us,{size:e,"aria-label":"Dialog",onPointerDownOutside:i=>{const s=i.target;(s==null?void 0:s.id)!==go&&i.preventDefault()},...n},r&&t.createElement(N,{as:q.Close,css:{position:"absolute",right:"$4",top:"$4"},label:o,hasTooltip:!1,size:"md",theme:"neutral"},t.createElement(b,{is:v.Close})),t.Children.map(a,i=>(i==null?void 0:i.type)!==oa&&i)))),hs=l(q.Root,{}),ue=e=>t.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(Te.Content,{bg:"white",borderRadius:"$0",boxShadow:"$0",py:"$2",zIndex:Sn,"@allowMotion":{animationDuration:"250ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="open"]':{'&[data-side="top"]':{animationName:Nt},'&[data-side="right"]':{animationName:Mt},'&[data-side="bottom"]':{animationName:Rt},'&[data-side="left"]':{animationName:Ft}}}}),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"}},fo=l(Te.Item,fs),$s=l("a",{textDecoration:"none"}),bs=({children:e,href:a,...o})=>u.default.createElement(fo,{...o,asChild:!0},u.default.createElement($s,{href:a,role:"menuitem"},e)),vs=l(Te.Separator,{height:"1px",backgroundColor:"$tonal200",my:"$2"}),ys=l(Te.Trigger,{}),xs=l(Te.Root,{}),Ee=e=>u.default.createElement(xs,{...e});Ee.Content=gs,Ee.Item=fo,Ee.LinkItem=bs,Ee.Portal=Te.Portal,Ee.Separator=vs,Ee.Trigger=ys;const $o=l(A,{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(We,{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(ws,{...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"}}}}),Es=l(D,{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"}}}}),Qe=({size:e="sm",children:a,...o})=>t.createElement(Es,{size:e,...o},t.Children.map(a,r=>t.isValidElement(r)&&(r.type===bo||r.type===vo||r.type===$o)?t.cloneElement(r,{...r.props,size:e}):r));Qe.displayName="EmptyState",Qe.Image=bo,Qe.Title=vo,Qe.Body=$o;const yo=({accept:e,children:a,multiple:o=!1,onFileSelect:r,...n})=>{const i=s=>{const{files:c}=s.target;r(c)};return t.createElement(ne,{as:"label",...n},t.createElement(b,{is:v.Upload}),a,t.createElement("input",{type:"file",onChange:i,accept:e,multiple:o,hidden:!0}))};yo.displayName="FileInput";const Cs=l("div",{display:"grid",variants:{gap:Tt("space",{gap:"$key"})}}),xo=({css:e,gap:a=2,minItemSize:o,maxItemSize:r="1fr",...n})=>t.createElement(Cs,{css:{...o&&{gridTemplateColumns:`repeat(auto-fit, minmax(${o}, ${r}))`},...e},gap:a,...n});xo.displayName="Grid";const wo=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=V.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return t.createElement(te,{css:e,description:i,error:d,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(we,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};wo.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=t.forwardRef((e,a)=>t.createElement(Ss,{ref:a,...e}));na.displayName="StackContent";const ks={code:Ci,emphasis:Si,heading:Di,inlineCode:Ii,image:Ti,link:Ri,list:Fi,listItem:Ni,paragraph:Mi,strong:Li,text:Pi,thematicBreak:Wi},Ds=e=>{var a,o;if((a=e.position)!=null&&a.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:a={},css:o})=>{const r=Tr.default(e,{extensions:[Rr.default()],mdastExtensions:[Ir.default.fromMarkdown]}),n={...ks,...a},i=s=>{const c=n[s.type];return c?t.createElement(c,{key:Ds(s),node:s,handleNode:i}):null};return t.createElement(na,{css:o},r.children.map(i))};Eo.displayName="MarkdownContent";const Co=u.default.createContext(void 0),zs=()=>{const e=u.default.useContext(Co);if(e===void 0)throw new Error("useNavigationMenuContext must be used within a NavigationMenuContextProvider");return e},xt=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:xt,onPointerLeave:xt},u.default.createElement(Is,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"}},Rs=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:a,...o},r)=>u.default.createElement(Rs,{active:a,...o,ref:r,onPointerMove:xt,onPointerLeave:xt},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:a,...o})=>{const{onNodeUpdate:r}=zs();return u.default.createElement(ce.Item,{value:a},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,a)}):n}))};Do.displayName="NavigationMenuDropdown";const Fs=l("button",{...la,...So}),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]":{...ko}}}}}),ca=u.default.forwardRef(({children:e,href:a,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:a,ref:s,elementType:n,css:r,...i},e)));ca.displayName="NavigationMenuLink";const zo=u.default.forwardRef((e,a)=>u.default.createElement(ca,{ref:a,variant:"dropdownItem",...e})),Io=l(A,{color:"$tonal500",fontWeight:600});zo.displayName="NavigationMenuDropdownItem",Io.displayName="NavigationMenuDropdownItemTitle";const As=k({"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:lt}),Bs=l("div",{position:"absolute",left:0,top:"100%",width:"100%",display:"flex",justifyContent:"center"}),pe=({children:e,css:a})=>{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 g;return n===""&&(g=setTimeout(()=>r(null),m)),()=>{g!==null&&clearTimeout(g)}},[n]);const p=(g,h)=>{if(g&&s&&n===h){const f=s/2,$=s-g.offsetLeft-g.offsetWidth+g.offsetWidth/2;r(Math.round(f-$))}return g};return u.default.createElement(Co.Provider,{value:{onNodeUpdate:p}},u.default.createElement(Ls,{onValueChange:i,css:a},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=Do,pe.DropdownContent=ia,pe.DropdownItem=zo,pe.DropdownItemTitle=Io,pe.DropdownTrigger=sa,pe.displayName="NavigationMenu";const Os=l(w,{position:"relative"}),Hs=l(D,{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:a})=>u.default.createElement(Os,null,!!e&&u.default.createElement(Hs,{role:"status"},e),a),_s=l("span",{zIndex:1}),qs=l(N,{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=t.forwardRef((e,a)=>{const{icon:o,disabledTooltipContent:r,showTooltip:n,...i}=e;return t.createElement(X,null,t.createElement(X.Trigger,{asChild:!0},t.createElement(_s,{tabIndex:-1},t.createElement(qs,{hasTooltip:!1,tabIndex:-1,appearance:"outline",ref:a,...i},t.createElement(b,{is:o})))),n&&t.createElement(X.Content,null,r))}),da=t.forwardRef((e,a)=>{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:g,disabledTooltipContent:h,css:f,...$}=e,[y,O]=t.useState(s),I=t.useRef(null);t.useImperativeHandle(a,()=>I.current);const M={increment:"increment",decrement:"decrement",...g},x={decrement:`Cannot enter values below ${r}`,increment:`Cannot enter values above ${n}`,...h},C=y>=n,E=y<=r,T=t.useCallback(S=>Math.min(Math.max(S,r),n),[n,r]),L=t.useCallback(S=>{O(S),p==null||p(Number(S))},[p]),R=t.useCallback(S=>{const Y=S.target.value.replace(/\D/g,"");L(Y)},[L]),F=t.useCallback(()=>{var S;if(C||d)return;(S=I==null?void 0:I.current)==null||S.focus();let Y;y===""?Y=i:Y=Number(y)+i,L(T(Y))},[T,C,d,i,L,y]),_=t.useCallback(()=>{var S;if(E||d)return;(S=I==null?void 0:I.current)==null||S.focus();let Y;y===""?Y=r:Y=Number(y)-i,L(T(Y))},[T,E,d,r,i,L,y]),ke=t.useCallback(S=>{if(S.nativeEvent.isComposing)return;const Y=S.key,_e={ArrowUp:F,ArrowRight:F,ArrowDown:_,ArrowLeft:_,Home:()=>L(r),End:()=>L(n)}[Y];_e&&(S.preventDefault(),_e(S))},[F,_,L,r,n]),Ct={name:o,type:"number",value:y,...$,onChange:R,onKeyDown:ke,size:m,css:{borderRadius:"0px",width:"$6","&:disabled":{opacity:.3,pointerEvents:"none"}},ref:I,readOnly:d,disabled:c,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":Number(y),role:"spinbutton"};return t.createElement(D,{css:f},t.createElement(To,{onClick:_,icon:v.Minus,css:{borderRight:"none",borderTopRightRadius:"0px",borderBottomRightRadius:"0px"},size:m,disabled:E||c,showTooltip:E&&!c,disabledTooltipContent:x.decrement,label:M.decrement}),t.createElement(we,{...Ct}),t.createElement(To,{onClick:F,icon:v.Plus,css:{borderLeft:"none",borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px"},size:m,disabled:C||c,showTooltip:C&&!c,disabledTooltipContent:x.increment,label:M.increment}))});da.displayName="NumberInput";const Ro=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c,trigger:d}=V.useFormContext(),{error:m}=ie(o),p=r?c(r):c;return t.createElement(te,{css:e,description:i,error:m,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(da,{id:o,name:o,ref:p,...m&&{state:"error","aria-invalid":!0},...s,onChange:d}))};Ro.displayName="NumberInputField";const ma=t.forwardRef(({css:e,hidePasswordText:a="Hide password",showPasswordText:o="Show password",size:r="md",...n},i)=>{const[s,c]=P.useState(!1),d=()=>c(m=>!m);return t.createElement(w,{css:{position:"relative",...e}},t.createElement(we,{...n,size:r,type:s?"text":"password",ref:i,css:{pr:"$sizes$2"}}),t.createElement(N,{appearance:"simple",theme:"neutral",css:{bottom:0,position:"absolute",right:0},label:s?a:o,onClick:d,onMouseDown:m=>m.preventDefault(),size:r},t.createElement(b,{is:s?v.Eye:v.EyeCrossed})))});ma.displayName="PasswordInput";const Fo=({css:e={},label:a="Password",name:o,prompt:r=void 0,description:n,validation:i,...s})=>{const{register:c}=V.useFormContext(),{error:d}=ie(o),m=i?c(i):c;return t.createElement(te,{css:{...e,position:"relative"},description:n,error:d,fieldId:o,label:a,prompt:r,required:Boolean(i==null?void 0:i.required)},t.createElement(ma,{autoComplete:"current-password",name:o,id:o,ref:m,...s}))};Fo.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"}),No=({value:e,max:a=100,theme:o="primary",...r})=>t.createElement(Gs,{value:e,max:a,theme:o,...r},t.createElement(js,{style:{width:"100%",transform:`translateX(-${100-(e||0)/a*100}%)`}}));No.displayName="ProgressBar";const Mo=({css:e,label:a,value:o,...r})=>t.createElement(gt,{css:e,label:a},t.createElement(ht,{value:o,...r}));Mo.displayName="RadioField";const Ys=l("fieldset",{all:"unset"}),ua=({children:e,css:a,direction:o="column",defaultValue:r,value:n,description:i,label:s,name:c,validation:d,onValueChange:m,...p})=>{const{control:g}=V.useFormContext(),{field:{ref:h,onChange:f,value:$,name:y}}=V.useController({name:c,control:g,rules:d,defaultValue:r}),{error:O}=ie(c);return t.useEffect(()=>{typeof n<"u"&&f(n)},[n]),t.createElement(Ys,{css:a},t.createElement(Oe,{as:"legend",css:{p:0,mb:"$3"},required:Boolean(d==null?void 0:d.required)},s),i&&t.createElement(jt,{css:{mb:"$3"}},i),t.createElement(Yt,{ref:h,direction:o,defaultValue:r,onValueChange:I=>{f(I),m==null||m(I)},value:$,...p},e),O&&t.createElement(mt,{css:{mt:"$2"}},O))};ua.Item=Mo,ua.displayName="RadioButtonField";const Us=l(Fe.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(Fe.Indicator,{backgroundColor:"white",borderRadius:"$round",position:"absolute",size:"6px"}),Ao=({children:e,isFullWidth:a=!1,size:o="md",align:r="left",...n})=>t.createElement(Us,{...n,align:r,isFullWidth:a,size:o},t.createElement(Xs,{align:r,containerIsFullWidth:a},t.createElement(Js,null)),t.createElement(w,null,e)),Ks=({css:e,children:a,size:o,isFullWidth:r,align:n,gap:i="3",justify:s,...c})=>t.createElement(Fe.Root,{...c},t.createElement(Pe,{direction:"row",justify:s,gap:i,css:e},t.Children.map(a,d=>t.isValidElement(d)&&(d==null?void 0:d.type)===Ao?t.cloneElement(d,{size:o,isFullWidth:r,align:n}):d))),Lo=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=V.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return t.createElement(te,{css:e,description:i,error:d,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(vt,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Lo.displayName="SearchField";const Po=({css:e=void 0,children:a,name:o,label:r,validation:n,prompt:i,description:s,hideLabel:c,...d})=>{const{register:m}=V.useFormContext(),{error:p}=ie(o),g=n?m(n):m;return t.createElement(te,{css:e,description:s,error:p,fieldId:o,label:r,prompt:i,required:Boolean(n==null?void 0:n.required),hideLabel:c},t.createElement(yt,{name:o,id:o,...d,ref:g,...p&&{state:"error"}},a))};Po.displayName="SelectField";const Wo=l(ae.Root,{width:"100%"});Wo.displayName="SidedrawerAccordionRoot";const Qs=k({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Zs=k({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,...a})=>u.default.createElement(ec,{...a},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,...a})=>u.default.createElement(ae.Header,null,u.default.createElement(oc,{...a},u.default.createElement(D,{css:{alignItems:"center"}},e),u.default.createElement(rc,{is:v.ChevronDown,size:"sm"}))),ic=({children:e})=>{let a=!1;return u.default.Children.forEach(e,o=>{var r;P.isValidElement(o)&&((r=o.props)==null?void 0:r.value)&&(a=!0)}),u.default.createElement(w,{css:{flexGrow:1,width:"100%",overflowY:"auto"}},a?u.default.createElement(Wo,{type:"single"},e):e)},lc=({appearance:e="simple",label:a="close",size:o="md",theme:r="neutral",...n})=>u.default.createElement(q.Close,{asChild:!0},u.default.createElement(N,{theme:r,appearance:e,size:o,label:a,...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:lt-1,"@allowMotion":{'&[data-state="open"]':{animation:`${At} 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:lt,"@allowMotion":{'&[data-state="open"]':{animation:`${Br} 250ms ease-out`},'&[data-state="closed"]':{animation:`${Or} 250ms ease-out`}}}),dc=({children:e,...a})=>u.default.createElement(q.Portal,null,u.default.createElement(sc,{"data-testid":"sidedrawer_overlay"}),u.default.createElement(cc,{role:"navigation",...a},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:a="throttle"}={})=>{const[o,r]=P.useState({x:0,y:0}),n=P.useMemo(()=>{if(a==="throttle")return Ie.throttle;if(a==="debounce")return Ie.debounce},[a]);return P.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,...a},o)=>u.default.createElement(N,{size:"md",appearance:"simple",theme:"neutral",ref:o,...a},u.default.createElement(b,{is:e}))),wt=({src:e,alt:a="Atom Learning logo",css:o})=>u.default.createElement(We,{className:"topbar-brand-logo",src:e,alt:a,css:{mr:"$3",mb:"5px",...o}});wt.toString=()=>".topbar-brand-logo";const hc=l(A,{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",[`& ${wt}`]:{'&[src$=".svg"]':{height:24,width:"auto"}}},lg:{height:"$7",[`& ${wt}`]:{'&[src$=".svg"]':{height:32,width:"auto"}}}}}}),bc=l(D,{alignItems:"center",height:"$4",mx:"$4",width:"100%","@md":{mx:"$5"}}),he=({size:e="md",...a})=>{const{y:o}=uc();return u.default.createElement($c,{hasScrolled:!!o,size:e},u.default.createElement(bc,{...a}))};he.Brand=gc,he.BrandLogo=wt,he.BrandName=hc,he.ActionIcon=pc,he.Divider=fc,he.displayName="TopBar";const vc=l("header",{"> div":{width:"100%"}}),yc=({children:e,...a})=>u.default.createElement(vc,{...a},u.default.createElement(he,{css:{mx:"$3"}},e)),xc=l("a",pa),wc=l("button",pa),Ec=({active:e,children:a,disabled:o,href:r,onClick:n,...i})=>r?u.default.createElement(xc,{active:e,href:r,onClick:n,...i},a):u.default.createElement(wc,{active:e,disabled:o,onClick:n,...i},a),Cc=l(q.Trigger,{}),Z=({children:e,...a})=>u.default.createElement(zr.Root,{...a},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%"}),Bo=(e,a,o)=>(e-a)/(o-a)*100,kc=(e,a,o)=>{const r=Bo(e,a,o);return r<=10?0:r>=90?100:50},Dc=({min:e,max:a,steps:o=[]})=>o.length===0?null:t.createElement(Sc,null,o.map(r=>t.createElement(A,{as:"span",key:r.value,css:{position:"absolute",color:"$tonal300"},style:{left:`${Bo(r.value,e,a)}%`,transform:`translateX(-${kc(r.value,e,a)}%)`}},r.label))),zc=({value:e=[],outputLabel:a=o=>`Current value is ${o}`})=>t.createElement(A,{css:{mt:"$4",color:"$tonal300",width:"100%"}},a(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=t.forwardRef(({value:e,defaultValue:a,min:o=0,max:r=100,theme:n="tonal",css:i,children:s,...c},d)=>{const m=e||a;return t.createElement(Ne,{css:i},t.createElement(Ic,{theme:n,defaultValue:a,value:e,min:o,max:r,ref:d,...c},t.createElement(ha,null,t.createElement(Tc,null)),(m==null?void 0:m.length)&&m.map((p,g)=>t.createElement(Rc,{key:`thumb${g}`}))),s)});Ce.Value=zc,Ce.Steps=Dc,Ce.displayName="Slider";const Oo=({css:e,label:a,name:o,defaultValue:r,value:n,validation:i,outputLabel:s,min:c=0,max:d=100,steps:m=[],...p})=>{const{control:g}=V.useFormContext(),{field:{ref:h,onChange:f,value:$,name:y}}=V.useController({name:o,control:g,rules:i,defaultValue:r});return u.default.useEffect(()=>{n!=null&&n.length&&f(n)},[JSON.stringify(n)]),u.default.createElement(te,{css:e,fieldId:o,label:a},u.default.createElement(Ce,{ref:h,name:y,onValueChange:f,value:$,min:c,max:d,...p},u.default.createElement(Ce.Steps,{min:c,max:d,steps:m}),u.default.createElement(Ce.Value,{value:$,outputLabel:s})))};Oo.displayName="SliderField";const Ho=t.createContext({steps:[],goToPreviousStep:()=>null,goToNextStep:()=>null,goToStep:()=>null,activeStep:0,viewedSteps:[],allowSkip:!1,direction:"horizontal",hideLabels:!1,completedSteps:[],showCompletedIcons:!1}),Fc=({children:e,stepCount:a,allowSkip:o,onComplete:r,onStepChange:n,direction:i,steps:s,hideLabels:c,showCompletedIcons:d})=>{const[m,p]=t.useState(0),[g,h]=t.useState([0]),[f,$]=t.useState([]),y=!a;t.useEffect(()=>{h(x=>x.includes(m)?x:[...x,m]),n==null||n(m)},[m,n]);const O=()=>{const x=r&&m===a-1,C=m<a-1;if((r||C)&&$(E=>E.includes(m)?E:[...E,m]),x)return r==null?void 0:r();if(C)return p(E=>E+1)},I=()=>{p(x=>x-1)},M=x=>{p(x)};return t.createElement(Ho.Provider,{value:{steps:s||Array(a).fill(""),goToPreviousStep:y?void 0:I,goToNextStep:y?void 0:O,goToStep:y?void 0:M,activeStep:m,viewedSteps:g,completedSteps:f,allowSkip:o,direction:i,hideLabels:c,showCompletedIcons:d}},e)},ga=()=>{const e=t.useContext(Ho);if(!e)throw new Error("Ensure that you wrap any components with the root component Stepper");return e},Nc=({label:e,children:a,...o})=>{const{activeStep:r,goToPreviousStep:n}=ga();return t.createElement(ne,{size:"sm",appearance:"outline",...o,disabled:r===0,onClick:n},a||(e==null?void 0:e(r)))},Mc=({label:e,children:a,onClick:o,...r})=>{const{goToNextStep:n,activeStep:i}=ga();return t.createElement(ne,{size:"sm",...r,onClick:()=>{if(o)return o(n);n==null||n()},css:{ml:"auto"}},a||(e==null?void 0:e(i)))},Ac=l(D,{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(D,{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(A,{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(D,{justifyContent:"space-between",variants:{direction:{vertical:{flexDirection:"column"},horizontal:{flexDirection:"row"}}}}),Bc=({css:e})=>{const{steps:a,goToStep:o,activeStep:r,viewedSteps:n,allowSkip:i,direction:s,hideLabels:c,completedSteps:d,showCompletedIcons:m}=ga(),p=h=>{const f=a[h];return f.status?f.status:d.length===a.length?B.SUCCESS:r===h&&d.includes(r)?B.REVIEWED:r===h?B.ACTIVE:d.includes(h)?B.COMPLETED:n.includes(h)?B.VIEWED:B.DEFAULT},g=h=>{var f;const $=(f=a[h])==null?void 0:f.status;return d.length===a.length||$===B.SUCCESS?B.SUCCESS:$===B.COMPLETED||h<Math.max(...n)?B.ACTIVE:$===B.VIEWED?B.VIEWED:B.DEFAULT};return t.createElement(Wc,{css:e,direction:s},a.map((h,f)=>{const $=p(f),y=g(f);return t.createElement(Lc,{tabIndex:0,key:`step_${f}`,direction:s,separator:y,status:$,css:s==="horizontal"?{width:`calc(100% / ${a.length})`}:{height:`calc(100% / ${a.length})`},canInteract:i},t.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":h.label?"":`step ${f+1}`,"aria-labelledby":h.label?`step-${f}`:void 0,css:{cursor:i&&n.includes(f)?"pointer":"auto"}},h.status===B.SUCCESS||m&&$===B.COMPLETED?t.createElement(b,{is:v.Ok}):f+1),h.label&&!c&&t.createElement(Pc,{as:"span",id:`step-${f}`,direction:s,status:$},h.label))}))},Ze=({children:e,stepCount:a,allowSkip:o,onComplete:r,onStepChange:n,direction:i="horizontal",steps:s,hideLabels:c=!1,showCompletedIcons:d=!1,css:m})=>{Re.default(!(a&&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)||a||0;return t.createElement(Fc,{stepCount:p,allowSkip:o,onComplete:r,onStepChange:a?n:void 0,direction:i,steps:s||Array(p).fill(""),hideLabels:c,showCompletedIcons:d},t.createElement(w,{"aria-label":"progress",css:{width:"100%",...m}},e))};Ze.StepBack=Nc,Ze.StepForward=Mc,Ze.Steps=Bc,Ze.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))"}}),Vo=e=>t.createElement(Oc,{...e},t.createElement(Hc,null));Vo.displayName="Switch";const Vc=l(at.Content,{flexGrow:1,fontFamily:"$body"}),_o=Vc;_o.displayName="TabsContent";const _c=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()}}}),qo=({children:e,...a})=>t.createElement(_c,{asChild:!0,...a},t.createElement(A,{size:"sm",as:"button"},e));qo.displayName="TabsTrigger";const qc=({element:e,delay:a=500,delayMethod:o="throttle"})=>{const[r,n]=P.useState({left:0,top:0}),i=P.useMemo(()=>{if(o==="throttle")return Ie.throttle;if(o==="debounce")return Ie.debounce},[o]);return P.useEffect(()=>{if(!e)return;const s=i(a,()=>{n({left:e.scrollLeft,top:e.scrollTop})});return e.addEventListener("scroll",s),()=>{e.removeEventListener("scroll",s)}},[e,i,a]),r},Gc=e=>{try{return new ResizeObserver(e)}catch{return null}},jc=({delay:e=500,elements:a,onResize:o})=>{const r=t.useMemo(()=>Gc(Ie.debounce(e,o)),[e,o]);return t.useEffect(()=>(a.forEach(n=>{n&&(r==null||r.observe(n))}),()=>{a.forEach(n=>n&&(r==null?void 0:r.unobserve(n)))}),[r,a]),r},Yc=({element:e,delay:a=500})=>{const[o,r]=P.useState({width:void 0,height:void 0}),n=P.useCallback(()=>{r({width:e==null?void 0:e.clientWidth,height:e==null?void 0:e.clientHeight})},[e]),i=P.useMemo(()=>[e],[e]);return jc({delay:a,elements:i,onResize:n}),o},Uc=l(it,{position:"relative",borderBottom:"1px solid $base3",width:"100%"}),Xc=l(at.List,{flexShrink:0,display:"flex",width:"100%",overflowX:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}),Go=l(N,{height:"100% !important",position:"absolute",top:"50%",transform:"translateY(-50%)",cursor:"pointer",background:"$background !important",color:"$interactive1 !important",borderRadius:0,opacity:.9}),jo=.8,Yo=({children:e,colorScheme:a={},...o})=>{const[r,n]=zl(),{width:i}=Yc({element:r,delay:500}),{left:s}=qc({element:r,delay:100,delayMethod:"debounce"}),c=u.default.useMemo(()=>r?r.scrollWidth>r.clientWidth:!1,[i,r]),d=u.default.useMemo(()=>c?s>0:!1,[s,c]),m=u.default.useMemo(()=>!r||!c?!1:r.scrollWidth-s-r.clientWidth>1,[r,s,c]),p=u.default.useCallback(g=>{!r||r.scroll({left:r.scrollLeft+r.clientWidth*g,behavior:"smooth"})},[r]);return u.default.createElement(Uc,{base:"slate",accent:"blue",interactive:"hiContrast1",...a,...o},d&&u.default.createElement(Go,{label:"scroll left",size:"md",css:{left:0},onClick:()=>p(-jo)},u.default.createElement(b,{is:v.ChevronLeft})),u.default.createElement(Xc,{ref:n},e),m&&u.default.createElement(Go,{label:"scroll right",size:"md",css:{right:0},onClick:()=>p(jo)},u.default.createElement(b,{is:v.ChevronRight})))};Yo.displayName="TabsTriggerList";const Jc=l(at.Root,{width:"100%"}),et=({children:e,...a})=>t.createElement(Jc,{...a},e);et.TriggerList=Yo,et.Trigger=qo,et.Content=_o,et.displayName="Tabs";const Kc=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=t.forwardRef((e,a)=>t.createElement(Kc,{...e,ref:a}));fa.displayName="Textarea";const Uo=({css:e=void 0,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=V.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return t.createElement(te,{css:e,description:i,error:d,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(fa,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Uo.displayName="TextareaField";const Xo=400,Qc=k({"0%":{transform:"translate3d(0,-100%,0)",opacity:0},"100%":{transform:"translate3d(0,0,0)",opacity:1}}),Zc=k({"0%":{transform:"translate3d(0,0,0)",opacity:1},"100%":{transform:"translate3d(0,-100%,0)",opacity:0}}),ed=l("div",{position:"absolute",width:"100%",variants:{visible:{true:{"@allowMotion":{animation:`${Qc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}},false:{opacity:0,"@allowMotion":{animation:`${Zc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}}}}}),td=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"}}}}),ad=t.memo(({ariaLive:e,height:a,id:o,message:r,role:n,type:i="blank",visible:s,calculateOffset:c,updateHeight:d})=>{const m=c(o,{reverseOrder:!0,margin:8});return t.createElement(ed,{visible:s},t.createElement(td,{ref:p=>{p&&a===void 0&&d(o,p.getBoundingClientRect().height)},status:i,role:n,"aria-live":e,style:{transform:`translateY(${m}px)`}},i==="error"&&t.createElement(b,{size:"sm",css:{mr:"$3",flex:"0 0 auto"},is:v.Error}),t.createElement(A,null,r),i==="loading"?t.createElement(st,{css:{flex:"0 0 auto",ml:"auto"}}):t.createElement(N,{css:{position:"absolute",top:"$2",right:"$2",color:"white","&:hover,&:focus":{color:"white",opacity:.5}},label:"Close alert",onClick:()=>kt.toast.dismiss(o)},t.createElement(b,{is:v.Close}))))}),od=l("div",{left:"$2",position:"fixed",top:"$2",right:"$2",zIndex:lt,"@sm":{top:"$3",right:"auto",left:`calc(50% - ${Xo/2}px)`}}),Jo=({children:e})=>{const{toasts:a,handlers:o}=kt.useToaster(),{startPause:r,endPause:n,calculateOffset:i,updateHeight:s}=o;return t.createElement(t.Fragment,null,t.createElement(od,{onMouseEnter:r,onMouseLeave:n},a.map(c=>t.createElement(ad,{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"}}),rd=Se,Et={sm:"32px",md:"40px",lg:"48px"},nd={sm:"$4",md:"$5",lg:"$5"},id={sm:"$2",md:"$3",lg:"$3"},$a=e=>({fontSize:`$${e}`,px:nd[e],minHeight:Et[e],"& > *:not(:last-child)":{mr:id[e]}}),ld=l(Se,{flexGrow:1,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,lineHeight:1,py:"$1",[`& ${Ia}`]:{flexShrink:0},variants:{size:{sm:$a("sm"),md:$a("md"),lg:$a("lg")},isIconOnly:{true:{}}},compoundVariants:[{isIconOnly:!0,size:"sm",css:{minWidth:Et.sm,p:0}},{isIconOnly:!0,size:"md",css:{minWidth:Et.md,p:0}},{isIconOnly:!0,size:"lg",css:{minWidth:Et.lg,p:0}}]}),sd=t.forwardRef(({size:e="md",children:a,...o},r)=>{var n;const i=t.Children.toArray(a),s=i.length<=1,c=s&&t.isValidElement(i[0])&&((n=i[0])==null?void 0:n.type)===b;return t.createElement(ld,{ref:r,size:e,isIconOnly:c,...o},i.map(d=>!s&&(typeof d=="string"||typeof d=="number")?t.createElement("span",{key:d},d):t.isValidElement(d)&&(d==null?void 0:d.type)===b?t.cloneElement(d,{...d.props,size:e}):d))}),cd=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"}}}}]}),dd=e=>e==="horizontal"?"row":"column",md=t.forwardRef(({orientation:e="horizontal",gap:a=!1,isFullWidth:o,children:r,wrap:n="no-wrap",...i},s)=>{const c=typeof a=="number",d=dd(e);return t.createElement(cd,{ref:s,direction:d,hasGap:c,isFullWidth:o,orientation:e,...i},t.createElement(Pe,{direction:d,gap:c&&a,align:!1,wrap:n},r))}),ud={Item:rd,Button:sd,Root:md},pd=l(Nr.default,{}),Ko=t.forwardRef(({id:e,ratio:a=9/16,css:o,...r},n)=>t.createElement(Ne,{css:o},t.createElement(w,{css:{borderRadius:"$0",position:"relative",paddingTop:`${a*100}%`,overflow:"hidden",height:0,width:"100%"}},t.createElement(pd,{...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=je,exports.ActionIcon=N,exports.AlertDialog=j,exports.AlertProvider=Un,exports.Avatar=Be,exports.Badge=Wa,exports.Box=w,exports.Button=ne,exports.Carousel=ve,exports.Checkbox=dt,exports.CheckboxField=Ya,exports.Chip=de,exports.ChipDismissibleGroup=Jt,exports.ChipGroup=Ut,exports.ChipToggleGroup=Kt,exports.ColorScheme=it,exports.Combobox=xe,exports.DataTable=W,exports.DateField=po,exports.DateInput=aa,exports.Dialog=ue,exports.Dismissible=ft,exports.DismissibleGroup=ye,exports.Divider=Gt,exports.DropdownMenu=Ee,exports.EmptyState=Qe,exports.FieldWrapper=te,exports.FileInput=yo,exports.Flex=D,exports.Form=ja,exports.Grid=xo,exports.Heading=ct,exports.Icon=b,exports.Image=We,exports.InlineFieldWrapper=gt,exports.InlineMessage=mt,exports.Input=we,exports.InputField=wo,exports.Label=Oe,exports.Link=pt,exports.List=ut,exports.Loader=st,exports.MarkdownContent=Eo,exports.NavigationMenu=pe,exports.NotificationBadge=Vs,exports.NumberInput=da,exports.NumberInputField=Ro,exports.PasswordField=Fo,exports.PasswordInput=ma,exports.Popover=le,exports.ProgressBar=No,exports.RadioButton=ht,exports.RadioButtonField=ua,exports.RadioButtonGroup=Yt,exports.RadioCard=Ao,exports.RadioCardGroup=Ks,exports.SearchField=Lo,exports.SearchInput=vt,exports.Select=yt,exports.SelectField=Po,exports.Sidedrawer=Z,exports.Slider=Ce,exports.SliderField=Oo,exports.Stack=Pe,exports.StackContent=na,exports.Stepper=Ze,exports.StyledButton=Ra,exports.StyledLink=_a,exports.Switch=Vo,exports.Table=z,exports.Tabs=et,exports.Text=A,exports.Textarea=fa,exports.TextareaField=Uo,exports.ToastProvider=Jo,exports.ToggleGroup=ud,exports.Tooltip=X,exports.TopBar=he,exports.Video=Ko,exports.createTheme=Pr,exports.createThemeVariants=Tt,exports.css=Ar,exports.focusVisibleStyleBlock=be,exports.getCssText=Lr,exports.globalCss=Ca,exports.keyframes=k,exports.media=It,exports.styled=l,exports.theme=G,exports.useAlert=Xn,exports.useCarousel=hi,exports.useDataTable=K,exports.utils=zt;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|