UNPKG

@devopness/ui-react

Version:

Devopness Design System React Components - Painless essential DevOps to everyone

51 lines (41 loc) 233 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),B=require("react"),te=require("./floating-ui.dom-D_p-Q3wm.cjs"),Un=require("react-dom");function Na(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const n=Na(B),Rr=Na(Un);function Yo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ve(...e){return t=>{let r=!1;const o=e.map(a=>{const s=Yo(a,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let a=0;a<o.length;a++){const s=o[a];typeof s=="function"?s():Yo(e[a],null)}}}}function $(...e){return n.useCallback(ve(...e),e)}function Vp(e){const t=Gp(e),r=n.forwardRef((o,a)=>{const{children:s,...i}=o,c=n.Children.toArray(s),l=c.find(Hp);if(l){const f=l.props.children,d=c.map(p=>p===l?n.Children.count(f)>1?n.Children.only(null):n.isValidElement(f)?f.props.children:null:p);return u.jsx(t,{...i,ref:a,children:n.isValidElement(f)?n.cloneElement(f,void 0,d):null})}return u.jsx(t,{...i,ref:a,children:s})});return r.displayName=`${e}.Slot`,r}function Gp(e){const t=n.forwardRef((r,o)=>{const{children:a,...s}=r;if(n.isValidElement(a)){const i=Up(a),c=Wp(s,a.props);return a.type!==n.Fragment&&(c.ref=o?ve(o,i):i),n.cloneElement(a,c)}return n.Children.count(a)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zp=Symbol("radix.slottable");function Hp(e){return n.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zp}function Wp(e,t){const r={...t};for(const o in t){const a=e[o],s=t[o];/^on[A-Z]/.test(o)?a&&s?r[o]=(...c)=>{const l=s(...c);return a(...c),l}:a&&(r[o]=a):o==="style"?r[o]={...a,...s}:o==="className"&&(r[o]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}function Up(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Kp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],P=Kp.reduce((e,t)=>{const r=Vp(`Primitive.${t}`),o=n.forwardRef((a,s)=>{const{asChild:i,...c}=a,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Dt(e,t){e&&Rr.flushSync(()=>e.dispatchEvent(t))}var Ra=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Yp="VisuallyHidden",Pa=n.forwardRef((e,t)=>u.jsx(P.span,{...e,ref:t,style:{...Ra,...e.style}}));Pa.displayName=Yp;var Kn=Pa;function Xp(e,t){const r=n.createContext(t),o=s=>{const{children:i,...c}=s,l=n.useMemo(()=>c,Object.values(c));return u.jsx(r.Provider,{value:l,children:i})};o.displayName=e+"Provider";function a(s){const i=n.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[o,a]}function U(e,t=[]){let r=[];function o(s,i){const c=n.createContext(i),l=r.length;r=[...r,i];const f=p=>{const{scope:m,children:h,...g}=p,v=m?.[e]?.[l]||c,C=n.useMemo(()=>g,Object.values(g));return u.jsx(v.Provider,{value:C,children:h})};f.displayName=s+"Provider";function d(p,m){const h=m?.[e]?.[l]||c,g=n.useContext(h);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[f,d]}const a=()=>{const s=r.map(i=>n.createContext(i));return function(c){const l=c?.[e]||s;return n.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return a.scopeName=e,[o,qp(a,...t)]}function qp(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(s){const i=o.reduce((c,{useScope:l,scopeName:f})=>{const p=l(s)[`__scope${f}`];return{...c,...p}},{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function Xo(e){const t=Zp(e),r=n.forwardRef((o,a)=>{const{children:s,...i}=o,c=n.Children.toArray(s),l=c.find(Jp);if(l){const f=l.props.children,d=c.map(p=>p===l?n.Children.count(f)>1?n.Children.only(null):n.isValidElement(f)?f.props.children:null:p);return u.jsx(t,{...i,ref:a,children:n.isValidElement(f)?n.cloneElement(f,void 0,d):null})}return u.jsx(t,{...i,ref:a,children:s})});return r.displayName=`${e}.Slot`,r}function Zp(e){const t=n.forwardRef((r,o)=>{const{children:a,...s}=r;if(n.isValidElement(a)){const i=tm(a),c=em(s,a.props);return a.type!==n.Fragment&&(c.ref=o?ve(o,i):i),n.cloneElement(a,c)}return n.Children.count(a)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qp=Symbol("radix.slottable");function Jp(e){return n.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qp}function em(e,t){const r={...t};for(const o in t){const a=e[o],s=t[o];/^on[A-Z]/.test(o)?a&&s?r[o]=(...c)=>{const l=s(...c);return a(...c),l}:a&&(r[o]=a):o==="style"?r[o]={...a,...s}:o==="className"&&(r[o]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}function tm(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Ct(e){const t=e+"CollectionProvider",[r,o]=U(t),[a,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:C,children:y}=v,b=B.useRef(null),w=B.useRef(new Map).current;return u.jsx(a,{scope:C,itemMap:w,collectionRef:b,children:y})};i.displayName=t;const c=e+"CollectionSlot",l=Xo(c),f=B.forwardRef((v,C)=>{const{scope:y,children:b}=v,w=s(c,y),x=$(C,w.collectionRef);return u.jsx(l,{ref:x,children:b})});f.displayName=c;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=Xo(d),h=B.forwardRef((v,C)=>{const{scope:y,children:b,...w}=v,x=B.useRef(null),N=$(C,x),_=s(d,y);return B.useEffect(()=>(_.itemMap.set(x,{ref:x,...w}),()=>{_.itemMap.delete(x)})),u.jsx(m,{[p]:"",ref:N,children:b})});h.displayName=d;function g(v){const C=s(e+"CollectionConsumer",v);return B.useCallback(()=>{const b=C.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${p}]`));return Array.from(C.itemMap.values()).sort((_,R)=>w.indexOf(_.ref.current)-w.indexOf(R.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:i,Slot:f,ItemSlot:h},g,o]}function S(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),r===!1||!a.defaultPrevented)return t?.(a)}}var J=globalThis?.document?n.useLayoutEffect:()=>{},rm=n[" useInsertionEffect ".trim().toString()]||J;function ee({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[a,s,i]=nm({defaultProp:t,onChange:r}),c=e!==void 0,l=c?e:a;{const d=n.useRef(e!==void 0);n.useEffect(()=>{const p=d.current;p!==c&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=c},[c,o])}const f=n.useCallback(d=>{if(c){const p=om(d)?d(e):d;p!==e&&i.current?.(p)}else s(d)},[c,e,s,i]);return[l,f]}function nm({defaultProp:e,onChange:t}){const[r,o]=n.useState(e),a=n.useRef(r),s=n.useRef(t);return rm(()=>{s.current=t},[t]),n.useEffect(()=>{a.current!==r&&(s.current?.(r),a.current=r)},[r,a]),[r,o,s]}function om(e){return typeof e=="function"}function am(e,t){return n.useReducer((r,o)=>t[r][o]??r,e)}var X=e=>{const{present:t,children:r}=e,o=sm(t),a=typeof r=="function"?r({present:o.isPresent}):n.Children.only(r),s=$(o.ref,im(a));return typeof r=="function"||o.isPresent?n.cloneElement(a,{ref:s}):null};X.displayName="Presence";function sm(e){const[t,r]=n.useState(),o=n.useRef(null),a=n.useRef(e),s=n.useRef("none"),i=e?"mounted":"unmounted",[c,l]=am(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect(()=>{const f=rr(o.current);s.current=c==="mounted"?f:"none"},[c]),J(()=>{const f=o.current,d=a.current;if(d!==e){const m=s.current,h=rr(f);e?l("MOUNT"):h==="none"||f?.display==="none"?l("UNMOUNT"):l(d&&m!==h?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,l]),J(()=>{if(t){let f;const d=t.ownerDocument.defaultView??window,p=h=>{const v=rr(o.current).includes(CSS.escape(h.animationName));if(h.target===t&&v&&(l("ANIMATION_END"),!a.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},m=h=>{h.target===t&&(s.current=rr(o.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(f),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:n.useCallback(f=>{o.current=f?getComputedStyle(f):null,r(f)},[])}}function rr(e){return e?.animationName||"none"}function im(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var cm=n[" useId ".trim().toString()]||(()=>{}),lm=0;function ce(e){const[t,r]=n.useState(cm());return J(()=>{r(o=>o??String(lm++))},[e]),e||(t?`radix-${t}`:"")}var _a=n.createContext(void 0),Ta=e=>{const{dir:t,children:r}=e;return u.jsx(_a.Provider,{value:t,children:r})};function _e(e){const t=n.useContext(_a);return e||t||"ltr"}var Ma=Ta;const um=Object.freeze(Object.defineProperty({__proto__:null,DirectionProvider:Ta,Provider:Ma,useDirection:_e},Symbol.toStringTag,{value:"Module"}));function W(e){const t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>(...r)=>t.current?.(...r),[])}function dm(e,t=globalThis?.document){const r=W(e);n.useEffect(()=>{const o=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var fm="DismissableLayer",Sn="dismissableLayer.update",pm="dismissableLayer.pointerDownOutside",mm="dismissableLayer.focusOutside",qo,Ia=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Be=n.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:i,onDismiss:c,...l}=e,f=n.useContext(Ia),[d,p]=n.useState(null),m=d?.ownerDocument??globalThis?.document,[,h]=n.useState({}),g=$(t,R=>p(R)),v=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(C),b=d?v.indexOf(d):-1,w=f.layersWithOutsidePointerEventsDisabled.size>0,x=b>=y,N=gm(R=>{const D=R.target,T=[...f.branches].some(O=>O.contains(D));!x||T||(a?.(R),i?.(R),R.defaultPrevented||c?.())},m),_=Cm(R=>{const D=R.target;[...f.branches].some(O=>O.contains(D))||(s?.(R),i?.(R),R.defaultPrevented||c?.())},m);return dm(R=>{b===f.layers.size-1&&(o?.(R),!R.defaultPrevented&&c&&(R.preventDefault(),c()))},m),n.useEffect(()=>{if(d)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(qo=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(d)),f.layers.add(d),Zo(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=qo)}},[d,m,r,f]),n.useEffect(()=>()=>{d&&(f.layers.delete(d),f.layersWithOutsidePointerEventsDisabled.delete(d),Zo())},[d,f]),n.useEffect(()=>{const R=()=>h({});return document.addEventListener(Sn,R),()=>document.removeEventListener(Sn,R)},[]),u.jsx(P.div,{...l,ref:g,style:{pointerEvents:w?x?"auto":"none":void 0,...e.style},onFocusCapture:S(e.onFocusCapture,_.onFocusCapture),onBlurCapture:S(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:S(e.onPointerDownCapture,N.onPointerDownCapture)})});Be.displayName=fm;var vm="DismissableLayerBranch",hm=n.forwardRef((e,t)=>{const r=n.useContext(Ia),o=n.useRef(null),a=$(t,o);return n.useEffect(()=>{const s=o.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),u.jsx(P.div,{...e,ref:a})});hm.displayName=vm;function gm(e,t=globalThis?.document){const r=W(e),o=n.useRef(!1),a=n.useRef(()=>{});return n.useEffect(()=>{const s=c=>{if(c.target&&!o.current){let l=function(){Aa(pm,r,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=l,t.addEventListener("click",a.current,{once:!0})):l()}else t.removeEventListener("click",a.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function Cm(e,t=globalThis?.document){const r=W(e),o=n.useRef(!1);return n.useEffect(()=>{const a=s=>{s.target&&!o.current&&Aa(mm,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Zo(){const e=new CustomEvent(Sn);document.dispatchEvent(e)}function Aa(e,t,r,{discrete:o}){const a=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?Dt(a,s):a.dispatchEvent(s)}var sn="focusScope.autoFocusOnMount",cn="focusScope.autoFocusOnUnmount",Qo={bubbles:!1,cancelable:!0},ym="FocusScope",Gt=n.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...i}=e,[c,l]=n.useState(null),f=W(a),d=W(s),p=n.useRef(null),m=$(t,v=>l(v)),h=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect(()=>{if(o){let v=function(w){if(h.paused||!c)return;const x=w.target;c.contains(x)?p.current=x:je(p.current,{select:!0})},C=function(w){if(h.paused||!c)return;const x=w.relatedTarget;x!==null&&(c.contains(x)||je(p.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const N of w)N.removedNodes.length>0&&je(c)};document.addEventListener("focusin",v),document.addEventListener("focusout",C);const b=new MutationObserver(y);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",C),b.disconnect()}}},[o,c,h.paused]),n.useEffect(()=>{if(c){ea.add(h);const v=document.activeElement;if(!c.contains(v)){const y=new CustomEvent(sn,Qo);c.addEventListener(sn,f),c.dispatchEvent(y),y.defaultPrevented||(wm(Nm($a(c)),{select:!0}),document.activeElement===v&&je(c))}return()=>{c.removeEventListener(sn,f),setTimeout(()=>{const y=new CustomEvent(cn,Qo);c.addEventListener(cn,d),c.dispatchEvent(y),y.defaultPrevented||je(v??document.body,{select:!0}),c.removeEventListener(cn,d),ea.remove(h)},0)}}},[c,f,d,h]);const g=n.useCallback(v=>{if(!r&&!o||h.paused)return;const C=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(C&&y){const b=v.currentTarget,[w,x]=bm(b);w&&x?!v.shiftKey&&y===x?(v.preventDefault(),r&&je(w,{select:!0})):v.shiftKey&&y===w&&(v.preventDefault(),r&&je(x,{select:!0})):y===b&&v.preventDefault()}},[r,o,h.paused]);return u.jsx(P.div,{tabIndex:-1,...i,ref:m,onKeyDown:g})});Gt.displayName=ym;function wm(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(je(o,{select:t}),document.activeElement!==r)return}function bm(e){const t=$a(e),r=Jo(t,e),o=Jo(t.reverse(),e);return[r,o]}function $a(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Jo(e,t){for(const r of e)if(!xm(r,{upTo:t}))return r}function xm(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Sm(e){return e instanceof HTMLInputElement&&"select"in e}function je(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Sm(e)&&t&&e.select()}}var ea=Em();function Em(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=ta(e,t),e.unshift(t)},remove(t){e=ta(e,t),e[0]?.resume()}}}function ta(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function Nm(e){return e.filter(t=>t.tagName!=="A")}var Rm="Portal",Ve=n.forwardRef((e,t)=>{const{container:r,...o}=e,[a,s]=n.useState(!1);J(()=>s(!0),[]);const i=r||a&&globalThis?.document?.body;return i?Un.createPortal(u.jsx(P.div,{...o,ref:t}),i):null});Ve.displayName=Rm;var Pm=Ve,ln=0;function Pr(){n.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ra()),document.body.insertAdjacentElement("beforeend",e[1]??ra()),ln++,()=>{ln===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ln--}},[])}function ra(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var lr="right-scroll-bar-position",ur="width-before-scroll-bar",_m="with-scroll-bars-hidden",Tm="--removed-body-scroll-bar-size";function un(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Mm(e,t){var r=B.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var a=r.value;a!==o&&(r.value=o,r.callback(o,a))}}}})[0];return r.callback=t,r.facade}var Im=typeof window<"u"?n.useLayoutEffect:n.useEffect,na=new WeakMap;function Am(e,t){var r=Mm(null,function(o){return e.forEach(function(a){return un(a,o)})});return Im(function(){var o=na.get(r);if(o){var a=new Set(o),s=new Set(e),i=r.current;a.forEach(function(c){s.has(c)||un(c,null)}),s.forEach(function(c){a.has(c)||un(c,i)})}na.set(r,e)},[e]),r}function $m(e){return e}function Dm(e,t){t===void 0&&(t=$m);var r=[],o=!1,a={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var i=t(s,o);return r.push(i),function(){r=r.filter(function(c){return c!==i})}},assignSyncMedium:function(s){for(o=!0;r.length;){var i=r;r=[],i.forEach(s)}r={push:function(c){return s(c)},filter:function(){return r}}},assignMedium:function(s){o=!0;var i=[];if(r.length){var c=r;r=[],c.forEach(s),i=r}var l=function(){var d=i;i=[],d.forEach(s)},f=function(){return Promise.resolve().then(l)};f(),r={push:function(d){i.push(d),f()},filter:function(d){return i=i.filter(d),r}}}};return a}function Om(e){e===void 0&&(e={});var t=Dm(null);return t.options=te.__assign({async:!0,ssr:!1},e),t}var Da=function(e){var t=e.sideCar,r=te.__rest(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return n.createElement(o,te.__assign({},r))};Da.isSideCarExport=!0;function km(e,t){return e.useMedium(t),Da}var Oa=Om(),dn=function(){},_r=n.forwardRef(function(e,t){var r=n.useRef(null),o=n.useState({onScrollCapture:dn,onWheelCapture:dn,onTouchMoveCapture:dn}),a=o[0],s=o[1],i=e.forwardProps,c=e.children,l=e.className,f=e.removeScrollBar,d=e.enabled,p=e.shards,m=e.sideCar,h=e.noRelative,g=e.noIsolation,v=e.inert,C=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,w=e.gapMode,x=te.__rest(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=m,_=Am([r,t]),R=te.__assign(te.__assign({},x),a);return n.createElement(n.Fragment,null,d&&n.createElement(N,{sideCar:Oa,removeScrollBar:f,shards:p,noRelative:h,noIsolation:g,inert:v,setCallbacks:s,allowPinchZoom:!!C,lockRef:r,gapMode:w}),i?n.cloneElement(n.Children.only(c),te.__assign(te.__assign({},R),{ref:_})):n.createElement(b,te.__assign({},R,{className:l,ref:_}),c))});_r.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_r.classNames={fullWidth:ur,zeroRight:lr};var jm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Lm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=jm();return t&&e.setAttribute("nonce",t),e}function Fm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Bm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Vm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Lm())&&(Fm(t,r),Bm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Gm=function(){var e=Vm();return function(t,r){n.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},ka=function(){var e=Gm(),t=function(r){var o=r.styles,a=r.dynamic;return e(o,a),null};return t},zm={left:0,top:0,right:0,gap:0},fn=function(e){return parseInt(e||"",10)||0},Hm=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[fn(r),fn(o),fn(a)]},Wm=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zm;var t=Hm(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},Um=ka(),dt="data-scroll-locked",Km=function(e,t,r,o){var a=e.left,s=e.top,i=e.right,c=e.gap;return r===void 0&&(r="margin"),` .`.concat(_m,` { overflow: hidden `).concat(o,`; padding-right: `).concat(c,"px ").concat(o,`; } body[`).concat(dt,`] { overflow: hidden `).concat(o,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(o,";"),r==="margin"&&` padding-left: `.concat(a,`px; padding-top: `).concat(s,`px; padding-right: `).concat(i,`px; margin-left:0; margin-top:0; margin-right: `).concat(c,"px ").concat(o,`; `),r==="padding"&&"padding-right: ".concat(c,"px ").concat(o,";")].filter(Boolean).join(""),` } .`).concat(lr,` { right: `).concat(c,"px ").concat(o,`; } .`).concat(ur,` { margin-right: `).concat(c,"px ").concat(o,`; } .`).concat(lr," .").concat(lr,` { right: 0 `).concat(o,`; } .`).concat(ur," .").concat(ur,` { margin-right: 0 `).concat(o,`; } body[`).concat(dt,`] { `).concat(Tm,": ").concat(c,`px; } `)},oa=function(){var e=parseInt(document.body.getAttribute(dt)||"0",10);return isFinite(e)?e:0},Ym=function(){n.useEffect(function(){return document.body.setAttribute(dt,(oa()+1).toString()),function(){var e=oa()-1;e<=0?document.body.removeAttribute(dt):document.body.setAttribute(dt,e.toString())}},[])},Xm=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o;Ym();var s=n.useMemo(function(){return Wm(a)},[a]);return n.createElement(Um,{styles:Km(s,!t,a,r?"":"!important")})},En=!1;if(typeof window<"u")try{var nr=Object.defineProperty({},"passive",{get:function(){return En=!0,!0}});window.addEventListener("test",nr,nr),window.removeEventListener("test",nr,nr)}catch{En=!1}var it=En?{passive:!1}:!1,qm=function(e){return e.tagName==="TEXTAREA"},ja=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!qm(e)&&r[t]==="visible")},Zm=function(e){return ja(e,"overflowY")},Qm=function(e){return ja(e,"overflowX")},aa=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var a=La(e,o);if(a){var s=Fa(e,o),i=s[1],c=s[2];if(i>c)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},Jm=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},ev=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},La=function(e,t){return e==="v"?Zm(t):Qm(t)},Fa=function(e,t){return e==="v"?Jm(t):ev(t)},tv=function(e,t){return e==="h"&&t==="rtl"?-1:1},rv=function(e,t,r,o,a){var s=tv(e,window.getComputedStyle(t).direction),i=s*o,c=r.target,l=t.contains(c),f=!1,d=i>0,p=0,m=0;do{if(!c)break;var h=Fa(e,c),g=h[0],v=h[1],C=h[2],y=v-C-s*g;(g||y)&&La(e,c)&&(p+=y,m+=g);var b=c.parentNode;c=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(d&&Math.abs(p)<1||!d&&Math.abs(m)<1)&&(f=!0),f},or=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sa=function(e){return[e.deltaX,e.deltaY]},ia=function(e){return e&&"current"in e?e.current:e},nv=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ov=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},av=0,ct=[];function sv(e){var t=n.useRef([]),r=n.useRef([0,0]),o=n.useRef(),a=n.useState(av++)[0],s=n.useState(ka)[0],i=n.useRef(e);n.useEffect(function(){i.current=e},[e]),n.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=te.__spreadArray([e.lockRef.current],(e.shards||[]).map(ia),!0).filter(Boolean);return v.forEach(function(C){return C.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=n.useCallback(function(v,C){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var y=or(v),b=r.current,w="deltaX"in v?v.deltaX:b[0]-y[0],x="deltaY"in v?v.deltaY:b[1]-y[1],N,_=v.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in v&&R==="h"&&_.type==="range")return!1;var D=window.getSelection(),T=D&&D.anchorNode,O=T?T===_||T.contains(_):!1;if(O)return!1;var k=aa(R,_);if(!k)return!0;if(k?N=R:(N=R==="v"?"h":"v",k=aa(R,_)),!k)return!1;if(!o.current&&"changedTouches"in v&&(w||x)&&(o.current=N),!N)return!0;var V=o.current||N;return rv(V,C,v,V==="h"?w:x)},[]),l=n.useCallback(function(v){var C=v;if(!(!ct.length||ct[ct.length-1]!==s)){var y="deltaY"in C?sa(C):or(C),b=t.current.filter(function(N){return N.name===C.type&&(N.target===C.target||C.target===N.shadowParent)&&nv(N.delta,y)})[0];if(b&&b.should){C.cancelable&&C.preventDefault();return}if(!b){var w=(i.current.shards||[]).map(ia).filter(Boolean).filter(function(N){return N.contains(C.target)}),x=w.length>0?c(C,w[0]):!i.current.noIsolation;x&&C.cancelable&&C.preventDefault()}}},[]),f=n.useCallback(function(v,C,y,b){var w={name:v,delta:C,target:y,should:b,shadowParent:iv(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(x){return x!==w})},1)},[]),d=n.useCallback(function(v){r.current=or(v),o.current=void 0},[]),p=n.useCallback(function(v){f(v.type,sa(v),v.target,c(v,e.lockRef.current))},[]),m=n.useCallback(function(v){f(v.type,or(v),v.target,c(v,e.lockRef.current))},[]);n.useEffect(function(){return ct.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,it),document.addEventListener("touchmove",l,it),document.addEventListener("touchstart",d,it),function(){ct=ct.filter(function(v){return v!==s}),document.removeEventListener("wheel",l,it),document.removeEventListener("touchmove",l,it),document.removeEventListener("touchstart",d,it)}},[]);var h=e.removeScrollBar,g=e.inert;return n.createElement(n.Fragment,null,g?n.createElement(s,{styles:ov(a)}):null,h?n.createElement(Xm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function iv(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const cv=km(Oa,sv);var zt=n.forwardRef(function(e,t){return n.createElement(_r,te.__assign({},e,{ref:t,sideCar:cv}))});zt.classNames=_r.classNames;var lv=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},lt=new WeakMap,ar=new WeakMap,sr={},pn=0,Ba=function(e){return e&&(e.host||Ba(e.parentNode))},uv=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=Ba(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},dv=function(e,t,r,o){var a=uv(t,Array.isArray(e)?e:[e]);sr[r]||(sr[r]=new WeakMap);var s=sr[r],i=[],c=new Set,l=new Set(a),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};a.forEach(f);var d=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(m){if(c.has(m))d(m);else try{var h=m.getAttribute(o),g=h!==null&&h!=="false",v=(lt.get(m)||0)+1,C=(s.get(m)||0)+1;lt.set(m,v),s.set(m,C),i.push(m),v===1&&g&&ar.set(m,!0),C===1&&m.setAttribute(r,"true"),g||m.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return d(t),c.clear(),pn++,function(){i.forEach(function(p){var m=lt.get(p)-1,h=s.get(p)-1;lt.set(p,m),s.set(p,h),m||(ar.has(p)||p.removeAttribute(o),ar.delete(p)),h||p.removeAttribute(r)}),pn--,pn||(lt=new WeakMap,lt=new WeakMap,ar=new WeakMap,sr={})}},Tr=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=lv(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live], script"))),dv(o,a,r,"aria-hidden")):function(){return null}};function fv(e){const t=pv(e),r=n.forwardRef((o,a)=>{const{children:s,...i}=o,c=n.Children.toArray(s),l=c.find(vv);if(l){const f=l.props.children,d=c.map(p=>p===l?n.Children.count(f)>1?n.Children.only(null):n.isValidElement(f)?f.props.children:null:p);return u.jsx(t,{...i,ref:a,children:n.isValidElement(f)?n.cloneElement(f,void 0,d):null})}return u.jsx(t,{...i,ref:a,children:s})});return r.displayName=`${e}.Slot`,r}function pv(e){const t=n.forwardRef((r,o)=>{const{children:a,...s}=r;if(n.isValidElement(a)){const i=gv(a),c=hv(s,a.props);return a.type!==n.Fragment&&(c.ref=o?ve(o,i):i),n.cloneElement(a,c)}return n.Children.count(a)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mv=Symbol("radix.slottable");function vv(e){return n.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mv}function hv(e,t){const r={...t};for(const o in t){const a=e[o],s=t[o];/^on[A-Z]/.test(o)?a&&s?r[o]=(...c)=>{const l=s(...c);return a(...c),l}:a&&(r[o]=a):o==="style"?r[o]={...a,...s}:o==="className"&&(r[o]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}function gv(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Mr="Dialog",[Va,Ga]=U(Mr),[Cv,Ee]=Va(Mr),za=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:a,onOpenChange:s,modal:i=!0}=e,c=n.useRef(null),l=n.useRef(null),[f,d]=ee({prop:o,defaultProp:a??!1,onChange:s,caller:Mr});return u.jsx(Cv,{scope:t,triggerRef:c,contentRef:l,contentId:ce(),titleId:ce(),descriptionId:ce(),open:f,onOpenChange:d,onOpenToggle:n.useCallback(()=>d(p=>!p),[d]),modal:i,children:r})};za.displayName=Mr;var Ha="DialogTrigger",Wa=n.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=Ee(Ha,r),s=$(t,a.triggerRef);return u.jsx(P.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":qn(a.open),...o,ref:s,onClick:S(e.onClick,a.onOpenToggle)})});Wa.displayName=Ha;var Yn="DialogPortal",[yv,Ua]=Va(Yn,{forceMount:void 0}),Ka=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:a}=e,s=Ee(Yn,t);return u.jsx(yv,{scope:t,forceMount:r,children:n.Children.map(o,i=>u.jsx(X,{present:r||s.open,children:u.jsx(Ve,{asChild:!0,container:a,children:i})}))})};Ka.displayName=Yn;var pr="DialogOverlay",Ya=n.forwardRef((e,t)=>{const r=Ua(pr,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,s=Ee(pr,e.__scopeDialog);return s.modal?u.jsx(X,{present:o||s.open,children:u.jsx(bv,{...a,ref:t})}):null});Ya.displayName=pr;var wv=fv("DialogOverlay.RemoveScroll"),bv=n.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=Ee(pr,r);return u.jsx(zt,{as:wv,allowPinchZoom:!0,shards:[a.contentRef],children:u.jsx(P.div,{"data-state":qn(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Je="DialogContent",Xa=n.forwardRef((e,t)=>{const r=Ua(Je,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,s=Ee(Je,e.__scopeDialog);return u.jsx(X,{present:o||s.open,children:s.modal?u.jsx(xv,{...a,ref:t}):u.jsx(Sv,{...a,ref:t})})});Xa.displayName=Je;var xv=n.forwardRef((e,t)=>{const r=Ee(Je,e.__scopeDialog),o=n.useRef(null),a=$(t,r.contentRef,o);return n.useEffect(()=>{const s=o.current;if(s)return Tr(s)},[]),u.jsx(qa,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:S(e.onCloseAutoFocus,s=>{s.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:S(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&s.preventDefault()}),onFocusOutside:S(e.onFocusOutside,s=>s.preventDefault())})}),Sv=n.forwardRef((e,t)=>{const r=Ee(Je,e.__scopeDialog),o=n.useRef(!1),a=n.useRef(!1);return u.jsx(qa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||r.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&a.current&&s.preventDefault()}})}),qa=n.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:s,...i}=e,c=Ee(Je,r),l=n.useRef(null),f=$(t,l);return Pr(),u.jsxs(u.Fragment,{children:[u.jsx(Gt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:s,children:u.jsx(Be,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":qn(c.open),...i,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(Nv,{titleId:c.titleId}),u.jsx(Pv,{contentRef:l,descriptionId:c.descriptionId})]})]})}),Xn="DialogTitle",Za=n.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=Ee(Xn,r);return u.jsx(P.h2,{id:a.titleId,...o,ref:t})});Za.displayName=Xn;var Qa="DialogDescription",Ja=n.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=Ee(Qa,r);return u.jsx(P.p,{id:a.descriptionId,...o,ref:t})});Ja.displayName=Qa;var es="DialogClose",ts=n.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=Ee(es,r);return u.jsx(P.button,{type:"button",...o,ref:t,onClick:S(e.onClick,()=>a.onOpenChange(!1))})});ts.displayName=es;function qn(e){return e?"open":"closed"}var rs="DialogTitleWarning",[Ev,ns]=Xp(rs,{contentName:Je,titleName:Xn,docsSlug:"dialog"}),Nv=({titleId:e})=>{const t=ns(rs),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return n.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Rv="DialogDescriptionWarning",Pv=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ns(Rv).contentName}}.`;return n.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},os=za,as=Wa,ss=Ka,is=Ya,cs=Xa,ls=Za,us=Ja,Zn=ts,_v=Symbol("radix.slottable");function Tv(e){const t=({children:r})=>u.jsx(u.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=_v,t}var ds="AlertDialog",[Mv]=U(ds,[Ga]),Oe=Ga(),fs=e=>{const{__scopeAlertDialog:t,...r}=e,o=Oe(t);return u.jsx(os,{...o,...r,modal:!0})};fs.displayName=ds;var Iv="AlertDialogTrigger",ps=n.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...o}=e,a=Oe(r);return u.jsx(as,{...a,...o,ref:t})});ps.displayName=Iv;var Av="AlertDialogPortal",ms=e=>{const{__scopeAlertDialog:t,...r}=e,o=Oe(t);return u.jsx(ss,{...o,...r})};ms.displayName=Av;var $v="AlertDialogOverlay",vs=n.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...o}=e,a=Oe(r);return u.jsx(is,{...a,...o,ref:t})});vs.displayName=$v;var ft="AlertDialogContent",[Dv,Ov]=Mv(ft),kv=Tv("AlertDialogContent"),hs=n.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:o,...a}=e,s=Oe(r),i=n.useRef(null),c=$(t,i),l=n.useRef(null);return u.jsx(Ev,{contentName:ft,titleName:gs,docsSlug:"alert-dialog",children:u.jsx(Dv,{scope:r,cancelRef:l,children:u.jsxs(cs,{role:"alertdialog",...s,...a,ref:c,onOpenAutoFocus:S(a.onOpenAutoFocus,f=>{f.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[u.jsx(kv,{children:o}),u.jsx(Lv,{contentRef:i})]})})})});hs.displayName=ft;var gs="AlertDialogTitle",Cs=n.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...o}=e,a=Oe(r);return u.jsx(ls,{...a,...o,ref:t})});Cs.displayName=gs;var ys="AlertDialogDescription",ws=n.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...o}=e,a=Oe(r);return u.jsx(us,{...a,...o,ref:t})});ws.displayName=ys;var jv="AlertDialogAction",bs=n.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...o}=e,a=Oe(r);return u.jsx(Zn,{...a,...o,ref:t})});bs.displayName=jv;var xs="AlertDialogCancel",Ss=n.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...o}=e,{cancelRef:a}=Ov(xs,r),s=Oe(r),i=$(t,a);return u.jsx(Zn,{...s,...o,ref:i})});Ss.displayName=xs;var Lv=({contentRef:e})=>{const t=`\`${ft}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${ft}\` by passing a \`${ys}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ft}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return n.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Fv=fs,Bv=ps,Vv=ms,Gv=vs,zv=hs,Hv=bs,Wv=Ss,Uv=Cs,Kv=ws,Yv="AspectRatio",Es=n.forwardRef((e,t)=>{const{ratio:r=1/1,style:o,...a}=e;return u.jsx("div",{style:{position:"relative",width:"100%",paddingBottom:`${100/r}%`},"data-radix-aspect-ratio-wrapper":"",children:u.jsx(P.div,{...a,ref:t,style:{...o,position:"absolute",top:0,right:0,bottom:0,left:0}})})});Es.displayName=Yv;var Xv=Es,ir={exports:{}},mn={};var ca;function qv(){if(ca)return mn;ca=1;var e=B;function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var r=typeof Object.is=="function"?Object.is:t,o=e.useState,a=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function c(p,m){var h=m(),g=o({inst:{value:h,getSnapshot:m}}),v=g[0].inst,C=g[1];return s(function(){v.value=h,v.getSnapshot=m,l(v)&&C({inst:v})},[p,h,m]),a(function(){return l(v)&&C({inst:v}),p(function(){l(v)&&C({inst:v})})},[p]),i(h),h}function l(p){var m=p.getSnapshot;p=p.value;try{var h=m();return!r(p,h)}catch{return!0}}function f(p,m){return m()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return mn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,mn}var vn={};var la;function Zv(){return la||(la=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}function t(h,g){d||a.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var v=g();if(!p){var C=g();s(v,C)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}C=i({inst:{value:v,getSnapshot:g}});var y=C[0].inst,b=C[1];return l(function(){y.value=v,y.getSnapshot=g,r(y)&&b({inst:y})},[h,v,g]),c(function(){return r(y)&&b({inst:y}),h(function(){r(y)&&b({inst:y})})},[h]),f(v),v}function r(h){var g=h.getSnapshot;h=h.value;try{var v=g();return!s(h,v)}catch{return!0}}function o(h,g){return g()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=B,s=typeof Object.is=="function"?Object.is:e,i=a.useState,c=a.useEffect,l=a.useLayoutEffect,f=a.useDebugValue,d=!1,p=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:t;vn.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),vn}var ua;function Qv(){return ua||(ua=1,process.env.NODE_ENV==="production"?ir.exports=qv():ir.exports=Zv()),ir.exports}var Jv=Qv();function eh(){return Jv.useSyncExternalStore(th,()=>!0,()=>!1)}function th(){return()=>{}}var Qn="Avatar",[rh]=U(Qn),[nh,Ns]=rh(Qn),Rs=n.forwardRef((e,t)=>{const{__scopeAvatar:r,...o}=e,[a,s]=n.useState("idle");return u.jsx(nh,{scope:r,imageLoadingStatus:a,onImageLoadingStatusChange:s,children:u.jsx(P.span,{...o,ref:t})})});Rs.displayName=Qn;var Ps="AvatarImage",_s=n.forwardRef((e,t)=>{const{__scopeAvatar:r,src:o,onLoadingStatusChange:a=()=>{},...s}=e,i=Ns(Ps,r),c=oh(o,s),l=W(f=>{a(f),i.onImageLoadingStatusChange(f)});return J(()=>{c!=="idle"&&l(c)},[c,l]),c==="loaded"?u.jsx(P.img,{...s,ref:t,src:o}):null});_s.displayName=Ps;var Ts="AvatarFallback",Ms=n.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:o,...a}=e,s=Ns(Ts,r),[i,c]=n.useState(o===void 0);return n.useEffect(()=>{if(o!==void 0){const l=window.setTimeout(()=>c(!0),o);return()=>window.clearTimeout(l)}},[o]),i&&s.imageLoadingStatus!=="loaded"?u.jsx(P.span,{...a,ref:t}):null});Ms.displayName=Ts;function da(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function oh(e,{referrerPolicy:t,crossOrigin:r}){const o=eh(),a=n.useRef(null),s=o?(a.current||(a.current=new window.Image),a.current):null,[i,c]=n.useState(()=>da(s,e));return J(()=>{c(da(s,e))},[s,e]),J(()=>{const l=p=>()=>{c(p)};if(!s)return;const f=l("loaded"),d=l("error");return s.addEventListener("load",f),s.addEventListener("error",d),t&&(s.referrerPolicy=t),typeof r=="string"&&(s.crossOrigin=r),()=>{s.removeEventListener("load",f),s.removeEventListener("error",d)}},[s,r,t]),i}var ah=Rs,sh=_s,ih=Ms;function yt(e){const t=n.useRef({value:e,previous:e});return n.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ht(e){const[t,r]=n.useState(void 0);return J(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const s=a[0];let i,c;if("borderBoxSize"in s){const l=s.borderBoxSize,f=Array.isArray(l)?l[0]:l;i=f.inlineSize,c=f.blockSize}else i=e.offsetWidth,c=e.offsetHeight;r({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var Ir="Checkbox",[ch,Is]=U(Ir),[lh,Jn]=ch(Ir);function uh(e){const{__scopeCheckbox:t,checked:r,children:o,defaultChecked:a,disabled:s,form:i,name:c,onCheckedChange:l,required:f,value:d="on",internal_do_not_use_render:p}=e,[m,h]=ee({prop:r,defaultProp:a??!1,onChange:l,caller:Ir}),[g,v]=n.useState(null),[C,y]=n.useState(null),b=n.useRef(!1),w=g?!!i||!!g.closest("form"):!0,x={checked:m,disabled:s,setChecked:h,control:g,setControl:v,name:c,form:i,value:d,hasConsumerStoppedPropagationRef:b,required:f,defaultChecked:Fe(a)?!1:a,isFormControl:w,bubbleInput:C,setBubbleInput:y};return u.jsx(lh,{scope:t,...x,children:dh(p)?p(x):o})}var As="CheckboxTrigger",$s=n.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...o},a)=>{const{control:s,value:i,disabled:c,checked:l,required:f,setControl:d,setChecked:p,hasConsumerStoppedPropagationRef:m,isFormControl:h,bubbleInput:g}=Jn(As,e),v=$(a,d),C=n.useRef(l);return n.useEffect(()=>{const y=s?.form;if(y){const b=()=>p(C.current);return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[s,p]),u.jsx(P.button,{type:"button",role:"checkbox","aria-checked":Fe(l)?"mixed":l,"aria-required":f,"data-state":js(l),"data-disabled":c?"":void 0,disabled:c,value:i,...o,ref:v,onKeyDown:S(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:S(r,y=>{p(b=>Fe(b)?!0:!b),g&&h&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})})});$s.displayName=As;var eo=n.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:o,checked:a,defaultChecked:s,required:i,disabled:c,value:l,onCheckedChange:f,form:d,...p}=e;return u.jsx(uh,{__scopeCheckbox:r,checked:a,defaultChecked:s,disabled:c,required:i,onCheckedChange:f,name:o,form:d,value:l,internal_do_not_use_render:({isFormControl:m})=>u.jsxs(u.Fragment,{children:[u.jsx($s,{...p,ref:t,__scopeCheckbox:r}),m&&u.jsx(ks,{__scopeCheckbox:r})]})})});eo.displayName=Ir;var Ds="CheckboxIndicator",to=n.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:o,...a}=e,s=Jn(Ds,r);return u.jsx(X,{present:o||Fe(s.checked)||s.checked===!0,children:u.jsx(P.span,{"data-state":js(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});to.displayName=Ds;var Os="CheckboxBubbleInput",ks=n.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:o,hasConsumerStoppedPropagationRef:a,checked:s,defaultChecked:i,required:c,disabled:l,name:f,value:d,form:p,bubbleInput:m,setBubbleInput:h}=Jn(Os,e),g=$(r,h),v=yt(s),C=Ht(o);n.useEffect(()=>{const b=m;if(!b)return;const w=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(w,"checked").set,_=!a.current;if(v!==s&&N){const R=new Event("click",{bubbles:_});b.indeterminate=Fe(s),N.call(b,Fe(s)?!1:s),b.dispatchEvent(R)}},[m,v,s,a]);const y=n.useRef(Fe(s)?!1:s);return u.jsx(P.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??y.current,required:c,disabled:l,name:f,value:d,form:p,...t,tabIndex:-1,ref:g,style:{...t.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ks.displayName=Os;function dh(e){return typeof e=="function"}function Fe(e){return e==="indeterminate"}function js(e){return Fe(e)?"indeterminate":e?"checked":"unchecked"}var fh=typeof document<"u",ph=function(){},dr=fh?B.useLayoutEffect:ph;function mr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,o,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!mr(e[o],t[o]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,a[o]))return!1;for(o=r;o--!==0;){const s=a[o];if(!(s==="_owner"&&e.$$typeof)&&!mr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ls(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fa(e,t){const r=Ls(e);return Math.round(t*r)/r}function hn(e){const t=n.useRef(e);return dr(()=>{t.current=e}),t}function mh(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:a,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:f}=e,[d,p]=n.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=n.useState(o);mr(m,o)||h(o);const[g,v]=n.useState(null),[C,y]=n.useState(null),b=n.useCallback(j=>{j!==_.current&&(_.current=j,v(j))},[]),w=n.useCallback(j=>{j!==R.current&&(R.current=j,y(j))},[]),x=s||g,N=i||C,_=n.useRef(null),R=n.useRef(null),D=n.useRef(d),T=l!=null,O=hn(l),k=hn(a),V=hn(f),G=n.useCallback(()=>{if(!_.current||!R.current)return;const j={placement:t,strategy:r,middleware:m};k.current&&(j.platform=k.current),te.computePosition(_.current,R.current,j).then(A=>{const ae={...A,isPositioned:V.current!==!1};Z.current&&!mr(D.current,ae)&&(D.current=ae,Rr.flushSync(()=>{p(ae)}))})},[m,t,r,k,V]);dr(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,p(j=>({...j,isPositioned:!1})))},[f]);const Z=n.useRef(!1);dr(()=>(Z.current=!0,()=>{Z.current=!1}),[]),dr(()=>{if(x&&(_.current=x),N&&(R.current=N),x&&N){if(O.current)return O.current(x,N,G);G()}},[x,N,G,O,T]);const Q=n.useMemo(()=>({reference:_,floating:R,setReference:b,setFloating:w}),[b,w]),L=n.useMemo(()=>({reference:x,floating:N}),[x,N]),H=n.useMemo(()=>{const j={position:r,left:0,top:0};if(!L.floating)return j;const A=fa(L.floating,d.x),ae=fa(L.floating,d.y);return c?{...j,transform:"translate("+A+"px, "+ae+"px)",...Ls(L.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:A,top:ae}},[r,c,L.floating,d.x,d.y]);return n.useMemo(()=>({...d,update:G,refs:Q,elements:L,floatingStyles:H}),[d,G,Q,L,H])}const vh=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name: