@vertesia/ui 1.5.0-dev.20260826.064249Z → 1.5.0-dev.20260901.033115Z

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.
Files changed (130) hide show
  1. package/lib/core/components/FormItem.d.ts.map +1 -1
  2. package/lib/core/components/FormItem.js +2 -3
  3. package/lib/core/components/FormItem.js.map +1 -1
  4. package/lib/core/components/InfoTip.d.ts +20 -0
  5. package/lib/core/components/InfoTip.d.ts.map +1 -0
  6. package/lib/core/components/InfoTip.js +18 -0
  7. package/lib/core/components/InfoTip.js.map +1 -0
  8. package/lib/core/components/index.d.ts +1 -0
  9. package/lib/core/components/index.d.ts.map +1 -1
  10. package/lib/core/components/index.js +1 -0
  11. package/lib/core/components/index.js.map +1 -1
  12. package/lib/core/components/shadcn/Panel.d.ts.map +1 -1
  13. package/lib/core/components/shadcn/Panel.js +3 -3
  14. package/lib/core/components/shadcn/Panel.js.map +1 -1
  15. package/lib/features/store/objects/search/DocumentSearchContext.d.ts +15 -0
  16. package/lib/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
  17. package/lib/features/store/objects/search/DocumentSearchContext.js +45 -2
  18. package/lib/features/store/objects/search/DocumentSearchContext.js.map +1 -1
  19. package/lib/features/store/objects/selection/actions/DeleteObjectsAction.d.ts.map +1 -1
  20. package/lib/features/store/objects/selection/actions/DeleteObjectsAction.js +5 -0
  21. package/lib/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -1
  22. package/lib/features/store/types/IntakePolicyEditor.d.ts.map +1 -1
  23. package/lib/features/store/types/IntakePolicyEditor.js +1 -1
  24. package/lib/features/store/types/IntakePolicyEditor.js.map +1 -1
  25. package/lib/features/store/types/IntakePolicyForm.d.ts.map +1 -1
  26. package/lib/features/store/types/IntakePolicyForm.js +15 -15
  27. package/lib/features/store/types/IntakePolicyForm.js.map +1 -1
  28. package/lib/features/store/types/TypeRegistry.d.ts +10 -0
  29. package/lib/features/store/types/TypeRegistry.d.ts.map +1 -1
  30. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts +10 -0
  31. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts.map +1 -1
  32. package/lib/i18n/locales/ar.json +35 -0
  33. package/lib/i18n/locales/de.json +35 -0
  34. package/lib/i18n/locales/en.json +35 -0
  35. package/lib/i18n/locales/es.json +35 -0
  36. package/lib/i18n/locales/fr.json +35 -0
  37. package/lib/i18n/locales/it.json +35 -0
  38. package/lib/i18n/locales/ja.json +35 -0
  39. package/lib/i18n/locales/ko.json +35 -0
  40. package/lib/i18n/locales/pt.json +35 -0
  41. package/lib/i18n/locales/ru.json +35 -0
  42. package/lib/i18n/locales/tr.json +35 -0
  43. package/lib/i18n/locales/zh-TW.json +35 -0
  44. package/lib/i18n/locales/zh.json +35 -0
  45. package/lib/router/RouteComponent.d.ts +8 -0
  46. package/lib/router/RouteComponent.d.ts.map +1 -1
  47. package/lib/router/RouteComponent.js +41 -9
  48. package/lib/router/RouteComponent.js.map +1 -1
  49. package/lib/session/UserSessionProvider.d.ts.map +1 -1
  50. package/lib/session/UserSessionProvider.js +12 -13
  51. package/lib/session/UserSessionProvider.js.map +1 -1
  52. package/lib/session/auth/domainRouting.d.ts +11 -0
  53. package/lib/session/auth/domainRouting.d.ts.map +1 -1
  54. package/lib/session/auth/domainRouting.js +13 -0
  55. package/lib/session/auth/domainRouting.js.map +1 -1
  56. package/lib/session/useUXTracking.d.ts.map +1 -1
  57. package/lib/session/useUXTracking.js +6 -1
  58. package/lib/session/useUXTracking.js.map +1 -1
  59. package/lib/vertesia-ui-core.js +199 -4
  60. package/lib/vertesia-ui-core.js.map +1 -1
  61. package/lib/vertesia-ui-features.js +975 -33
  62. package/lib/vertesia-ui-features.js.map +1 -1
  63. package/lib/vertesia-ui-i18n.BJBGsq-8.chunk.js +5 -0
  64. package/lib/vertesia-ui-i18n.BJBGsq-8.chunk.js.map +1 -0
  65. package/lib/vertesia-ui-i18n.BY5YG5cX.chunk.js +5 -0
  66. package/lib/vertesia-ui-i18n.BY5YG5cX.chunk.js.map +1 -0
  67. package/lib/vertesia-ui-i18n.Bd5_1BXO.chunk.js +5 -0
  68. package/lib/vertesia-ui-i18n.Bd5_1BXO.chunk.js.map +1 -0
  69. package/lib/vertesia-ui-i18n.Bvwej2HH.chunk.js +5 -0
  70. package/lib/vertesia-ui-i18n.Bvwej2HH.chunk.js.map +1 -0
  71. package/lib/vertesia-ui-i18n.CMT3f4gf.chunk.js +5 -0
  72. package/lib/vertesia-ui-i18n.CMT3f4gf.chunk.js.map +1 -0
  73. package/lib/vertesia-ui-i18n.D56DNPJW.chunk.js +5 -0
  74. package/lib/vertesia-ui-i18n.D56DNPJW.chunk.js.map +1 -0
  75. package/lib/vertesia-ui-i18n.DDzKLNx6.chunk.js +5 -0
  76. package/lib/vertesia-ui-i18n.DDzKLNx6.chunk.js.map +1 -0
  77. package/lib/vertesia-ui-i18n.D_Am1LpF.chunk.js +5 -0
  78. package/lib/vertesia-ui-i18n.D_Am1LpF.chunk.js.map +1 -0
  79. package/lib/vertesia-ui-i18n.DrZizgGV.chunk.js +5 -0
  80. package/lib/vertesia-ui-i18n.DrZizgGV.chunk.js.map +1 -0
  81. package/lib/vertesia-ui-i18n.DwHsq86z.chunk.js +5 -0
  82. package/lib/vertesia-ui-i18n.DwHsq86z.chunk.js.map +1 -0
  83. package/lib/vertesia-ui-i18n.PLpo0Bbz.chunk.js +5 -0
  84. package/lib/vertesia-ui-i18n.PLpo0Bbz.chunk.js.map +1 -0
  85. package/lib/vertesia-ui-i18n.js +2 -38
  86. package/lib/vertesia-ui-i18n.js.map +1 -1
  87. package/lib/vertesia-ui-i18n.xVbXALqz.chunk.js +5 -0
  88. package/lib/vertesia-ui-i18n.xVbXALqz.chunk.js.map +1 -0
  89. package/lib/vertesia-ui-layout.js +80 -1
  90. package/lib/vertesia-ui-layout.js.map +1 -1
  91. package/lib/vertesia-ui-rich-text.js +278 -4
  92. package/lib/vertesia-ui-rich-text.js.map +1 -1
  93. package/lib/vertesia-ui-router.js +1 -1
  94. package/lib/vertesia-ui-router.js.map +1 -1
  95. package/lib/vertesia-ui-session.js +1 -1
  96. package/lib/vertesia-ui-session.js.map +1 -1
  97. package/lib/vertesia-ui-shell.js +118 -1
  98. package/lib/vertesia-ui-shell.js.map +1 -1
  99. package/lib/vertesia-ui-widgets.js +336 -20
  100. package/lib/vertesia-ui-widgets.js.map +1 -1
  101. package/package.json +7 -7
  102. package/src/core/components/FormItem.tsx +2 -5
  103. package/src/core/components/InfoTip.test.tsx +33 -0
  104. package/src/core/components/InfoTip.tsx +32 -0
  105. package/src/core/components/index.ts +1 -0
  106. package/src/core/components/shadcn/Panel.tsx +3 -7
  107. package/src/features/store/objects/search/DocumentSearchContext.test.ts +45 -0
  108. package/src/features/store/objects/search/DocumentSearchContext.ts +50 -2
  109. package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +5 -0
  110. package/src/features/store/types/IntakePolicyEditor.tsx +3 -4
  111. package/src/features/store/types/IntakePolicyForm.tsx +120 -20
  112. package/src/i18n/locales/ar.json +35 -0
  113. package/src/i18n/locales/de.json +35 -0
  114. package/src/i18n/locales/en.json +35 -0
  115. package/src/i18n/locales/es.json +35 -0
  116. package/src/i18n/locales/fr.json +35 -0
  117. package/src/i18n/locales/it.json +35 -0
  118. package/src/i18n/locales/ja.json +35 -0
  119. package/src/i18n/locales/ko.json +35 -0
  120. package/src/i18n/locales/pt.json +35 -0
  121. package/src/i18n/locales/ru.json +35 -0
  122. package/src/i18n/locales/tr.json +35 -0
  123. package/src/i18n/locales/zh-TW.json +35 -0
  124. package/src/i18n/locales/zh.json +35 -0
  125. package/src/router/RouteComponent.test.tsx +139 -0
  126. package/src/router/RouteComponent.tsx +54 -9
  127. package/src/session/UserSessionProvider.tsx +12 -11
  128. package/src/session/auth/domainRouting.test.ts +24 -1
  129. package/src/session/auth/domainRouting.ts +29 -0
  130. package/src/session/useUXTracking.tsx +6 -1
@@ -1,4 +1,199 @@
1
- import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import r,{clsx as i}from"clsx";import{AlertTriangle as a,Check as o,CheckIcon as s,ChevronDown as c,ChevronDownIcon as l,ChevronRight as u,ChevronRightIcon as d,ChevronUp as f,ChevronUpIcon as p,ChevronsUpDown as m,CircleCheck as h,CircleX as g,Computer as _,CopyIcon as v,Info as y,ListFilter as b,Loader2 as x,LoaderCircle as S,Minus as C,Moon as w,MoreHorizontal as T,Plus as E,Search as D,SearchIcon as O,SquarePlus as k,Sun as A,TriangleAlert as ee,X as j,XIcon as te}from"lucide-react";import*as M from"react";import N,{Children as ne,Fragment as re,cloneElement as ie,createContext as ae,forwardRef as oe,isValidElement as se,useCallback as P,useContext as ce,useEffect as F,useId as le,useLayoutEffect as ue,useMemo as de,useRef as I,useState as L}from"react";import{createPortal as fe}from"react-dom";import{Slot as pe}from"@radix-ui/react-slot";import{SUPPORTED_LANGUAGES as me,useLanguage as he,useUITranslation as R}from"@vertesia/ui/i18n";import{cva as z}from"class-variance-authority";import{twMerge as ge}from"tailwind-merge";import*as B from"@radix-ui/react-tooltip";import{Env as _e}from"@vertesia/ui/env";import{AnimatePresence as ve,motion as ye}from"framer-motion";import*as be from"@radix-ui/react-checkbox";import*as xe from"@radix-ui/react-collapsible";import{Command as V}from"cmdk";import*as H from"@radix-ui/react-dialog";import*as U from"@radix-ui/react-dropdown-menu";import Se from"react-calendar";import Ce from"dayjs";import we from"dayjs/plugin/localizedFormat";import Te from"dayjs/plugin/relativeTime";import*as W from"@radix-ui/react-popover";import{isEqual as Ee}from"lodash-es";import*as De from"@radix-ui/react-label";import*as Oe from"@radix-ui/react-radio-group";import*as ke from"react-resizable-panels";import*as Ae from"@radix-ui/react-separator";import*as je from"@radix-ui/react-slider";import*as Me from"@radix-ui/react-switch";import*as Ne from"@radix-ui/react-tabs";function Pe(e){switch(e){case`xs`:return`size-4`;case`sm`:return`size-6`;case`md`:return`size-8`;case`lg`:return`size-10`;case`xl`:return`size-12`;case`2xl`:return`size-14`;default:throw Error(`Unexpected size: ${e}`)}}function Fe({size:e,src:n,name:r,shape:i=`circle`,color:a=`bg-gray-500`,className:o}){let s=i===`circle`?`rounded-full`:`rounded-md`,c=Pe(e||`md`);if(n)return t(`img`,{className:`inline-block ${c} ${s} ${a} ${o}`,src:n,alt:r||n,title:r});if(r){let[n,i]=r.split(` `),l=i?`${n[0]}${i[0]}`:`${n[0]}${n[1]}`;return t(`span`,{className:`inline-flex ${c} items-center justify-center ${s} ${a} ${o}`,title:r,children:t(`span`,{className:`${e===`xs`?`text-[0.6rem]`:`text-xs`} font-medium leading-none text-white`,children:l})})}return t(`span`,{className:`inline-block ${c} overflow-hidden ${s} ${a}`,children:t(`svg`,{className:`h-full w-full text-gray-300`,fill:`currentColor`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:t(`path`,{d:`M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z`})})})}function Ie({size:e,shape:n=`circle`,color:r=`bg-gray-500`,className:i,children:a}){let o=n===`circle`?`rounded-full`:`rounded-md`,s=Pe(e||`md`);return t(`span`,{className:`inline-block ${s} overflow-hidden ${o} ${r} ${i}`,children:a})}function Le({className:e,children:n}){return t(`div`,{className:r(`flex items-center justify-center`,e),children:n})}function Re(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`;case`ne`:return`sw`;case`nw`:return`se`;case`se`:return`nw`;case`sw`:return`ne`;default:return e}}function ze(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var Be=class{left;top;width;height;alignAxis;gap;constructor(e=0){this.gap=e}position(e,t,n){switch(e){case`top`:this.top=t.top-n.height-this.gap,this.alignAxis=`x`;break;case`bottom`:this.top=t.bottom+this.gap,this.alignAxis=`x`;break;case`left`:this.left=t.left-n.width-this.gap,this.alignAxis=`y`;break;case`right`:this.left=t.right+this.gap,this.alignAxis=`y`;break;case`ne`:this.top=t.top-n.height-this.gap,this.left=t.right+this.gap;break;case`nw`:this.top=t.top-n.height-this.gap,this.left=t.left-n.width-this.gap;break;case`se`:this.top=t.bottom+this.gap,this.left=t.right+this.gap;break;case`sw`:this.top=t.bottom+this.gap,this.left=t.left-n.width-this.gap}}align(e,t,n){if(this.alignAxis)switch(e){case`start`:this.alignAxis===`x`?this.left=t.left:this.top=t.top;break;case`end`:this.alignAxis===`x`?this.left=t.right-n.width:this.top=t.bottom-n.height;break;case`center`:this.alignAxis===`x`?this.left=t.left+t.width/2-n.width/2:this.top=t.top+t.height/2-n.height/2;break;case`fill`:this.alignAxis===`x`?(this.left=t.left,this.width=t.right-t.left):(this.top=t.top,this.height=t.bottom-t.top)}}computePosition(e,t,n){if(this.position(e.position,n,t),e.align&&this.align(e.align,n,t),!this.left&&!this.top)throw Error(`Invalid position. Cannot compute x,y coordinates`);let r=this.width!=null,i=this.height!=null,a=this.width??t.width,o=this.height??t.height;return{rect:new DOMRect(this.left??0,this.top??0,a,o),constrainWidth:r,constrainHeight:i,position:e.position,align:e.align}}flipAxis(e,t){if(this.alignAxis===t){if(e.align){let t=ze(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=Re(e.position);if(t!==e.position)return{...e,position:t}}return null}};function Ve(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}function He(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function Ue(e,t,n,r){let i=new Be(e.gap),a=i.computePosition(e,t,n),o=He(a.rect,r,`x`),s=He(a.rect,r,`y`);if(o&&s)return a;let c=null;return o||(c=i.flipAxis(e,`x`)),s||(c=i.flipAxis(c||e,`y`)),c?(a=new Be(i.gap).computePosition(c,t,n),Ve(a.rect,r)?a:null):null}function We(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return i<=n||a<=r?null:new DOMRect(n,r,i-n,a-r)}function Ge(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=We(e[n].getBoundingClientRect(),t),!t)return null;return t}function Ke(e){let t=e.scrollHeight>e.clientHeight,n=e.scrollWidth>e.clientWidth;if(t||n){let r=getComputedStyle(e);if(t&&r.overflowY!==`visible`||n&&r.overflowX!==`visible`)return!0}return!1}function qe(e,t=document.documentElement){let n=[],r=e.parentElement;for(;r&&r!==t;)Ke(r)&&n.push(r),r=r.parentElement;return n.push(t),n}var Je=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=qe(this.anchor,this.root),this.visibleClientRect=Ge(this.scrollableParents)}get anchor(){return this.options.anchor}registerListeners(e){let t=this.scrollableParents,n=()=>{this.update()};window.addEventListener(`resize`,n);for(let e of t)e.addEventListener(`scroll`,n);let r;this.options.closeOnClick&&(r=t=>{e.contains(t.target)||this.tryClose()},window.setTimeout(()=>{r&&document.addEventListener(`click`,r)},0));let i;this.options.closeOnEsc&&(i=e=>{e.key===`Escape`&&this.tryClose()},window.setTimeout(()=>{i&&document.addEventListener(`keydown`,i)},0));let a=this.options.blockPageScroll;return a&&(document.body.style.overflow=`hidden`,document.body.style.height=`100%`),()=>{window.removeEventListener(`resize`,n);for(let e of t)e.removeEventListener(`scroll`,n);r&&document.removeEventListener(`click`,r),i&&document.removeEventListener(`keydown`,i),a&&(document.body.style.overflow=``,document.body.style.height=``)}}open(e,t){if(this.context)throw Error(`The popup controller is already bound to an element`);this.tryOpen(e,t)}tryOpen(e,t){this.context||(this.context={element:e,constraints:t,cleanup:this.registerListeners(e)},e.style.display=``,e.style.visibility=`hidden`,this.update(),this.options.onOpen?.(this))}close(){if(!this.context)throw Error(`The popup controller is not bound to an element`);this.tryClose()}tryClose(){this.context&&=(this.options.onClose?.(this),this.context.cleanup(),this.context.element.style.display=`none`,void 0)}get isOpen(){return!!this.context}update(){if(!this.context)return;let e=this.context.element,t=this.context.constraints,n=e.getBoundingClientRect(),r=this.anchor.getBoundingClientRect(),i=this.visibleClientRect;if(!i)return;let a=Ue(t,n,r,i);this.context.position=a||void 0,a&&(a.constrainHeight&&(e.style.height=`${a.rect.height}px`),a.constrainWidth&&(e.style.width=`${a.rect.width}px`),e.style.left=`${a.rect.left}px`,e.style.top=`${a.rect.top}px`,e.style.visibility=`visible`)}createPopupElement(){let e=document.createElement(`div`);return e.style.margin=`0`,e.style.padding=`0`,e.style.border=`none`,e.style.background=`transparent`,e.className=`composable-Popup`,e}};const Ye=ae(void 0);function Xe(){let e=ce(Ye);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function Ze({ctrlRef:e,id:n,constraints:r,isOpen:i,children:a,className:o,onClose:s,onOpen:c,zIndex:l,position:u,anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h}){let g=I(null),[_,v]=L(),y=I(s),b=I(c);return y.current=s,b.current=c,F(()=>{if(!d)throw Error(`Anchor element is required`);let e=new Je({anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h,onClose:()=>y.current?.(),onOpen:()=>b.current?.()});return v(e),()=>{e.tryClose()}},[d,h,p,m,f]),F(()=>{e&&(e.current=_)},[_,e]),F(()=>{_&&g.current?_.isOpen!==i&&(i?_.open(g.current,r):_.close()):_?.isOpen&&!i&&_.close()},[r,i,_]),t(Ye.Provider,{value:_,children:i&&fe(t(`div`,{id:n,style:{visibility:`hidden`,position:u||`absolute`,zIndex:l||100},ref:g,className:o,children:a}),document.body)})}function Qe({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(Ze,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function $e(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var et=class{filter(e,t){let n=t.toLowerCase();return e.filter(e=>this.valueOf(e).toLowerCase().includes(n))}renderOption(e){return this.valueOf(e)}findById(e,t){return e.find(e=>this.idOf(e)===t)}createItem(e){return null}},tt=class e extends et{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},nt=class e extends tt{createItem(e){return e}static instance=new e};function rt(e,t){return{buttonRight:4,buttonWidth:24,maxMenuHeight:240,menuClass:`w-72 mt-1 border-popover bg-popover text-popover-foreground shadow-md overflow-auto p-0 z-10`,inputClass:r(t?`block m-0 p-0 border-0 focus:outline-none focus:ring-0`:`block sm:text-sm sm:leading-6 bg-muted rounded-md border-0 shadow-sm ring-1 ring-inset ring-muted placeholder:text-muted focus:ring-2 focus:ring-inset focus:ring-primary py-1.5`,e?`w-full`:`!w-auto`),optionClass:`py-2 px-3 shadow-sm flex flex-col [&.option-selected]:font-semibold [&.option-highlighted]:bg-blue-300`,Input:at,Menu:st,Toggle:ot}}function it({menuAlign:r=`fill`,menuGap:i,focusOnMount:a,onSelect:o,value:s,zIndex:c,unstyledInput:l,fullWidth:u,api:d,layout:f,adapter:p,items:m,placeholder:h,clearable:g,noMatchMessage:_,openOnFocus:v}){let[y]=L($e()),b=I(void 0),x=I(null),S=f?Object.assign(rt(u,l),f):rt(u,l),C=N.useRef(null),w=ct({adapter:p,items:m,value:s,popupId:y});F(()=>{x.current&&a&&x.current.focus()},[a]),F(()=>{w.onSelect=o,w.popupCtrl=b.current},[w,o]),F(()=>{if(d&&w&&x.current)return d.current={open:()=>w.openMenu(),close:()=>w.closeMenu(),toggle:()=>w.toggleMenu(),setInputValue:e=>w.inputText=e,inputValue:w.inputText||``,selectedItem:w.selectedItem,focus:()=>x.current?.focus()},()=>{d.current=null}},[d,w]);let T=w.isMenuOpen&&(w.filteredItems.length>0||!!_);return n(e,{children:[t(S.Input,{boxRef:C,inputRef:x,ctrl:w,layout:S,placeholder:h,clearable:g,openOnFocus:v}),t(Qe,{id:y,ctrlRef:b,className:`combobox-popup`,closeOnClick:!0,closeOnEsc:!0,onClose:()=>w.closeMenu(),isOpen:T,anchor:C,zIndex:c,constraints:{position:`bottom`,align:r,gap:i??4},children:t(S.Menu,{fillWidth:r===`fill`,items:w.filteredItems,ctrl:w,layout:S,adapter:p,noMatchMessage:_})})]})}function at({inputRef:e,placeholder:r,boxRef:i,ctrl:a,layout:o,clearable:s,openOnFocus:c}){let l=o.Toggle,u=s&&a.selectedItem!=null,d=+!!l+ +!!u,f=d>0?{paddingRight:`${o.buttonWidth*d+o.buttonRight}px`}:void 0;return n(`div`,{className:`relative`,ref:i,children:[t(`input`,{ref:e,placeholder:r,...a.getInputProps(),onFocus:c?()=>a.openMenu():void 0,style:f,className:o.inputClass}),n(`div`,{style:{position:`absolute`,right:`${o.buttonRight}px`,top:0,bottom:0,display:`flex`,alignItems:`center`,gap:`2px`},children:[u&&t(`button`,{type:`button`,style:{border:`none`,padding:0,margin:0,backgroundColor:`transparent`,cursor:`pointer`,display:`flex`,alignItems:`center`,width:`${o.buttonWidth}px`},onClick:()=>{a.selectedItem=null},children:t(te,{className:`w-4 h-4`})}),l&&t(`button`,{type:`button`,style:{width:`${o.buttonWidth}px`,border:`none`,padding:0,margin:0,backgroundColor:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`},...a.getToggleButtonProps(),children:t(l,{ctrl:a,layout:o})})]})]})}function ot({ctrl:e}){return e.isMenuOpen?t(p,{className:`w-4 h-4`}):t(l,{className:`w-4 h-4`})}function st({fillWidth:e,items:n,layout:i,ctrl:a,adapter:o,noMatchMessage:s}){let{highlightedIndex:c,selectedItem:l}=a;return n.length===0?s?t(`div`,{style:{width:e?`100%`:void 0},className:i.menuClass,children:s}):null:t(`ul`,{style:{width:e?`100%`:void 0,maxHeight:i.maxMenuHeight?`${i.maxMenuHeight}px`:`240px`},className:i.menuClass,...a.getMenuProps(),children:n.map((e,n)=>t(`li`,{"data-index":n,className:r(i.optionClass,c===n&&`option-highlighted`,l===e&&`option-selected`),...a.getItemProps(e,n),children:o.renderOption(e)},o.idOf(e)))})}function ct(e){let[t,n]=L(new lt(e));return F(()=>{t?.withState(n)},[t]),t}var lt=class e{popupId;items;adapter;onSelect;setState;_selectedItem=null;_filteredItems;_inputText=``;_highlightedIndex=null;_isMenuOpen=!1;popupCtrl;constructor({adapter:e,items:t,value:n,popupId:r}){this.adapter=e,this.items=t,this.popupId=r,typeof n==`string`?this._inputText=n:n&&(this._selectedItem=e.findById(t,e.idOf(n))||null,this._selectedItem&&(this._inputText=e.valueOf(n))),this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items}withState(e){return this.setState=e,this}clone(){let t=new e({adapter:this.adapter,items:this.items,popupId:this.popupId});return t.setState=this.setState,t.onSelect=this.onSelect,t._inputText=this._inputText,t._highlightedIndex=this._highlightedIndex,t._selectedItem=this._selectedItem,t._isMenuOpen=this._isMenuOpen,t._filteredItems=this._filteredItems,t.popupCtrl=this.popupCtrl,t}updateState(){this.setState?.(this.clone())}get filteredItems(){return this._inputText?this.adapter.filter(this.items,this._inputText):this.items}get selectedItem(){return this._selectedItem}set selectedItem(e){this._selectedItem=e,this._inputText=e?this.adapter.valueOf(e):``,this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items,this.updateState(),this.onSelect?.(e)}get isMenuOpen(){return this._isMenuOpen}set inputText(e){if(this._inputText=e,this._filteredItems=e?this.adapter.filter(this.items,e):this.items,this._highlightedIndex=null,this._selectedItem=null,this.updateState(),this.isMenuOpen&&this.popupCtrl){let e=this.popupCtrl,t=e.context?.position?.position;t&&t===`top`&&window.setTimeout(()=>{e.update()},100)}}get inputText(){return this._inputText}set highlightedIndex(e){this._highlightedIndex=e,this.updateState()}get highlightedIndex(){return this._highlightedIndex}openMenu(){this._filteredItems.length>0&&(this._isMenuOpen=!0,this.updateState())}closeMenu(e){this._isMenuOpen&&(this._highlightedIndex=null,this._isMenuOpen=!1,this.updateState())}toggleMenu(){this._isMenuOpen?this.closeMenu():this.openMenu()}highlightIndex(e,t=!1){this.highlightedIndex=e;let n=document.getElementById(this.popupId);n&&n.querySelector(`li[data-index="${e}"]`)?.scrollIntoView(t)}getMenuProps(){return{}}getToggleButtonProps(){return{onClick:()=>{this._isMenuOpen=!this._isMenuOpen,this.updateState()}}}getItemProps(e,t){return{"aria-selected":this._highlightedIndex===t,onClick:()=>{this.selectedItem=e,this.closeMenu()},onMouseEnter:()=>{this.highlightedIndex!==t&&(this.highlightedIndex=t)},onMouseLeave:()=>{this.highlightedIndex===t&&(this.highlightedIndex=null)}}}getInputProps(){let e=this._filteredItems;return{onClick:()=>{this.openMenu()},onChange:e=>{let t=e.target.value;this.inputText=t,this.openMenu()},value:this.inputText,onKeyDown:t=>{let n=t.key;if(n===`Enter`){if(this.highlightedIndex!=null)this.selectedItem=e[this.highlightedIndex||0];else if(this.inputText){let e=this.adapter.createItem(this.inputText);e&&(this.items.push(e),this.selectedItem=e)}this.closeMenu()}else n===`ArrowDown`?this.isMenuOpen?this.highlightIndex(this.highlightedIndex===null?0:ut(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:dt(this.highlightedIndex,e.length),!0)}}}};function ut(e,t){return(e+1)%t}function dt(e,t){return(e-1+t)%t}function ft({options:e,creatable:n,...r}){let i=n?nt.instance:tt.instance;return t(it,{adapter:i,items:e,...r})}function pt({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}function G(...e){return ge(i(e))}const mt=N.createContext(void 0);function ht(e,t=`plugin-portal-container`){let n=e instanceof Document?e.body:e;for(let e of Array.from(n.children))if(e instanceof HTMLElement&&e.id===t)return e;let r=document.createElement(`div`);return r.id=t,n.appendChild(r),r}function gt({children:e,id:n=`plugin-portal-container`}){let r=N.useContext(mt),i=N.useRef(null),[a,o]=N.useState(r||void 0);return N.useEffect(()=>{if(r){o(r);return}if(i.current){let e=i.current.getRootNode();if(e instanceof ShadowRoot||e instanceof Document){let t=ht(e,n);o(t)}else o(null)}},[n,r]),a===void 0?t(`div`,{ref:i,style:{display:`none`}}):t(mt.Provider,{value:a||void 0,children:e})}function _t(){return N.useContext(mt)}const vt=B.Provider,yt=B.Root,bt=B.Trigger,xt=M.forwardRef(({className:e,sideOffset:n=4,side:r=`top`,...i},a)=>{let o=_t();return t(B.Portal,{container:o,children:t(B.Content,{ref:a,sideOffset:n,side:r,style:{zIndex:100},className:G(`max-w-[90vw]`,`z-50 overflow-hidden rounded-md bg-tooltips border border-border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})})});xt.displayName=B.Content.displayName;function St({description:e,children:r,size:i=`sm`,placement:a=`top`,className:o,asChild:s}){let[c,l]=M.useState(!1),u=M.useRef(!1);return M.useEffect(()=>{let e=()=>{l(!1),u.current=!0,requestAnimationFrame(()=>{u.current=!1})};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,e)}},[]),t(vt,{delayDuration:0,children:n(yt,{open:c,onOpenChange:e=>{u.current||l(e)},children:[t(bt,{className:`cursor-pointer`,asChild:s,children:r}),t(xt,{side:a,className:`px-3 py-1.5 max-w-${i} text-${i} px-3 ${o}`,children:e})]})})}const Ct=new Set;function wt(e,t,n){F(()=>{t&&!Ct.has(e)&&(Ct.add(e),console.warn(`[@vertesia/ui] ${e} is deprecated: ${n}`))},[t,n,e])}function Tt(e){return M.Children.toArray(e).some(e=>{if(typeof e==`string`)return e.trim().length>0;if(typeof e==`number`)return!0;if(M.isValidElement(e)){let t=e.props;return t[`aria-hidden`]===!0||t[`aria-hidden`]===`true`?!1:Tt(t.children)}return!1})}const Et=z(`hover:cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{destructive:`bg-destructive dark:bg-destructive/10 text-destructive ring-1 ring-inset ring-destructive-muted/50 dark:ring-destructive-muted/50 shadow-xs hover:bg-destructive/50`,outline:`border border-input bg-background shadow-xs hover:bg-muted ring-inset`,secondary:`bg-primary/5 dark:bg-primary/10 text-primary shadow-xs hover:bg-primary/10 dark:hover:bg-primary/20 ring-inset`,ghost:`hover:bg-muted/50 dark:hover:bg-muted/20 ring-inset`,link:`text-foreground underline-offset-4 hover:underline ring-inset`,primary:`bg-primary text-white shadow-xs hover:bg-primary/90 ring-inset`,unstyled:``},size:{xs:`h-7 rounded px-2 py-1 text-xs gap-x-1`,sm:`h-8 rounded px-3 text-xs`,md:`h-9 rounded-md px-4 py-2`,lg:`h-10 rounded-md px-3`,xl:`rounded-md px-3.5 py-2.5 text-sm gap-x-2`,icon:`p-0 m-0 rounded-full`,none:``}},defaultVariants:{variant:`primary`,size:`md`}}),K=M.forwardRef(({className:i,variant:a,size:o,asChild:s=!1,alt:c,isDisabled:l,isLoading:u,title:d,tooltipPlacement:f=`top`,onClick:p,type:m,...h},g)=>{wt(`Button.alt`,c!==void 0,"use `title` instead — it drives the same tooltip and the accessible name. `alt` remains an alias for one release.");let _=s?pe:`button`,v=s?m:m??`button`,y=d??c,b=h[`aria-label`]??c??(Tt(h.children)?void 0:d),S=s?h.children:n(e,{children:[u&&t(x,{className:`animate-spin`}),h.children]}),C=t(_,{className:r(G(Et({variant:a,size:o})),i),disabled:l||u||h.disabled,ref:g,onClick:p,type:v,autoFocus:!1,...h,"aria-label":b,children:S});return y?t(St,{description:y,asChild:!0,className:`cursor-pointer`,size:`xs`,placement:f,children:C}):C});K.displayName=`Button`;const Dt=M.forwardRef(({size:e,content:n,toast:r,className:i,alt:a,"aria-label":s,...c},l)=>{let[u,d]=L(!1),{t:f}=R();wt(`CopyButton.alt`,a!==void 0,"use aria-label for the accessible name. `alt` is forwarded for one release.");let p=e=>{e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{d(!0),setTimeout(()=>d(!1),2e3),r?.toast&&r.toast({status:`success`,title:r.message||f(`misc.copiedToClipboard`),duration:2e3})}).catch(e=>{console.error(`Failed to copy text: `,e),r?.toast&&r.toast({status:`error`,title:f(`misc.failedToCopy`),duration:2e3})})},m=s??a??f(`misc.copy`);return t(K,{ref:l,className:G(i),variant:`unstyled`,size:e||`sm`,onClick:p,...c,title:m,children:u?t(o,{className:`text-success`}):t(v,{className:`size-4`})})});Dt.displayName=`CopyButton`;function Ot({buttonLabel:e,title:r,children:i,onClick:a}){return t(`div`,{className:`flex items-center justify-center h-full text-center`,children:n(`div`,{className:`py-12`,children:[t(`svg`,{className:`mx-auto size-12`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,children:t(`path`,{vectorEffect:`non-scaling-stroke`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z`})}),t(`h3`,{className:`mt-2 text-sm font-semibold`,children:r}),t(`p`,{className:`mt-1 text-sm text-muted`,children:i}),t(`div`,{className:`mt-6`,children:n(K,{onClick:a,children:[t(E,{className:`-ms-0.5 me-1.5 size-5`,"aria-hidden":`true`}),e]})})]})})}function kt(e){return e.isFile}function At(e){return e.isDirectory}function jt(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Mt({children:e,onUpload:r}){let i=I(null);return n(`label`,{style:{cursor:`pointer`},children:[e,t(`input`,{ref:i,type:`file`,style:{display:`none`},onChange:()=>{i.current?.files&&r(jt(i.current.files))}})]})}function Nt({onUpload:e}){let r=Lt({onUpload:e});return t(`div`,{...r,className:`flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600`,children:n(`label`,{htmlFor:`dropzone-file`,className:`flex flex-col items-center justify-center w-full h-full`,children:[n(`div`,{className:`flex flex-col items-center justify-center pt-5 pb-6`,children:[t(`svg`,{className:`w-8 h-8 mb-4 text-gray-500 dark:text-gray-400`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 20 16`,children:t(`path`,{stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2`})}),n(`p`,{className:`mb-2 text-sm text-gray-500 dark:text-gray-400`,children:[t(`span`,{className:`font-semibold`,children:`Click to upload`}),` or drag and drop`]}),t(`p`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:`SVG, PNG, JPG or GIF (MAX. 800x400px)`})]}),t(`input`,{id:`dropzone-file`,type:`file`,className:`hidden`})]})})}function Pt(e){if(!e)return!1;let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t}function Ft(e){if(!e)return!1;let t=e.__dragOver_cnt__;return t?(e.__dragOver_cnt__=t-1,t===1):!1}function It(e){e&&delete e.__dragOver_cnt__}function Lt({onUpload:e,dragOverClass:t=`is-drag-over-on`,dropEffect:n=`copy`}){let r=I(null);return{onDrop:n=>{n.preventDefault(),It(r.current),r.current?.classList.remove(t);let i=n.dataTransfer.items;if(i){let t=[],n=(e,t=``)=>new Promise(r=>{if(kt(e))e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if(At(e)){let i=e.createReader(),a=[],o=()=>{i.readEntries(i=>{if(!i.length)Promise.all(a).then(e=>r(e.flat()));else{for(let r of i)a.push(n(r,`${t+e.name}/`));o()}})};o()}});for(let e=0;e<i.length;e++){let r=i[e].webkitGetAsEntry();r&&t.push(n(r))}Promise.all(t).then(t=>{let n=t.flat();n.length&&e(n)})}},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=n},onDragEnter:()=>{Pt(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{Ft(r.current)&&r.current?.classList.remove(t)},ref:r}}function Rt(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` `):void 0}function zt(){try{return _e.isDev}catch{return!1}}function Bt({description:e,helpText:i,error:a,required:o,label:s,className:c,direction:l=`column`,children:u,disabled:d=!1,fullWidthLabel:f=!1,childrenId:p}){let m=le(),h=le(),g=le(),_=p??m,v=I(!1),b=ne.toArray(u).filter(se),x=b.length===1?b[0]:void 0,S=x?.type===re,C=!!x&&!S,w=!1,T=u;if(C&&x){let e=x,t=e.props??{},n=Rt(t[`aria-describedby`],i?h:void 0,a?g:void 0),r=t[`aria-invalid`]??(a?!0:void 0);T=ie(e,{id:t.id??_,"aria-describedby":n,"aria-invalid":r}),w=!0}else zt()&&!v.current&&(i||a||p===void 0)&&(v.current=!0,console.warn("[@vertesia/ui] FormItem received zero, multiple, or a fragment as element children. ARIA wiring skipped. Pass `childrenId` and set `id` / `aria-describedby` / `aria-invalid` on your input manually, or wrap the input in a single non-fragment element."));let E=w||p?_:void 0;return n(`div`,{className:r(`flex w-full space-y-1`,c,l===`row`?`flex-row justify-between items-center gap-2`:l===`row-reverse`?`flex-row-reverse justify-between items-center gap-2`:`flex-col`),children:[n(`div`,{className:r(`flex items-center gap-1 mb-0`,f&&`w-full`),children:[n(`label`,{htmlFor:E,className:`text-sm font-medium mb-1 ${d?`text-muted`:``} ${f&&`flex-1`}`,children:[s,o?t(`span`,{className:`text-destructive -mt-4 ms-1`,children:`*`}):``]}),e&&t(`div`,{className:`mx-2 flex w-4 items-center`,children:t(St,{description:e,children:t(y,{className:`size-3 text-muted`})})})]}),T,i&&t(`p`,{id:h,className:`text-xs text-muted`,children:i}),a&&t(`p`,{id:g,className:`text-xs text-destructive`,children:a})]})}function Vt(e){return t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e(t))}}const Ht=z(`inline-flex items-center rounded-md px-2 py-1 text-xs font-medium`,{variants:{variant:{default:`text-foreground bg-muted`,secondary:`bg-secondary text-primary`,destructive:`bg-destructive text-destructive`,attention:`bg-attention text-attention`,success:`bg-success text-success`,info:`bg-info text-info`,done:`bg-done text-done`,outline:`bg-transparent border border-border text-foreground`}},defaultVariants:{variant:`default`}});function Ut({className:e,variant:n,children:r,onClick:i,...a}){let o=i?{role:`button`,tabIndex:0,onClick:i,onKeyDown:Vt(i)}:{};return t(`span`,{className:G(Ht({variant:n}),e),...o,...a,children:r})}const Wt=z(`inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ring-border`,{variants:{variant:{default:``,success:``,destructive:``,attention:``,done:``,info:``,outline:``}},defaultVariants:{variant:`default`}}),Gt=z(`h-1.5 w-1.5`,{variants:{variant:{default:`fill-foreground`,success:`fill-success`,destructive:`fill-destructive`,attention:`fill-attention`,done:`fill-done`,info:`fill-info`,outline:`fill-foreground`}},defaultVariants:{variant:`default`}});function Kt({variant:e,className:r,dotClassName:i,children:a,...o}){return n(`span`,{className:G(Wt({variant:e}),r),...o,children:[t(`div`,{className:`flex-shrink-0`,children:t(`svg`,{className:G(Gt({variant:e}),i),viewBox:`0 0 6 6`,"aria-hidden":`true`,children:t(`circle`,{cx:3,cy:3,r:3})})}),t(`span`,{className:`truncate`,children:a})]})}function qt({value:e=[],onChange:i,className:a,delimiters:o=`, `,placeholder:s,autoFocus:c,disabled:l=!1}){let[u,d]=L(``),f=t=>{if(l)return;let n=t.currentTarget.value;n?.trim()&&(i([...e,n.trim()]),d(``))},p=t=>{if(l)return;let n=t.currentTarget.value,r=!n.trim(),a=t.key;a===`Enter`||o.indexOf(a)>-1?(t.preventDefault(),e&&!r&&(i([...e,n.trim()]),d(``))):a===`Backspace`&&r&&e&&e.length>0&&(e.pop(),i([...e]))},m=t=>{if(l)return;let n=t.clipboardData.getData(`text`);if(n){t.preventDefault();let r=o.split(``).map(e=>e===` `?`\\s`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),a=RegExp(`[${r}]+`),s=n.split(a).map(e=>e.trim()).filter(e=>e.length>0);s.length>0&&i([...e,...s]),d(``)}},h=t=>{l||e&&e.length>0&&(e.splice(t,1),i([...e]))};return n(`div`,{className:r(a,`w-full flex flex-wrap items-center gap-1 p-2 py-1.5`,`rounded-md text-sm rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,l&&`opacity-50 cursor-not-allowed`),children:[e&&e.length>0&&e.map((e,n)=>t(St,{description:`click to remove`,children:t(Ut,{variant:`secondary`,onClick:()=>h(n),className:r(`flex-shrink-0 transition-colors`,l?`cursor-not-allowed`:`cursor-pointer hover:bg-destructive hover:text-destructive`),title:e,children:t(`span`,{className:`break-all`,children:e})})},`item-${n}`)),t(`input`,{className:`flex-1 min-w-[80px] m-0 p-0 px-1 border-0 bg-transparent text-sm placeholder:text-muted focus:outline-none focus:ring-0 disabled:cursor-not-allowed`,type:`text`,value:u,onBlur:f,onKeyDown:p,onPaste:m,onChange:e=>d(e.currentTarget.value),placeholder:!e||e.length===0?s:``,autoFocus:c,disabled:l})]})}function Jt({underline:e=`always`,className:n,children:i,...a}){let o;return e===`always`?o=`underline`:e===`hover`&&(o=`hover:underline`),t(`a`,{className:r(`text-indigo-800 dark:text-indigo-300`,n,o),...a,children:i})}function Yt({className:e,children:n}){return t(`ul`,{className:`${e} space-y-1 flex flex-col items-start`,children:n})}Yt.Item=oe(function(e,n){let{current:i,children:a,className:o,href:s=`#`,onClick:c,...l}=e;return t(`li`,{className:r(o,i?`bg-muted`:``,`w-full p-2 ps-3 text-sm leading-6 font-semibold hover:bg-muted`),children:t(`a`,{ref:n,href:s,onClick:e=>{c?(e.preventDefault(),c(e)):s===`#`&&e.preventDefault()},className:`w-full flex items-center gap-x-3`,...l,children:a})})});const Xt=`rounded-md text-sm flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,Zt={INPUT_UNSTYLED:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,INPUT_NO_PADDING:Xt,INPUT:`${Xt} py-1.5`};function Qt(e){return e==null||Number.isNaN(e)?``:e.toString()}const $t=N.forwardRef(({value:e,onChange:n,className:i,noScroll:a=!1,noSpinners:o=!1,...s},c)=>{let[l,u]=N.useState(Qt(e));return F(()=>{if(e==null||!Number.isNaN(e)){let t=Qt(e);u(t)}},[e]),t(`input`,{onWheel:a?e=>{e.currentTarget.blur()}:s.onWheel,type:`number`,value:l,onChange:e=>{let t=e.target.value;u(t),t===``?n?.(void 0,t):n?.(parseFloat(t),t)},className:r(i,Zt.INPUT,{"no-spinners":o},o&&`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`),ref:c,...s})});function en({children:e,overlayContent:r,className:i=``,overlayClassName:a=``,position:o=`right`,width:s,height:c,showCloseButton:l=!0,onOpen:u,onClose:d,triggerClassName:f=``,backdropClassName:p=``,animationConfig:m={type:`spring`,stiffness:300,damping:30}}){let[h,g]=L(!1),_=()=>{g(!0),u?.()},v=()=>{g(!1),d?.()},y=tn(o),b=nn(o,s,c);return n(`div`,{className:`flex items-center justify-center w-full ${i}`,children:[t(K,{variant:`unstyled`,size:`none`,onClick:_,className:`w-full align-left cursor-pointer ${f}`,children:e}),h&&t(`div`,{className:`z-45 fixed inset-0 bg-black bg-opacity-50 ${p}`,children:n(ye.div,{...y,transition:m,className:`${b} ${a}`,children:[l&&t(`div`,{className:`absolute top-2 end-2 z-10`,children:t(K,{onClick:v,variant:`primary`,children:t(j,{})})}),t(`div`,{className:l?`mt-8`:``,children:r})]})})]})}function tn(e){switch(e){case`left`:return{initial:{x:`-100%`},animate:{x:0},exit:{x:`-100%`}};case`right`:return{initial:{x:`100%`},animate:{x:0},exit:{x:`100%`}};case`top`:return{initial:{y:`-100%`},animate:{y:0},exit:{y:`-100%`}};case`bottom`:return{initial:{y:`100%`},animate:{y:0},exit:{y:`100%`}};case`center`:return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}};default:return{initial:{x:`100%`},animate:{x:0},exit:{x:`100%`}}}}function nn(e,t,n){let r=`fixed bg-white shadow-lg p-4 relative`;switch(e){case`left`:return`${r} left-0 top-[var(--header-height)] h-full ${t||`w-80`}`;case`right`:return`${r} right-0 top-[var(--header-height)] h-full ${t||`w-80`}`;case`top`:return`${r} top-[var(--header-height)] start-0 end-0 ${n||`h-80`}`;case`bottom`:return`${r} bottom-0 start-0 end-0 ${n||`h-80`}`;case`center`:return`${r} top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 ${t||`w-96`} ${n||`max-h-96`}`;default:return`${r} right-0 top-[var(--header-height)] h-full ${t||`w-80`}`}}const rn=`--tailwind-portal`;function an({children:e}){let n=I(null),[r,i]=L(null);return F(()=>{if(n.current){let e=n.current.ownerDocument,t=e.getElementById(rn);t||(t=e.createElement(`DIV`),t.id=rn,e.body.appendChild(t)),i(t)}},[]),r?fe(e,r):t(`span`,{ref:n})}function on({path:e,maxItems:r=3,className:i,separator:a}){let o=e||[],s=e=>{let n=typeof e.label==`string`&&e.label.length>20?`${e.label.slice(0,17)}...`:e.label;return e.onClick?t(dn,{onClick:e.onClick,href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):e.href?t(dn,{href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):t(fn,{children:n})};if(o.length<=r)return t(sn,{className:G(`w-full flex items-center`,i),children:t(cn,{children:o.map((e,r)=>n(M.Fragment,{children:[t(ln,{children:s(e)}),r<o.length-1&&t(pn,{children:a??t(u,{className:`cn-rtl-flip`})})]},`crumb-${r}`))})});let c=o.slice(-(r-1));return t(sn,{className:G(`w-full flex items-center`,i),children:n(cn,{children:[t(ln,{children:t(mn,{})}),t(pn,{children:a??t(u,{className:`cn-rtl-flip`})}),c.map((e,r)=>n(M.Fragment,{children:[t(ln,{children:s(e)}),r<c.length-1&&t(pn,{children:a??t(u,{className:`cn-rtl-flip`})})]},`crumb-${r}`))]})})}const sn=M.forwardRef(({...e},n)=>t(`nav`,{ref:n,"aria-label":`breadcrumb`,...e}));sn.displayName=`Breadcrumb`;const cn=M.forwardRef(({className:e,...n},r)=>t(`ol`,{ref:r,className:G(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted sm:gap-2.5`,e),...n}));cn.displayName=`BreadcrumbList`;const ln=M.forwardRef(({className:e,...n},r)=>t(`li`,{ref:r,className:G(`inline-flex items-center gap-1.5 text-muted`,e),...n}));ln.displayName=`BreadcrumbItem`;const un=M.forwardRef(({asChild:e,className:n,...r},i)=>t(`a`,{ref:i,className:G(`transition-colors hover:text-muted`,n),...r}));un.displayName=`BreadcrumbLink`;const dn=M.forwardRef(({className:e,href:n,onClick:r,...i},a)=>t(K,{variant:`ghost`,size:`md`,ref:a,className:G(`p-0! hover:underline! hover:bg-background!`,e),onClick:e=>{e.preventDefault(),r&&r(e)},...i}));dn.displayName=`BreadcrumbButton`;const fn=M.forwardRef(({className:e,...n},r)=>t(`span`,{ref:r,"aria-current":`page`,className:G(`font-normal text-foreground`,e),...n}));fn.displayName=`BreadcrumbPage`;const pn=({children:e,className:n,...r})=>t(`li`,{role:`presentation`,"aria-hidden":`true`,className:G(`[&>svg]:w-3.5 [&>svg]:h-3.5`,n),...r,children:e??t(u,{className:`cn-rtl-flip`})});pn.displayName=`BreadcrumbSeparator`;const mn=({className:e,...r})=>n(`span`,{role:`presentation`,"aria-hidden":`true`,className:G(`flex h-9 w-9 items-center justify-center`,e),...r,children:[t(T,{className:`h-4 w-4`}),t(`span`,{className:`sr-only`,children:`More`})]});mn.displayName=`BreadcrumbEllipsis`;const hn=M.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:G(`rounded-xl border bg-card text-card-foreground shadow`,e),...n}));hn.displayName=`Card`;const gn=M.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:G(`flex flex-col p-6`,e),...n}));gn.displayName=`CardHeader`;const _n=M.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:G(`font-semibold leading-none tracking-tight`,e),...n}));_n.displayName=`CardTitle`;const vn=M.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:G(`text-sm text-muted-foreground`,e),...n}));vn.displayName=`CardDescription`;const yn=M.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:G(`p-6 pt-0`,e),...n}));yn.displayName=`CardContent`;const bn=M.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:G(`flex items-center p-6 pt-0`,e),...n}));bn.displayName=`CardFooter`;const xn=M.forwardRef(({className:e,...n},r)=>t(be.Root,{ref:r,className:G(`peer size-4 shrink-0 rounded-sm border border-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-white`,e),...n,children:t(be.Indicator,{className:G(`flex items-center justify-center text-current`),children:t(o,{className:`size-4`})})}));xn.displayName=be.Root.displayName;function Sn({...e}){return t(xe.Root,{"data-slot":`collapsible`,...e})}function Cn({...e}){return t(xe.Trigger,{"data-slot":`collapsible-trigger`,...e})}function wn({...e}){return t(xe.Content,{"data-slot":`collapsible-content`,...e})}function Tn({children:e}){return t(`span`,{style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`},children:e})}const En=ae(!1);function Dn(){return!!ce(En)}function On({children:e}){return t(En.Provider,{value:!0,children:e})}function kn({className:e,children:r,isOpen:i,onClose:a,description:o=`Modal Description`,noCloseButton:s=!1,allowOverflow:c=!1,disableCloseOnClickOutside:l=!1,size:u=`md`,action:d}){let f=e=>{e||a()};function p(){switch(u){case`sm`:return`max-w-[20vw]`;case`md`:return`max-w-[60vw] lg:max-w-[40vw]`;case`lg`:return`max-w-[80vw] md:max-w-[60vw]`;case`xl`:return`max-w-[95vw] lg:max-w-[80vw]`;case`full`:return`h-[calc(100vh-2rem)] max-w-[calc(100vw-2rem)]`;default:return`max-w-[60vw] lg:max-w-[40vw]`}}return n(Nn,{open:i,onOpenChange:e=>{(!l||e)&&f(e)},children:[c&&t(Ln,{className:`z-50 fixed inset-0 bg-black/80`}),t(Tn,{children:t(zn,{children:o})}),n(Rn,{className:G(`min-h-20 p-4`,`fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 sm:rounded-lg`,p(),e),children:[t(`div`,{className:`top-4 end-4 absolute`,children:n(`div`,{className:`flex gap-2`,children:[d&&d,!s&&t(In,{onClick:()=>f(!1),asChild:!0,autoFocus:!1,children:t(K,{variant:`outline`,title:`Close`,className:`data-[state=open]:bg-accent opacity-70 hover:opacity-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-ring ring-offset-background focus:ring-offset-2 data-[state=open]:text-muted-foreground transition-opacity disabled:pointer-events-none`,children:t(j,{className:`size-4`})})})]})}),t(On,{children:r})]})]})}const An=({children:e,show:r=!0,className:i,description:a,showDivider:o=!1,...s})=>r?n(Bn,{className:G(o?`border-b-solid border-b border-b-1 pb-2 mb-4`:``,`text-lg font-semibold leading-6 tracking-tight`,{"py-2":!a},i),...s,children:[e,a&&t(zn,{className:`text-sm !font-normal text-muted-foreground pb-2`,children:a})]}):n(Tn,{children:[t(Bn,{children:e}),a&&t(zn,{children:a})]}),jn=({children:e,className:n,...r})=>t(`div`,{className:G(`text-sm max-h-[80vh] overflow-y-auto`,n),...r,children:e}),Mn=({align:e=`right`,children:n,className:r,...i})=>t(`div`,{className:G(`w-full flex py-3 sm:py-2 sm:flex sm:flex-row-reverse sm:flex-row sm:justify-end gap-2`,{left:`justify-start`,center:`justify-center`,right:`justify-end`}[e],r),...i,children:n}),Nn=H.Root,Pn=H.Trigger,Fn=H.Portal,In=H.Close,Ln=M.forwardRef(({className:e,...n},r)=>t(H.Overlay,{ref:r,className:G(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...n}));Ln.displayName=H.Overlay.displayName;const Rn=M.forwardRef(({className:e,children:r,...i},a)=>{let o=_t();return n(Fn,{container:o,children:[t(Ln,{}),t(H.Content,{ref:a,className:G(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...i,children:r})]})});Rn.displayName=H.Content.displayName;const zn=M.forwardRef(({className:e,...n},r)=>t(H.Description,{ref:r,className:G(`text-sm text-muted`,e),...n}));zn.displayName=H.Description.displayName;const Bn=M.forwardRef(({className:e,...n},r)=>t(H.Title,{ref:r,className:G(`text-lg font-semibold leading-none tracking-tight`,e),...n}));Bn.displayName=H.Title.displayName;const Vn=M.forwardRef(({className:e,...n},r)=>t(V,{ref:r,className:G(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...n}));Vn.displayName=V.displayName;const Hn=({children:e,...n})=>t(Nn,{...n,children:t(Rn,{className:`shadow-lg p-0 overflow-hidden`,children:t(Vn,{className:`[&_[cmdk-group]]:px-2 [&_[cmdk-item]]:px-2 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:w-5 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,children:e})})}),Un=M.forwardRef(({className:e,...r},i)=>n(`div`,{className:`flex items-center px-3 border-b`,"cmdk-input-wrapper":``,children:[t(D,{className:`opacity-50 size-4 shrink-0`}),t(V.Input,{ref:i,className:G(`focus:ring-0`,`border-0 flex h-8 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...r})]}));Un.displayName=V.Input.displayName;const Wn=M.forwardRef(({className:e,...n},r)=>t(V.List,{ref:r,className:G(`overflow-y-auto overflow-x-hidden`,e),...n}));Wn.displayName=V.List.displayName;const Gn=M.forwardRef((e,n)=>t(V.Empty,{ref:n,className:`py-2 text-sm text-center`,...e}));Gn.displayName=V.Empty.displayName;const q=M.forwardRef(({className:e,...n},r)=>t(V.Group,{ref:r,className:G(`overflow-y-auto overflow-x-hidden p-1 text-foreground`,`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...n}));q.displayName=V.Group.displayName;const Kn=M.forwardRef(({className:e,...n},r)=>t(V.Separator,{ref:r,className:G(`-mx-1 h-px bg-border`,e),...n}));Kn.displayName=V.Separator.displayName;const J=M.forwardRef(({className:e,...n},r)=>t(V.Item,{ref:r,className:G(`hover:bg-muted cursor-pointer relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,e),...n}));J.displayName=V.Item.displayName;const qn=({className:e,...n})=>t(`span`,{className:G(`ms-auto text-xs tracking-widest text-muted-foreground`,e),...n});qn.displayName=`CommandShortcut`;const Jn=M.createContext(!1);function Yn({...e}){return t(U.Root,{"data-slot":`dropdown-menu`,...e})}function Xn({...e}){return t(U.Portal,{"data-slot":`dropdown-menu-portal`,...e})}function Zn({...e}){return t(U.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function Qn({className:e,align:n=`start`,sideOffset:r=4,...i}){return t(U.Portal,{children:t(U.Content,{"data-slot":`dropdown-menu-content`,sideOffset:r,align:n,className:G(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden`,e),...i})})}function $n({...e}){return t(U.Group,{"data-slot":`dropdown-menu-group`,...e})}function er({className:e,inset:n,variant:r=`default`,...i}){return t(U.Item,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":r,className:G(`hover:bg-muted focus:bg-muted data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive gap-2 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...i})}function tr({className:e,children:r,checked:i,inset:a,...o}){return n(U.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:G(`focus:bg-muted focus:text-muted focus:**:text-muted gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),checked:i,...o,children:[t(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:t(U.ItemIndicator,{children:t(s,{})})}),r]})}function nr({...e}){return t(U.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function rr({className:e,children:r,inset:i,...a}){return n(U.RadioItem,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:G(`focus:bg-muted focus:text-muted focus:**:text-muted gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[t(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-radio-item-indicator`,children:t(U.ItemIndicator,{children:t(s,{})})}),r]})}function ir({className:e,inset:n,...r}){return t(U.Label,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:G(`text-muted px-1.5 py-1 text-xs font-medium data-inset:ps-7`,e),...r})}function ar({className:e,...n}){return t(U.Separator,{"data-slot":`dropdown-menu-separator`,className:G(`bg-border -mx-1 my-1 h-px`,e),...n})}function or({className:e,...n}){return t(`span`,{"data-slot":`dropdown-menu-shortcut`,className:G(`text-muted group-focus/dropdown-menu-item:text-muted ms-auto text-xs tracking-widest`,e),...n})}function sr({...e}){return t(U.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function cr({className:e,inset:r,children:i,...a}){return n(U.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":r,className:G(`focus:bg-muted focus:text-muted data-open:bg-muted data-open:text-muted not-data-[variant=destructive]:focus:**:text-muted gap-2 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[i,t(d,{className:`cn-rtl-flip ms-auto`})]})}function lr({className:e,...n}){return t(U.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:G(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-lg p-1 shadow-lg ring-1 duration-100 z-50 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden`,e),...n})}const ur={left:`start`,center:`center`,right:`end`};function dr({trigger:e,children:r,align:i=`right`,hover:a}){let[o,s]=M.useState(!1),c=M.useRef(null);return a?n(`div`,{className:`relative inline-flex`,onMouseEnter:()=>{c.current&&clearTimeout(c.current),s(!0)},onMouseLeave:()=>{c.current=setTimeout(()=>s(!1),80)},children:[e,o&&t(`div`,{className:G(`absolute top-full pt-1 z-50`,i===`right`?`end-0`:i===`center`?`left-1/2 -translate-x-1/2`:`start-0`),children:t(`div`,{className:`min-w-32 rounded-lg p-1 shadow-md ring-1 ring-foreground/10 bg-popover text-popover-foreground`,children:t(Jn.Provider,{value:!0,children:r})})})]}):n(Yn,{children:[t(Zn,{asChild:!0,children:t(`span`,{className:`-m-1.5 flex items-center p-1.5`,children:e})}),t(Qn,{align:ur[i],className:`w-max`,children:r})]})}function fr({children:e,label:r}){return n($n,{children:[r&&t(ir,{children:r}),e]})}function pr({children:e,href:n,onClick:r,isDisabled:i=!1,variant:a=`default`,className:o}){let s=M.useContext(Jn),c=G(`w-full gap-2 rounded-md px-1.5 py-1 text-sm text-nowrap [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,a===`destructive`?`text-destructive`:``,i?`pointer-events-none opacity-50`:`hover:bg-muted focus:bg-muted`,o);return s?n?t(`a`,{href:n,className:c,children:e}):t(`button`,{type:`button`,className:c,disabled:i,onClick:e=>{e.stopPropagation(),r?.(e)},children:e}):t(er,{className:G(`data-[disabled]:pointer-events-none data-[disabled]:opacity-50 text-nowrap`,o),disabled:i,variant:a,onClick:e=>{e.stopPropagation(),r?.(e)},asChild:!!n,children:n?t(`a`,{href:n,children:e}):e})}const mr=({children:e,className:n})=>{let r=I(null),[i,a]=L(`auto`);return F(()=>{if(r.current){let e=new ResizeObserver(e=>{let t=e[0].contentRect.height;a(t)});return e.observe(r.current),()=>{e.disconnect()}}},[]),t(`div`,{className:G(n,`overflow-hidden transition-all duration-100 ease-in`),style:{height:i},children:t(`div`,{ref:r,children:e})})};Ce.extend(Te),Ce.extend(we);var Y=Ce;const hr=M.createContext(null),X=({hover:e=!1,click:n=!1,modal:r,children:i,_open:a,onOpenChange:o})=>{let[s,c]=M.useState(a||!1);return t(hr.Provider,{value:{open:s,setOpen:c,hover:e,click:n},children:t(W.Root,{open:s,onOpenChange:e=>{c(e),o&&o(e)},modal:r,children:i})})};function gr(e=!1,t=()=>{},n){e&&t(n===`enter`)}const Z=M.forwardRef(({children:e,...n},r)=>{let i=M.useContext(hr);if(!i)throw Error(`PopoverTrigger must be used within a Popover`);let{setOpen:a,hover:o,click:s}=i;return t(W.Trigger,{ref:r,asChild:!0,onMouseEnter:()=>gr(o,a,`enter`),onMouseLeave:()=>gr(o,a,`leave`),onClick:()=>{s&&a(e=>!e)},...n,children:e})});Z.displayName=W.Trigger.displayName;const _r=W.Anchor,Q=M.forwardRef(({className:e,align:n=`center`,side:r=`bottom`,...i},a)=>{let o=M.useContext(hr);if(!o)throw Error(`PopoverContent must be used within a Popover`);let{setOpen:s,hover:c}=o,l=_t();return t(W.Portal,{container:l,children:t(W.Content,{ref:a,align:n,side:r,onMouseEnter:()=>gr(c,s,`enter`),onMouseLeave:()=>gr(c,s,`leave`),className:G(`z-50 w-72 rounded-md border-popover bg-popover text-popover-foreground ring-1 ring-gray-200 dark:ring-slate-700 shadow-md focus:outline-none animate-in`,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})})});Q.displayName=W.Content.displayName;const vr=W.Close;vr.displayName=W.Close.displayName;function yr(){let e=M.useContext(hr);if(!e)throw Error(`usePopoverContext must be used within a Popover`);return{...e,close:()=>e.setOpen(!1)}}const br=`
1
+ import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import r,{clsx as i}from"clsx";import*as a from"react";import o,{Children as s,Component as c,Fragment as l,cloneElement as u,createContext as d,createElement as f,forwardRef as p,isValidElement as m,useCallback as h,useContext as g,useEffect as _,useId as v,useImperativeHandle as y,useInsertionEffect as b,useLayoutEffect as x,useMemo as S,useRef as C,useState as w}from"react";import*as T from"react-dom";import{createPortal as E}from"react-dom";import{SUPPORTED_LANGUAGES as D,useLanguage as O,useUITranslation as k}from"@vertesia/ui/i18n";import{cva as A}from"class-variance-authority";import{twMerge as j}from"tailwind-merge";import{DismissableLayer as M,useDismissableLayerSurface as N}from"@radix-ui/react-dismissable-layer";import{arrow as P,autoUpdate as ee,computePosition as te,flip as F,hide as ne,limitShift as re,offset as ie,shift as ae,size as oe}from"@floating-ui/dom";import{Env as se}from"@vertesia/ui/env";import{FocusScope as ce}from"@radix-ui/react-focus-scope";import{useFocusGuards as le}from"@radix-ui/react-focus-guards";import{RemoveScroll as ue}from"react-remove-scroll";import{hideOthers as de}from"aria-hidden";import{useDirection as fe}from"@radix-ui/react-direction";import pe from"dayjs";import me from"dayjs/plugin/localizedFormat";import he from"dayjs/plugin/relativeTime";import{isEqual as ge}from"lodash-es";import*as _e from"react-resizable-panels";var ve=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});function ye(e){switch(e){case`xs`:return`size-4`;case`sm`:return`size-6`;case`md`:return`size-8`;case`lg`:return`size-10`;case`xl`:return`size-12`;case`2xl`:return`size-14`;default:throw Error(`Unexpected size: ${e}`)}}function be({size:e,src:n,name:r,shape:i=`circle`,color:a=`bg-gray-500`,className:o}){let s=i===`circle`?`rounded-full`:`rounded-md`,c=ye(e||`md`);if(n)return t(`img`,{className:`inline-block ${c} ${s} ${a} ${o}`,src:n,alt:r||n,title:r});if(r){let[n,i]=r.split(` `),l=i?`${n[0]}${i[0]}`:`${n[0]}${n[1]}`;return t(`span`,{className:`inline-flex ${c} items-center justify-center ${s} ${a} ${o}`,title:r,children:t(`span`,{className:`${e===`xs`?`text-[0.6rem]`:`text-xs`} font-medium leading-none text-white`,children:l})})}return t(`span`,{className:`inline-block ${c} overflow-hidden ${s} ${a}`,children:t(`svg`,{className:`h-full w-full text-gray-300`,fill:`currentColor`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:t(`path`,{d:`M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z`})})})}function xe({size:e,shape:n=`circle`,color:r=`bg-gray-500`,className:i,children:a}){let o=n===`circle`?`rounded-full`:`rounded-md`,s=ye(e||`md`);return t(`span`,{className:`inline-block ${s} overflow-hidden ${o} ${r} ${i}`,children:a})}function Se({className:e,children:n}){return t(`div`,{className:r(`flex items-center justify-center`,e),children:n})}
2
+ /**
3
+ * @license lucide-react v1.31.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ const Ce=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),we=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Te=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Ee=e=>{
9
+ /**
10
+ * @license lucide-react v1.31.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ /**
16
+ * @license lucide-react v1.31.0 - ISC
17
+ *
18
+ * This source code is licensed under the ISC license.
19
+ * See the LICENSE file in the root directory of this source tree.
20
+ */
21
+ /**
22
+ * @license lucide-react v1.31.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */
27
+ let t=Te(e);return t.charAt(0).toUpperCase()+t.slice(1)};
28
+ /**
29
+ * @license lucide-react v1.31.0 - ISC
30
+ *
31
+ * This source code is licensed under the ISC license.
32
+ * See the LICENSE file in the root directory of this source tree.
33
+ */
34
+ var De={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};
35
+ /**
36
+ * @license lucide-react v1.31.0 - ISC
37
+ *
38
+ * This source code is licensed under the ISC license.
39
+ * See the LICENSE file in the root directory of this source tree.
40
+ */
41
+ const Oe=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ke=d({}),Ae=()=>g(ke),je=p(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{
42
+ /**
43
+ * @license lucide-react v1.31.0 - ISC
44
+ *
45
+ * This source code is licensed under the ISC license.
46
+ * See the LICENSE file in the root directory of this source tree.
47
+ */
48
+ /**
49
+ * @license lucide-react v1.31.0 - ISC
50
+ *
51
+ * This source code is licensed under the ISC license.
52
+ * See the LICENSE file in the root directory of this source tree.
53
+ */
54
+ let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:p=`currentColor`,className:m=``}=Ae()??{},h=r??d?Number(n??u)*24/Number(t??l):n??u;return f(`svg`,{ref:c,...De,width:t??l??De.width,height:t??l??De.height,stroke:e??p,strokeWidth:h,className:Ce(`lucide`,m,i),...!a&&!Oe(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>f(e,t)),...Array.isArray(a)?a:[a]])}),I=(e,t)=>{
55
+ /**
56
+ * @license lucide-react v1.31.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */
61
+ let n=p(({className:n,...r},i)=>f(je,{ref:i,iconNode:t,className:Ce(`lucide-${we(Ee(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Ee(e),n},Me=I(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ne=I(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Pe=I(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Fe=I(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Ie=I(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Le=I(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Re=I(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),L=I(`computer`,[[`rect`,{width:`14`,height:`8`,x:`5`,y:`2`,rx:`2`,key:`wc9tft`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h2`,key:`rwmk9e`}],[`path`,{d:`M12 18h6`,key:`aqd8w3`}]]),ze=I(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Be=I(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Ve=I(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),He=I(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),Ue=I(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),We=I(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Ge=I(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Ke=I(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),qe=I(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Je=I(`square-plus`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),Ye=I(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Xe=I(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Ze=I(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]])
62
+ /**
63
+ * @license lucide-react v1.31.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */
68
+ /**
69
+ * @license lucide-react v1.31.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */
74
+ /**
75
+ * @license lucide-react v1.31.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */
80
+ /**
81
+ * @license lucide-react v1.31.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */
86
+ /**
87
+ * @license lucide-react v1.31.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */
92
+ /**
93
+ * @license lucide-react v1.31.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */
98
+ /**
99
+ * @license lucide-react v1.31.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */
104
+ /**
105
+ * @license lucide-react v1.31.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */
110
+ /**
111
+ * @license lucide-react v1.31.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */
116
+ /**
117
+ * @license lucide-react v1.31.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */
122
+ /**
123
+ * @license lucide-react v1.31.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */
128
+ /**
129
+ * @license lucide-react v1.31.0 - ISC
130
+ *
131
+ * This source code is licensed under the ISC license.
132
+ * See the LICENSE file in the root directory of this source tree.
133
+ */
134
+ /**
135
+ * @license lucide-react v1.31.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */
140
+ /**
141
+ * @license lucide-react v1.31.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */
146
+ /**
147
+ * @license lucide-react v1.31.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */
152
+ /**
153
+ * @license lucide-react v1.31.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */
158
+ /**
159
+ * @license lucide-react v1.31.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */
164
+ /**
165
+ * @license lucide-react v1.31.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */
170
+ /**
171
+ * @license lucide-react v1.31.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */
176
+ /**
177
+ * @license lucide-react v1.31.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */
182
+ /**
183
+ * @license lucide-react v1.31.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */
188
+ ;function Qe(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`;case`ne`:return`sw`;case`nw`:return`se`;case`se`:return`nw`;case`sw`:return`ne`;default:return e}}function $e(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var et=class{left;top;width;height;alignAxis;gap;constructor(e=0){this.gap=e}position(e,t,n){switch(e){case`top`:this.top=t.top-n.height-this.gap,this.alignAxis=`x`;break;case`bottom`:this.top=t.bottom+this.gap,this.alignAxis=`x`;break;case`left`:this.left=t.left-n.width-this.gap,this.alignAxis=`y`;break;case`right`:this.left=t.right+this.gap,this.alignAxis=`y`;break;case`ne`:this.top=t.top-n.height-this.gap,this.left=t.right+this.gap;break;case`nw`:this.top=t.top-n.height-this.gap,this.left=t.left-n.width-this.gap;break;case`se`:this.top=t.bottom+this.gap,this.left=t.right+this.gap;break;case`sw`:this.top=t.bottom+this.gap,this.left=t.left-n.width-this.gap}}align(e,t,n){if(this.alignAxis)switch(e){case`start`:this.alignAxis===`x`?this.left=t.left:this.top=t.top;break;case`end`:this.alignAxis===`x`?this.left=t.right-n.width:this.top=t.bottom-n.height;break;case`center`:this.alignAxis===`x`?this.left=t.left+t.width/2-n.width/2:this.top=t.top+t.height/2-n.height/2;break;case`fill`:this.alignAxis===`x`?(this.left=t.left,this.width=t.right-t.left):(this.top=t.top,this.height=t.bottom-t.top)}}computePosition(e,t,n){if(this.position(e.position,n,t),e.align&&this.align(e.align,n,t),!this.left&&!this.top)throw Error(`Invalid position. Cannot compute x,y coordinates`);let r=this.width!=null,i=this.height!=null,a=this.width??t.width,o=this.height??t.height;return{rect:new DOMRect(this.left??0,this.top??0,a,o),constrainWidth:r,constrainHeight:i,position:e.position,align:e.align}}flipAxis(e,t){if(this.alignAxis===t){if(e.align){let t=$e(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=Qe(e.position);if(t!==e.position)return{...e,position:t}}return null}};function tt(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}function nt(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function rt(e,t,n,r){let i=new et(e.gap),a=i.computePosition(e,t,n),o=nt(a.rect,r,`x`),s=nt(a.rect,r,`y`);if(o&&s)return a;let c=null;return o||(c=i.flipAxis(e,`x`)),s||(c=i.flipAxis(c||e,`y`)),c?(a=new et(i.gap).computePosition(c,t,n),tt(a.rect,r)?a:null):null}function it(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return i<=n||a<=r?null:new DOMRect(n,r,i-n,a-r)}function at(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=it(e[n].getBoundingClientRect(),t),!t)return null;return t}function ot(e){let t=e.scrollHeight>e.clientHeight,n=e.scrollWidth>e.clientWidth;if(t||n){let r=getComputedStyle(e);if(t&&r.overflowY!==`visible`||n&&r.overflowX!==`visible`)return!0}return!1}function st(e,t=document.documentElement){let n=[],r=e.parentElement;for(;r&&r!==t;)ot(r)&&n.push(r),r=r.parentElement;return n.push(t),n}var ct=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=st(this.anchor,this.root),this.visibleClientRect=at(this.scrollableParents)}get anchor(){return this.options.anchor}registerListeners(e){let t=this.scrollableParents,n=()=>{this.update()};window.addEventListener(`resize`,n);for(let e of t)e.addEventListener(`scroll`,n);let r;this.options.closeOnClick&&(r=t=>{e.contains(t.target)||this.tryClose()},window.setTimeout(()=>{r&&document.addEventListener(`click`,r)},0));let i;this.options.closeOnEsc&&(i=e=>{e.key===`Escape`&&this.tryClose()},window.setTimeout(()=>{i&&document.addEventListener(`keydown`,i)},0));let a=this.options.blockPageScroll;return a&&(document.body.style.overflow=`hidden`,document.body.style.height=`100%`),()=>{window.removeEventListener(`resize`,n);for(let e of t)e.removeEventListener(`scroll`,n);r&&document.removeEventListener(`click`,r),i&&document.removeEventListener(`keydown`,i),a&&(document.body.style.overflow=``,document.body.style.height=``)}}open(e,t){if(this.context)throw Error(`The popup controller is already bound to an element`);this.tryOpen(e,t)}tryOpen(e,t){this.context||(this.context={element:e,constraints:t,cleanup:this.registerListeners(e)},e.style.display=``,e.style.visibility=`hidden`,this.update(),this.options.onOpen?.(this))}close(){if(!this.context)throw Error(`The popup controller is not bound to an element`);this.tryClose()}tryClose(){this.context&&=(this.options.onClose?.(this),this.context.cleanup(),this.context.element.style.display=`none`,void 0)}get isOpen(){return!!this.context}update(){if(!this.context)return;let e=this.context.element,t=this.context.constraints,n=e.getBoundingClientRect(),r=this.anchor.getBoundingClientRect(),i=this.visibleClientRect;if(!i)return;let a=rt(t,n,r,i);this.context.position=a||void 0,a&&(a.constrainHeight&&(e.style.height=`${a.rect.height}px`),a.constrainWidth&&(e.style.width=`${a.rect.width}px`),e.style.left=`${a.rect.left}px`,e.style.top=`${a.rect.top}px`,e.style.visibility=`visible`)}createPopupElement(){let e=document.createElement(`div`);return e.style.margin=`0`,e.style.padding=`0`,e.style.border=`none`,e.style.background=`transparent`,e.className=`composable-Popup`,e}};const lt=d(void 0);function ut(){let e=g(lt);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function dt({ctrlRef:e,id:n,constraints:r,isOpen:i,children:a,className:o,onClose:s,onOpen:c,zIndex:l,position:u,anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h}){let g=C(null),[v,y]=w(),b=C(s),x=C(c);return b.current=s,x.current=c,_(()=>{if(!d)throw Error(`Anchor element is required`);let e=new ct({anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h,onClose:()=>b.current?.(),onOpen:()=>x.current?.()});return y(e),()=>{e.tryClose()}},[d,h,p,m,f]),_(()=>{e&&(e.current=v)},[v,e]),_(()=>{v&&g.current?v.isOpen!==i&&(i?v.open(g.current,r):v.close()):v?.isOpen&&!i&&v.close()},[r,i,v]),t(lt.Provider,{value:v,children:i&&E(t(`div`,{id:n,style:{visibility:`hidden`,position:u||`absolute`,zIndex:l||100},ref:g,className:o,children:a}),document.body)})}function ft({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(dt,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function pt(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var mt=class{filter(e,t){let n=t.toLowerCase();return e.filter(e=>this.valueOf(e).toLowerCase().includes(n))}renderOption(e){return this.valueOf(e)}findById(e,t){return e.find(e=>this.idOf(e)===t)}createItem(e){return null}},ht=class e extends mt{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},gt=class e extends ht{createItem(e){return e}static instance=new e};function _t(e,t){return{buttonRight:4,buttonWidth:24,maxMenuHeight:240,menuClass:`w-72 mt-1 border-popover bg-popover text-popover-foreground shadow-md overflow-auto p-0 z-10`,inputClass:r(t?`block m-0 p-0 border-0 focus:outline-none focus:ring-0`:`block sm:text-sm sm:leading-6 bg-muted rounded-md border-0 shadow-sm ring-1 ring-inset ring-muted placeholder:text-muted focus:ring-2 focus:ring-inset focus:ring-primary py-1.5`,e?`w-full`:`!w-auto`),optionClass:`py-2 px-3 shadow-sm flex flex-col [&.option-selected]:font-semibold [&.option-highlighted]:bg-blue-300`,Input:yt,Menu:xt,Toggle:bt}}function vt({menuAlign:r=`fill`,menuGap:i,focusOnMount:a,onSelect:s,value:c,zIndex:l,unstyledInput:u,fullWidth:d,api:f,layout:p,adapter:m,items:h,placeholder:g,clearable:v,noMatchMessage:y,openOnFocus:b}){let[x]=w(pt()),S=C(void 0),T=C(null),E=p?Object.assign(_t(d,u),p):_t(d,u),D=o.useRef(null),O=St({adapter:m,items:h,value:c,popupId:x});_(()=>{T.current&&a&&T.current.focus()},[a]),_(()=>{O.onSelect=s,O.popupCtrl=S.current},[O,s]),_(()=>{if(f&&O&&T.current)return f.current={open:()=>O.openMenu(),close:()=>O.closeMenu(),toggle:()=>O.toggleMenu(),setInputValue:e=>O.inputText=e,inputValue:O.inputText||``,selectedItem:O.selectedItem,focus:()=>T.current?.focus()},()=>{f.current=null}},[f,O]);let k=O.isMenuOpen&&(O.filteredItems.length>0||!!y);return n(e,{children:[t(E.Input,{boxRef:D,inputRef:T,ctrl:O,layout:E,placeholder:g,clearable:v,openOnFocus:b}),t(ft,{id:x,ctrlRef:S,className:`combobox-popup`,closeOnClick:!0,closeOnEsc:!0,onClose:()=>O.closeMenu(),isOpen:k,anchor:D,zIndex:l,constraints:{position:`bottom`,align:r,gap:i??4},children:t(E.Menu,{fillWidth:r===`fill`,items:O.filteredItems,ctrl:O,layout:E,adapter:m,noMatchMessage:y})})]})}function yt({inputRef:e,placeholder:r,boxRef:i,ctrl:a,layout:o,clearable:s,openOnFocus:c}){let l=o.Toggle,u=s&&a.selectedItem!=null,d=+!!l+ +!!u,f=d>0?{paddingRight:`${o.buttonWidth*d+o.buttonRight}px`}:void 0;return n(`div`,{className:`relative`,ref:i,children:[t(`input`,{ref:e,placeholder:r,...a.getInputProps(),onFocus:c?()=>a.openMenu():void 0,style:f,className:o.inputClass}),n(`div`,{style:{position:`absolute`,right:`${o.buttonRight}px`,top:0,bottom:0,display:`flex`,alignItems:`center`,gap:`2px`},children:[u&&t(`button`,{type:`button`,style:{border:`none`,padding:0,margin:0,backgroundColor:`transparent`,cursor:`pointer`,display:`flex`,alignItems:`center`,width:`${o.buttonWidth}px`},onClick:()=>{a.selectedItem=null},children:t(Ze,{className:`w-4 h-4`})}),l&&t(`button`,{type:`button`,style:{width:`${o.buttonWidth}px`,border:`none`,padding:0,margin:0,backgroundColor:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`},...a.getToggleButtonProps(),children:t(l,{ctrl:a,layout:o})})]})]})}function bt({ctrl:e}){return e.isMenuOpen?t(Fe,{className:`w-4 h-4`}):t(Ne,{className:`w-4 h-4`})}function xt({fillWidth:e,items:n,layout:i,ctrl:a,adapter:o,noMatchMessage:s}){let{highlightedIndex:c,selectedItem:l}=a;return n.length===0?s?t(`div`,{style:{width:e?`100%`:void 0},className:i.menuClass,children:s}):null:t(`ul`,{style:{width:e?`100%`:void 0,maxHeight:i.maxMenuHeight?`${i.maxMenuHeight}px`:`240px`},className:i.menuClass,...a.getMenuProps(),children:n.map((e,n)=>t(`li`,{"data-index":n,className:r(i.optionClass,c===n&&`option-highlighted`,l===e&&`option-selected`),...a.getItemProps(e,n),children:o.renderOption(e)},o.idOf(e)))})}function St(e){let[t,n]=w(new Ct(e));return _(()=>{t?.withState(n)},[t]),t}var Ct=class e{popupId;items;adapter;onSelect;setState;_selectedItem=null;_filteredItems;_inputText=``;_highlightedIndex=null;_isMenuOpen=!1;popupCtrl;constructor({adapter:e,items:t,value:n,popupId:r}){this.adapter=e,this.items=t,this.popupId=r,typeof n==`string`?this._inputText=n:n&&(this._selectedItem=e.findById(t,e.idOf(n))||null,this._selectedItem&&(this._inputText=e.valueOf(n))),this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items}withState(e){return this.setState=e,this}clone(){let t=new e({adapter:this.adapter,items:this.items,popupId:this.popupId});return t.setState=this.setState,t.onSelect=this.onSelect,t._inputText=this._inputText,t._highlightedIndex=this._highlightedIndex,t._selectedItem=this._selectedItem,t._isMenuOpen=this._isMenuOpen,t._filteredItems=this._filteredItems,t.popupCtrl=this.popupCtrl,t}updateState(){this.setState?.(this.clone())}get filteredItems(){return this._inputText?this.adapter.filter(this.items,this._inputText):this.items}get selectedItem(){return this._selectedItem}set selectedItem(e){this._selectedItem=e,this._inputText=e?this.adapter.valueOf(e):``,this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items,this.updateState(),this.onSelect?.(e)}get isMenuOpen(){return this._isMenuOpen}set inputText(e){if(this._inputText=e,this._filteredItems=e?this.adapter.filter(this.items,e):this.items,this._highlightedIndex=null,this._selectedItem=null,this.updateState(),this.isMenuOpen&&this.popupCtrl){let e=this.popupCtrl,t=e.context?.position?.position;t&&t===`top`&&window.setTimeout(()=>{e.update()},100)}}get inputText(){return this._inputText}set highlightedIndex(e){this._highlightedIndex=e,this.updateState()}get highlightedIndex(){return this._highlightedIndex}openMenu(){this._filteredItems.length>0&&(this._isMenuOpen=!0,this.updateState())}closeMenu(e){this._isMenuOpen&&(this._highlightedIndex=null,this._isMenuOpen=!1,this.updateState())}toggleMenu(){this._isMenuOpen?this.closeMenu():this.openMenu()}highlightIndex(e,t=!1){this.highlightedIndex=e;let n=document.getElementById(this.popupId);n&&n.querySelector(`li[data-index="${e}"]`)?.scrollIntoView(t)}getMenuProps(){return{}}getToggleButtonProps(){return{onClick:()=>{this._isMenuOpen=!this._isMenuOpen,this.updateState()}}}getItemProps(e,t){return{"aria-selected":this._highlightedIndex===t,onClick:()=>{this.selectedItem=e,this.closeMenu()},onMouseEnter:()=>{this.highlightedIndex!==t&&(this.highlightedIndex=t)},onMouseLeave:()=>{this.highlightedIndex===t&&(this.highlightedIndex=null)}}}getInputProps(){let e=this._filteredItems;return{onClick:()=>{this.openMenu()},onChange:e=>{let t=e.target.value;this.inputText=t,this.openMenu()},value:this.inputText,onKeyDown:t=>{let n=t.key;if(n===`Enter`){if(this.highlightedIndex!=null)this.selectedItem=e[this.highlightedIndex||0];else if(this.inputText){let e=this.adapter.createItem(this.inputText);e&&(this.items.push(e),this.selectedItem=e)}this.closeMenu()}else n===`ArrowDown`?this.isMenuOpen?this.highlightIndex(this.highlightedIndex===null?0:wt(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:Tt(this.highlightedIndex,e.length),!0)}}}};function wt(e,t){return(e+1)%t}function Tt(e,t){return(e-1+t)%t}function Et({options:e,creatable:n,...r}){let i=n?gt.instance:ht.instance;return t(vt,{adapter:i,items:e,...r})}function Dt({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}var Ot=Object.defineProperty,kt=(e,t)=>Ot(e,`name`,{value:t,configurable:!0});function At(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}kt(At,`setRef`);function jt(...e){return t=>{let n=!1,r=e.map(e=>{let r=At(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():At(e[t],null)}}}}kt(jt,`composeRefs`);function R(...e){return a.useCallback(jt(...e),e)}kt(R,`useComposedRefs`);var Mt=Object.defineProperty,Nt=(e,t)=>Mt(e,`name`,{value:t,configurable:!0});function Pt(e){let t=a.forwardRef((t,n)=>{let{children:r,...i}=t,o=null,s=!1,c=[];Ut(r)&&typeof qt==`function`&&(r=qt(r._payload)),a.Children.forEach(r,e=>{if(Vt(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ut(n)&&typeof qt==`function`&&(n=qt(n._payload)),o=Rt(t,n),c.push(o?.props?.children)}else c.push(e)}),o?o=a.cloneElement(o,void 0,c):!s&&a.Children.count(r)===1&&a.isValidElement(r)&&(o=r);let l=o?Bt(o):void 0,u=R(n,l);if(!o){if(r||r===0)throw Error(s?Kt(e):Gt(e));return r}let d=zt(i,o.props??{});return o.type!==a.Fragment&&(d.ref=n?u:l),a.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}Nt(Pt,`createSlot`);var Ft=Pt(`Slot`),It=Symbol.for(`radix.slottable`);function Lt(e){let t=Nt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=It,t}Nt(Lt,`createSlottable`);var Rt=Nt((e,t)=>{if(`child`in e.props){let t=e.props.child;return a.isValidElement(t)?a.cloneElement(t,void 0,e.props.children(t.props.children)):null}return a.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function zt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Nt(zt,`mergeProps`);function Bt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Nt(Bt,`getElementRef`);function Vt(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===It}Nt(Vt,`isSlottable`);var Ht=Symbol.for(`react.lazy`);function Ut(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ht&&`_payload`in e&&Wt(e._payload)}Nt(Ut,`isLazyComponent`);function Wt(e){return typeof e==`object`&&!!e&&`then`in e}Nt(Wt,`isPromiseLike`);var Gt=Nt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Kt=Nt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),qt=a.use;function z(...e){return j(i(e))}var Jt=Object.defineProperty,Yt=(e,t)=>Jt(e,`name`,{value:t,configurable:!0}),Xt=!!(typeof window<`u`&&window.document&&window.document.createElement);function B(e,t,{checkForDefaultPrevented:n=!0}={}){return Yt(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Yt(B,`composeEventHandlers`);function Zt(e){if(!Xt)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Yt(Zt,`getOwnerWindow`);function Qt(e){if(!Xt)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Yt(Qt,`getOwnerDocument`);function $t(e,t=!1){let{activeElement:n}=Qt(e);if(!n?.nodeName)return null;if(en(n)&&n.contentDocument)return $t(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Qt(n).getElementById(e);if(t)return t}}return n}Yt($t,`getActiveElement`);function en(e){return e.tagName===`IFRAME`}Yt(en,`isFrame`);var tn=Object.defineProperty,nn=(e,t)=>tn(e,`name`,{value:t,configurable:!0});function rn(e,n){let r=a.createContext(n);r.displayName=e+`Context`;let i=nn(e=>{let{children:n,...i}=e,o=a.useMemo(()=>i,Object.values(i));return t(r.Provider,{value:o,children:n})},`Provider`);i.displayName=e+`Provider`;function o(t,i={}){let{optional:o=!1}=i,s=a.useContext(r);if(s)return s;if(n!==void 0)return n;if(!o)throw Error(`\`${t}\` must be used within \`${e}\``)}return nn(o,`useContext`),[i,o]}nn(rn,`createContext`);function an(e,n=[]){let r=[];function i(n,i){let o=a.createContext(i);o.displayName=n+`Context`;let s=r.length;r=[...r,i];let c=nn(n=>{let{scope:r,children:i,...c}=n,l=r?.[e]?.[s]||o,u=a.useMemo(()=>c,Object.values(c));return t(l.Provider,{value:u,children:i})},`Provider`);c.displayName=n+`Provider`;function l(t,r,c={}){let{optional:l=!1}=c,u=r?.[e]?.[s]||o,d=a.useContext(u);if(d)return d;if(i!==void 0)return i;if(!l)throw Error(`\`${t}\` must be used within \`${n}\``)}return nn(l,`useContext`),[c,l]}nn(i,`createContext`);let o=nn(()=>{let t=r.map(e=>a.createContext(e));return nn(function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return o.scopeName=e,[i,on(o,...n)]}nn(an,`createContextScope`);function on(...e){let t=e[0];if(e.length===1)return t;let n=nn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return nn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}nn(on,`composeContextScopes`);var sn=globalThis?.document?a.useLayoutEffect:()=>{},cn=Object.defineProperty,ln=(e,t)=>cn(e,`name`,{value:t,configurable:!0}),un=a.useId||(()=>void 0),dn=0;function V(e){let[t,n]=a.useState(un());return sn(()=>{e||n(e=>e??String(dn++))},[e]),e||(t?`radix-${t}`:``)}ln(V,`useId`);var fn=typeof document<`u`?x:function(){};function pn(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 n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!pn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!pn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function mn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function hn(e,t){let n=mn(e);return Math.round(t*n)/n}function gn(e){let t=a.useRef(e);return fn(()=>{t.current=e}),t}function _n(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=a.useState(r);pn(p,r)||m(r);let[h,g]=a.useState(null),[_,v]=a.useState(null),y=a.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=a.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=a.useRef(null),w=a.useRef(null),E=a.useRef(d),D=l!=null,O=gn(l),k=gn(i),A=gn(u),j=a.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),te(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!pn(E.current,t)&&(E.current=t,T.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);fn(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=a.useRef(!1);fn(()=>(M.current=!0,()=>{M.current=!1}),[]),fn(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=a.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=a.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=a.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=hn(P.floating,d.x),r=hn(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...mn(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return a.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:ee}),[d,j,N,P,ee])}const vn=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:P({element:r.current,padding:i}).fn(n):r?P({element:r,padding:i}).fn(n):{}}}},yn=(e,t)=>{let n=ie(e);return{name:n.name,fn:n.fn,options:[e,t]}},bn=(e,t)=>{let n=ae(e);return{name:n.name,fn:n.fn,options:[e,t]}},xn=(e,t)=>({fn:re(e).fn,options:[e,t]}),Sn=(e,t)=>{let n=F(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cn=(e,t)=>{let n=oe(e);return{name:n.name,fn:n.fn,options:[e,t]}},wn=(e,t)=>{let n=ne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tn=(e,t)=>{let n=vn(e);return{name:n.name,fn:n.fn,options:[e,t]}};var En=Object.defineProperty,Dn=(e,t)=>En(e,`name`,{value:t,configurable:!0}),H=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=Pt(`Primitive.${n}`),i=a.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function On(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}Dn(On,`dispatchDiscreteCustomEvent`);var kn=Object.defineProperty,An=(e,t)=>kn(e,`name`,{value:t,configurable:!0});function jn(e){let t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}An(jn,`useCallbackRef`);var Mn=Object.defineProperty,Nn=(e,t)=>Mn(e,`name`,{value:t,configurable:!0});function Pn(e){let[t,n]=a.useState(void 0);return sn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Nn(Pn,`useSize`);var Fn=Object.defineProperty,In=(e,t)=>Fn(e,`name`,{value:t,configurable:!0}),Ln=`Popper`,[Rn,zn]=an(Ln),[Bn,Vn]=Rn(Ln),Hn=In(e=>{let{__scopePopper:n,children:r}=e,[i,o]=a.useState(null),[s,c]=a.useState(void 0);return t(Bn,{scope:n,anchor:i,onAnchorChange:o,placementState:s,setPlacementState:c,children:r})},`Popper`),Un=`PopperAnchor`,Wn=a.forwardRef(In(function(e,n){let{__scopePopper:r,virtualRef:i,...o}=e,s=Vn(Un,r),c=a.useRef(null),l=s.onAnchorChange,u=R(n,a.useCallback(e=>{c.current=e,e&&l(e)},[l])),d=a.useRef(null);a.useEffect(()=>{if(!i)return;let e=d.current;d.current=i.current,e!==d.current&&l(d.current)});let f=s.placementState&&Zn(s.placementState),p=f?.[0],m=f?.[1];return i?null:t(H.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...o,ref:u})},`PopperAnchor`)),Gn=`PopperContent`,[Kn,qn]=Rn(Gn),Jn=a.forwardRef(In(function(e,n){let{__scopePopper:r,side:i=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=Vn(Gn,r),[y,b]=a.useState(null),x=R(n,b),[S,C]=a.useState(null),w=Pn(S),T=w?.width??0,E=w?.height??0,D=i+(s===`center`?``:`-`+s),O=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(d)?d:[d],A=k.length>0,j={padding:O,boundary:k.filter(Yn),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:te,middlewareData:F}=_n({strategy:`fixed`,placement:D,whileElementsMounted:In((...e)=>ee(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[yn({mainAxis:o+E,alignmentAxis:c}),u&&bn({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?xn():void 0,...j}),u&&Sn({...j}),Cn({...j,apply:In(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&Tn({element:S,padding:l}),Xn({arrowWidth:T,arrowHeight:E}),m&&wn({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),ne=v.setPlacementState;sn(()=>(ne(P),()=>{ne(void 0)}),[P,ne]);let[re,ie]=Zn(P),ae=jn(g);sn(()=>{te&&ae?.()},[te,ae]);let oe=F.arrow?.x,se=F.arrow?.y,ce=F.arrow?.centerOffset!==0,[le,ue]=a.useState();return sn(()=>{y&&ue(window.getComputedStyle(y).zIndex)},[y]),t(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:te?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:t(Kn,{scope:r,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:t(H.div,{"data-side":re,"data-align":ie,..._,ref:x,style:{..._.style,animation:te?_.style?.animation:`none`}})})})},`PopperContent`));function Yn(e){return e!==null}In(Yn,`isNotNull`);var Xn=In(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Zn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Zn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}In(Zn,`getSideAndAlignFromPlacement`);var Qn=Hn,$n=Wn,er=Jn,tr=Object.defineProperty,nr=a.forwardRef(((e,t)=>tr(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[o,s]=a.useState(!1);sn(()=>s(!0),[]);let c=r||o&&globalThis?.document?.body;return c?T.createPortal(t(H.div,{...i,ref:n}),c):null},`Portal`)),rr=Object.defineProperty,ir=(e,t)=>rr(e,`name`,{value:t,configurable:!0});function ar(e,t){return a.useReducer((e,n)=>t[e][n]??e,e)}ir(ar,`useStateMachine`);var or=ir(e=>{let{present:t,children:n}=e,r=sr(t),i=typeof n==`function`?n({present:r.isPresent}):a.Children.only(n),o=lr(r.ref,dr(i));return typeof n==`function`||r.isPresent?a.cloneElement(i,{ref:o}):null},`Presence`);function sr(e){let[t,n]=a.useState(),r=a.useRef(null),i=a.useRef(e),o=a.useRef(`none`),s=a.useRef(void 0),[c,l]=ar(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return a.useEffect(()=>{c===`mounted`?(o.current=s.current??ur(r.current),s.current=void 0):o.current=`none`},[c]),sn(()=>{let t=r.current,n=i.current;if(n!==e){let r=o.current,a=ur(t);e?(s.current=a,l(`MOUNT`)):a===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==a?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),sn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=ir(a=>{let o=ur(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=ir(e=>{e.target===t&&(o.current=ur(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,a),t.addEventListener(`animationend`,a),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,a),t.removeEventListener(`animationend`,a)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:a.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=ur(t)}else r.current=null;n(e)},[])}}ir(sr,`usePresence`);function cr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ir(cr,`setRef`);function lr(...e){let t=a.useRef(e);return t.current=e,a.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=cr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():cr(n[e],null)}}},[])}ir(lr,`useStableComposedRefs`);function ur(e){return e?.animationName||`none`}ir(ur,`getAnimationName`);function dr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ir(dr,`getElementRef`);var fr=Object.defineProperty,pr=(e,t)=>fr(e,`name`,{value:t,configurable:!0}),mr=a.useEffectEvent,hr=a.useInsertionEffect;function gr(e){if(typeof mr==`function`)return mr(e);let t=a.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof hr==`function`?hr(()=>{t.current=e}):sn(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}pr(gr,`useEffectEvent`);var _r=Object.defineProperty,vr=(e,t)=>_r(e,`name`,{value:t,configurable:!0}),yr=a.useInsertionEffect||sn;function br({prop:e,defaultProp:t,onChange:n=vr(()=>{},`onChange`),caller:r}){let[i,o,s]=xr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,a.useCallback(t=>{if(c){let n=Sr(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}vr(br,`useControllableState`);function xr({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return yr(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}vr(xr,`useUncontrolledState`);function Sr(e){return typeof e==`function`}vr(Sr,`isFunction`);var Cr=Symbol(`RADIX:SYNC_STATE`);function wr(e,t,n,r){let{prop:i,defaultProp:o,onChange:s,caller:c}=t,l=i!==void 0,u=gr(s),d=[{...n,state:o}];r&&d.push(r);let[f,p]=a.useReducer((t,n)=>{if(n.type===Cr)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=a.useRef(m);a.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=a.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return a.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:Cr,state:i})},[i,f.state,l]),[g,p]}vr(wr,`useControllableStateReducer`);var Tr=Object.defineProperty,Er=(e,t)=>Tr(e,`name`,{value:t,configurable:!0}),Dr=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`}),Or=a.forwardRef(Er(function(e,n){return t(H.span,{...e,ref:n,style:{...Dr,...e.style}})},`VisuallyHidden`)),kr=Object.defineProperty,Ar=(e,t)=>kr(e,`name`,{value:t,configurable:!0}),[jr,Mr]=an(`Tooltip`,[zn]),Nr=zn(),Pr=`TooltipProvider`,Fr=700,Ir=`tooltip.open`,[Lr,Rr]=jr(Pr),zr=Ar(e=>{let{__scopeTooltip:n,delayDuration:r=Fr,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:s}=e,c=a.useRef(!0),l=a.useRef(!1),u=a.useRef(0);return a.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),t(Lr,{scope:n,isOpenDelayedRef:c,delayDuration:r,onOpen:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),c.current=!1)},[i]),onClose:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:a.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:s})},`TooltipProvider`),Br=`Tooltip`,[Vr,Hr]=jr(Br),Ur=Ar(e=>{let{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=Rr(Br,e.__scopeTooltip),d=Nr(n),[f,p]=a.useState(null),[m,h]=a.useState(void 0),g=V(),_=a.useRef(0),v=c??u.disableHoverableContent,y=l??u.delayDuration,b=a.useRef(!1),[x,S]=br({prop:i,defaultProp:o??!1,onChange:Ar(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(Ir))):u.onClose(),s?.(e)},`onChange`),caller:Br}),C=a.useMemo(()=>x?b.current?`delayed-open`:`instant-open`:`closed`,[x]),w=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,b.current=!1,S(!0)},[S]),T=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,S(!1)},[S]),E=a.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{b.current=!0,S(!0),_.current=0},y)},[y,S]);a.useEffect(()=>()=>{_.current&&=(window.clearTimeout(_.current),0)},[]);let D=m??g;return t(Qn,{...d,children:t(Vr,{scope:n,contentId:D,setContentId:h,open:x,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:a.useCallback(()=>{u.isOpenDelayedRef.current?E():w()},[u.isOpenDelayedRef,E,w]),onTriggerLeave:a.useCallback(()=>{v?T():(window.clearTimeout(_.current),_.current=0)},[T,v]),onOpen:w,onClose:T,disableHoverableContent:v,children:r})})},`Tooltip`),Wr=`TooltipTrigger`,Gr=a.forwardRef(Ar(function(e,n){let{__scopeTooltip:r,...i}=e,o=Hr(Wr,r),s=Rr(Wr,r),c=Nr(r),l=R(n,a.useRef(null),o.onTriggerChange),u=a.useRef(!1),d=a.useRef(!1),f=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),t($n,{asChild:!0,...c,children:t(H.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:l,onPointerMove:B(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:B(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:B(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:B(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:B(e.onBlur,o.onClose),onClick:B(e.onClick,o.onClose)})})},`TooltipTrigger`)),Kr=`TooltipPortal`,[qr,Jr]=jr(Kr,{forceMount:void 0}),Yr=Ar(e=>{let{__scopeTooltip:n,forceMount:r,children:i,container:a}=e,o=Hr(Kr,n);return t(qr,{scope:n,forceMount:r,children:t(or,{present:r||o.open,children:t(nr,{asChild:!0,container:a,children:i})})})},`TooltipPortal`),Xr=`TooltipContent`,Zr=a.forwardRef(Ar(function(e,n){let r=Jr(Xr,e.__scopeTooltip),{forceMount:i=r.forceMount,side:a=`top`,...o}=e,s=Hr(Xr,e.__scopeTooltip);return t(or,{present:i||s.open,children:s.disableHoverableContent?t(ei,{side:a,...o,ref:n}):t(Qr,{side:a,...o,ref:n})})},`TooltipContent`)),Qr=a.forwardRef(Ar(function(e,n){let r=Hr(Xr,e.__scopeTooltip),i=Rr(Xr,e.__scopeTooltip),o=a.useRef(null),s=R(n,o),[c,l]=a.useState(null),{trigger:u,onClose:d}=r,f=o.current,{onPointerInTransitChange:p}=i,m=a.useCallback(()=>{l(null),p(!1)},[p]),h=a.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ni(r,ti(r,n.getBoundingClientRect())),a=ri(t.getBoundingClientRect()),o=ai([...i,...a]);l(o),p(!0)},[p]);return a.useEffect(()=>()=>m(),[m]),a.useEffect(()=>{if(u&&f){let e=Ar(e=>h(e,f),`handleTriggerLeave`),t=Ar(e=>h(e,u),`handleContentLeave`);return u.addEventListener(`pointerleave`,e),f.addEventListener(`pointerleave`,t),()=>{u.removeEventListener(`pointerleave`,e),f.removeEventListener(`pointerleave`,t)}}},[u,f,h,m]),a.useEffect(()=>{if(c){let e=Ar(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!ii(n,c);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,c,d,m]),t(ei,{...e,ref:s})},`TooltipContentHoverable`)),$r=Lt(`TooltipContent`),ei=a.forwardRef(Ar(function(e,r){let{__scopeTooltip:i,children:o,"aria-label":s,id:c,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=Hr(Xr,i),p=Nr(i),{onClose:m}=f;a.useEffect(()=>(document.addEventListener(Ir,m),()=>document.removeEventListener(Ir,m)),[m]),a.useEffect(()=>{if(f.trigger){let e=Ar(e=>{e.target instanceof Node&&e.target.contains(f.trigger)&&m()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[f.trigger,m]);let{setContentId:h}=f;return sn(()=>(h(c),()=>{h(void 0)}),[c,h]),t(M,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:m,children:n(er,{"data-state":f.stateAttribute,role:s?void 0:`tooltip`,id:s?void 0:f.contentId,...p,...d,ref:r,style:{...d.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[t($r,{children:o}),s?t(Or,{id:f.contentId,role:`tooltip`,children:s}):null]})})},`TooltipContentImpl`));function ti(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Ar(ti,`getExitSideFromRect`);function ni(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Ar(ni,`getPaddedExitPoints`);function ri(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Ar(ri,`getPointsFromRect`);function ii(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Ar(ii,`isPointInPolygon`);function ai(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),oi(t)}Ar(ai,`getHull`);function oi(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Ar(oi,`getHullPresorted`);var si=zr,ci=Ur,li=Gr,ui=Yr,di=Zr;const fi=o.createContext(void 0);function pi(e,t=`plugin-portal-container`){let n=e instanceof Document?e.body:e;for(let e of Array.from(n.children))if(e instanceof HTMLElement&&e.id===t)return e;let r=document.createElement(`div`);return r.id=t,n.appendChild(r),r}function mi({children:e,id:n=`plugin-portal-container`}){let r=o.useContext(fi),i=o.useRef(null),[a,s]=o.useState(r||void 0);return o.useEffect(()=>{if(r){s(r);return}if(i.current){let e=i.current.getRootNode();if(e instanceof ShadowRoot||e instanceof Document){let t=pi(e,n);s(t)}else s(null)}},[n,r]),a===void 0?t(`div`,{ref:i,style:{display:`none`}}):t(fi.Provider,{value:a||void 0,children:e})}function hi(){return o.useContext(fi)}const gi=si,_i=ci,vi=li,yi=a.forwardRef(({className:e,sideOffset:n=4,side:r=`top`,...i},a)=>{let o=hi();return t(ui,{container:o,children:t(di,{ref:a,sideOffset:n,side:r,style:{zIndex:100},className:z(`max-w-[90vw]`,`z-50 overflow-hidden rounded-md bg-tooltips border border-border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})})});yi.displayName=di.displayName;function bi({description:e,children:r,size:i=`sm`,placement:o=`top`,className:s,asChild:c}){let[l,u]=a.useState(!1),d=a.useRef(!1);return a.useEffect(()=>{let e=()=>{u(!1),d.current=!0,requestAnimationFrame(()=>{d.current=!1})};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,e)}},[]),t(gi,{delayDuration:0,children:n(_i,{open:l,onOpenChange:e=>{d.current||u(e)},children:[t(vi,{className:`cursor-pointer`,asChild:c,children:r}),t(yi,{side:o,className:`px-3 py-1.5 max-w-${i} text-${i} px-3 ${s}`,children:e})]})})}const xi=new Set;function Si(e,t,n){_(()=>{t&&!xi.has(e)&&(xi.add(e),console.warn(`[@vertesia/ui] ${e} is deprecated: ${n}`))},[t,n,e])}function Ci(e){return a.Children.toArray(e).some(e=>{if(typeof e==`string`)return e.trim().length>0;if(typeof e==`number`)return!0;if(a.isValidElement(e)){let t=e.props;return t[`aria-hidden`]===!0||t[`aria-hidden`]===`true`?!1:Ci(t.children)}return!1})}const wi=A(`hover:cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{destructive:`bg-destructive dark:bg-destructive/10 text-destructive ring-1 ring-inset ring-destructive-muted/50 dark:ring-destructive-muted/50 shadow-xs hover:bg-destructive/50`,outline:`border border-input bg-background shadow-xs hover:bg-muted ring-inset`,secondary:`bg-primary/5 dark:bg-primary/10 text-primary shadow-xs hover:bg-primary/10 dark:hover:bg-primary/20 ring-inset`,ghost:`hover:bg-muted/50 dark:hover:bg-muted/20 ring-inset`,link:`text-foreground underline-offset-4 hover:underline ring-inset`,primary:`bg-primary text-white shadow-xs hover:bg-primary/90 ring-inset`,unstyled:``},size:{xs:`h-7 rounded px-2 py-1 text-xs gap-x-1`,sm:`h-8 rounded px-3 text-xs`,md:`h-9 rounded-md px-4 py-2`,lg:`h-10 rounded-md px-3`,xl:`rounded-md px-3.5 py-2.5 text-sm gap-x-2`,icon:`p-0 m-0 rounded-full`,none:``}},defaultVariants:{variant:`primary`,size:`md`}}),U=a.forwardRef(({className:i,variant:a,size:o,asChild:s=!1,alt:c,isDisabled:l,isLoading:u,title:d,tooltipPlacement:f=`top`,onClick:p,type:m,...h},g)=>{Si(`Button.alt`,c!==void 0,"use `title` instead — it drives the same tooltip and the accessible name. `alt` remains an alias for one release.");let _=s?Ft:`button`,v=s?m:m??`button`,y=d??c,b=h[`aria-label`]??c??(Ci(h.children)?void 0:d),x=s?h.children:n(e,{children:[u&&t(Ue,{className:`animate-spin`}),h.children]}),S=t(_,{className:r(z(wi({variant:a,size:o})),i),disabled:l||u||h.disabled,ref:g,onClick:p,type:v,autoFocus:!1,...h,"aria-label":b,children:x});return y?t(bi,{description:y,asChild:!0,className:`cursor-pointer`,size:`xs`,placement:f,children:S}):S});U.displayName=`Button`;const Ti=a.forwardRef(({size:e,content:n,toast:r,className:i,alt:a,"aria-label":o,...s},c)=>{let[l,u]=w(!1),{t:d}=k();Si(`CopyButton.alt`,a!==void 0,"use aria-label for the accessible name. `alt` is forwarded for one release.");let f=e=>{e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{u(!0),setTimeout(()=>u(!1),2e3),r?.toast&&r.toast({status:`success`,title:r.message||d(`misc.copiedToClipboard`),duration:2e3})}).catch(e=>{console.error(`Failed to copy text: `,e),r?.toast&&r.toast({status:`error`,title:d(`misc.failedToCopy`),duration:2e3})})},p=o??a??d(`misc.copy`);return t(U,{ref:c,className:z(i),variant:`unstyled`,size:e||`sm`,onClick:f,...s,title:p,children:l?t(Me,{className:`text-success`}):t(ze,{className:`size-4`})})});Ti.displayName=`CopyButton`;function Ei({buttonLabel:e,title:r,children:i,onClick:a}){return t(`div`,{className:`flex items-center justify-center h-full text-center`,children:n(`div`,{className:`py-12`,children:[t(`svg`,{className:`mx-auto size-12`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,children:t(`path`,{vectorEffect:`non-scaling-stroke`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z`})}),t(`h3`,{className:`mt-2 text-sm font-semibold`,children:r}),t(`p`,{className:`mt-1 text-sm text-muted`,children:i}),t(`div`,{className:`mt-6`,children:n(U,{onClick:a,children:[t(Ke,{className:`-ms-0.5 me-1.5 size-5`,"aria-hidden":`true`}),e]})})]})})}function Di(e){return e.isFile}function Oi(e){return e.isDirectory}function ki(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Ai({children:e,onUpload:r}){let i=C(null);return n(`label`,{style:{cursor:`pointer`},children:[e,t(`input`,{ref:i,type:`file`,style:{display:`none`},onChange:()=>{i.current?.files&&r(ki(i.current.files))}})]})}function ji({onUpload:e}){let r=Fi({onUpload:e});return t(`div`,{...r,className:`flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600`,children:n(`label`,{htmlFor:`dropzone-file`,className:`flex flex-col items-center justify-center w-full h-full`,children:[n(`div`,{className:`flex flex-col items-center justify-center pt-5 pb-6`,children:[t(`svg`,{className:`w-8 h-8 mb-4 text-gray-500 dark:text-gray-400`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 20 16`,children:t(`path`,{stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2`})}),n(`p`,{className:`mb-2 text-sm text-gray-500 dark:text-gray-400`,children:[t(`span`,{className:`font-semibold`,children:`Click to upload`}),` or drag and drop`]}),t(`p`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:`SVG, PNG, JPG or GIF (MAX. 800x400px)`})]}),t(`input`,{id:`dropzone-file`,type:`file`,className:`hidden`})]})})}function Mi(e){if(!e)return!1;let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t}function Ni(e){if(!e)return!1;let t=e.__dragOver_cnt__;return t?(e.__dragOver_cnt__=t-1,t===1):!1}function Pi(e){e&&delete e.__dragOver_cnt__}function Fi({onUpload:e,dragOverClass:t=`is-drag-over-on`,dropEffect:n=`copy`}){let r=C(null);return{onDrop:n=>{n.preventDefault(),Pi(r.current),r.current?.classList.remove(t);let i=n.dataTransfer.items;if(i){let t=[],n=(e,t=``)=>new Promise(r=>{if(Di(e))e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if(Oi(e)){let i=e.createReader(),a=[],o=()=>{i.readEntries(i=>{if(!i.length)Promise.all(a).then(e=>r(e.flat()));else{for(let r of i)a.push(n(r,`${t+e.name}/`));o()}})};o()}});for(let e=0;e<i.length;e++){let r=i[e].webkitGetAsEntry();r&&t.push(n(r))}Promise.all(t).then(t=>{let n=t.flat();n.length&&e(n)})}},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=n},onDragEnter:()=>{Mi(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{Ni(r.current)&&r.current?.classList.remove(t)},ref:r}}function Ii({description:e,size:n=`sm`,placement:r=`top`,className:i}){return e?t(bi,{description:e,placement:r,children:t(Ve,{className:z(n===`md`?`size-4`:`size-3`,`text-muted`,i)})}):null}function Li(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` `):void 0}function Ri(){try{return se.isDev}catch{return!1}}function zi({description:e,helpText:i,error:a,required:o,label:c,className:d,direction:f=`column`,children:p,disabled:h=!1,fullWidthLabel:g=!1,childrenId:_}){let y=v(),b=v(),x=v(),S=_??y,w=C(!1),T=s.toArray(p).filter(m),E=T.length===1?T[0]:void 0,D=E?.type===l,O=!!E&&!D,k=!1,A=p;if(O&&E){let e=E,t=e.props??{},n=Li(t[`aria-describedby`],i?b:void 0,a?x:void 0),r=t[`aria-invalid`]??(a?!0:void 0);A=u(e,{id:t.id??S,"aria-describedby":n,"aria-invalid":r}),k=!0}else Ri()&&!w.current&&(i||a||_===void 0)&&(w.current=!0,console.warn("[@vertesia/ui] FormItem received zero, multiple, or a fragment as element children. ARIA wiring skipped. Pass `childrenId` and set `id` / `aria-describedby` / `aria-invalid` on your input manually, or wrap the input in a single non-fragment element."));let j=k||_?S:void 0;return n(`div`,{className:r(`flex w-full space-y-1`,d,f===`row`?`flex-row justify-between items-center gap-2`:f===`row-reverse`?`flex-row-reverse justify-between items-center gap-2`:`flex-col`),children:[n(`div`,{className:r(`flex items-center gap-1 mb-0`,g&&`w-full`),children:[n(`label`,{htmlFor:j,className:`text-sm font-medium mb-1 ${h?`text-muted`:``} ${g&&`flex-1`}`,children:[c,o?t(`span`,{className:`text-destructive -mt-4 ms-1`,children:`*`}):``]}),e&&t(`div`,{className:`mx-2 flex w-4 items-center`,children:t(Ii,{description:e})})]}),A,i&&t(`p`,{id:b,className:`text-xs text-muted`,children:i}),a&&t(`p`,{id:x,className:`text-xs text-destructive`,children:a})]})}function Bi(e){return t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e(t))}}const Vi=A(`inline-flex items-center rounded-md px-2 py-1 text-xs font-medium`,{variants:{variant:{default:`text-foreground bg-muted`,secondary:`bg-secondary text-primary`,destructive:`bg-destructive text-destructive`,attention:`bg-attention text-attention`,success:`bg-success text-success`,info:`bg-info text-info`,done:`bg-done text-done`,outline:`bg-transparent border border-border text-foreground`}},defaultVariants:{variant:`default`}});function Hi({className:e,variant:n,children:r,onClick:i,...a}){let o=i?{role:`button`,tabIndex:0,onClick:i,onKeyDown:Bi(i)}:{};return t(`span`,{className:z(Vi({variant:n}),e),...o,...a,children:r})}const Ui=A(`inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ring-border`,{variants:{variant:{default:``,success:``,destructive:``,attention:``,done:``,info:``,outline:``}},defaultVariants:{variant:`default`}}),Wi=A(`h-1.5 w-1.5`,{variants:{variant:{default:`fill-foreground`,success:`fill-success`,destructive:`fill-destructive`,attention:`fill-attention`,done:`fill-done`,info:`fill-info`,outline:`fill-foreground`}},defaultVariants:{variant:`default`}});function Gi({variant:e,className:r,dotClassName:i,children:a,...o}){return n(`span`,{className:z(Ui({variant:e}),r),...o,children:[t(`div`,{className:`flex-shrink-0`,children:t(`svg`,{className:z(Wi({variant:e}),i),viewBox:`0 0 6 6`,"aria-hidden":`true`,children:t(`circle`,{cx:3,cy:3,r:3})})}),t(`span`,{className:`truncate`,children:a})]})}function Ki({value:e=[],onChange:i,className:a,delimiters:o=`, `,placeholder:s,autoFocus:c,disabled:l=!1}){let[u,d]=w(``),f=t=>{if(l)return;let n=t.currentTarget.value;n?.trim()&&(i([...e,n.trim()]),d(``))},p=t=>{if(l)return;let n=t.currentTarget.value,r=!n.trim(),a=t.key;a===`Enter`||o.indexOf(a)>-1?(t.preventDefault(),e&&!r&&(i([...e,n.trim()]),d(``))):a===`Backspace`&&r&&e&&e.length>0&&(e.pop(),i([...e]))},m=t=>{if(l)return;let n=t.clipboardData.getData(`text`);if(n){t.preventDefault();let r=o.split(``).map(e=>e===` `?`\\s`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),a=RegExp(`[${r}]+`),s=n.split(a).map(e=>e.trim()).filter(e=>e.length>0);s.length>0&&i([...e,...s]),d(``)}},h=t=>{l||e&&e.length>0&&(e.splice(t,1),i([...e]))};return n(`div`,{className:r(a,`w-full flex flex-wrap items-center gap-1 p-2 py-1.5`,`rounded-md text-sm rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,l&&`opacity-50 cursor-not-allowed`),children:[e&&e.length>0&&e.map((e,n)=>t(bi,{description:`click to remove`,children:t(Hi,{variant:`secondary`,onClick:()=>h(n),className:r(`flex-shrink-0 transition-colors`,l?`cursor-not-allowed`:`cursor-pointer hover:bg-destructive hover:text-destructive`),title:e,children:t(`span`,{className:`break-all`,children:e})})},`item-${n}`)),t(`input`,{className:`flex-1 min-w-[80px] m-0 p-0 px-1 border-0 bg-transparent text-sm placeholder:text-muted focus:outline-none focus:ring-0 disabled:cursor-not-allowed`,type:`text`,value:u,onBlur:f,onKeyDown:p,onPaste:m,onChange:e=>d(e.currentTarget.value),placeholder:!e||e.length===0?s:``,autoFocus:c,disabled:l})]})}function qi({underline:e=`always`,className:n,children:i,...a}){let o;return e===`always`?o=`underline`:e===`hover`&&(o=`hover:underline`),t(`a`,{className:r(`text-indigo-800 dark:text-indigo-300`,n,o),...a,children:i})}function Ji({className:e,children:n}){return t(`ul`,{className:`${e} space-y-1 flex flex-col items-start`,children:n})}Ji.Item=p(function(e,n){let{current:i,children:a,className:o,href:s=`#`,onClick:c,...l}=e;return t(`li`,{className:r(o,i?`bg-muted`:``,`w-full p-2 ps-3 text-sm leading-6 font-semibold hover:bg-muted`),children:t(`a`,{ref:n,href:s,onClick:e=>{c?(e.preventDefault(),c(e)):s===`#`&&e.preventDefault()},className:`w-full flex items-center gap-x-3`,...l,children:a})})});const Yi=`rounded-md text-sm flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,Xi={INPUT_UNSTYLED:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,INPUT_NO_PADDING:Yi,INPUT:`${Yi} py-1.5`};function Zi(e){return e==null||Number.isNaN(e)?``:e.toString()}const Qi=o.forwardRef(({value:e,onChange:n,className:i,noScroll:a=!1,noSpinners:s=!1,...c},l)=>{let[u,d]=o.useState(Zi(e));return _(()=>{if(e==null||!Number.isNaN(e)){let t=Zi(e);d(t)}},[e]),t(`input`,{onWheel:a?e=>{e.currentTarget.blur()}:c.onWheel,type:`number`,value:u,onChange:e=>{let t=e.target.value;d(t),t===``?n?.(void 0,t):n?.(parseFloat(t),t)},className:r(i,Xi.INPUT,{"no-spinners":s},s&&`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`),ref:l,...c})}),$i=d({});function ea(e){let t=C(null);return t.current===null&&(t.current=e()),t.current}const ta=typeof window<`u`?x:_,na=d(null);function ra(e,t){e.indexOf(t)===-1&&e.push(t)}function ia(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const aa=(e,t,n)=>n>t?t:n<e?e:n,oa={},sa=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ca=e=>typeof e==`object`&&!!e,la=e=>/^0[^.\s]+$/u.test(e);function ua(e){let t;return()=>(t===void 0&&(t=e()),t)}const da=e=>e,fa=(...e)=>e.reduce((e,t)=>n=>t(e(n))),pa=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1};var ma=class{constructor(){this.subscriptions=[]}add(e){return ra(this.subscriptions,e),()=>ia(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};const ha=e=>e*1e3,ga=e=>e/1e3,_a=(e,t)=>t?1e3/t*e:0,va=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function ya(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=va(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>1e-7&&++s<12);return o}function ba(e,t,n,r){if(e===t&&n===r)return da;let i=t=>ya(t,0,1,e,n);return e=>e===0||e===1?e:va(i(e),t,r)}const xa=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Sa=e=>t=>1-e(1-t),Ca=ba(.33,1.53,.69,.99),wa=Sa(Ca),Ta=xa(wa),Ea=e=>e>=1?1:(e*=2)<1?.5*wa(e):.5*(2-2**(-10*(e-1))),Da=e=>1-Math.sin(Math.acos(e)),Oa=Sa(Da),ka=xa(Da),Aa=ba(.42,0,1,1),ja=ba(0,0,.58,1),Ma=ba(.42,0,.58,1),Na=e=>Array.isArray(e)&&typeof e[0]!=`number`,Pa=e=>Array.isArray(e)&&typeof e[0]==`number`,Fa={linear:da,easeIn:Aa,easeInOut:Ma,easeOut:ja,circIn:Da,circInOut:ka,circOut:Oa,backIn:wa,backInOut:Ta,backOut:Ca,anticipate:Ea},Ia=e=>typeof e==`string`,La=e=>{if(Pa(e)){e.length;let[t,n,r,i]=e;return ba(t,n,r,i)}return Ia(e)?(Fa[e],`${e}`,Fa[e]):e},Ra=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function za(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}function Ba(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ra.reduce((e,t)=>(e[t]=za(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=oa.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Ra.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Ra.length;t++)o[Ra[t]].cancel(e)},state:i,steps:o}}const{schedule:W,cancel:Va,state:Ha,steps:Ua}=Ba(typeof requestAnimationFrame<`u`?requestAnimationFrame:da,!0);let Wa;function Ga(){Wa=void 0}const Ka={now:()=>(Wa===void 0&&Ka.set(Ha.isProcessing||oa.useManualTiming?Ha.timestamp:performance.now()),Wa),set:e=>{Wa=e,queueMicrotask(Ga)}},qa=e=>t=>typeof t==`string`&&t.startsWith(e),Ja=qa(`--`),Ya=qa(`var(--`),Xa=e=>Ya(e)?Za.test(e.split(`/*`)[0].trim()):!1,Za=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Qa(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}const $a={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},eo={...$a,transform:e=>aa(0,1,e)},to={...$a,default:1},no=e=>Math.round(e*1e5)/1e5,ro=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function io(e){return e==null}const ao=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,oo=(e,t)=>n=>!!(typeof n==`string`&&ao.test(n)&&n.startsWith(e)||t&&!io(n)&&Object.prototype.hasOwnProperty.call(n,t)),so=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ro);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},co=e=>aa(0,255,e),lo={...$a,transform:e=>Math.round(co(e))},uo={test:oo(`rgb`,`red`),parse:so(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+lo.transform(e)+`, `+lo.transform(t)+`, `+lo.transform(n)+`, `+no(eo.transform(r))+`)`};function fo(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const po={test:oo(`#`),parse:fo,transform:uo.transform},mo=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ho=mo(`deg`),go=mo(`%`),G=mo(`px`),_o=mo(`vh`),vo=mo(`vw`),yo={...go,parse:e=>go.parse(e)/100,transform:e=>go.transform(e*100)},bo={test:oo(`hsl`,`hue`),parse:so(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+go.transform(no(t))+`, `+go.transform(no(n))+`, `+no(eo.transform(r))+`)`},K={test:e=>uo.test(e)||po.test(e)||bo.test(e),parse:e=>uo.test(e)?uo.parse(e):bo.test(e)?bo.parse(e):po.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?uo.transform(e):bo.transform(e),getAnimatableNone:e=>{let t=K.parse(e);return t.alpha=0,K.transform(t)}},xo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function So(e){return isNaN(e)&&typeof e==`string`&&(e.match(ro)?.length||0)+(e.match(xo)?.length||0)>0}const Co=`number`,wo=`color`,To=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Eo(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(To,e=>(K.test(e)?(r.color.push(a),i.push(wo),n.push(K.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(Co),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function Do(e){return Eo(e).values}function Oo({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Co?no(r[a]):e===wo?K.transform(r[a]):r[a]}return i}}function ko(e){return Oo(Eo(e))}const Ao=e=>typeof e==`number`?0:K.test(e)?K.getAnimatableNone(e):e,jo=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Ao(e);function Mo(e){let t=Eo(e);return Oo(t)(t.values.map((e,n)=>jo(e,t.split[n])))}const No={test:So,parse:Do,createTransformer:ko,getAnimatableNone:Mo};function Po(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Fo({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Po(s,r,e+1/3),a=Po(s,r,e),o=Po(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Io(e,t){return n=>n>0?t:e}const q=(e,t,n)=>e+(t-e)*n,Lo=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Ro=[po,uo,bo],zo=e=>Ro.find(t=>t.test(e));function Bo(e){let t=zo(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===bo&&(n=Fo(n)),n}const Vo=(e,t)=>{let n=Bo(e),r=Bo(t);if(!n||!r)return Io(e,t);let i={...n};return e=>(i.red=Lo(n.red,r.red,e),i.green=Lo(n.green,r.green,e),i.blue=Lo(n.blue,r.blue,e),i.alpha=q(n.alpha,r.alpha,e),uo.transform(i))},Ho=new Set([`none`,`hidden`]);function Uo(e,t){return Ho.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Wo(e,t){return n=>q(e,t,n)}function Go(e){return typeof e==`number`?Wo:typeof e==`string`?Xa(e)?Io:K.test(e)?Vo:Yo:Array.isArray(e)?Ko:typeof e==`object`?K.test(e)?Vo:qo:Io}function Ko(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Go(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function qo(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Go(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Jo(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const Yo=(e,t)=>{let n=No.createTransformer(t),r=Eo(e),i=Eo(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ho.has(e)&&!i.values.length||Ho.has(t)&&!r.values.length?Uo(e,t):fa(Ko(Jo(r,i),i.values),n):(`${e}${t}`,Io(e,t))};function Xo(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?q(e,t,n):Go(e)(e,t)}const Zo=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>W.update(t,e),stop:()=>Va(t),now:()=>Ha.isProcessing?Ha.timestamp:Ka.now()}},Qo=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},$o=2e4;function es(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function ts(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(es(r),$o);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:ga(i)}}const J={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ns(e,t){return e*Math.sqrt(1-t*t)}function rs(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const is=.001;function as({duration:e=J.duration,bounce:t=J.bounce,velocity:n=J.velocity,mass:r=J.mass}){let i,a;J.maxDuration;let o=1-t;o=aa(J.minDamping,J.maxDamping,o),e=aa(J.minDuration,J.maxDuration,ga(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=ns(t,o),c=Math.exp(-i);return is-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=ns(t**2,o);return(-i(t)+is>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=rs(i,a,s);if(e=ha(e),isNaN(c))return{stiffness:J.stiffness,damping:J.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}const os=[`duration`,`bounce`],ss=[`stiffness`,`damping`,`mass`];function cs(e,t){return t.some(t=>e[t]!==void 0)}function ls(e){let t={velocity:J.velocity,stiffness:J.stiffness,damping:J.damping,mass:J.mass,isResolvedFromDuration:!1,...e};if(!cs(e,ss)&&cs(e,os)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*aa(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:J.mass,stiffness:i,damping:a}}else{let n=as({...e,velocity:0});t={...t,...n,mass:J.mass},t.isResolvedFromDuration=!0}}return t}function us(e=J.visualDuration,t=J.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=ls({...n,velocity:-ga(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=ga(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?J.restSpeed.granular:J.restSpeed.default,i||=v?J.restDelta.granular:J.restDelta.default;let y,b,x,S,C,w;if(h<1)x=ns(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>ha(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=ha(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=ha(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(es(T),$o),t=Qo(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}us.applyToOptions=e=>{let t=ts(e,100,us);return e.ease=t.ease,e.duration=ha(t.duration),e.type=`keyframes`,e};function ds(e,t,n){let r=Math.max(t-5,0);return _a(n-e(r),t-r)}function fs({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=us({keyframes:[f.value,m(f.value)],velocity:ds(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function ps(e,t,n){let r=[],i=n||oa.mix||Xo,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);if(t){let e=Array.isArray(t)?t[n]||da:t;a=fa(e,a)}r.push(a)}return r}function ms(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=ps(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=pa(e[r],e[r+1],n);return s[r](i)};return n?t=>l(aa(e[0],e[a-1],t)):l}function hs(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=pa(0,t,r);e.push(q(n,1,i))}}function gs(e){let t=[0];return hs(t,e.length-1),t}function _s(e,t){return e.map(e=>e*t)}function vs(e,t){return e.map(()=>t||Ma).splice(0,e.length-1)}function ys({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Na(r)?r.map(La):La(r),a={done:!1,value:t[0]},o=ms(_s(n&&n.length===t.length?n:gs(t),e),t,{ease:Array.isArray(i)?i:vs(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}const bs=e=>e!==null;function xs(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(bs),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const Ss={decay:fs,inertia:fs,tween:ys,keyframes:ys,spring:us};function Cs(e){typeof e.type==`string`&&(e.type=Ss[e.type])}var ws=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}};const Ts=e=>e/100;var Es=class extends ws{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Ka.now()&&this.tick(Ka.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Cs(e);let{type:t=ys,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||ys;s!==ys&&typeof o[0]!=`number`&&(this.mixKeyframes=fa(Ts,Xo(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=es(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=aa(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==fs&&(b.value=xs(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return ga(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+ga(e)}get time(){return ga(this.currentTime)}set time(e){e=ha(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return ds(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Ka.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=ga(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Zo,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Ka.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Ds(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Os=e=>e*180/Math.PI,ks=e=>{let t=Os(Math.atan2(e[1],e[0]));return js(t)},As={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ks,rotateZ:ks,skewX:e=>Os(Math.atan(e[1])),skewY:e=>Os(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},js=e=>(e%=360,e<0&&(e+=360),e),Ms=ks,Ns=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ps=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Fs={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ns,scaleY:Ps,scale:e=>(Ns(e)+Ps(e))/2,rotateX:e=>js(Os(Math.atan2(e[6],e[5]))),rotateY:e=>js(Os(Math.atan2(-e[2],e[0]))),rotateZ:Ms,rotate:Ms,skewX:e=>Os(Math.atan(e[4])),skewY:e=>Os(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Is(e){return+!!e.includes(`scale`)}function Ls(e,t){if(!e||e===`none`)return Is(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Fs,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=As,i=t}if(!i)return Is(t);let a=r[t],o=i[1].split(`,`).map(zs);return typeof a==`function`?a(o):o[a]}const Rs=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Ls(n,t)};function zs(e){return parseFloat(e.trim())}const Bs=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Vs=new Set([...Bs,`pathRotation`]),Hs=e=>e===$a||e===G,Us=new Set([`x`,`y`,`z`]),Ws=Bs.filter(e=>!Us.has(e));function Gs(e){let t=[];return Ws.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}const Ks={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Ls(t,`x`),y:(e,{transform:t})=>Ls(t,`y`)};Ks.translateX=Ks.x,Ks.translateY=Ks.y;const qs=new Set;let Js=!1,Ys=!1,Xs=!1;function Zs(){if(Ys){let e=Array.from(qs).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Gs(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Ys=!1,Js=!1,qs.forEach(e=>e.complete(Xs)),qs.clear()}function Qs(){qs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ys=!0)})}function $s(){Xs=!0,Qs(),Zs(),Xs=!1}var ec=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(qs.add(this),Js||(Js=!0,W.read(Qs),W.resolveKeyframes(Zs))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Ds(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),qs.delete(this)}cancel(){this.state===`scheduled`&&(qs.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const tc=e=>e.startsWith(`--`);function nc(e,t,n){tc(t)?e.style.setProperty(t,n):e.style[t]=n}const rc={};function ic(e,t){let n=ua(e);return()=>rc[t]??n()}const ac=ic(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),oc=ic(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),sc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,cc={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:sc([0,.65,.55,1]),circOut:sc([.55,0,1,.45]),backIn:sc([.31,.01,.66,-.59]),backOut:sc([.33,1.53,.69,.99])};function lc(e,t){if(e)return typeof e==`function`?oc()?Qo(e,t):`ease-out`:Pa(e)?sc(e):Array.isArray(e)?e.map(e=>lc(e,t)||cc.easeOut):cc[e]}function uc(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=lc(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function dc(e){return typeof e==`function`&&`applyToOptions`in e}function fc({type:e,...t}){return dc(e)&&oc()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var pc=class extends ws{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=fc(e);this.animation=uc(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=xs(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),nc(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return ga(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+ga(e)}get time(){return ga(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ha(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&ac()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),da):r(this)}};const mc={anticipate:Ea,backInOut:Ta,circInOut:ka};function hc(e){return e in mc}function gc(e){typeof e.ease==`string`&&hc(e.ease)&&(e.ease=mc[e.ease])}var _c=class extends pc{constructor(e){gc(e),Cs(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Es({...a,autoplay:!1}),s=Math.max(10,Ka.now()-this.startTime),c=aa(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&nc(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const vc=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(No.test(e)||e===`0`)&&!e.startsWith(`url(`));function yc(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function bc(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=vc(i,t),s=vc(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:yc(e)||(n===`spring`||dc(n))&&r}function xc(e){e.duration=0,e.type=`keyframes`}const Sc=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),Cc=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function wc(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Cc.test(e[t]))return!0;return!1}const Tc=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Ec=ua(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Dc(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Ec()&&n&&(Sc.has(n)||Tc.has(n)&&wc(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Oc=class extends ws{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ka.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||ec;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Ka.now();let u=!0;bc(e,i,a,o)||(u=!1,(oa.instantAnimations||!s)&&l?.(xs(e,n,t)),e[0]=e[e.length-1],xc(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&Dc(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new _c({...d,element:p})}catch{m=new Es(d)}else m=new Es(d);m.finished.then(()=>{this.notifyFinished()}).catch(da),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),$s()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function kc(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}const Ac=e=>!isNaN(parseFloat(e)),jc={current:void 0};var Mc=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Ka.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Ka.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ac(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new ma);let n=this.events[e].add(t);return e===`change`?()=>{n(),W.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return jc.current&&jc.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Ka.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return _a(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Nc(e,t){return new Mc(e,t)}function Pc(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Fc(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Pc(n,e)}const Ic={type:`spring`,stiffness:500,damping:25,restSpeed:10},Lc=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Rc={type:`keyframes`,duration:.8},zc={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Bc=(e,{keyframes:t})=>t.length>2?Rc:Vs.has(e)?e.startsWith(`scale`)?Lc(t[1]):Ic:zc,Vc=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Hc(e){for(let t in e)if(!Vc.has(t))return!0;return!1}const Uc=(e,t,n,r={},i,a)=>o=>{let s=Fc(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=ha(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Hc(s)||Object.assign(u,Bc(e,u)),u.duration&&=ha(u.duration),u.repeatDelay&&=ha(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(xc(u),u.delay===0&&(d=!0)),(oa.instantAnimations||oa.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,xc(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=xs(u.keyframes,s);if(e!==void 0){W.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Es(u):new Oc(u)},Wc=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gc(e){let t=Wc.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Kc(e,t,n=1){`${e}`;let[r,i]=Gc(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return sa(e)?parseFloat(e):e}return Xa(i)?Kc(i,t,n+1):i}function qc(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Jc(e,t,n,r){if(typeof t==`function`){let[i,a]=qc(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=qc(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Yc(e,t,n){let r=e.getProps();return Jc(r,t,n===void 0?r.custom:n,e)}const Xc=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Bs]),Zc=e=>Array.isArray(e);function Qc(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Nc(n))}function $c(e){return Zc(e)?e[e.length-1]||0:e}function el(e,t){let{transitionEnd:n={},transition:r={},...i}=Yc(e,t)||{};i={...i,...n};for(let t in i)Qc(e,t,$c(i[t]))}const tl=e=>!!(e&&e.getVelocity);function nl(e){return!!(tl(e)&&e.add)}function rl(e,t){let n=e.getValue(`willChange`);if(nl(n))return n.add(t);if(!n&&oa.WillChange){let n=new oa.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function il(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const al=`data-`+il(`framerAppearId`);function ol(e){return e.props[al]}function sl({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function cl(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Pc(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&sl(f,t))continue;let o={delay:n,...Fc(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){W.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=ol(e);if(n){let e=window.MotionHandoffAnimation(n,t,W);e!==null&&(o.startTime=e,p=!0)}}rl(e,t);let m=l??e.shouldReduceMotion;r.start(Uc(t,r,i,m&&Xc.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>W.update(()=>{o&&el(e,o)});d.length?Promise.all(d).then(t):t()}return d}function ll(e,t,n={}){let r=Yc(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(cl(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return ul(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function ul(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(ll(c,t,{...o,delay:n+(typeof r==`function`?0:r)+kc(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function dl(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>ll(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=ll(e,t,n);else{let i=typeof t==`function`?Yc(e,t,n.custom):t;r=Promise.all(cl(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}const fl={test:e=>e===`auto`,parse:e=>e},pl=e=>t=>t.test(e),ml=[$a,G,go,ho,vo,_o,fl],hl=e=>ml.find(pl(e));function gl(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||la(e)}const _l=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function vl(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ro)||[];if(!r)return e;let i=n.replace(r,``),a=+!!_l.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const yl=/\b([a-z-]*)\(.*?\)/gu,bl={...No,getAnimatableNone:e=>{let t=e.match(yl);return t?t.map(vl).join(` `):e}},xl={...No,getAnimatableNone:e=>{let t=No.parse(e);return No.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Sl={...$a,transform:Math.round},Cl={borderWidth:G,borderTopWidth:G,borderRightWidth:G,borderBottomWidth:G,borderLeftWidth:G,borderRadius:G,borderTopLeftRadius:G,borderTopRightRadius:G,borderBottomRightRadius:G,borderBottomLeftRadius:G,width:G,maxWidth:G,height:G,maxHeight:G,top:G,right:G,bottom:G,left:G,inset:G,insetBlock:G,insetBlockStart:G,insetBlockEnd:G,insetInline:G,insetInlineStart:G,insetInlineEnd:G,padding:G,paddingTop:G,paddingRight:G,paddingBottom:G,paddingLeft:G,paddingBlock:G,paddingBlockStart:G,paddingBlockEnd:G,paddingInline:G,paddingInlineStart:G,paddingInlineEnd:G,margin:G,marginTop:G,marginRight:G,marginBottom:G,marginLeft:G,marginBlock:G,marginBlockStart:G,marginBlockEnd:G,marginInline:G,marginInlineStart:G,marginInlineEnd:G,fontSize:G,backgroundPositionX:G,backgroundPositionY:G,rotate:ho,pathRotation:ho,rotateX:ho,rotateY:ho,rotateZ:ho,scale:to,scaleX:to,scaleY:to,scaleZ:to,skew:ho,skewX:ho,skewY:ho,distance:G,translateX:G,translateY:G,translateZ:G,x:G,y:G,z:G,perspective:G,transformPerspective:G,opacity:eo,originX:yo,originY:yo,originZ:G,zIndex:Sl,fillOpacity:eo,strokeOpacity:eo,numOctaves:Sl},wl={...Cl,color:K,backgroundColor:K,outlineColor:K,fill:K,stroke:K,borderColor:K,borderTopColor:K,borderRightColor:K,borderBottomColor:K,borderLeftColor:K,filter:bl,WebkitFilter:bl,mask:xl,WebkitMask:xl},Tl=e=>wl[e],El=new Set([bl,xl]);function Dl(e,t){let n=Tl(e);return El.has(n)||(n=No),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ol=new Set([`auto`,`none`,`0`]);function kl(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Ol.has(t)&&Eo(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Dl(n,i)}var Al=class extends ec{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Xa(r))){let i=Kc(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Xc.has(n)||e.length!==2)return;let[r,i]=e,a=hl(r),o=hl(i);if(Qa(r)!==Qa(i)&&Ks[n]){this.needsMeasurement=!0;return}if(a!==o){if(Hs(a)&&Hs(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Ks[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||gl(e[t]))&&n.push(t);n.length&&kl(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ks[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Ks[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};const jl=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function Ml(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}const Nl=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Pl(e){return ca(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}const{schedule:Fl,cancel:Il}=Ba(queueMicrotask,!1),Ll={x:!1,y:!1};function Rl(){return Ll.x||Ll.y}function zl(e){return e===`x`||e===`y`?Ll[e]?null:(Ll[e]=!0,()=>{Ll[e]=!1}):Ll.x||Ll.y?null:(Ll.x=Ll.y=!0,()=>{Ll.x=Ll.y=!1})}function Bl(e,t){let n=Ml(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Vl(e){return!(e.pointerType===`touch`||Rl())}function Hl(e,t,n={}){let[r,i,a]=Bl(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Vl(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}const Ul=(e,t)=>t?e===t||Ul(e,t.parentElement):!1,Wl=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Gl=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Kl(e){return Gl.has(e.tagName)||e.isContentEditable===!0}const ql=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Jl(e){return ql.has(e.tagName)||e.isContentEditable===!0}const Yl=new WeakSet;function Xl(e){return t=>{t.key===`Enter`&&e(t)}}function Zl(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const Ql=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Xl(()=>{if(Yl.has(n))return;Zl(n,`down`);let e=Xl(()=>{Zl(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Zl(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function $l(e){return Wl(e)&&!Rl()}const eu=new WeakSet;function tu(e,t,n={}){let[r,i,a]=Bl(e,n),o=e=>{let r=e.currentTarget;if(!$l(e)||eu.has(e))return;Yl.add(r),n.stopPropagation&&eu.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Yl.has(r)&&Yl.delete(r),$l(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Ul(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Pl(e)&&(e.addEventListener(`focus`,e=>Ql(e,i)),!Kl(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function nu(e){return ca(e)&&`ownerSVGElement`in e}const ru=new WeakMap;let iu;const au=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:nu(r)&&`getBBox`in r?r.getBBox()[t]:r[n],ou=au(`inline`,`width`,`offsetWidth`),su=au(`block`,`height`,`offsetHeight`);function cu({target:e,borderBoxSize:t}){ru.get(e)?.forEach(n=>{n(e,{get width(){return ou(e,t)},get height(){return su(e,t)}})})}function lu(e){e.forEach(cu)}function uu(){typeof ResizeObserver>`u`||(iu=new ResizeObserver(lu))}function du(e,t){iu||uu();let n=Ml(e);return n.forEach(e=>{let n=ru.get(e);n||(n=new Set,ru.set(e,n)),n.add(t),iu?.observe(e)}),()=>{n.forEach(e=>{let n=ru.get(e);n?.delete(t),n?.size||iu?.unobserve(e)})}}const fu=new Set;let pu;function mu(){pu=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};fu.forEach(t=>t(e))},window.addEventListener(`resize`,pu)}function hu(e){return fu.add(e),pu||mu(),()=>{fu.delete(e),!fu.size&&typeof pu==`function`&&(window.removeEventListener(`resize`,pu),pu=void 0)}}function gu(e,t){return typeof e==`function`?hu(e):du(e,t)}const _u={value:null,addProjectionMetrics:null};function vu(e){return nu(e)&&e.tagName===`svg`}const yu=[...ml,K,No],bu=e=>yu.find(pl(e)),xu=()=>({translate:0,scale:1,origin:0,originPoint:0}),Su=()=>({x:xu(),y:xu()}),Cu=()=>({min:0,max:0}),Y=()=>({x:Cu(),y:Cu()}),wu=new WeakMap;function Tu(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Eu(e){return typeof e==`string`||Array.isArray(e)}const Du=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Ou=[`initial`,...Du];function ku(e){return Tu(e.animate)||Ou.some(t=>Eu(e[t]))}function Au(e){return!!(ku(e)||e.variants)}function ju(e,t,n){for(let r in t){let i=t[r],a=n[r];if(tl(i))e.addValue(r,i);else if(tl(a))e.addValue(r,Nc(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Nc(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const Mu={current:null},Nu={current:!1},Pu=typeof window<`u`;function Fu(){if(Nu.current=!0,Pu){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Mu.current=e.matches;e.addEventListener(`change`,t),t()}else Mu.current=!1}}const Iu=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let Lu={};function Ru(e){Lu=e}function zu(){return Lu}var Bu=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ec,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Ka.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,W.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=ku(t),this.isVariantNode=Au(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&tl(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,wu.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Nu.current||Fu(),this.shouldReduceMotion=Mu.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Va(this.notifyUpdate),Va(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Sc.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new pc({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:ha(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Vs.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&W.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Lu){let t=Lu[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Y()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Iu.length;t++){let n=Iu[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=ju(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Nc(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(sa(n)||la(n))?n=parseFloat(n):!bu(n)&&No.test(t)&&(n=Dl(e,t)),this.setBaseTarget(e,tl(n)?n.get():n)),tl(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Jc(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!tl(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new ma),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Fl.render(this.render)}},Vu=class extends Bu{constructor(){super(...arguments),this.KeyframeResolver=Al}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;tl(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Hu=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Uu({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Wu({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Gu(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ku(e){return e===void 0||e===1}function qu({scale:e,scaleX:t,scaleY:n}){return!Ku(e)||!Ku(t)||!Ku(n)}function Ju(e){return qu(e)||Yu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Yu(e){return Xu(e.x)||Xu(e.y)}function Xu(e){return e&&e!==`0%`}function Zu(e,t,n){return n+t*(e-n)}function Qu(e,t,n,r,i){return i!==void 0&&(e=Zu(e,i,r)),Zu(e,n,r)+t}function $u(e,t=0,n=1,r,i){e.min=Qu(e.min,t,n,r,i),e.max=Qu(e.max,t,n,r,i)}function ed(e,{x:t,y:n}){$u(e.x,t.translate,t.scale,t.originPoint),$u(e.y,n.translate,n.scale,n.originPoint)}const td=.999999999999,nd=1.0000000000001;function rd(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(id(e.x,-a.scroll.offset.x),id(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ed(e,o)),r&&Ju(a.latestValues)&&sd(e,a.latestValues,a.layout?.layoutBox))}t.x<nd&&t.x>td&&(t.x=1),t.y<nd&&t.y>td&&(t.y=1)}function id(e,t){e.min+=t,e.max+=t}function ad(e,t,n,r,i=.5){$u(e,t,n,q(e.min,e.max,i),r)}function od(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function sd(e,t,n){let r=n??e;ad(e.x,od(t.x,r.x),t.scaleX,t.scale,t.originX),ad(e.y,od(t.y,r.y),t.scaleY,t.scale,t.originY)}function cd(e,t){return Uu(Gu(e.getBoundingClientRect(),t))}function ld(e,t,n){let r=cd(e,n),{scroll:i}=t;return i&&(id(r.x,i.offset.x),id(r.y,i.offset.y)),r}const ud={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},dd=Bs.length;function fd(e,t,n){let r=``,i=!0;for(let a=0;a<dd;a++){let o=Bs[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Nl(s,Cl[o]);if(!c){i=!1;let t=ud[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${Nl(a,Cl.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function pd(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Vs.has(e)){o=!0;continue}if(Ja(e)){i[e]=n;continue}{let t=Nl(n,Cl[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=fd(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function md(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function hd(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const gd={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(G.test(e))e=parseFloat(e);else return e}return`${hd(e,t.target.x)}% ${hd(e,t.target.y)}%`}},_d={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=No.parse(e);if(i.length>5)return r;let a=No.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=q(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},vd={borderRadius:{...gd,applyTo:[...jl]},borderTopLeftRadius:gd,borderTopRightRadius:gd,borderBottomLeftRadius:gd,borderBottomRightRadius:gd,boxShadow:_d};function yd(e,{layout:t,layoutId:n}){return Vs.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!vd[e]||e===`opacity`)}function bd(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(tl(r[t])||i&&tl(i[t])||yd(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function xd(e){return window.getComputedStyle(e)}var Sd=class extends Vu{constructor(){super(...arguments),this.type=`html`,this.renderInstance=md}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Vs.has(t))return this.projection?.isProjecting?Is(t):Rs(e,t);{let n=xd(e),r=(Ja(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return cd(e,t)}build(e,t,n){pd(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return bd(e,t,n)}};const Cd={offset:`stroke-dashoffset`,array:`stroke-dasharray`},wd={offset:`strokeDashoffset`,array:`strokeDasharray`};function Td(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Cd:wd;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Ed=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Dd(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(pd(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Ed)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Td(d,i,a,o,!1)}const Od=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),kd=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Ad(e,t,n,r){md(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Od.has(n)?n:il(n),t.attrs[n])}function jd(e,t,n){let r=bd(e,t,n);for(let n in e)if(tl(e[n])||tl(t[n])){let t=Bs.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Md=class extends Vu{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Y}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Vs.has(t)){let e=Tl(t);return e&&e.default||0}return t=Od.has(t)?t:il(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return jd(e,t,n)}build(e,t,n){Dd(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Ad(e,t,n,r)}mount(e){this.isSVGTag=kd(e.tagName),super.mount(e)}};const Nd=Ou.length;function Pd(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&Pd(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Nd;n++){let r=Ou[n],i=e.props[r];(Eu(i)||i===!1)&&(t[r]=i)}return t}function Fd(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Id=[...Du].reverse(),Ld=Du.length;function Rd(e){return t=>Promise.all(t.map(({animation:t,options:n})=>dl(e,t,n)))}function zd(e){let t=Rd(e),n=Hd(),r=!0,i=!1,a=t=>(n,r)=>{let i=Yc(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=Pd(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Ld;t++){let p=Id[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Eu(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Tu(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Bd(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Zc(t)&&Zc(n)?!Fd(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Yc(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=kc(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Yc(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Hd(),i=!0}}}function Bd(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Fd(t,e):!1}function Vd(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hd(){return{animate:Vd(!0),whileInView:Vd(),whileHover:Vd(),whileTap:Vd(),whileDrag:Vd(),whileFocus:Vd(),exit:Vd()}}function Ud(e,t){e.min=t.min,e.max=t.max}function Wd(e,t){Ud(e.x,t.x),Ud(e.y,t.y)}function Gd(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Kd(e){return e.max-e.min}function qd(e,t,n){return Math.abs(e-t)<=n}function Jd(e,t,n,r=.5){e.origin=r,e.originPoint=q(t.min,t.max,e.origin),e.scale=Kd(n)/Kd(t),e.translate=q(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Yd(e,t,n,r){Jd(e.x,t.x,n.x,r?r.originX:void 0),Jd(e.y,t.y,n.y,r?r.originY:void 0)}function Xd(e,t,n,r=0){e.min=(r?q(n.min,n.max,r):n.min)+t.min,e.max=e.min+Kd(t)}function Zd(e,t,n,r){Xd(e.x,t.x,n.x,r?.x),Xd(e.y,t.y,n.y,r?.y)}function Qd(e,t,n,r=0){let i=r?q(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Kd(t)}function $d(e,t,n,r){Qd(e.x,t.x,n.x,r?.x),Qd(e.y,t.y,n.y,r?.y)}function ef(e,t,n,r,i){return e-=t,e=Zu(e,1/n,r),i!==void 0&&(e=Zu(e,1/i,r)),e}function tf(e,t=0,n=1,r=.5,i,a=e,o=e){if(go.test(t)&&(t=parseFloat(t),t=q(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=q(a.min,a.max,r);e===a&&(s-=t),e.min=ef(e.min,t,n,s,i),e.max=ef(e.max,t,n,s,i)}function nf(e,t,[n,r,i],a,o){tf(e,t[n],t[r],t[i],t.scale,a,o)}const rf=[`x`,`scaleX`,`originX`],af=[`y`,`scaleY`,`originY`];function of(e,t,n,r){nf(e.x,t,rf,n?n.x:void 0,r?r.x:void 0),nf(e.y,t,af,n?n.y:void 0,r?r.y:void 0)}function sf(e){return e.translate===0&&e.scale===1}function cf(e){return sf(e.x)&&sf(e.y)}function lf(e,t){return e.min===t.min&&e.max===t.max}function uf(e,t){return lf(e.x,t.x)&&lf(e.y,t.y)}function df(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ff(e,t){return df(e.x,t.x)&&df(e.y,t.y)}function pf(e){return Kd(e.x)/Kd(e.y)}function mf(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function hf(e){return[e(`x`),e(`y`)]}function gf(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}const _f=jl.length,vf=e=>typeof e==`string`?parseFloat(e):e,yf=e=>typeof e==`number`||G.test(e);function bf(e,t,n,r,i,a){i?(e.opacity=q(0,n.opacity??1,Sf(r)),e.opacityExit=q(t.opacity??1,0,Cf(r))):a&&(e.opacity=q(t.opacity??1,n.opacity??1,r));for(let i=0;i<_f;i++){let a=jl[i],o=xf(t,a),s=xf(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||yf(o)===yf(s)?(e[a]=Math.max(q(vf(o),vf(s),r),0),(go.test(s)||go.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=q(t.rotate||0,n.rotate||0,r))}function xf(e,t){return e[t]===void 0?e.borderRadius:e[t]}const Sf=wf(0,.5,Oa),Cf=wf(.5,.95,da);function wf(e,t,n){return r=>r<e?0:r>t?1:n(pa(e,t,r))}function Tf(e,t,n){let r=tl(e)?e:Nc(e);return r.start(Uc(``,r,t,n)),r.animation}function Ef(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const Df=(e,t)=>e.depth-t.depth;var Of=class{constructor(){this.children=[],this.isDirty=!1}add(e){ra(this.children,e),this.isDirty=!0}remove(e){ia(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Df),this.isDirty=!1,this.children.forEach(e)}};function kf(e,t){let n=Ka.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Va(r),e(a-t))};return W.setup(r,!0),()=>Va(r)}function Af(e){return tl(e)?e.get():e}var jf=class{constructor(){this.members=[]}add(e){ra(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(ia(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(ia(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};const Mf={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Nf={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Pf=[``,`X`,`Y`,`Z`];let Ff=0;function If(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Lf(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=ol(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,W,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Lf(r)}function Rf({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Ff++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,_u.value&&(Nf.nodes=Nf.calculatedTargetDeltas=Nf.calculatedProjections=0),this.nodes.forEach(Vf),this.nodes.forEach(Xf),this.nodes.forEach(Zf),this.nodes.forEach(Hf),_u.addProjectionMetrics&&_u.addProjectionMetrics(Nf)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Of)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ma),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=nu(t)&&!vu(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;W.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=kf(i,250),Mf.hasAnimatedSinceResize&&(Mf.hasAnimatedSinceResize=!1,this.nodes.forEach(Yf)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||ip,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!ff(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Fc(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Yf(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Va(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Qf),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Lf(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Gf),this.nodes.forEach(Wf);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Kf);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(qf),this.nodes.forEach(Jf),this.nodes.forEach(zf),this.nodes.forEach(Bf)):this.nodes.forEach(Kf),this.clearAllSnapshots();let e=Ka.now();Ha.delta=aa(0,1e3/60,e-Ha.timestamp),Ha.timestamp=e,Ha.isProcessing=!0,Ua.update.process(Ha),Ua.preRender.process(Ha),Ua.render.process(Ha),Ha.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Uf),this.sharedNodes.forEach($f)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,W.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){W.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Kd(this.snapshot.measuredBox.x)&&!Kd(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=Y(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!cf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Ju(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),cp(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Y();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(up))){let{scroll:e}=this.root;e&&(id(t.x,e.offset.x),id(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Y();if(Wd(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Wd(t,e),id(t.x,i.offset.x),id(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Y();Wd(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(id(r.x,-n.scroll.offset.x),id(r.y,-n.scroll.offset.y)),Ju(n.latestValues)&&sd(r,n.latestValues,n.layout?.layoutBox)}return Ju(this.latestValues)&&sd(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Y();Wd(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Ju(n.latestValues))continue;let r;n.instance&&(qu(n.latestValues)&&n.updateSnapshot(),r=Y(),Wd(r,n.measurePageBox())),of(t,n.latestValues,n.snapshot?.layoutBox,r)}return Ju(this.latestValues)&&of(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ha.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Ha.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Y(),this.targetWithTransforms=Y()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Zd(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Wd(this.target,this.layout.layoutBox),ed(this.target,this.targetDelta)):Wd(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),_u.value&&Nf.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||qu(this.parent.latestValues)||Yu(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Y(),this.relativeTargetOrigin=Y(),$d(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Wd(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Ha.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Wd(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;rd(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Y());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gd(this.prevProjectionDelta.x,this.projectionDelta.x),Gd(this.prevProjectionDelta.y,this.projectionDelta.y)),Yd(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!mf(this.projectionDelta.x,this.prevProjectionDelta.x)||!mf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),_u.value&&Nf.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Su(),this.projectionDelta=Su(),this.projectionDeltaWithTransform=Su()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Su();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Y(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(rp));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=q(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=q(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(ep(o.x,e.x,n),ep(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($d(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),np(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&uf(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Y(),Wd(f,this.relativeTarget)),c&&(this.animationValues=a,bf(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Va(this.pendingAnimation),void 0),this.pendingAnimation=W.update(()=>{Mf.hasAnimatedSinceResize=!0,this.motionValue||=Nc(0),this.motionValue.jump(0,!1),this.currentAnimation=Tf(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&lp(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Y();let t=Kd(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Kd(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Wd(t,n),sd(t,i),Yd(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new jf),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&If(`z`,e,r,this.animationValues);for(let t=0;t<Pf.length;t++)If(`rotate${Pf[t]}`,e,r,this.animationValues),If(`skew${Pf[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Af(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Af(t?.pointerEvents)||``),this.hasProjected&&!Ju(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=gf(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in vd){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=vd[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Af(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Wf),this.root.sharedNodes.clear()}}}function zf(e){e.updateLayout()}function Bf(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)hf(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Kd(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Ud(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else lp(i,t.layoutBox,n)&&hf(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Kd(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Su();Yd(o,n,t.layoutBox);let s=Su();a?Yd(s,e.applyTransform(r,!0),t.measuredBox):Yd(s,n,t.layoutBox);let c=!cf(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Y();$d(s,t.layoutBox,i.layoutBox,o);let c=Y();$d(c,n,a.layoutBox,o),ff(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Vf(e){_u.value&&Nf.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Hf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Uf(e){e.clearSnapshot()}function Wf(e){e.clearMeasurements()}function Gf(e){e.isLayoutDirty=!0,e.updateLayout()}function Kf(e){e.isLayoutDirty=!1}function qf(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Jf(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Yf(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Xf(e){e.resolveTargetDelta()}function Zf(e){e.calcProjection()}function Qf(e){e.resetSkewAndRotation()}function $f(e){e.removeLeadSnapshot()}function ep(e,t,n){e.translate=q(t.translate,0,n),e.scale=q(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function tp(e,t,n,r){e.min=q(t.min,n.min,r),e.max=q(t.max,n.max,r)}function np(e,t,n,r){tp(e.x,t.x,n.x,r),tp(e.y,t.y,n.y,r)}function rp(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ip={duration:.45,ease:[.4,0,.1,1]},ap=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),op=ap(`applewebkit/`)&&!ap(`chrome/`)?Math.round:da;function sp(e){e.min=op(e.min),e.max=op(e.max)}function cp(e){sp(e.x),sp(e.y)}function lp(e,t,n){return e===`position`||e===`preserve-aspect`&&!qd(pf(t),pf(n),.2)}function up(e){return e!==e.root&&e.scroll?.wasRoot}const dp=Rf({attachResizeListener:(e,t)=>Ef(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),fp={current:void 0},pp=Rf({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fp.current){let e=new dp({});e.mount(window),e.setOptions({layoutScroll:!0}),fp.current=e}return fp.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),mp=d({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function hp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function gp(...e){return t=>{let n=!1,r=e.map(e=>{let r=hp(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():hp(e[t],null)}}}}function _p(...e){return a.useCallback(gp(...e),e)}var vp=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Pl(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Pl(e)&&e.offsetWidth||0,r=Pl(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function yp({children:e,isPresent:n,anchorX:r,anchorY:i,root:o,pop:s}){let c=v(),l=C(null),u=C({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:d}=g(mp),f=_p(l,s===!1?void 0:e.props?.ref??e?.ref);return b(()=>{let{width:e,height:t,top:a,left:f,right:p,bottom:m,direction:h}=u.current;if(n||s===!1||!l.current||!e||!t)return;let g=h===`rtl`,_=r===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=i===`bottom`?`bottom: ${m}`:`top: ${a}`;l.current.dataset.motionPopId=c;let y=document.createElement(`style`);d&&(y.nonce=d);let b=o??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
189
+ [data-motion-pop-id="${c}"] {
190
+ position: absolute !important;
191
+ width: ${e}px !important;
192
+ height: ${t}px !important;
193
+ ${_}px !important;
194
+ ${v}px !important;
195
+ }
196
+ `),()=>{l.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[n]),t(vp,{isPresent:n,childRef:l,sizeRef:u,pop:s,children:s===!1?e:a.cloneElement(e,{ref:f})})}const bp=({children:e,initial:n,isPresent:r,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=ea(xp),p=v(),m=C(r),h=C(i);ta(()=>{m.current=r,h.current=i});let g=!0,_=S(()=>(g=!1,{id:p,initial:n,isPresent:r,custom:o,onExitComplete:e=>{f.set(e,!0);for(let e of f.values())if(!e)return;i&&i()},register:e=>(f.set(e,!1),()=>{f.delete(e),!m.current&&!f.size&&h.current?.()})}),[r,f,i]);return s&&g&&(_={..._}),S(()=>{f.forEach((e,t)=>f.set(t,!1))},[r]),a.useEffect(()=>{!r&&!f.size&&i&&i()},[r]),e=t(yp,{pop:c===`popLayout`,isPresent:r,anchorX:l,anchorY:u,root:d,children:e}),t(na.Provider,{value:_,children:e})};function xp(){return new Map}function Sp(e=!0){let t=g(na);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=v();_(()=>{if(e)return i(a)},[e]);let o=h(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const Cp=e=>e.key||``;function wp(e){let t=[];return s.forEach(e,e=>{m(e)&&t.push(e)}),t}const Tp=({children:n,custom:r,initial:i=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s=`sync`,propagate:c=!1,anchorX:l=`left`,anchorY:u=`top`,root:d})=>{let[f,p]=Sp(c),m=S(()=>wp(n),[n]),h=c&&!f?[]:m.map(Cp),_=C(!0),v=C(m),y=ea(()=>new Map),b=C(new Set),[x,T]=w(m),[E,D]=w(m);ta(()=>{_.current=!1,v.current=m;for(let e=0;e<E.length;e++){let t=Cp(E[e]);h.includes(t)?(y.delete(t),b.current.delete(t)):y.get(t)!==!0&&y.set(t,!1)}},[E,h.length,h.join(`-`)]);let O=[];if(m!==x){let e=[...m];for(let t=0;t<E.length;t++){let n=E[t],r=Cp(n);h.includes(r)||(e.splice(t,0,n),O.push(n))}return s===`wait`&&O.length&&(e=O),D(wp(e)),T(m),null}let{forceRender:k}=g($i);return t(e,{children:E.map(e=>{let n=Cp(e),g=c&&!f?!1:m===E||h.includes(n);return t(bp,{isPresent:g,initial:!_.current||i?void 0:!1,custom:r,presenceAffectsLayout:o,mode:s,root:d,onExitComplete:g?void 0:()=>{if(b.current.has(n))return;if(y.has(n))b.current.add(n),y.set(n,!0);else return;let e=!0;y.forEach(t=>{t||(e=!1)}),e&&(k?.(),D(v.current),c&&p?.(),a&&a())},anchorX:l,anchorY:u,children:e},n)})})},Ep=d({strict:!1}),Dp={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]};let Op=!1;function kp(){if(Op)return;let e={};for(let t in Dp)e[t]={isEnabled:e=>Dp[t].some(t=>!!e[t])};Ru(e),Op=!0}function Ap(){return kp(),zu()}function jp(e){let t=Ap();for(let n in e)t[n]={...t[n],...e[n]};Ru(t)}const Mp=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Np(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Mp.has(e)}let Pp=e=>!Np(e);function Fp(e){typeof e==`function`&&(Pp=t=>t.startsWith(`on`)?!Np(t):e(t))}try{Fp(ve(`@emotion/is-prop-valid`).default)}catch{}function Ip(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(tl(e[i])||(Pp(i)||n===!0&&Np(i)||!t&&!Np(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}const Lp=d({});function Rp(e,t){if(ku(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Eu(t)?t:void 0,animate:Eu(n)?n:void 0}}return e.inherit===!1?{}:t}function zp(e){let{initial:t,animate:n}=Rp(e,g(Lp));return S(()=>({initial:t,animate:n}),[Bp(t),Bp(n)])}function Bp(e){return Array.isArray(e)?e.join(` `):e}const Vp=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Hp(e,t,n){for(let r in t)!tl(t[r])&&!yd(r,n)&&(e[r]=t[r])}function Up({transformTemplate:e},t){return S(()=>{let n=Vp();return pd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Wp(e,t){let n=e.style||{},r={};return Hp(r,n,e),Object.assign(r,Up(e,t)),r}function Gp(e,t){let n={},r=Wp(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Kp=()=>({...Vp(),attrs:{}});function qp(e,t,n,r){let i=S(()=>{let n=Kp();return Dd(n,t,kd(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Hp(t,e.style,e),i.style={...t,...i.style}}return i}const Jp=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Yp(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Jp.indexOf(e)>-1||/[A-Z]/u.test(e))}function Xp(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??Yp(e)?qp:Gp)(t,r,i,e),c=Ip(t,typeof e==`string`,a),u=e===l?{}:{...c,...s,ref:n},{children:d}=t,p=S(()=>tl(d)?d.get():d,[d]);return f(e,{...u,children:p})}function Zp({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Qp(n,r,i,e),renderState:t()}}function Qp(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Af(a[e]);let{initial:o,animate:s}=e,c=ku(e),l=Au(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Tu(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Jc(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}const $p=e=>(t,n)=>{let r=g(Lp),i=g(na),a=()=>Zp(e,t,r,i);return n?a():ea(a)},em=$p({scrapeMotionValuesFromProps:bd,createRenderState:Vp}),tm=$p({scrapeMotionValuesFromProps:jd,createRenderState:Kp}),nm=Symbol.for(`motionComponentSymbol`);function rm(e,t,n){let r=C(n);b(()=>{r.current=n});let i=C(null);return h(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}const im=d({});function am(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function om(e,t,n,r,i,a){let{visualElement:o}=g(Lp),s=g(Ep),c=g(na),l=g(mp),u=l.reducedMotion,d=l.skipAnimations,f=C(null),p=C(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=g(im);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&sm(f.current,n,i,h);let v=C(!1);b(()=>{m&&v.current&&m.update(n,c)});let y=n[al],x=C(!!y&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return ta(()=>{p.current=!0,m&&(v.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),_(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),!1),m.enteringChildren=void 0)}),m}function sm(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:cm(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&am(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function cm(e){if(e)return e.options.allowProjection===!1?cm(e.parent):e.projection}function lm(e,{forwardMotionProps:r=!1,type:i}={},a,o){a&&jp(a);let s=i?i===`svg`:Yp(e),c=s?tm:em;function l(i,l){let u,d={...g(mp),...i,layoutId:um(i)},{isStatic:f}=d,p=zp(i),m=c(i,f);if(!f&&typeof window<`u`){dm(d,a);let t=fm(d);u=t.MeasureLayout,p.visualElement=om(e,m,d,o,t.ProjectionNode,s)}return n(Lp.Provider,{value:p,children:[u&&p.visualElement?t(u,{visualElement:p.visualElement,...d}):null,Xp(e,i,rm(m,p.visualElement,l),m,f,r,s)]})}l.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let u=p(l);return u[nm]=e,u}function um({layoutId:e}){let t=g($i).id;return t&&e!==void 0?t+`-`+e:e}function dm(e,t){g(Ep).strict}function fm(e){let{drag:t,layout:n}=Ap();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function pm(e,t){if(typeof Proxy>`u`)return lm;let n=new Map,r=(n,r)=>lm(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,lm(a,void 0,e,t)),n.get(a))})}const mm=(e,t)=>t.isSVG??Yp(e)?new Md(t):new Sd(t,{allowProjection:e!==l});var hm=class extends Hu{constructor(e){super(e),e.animationState||=zd(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Tu(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};let gm=0;const _m={animation:{Feature:hm},exit:{Feature:class extends Hu{constructor(){super(...arguments),this.id=gm++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=Yc(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function vm(e){return{point:{x:e.pageX,y:e.pageY}}}const ym=e=>t=>Wl(t)&&e(t,vm(t));function bm(e,t,n,r){return Ef(e,t,ym(n),r)}const xm=({current:e})=>e?e.ownerDocument.defaultView:null,Sm=(e,t)=>Math.abs(e-t);function Cm(e,t){let n=Sm(e.x,t.x),r=Sm(e.y,t.y);return Math.sqrt(n**2+r**2)}const wm=new Set([`auto`,`scroll`]);var Tm=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Em(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Om(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Cm(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=Ha;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Em(t,this.transformPagePoint),W.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Om(e.type===`pointercancel`?this.lastMoveEventInfo:Em(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Wl(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Em(vm(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Ha;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Om(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=fa(bm(this.contextWindow,`pointermove`,this.handlePointerMove,d),bm(this.contextWindow,`pointerup`,this.handlePointerUp,d),bm(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(wm.has(e.overflowX)||wm.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),W.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Va(this.updatePoint)}};function Em(e,t){return t?{point:t(e.point)}:e}function Dm(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Om({point:e},t){return{point:e,delta:Dm(e,Am(t)),offset:Dm(e,km(t)),velocity:jm(t,.1)}}function km(e){return e[0]}function Am(e){return e[e.length-1]}function jm(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Am(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>ha(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>ha(t)*2&&(r=e[1]);let a=ga(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Mm(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?q(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?q(n,e,r.max):Math.min(e,n)),e}function Nm(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Pm(e,{top:t,left:n,bottom:r,right:i}){return{x:Nm(e.x,n,i),y:Nm(e.y,t,r)}}function Fm(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Im(e,t){return{x:Fm(e.x,t.x),y:Fm(e.y,t.y)}}function Lm(e,t){let n=.5,r=Kd(e),i=Kd(t);return i>r?n=pa(t.min,t.max-r,e.min):r>i&&(n=pa(e.min,e.max-i,t.min)),aa(0,1,n)}function Rm(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const zm=.35;function Bm(e=zm){return e===!1?e=0:e===!0&&(e=zm),{x:Vm(e,`left`,`right`),y:Vm(e,`top`,`bottom`)}}function Vm(e,t,n){return{min:Hm(e,t),max:Hm(e,n)}}function Hm(e,t){return typeof e==`number`?e:e[t]||0}const Um=new WeakMap;var Wm=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Y(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(vm(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=zl(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),hf(e=>{let t=this.getAxisMotionValue(e).get()||0;if(go.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Kd(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&W.update(()=>i(e,t),!1,!0),rl(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Jm(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&W.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Tm(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:xm(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&W.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!qm(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Mm(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&am(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?Pm(n.layoutBox,e):!1,this.elastic=Bm(t),r!==this.constraints&&!am(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&hf(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Rm(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!am(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=ld(n,r.root,this.visualElement.getTransformPagePoint()),a=Im(r.layout.layoutBox,i);if(t){let e=t(Wu(a));this.hasMutatedConstraints=!!e,e&&(a=Uu(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=hf(o=>{if(!qm(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return rl(this.visualElement,e),n.start(Uc(e,n,0,t,this.visualElement,!1))}stopAnimation(){hf(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){hf(t=>{let{drag:n}=this.getProps();if(!qm(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-q(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!am(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};hf(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Lm({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),hf(t=>{if(!qm(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(q(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Um.set(this.visualElement,this);let e=this.visualElement.current,t=bm(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Jl(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();am(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Km(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),W.read(r);let o=Ef(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(hf(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=zm,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Gm(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Km(e,t,n){let r=gu(e,Gm(n)),i=gu(t,Gm(n));return()=>{r(),i()}}function qm(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Jm(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Ym=class extends Hu{constructor(e){super(e),this.removeGroupControls=da,this.removeListeners=da,this.controls=new Wm(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||da}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};const Xm=e=>(t,n)=>{e&&W.update(()=>e(t,n),!1,!0)};var Zm=class extends Hu{constructor(){super(...arguments),this.removePointerDownListener=da}onPointerDown(e){this.session=new Tm(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xm(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Xm(e),onStart:Xm(t),onMove:Xm(n),onEnd:(e,t)=>{delete this.session,r&&W.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=bm(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};let Qm=!1;var $m=class extends c{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Qm&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Mf.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Qm=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||W.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Fl.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Qm=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function eh(e){let[n,r]=Sp(),i=g($i);return t($m,{...e,layoutGroup:i,switchLayoutGroup:g(im),isPresent:n,safeToRemove:r})}const th={pan:{Feature:Zm},drag:{Feature:Ym,ProjectionNode:pp,MeasureLayout:eh}};function nh(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&W.postRender(()=>i(t,vm(t)))}var rh=class extends Hu{mount(){let{current:e}=this.node;e&&(this.unmount=Hl(e,(e,t)=>(nh(this.node,t,`Start`),e=>nh(this.node,e,`End`))))}unmount(){}},ih=class extends Hu{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=fa(Ef(this.node.current,`focus`,()=>this.onFocus()),Ef(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function ah(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&W.postRender(()=>i(t,vm(t)))}var oh=class extends Hu{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=tu(e,(e,t)=>(ah(this.node,t,`Start`),(e,{success:t})=>ah(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const sh=new WeakMap,ch=new WeakMap,lh=e=>{let t=sh.get(e.target);t&&t(e)},uh=e=>{e.forEach(lh)};function dh({root:e,...t}){let n=e||document;ch.has(n)||ch.set(n,{});let r=ch.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(uh,{root:e,...t})),r[i]}function fh(e,t,n){let r=dh(t);return sh.set(e,n),r.observe(e),()=>{sh.delete(e),r.unobserve(e)}}const ph={some:0,all:1};var mh=class extends Hu{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:ph[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=fh(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(hh(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function hh({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const gh={inView:{Feature:mh},tap:{Feature:oh},focus:{Feature:ih},hover:{Feature:rh}},_h={layout:{ProjectionNode:pp,MeasureLayout:eh}},vh=pm({..._m,...gh,...th,..._h},mm);function yh({children:e,overlayContent:r,className:i=``,overlayClassName:a=``,position:o=`right`,width:s,height:c,showCloseButton:l=!0,onOpen:u,onClose:d,triggerClassName:f=``,backdropClassName:p=``,animationConfig:m={type:`spring`,stiffness:300,damping:30}}){let[h,g]=w(!1),_=()=>{g(!0),u?.()},v=()=>{g(!1),d?.()},y=bh(o),b=xh(o,s,c);return n(`div`,{className:`flex items-center justify-center w-full ${i}`,children:[t(U,{variant:`unstyled`,size:`none`,onClick:_,className:`w-full align-left cursor-pointer ${f}`,children:e}),h&&t(`div`,{className:`z-45 fixed inset-0 bg-black bg-opacity-50 ${p}`,children:n(vh.div,{...y,transition:m,className:`${b} ${a}`,children:[l&&t(`div`,{className:`absolute top-2 end-2 z-10`,children:t(U,{onClick:v,variant:`primary`,children:t(Ze,{})})}),t(`div`,{className:l?`mt-8`:``,children:r})]})})]})}function bh(e){switch(e){case`left`:return{initial:{x:`-100%`},animate:{x:0},exit:{x:`-100%`}};case`right`:return{initial:{x:`100%`},animate:{x:0},exit:{x:`100%`}};case`top`:return{initial:{y:`-100%`},animate:{y:0},exit:{y:`-100%`}};case`bottom`:return{initial:{y:`100%`},animate:{y:0},exit:{y:`100%`}};case`center`:return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}};default:return{initial:{x:`100%`},animate:{x:0},exit:{x:`100%`}}}}function xh(e,t,n){let r=`fixed bg-white shadow-lg p-4 relative`;switch(e){case`left`:return`${r} left-0 top-[var(--header-height)] h-full ${t||`w-80`}`;case`right`:return`${r} right-0 top-[var(--header-height)] h-full ${t||`w-80`}`;case`top`:return`${r} top-[var(--header-height)] start-0 end-0 ${n||`h-80`}`;case`bottom`:return`${r} bottom-0 start-0 end-0 ${n||`h-80`}`;case`center`:return`${r} top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 ${t||`w-96`} ${n||`max-h-96`}`;default:return`${r} right-0 top-[var(--header-height)] h-full ${t||`w-80`}`}}const Sh=`--tailwind-portal`;function Ch({children:e}){let n=C(null),[r,i]=w(null);return _(()=>{if(n.current){let e=n.current.ownerDocument,t=e.getElementById(Sh);t||(t=e.createElement(`DIV`),t.id=Sh,e.body.appendChild(t)),i(t)}},[]),r?E(e,r):t(`span`,{ref:n})}function wh({path:e,maxItems:r=3,className:i,separator:o}){let s=e||[],c=e=>{let n=typeof e.label==`string`&&e.label.length>20?`${e.label.slice(0,17)}...`:e.label;return e.onClick?t(kh,{onClick:e.onClick,href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):e.href?t(kh,{href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):t(Ah,{children:n})};if(s.length<=r)return t(Th,{className:z(`w-full flex items-center`,i),children:t(Eh,{children:s.map((e,r)=>n(a.Fragment,{children:[t(Dh,{children:c(e)}),r<s.length-1&&t(jh,{children:o??t(Pe,{className:`cn-rtl-flip`})})]},`crumb-${r}`))})});let l=s.slice(-(r-1));return t(Th,{className:z(`w-full flex items-center`,i),children:n(Eh,{children:[t(Dh,{children:t(Mh,{})}),t(jh,{children:o??t(Pe,{className:`cn-rtl-flip`})}),l.map((e,r)=>n(a.Fragment,{children:[t(Dh,{children:c(e)}),r<l.length-1&&t(jh,{children:o??t(Pe,{className:`cn-rtl-flip`})})]},`crumb-${r}`))]})})}const Th=a.forwardRef(({...e},n)=>t(`nav`,{ref:n,"aria-label":`breadcrumb`,...e}));Th.displayName=`Breadcrumb`;const Eh=a.forwardRef(({className:e,...n},r)=>t(`ol`,{ref:r,className:z(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted sm:gap-2.5`,e),...n}));Eh.displayName=`BreadcrumbList`;const Dh=a.forwardRef(({className:e,...n},r)=>t(`li`,{ref:r,className:z(`inline-flex items-center gap-1.5 text-muted`,e),...n}));Dh.displayName=`BreadcrumbItem`;const Oh=a.forwardRef(({asChild:e,className:n,...r},i)=>t(`a`,{ref:i,className:z(`transition-colors hover:text-muted`,n),...r}));Oh.displayName=`BreadcrumbLink`;const kh=a.forwardRef(({className:e,href:n,onClick:r,...i},a)=>t(U,{variant:`ghost`,size:`md`,ref:a,className:z(`p-0! hover:underline! hover:bg-background!`,e),onClick:e=>{e.preventDefault(),r&&r(e)},...i}));kh.displayName=`BreadcrumbButton`;const Ah=a.forwardRef(({className:e,...n},r)=>t(`span`,{ref:r,"aria-current":`page`,className:z(`font-normal text-foreground`,e),...n}));Ah.displayName=`BreadcrumbPage`;const jh=({children:e,className:n,...r})=>t(`li`,{role:`presentation`,"aria-hidden":`true`,className:z(`[&>svg]:w-3.5 [&>svg]:h-3.5`,n),...r,children:e??t(Pe,{className:`cn-rtl-flip`})});jh.displayName=`BreadcrumbSeparator`;const Mh=({className:e,...r})=>n(`span`,{role:`presentation`,"aria-hidden":`true`,className:z(`flex h-9 w-9 items-center justify-center`,e),...r,children:[t(Be,{className:`h-4 w-4`}),t(`span`,{className:`sr-only`,children:`More`})]});Mh.displayName=`BreadcrumbEllipsis`;const Nh=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:z(`rounded-xl border bg-card text-card-foreground shadow`,e),...n}));Nh.displayName=`Card`;const Ph=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:z(`flex flex-col p-6`,e),...n}));Ph.displayName=`CardHeader`;const Fh=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:z(`font-semibold leading-none tracking-tight`,e),...n}));Fh.displayName=`CardTitle`;const Ih=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:z(`text-sm text-muted-foreground`,e),...n}));Ih.displayName=`CardDescription`;const Lh=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:z(`p-6 pt-0`,e),...n}));Lh.displayName=`CardContent`;const Rh=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:z(`flex items-center p-6 pt-0`,e),...n}));Rh.displayName=`CardFooter`;var zh=Object.defineProperty,Bh=(e,t)=>zh(e,`name`,{value:t,configurable:!0}),Vh=`Checkbox`,[Hh,Uh]=an(Vh),[Wh,Gh]=Hh(Vh);function Kh(e){let{__scopeCheckbox:n,checked:r,children:i,defaultChecked:o,disabled:s,form:c,name:l,onCheckedChange:u,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[m,h]=br({prop:r,defaultProp:o??!1,onChange:u,caller:Vh}),[g,_]=a.useState(null),[v,y]=a.useState(null),b=a.useRef(!1),[x,S]=a.useReducer(e=>e+1,0),C=!g||!!c||!!g.closest(`form`),w={checked:m,disabled:s,setChecked:h,control:g,setControl:_,name:l,form:c,value:f,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:d,defaultChecked:!tg(o)&&o,isFormControl:C,bubbleInput:v,setBubbleInput:y};return t(Wh,{scope:n,...w,children:eg(p)?p(w):i})}Bh(Kh,`CheckboxProvider`);var qh=`CheckboxTrigger`,Jh=a.forwardRef(Bh(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...i},o){let{control:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=Gh(qh,e),v=R(o,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?.form;if(e){let t=Bh(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,p]),t(H.button,{type:`button`,role:`checkbox`,"aria-checked":tg(u)?`mixed`:u,"aria-required":d,"data-state":ng(u),"data-disabled":l?``:void 0,disabled:l,value:c,...i,ref:v,onKeyDown:B(n,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:B(r,e=>{h(),p(e=>tg(e)?!0:!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`CheckboxTrigger`)),Yh=a.forwardRef(Bh(function(r,i){let{__scopeCheckbox:a,name:o,checked:s,defaultChecked:c,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=r;return t(Kh,{__scopeCheckbox:a,checked:s,defaultChecked:c,disabled:u,required:l,onCheckedChange:f,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(Jh,{...m,ref:i,__scopeCheckbox:a}),r&&t($h,{__scopeCheckbox:a})]})})},`Checkbox`)),Xh=`CheckboxIndicator`,Zh=a.forwardRef(Bh(function(e,n){let{__scopeCheckbox:r,forceMount:i,...a}=e,o=Gh(Xh,r);return t(or,{present:i||tg(o.checked)||o.checked===!0,children:t(H.span,{"data-state":ng(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Qh=`CheckboxBubbleInput`,$h=a.forwardRef(Bh(function({__scopeCheckbox:e,onClick:n,...r},i){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=Gh(Qh,e),v=R(i,_),y=Pn(o),b=a.useRef(!1),x=a.useRef(l),S=a.useRef(c);a.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==S.current;S.current=c;let i=x.current!==l;x.current=l;let a=!(r&&s.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});e.indeterminate=tg(l),n.call(e,!tg(l)&&l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(!tg(l)&&l);return t(H.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...r,tabIndex:-1,ref:v,onClick:B(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function eg(e){return typeof e==`function`}Bh(eg,`isFunction`);function tg(e){return e===`indeterminate`}Bh(tg,`isIndeterminate`);function ng(e){return tg(e)?`indeterminate`:e?`checked`:`unchecked`}Bh(ng,`getState`);const rg=a.forwardRef(({className:e,...n},r)=>t(Yh,{ref:r,className:z(`peer size-4 shrink-0 rounded-sm border border-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-white`,e),...n,children:t(Zh,{className:z(`flex items-center justify-center text-current`),children:t(Me,{className:`size-4`})})}));rg.displayName=Yh.displayName;var ig=Object.defineProperty,ag=(e,t)=>ig(e,`name`,{value:t,configurable:!0}),og=`Collapsible`,[sg,cg]=an(og),[lg,ug]=sg(og),dg=a.forwardRef(ag(function(e,n){let{__scopeCollapsible:r,open:i,defaultOpen:o,disabled:s,onOpenChange:c,...l}=e,[u,d]=br({prop:i,defaultProp:o??!1,onChange:c,caller:og});return t(lg,{scope:r,disabled:s,contentId:V(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:t(H.div,{"data-state":_g(u),"data-disabled":s?``:void 0,...l,ref:n})})},`Collapsible`)),fg=`CollapsibleTrigger`,pg=a.forwardRef(ag(function(e,n){let{__scopeCollapsible:r,...i}=e,a=ug(fg,r);return t(H.button,{type:`button`,"aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":_g(a.open),"data-disabled":a.disabled?``:void 0,disabled:a.disabled,...i,ref:n,onClick:B(e.onClick,a.onOpenToggle)})},`CollapsibleTrigger`)),mg=`CollapsibleContent`,hg=a.forwardRef(ag(function(e,n){let{forceMount:r,...i}=e,a=ug(mg,e.__scopeCollapsible);return t(or,{present:r||a.open,children:({present:e})=>t(gg,{...i,ref:n,present:e})})},`CollapsibleContent`)),gg=a.forwardRef(ag(function(e,n){let{__scopeCollapsible:r,present:i,children:o,...s}=e,c=ug(mg,r),[l,u]=a.useState(i),d=a.useRef(null),f=R(n,d),p=a.useRef(0),m=p.current,h=a.useRef(0),g=h.current,_=c.open||l,v=a.useRef(_),y=a.useRef(void 0);return a.useEffect(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),sn(()=>{let e=d.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();p.current=t.height,h.current=t.width,v.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),u(i)}},[c.open,i]),t(H.div,{"data-state":_g(c.open),"data-disabled":c.disabled?``:void 0,id:c.contentId,hidden:!_,...s,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:_&&o})},`CollapsibleContentImpl`));function _g(e){return e?`open`:`closed`}ag(_g,`getState`);var vg=dg,yg=pg,bg=hg;function xg({...e}){return t(vg,{"data-slot":`collapsible`,...e})}function Sg({...e}){return t(yg,{"data-slot":`collapsible-trigger`,...e})}function Cg({...e}){return t(bg,{"data-slot":`collapsible-content`,...e})}var wg=1,Tg=.9,Eg=.8,Dg=.17,Og=.1,kg=.999,Ag=.9999,jg=.99,Mg=/[\\\/_+.#"@\[\(\{&]/,Ng=/[\\\/_+.#"@\[\(\{&]/g,Pg=/[\s-]/,Fg=/[\s-]/g;function Ig(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?wg:jg;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Ig(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=wg:Mg.test(e.charAt(l-1))?(d*=Eg,p=e.slice(i,l-1).match(Ng),p&&i>0&&(d*=kg**+p.length)):Pg.test(e.charAt(l-1))?(d*=Tg,m=e.slice(i,l-1).match(Fg),m&&i>0&&(d*=kg**+m.length)):(d*=Dg,i>0&&(d*=kg**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Ag)),(d<Og&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Ig(e,t,n,r,l+1,a+2,o),f*Og>d&&(d=f*Og)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Lg(e){return e.toLowerCase().replace(Fg,` `)}function Rg(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Ig(e,t,Lg(e),Lg(t),0,0,{})}var zg=Object.defineProperty,Bg=(e,t)=>zg(e,`name`,{value:t,configurable:!0}),Vg=`Dialog`,[Hg,Ug]=an(Vg),[Wg,Gg]=Hg(Vg),Kg=Bg(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,l=a.useRef(null),u=a.useRef(null),[d,f]=br({prop:i,defaultProp:o??!1,onChange:s,caller:Vg}),[p,m]=a.useState(0),[h,g]=a.useState(0);return t(Wg,{scope:n,triggerRef:l,contentRef:u,contentId:V(),titleId:V(),descriptionId:V(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(e=>!e),[f]),modal:c,children:r})},`Dialog`),qg=`DialogTrigger`,Jg=a.forwardRef(Bg(function(e,n){let{__scopeDialog:r,...i}=e,a=Gg(qg,r),o=R(n,a.triggerRef);return t(H.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":m_(a.open),...i,ref:o,onClick:B(e.onClick,a.onOpenToggle)})},`DialogTrigger`)),Yg=`DialogPortal`,[Xg,Zg]=Hg(Yg,{forceMount:void 0}),Qg=Bg(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:o}=e,s=Gg(Yg,n);return t(Xg,{scope:n,forceMount:r,children:a.Children.map(i,e=>t(or,{present:r||s.open,children:t(nr,{asChild:!0,container:o,children:e})}))})},`DialogPortal`),$g=`DialogOverlay`,e_=a.forwardRef(Bg(function(e,n){let r=Zg($g,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=Gg($g,e.__scopeDialog);return o.modal?t(or,{present:i||o.open,children:t(n_,{...a,ref:n})}):null},`DialogOverlay`)),t_=Pt(`DialogOverlay.RemoveScroll`),n_=a.forwardRef(Bg(function(e,n){let{__scopeDialog:r,...i}=e,a=Gg($g,r),o=R(n,N());return t(ue,{as:t_,allowPinchZoom:!0,shards:[a.contentRef],children:t(H.div,{"data-state":m_(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),r_=`DialogContent`,i_=a.forwardRef(Bg(function(e,n){let r=Zg(r_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=Gg(r_,e.__scopeDialog);return t(or,{present:i||o.open,children:o.modal?t(a_,{...a,ref:n}):t(o_,{...a,ref:n})})},`DialogContent`)),a_=a.forwardRef(Bg(function(e,n){let r=Gg(r_,e.__scopeDialog),i=a.useRef(null),o=R(n,r.contentRef,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),t(s_,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:B(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:B(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:B(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),o_=a.forwardRef(Bg(function(e,n){let r=Gg(r_,e.__scopeDialog),i=a.useRef(!1),o=a.useRef(!1);return t(s_,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(o.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&o.current&&t.preventDefault()}})},`DialogContentNonModal`)),s_=a.forwardRef(Bg(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=Gg(r_,i);return le(),t(e,{children:t(ce,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:t(M,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":m_(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),c_=`DialogTitle`,l_=a.forwardRef(Bg(function(e,n){let{__scopeDialog:r,...i}=e,a=Gg(c_,r),{setTitleCount:o}=a;return sn(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(H.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),u_=`DialogDescription`,d_=a.forwardRef(Bg(function(e,n){let{__scopeDialog:r,...i}=e,a=Gg(u_,r),{setDescriptionCount:o}=a;return sn(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(H.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),f_=`DialogClose`,p_=a.forwardRef(Bg(function(e,n){let{__scopeDialog:r,...i}=e,a=Gg(f_,r);return t(H.button,{type:`button`,...i,ref:n,onClick:B(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function m_(e){return e?`open`:`closed`}Bg(m_,`getState`);var h_=`[cmdk-group=""]`,g_=`[cmdk-group-items=""]`,__=`[cmdk-group-heading=""]`,v_=`[cmdk-item=""]`,y_=`${v_}:not([aria-disabled="true"])`,b_=`cmdk-item-select`,x_=`data-value`,S_=(e,t,n)=>Rg(e,t,n),C_=a.createContext(void 0),w_=()=>a.useContext(C_),T_=a.createContext(void 0),E_=()=>a.useContext(T_),D_=a.createContext(void 0),O_=a.forwardRef((e,t)=>{let n=H_(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=H_(()=>new Set),i=H_(()=>new Map),o=H_(()=>new Map),s=H_(()=>new Set),c=B_(e),{label:l,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=V(),b=V(),x=V(),S=a.useRef(null),C=G_();V_(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),V_(()=>{C(6,A)},[]);let w=a.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),c.current?.value!==void 0){let e=t??``;(o=(a=c.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),T=a.useMemo(()=>({value:(e,t,r)=>{t!==o.current.get(e)?.value&&(o.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{o.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{o.current.delete(e),i.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e[`aria-label`],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=c.current?.filter??S_;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||c.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(g_);t?t.appendChild(e.parentElement===t?e:e.closest(`${g_} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${g_} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${h_}[${x_}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(x_);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(o.current.get(t)?.value??``,o.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(h_)?.querySelector(__))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${v_}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(y_)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(x_))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=c.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(x_))}function ee(e){let t=j()?.closest(h_),n;for(;t&&!n;)t=e>0?R_(t,h_):z_(t,h_),n=t?.querySelector(y_);n?w.setState(`value`,n.getAttribute(x_)):P(e)}let te=()=>N(M().length-1),F=e=>{e.preventDefault(),e.metaKey?te():e.altKey?ee(1):P(1)},ne=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?ee(-1):P(-1)};return a.createElement(H.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&F(e);break;case`ArrowDown`:F(e);break;case`p`:case`k`:_&&e.ctrlKey&&ne(e);break;case`ArrowUp`:ne(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),te();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(b_);t.dispatchEvent(e)}}}}},a.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:J_},l),q_(e,e=>a.createElement(T_.Provider,{value:w},a.createElement(C_.Provider,{value:T},e))))}),k_=a.forwardRef((e,t)=>{let n=V(),r=a.useRef(null),i=a.useContext(D_),o=w_(),s=B_(e),c=s.current?.forceMount??i?.forceMount;V_(()=>{if(!c)return o.item(n,i?.id)},[c]);let l=W_(n,r,[e.value,e.children,r],e.keywords),u=E_(),d=U_(e=>e.value&&e.value===l.current),f=U_(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);a.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(b_,p),()=>t.removeEventListener(b_,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return a.createElement(H.div,{ref:jt(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||o.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),A_=a.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=V(),c=a.useRef(null),l=a.useRef(null),u=V(),d=w_(),f=U_(e=>i||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));V_(()=>d.group(s),[]),W_(s,c,[e.value,e.heading,l]);let p=a.useMemo(()=>({id:s,forceMount:i}),[i]);return a.createElement(H.div,{ref:jt(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},n&&a.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),q_(e,e=>a.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},a.createElement(D_.Provider,{value:p},e))))}),j_=a.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=a.useRef(null),o=U_(e=>!e.search);return!n&&!o?null:a.createElement(H.div,{ref:jt(i,t),...r,"cmdk-separator":``,role:`separator`})}),M_=a.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=E_(),s=U_(e=>e.search),c=U_(e=>e.selectedItemId),l=w_();return a.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),a.createElement(H.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:s,onChange:e=>{i||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),N_=a.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,o=a.useRef(null),s=a.useRef(null),c=U_(e=>e.selectedItemId),l=w_();return a.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),a.createElement(H.div,{ref:jt(o,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},q_(e,e=>a.createElement(`div`,{ref:jt(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),P_=a.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...c}=e;return a.createElement(Kg,{open:n,onOpenChange:r},a.createElement(Qg,{container:s},a.createElement(e_,{"cmdk-overlay":``,className:i}),a.createElement(i_,{"aria-label":e.label,"cmdk-dialog":``,className:o},a.createElement(O_,{ref:t,...c}))))}),F_=a.forwardRef((e,t)=>U_(e=>e.filtered.count===0)?a.createElement(H.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),I_=a.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...o}=e;return a.createElement(H.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},q_(e,e=>a.createElement(`div`,{"aria-hidden":!0},e)))}),L_=Object.assign(O_,{List:N_,Item:k_,Input:M_,Group:A_,Separator:j_,Dialog:P_,Empty:F_,Loading:I_});function R_(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function z_(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function B_(e){let t=a.useRef(e);return V_(()=>{t.current=e}),t}var V_=typeof window>`u`?a.useEffect:a.useLayoutEffect;function H_(e){let t=a.useRef();return t.current===void 0&&(t.current=e()),t}function U_(e){let t=E_(),n=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,n,n)}function W_(e,t,n,r=[]){let i=a.useRef(),o=w_();return V_(()=>{var a;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());o.value(e,s,c),(a=t.current)==null||a.setAttribute(x_,s),i.current=s}),i}var G_=()=>{let[e,t]=a.useState(),n=H_(()=>new Map);return V_(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function K_(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function q_({asChild:e,children:t},n){return e&&a.isValidElement(t)?a.cloneElement(K_(t),{ref:t.ref},n(t.props.children)):n(t)}var J_={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Y_({children:e}){return t(`span`,{style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`},children:e})}const X_=d(!1);function Z_(){return!!g(X_)}function Q_({children:e}){return t(X_.Provider,{value:!0,children:e})}function $_({className:e,children:r,isOpen:i,onClose:a,description:o=`Modal Description`,noCloseButton:s=!1,allowOverflow:c=!1,disableCloseOnClickOutside:l=!1,size:u=`md`,action:d}){let f=e=>{e||a()};function p(){switch(u){case`sm`:return`max-w-[20vw]`;case`md`:return`max-w-[60vw] lg:max-w-[40vw]`;case`lg`:return`max-w-[80vw] md:max-w-[60vw]`;case`xl`:return`max-w-[95vw] lg:max-w-[80vw]`;case`full`:return`h-[calc(100vh-2rem)] max-w-[calc(100vw-2rem)]`;default:return`max-w-[60vw] lg:max-w-[40vw]`}}return n(rv,{open:i,onOpenChange:e=>{(!l||e)&&f(e)},children:[c&&t(sv,{className:`z-50 fixed inset-0 bg-black/80`}),t(Y_,{children:t(lv,{children:o})}),n(cv,{className:z(`min-h-20 p-4`,`fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 sm:rounded-lg`,p(),e),children:[t(`div`,{className:`top-4 end-4 absolute`,children:n(`div`,{className:`flex gap-2`,children:[d&&d,!s&&t(ov,{onClick:()=>f(!1),asChild:!0,autoFocus:!1,children:t(U,{variant:`outline`,title:`Close`,className:`data-[state=open]:bg-accent opacity-70 hover:opacity-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-ring ring-offset-background focus:ring-offset-2 data-[state=open]:text-muted-foreground transition-opacity disabled:pointer-events-none`,children:t(Ze,{className:`size-4`})})})]})}),t(Q_,{children:r})]})]})}const ev=({children:e,show:r=!0,className:i,description:a,showDivider:o=!1,...s})=>r?n(uv,{className:z(o?`border-b-solid border-b border-b-1 pb-2 mb-4`:``,`text-lg font-semibold leading-6 tracking-tight`,{"py-2":!a},i),...s,children:[e,a&&t(lv,{className:`text-sm !font-normal text-muted-foreground pb-2`,children:a})]}):n(Y_,{children:[t(uv,{children:e}),a&&t(lv,{children:a})]}),tv=({children:e,className:n,...r})=>t(`div`,{className:z(`text-sm max-h-[80vh] overflow-y-auto`,n),...r,children:e}),nv=({align:e=`right`,children:n,className:r,...i})=>t(`div`,{className:z(`w-full flex py-3 sm:py-2 sm:flex sm:flex-row-reverse sm:flex-row sm:justify-end gap-2`,{left:`justify-start`,center:`justify-center`,right:`justify-end`}[e],r),...i,children:n}),rv=Kg,iv=Jg,av=Qg,ov=p_,sv=a.forwardRef(({className:e,...n},r)=>t(e_,{ref:r,className:z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...n}));sv.displayName=e_.displayName;const cv=a.forwardRef(({className:e,children:r,...i},a)=>{let o=hi();return n(av,{container:o,children:[t(sv,{}),t(i_,{ref:a,className:z(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...i,children:r})]})});cv.displayName=i_.displayName;const lv=a.forwardRef(({className:e,...n},r)=>t(d_,{ref:r,className:z(`text-sm text-muted`,e),...n}));lv.displayName=d_.displayName;const uv=a.forwardRef(({className:e,...n},r)=>t(l_,{ref:r,className:z(`text-lg font-semibold leading-none tracking-tight`,e),...n}));uv.displayName=l_.displayName;const dv=a.forwardRef(({className:e,...n},r)=>t(L_,{ref:r,className:z(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...n}));dv.displayName=L_.displayName;const fv=({children:e,...n})=>t(rv,{...n,children:t(cv,{className:`shadow-lg p-0 overflow-hidden`,children:t(dv,{className:`[&_[cmdk-group]]:px-2 [&_[cmdk-item]]:px-2 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:w-5 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,children:e})})}),pv=a.forwardRef(({className:e,...r},i)=>n(`div`,{className:`flex items-center px-3 border-b`,"cmdk-input-wrapper":``,children:[t(qe,{className:`opacity-50 size-4 shrink-0`}),t(L_.Input,{ref:i,className:z(`focus:ring-0`,`border-0 flex h-8 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...r})]}));pv.displayName=L_.Input.displayName;const mv=a.forwardRef(({className:e,...n},r)=>t(L_.List,{ref:r,className:z(`overflow-y-auto overflow-x-hidden`,e),...n}));mv.displayName=L_.List.displayName;const hv=a.forwardRef((e,n)=>t(L_.Empty,{ref:n,className:`py-2 text-sm text-center`,...e}));hv.displayName=L_.Empty.displayName;const gv=a.forwardRef(({className:e,...n},r)=>t(L_.Group,{ref:r,className:z(`overflow-y-auto overflow-x-hidden p-1 text-foreground`,`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...n}));gv.displayName=L_.Group.displayName;const _v=a.forwardRef(({className:e,...n},r)=>t(L_.Separator,{ref:r,className:z(`-mx-1 h-px bg-border`,e),...n}));_v.displayName=L_.Separator.displayName;const vv=a.forwardRef(({className:e,...n},r)=>t(L_.Item,{ref:r,className:z(`hover:bg-muted cursor-pointer relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,e),...n}));vv.displayName=L_.Item.displayName;const yv=({className:e,...n})=>t(`span`,{className:z(`ms-auto text-xs tracking-widest text-muted-foreground`,e),...n});yv.displayName=`CommandShortcut`;var bv=Object.defineProperty,xv=(e,t)=>bv(e,`name`,{value:t,configurable:!0});function Sv(e){let n=e+`CollectionProvider`,[r,i]=an(n),[o,s]=r(n,{collectionRef:{current:null},itemMap:new Map}),c=xv(e=>{let{scope:n,children:r}=e,i=a.useRef(null),s=a.useRef(new Map).current;return t(o,{scope:n,itemMap:s,collectionRef:i,children:r})},`CollectionProvider`);c.displayName=n;let l=e+`CollectionSlot`,u=Pt(l),d=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=R(n,s(l,r).collectionRef);return t(u,{ref:a,children:i})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=Pt(f),h=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),l=R(n,c),u=s(f,r);return a.useEffect(()=>(u.itemMap.set(c,{ref:c,...o}),()=>void u.itemMap.delete(c))),t(m,{[p]:``,ref:l,children:i})});h.displayName=f;function g(t){let n=s(e+`CollectionConsumer`,t);return a.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return xv(g,`useCollection`),[{Provider:c,Slot:d,ItemSlot:h},g,i]}xv(Sv,`createCollection`);var Cv=new WeakMap,wv=class e extends Map{static{xv(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Cv.set(this,!0)}set(e,t){return Cv.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Dv(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Tv(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Tv(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Tv(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Tv(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Ev(e,t);return n===-1?void 0:e[n]}xv(Tv,`at`);function Ev(e,t){let n=e.length,r=Dv(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}xv(Ev,`toSafeIndex`);function Dv(e){return e!==e||e===0?0:Math.trunc(e)}xv(Dv,`toSafeInteger`);function Ov(e){let n=e+`CollectionProvider`,[r,i]=an(n),[o,s]=r(n,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new wv,setItemMap:xv(()=>void 0,`setItemMap`)}),c=xv(({state:e,...n})=>e?t(u,{...n,state:e}):t(l,{...n}),`CollectionProvider`);c.displayName=n;let l=xv(e=>{let n=_();return t(u,{...e,state:n})},`CollectionInit`);l.displayName=n+`Init`;let u=xv(e=>{let{scope:n,children:r,state:i}=e,s=a.useRef(null),[c,l]=a.useState(null),u=R(s,l),[d,f]=i;return a.useEffect(()=>{if(!c)return;let e=Mv(()=>{});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c]),t(o,{scope:n,itemMap:d,setItemMap:f,collectionRef:u,collectionRefObject:s,collectionElement:c,children:r})},`CollectionProviderImpl`);u.displayName=n+`Impl`;let d=e+`CollectionSlot`,f=Pt(d),p=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=R(n,s(d,r).collectionRef);return t(f,{ref:a,children:i})});p.displayName=d;let m=e+`CollectionItemSlot`,h=Pt(m),g=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),[l,u]=a.useState(null),d=R(n,c,u),{setItemMap:f}=s(m,r),p=a.useRef(o);kv(p.current,o)||(p.current=o);let g=p.current;return a.useEffect(()=>{let e=g;return f(t=>l?t.has(l)?t.set(l,{...e,element:l}).toSorted(jv):(t.set(l,{...e,element:l}),t.toSorted(jv)):t),()=>{f(e=>!l||!e.has(l)?e:(e.delete(l),new wv(e)))}},[l,g,f]),t(h,{"data-radix-collection-item":``,ref:d,children:i})});g.displayName=m;function _(){return a.useState(new wv)}xv(_,`useInitCollection`);function v(t){let{itemMap:n}=s(e+`CollectionConsumer`,t);return n}return xv(v,`useCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:i,useCollection:v,useInitCollection:_}]}xv(Ov,`createCollection`);function kv(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}xv(kv,`shallowEqual`);function Av(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}xv(Av,`isElementPreceding`);function jv(e,t){return!e[1].element||!t[1].element?0:Av(e[1].element,t[1].element)?-1:1}xv(jv,`sortByDocumentPosition`);function Mv(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}xv(Mv,`getChildListObserver`);var Nv=Object.defineProperty,Pv=(e,t)=>Nv(e,`name`,{value:t,configurable:!0}),Fv=!1;function Iv(){let[e,t]=a.useState(Fv);return a.useEffect(()=>{Fv||(Fv=!0,t(!0))},[]),e}Pv(Iv,`useIsHydrated`);var Lv=a.useSyncExternalStore;function Rv(){return()=>{}}Pv(Rv,`subscribe`);function zv(){return Lv(Rv,()=>!0,()=>!1)}Pv(zv,`useIsHydratedModern`);var Bv=typeof Lv==`function`?zv:Iv,Vv=Object.defineProperty,Hv=(e,t)=>Vv(e,`name`,{value:t,configurable:!0}),Uv=`rovingFocusGroup.onEntryFocus`,Wv={bubbles:!1,cancelable:!0},Gv=`RovingFocusGroup`,[Kv,qv,Jv]=Sv(Gv),[Yv,Xv]=an(Gv,[Jv]),[Zv,Qv]=Yv(Gv),$v=a.forwardRef(Hv(function(e,n){return t(Kv.Provider,{scope:e.__scopeRovingFocusGroup,children:t(Kv.Slot,{scope:e.__scopeRovingFocusGroup,children:t(ey,{...e,ref:n})})})},`RovingFocusGroup`)),ey=a.forwardRef(Hv(function(e,n){let{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=a.useRef(null),h=R(n,m),g=fe(s),[_,v]=br({prop:c,defaultProp:l??null,onChange:u,caller:Gv}),[y,b]=a.useState(!1),x=jn(d),S=qv(r),C=a.useRef(!1),[w,T]=a.useState(0);return a.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Uv,x),()=>e.removeEventListener(Uv,x)},[x]),t(Zv,{scope:r,orientation:i,dir:g,loop:o,currentTabStopId:_,onItemFocus:a.useCallback(e=>v(e),[v]),onItemShiftTab:a.useCallback(()=>b(!0),[]),onFocusableItemAdd:a.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>T(e=>e-1),[]),children:t(H.div,{tabIndex:y||w===0?-1:0,"data-orientation":i,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:B(e.onMouseDown,()=>{C.current=!0}),onFocus:B(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(Uv,Wv);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);oy([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}C.current=!1}),onBlur:B(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),ty=`RovingFocusGroupItem`,ny=a.forwardRef(Hv(function(e,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:s,children:c,...l}=e,u=V(),d=s||u,f=Qv(ty,r),p=f.currentTabStopId===d,m=qv(r),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f,v=Bv();return sn(()=>{if(!(!v||!i))return h(),()=>g()},[v,i,h,g]),a.useEffect(()=>{if(!(v||!i))return h(),()=>g()},[v,i,h,g]),t(Kv.ItemSlot,{scope:r,id:d,focusable:i,active:o,children:t(H.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:n,onMouseDown:B(e.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:B(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:B(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ay(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?sy(n,r+1):n.slice(r+1)}setTimeout(()=>oy(n))}}),children:typeof c==`function`?c({isCurrentTabStop:p,hasTabStop:_!=null}):c})})},`RovingFocusGroupItem`)),ry={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function iy(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Hv(iy,`getDirectionAwareKey`);function ay(e,t,n){let r=iy(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ry[r]}Hv(ay,`getFocusIntent`);function oy(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Hv(oy,`focusFirst`);function sy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Hv(sy,`wrapArray`);var cy=$v,ly=ny,uy=Object.defineProperty,X=(e,t)=>uy(e,`name`,{value:t,configurable:!0}),dy=[`Enter`,` `],fy=[`ArrowDown`,`PageUp`,`Home`],py=[`ArrowUp`,`PageDown`,`End`],my=[...fy,...py],hy={ltr:[...dy,`ArrowRight`],rtl:[...dy,`ArrowLeft`]},gy={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},_y=`Menu`,[vy,yy,by]=Sv(_y),[xy,Sy]=an(_y,[by,zn,Xv]),Cy=zn(),wy=Xv(),[Ty,Ey]=xy(_y),[Dy,Oy]=xy(_y),ky=X(e=>{let{__scopeMenu:n,open:r=!1,children:i,dir:o,onOpenChange:s,modal:c=!0}=e,l=Cy(n),[u,d]=a.useState(null),f=a.useRef(!1),p=jn(s),m=fe(o);return a.useEffect(()=>{let e=X(()=>{f.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=X(()=>f.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),a.useEffect(()=>{if(!r)return;let e=X(()=>p(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[r,p]),t(Qn,{...l,children:t(Ty,{scope:n,open:r,onOpenChange:p,content:u,onContentChange:d,children:t(Dy,{scope:n,onClose:a.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:c,children:i})})})},`Menu`),Ay=a.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e,a=Cy(r);return t($n,{...a,...i,ref:n})},`MenuAnchor`)),jy=`MenuPortal`,[My,Ny]=xy(jy,{forceMount:void 0}),Py=X(e=>{let{__scopeMenu:n,forceMount:r,children:i,container:a}=e,o=Ey(jy,n);return t(My,{scope:n,forceMount:r,children:t(or,{present:r||o.open,children:t(nr,{asChild:!0,container:a,children:i})})})},`MenuPortal`),Fy=`MenuContent`,[Iy,Ly]=xy(Fy),Ry=a.forwardRef(X(function(e,n){let r=Ny(Fy,e.__scopeMenu),{forceMount:i=r.forceMount,...a}=e,o=Ey(Fy,e.__scopeMenu),s=Oy(Fy,e.__scopeMenu);return t(vy.Provider,{scope:e.__scopeMenu,children:t(or,{present:i||o.open,children:t(vy.Slot,{scope:e.__scopeMenu,children:s.modal?t(zy,{...a,ref:n}):t(By,{...a,ref:n})})})})},`MenuContent`)),zy=a.forwardRef(X(function(e,n){let r=Ey(Fy,e.__scopeMenu),i=a.useRef(null),o=R(n,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),t(Hy,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:B(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentModal`)),By=a.forwardRef(X(function(e,n){let r=Ey(Fy,e.__scopeMenu);return t(Hy,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentNonModal`)),Vy=Pt(`MenuContent.ScrollLock`),Hy=a.forwardRef(X(function(e,n){let{__scopeMenu:r,loop:i=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=Ey(Fy,r),y=Oy(Fy,r),b=Cy(r),x=wy(r),S=yy(r),[C,w]=a.useState(null),T=a.useRef(null),E=R(n,T,v.onContentChange),D=a.useRef(0),O=a.useRef(``),k=a.useRef(0),A=a.useRef(null),j=a.useRef(`right`),N=a.useRef(0),P=g?ue:a.Fragment,ee=g?{as:Vy,allowPinchZoom:!0}:void 0,te=X(e=>{let t=O.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=yb(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;X((function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);a.useEffect(()=>()=>window.clearTimeout(D.current),[]),le();let F=a.useCallback(e=>j.current===A.current?.side&&xb(e,A.current?.area),[]);return t(Iy,{scope:r,searchRef:O,onItemEnter:a.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:a.useCallback(e=>{F(e)||(T.current?.focus(),w(null))},[F]),onTriggerLeave:a.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:k,onPointerGraceIntentChange:a.useCallback(e=>{A.current=e},[]),children:t(P,{...ee,children:t(ce,{asChild:!0,trapped:o,onMountAutoFocus:B(s,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:t(M,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:t(cy,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:i,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:B(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t(er,{role:`menu`,"aria-orientation":`vertical`,"data-state":mb(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:E,style:{outline:`none`,..._.style},onKeyDown:B(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=T.current;if(e.target!==i||!my.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);py.includes(e.key)&&a.reverse(),_b(a)}),onBlur:B(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:B(e.onPointerMove,Sb(e=>{let t=e.target,n=N.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>N.current?`right`:`left`;j.current=t,N.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),Uy=a.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e;return t(H.div,{role:`group`,...i,ref:n})},`MenuGroup`)),Wy=a.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e;return t(H.div,{...i,ref:n})},`MenuLabel`)),Gy=`MenuItem`,Ky=`menu.itemSelect`,qy=a.forwardRef(X(function(e,n){let{disabled:r=!1,onSelect:i,...o}=e,s=a.useRef(null),c=Oy(Gy,e.__scopeMenu),l=Ly(Gy,e.__scopeMenu),u=R(n,s),d=a.useRef(!1),f=X(()=>{let e=s.current;if(!r&&e){let t=new CustomEvent(Ky,{bubbles:!0,cancelable:!0});e.addEventListener(Ky,e=>i?.(e),{once:!0}),On(e,t),t.defaultPrevented?d.current=!1:c.onClose()}},`handleSelect`);return t(Jy,{...o,ref:u,disabled:r,onClick:B(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:B(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:B(e.onKeyDown,e=>{r||e.target!==e.currentTarget||(l.searchRef.current===``||e.key!==` `)&&dy.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Jy=a.forwardRef(X(function(e,n){let{__scopeMenu:r,disabled:i=!1,textValue:o,...s}=e,c=Ly(Gy,r),l=wy(r),u=a.useRef(null),d=R(n,u),[f,p]=a.useState(!1),[m,h]=a.useState(``);return a.useEffect(()=>{let e=u.current;e&&h((e.textContent??``).trim())},[s.children]),t(vy.ItemSlot,{scope:r,disabled:i,textValue:o??m,children:t(ly,{asChild:!0,...l,focusable:!i,children:t(H.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...s,ref:d,onPointerMove:B(e.onPointerMove,Sb(e=>{i?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:B(e.onPointerLeave,Sb(e=>c.onItemLeave(e))),onFocus:B(e.onFocus,()=>p(!0)),onBlur:B(e.onBlur,()=>p(!1))})})})},`MenuItemImpl`)),Yy=a.forwardRef(X(function(e,n){let{checked:r=!1,onCheckedChange:i,...a}=e;return t(nb,{scope:e.__scopeMenu,checked:r,children:t(qy,{role:`menuitemcheckbox`,"aria-checked":hb(r)?`mixed`:r,...a,ref:n,"data-state":gb(r),onSelect:B(a.onSelect,()=>i?.(hb(r)?!0:!r),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[Xy,Zy]=xy(`MenuRadioGroup`,{value:void 0,onValueChange:X(()=>{},`onValueChange`)}),Qy=a.forwardRef(X(function(e,n){let{value:r,onValueChange:i,...a}=e,o=jn(i);return t(Xy,{scope:e.__scopeMenu,value:r,onValueChange:o,children:t(Uy,{...a,ref:n})})},`MenuRadioGroup`)),$y=`MenuRadioItem`,eb=a.forwardRef(X(function(e,n){let{value:r,...i}=e,a=Zy($y,e.__scopeMenu),o=r===a.value;return t(nb,{scope:e.__scopeMenu,checked:o,children:t(qy,{role:`menuitemradio`,"aria-checked":o,...i,ref:n,"data-state":gb(o),onSelect:B(i.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),tb=`MenuItemIndicator`,[nb,rb]=xy(tb,{checked:!1}),ib=a.forwardRef(X(function(e,n){let{__scopeMenu:r,forceMount:i,...a}=e,o=rb(tb,r);return t(or,{present:i||hb(o.checked)||o.checked===!0,children:t(H.span,{...a,ref:n,"data-state":gb(o.checked)})})},`MenuItemIndicator`)),ab=a.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e;return t(H.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:n})},`MenuSeparator`)),ob=`MenuSub`,[sb,cb]=xy(ob),lb=X(e=>{let{__scopeMenu:n,children:r,open:i=!1,onOpenChange:o}=e,s=Ey(ob,n),c=Cy(n),[l,u]=a.useState(null),[d,f]=a.useState(null),p=jn(o);return a.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),t(Qn,{...c,children:t(Ty,{scope:n,open:i,onOpenChange:p,content:d,onContentChange:f,children:t(sb,{scope:n,contentId:V(),triggerId:V(),trigger:l,onTriggerChange:u,children:r})})})},`MenuSub`),ub=`MenuSubTrigger`,db=a.forwardRef(X(function(e,n){let r=Ey(ub,e.__scopeMenu),i=Oy(ub,e.__scopeMenu),o=cb(ub,e.__scopeMenu),s=Ly(ub,e.__scopeMenu),c=a.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},f=a.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);a.useEffect(()=>f,[f]),a.useEffect(()=>{let e=l.current;return()=>{window.clearTimeout(e),u(null)}},[l,u]);let p=R(n,o.onTriggerChange);return t(Ay,{asChild:!0,...d,children:t(Jy,{id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":mb(r.open),...e,ref:p,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:B(e.onPointerMove,Sb(t=>{s.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!r.open&&!c.current&&(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:B(e.onPointerLeave,Sb(e=>{f();let t=r.content?.getBoundingClientRect();if(t){let n=r.content?.dataset.side,i=n===`right`,a=i?-5:5,o=t[i?`left`:`right`],c=t[i?`right`:`left`];s.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:o,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:o,y:t.bottom}],side:n}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:B(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(s.searchRef.current===``||t.key!==` `)&&hy[i.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),fb=`MenuSubContent`,pb=a.forwardRef(X(function(e,n){let r=Ny(Fy,e.__scopeMenu),{forceMount:i=r.forceMount,align:o=`start`,...s}=e,c=Ey(Fy,e.__scopeMenu),l=Oy(Fy,e.__scopeMenu),u=cb(fb,e.__scopeMenu),d=a.useRef(null),f=R(n,d);return t(vy.Provider,{scope:e.__scopeMenu,children:t(or,{present:i||c.open,children:t(vy.Slot,{scope:e.__scopeMenu,children:t(Hy,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:f,align:o,side:l.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:B(e.onFocusOutside,e=>{e.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:B(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:B(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=gy[l.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function mb(e){return e?`open`:`closed`}X(mb,`getOpenState`);function hb(e){return e===`indeterminate`}X(hb,`isIndeterminate`);function gb(e){return hb(e)?`indeterminate`:e?`checked`:`unchecked`}X(gb,`getCheckedState`);function _b(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(_b,`focusFirst`);function vb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(vb,`wrapArray`);function yb(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=vb(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}X(yb,`getNextMatch`);function bb(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}X(bb,`isPointInPolygon`);function xb(e,t){return t?bb({x:e.clientX,y:e.clientY},t):!1}X(xb,`isPointerInGraceArea`);function Sb(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(Sb,`whenMouse`);var Cb=ky,wb=Ay,Tb=Py,Eb=Ry,Db=Uy,Ob=Wy,kb=qy,Ab=Yy,jb=Qy,Mb=eb,Nb=ib,Pb=ab,Fb=lb,Ib=db,Lb=pb,Rb=Object.defineProperty,zb=(e,t)=>Rb(e,`name`,{value:t,configurable:!0}),Bb=`DropdownMenu`,[Vb,Hb]=an(Bb,[Sy]),Ub=Sy(),[Wb,Gb]=Vb(Bb),Kb=zb(e=>{let{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=Ub(n),d=a.useRef(null),[f,p]=br({prop:o,defaultProp:s??!1,onChange:c,caller:Bb});return t(Wb,{scope:n,triggerId:V(),triggerRef:d,contentId:V(),open:f,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:l,children:t(Cb,{...u,open:f,onOpenChange:p,dir:i,modal:l,children:r})})},`DropdownMenu`),qb=`DropdownMenuTrigger`,Jb=a.forwardRef(zb(function(e,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=e,o=Gb(qb,r),s=Ub(r),c=R(n,o.triggerRef);return t(wb,{asChild:!0,...s,children:t(H.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:c,onPointerDown:B(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:B(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Yb=zb(e=>{let{__scopeDropdownMenu:n,...r}=e,i=Ub(n);return t(Tb,{...i,...r})},`DropdownMenuPortal`),Xb=`DropdownMenuContent`,Zb=a.forwardRef(zb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,o=Gb(Xb,r),s=Ub(r),c=a.useRef(!1);return t(Eb,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...i,ref:n,onCloseAutoFocus:B(e.onCloseAutoFocus,e=>{c.current||o.triggerRef.current?.focus(),c.current=!1,e.preventDefault()}),onInteractOutside:B(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!o.modal||r)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Qb=a.forwardRef(zb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Ub(r);return t(Db,{...a,...i,ref:n})},`DropdownMenuGroup`)),$b=a.forwardRef(zb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Ub(r);return t(Ob,{...a,...i,ref:n})},`DropdownMenuLabel`)),ex=a.forwardRef(zb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Ub(r);return t(kb,{...a,...i,ref:n})},`DropdownMenuItem`)),tx=a.forwardRef(zb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Ub(r);return t(Ab,{...a,...i,ref:n})},`DropdownMenuCheckboxItem`)),nx=a.forwardRef(zb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Ub(r);return t(jb,{...a,...i,ref:n})},`DropdownMenuRadioGroup`)),rx=a.forwardRef(zb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Ub(r);return t(Mb,{...a,...i,ref:n})},`DropdownMenuRadioItem`)),ix=a.forwardRef(zb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Ub(r);return t(Nb,{...a,...i,ref:n})},`DropdownMenuItemIndicator`)),ax=a.forwardRef(zb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Ub(r);return t(Pb,{...a,...i,ref:n})},`DropdownMenuSeparator`)),ox=zb(e=>{let{__scopeDropdownMenu:n,children:r,open:i,onOpenChange:a,defaultOpen:o}=e,s=Ub(n),[c,l]=br({prop:i,defaultProp:o??!1,onChange:a,caller:`DropdownMenuSub`});return t(Fb,{...s,open:c,onOpenChange:l,children:r})},`DropdownMenuSub`),sx=a.forwardRef(zb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Ub(r);return t(Ib,{...a,...i,ref:n})},`DropdownMenuSubTrigger`)),cx=a.forwardRef(zb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Ub(r);return t(Lb,{...a,...i,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),lx=Kb,ux=Jb,dx=Yb,fx=Zb,px=Qb,mx=$b,hx=ex,gx=tx,_x=nx,vx=rx,yx=ix,bx=ax,xx=ox,Sx=sx,Cx=cx;const wx=a.createContext(!1);function Tx({...e}){return t(lx,{"data-slot":`dropdown-menu`,...e})}function Ex({...e}){return t(dx,{"data-slot":`dropdown-menu-portal`,...e})}function Dx({...e}){return t(ux,{"data-slot":`dropdown-menu-trigger`,...e})}function Ox({className:e,align:n=`start`,sideOffset:r=4,...i}){return t(dx,{children:t(fx,{"data-slot":`dropdown-menu-content`,sideOffset:r,align:n,className:z(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden`,e),...i})})}function kx({...e}){return t(px,{"data-slot":`dropdown-menu-group`,...e})}function Ax({className:e,inset:n,variant:r=`default`,...i}){return t(hx,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":r,className:z(`hover:bg-muted focus:bg-muted data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive gap-2 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...i})}function jx({className:e,children:r,checked:i,inset:a,...o}){return n(gx,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:z(`focus:bg-muted focus:text-muted focus:**:text-muted gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),checked:i,...o,children:[t(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:t(yx,{children:t(Me,{})})}),r]})}function Mx({...e}){return t(_x,{"data-slot":`dropdown-menu-radio-group`,...e})}function Nx({className:e,children:r,inset:i,...a}){return n(vx,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:z(`focus:bg-muted focus:text-muted focus:**:text-muted gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[t(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-radio-item-indicator`,children:t(yx,{children:t(Me,{})})}),r]})}function Px({className:e,inset:n,...r}){return t(mx,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:z(`text-muted px-1.5 py-1 text-xs font-medium data-inset:ps-7`,e),...r})}function Fx({className:e,...n}){return t(bx,{"data-slot":`dropdown-menu-separator`,className:z(`bg-border -mx-1 my-1 h-px`,e),...n})}function Ix({className:e,...n}){return t(`span`,{"data-slot":`dropdown-menu-shortcut`,className:z(`text-muted group-focus/dropdown-menu-item:text-muted ms-auto text-xs tracking-widest`,e),...n})}function Lx({...e}){return t(xx,{"data-slot":`dropdown-menu-sub`,...e})}function Rx({className:e,inset:r,children:i,...a}){return n(Sx,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":r,className:z(`focus:bg-muted focus:text-muted data-open:bg-muted data-open:text-muted not-data-[variant=destructive]:focus:**:text-muted gap-2 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[i,t(Pe,{className:`cn-rtl-flip ms-auto`})]})}function zx({className:e,...n}){return t(Cx,{"data-slot":`dropdown-menu-sub-content`,className:z(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-lg p-1 shadow-lg ring-1 duration-100 z-50 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden`,e),...n})}const Bx={left:`start`,center:`center`,right:`end`};function Vx({trigger:e,children:r,align:i=`right`,hover:o}){let[s,c]=a.useState(!1),l=a.useRef(null);return o?n(`div`,{className:`relative inline-flex`,onMouseEnter:()=>{l.current&&clearTimeout(l.current),c(!0)},onMouseLeave:()=>{l.current=setTimeout(()=>c(!1),80)},children:[e,s&&t(`div`,{className:z(`absolute top-full pt-1 z-50`,i===`right`?`end-0`:i===`center`?`left-1/2 -translate-x-1/2`:`start-0`),children:t(`div`,{className:`min-w-32 rounded-lg p-1 shadow-md ring-1 ring-foreground/10 bg-popover text-popover-foreground`,children:t(wx.Provider,{value:!0,children:r})})})]}):n(Tx,{children:[t(Dx,{asChild:!0,children:t(`span`,{className:`-m-1.5 flex items-center p-1.5`,children:e})}),t(Ox,{align:Bx[i],className:`w-max`,children:r})]})}function Hx({children:e,label:r}){return n(kx,{children:[r&&t(Px,{children:r}),e]})}function Ux({children:e,href:n,onClick:r,isDisabled:i=!1,variant:o=`default`,className:s}){let c=a.useContext(wx),l=z(`w-full gap-2 rounded-md px-1.5 py-1 text-sm text-nowrap [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,o===`destructive`?`text-destructive`:``,i?`pointer-events-none opacity-50`:`hover:bg-muted focus:bg-muted`,s);return c?n?t(`a`,{href:n,className:l,children:e}):t(`button`,{type:`button`,className:l,disabled:i,onClick:e=>{e.stopPropagation(),r?.(e)},children:e}):t(Ax,{className:z(`data-[disabled]:pointer-events-none data-[disabled]:opacity-50 text-nowrap`,s),disabled:i,variant:o,onClick:e=>{e.stopPropagation(),r?.(e)},asChild:!!n,children:n?t(`a`,{href:n,children:e}):e})}const Wx=({children:e,className:n})=>{let r=C(null),[i,a]=w(`auto`);return _(()=>{if(r.current){let e=new ResizeObserver(e=>{let t=e[0].contentRect.height;a(t)});return e.observe(r.current),()=>{e.disconnect()}}},[]),t(`div`,{className:z(n,`overflow-hidden transition-all duration-100 ease-in`),style:{height:i},children:t(`div`,{ref:r,children:e})})},Gx=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!Kx(i,a)&&r||Object.defineProperty(e,n,a)},Kx=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},qx=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Jx=(e,t)=>`/* Wrapped ${e}*/\n${t}`,Yx=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),Xx=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),Zx=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=Jx.bind(null,r,t.toString());Object.defineProperty(i,"name",Xx);let{writable:a,enumerable:o,configurable:s}=Yx;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:o,configurable:s})};function Qx(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))Gx(e,t,r,n);return qx(e,t),Zx(e,t,r),e}const $x=2147483647,eS=new WeakMap,tS=new WeakMap,nS=new WeakMap;function rS(e,t){let n=e.get(t);if(n){if(n.maxAge<=Date.now()){e.delete(t);return}return n}}function iS(e,{cacheKey:t,cache:n=new Map,maxAge:r}={}){if(r===0)return e;if(typeof r==`number`&&Number.isFinite(r)){if(r>$x)throw TypeError(`The \`maxAge\` option cannot exceed ${$x}.`);if(r<0)throw TypeError("The `maxAge` option should not be a negative number.")}let i=function(...a){let o=t?t(a):a[0],s=rS(n,o);if(s)return s.data;let c=e.apply(this,a),l=typeof r==`function`?r(...a):r;if(l!==void 0&&l!==1/0){if(!Number.isFinite(l))throw TypeError("The `maxAge` function must return a finite number, `0`, or `Infinity`.");if(l<=0)return c;if(l>$x)throw TypeError(`The \`maxAge\` function result cannot exceed ${$x}.`)}if(n.set(o,{data:c,maxAge:l===void 0||l===1/0?1/0:Date.now()+l}),l!==void 0&&l!==1/0){let e=setTimeout(()=>{n.delete(o),tS.get(i)?.delete(e)},l);e.unref?.();let t=tS.get(i)??new Set;t.add(e),tS.set(i,t)}return c};return Qx(i,e,{ignoreNonConfigurable:!0}),eS.set(i,n),nS.set(i,t??(e=>e[0])),i}function aS(e){return typeof e==`string`}function oS(e,t,n){return n.indexOf(e)===t}function sS(e){return e.toLowerCase()===e}function cS(e){return e.indexOf(`,`)===-1?e:e.split(`,`)}function lS(e){if(!e)return e;if(e===`C`||e===`posix`||e===`POSIX`)return`en-US`;if(e.indexOf(`.`)!==-1){var t=e.split(`.`)[0],n=t===void 0?``:t;return lS(n)}if(e.indexOf(`@`)!==-1){var r=e.split(`@`)[0],n=r===void 0?``:r;return lS(n)}if(e.indexOf(`-`)===-1||!sS(e))return e;var i=e.split(`-`),a=i[0],o=i[1];return`${a}-${(o===void 0?``:o).toUpperCase()}`}function uS(e){var t=e===void 0?{}:e,n=t.useFallbackLocale,r=n===void 0||n,i=t.fallbackLocale,a=i===void 0?`en-US`:i,o=[];if(typeof navigator<`u`){for(var s=navigator.languages||[],c=[],l=0,u=s;l<u.length;l++){var d=u[l];c=c.concat(cS(d))}var f=navigator.language,p=f&&cS(f);o=o.concat(c,p)}return r&&o.push(a),o.filter(aS).map(lS).filter(oS)}var dS=iS(uS,{cacheKey:JSON.stringify});function fS(e){return dS(e)[0]||null}var pS=iS(fS,{cacheKey:JSON.stringify});const mS=new Map;function hS(e){return function(t,n){let r=t||pS();mS.has(r)||mS.set(r,new Map);let i=mS.get(r);if(!i.has(e)){let t=new Intl.DateTimeFormat(r||void 0,e);i.set(e,t.format.bind(t))}return i.get(e)(n)}}function gS(e){let t=new Date(e);return new Date(t.setHours(12))}function _S(e){return(t,n)=>hS(e)(t,gS(n))}const vS={day:`numeric`},yS={day:`numeric`,month:`long`,year:`numeric`},bS={month:`long`},xS={month:`long`,year:`numeric`},SS={weekday:`short`},CS={weekday:`long`},wS={year:`numeric`},TS=_S(vS),ES=_S(yS),DS=_S(bS),OS=_S(xS),kS=_S(SS),AS=_S(CS),jS=_S(wS);function MS(e,t,n){return function(r,i=n){return t(e(r)+i)}}function NS(e){return function(t){return new Date(e(t).getTime()-1)}}function PS(e,t){return function(n){return[e(n),t(n)]}}function Z(e){if(e instanceof Date)return e.getFullYear();if(typeof e==`number`)return e;let t=Number.parseInt(e,10);if(typeof e==`string`&&!Number.isNaN(t))return t;throw Error(`Failed to get year from date: ${e}.`)}function FS(e){if(e instanceof Date)return e.getMonth();throw Error(`Failed to get month from date: ${e}.`)}function IS(e){if(e instanceof Date)return e.getDate();throw Error(`Failed to get year from date: ${e}.`)}function LS(e){let t=Z(e),n=t+(-t+1)%100,r=new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const RS=MS(Z,LS,-100),zS=MS(Z,LS,100),BS=NS(zS),VS=MS(Z,BS,-100),HS=PS(LS,BS);function US(e){let t=Z(e),n=t+(-t+1)%10,r=new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const WS=MS(Z,US,-10),GS=MS(Z,US,10),KS=NS(GS),qS=MS(Z,KS,-10),JS=PS(US,KS);function YS(e){let t=Z(e),n=new Date;return n.setFullYear(t,0,1),n.setHours(0,0,0,0),n}const XS=MS(Z,YS,-1),ZS=MS(Z,YS,1),QS=NS(ZS),$S=MS(Z,QS,-1),eC=PS(YS,QS);function tC(e,t){return function(n,r=t){let i=Z(n),a=FS(n)+r,o=new Date;return o.setFullYear(i,a,1),o.setHours(0,0,0,0),e(o)}}function nC(e){let t=Z(e),n=FS(e),r=new Date;return r.setFullYear(t,n,1),r.setHours(0,0,0,0),r}const rC=tC(nC,-1),iC=tC(nC,1),aC=NS(iC),oC=tC(aC,-1),sC=PS(nC,aC);function cC(e,t){return function(n,r=t){let i=Z(n),a=FS(n),o=IS(n)+r,s=new Date;return s.setFullYear(i,a,o),s.setHours(0,0,0,0),e(s)}}function lC(e){let t=Z(e),n=FS(e),r=IS(e),i=new Date;return i.setFullYear(t,n,r),i.setHours(0,0,0,0),i}const uC=NS(cC(lC,1)),dC=PS(lC,uC);function fC(e){return IS(aC(e))}const pC={GREGORY:`gregory`,HEBREW:`hebrew`,ISLAMIC:`islamic`,ISO_8601:`iso8601`},mC={gregory:[`en-CA`,`en-US`,`es-AR`,`es-BO`,`es-CL`,`es-CO`,`es-CR`,`es-DO`,`es-EC`,`es-GT`,`es-HN`,`es-MX`,`es-NI`,`es-PA`,`es-PE`,`es-PR`,`es-SV`,`es-VE`,`pt-BR`],hebrew:[`he`,`he-IL`],islamic:[`ar`,`ar-AE`,`ar-BH`,`ar-DZ`,`ar-EG`,`ar-IQ`,`ar-JO`,`ar-KW`,`ar-LY`,`ar-OM`,`ar-QA`,`ar-SA`,`ar-SD`,`ar-SY`,`ar-YE`,`dv`,`dv-MV`,`ps`,`ps-AR`]},hC=[0,1,2,3,4,5,6],gC=hC[0],_C=hC[5],vC=hC[6];function yC(e,t=pC.ISO_8601){let n=e.getDay();switch(t){case pC.ISO_8601:return(n+6)%7;case pC.ISLAMIC:return(n+1)%7;case pC.HEBREW:case pC.GREGORY:return n;default:throw Error(`Unsupported calendar type.`)}}function bC(e){return Z(LS(e))}function xC(e){return Z(US(e))}function SC(e,t=pC.ISO_8601){let n=Z(e),r=FS(e),i=e.getDate()-yC(e,t);return new Date(n,r,i)}function CC(e,t=pC.ISO_8601){let n=t===pC.GREGORY?pC.GREGORY:pC.ISO_8601,r=SC(e,t),i=Z(e)+1,a,o;do a=new Date(i,0,n===pC.ISO_8601?4:1),o=SC(a,t),--i;while(e<o);return Math.round((r.getTime()-o.getTime())/6048e5)+1}function wC(e,t){switch(e){case`century`:return LS(t);case`decade`:return US(t);case`year`:return YS(t);case`month`:return nC(t);case`day`:return lC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function TC(e,t){switch(e){case`century`:return RS(t);case`decade`:return WS(t);case`year`:return XS(t);case`month`:return rC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function EC(e,t){switch(e){case`century`:return zS(t);case`decade`:return GS(t);case`year`:return ZS(t);case`month`:return iC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function DC(e,t){switch(e){case`decade`:return WS(t,-100);case`year`:return XS(t,-10);case`month`:return rC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function OC(e,t){switch(e){case`decade`:return GS(t,100);case`year`:return ZS(t,10);case`month`:return iC(t,12);default:throw Error(`Invalid rangeType: ${e}`)}}function kC(e,t){switch(e){case`century`:return BS(t);case`decade`:return KS(t);case`year`:return QS(t);case`month`:return aC(t);case`day`:return uC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function AC(e,t){switch(e){case`century`:return VS(t);case`decade`:return qS(t);case`year`:return $S(t);case`month`:return oC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function jC(e,t){switch(e){case`decade`:return qS(t,-100);case`year`:return $S(t,-10);case`month`:return oC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function MC(e,t){switch(e){case`century`:return HS(t);case`decade`:return JS(t);case`year`:return eC(t);case`month`:return sC(t);case`day`:return dC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function NC(e,t,n){let r=[t,n].sort((e,t)=>e.getTime()-t.getTime());return[wC(e,r[0]),kC(e,r[1])]}function PC(e,t,n){return n.map(n=>(t||jS)(e,n)).join(` – `)}function FC(e,t,n){return PC(e,t,HS(n))}function IC(e,t,n){return PC(e,t,JS(n))}function LC(e){return e.getDay()===new Date().getDay()}function RC(e,t=pC.ISO_8601){let n=e.getDay();switch(t){case pC.ISLAMIC:case pC.HEBREW:return n===_C||n===vC;case pC.ISO_8601:case pC.GREGORY:return n===vC||n===gC;default:throw Error(`Unsupported calendar type.`)}}const zC=`react-calendar__navigation`;function BC({activeStartDate:r,drillUp:i,formatMonthYear:a=OS,formatYear:o=jS,locale:s,maxDate:c,minDate:l,navigationAriaLabel:u=``,navigationAriaLive:d,navigationLabel:f,next2AriaLabel:p=``,next2Label:m=`»`,nextAriaLabel:h=``,nextLabel:g=`›`,prev2AriaLabel:_=``,prev2Label:v=`«`,prevAriaLabel:y=``,prevLabel:b=`‹`,setActiveStartDate:x,showDoubleView:S,view:C,views:w}){let T=w.indexOf(C)>0,E=C!==`century`,D=TC(C,r),O=E?DC(C,r):void 0,k=EC(C,r),A=E?OC(C,r):void 0,j=(()=>{if(D.getFullYear()<0)return!0;let e=AC(C,r);return l&&l>=e})(),M=E&&(()=>{if(O.getFullYear()<0)return!0;let e=jC(C,r);return l&&l>=e})(),N=c&&c<k,P=E&&c&&c<A;function ee(){x(D,`prev`)}function te(){x(O,`prev2`)}function F(){x(k,`next`)}function ne(){x(A,`next2`)}function re(e){let t=(()=>{switch(C){case`century`:return FC(s,o,e);case`decade`:return IC(s,o,e);case`year`:return o(s,e);case`month`:return a(s,e);default:throw Error(`Invalid view: ${C}.`)}})();return f?f({date:e,label:t,locale:s||pS()||void 0,view:C}):t}function ie(){let a=`${zC}__label`;return n(`button`,{"aria-label":u,"aria-live":d,className:a,disabled:!T,onClick:i,style:{flexGrow:1},type:`button`,children:[t(`span`,{className:`${a}__labelText ${a}__labelText--from`,children:re(r)}),S?n(e,{children:[t(`span`,{className:`${a}__divider`,children:` – `}),t(`span`,{className:`${a}__labelText ${a}__labelText--to`,children:re(k)})]}):null]})}return n(`div`,{className:zC,children:[v!==null&&E?t(`button`,{"aria-label":_,className:`${zC}__arrow ${zC}__prev2-button`,disabled:M,onClick:te,type:`button`,children:v}):null,b!==null&&t(`button`,{"aria-label":y,className:`${zC}__arrow ${zC}__prev-button`,disabled:j,onClick:ee,type:`button`,children:b}),ie(),g!==null&&t(`button`,{"aria-label":h,className:`${zC}__arrow ${zC}__next-button`,disabled:N,onClick:F,type:`button`,children:g}),m!==null&&E?t(`button`,{"aria-label":p,className:`${zC}__arrow ${zC}__next2-button`,disabled:P,onClick:ne,type:`button`,children:m}):null]})}function VC(e){return`${e}%`}function HC({children:e,className:n,count:r,direction:i,offset:a,style:o,wrap:c,...l}){return t(`div`,{className:n,style:{display:`flex`,flexDirection:i,flexWrap:c?`wrap`:`nowrap`,...o},...l,children:s.map(e,(e,t)=>{let n=a&&t===0?VC(100*a/r):null;return u(e,{...e.props,style:{flexBasis:VC(100/r),flexShrink:0,flexGrow:0,overflow:`hidden`,marginLeft:n,marginInlineStart:n,marginInlineEnd:0}})})})}function UC(e,t,n){return t&&t>e?t:n&&n<e?n:e}function WC(e,t){return t[0]<=e&&t[1]>=e}function GC(e,t){return e[0]<=t[0]&&e[1]>=t[1]}function KC(e,t){return WC(e[0],t)||WC(e[1],t)}function qC(e,t,n){let r=KC(t,e),i=[];if(r){i.push(n);let r=WC(e[0],t),a=WC(e[1],t);r&&i.push(`${n}Start`),a&&i.push(`${n}End`),r&&a&&i.push(`${n}BothEnds`)}return i}function JC(e){return Array.isArray(e)?e[0]!==null&&e[1]!==null:e!==null}function YC(e){if(!e)throw Error(`args is required`);let{value:t,date:n,hover:r}=e,i=`react-calendar__tile`,a=[i];if(!n)return a;let o=new Date,s=(()=>{if(Array.isArray(n))return n;let{dateType:t}=e;if(!t)throw Error(`dateType is required when date is not an array of two dates`);return MC(t,n)})();if(WC(o,s)&&a.push(`${i}--now`),!t||!JC(t))return a;let c=(()=>{if(Array.isArray(t))return t;let{valueType:n}=e;if(!n)throw Error(`valueType is required when value is not an array of two dates`);return MC(n,t)})();GC(c,s)?a.push(`${i}--active`):KC(c,s)&&a.push(`${i}--hasActive`);let l=qC(c,s,`${i}--range`);if(a.push(...l),r&&(Array.isArray(t)?t:[t]).length===1){let e=qC(r>c[0]?[c[0],r]:[r,c[0]],s,`${i}--hover`);a.push(...e)}return a}function XC({className:e,count:n=3,dateTransform:r,dateType:i,end:a,hover:o,offset:s,renderTile:c,start:l,step:u=1,value:d,valueType:f}){let p=[];for(let e=l;e<=a;e+=u){let t=r(e);p.push(c({classes:YC({date:t,dateType:i,hover:o,value:d,valueType:f}),date:t}))}return t(HC,{className:e,count:n,offset:s,wrap:!0,children:p})}function ZC(e){let{activeStartDate:i,children:a,classes:o,date:s,formatAbbr:c,locale:l,maxDate:u,maxDateTransform:d,minDate:f,minDateTransform:p,onClick:m,onMouseOver:h,style:g,tileClassName:_,tileContent:v,tileDisabled:y,view:b}=e,x=S(()=>typeof _==`function`?_({activeStartDate:i,date:s,view:b}):_,[i,s,_,b]),C=S(()=>typeof v==`function`?v({activeStartDate:i,date:s,view:b}):v,[i,s,v,b]);return n(`button`,{className:r(o,x),disabled:f&&p(f)>s||u&&d(u)<s||y?.({activeStartDate:i,date:s,view:b}),onClick:m?e=>m(s,e):void 0,onFocus:h?()=>h(s):void 0,onMouseOver:h?()=>h(s):void 0,style:g,type:`button`,children:[c?t(`abbr`,{"aria-label":c(l,s),children:a}):a,C]})}const QC=`react-calendar__century-view__decades__decade`;function $C({classes:e=[],currentCentury:n,formatYear:r=jS,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(QC),LS(a).getFullYear()!==n&&s.push(`${QC}--neighboringCentury`),t(ZC,{...i,classes:s,maxDateTransform:KS,minDateTransform:US,view:`century`,children:IC(o,r,a)})}function ew(e){let{activeStartDate:n,hover:r,showNeighboringCentury:i,value:a,valueType:o,...s}=e,c=bC(n),l=c+(i?119:99);return t(XC,{className:`react-calendar__century-view__decades`,dateTransform:US,dateType:`decade`,end:l,hover:r,renderTile:({date:e,...r})=>t($C,{...s,...r,activeStartDate:n,currentCentury:c,date:e},e.getTime()),start:c,step:10,value:a,valueType:o})}function tw(e){function n(){return t(ew,{...e})}return t(`div`,{className:`react-calendar__century-view`,children:n()})}const nw=`react-calendar__decade-view__years__year`;function rw({classes:e=[],currentDecade:n,formatYear:r=jS,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(nw),US(a).getFullYear()!==n&&s.push(`${nw}--neighboringDecade`),t(ZC,{...i,classes:s,maxDateTransform:QS,minDateTransform:YS,view:`decade`,children:r(o,a)})}function iw(e){let{activeStartDate:n,hover:r,showNeighboringDecade:i,value:a,valueType:o,...s}=e,c=xC(n),l=c+(i?11:9);return t(XC,{className:`react-calendar__decade-view__years`,dateTransform:YS,dateType:`year`,end:l,hover:r,renderTile:({date:e,...r})=>t(rw,{...s,...r,activeStartDate:n,currentDecade:c,date:e},e.getTime()),start:c,value:a,valueType:o})}function aw(e){function n(){return t(iw,{...e})}return t(`div`,{className:`react-calendar__decade-view`,children:n()})}const ow=`react-calendar__month-view__days__day`;function sw({calendarType:e,classes:n=[],currentMonthIndex:r,formatDay:i=TS,formatLongDate:a=ES,...o}){let{date:s,locale:c}=o,l=[];return n&&l.push(...n),l.push(ow),RC(s,e)&&l.push(`${ow}--weekend`),s.getMonth()!==r&&l.push(`${ow}--neighboringMonth`),t(ZC,{...o,classes:l,formatAbbr:a,maxDateTransform:uC,minDateTransform:lC,view:`month`,children:i(c,s)})}function cw(e){let{activeStartDate:n,calendarType:r,hover:i,showFixedNumberOfWeeks:a,showNeighboringMonth:o,value:s,valueType:c,...l}=e,u=Z(n),d=FS(n),f=a||o,p=yC(n,r),m=f?0:p,h=(f?-p:0)+1,g=(()=>{if(a)return h+42-1;let e=fC(n);if(o){let t=new Date;return t.setFullYear(u,d,e),t.setHours(0,0,0,0),e+(7-yC(t,r)-1)}return e})();return t(XC,{className:`react-calendar__month-view__days`,count:7,dateTransform:e=>{let t=new Date;return t.setFullYear(u,d,e),lC(t)},dateType:`day`,hover:i,end:g,renderTile:({date:e,...i})=>t(sw,{...l,...i,activeStartDate:n,calendarType:r,currentMonthIndex:d,date:e},e.getTime()),offset:m,start:h,value:s,valueType:c})}const lw=`react-calendar__month-view__weekdays`,uw=`${lw}__weekday`;function dw(e){let{calendarType:n,formatShortWeekday:i=kS,formatWeekday:a=AS,locale:o,onMouseLeave:s}=e,c=nC(new Date),l=Z(c),u=FS(c),d=[];for(let e=1;e<=7;e+=1){let s=new Date(l,u,e-yC(c,n)),f=a(o,s);d.push(t(`div`,{className:r(uw,LC(s)&&`${uw}--current`,RC(s,n)&&`${uw}--weekend`),children:t(`abbr`,{"aria-label":f,title:f,children:i(o,s).replace(`.`,``)})},e))}return t(HC,{className:lw,count:7,onFocus:s,onMouseOver:s,children:d})}const fw=`react-calendar__tile`;function pw(e){let{onClickWeekNumber:n,weekNumber:r}=e,i=t(`span`,{children:r});if(n){let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`button`,{...o,className:fw,onClick:e=>r(a,n,e),type:`button`,children:i})}{let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`div`,{...o,className:fw,children:i})}}function mw(e){let{activeStartDate:n,calendarType:r,onClickWeekNumber:i,onMouseLeave:a,showFixedNumberOfWeeks:o}=e,s=(()=>{if(o)return 6;let e=fC(n)-(7-yC(n,r));return 1+Math.ceil(e/7)})(),c=(()=>{let e=Z(n),t=FS(n),i=IS(n),a=[];for(let n=0;n<s;n+=1)a.push(SC(new Date(e,t,i+n*7),r));return a})(),l=c.map(e=>CC(e,r));return t(HC,{className:`react-calendar__month-view__weekNumbers`,count:s,direction:`column`,onFocus:a,onMouseOver:a,style:{flexBasis:`calc(100% * (1 / 8)`,flexShrink:0},children:l.map((e,n)=>{let r=c[n];if(!r)throw Error(`date is not defined`);return t(pw,{date:r,onClickWeekNumber:i,weekNumber:e},e)})})}function hw(e){if(e){for(let[t,n]of Object.entries(mC))if(n.includes(e))return t}return pC.ISO_8601}function gw(e){let{activeStartDate:i,locale:a,onMouseLeave:o,showFixedNumberOfWeeks:s}=e,{calendarType:c=hw(a),formatShortWeekday:l,formatWeekday:u,onClickWeekNumber:d,showWeekNumbers:f,...p}=e;function m(){return t(dw,{calendarType:c,formatShortWeekday:l,formatWeekday:u,locale:a,onMouseLeave:o})}function h(){return f?t(mw,{activeStartDate:i,calendarType:c,onClickWeekNumber:d,onMouseLeave:o,showFixedNumberOfWeeks:s}):null}function g(){return t(cw,{calendarType:c,...p})}let _=`react-calendar__month-view`;return t(`div`,{className:r(_,f?`${_}--weekNumbers`:``),children:n(`div`,{style:{display:`flex`,alignItems:`flex-end`},children:[h(),n(`div`,{style:{flexGrow:1,width:`100%`},children:[m(),g()]})]})})}function _w({classes:e=[],formatMonth:n=DS,formatMonthYear:r=OS,...i}){let{date:a,locale:o}=i;return t(ZC,{...i,classes:[...e,`react-calendar__year-view__months__month`],formatAbbr:r,maxDateTransform:aC,minDateTransform:nC,view:`year`,children:n(o,a)})}function vw(e){let{activeStartDate:n,hover:r,value:i,valueType:a,...o}=e,s=Z(n);return t(XC,{className:`react-calendar__year-view__months`,dateTransform:e=>{let t=new Date;return t.setFullYear(s,e,1),nC(t)},dateType:`month`,end:11,hover:r,renderTile:({date:e,...r})=>t(_w,{...o,...r,activeStartDate:n,date:e},e.getTime()),start:0,value:i,valueType:a})}function yw(e){function n(){return t(vw,{...e})}return t(`div`,{className:`react-calendar__year-view`,children:n()})}const bw=`react-calendar`,xw=[`century`,`decade`,`year`,`month`],Sw=[`decade`,`year`,`month`,`day`],Cw=new Date;Cw.setFullYear(1,0,1),Cw.setHours(0,0,0,0);const ww=new Date(864e13);function Tw(e){return e instanceof Date?e:new Date(e)}function Ew(e,t){return xw.slice(xw.indexOf(e),xw.indexOf(t)+1)}function Dw(e,t,n){return Ew(t,n).indexOf(e)!==-1}function Ow(e,t,n){return e&&Dw(e,t,n)?e:n}function kw(e){let t=xw.indexOf(e);return Sw[t]}function Aw(e,t){let n=Array.isArray(e)?e[t]:e;if(!n)return null;let r=Tw(n);if(Number.isNaN(r.getTime()))throw Error(`Invalid date: ${e}`);return r}function jw({value:e,minDate:t,maxDate:n,maxDetail:r},i){let a=Aw(e,i);if(!a)return null;let o=kw(r);return UC((()=>{switch(i){case 0:return wC(o,a);case 1:return kC(o,a);default:throw Error(`Invalid index value: ${i}`)}})(),t,n)}const Mw=e=>jw(e,0),Nw=e=>jw(e,1),Pw=e=>[Mw,Nw].map(t=>t(e));function Fw({maxDate:e,maxDetail:t,minDate:n,minDetail:r,value:i,view:a}){return wC(Ow(a,r,t),Mw({value:i,minDate:n,maxDate:e,maxDetail:t})||new Date)}function Iw({activeStartDate:e,defaultActiveStartDate:t,defaultValue:n,defaultView:r,maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c,view:l}){let u=Ow(l,s,a),d=e||t;return d?wC(u,d):Fw({maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c||n,view:l||r})}function Lw(e){return e&&(!Array.isArray(e)||e.length===1)}function Rw(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var zw=p(function(e,i){let{activeStartDate:a,allowPartialRange:o,calendarType:s,className:c,"data-testid":l,defaultActiveStartDate:u,defaultValue:d,defaultView:f,formatDay:p,formatLongDate:m,formatMonth:g,formatMonthYear:_,formatShortWeekday:v,formatWeekday:b,formatYear:x,goToRangeStartOnSelect:S=!0,inputRef:C,locale:T,maxDate:E=ww,maxDetail:D=`month`,minDate:O=Cw,minDetail:k=`century`,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:ee,nextLabel:te,onActiveStartDateChange:F,onChange:ne,onClickDay:re,onClickDecade:ie,onClickMonth:ae,onClickWeekNumber:oe,onClickYear:se,onDrillDown:ce,onDrillUp:le,onViewChange:ue,prev2AriaLabel:de,prev2Label:fe,prevAriaLabel:pe,prevLabel:me,returnValue:he=`start`,selectRange:ge,showDoubleView:_e,showFixedNumberOfWeeks:ve,showNavigation:ye=!0,showNeighboringCentury:be,showNeighboringDecade:xe,showNeighboringMonth:Se=!0,showWeekNumbers:Ce,tileClassName:we,tileContent:Te,tileDisabled:Ee,value:De,view:Oe}=e,[ke,Ae]=w(u),[je,I]=w(null),[Me,Ne]=w(Array.isArray(d)?d.map(e=>e===null?null:Tw(e)):d==null?null:Tw(d)),[Pe,Fe]=w(f),Ie=a||ke||Iw({activeStartDate:a,defaultActiveStartDate:u,defaultValue:d,defaultView:f,maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:De,view:Oe}),Le=(()=>{let e=ge&&Lw(Me)||De===void 0?Me:De;return e?Array.isArray(e)?e.map(e=>e===null?null:Tw(e)):e===null?null:Tw(e):null})(),Re=kw(D),L=Ow(Oe||Pe,k,D),ze=Ew(k,D),Be=ge?je:null,Ve=ze.indexOf(L)<ze.length-1,He=ze.indexOf(L)>0,Ue=h(e=>(()=>{switch(he){case`start`:return Mw;case`end`:return Nw;case`range`:return Pw;default:throw Error(`Invalid returnValue.`)}})()({maxDate:E,maxDetail:D,minDate:O,value:e}),[E,D,O,he]),We=h((e,t)=>{Ae(e);let n={action:t,activeStartDate:e,value:Le,view:L};F&&!Rw(Ie,e)&&F(n)},[Ie,F,Le,L]),Ge=h((e,t)=>{let n=(()=>{switch(L){case`century`:return ie;case`decade`:return se;case`year`:return ae;case`month`:return re;default:throw Error(`Invalid view: ${L}.`)}})();n&&n(e,t)},[re,ie,ae,se,L]),Ke=h((e,t)=>{if(!Ve)return;Ge(e,t);let n=ze[ze.indexOf(L)+1];if(!n)throw Error(`Attempted to drill down from the lowest view.`);Ae(e),Fe(n);let r={action:`drillDown`,activeStartDate:e,value:Le,view:n};F&&!Rw(Ie,e)&&F(r),ue&&L!==n&&ue(r),ce&&ce(r)},[Ie,Ve,F,Ge,ce,ue,Le,L,ze]),qe=h(()=>{if(!He)return;let e=ze[ze.indexOf(L)-1];if(!e)throw Error(`Attempted to drill up from the highest view.`);let t=wC(e,Ie);Ae(t),Fe(e);let n={action:`drillUp`,activeStartDate:t,value:Le,view:e};F&&!Rw(Ie,t)&&F(n),ue&&L!==e&&ue(n),le&&le(n)},[Ie,He,F,le,ue,Le,L,ze]),Je=h((e,t)=>{let n=Le;Ge(e,t);let r=ge&&!Lw(n),i;if(ge){if(r)i=wC(Re,e);else{if(!n)throw Error(`previousValue is required`);if(Array.isArray(n))throw Error(`previousValue must not be an array`);i=NC(Re,n,e)}}else i=Ue(e);let a=!ge||r||S?Fw({maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:i,view:L}):null;t.persist(),Ae(a),Ne(i);let s={action:`onChange`,activeStartDate:a,value:i,view:L};if(F&&!Rw(Ie,a)&&F(s),ne){if(ge){if(!Lw(i))ne(i||null,t);else if(o){if(Array.isArray(i))throw Error(`value must not be an array`);ne([i||null,null],t)}}else ne(i||null,t)}},[Ie,o,Ue,S,E,D,O,k,F,ne,Ge,ge,Le,Re,L]);function Ye(e){I(e)}function Xe(){I(null)}y(i,()=>({activeStartDate:Ie,drillDown:Ke,drillUp:qe,onChange:Je,setActiveStartDate:We,value:Le,view:L}),[Ie,Ke,qe,Je,We,Le,L]);function Ze(e){let n={activeStartDate:e?EC(L,Ie):wC(L,Ie),hover:Be,locale:T,maxDate:E,minDate:O,onClick:Ve?Ke:Je,onMouseOver:ge?Ye:void 0,tileClassName:we,tileContent:Te,tileDisabled:Ee,value:Le,valueType:Re};switch(L){case`century`:return t(tw,{formatYear:x,showNeighboringCentury:be,...n});case`decade`:return t(aw,{formatYear:x,showNeighboringDecade:xe,...n});case`year`:return t(yw,{formatMonth:g,formatMonthYear:_,...n});case`month`:return t(gw,{calendarType:s,formatDay:p,formatLongDate:m,formatShortWeekday:v,formatWeekday:b,onClickWeekNumber:oe,onMouseLeave:ge?Xe:void 0,showFixedNumberOfWeeks:ve===void 0?_e:ve,showNeighboringMonth:Se,showWeekNumbers:Ce,...n});default:throw Error(`Invalid view: ${L}.`)}}function Qe(){return ye?t(BC,{activeStartDate:Ie,drillUp:qe,formatMonthYear:_,formatYear:x,locale:T,maxDate:E,minDate:O,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:ee,nextLabel:te,prev2AriaLabel:de,prev2Label:fe,prevAriaLabel:pe,prevLabel:me,setActiveStartDate:We,showDoubleView:_e,view:L,views:ze}):null}return n(`div`,{className:r(bw,ge&&(Array.isArray(Le)?Le:[Le]).length===1&&`${bw}--selectRange`,_e&&`${bw}--doubleView`,c),"data-testid":l,ref:C,children:[Qe(),n(`div`,{className:`${bw}__viewContainer`,onBlur:ge?Xe:void 0,onMouseLeave:ge?Xe:void 0,children:[Ze(),_e?Ze(!0):null]})]})});pe.extend(he),pe.extend(me);var Q=pe,Bw=Object.defineProperty,Vw=(e,t)=>Bw(e,`name`,{value:t,configurable:!0}),Hw=`Popover`,[Uw,Ww]=an(Hw,[zn]),Gw=zn(),[Kw,qw]=Uw(Hw),Jw=Vw(e=>{let{__scopePopover:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,l=Gw(n),u=a.useRef(null),[d,f]=a.useState(!1),[p,m]=br({prop:i,defaultProp:o??!1,onChange:s,caller:Hw});return t(Qn,{...l,children:t(Kw,{scope:n,contentId:V(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:a.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:c,children:r})})},`Popover`),Yw=`PopoverAnchor`,Xw=a.forwardRef(Vw(function(e,n){let{__scopePopover:r,...i}=e,o=qw(Yw,r),s=Gw(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=o;return a.useEffect(()=>(c(),()=>l()),[c,l]),t($n,{...s,...i,ref:n})},`PopoverAnchor`)),Zw=`PopoverTrigger`,Qw=a.forwardRef(Vw(function(e,n){let{__scopePopover:r,...i}=e,a=qw(Zw,r),o=Gw(r),s=R(n,a.triggerRef),c=t(H.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":dT(a.open),...i,ref:s,onClick:B(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:t($n,{asChild:!0,...o,children:c})},`PopoverTrigger`)),$w=`PopoverPortal`,[eT,tT]=Uw($w,{forceMount:void 0}),nT=Vw(e=>{let{__scopePopover:n,forceMount:r,children:i,container:a}=e,o=qw($w,n);return t(eT,{scope:n,forceMount:r,children:t(or,{present:r||o.open,children:t(nr,{asChild:!0,container:a,children:i})})})},`PopoverPortal`),rT=`PopoverContent`,iT=a.forwardRef(Vw(function(e,n){let r=tT(rT,e.__scopePopover),{forceMount:i=r.forceMount,...a}=e,o=qw(rT,e.__scopePopover);return t(or,{present:i||o.open,children:o.modal?t(oT,{...a,ref:n}):t(sT,{...a,ref:n})})},`PopoverContent`)),aT=Pt(`PopoverContent.RemoveScroll`),oT=a.forwardRef(Vw(function(e,n){let r=qw(rT,e.__scopePopover),i=a.useRef(null),o=R(n,i),s=a.useRef(!1);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),t(ue,{as:aT,allowPinchZoom:!0,children:t(cT,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:B(e.onCloseAutoFocus,e=>{e.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:B(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:B(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),sT=a.forwardRef(Vw(function(e,n){let r=qw(rT,e.__scopePopover),i=a.useRef(!1),o=a.useRef(!1);return t(cT,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(o.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&o.current&&t.preventDefault()}})},`PopoverContentNonModal`)),cT=a.forwardRef(Vw(function(e,n){let{__scopePopover:r,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=qw(rT,r),m=Gw(r);return le(),t(ce,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:o,children:t(M,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:t(er,{"data-state":dT(p.open),role:`dialog`,id:p.contentId,...m,...f,ref:n,style:{...f.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`)),lT=`PopoverClose`,uT=a.forwardRef(Vw(function(e,n){let{__scopePopover:r,...i}=e,a=qw(lT,r);return t(H.button,{type:`button`,...i,ref:n,onClick:B(e.onClick,()=>a.onOpenChange(!1))})},`PopoverClose`));function dT(e){return e?`open`:`closed`}Vw(dT,`getState`);var fT=Jw,pT=Xw,mT=Qw,hT=nT,gT=iT,_T=uT;const vT=a.createContext(null),yT=({hover:e=!1,click:n=!1,modal:r,children:i,_open:o,onOpenChange:s})=>{let[c,l]=a.useState(o||!1);return t(vT.Provider,{value:{open:c,setOpen:l,hover:e,click:n},children:t(fT,{open:c,onOpenChange:e=>{l(e),s&&s(e)},modal:r,children:i})})};function bT(e=!1,t=()=>{},n){e&&t(n===`enter`)}const xT=a.forwardRef(({children:e,...n},r)=>{let i=a.useContext(vT);if(!i)throw Error(`PopoverTrigger must be used within a Popover`);let{setOpen:o,hover:s,click:c}=i;return t(mT,{ref:r,asChild:!0,onMouseEnter:()=>bT(s,o,`enter`),onMouseLeave:()=>bT(s,o,`leave`),onClick:()=>{c&&o(e=>!e)},...n,children:e})});xT.displayName=mT.displayName;const ST=pT,CT=a.forwardRef(({className:e,align:n=`center`,side:r=`bottom`,...i},o)=>{let s=a.useContext(vT);if(!s)throw Error(`PopoverContent must be used within a Popover`);let{setOpen:c,hover:l}=s,u=hi();return t(hT,{container:u,children:t(gT,{ref:o,align:n,side:r,onMouseEnter:()=>bT(l,c,`enter`),onMouseLeave:()=>bT(l,c,`leave`),className:z(`z-50 w-72 rounded-md border-popover bg-popover text-popover-foreground ring-1 ring-gray-200 dark:ring-slate-700 shadow-md focus:outline-none animate-in`,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})})});CT.displayName=gT.displayName;const wT=_T;wT.displayName=_T.displayName;function TT(){let e=a.useContext(vT);if(!e)throw Error(`usePopoverContext must be used within a Popover`);return{...e,close:()=>e.setOpen(!1)}}const ET=`
2
197
  .calendar-wrapper .react-calendar__navigation {
3
198
  display: flex !important;
4
199
  justify-content: space-between !important;
@@ -84,12 +279,12 @@ import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import r,{clsx a
84
279
  text-align: center !important;
85
280
  }
86
281
 
87
- `,xr=({filterValues:r,setFilterValues:i,isRange:a=!1})=>{let[o,s]=L(!1),[c,l]=L([null,null]),{t:u}=R(),d=r[0]?Y(r[0]).toDate():void 0,f=a?[c[0]||(r[0]?Y(r[0]).toDate():null),c[1]||(r[1]?Y(r[1]).toDate():null)]:[null,null];F(()=>{a&&l([r[0]?Y(r[0]).toDate():null,r[1]?Y(r[1]).toDate():null])},[r,a]);let p=()=>a?f[0]&&f[1]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Y(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted-foreground`,children:`-`}),t(`span`,{className:`font-medium`,children:Y(f[1]).format(`MMMM DD, YYYY`)})]}):f[0]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Y(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted-foreground`,children:`- Select end`})]}):t(`span`,{className:`text-muted-foreground`,children:u(`filter.selectRange`)}):d?Y(d).format(`MMMM DD, YYYY`):`Pick a date`,m=e=>{if(a)Array.isArray(e)&&(l([e[0],e[1]]),e[0]&&e[1]?i([Y(e[0]).format(`YYYY-MM-DD`),Y(e[1]).format(`YYYY-MM-DD`)]):e[0]&&i([Y(e[0]).format(`YYYY-MM-DD`)]));else if(e){let t=Array.isArray(e)?e[0]:e;t&&(i([Y(t).format(`YYYY-MM-DD`)]),s(!1))}};return n(X,{_open:o,onOpenChange:s,children:[t(Z,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center min-h-[20px]`,children:p()})}),t(Q,{className:`w-auto p-0`,align:`start`,side:`bottom`,alignOffset:-4,sideOffset:6,children:t(`div`,{className:`p-2`,children:a?n(e,{children:[n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:br}),t(Se,{value:f,onChange:m,selectRange:!0,returnValue:`range`,maxDate:(()=>{let e=new Date;return e.setHours(23,59,59,999),e})(),className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(f[0]){let e=f[0].getTime();if(f[1]){let n=f[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-primary/20 text-primary font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}})]}),f[0]&&f[1]&&t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(K,{variant:`ghost`,size:`sm`,onClick:()=>s(!1),children:`Cancel`}),t(K,{size:`sm`,onClick:()=>s(!1),children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:br}),t(Se,{value:d,onChange:m,selectRange:!1,maxDate:(()=>{let e=new Date;return e.setHours(23,59,59,999),e})(),className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(d&&t===d.getTime())return`bg-primary text-primary-foreground rounded-md font-semibold`}return``}})]})})})]})};function Sr({value:n,labelRenderer:r,fallbackLabel:i}){let[a,o]=L(i||n),[s,c]=L(!1);return F(()=>{if(!r){o(i||n);return}(async()=>{c(!0);try{let e=r(n);if(e instanceof Promise){let t=await e;o(t)}else o(e)}catch(e){console.error(`Error rendering label:`,e),o(i||n)}finally{c(!1)}})()},[n,r,i]),s?t(`span`,{className:`text-muted-foreground`,children:`Loading...`}):t(e,{children:a})}const Cr=({filterType:r,filterValues:i,setFilterValues:a,options:o,labelRenderer:s,multiple:c=!0})=>{let[l,u]=L(!1),[d,f]=L(``),p=I(null),{t:m}=R(),h=o?.filter(e=>!i.some(t=>t.value===e.value));return n(X,{_open:l,onOpenChange:e=>{u(e),e||setTimeout(()=>{f(``)},200)},children:[t(Z,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 transition text-muted hover:text-primary shrink-0`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:i?.length===1?(()=>{let e=i[0];return t(Sr,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})})():`${i?.length} selected`})}),t(Q,{className:`w-[300px] p-0`,children:t(mr,{children:n(Vn,{children:[t(Un,{placeholder:r,className:`h-9`,value:d,onInputCapture:e=>{f(e.currentTarget.value)},ref:p}),n(Wn,{children:[t(Gn,{children:m(`filter.noResultsFound`)}),t(q,{children:i.map(e=>n(J,{className:`group flex gap-2 items-center`,onSelect:()=>{a(i.filter(t=>t.value!==e.value)),setTimeout(()=>{f(``)},200),u(!1)},children:[c&&t(`input`,{type:`checkbox`,checked:!0,onChange:()=>{}}),t(Sr,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})]},e.value))}),h?.length>0&&n(e,{children:[t(Kn,{}),t(q,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(e=>n(J,{className:`group flex gap-2 items-center`,value:String(e.label||e.value),onSelect:()=>{let t={value:e.value,label:e.label};a(c?[...i,t]:[t]),setTimeout(()=>{f(``)},200),u(!1)},children:[c&&t(xn,{checked:!1,className:`opacity-0 group-data-[selected=true]:opacity-100`}),t(`span`,{className:`text-muted`,children:t(Sr,{value:e.value||``,labelRenderer:e.labelRenderer||s,fallbackLabel:e.label})})]},e.value))})]})]})]})})})]})},wr=({filterType:e,filterValues:r,setFilterValues:i})=>{let[a,o]=L(!1),[s,c]=L(r);return n(X,{_open:a,onOpenChange:e=>{o(e),!e&&JSON.stringify(s)!==JSON.stringify(r)&&c(r)},children:[t(Z,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r.length>0?r.length===1?r[0]:`${r.length} tags`:`Add tags...`})}),t(Q,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-3`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t(qt,{value:s,onChange:c,placeholder:`Add ${e.toLowerCase()}...`}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(K,{size:`sm`,variant:`ghost`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(K,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})]})})]})},Tr=z(``,{variants:{size:{xs:`rounded py-1 text-xs rounded-xs`,sm:`rounded text-xs rounded-sm`,md:`rounded-md py-2 text-sm`,lg:`rounded-md text-base`,xl:`rounded-md py-2.5 text-lg`},variant:{default:`flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,unstyled:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,noPadding:`block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background`,legacy:`py-1.5 block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background`}},defaultVariants:{size:`md`,variant:`default`}}),$=M.forwardRef(({className:e,type:r,size:i=`md`,variant:a=`default`,clearable:o=!0,onChange:s,value:c,invalid:l,...u},d)=>{let f=()=>{s?.(``)},p=e=>{s?.(e.target.value)},m=u[`aria-invalid`]??(l?!0:void 0);return n(`div`,{className:`w-full relative inline-block [&:hover_.clear-button]:opacity-100`,children:[t(`input`,{type:r,className:G(Tr({size:i,variant:a}),e,o&&c?`pe-8`:``),ref:d,value:c??``,onChange:p,...u,"aria-invalid":m}),o&&c&&!u.readOnly&&!u.disabled&&t(K,{variant:`link`,size:`icon`,type:`button`,onClick:f,className:`clear-button opacity-0 transition-opacity duration-200
282
+ `,DT=({filterValues:r,setFilterValues:i,isRange:a=!1})=>{let[o,s]=w(!1),[c,l]=w([null,null]),{t:u}=k(),d=r[0]?Q(r[0]).toDate():void 0,f=a?[c[0]||(r[0]?Q(r[0]).toDate():null),c[1]||(r[1]?Q(r[1]).toDate():null)]:[null,null];_(()=>{a&&l([r[0]?Q(r[0]).toDate():null,r[1]?Q(r[1]).toDate():null])},[r,a]);let p=()=>a?f[0]&&f[1]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Q(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted-foreground`,children:`-`}),t(`span`,{className:`font-medium`,children:Q(f[1]).format(`MMMM DD, YYYY`)})]}):f[0]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Q(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted-foreground`,children:`- Select end`})]}):t(`span`,{className:`text-muted-foreground`,children:u(`filter.selectRange`)}):d?Q(d).format(`MMMM DD, YYYY`):`Pick a date`,m=e=>{if(a)Array.isArray(e)&&(l([e[0],e[1]]),e[0]&&e[1]?i([Q(e[0]).format(`YYYY-MM-DD`),Q(e[1]).format(`YYYY-MM-DD`)]):e[0]&&i([Q(e[0]).format(`YYYY-MM-DD`)]));else if(e){let t=Array.isArray(e)?e[0]:e;t&&(i([Q(t).format(`YYYY-MM-DD`)]),s(!1))}};return n(yT,{_open:o,onOpenChange:s,children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center min-h-[20px]`,children:p()})}),t(CT,{className:`w-auto p-0`,align:`start`,side:`bottom`,alignOffset:-4,sideOffset:6,children:t(`div`,{className:`p-2`,children:a?n(e,{children:[n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:f,onChange:m,selectRange:!0,returnValue:`range`,maxDate:(()=>{let e=new Date;return e.setHours(23,59,59,999),e})(),className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(f[0]){let e=f[0].getTime();if(f[1]){let n=f[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-primary/20 text-primary font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}})]}),f[0]&&f[1]&&t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:()=>s(!1),children:`Cancel`}),t(U,{size:`sm`,onClick:()=>s(!1),children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:d,onChange:m,selectRange:!1,maxDate:(()=>{let e=new Date;return e.setHours(23,59,59,999),e})(),className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(d&&t===d.getTime())return`bg-primary text-primary-foreground rounded-md font-semibold`}return``}})]})})})]})};function OT({value:n,labelRenderer:r,fallbackLabel:i}){let[a,o]=w(i||n),[s,c]=w(!1);return _(()=>{if(!r){o(i||n);return}(async()=>{c(!0);try{let e=r(n);if(e instanceof Promise){let t=await e;o(t)}else o(e)}catch(e){console.error(`Error rendering label:`,e),o(i||n)}finally{c(!1)}})()},[n,r,i]),s?t(`span`,{className:`text-muted-foreground`,children:`Loading...`}):t(e,{children:a})}const kT=({filterType:r,filterValues:i,setFilterValues:a,options:o,labelRenderer:s,multiple:c=!0})=>{let[l,u]=w(!1),[d,f]=w(``),p=C(null),{t:m}=k(),h=o?.filter(e=>!i.some(t=>t.value===e.value));return n(yT,{_open:l,onOpenChange:e=>{u(e),e||setTimeout(()=>{f(``)},200)},children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 transition text-muted hover:text-primary shrink-0`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:i?.length===1?(()=>{let e=i[0];return t(OT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})})():`${i?.length} selected`})}),t(CT,{className:`w-[300px] p-0`,children:t(Wx,{children:n(dv,{children:[t(pv,{placeholder:r,className:`h-9`,value:d,onInputCapture:e=>{f(e.currentTarget.value)},ref:p}),n(mv,{children:[t(hv,{children:m(`filter.noResultsFound`)}),t(gv,{children:i.map(e=>n(vv,{className:`group flex gap-2 items-center`,onSelect:()=>{a(i.filter(t=>t.value!==e.value)),setTimeout(()=>{f(``)},200),u(!1)},children:[c&&t(`input`,{type:`checkbox`,checked:!0,onChange:()=>{}}),t(OT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})]},e.value))}),h?.length>0&&n(e,{children:[t(_v,{}),t(gv,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(e=>n(vv,{className:`group flex gap-2 items-center`,value:String(e.label||e.value),onSelect:()=>{let t={value:e.value,label:e.label};a(c?[...i,t]:[t]),setTimeout(()=>{f(``)},200),u(!1)},children:[c&&t(rg,{checked:!1,className:`opacity-0 group-data-[selected=true]:opacity-100`}),t(`span`,{className:`text-muted`,children:t(OT,{value:e.value||``,labelRenderer:e.labelRenderer||s,fallbackLabel:e.label})})]},e.value))})]})]})]})})})]})},AT=({filterType:e,filterValues:r,setFilterValues:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(yT,{_open:a,onOpenChange:e=>{o(e),!e&&JSON.stringify(s)!==JSON.stringify(r)&&c(r)},children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r.length>0?r.length===1?r[0]:`${r.length} tags`:`Add tags...`})}),t(CT,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-3`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t(Ki,{value:s,onChange:c,placeholder:`Add ${e.toLowerCase()}...`}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{size:`sm`,variant:`ghost`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})]})})]})},jT=A(``,{variants:{size:{xs:`rounded py-1 text-xs rounded-xs`,sm:`rounded text-xs rounded-sm`,md:`rounded-md py-2 text-sm`,lg:`rounded-md text-base`,xl:`rounded-md py-2.5 text-lg`},variant:{default:`flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,unstyled:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,noPadding:`block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background`,legacy:`py-1.5 block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background`}},defaultVariants:{size:`md`,variant:`default`}}),MT=a.forwardRef(({className:e,type:r,size:i=`md`,variant:a=`default`,clearable:o=!0,onChange:s,value:c,invalid:l,...u},d)=>{let f=()=>{s?.(``)},p=e=>{s?.(e.target.value)},m=u[`aria-invalid`]??(l?!0:void 0);return n(`div`,{className:`w-full relative inline-block [&:hover_.clear-button]:opacity-100`,children:[t(`input`,{type:r,className:z(jT({size:i,variant:a}),e,o&&c?`pe-8`:``),ref:d,value:c??``,onChange:p,...u,"aria-invalid":m}),o&&c&&!u.readOnly&&!u.disabled&&t(U,{variant:`link`,size:`icon`,type:`button`,onClick:f,className:`clear-button opacity-0 transition-opacity duration-200
88
283
  absolute top-1/2 -translate-y-1/2 text-muted !hover:text-destructive cursor-pointer
89
- flex items-center justify-center size-6 rounded end-2`,"aria-label":`Clear input`,children:t(j,{size:16})})]})});$.displayName=`Input`;const Er=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=L(!1),[s,c]=L(r);return n(X,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(Z,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r||`Enter text...`})}),t(Q,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t($,{autoFocus:!0,type:`text`,size:`sm`,value:s,onChange:c,onKeyDown:e=>{e.key===`Enter`&&(i(s),o(!1))},placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(K,{variant:`ghost`,size:`sm`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(K,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})})]})})]})};function Dr({selectedView:r,selectedDate:i,setSelectedDate:a,setFilters:o,filters:s,handleClose:c,filterGroups:l}){let{t:u}=R(),[d,f]=L([null,null]),[p,m]=L([null,null]),h=l.find(e=>e.name===r),g=h?.multiple,_=new Date;_.setHours(23,59,59,999);let v=[p[0]||d[0],p[1]||d[1]],y=e=>{if(g)Array.isArray(e)?(m([e[0],e[1]]),f([e[0],e[1]])):(m([e,null]),f([e,null]));else{let t=Array.isArray(e)?e[0]:e;if(a(t||void 0),t){let e=new Date(t);e.setHours(0,0,0,0),o([...s,{name:r||``,placeholder:h?.placeholder,value:[{value:e.toISOString(),label:Y(e).format(`LLL dd, y`)}],type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}}};return t(`div`,{className:`p-2`,children:g?n(e,{children:[t(`div`,{children:g?v[0]&&v[1]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Y(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:u(`filter.to`)}),t(`span`,{className:`text-xs font-medium`,children:Y(v[1]).format(`MMMM DD, YYYY`)})]}):v[0]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Y(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`→ Select end date`})]}):t(`span`,{className:`text-muted text-xs`,children:h?.placeholder||h?.name||r||`Select date range`}):i?Y(i).format(`MMMM DD, YYYY`):`Pick a date`}),n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:br}),t(Se,{value:v,onChange:y,selectRange:!0,returnValue:`range`,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(v[0]){let e=v[0].getTime();if(v[1]){let n=v[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-primary/20 text-primary font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}},`${v[0]?.getTime()}-${v[1]?.getTime()}`)]}),t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(K,{variant:`ghost`,size:`sm`,onClick:c,children:`Cancel`}),t(K,{size:`sm`,onClick:()=>{if(d[0]){let e=new Date(d[0]),t=d[1]?new Date(d[1]):new Date(d[0]);e.setHours(0,0,0,0),t.setHours(23,59,59,999);let n=[];n.push({value:e.toISOString(),label:Y(e).format(`LLL dd, y`)}),d[1]&&d[0].getTime()!==d[1].getTime()&&n.push({value:t.toISOString(),label:Y(t).format(`LLL dd, y`)}),o([...s,{name:r||``,placeholder:h?.placeholder,value:n,type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}},disabled:!v[0],children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:br}),t(Se,{value:i,onChange:y,selectRange:!1,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(i&&t===i.getTime())return`bg-primary text-primary-foreground rounded-md font-semibold`}return``}})]})})}function Or({selectedView:e,commandInput:r,setFilters:i,handleClose:a,filterGroups:o}){let[s,c]=L([]),l=e=>{let t=o.find(t=>t.name===e);if(!t)return[];let n=t.options||[];if(!r.trim())return n;if(t.filterBy){let e=r.toLowerCase();return n.filter(n=>n.value!==void 0&&t.filterBy?.(n.value,e))}let i=r.toLowerCase();return n.filter(e=>String(e.value||``).toLowerCase().includes(i))};if(!e)return null;let u=l(e),d=o.find(t=>t.name===e),f=d?.placeholder||d?.name,p=()=>{s.length>0&&i(t=>[...t.filter(t=>t.name!==e),{name:e||``,placeholder:d?.placeholder||``,value:s,type:d?.type||`select`,multiple:d?.multiple||!1}]),a()},m=t=>{let n={value:t.value,label:t.label};d?.multiple?s.some(e=>e.value===t.value)?c(e=>e.filter(e=>e.value!==t.value)):c(e=>[...e,n]):(i(t=>{let r=t.findIndex(t=>t.name===e);if(r>=0){let e=[...t];return e[r]={...e[r],value:[n]},e}return[...t,{name:e||``,placeholder:d?.placeholder||``,value:[n],type:d?.type||`select`,multiple:d?.multiple||!1}]}),a())};return n(`div`,{className:`flex flex-col h-full`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted shrink-0`,children:t(`span`,{children:f})}),t(`div`,{className:`flex-1 overflow-hidden min-h-0`,children:t(`div`,{className:`max-h-[200px] overflow-y-auto`,children:u.length>0&&u.map(e=>{let r=s.some(t=>t.value===e.value);return n(J,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(Sr,{value:e.value||``,labelRenderer:e.labelRenderer||d?.labelRenderer,fallbackLabel:e.label}),d?.multiple&&r&&t(`span`,{className:`ms-auto text-xs text-success`,children:`✓`})]},e.value||`option-${Math.random()}`)})})}),d?.multiple&&t(`div`,{className:`p-2 border-t shrink-0`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(K,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),t(K,{size:`sm`,onClick:p,disabled:s.length===0,children:`Apply`})]})})]})}function kr({selectedView:e,setFilters:r,handleClose:i,filterGroups:a}){let[o,s]=L([]),c=a.find(t=>t.name===e);return n(`div`,{className:`p-2 space-y-3`,children:[t(`div`,{className:`space-y-2`,children:t(qt,{value:o,onChange:s,placeholder:c?.placeholder||`Add ${e}...`,autoFocus:!0})}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(K,{variant:`ghost`,size:`sm`,onClick:i,children:`Cancel`}),t(K,{size:`sm`,onClick:()=>{o.length>0&&r(t=>[...t.filter(t=>t.name!==e),{name:e,placeholder:c?.placeholder,value:o,type:`stringList`}]),i()},disabled:o.length===0,children:`Apply`})]})]})}function Ar({selectedView:e,textValue:r,setTextValue:i,setFilters:a,handleClose:o,filterGroups:s}){let c=()=>{a(t=>[...t,{name:e||``,placeholder:s.find(t=>t.name===e)?.placeholder,value:[{value:r,label:r}],type:`text`}]),o()};return n(`div`,{className:`p-2 flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:s.find(t=>t.name===e)?.placeholder})}),t($,{autoFocus:!0,type:`text`,size:`sm`,value:r,onChange:i,onKeyDown:e=>e.key===`Enter`&&c(),placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(K,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),t(K,{size:`sm`,onClick:c,disabled:!r.trim(),children:`Apply`})]})})]})}function jr(e,n,r){switch(e.type){case`date`:return t(xr,{filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value.map(e=>e.value||``):[],isRange:e.multiple,setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t.length>0?t.map(e=>({value:e,label:Y(e).format(`LLL dd, y`)})):[]}:n))}});case`text`:return t(Er,{filterType:e.placeholder||e.name,filterValue:Array.isArray(e.value)&&e.value[0]&&typeof e.value[0]==`object`&&e.value[0].value||``,setFilterValue:t=>{n(n=>n.map(n=>n===e?{...n,value:[{value:t,label:t}]}:n))}});case`stringList`:return t(wr,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`string`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))}});default:{let i=r.find(t=>t.name===e.name);return t(Cr,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))},options:i?.options||[],labelRenderer:i?.labelRenderer,multiple:e.multiple??i?.multiple})}}}function Mr({filters:e,setFilters:r,filterGroups:i}){return t(`div`,{className:`flex gap-2 flex-wrap justify-start`,children:e.filter(e=>e.value?.length>0).map(e=>n(`div`,{className:`flex gap-[1px] items-center text-sm`,children:[t(`div`,{className:`flex gap-1.5 shrink-0 rounded-s bg-muted p-1.5 h-8 items-center`,children:e.placeholder||e.name}),jr(e,r,i),t(K,{variant:`ghost`,size:`icon`,onClick:()=>{r(t=>t.filter(t=>t!==e))},className:`bg-muted rounded-s-none rounded-e-sm size-8 hover:text-primary hover:bg-muted/50 transition shrink-0`,children:t(j,{className:`size-6`})})]},`${e.name}-${e.type===`date`?`date`:e.type===`stringList`&&typeof e.value[0]==`string`?e.value.join(`,`):Array.isArray(e.value)?e.value.map(e=>e.value).join(`,`):``}`))})}const Nr=N.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),Pr=({filters:e,setFilters:n,filterGroups:r,children:i,inModal:a})=>{let o=new URL(window.location.href).searchParams.toString(),[s]=N.useState(()=>new URLSearchParams(window.location.search).get(`filters`)),c=N.useRef(new Set),l=N.useRef(a||!s);return F(()=>{if(!a&&l.current)try{let t=new URLSearchParams(o);if(e.length>0){let n=e.map(e=>{let t;if(e.type===`stringList`&&Array.isArray(e.value)&&typeof e.value[0]==`string`)t=`[${e.value.map(e=>encodeURIComponent(e)).join(`,`)}]`;else if(Array.isArray(e.value)){if(e.multiple)t=`[${e.value.map(e=>encodeURIComponent(Rr(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(Rr(e))).join(`,`)}]`;else{let n=e.value[0];t=typeof n==`string`?encodeURIComponent(n):typeof n==`object`&&n?.value!==void 0?encodeURIComponent(String(n.value)):encodeURIComponent(String(n||``))}}else t=encodeURIComponent(e.value||``);return`${encodeURIComponent(e.name)}:${t}`}).join(`;`);t.set(`filters`,n)}else t.delete(`filters`);let n=`${window.location.pathname}?${t.toString()}${window.location.hash}`;window.history.replaceState(window.history.state||{},``,n)}catch(e){console.error(`Failed to update URL with filters:`,e)}},[e,a,o]),F(()=>{if(!(a||!s||r.length===0))try{let e=s.split(`;`),t=[];for(let n of e){let e=n.indexOf(`:`);if(e===-1)continue;let i=n.slice(0,e),a=n.slice(e+1),o=decodeURIComponent(i);if(c.current.has(o))continue;let s=r.find(e=>e.name===o);if(!s)continue;c.current.add(o);let l;if(a.startsWith(`[`)&&a.endsWith(`]`)){let e=a.slice(1,-1);l=e?e.split(`,`).map(e=>decodeURIComponent(e)):[]}else l=[decodeURIComponent(a)];let u;u=s.type===`stringList`?l:s.type===`text`?l.length===1?[{value:l[0],label:l[0]}]:l.map(e=>({value:e,label:e})):l.map(e=>{let t=s.options?.find(t=>t.value===e),n=e;return t?.label?n=String(t.label):t?.labelRenderer?n=String(t.labelRenderer(e)):s.labelRenderer&&(n=String(s.labelRenderer(e))),{value:e,label:n}}),s.multiple&&!a.startsWith(`[`)&&!a.endsWith(`]`)&&(s.type===`stringList`?u=l:Array.isArray(u)||(u=[u])),t.push({name:o,type:s.type,placeholder:s.placeholder,value:u,multiple:s.multiple})}t.length>0&&n(e=>{let n=new Set(t.map(e=>e.name));return[...e.filter(e=>!n.has(e.name)),...t]}),l.current=!0}catch{}},[r,a,s,n]),t(Nr.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},Fr=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=N.useContext(Nr),{t:o}=R(),[s,c]=N.useState(!1),[l,u]=N.useState(null),[d,f]=N.useState(``),p=N.useRef(null),[m,h]=N.useState(),[g,_]=N.useState(``),v=e=>{u(e),f(``),p.current?.focus()},y=()=>{let e=a.map(e=>({...e,options:(e.options??[]).filter(t=>!r.some(n=>n.type===`date`?n.name===e.name:n.name===e.name&&(Array.isArray(n.value)&&typeof n.value[0]==`string`?n.value.some(e=>e===t.value):n.value.some(e=>Rr(e)===t.value))))})).filter(e=>(e.options??[]).length>0||e.type===`date`&&!r.some(t=>t.name===e.name)||e.type===`text`&&!r.some(t=>t.name===e.name)||e.type===`stringList`&&!r.some(t=>t.name===e.name));return e.length===0?t(Gn,{children:o(`filter.noAvailableFilters`)}):e.map(e=>t(J,{onSelect:()=>v(e.name),className:`group flex gap-2 items-center hover:bg-muted`,children:t(`span`,{children:e.placeholder??e.name})},e.name))},x=()=>{c(!1),setTimeout(()=>{u(null),f(``),h(void 0)},200)};return n(X,{_open:s,onOpenChange:e=>{c(e),e||setTimeout(()=>{u(null),f(``),_(``)},200)},children:[t(Z,{asChild:!0,children:n(K,{variant:`outline`,role:`combobox`,"aria-expanded":s,"aria-label":o(`filter.filter`),size:`md`,className:G(`transition group flex gap-1.5`,e),children:[t(b,{className:`size-4 shrink-0 transition-all text-muted`}),o(`filter.filter`)]})}),t(Q,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(Vn,{children:[a.find(e=>e.name===l)?.type===`select`&&t(Un,{placeholder:l?o(`filter.filterBy`,{view:l}):o(`filter.filterPlaceholder`),className:`h-9 ring-0`,value:d,onValueChange:e=>{f(e)},ref:p,autoFocus:!0}),t(Wn,{children:t(q,{children:l?(()=>{if(!l)return null;switch(a.find(e=>e.name===l)?.type){case`date`:return t(Dr,{selectedView:l,selectedDate:m,setSelectedDate:h,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(Ar,{selectedView:l,textValue:g,setTextValue:_,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(kr,{selectedView:l,setFilters:i,handleClose:x,filterGroups:a});default:return t(Or,{selectedView:l,commandInput:d,setFilters:i,handleClose:x,filterGroups:a})}})():y()})})]})})]})},Ir=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=N.useContext(Nr);return t(`div`,{className:G(e),children:t(Mr,{filters:n,setFilters:r,filterGroups:i})})},Lr=({className:e})=>{let{filters:n,setFilters:r}=N.useContext(Nr),{t:i}=R();return n.filter(e=>e.value?.length>0).length>0?t(K,{variant:`outline`,size:`md`,className:G(`transition group`,e),onClick:()=>r([]),children:i(`filter.clearAll`)}):null};function Rr(e){return typeof e==`string`?e:e.value||``}var zr;(function(e){e.IS=`is`,e.IS_NOT=`is_not`,e.CONTAINS=`contains`,e.BEFORE=`before`,e.AFTER=`after`,e.IS_ANY_OF=`is_any_of`})(zr||={});const Br=oe(({className:e,level:n=3,...r},i)=>{let a=`h${n}`;return t(a,{ref:i,className:G({h1:`text-2xl font-medium tracking-tight`,h2:`text-xl font-medium tracking-tight`,h3:`text-lg font-medium`,h4:`text-base font-medium`,h5:`text-sm font-medium`,h6:`text-xs font-medium`}[`h${n}`],`mb-2`,e),...r})});Br.displayName=`Heading`;function Vr({options:i,optionLabel:s,groupBy:c,value:l,onChange:u,addNew:d,addNewLabel:f,disabled:p,filterBy:h,label:g,placeholder:_,className:v,popupClass:y,isClearable:b,border:x=!0,multiple:C=!1,by:w,inline:T=!1,isLoading:E=!1,warnOnMissingValue:D=!0,missingValueWarning:A=`Value not in options list, may not be valid`,clearIcon:ee,clearTitle:te,"aria-label":M,"aria-labelledby":N,id:ne,"aria-describedby":re,"aria-invalid":ie}){let ae=I(null),[oe,se]=L(!1),[P,ce]=L(0),[ue,fe]=L(``),pe=le(),me=le(),he=de(()=>!D||C||l==null||!i?!1:!i.some(e=>typeof w==`string`?Hr(e,w)===Hr(l,w):typeof w==`function`?w(e,l):Ee(e,l)),[D,C,l,i,w]);F(()=>{let e=ae.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ce(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let R=e=>{if(C){let t=Array.isArray(l)?l:[];z(e,t)?u(t.filter(t=>!ge(t,e))):u([...t,e])}else u(e)},z=(e,t)=>!t||t.length===0?!1:t.some(t=>ge(t,e)),ge=(e,t)=>e==null||t==null?e===t:typeof w==`string`?Hr(e,w)===Hr(t,w):typeof w==`function`?w(e,t):Ee(e,t),B=i||[];function _e(e){return e?typeof e==`string`?t=>String(Hr(t,e)).toLowerCase():e:e=>String(e).toLowerCase()}let ve=ue.toLowerCase(),ye=_e(h);B=B.filter(e=>ye(e).includes(ve));let be=()=>{if(!l||Array.isArray(l)&&l.length===0)return t(`span`,{className:`text-muted`,children:_});let e=Array.isArray(l)?l[0]:l;return s?s(e):e},xe=()=>{let e=Array.isArray(l)?l:l?[l]:[];return e.length===0?t(`span`,{className:`text-muted`,children:_}):e.length===1?s?s(e[0]):e[0]:n(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,1).map((e,n)=>t(`span`,{className:`inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded`,children:s?s(e):e},`chip-${n}`)),e.length>1&&n(`span`,{className:`inline-flex items-center px-2 py-1 text-xs bg-muted rounded`,children:[`+`,e.length-1,` more`]})]})},V=(e,r)=>{let i=C?z(e,Array.isArray(l)?l:[]):l!=null&&ge(l,e);return t(J,{onSelect:()=>R(e),className:`w-full`,children:C||T?n(`div`,{className:`w-full flex justify-between items-center cursor-pointer`,children:[t(`div`,{className:`w-full truncate text-start`,children:s?s(e):e}),i&&t(o,{className:`size-4`})]}):n(vr,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:s?s(e):e}),i&&t(o,{className:`size-4`})]})},`option-${r}`)},H=(()=>{if(!c)return null;let e=[],t=new Map;for(let n of B){let r=c(n),i=t.get(r);i||(i=[],t.set(r,i),e.push({key:r,items:i})),i.push(n)}return e})(),U=()=>n(e,{children:[h&&n(`div`,{className:`flex justify-start items-center mb-1`,children:[t(`div`,{className:`mx-2`,children:t(O,{className:`size-4`})}),t($,{variant:`unstyled`,value:ue,onChange:fe,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(Vn,{className:`overflow-hidden`,children:n(Wn,{className:T?`max-h-full overflow-y-auto`:`max-h-[200px] overflow-y-auto`,onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[t(Gn,{children:`No result found.`}),H?H.map(e=>t(q,{heading:e.key,className:`[&_[cmdk-group-heading]]:text-muted [&_[cmdk-group-heading]]:border-b [&_[cmdk-group-heading]]:border-border [&_[cmdk-group-heading]]:ml-[-0.5rem] [&_[cmdk-group-heading]]:text-xs`,children:e.items.map((t,n)=>V(t,`${e.key}-${n}`))},e.key)):t(q,{children:B?.map((e,t)=>V(e,t))})]})}),d&&t(`div`,{className:`p-1`,children:n(`button`,{type:`button`,onClick:d,className:r(`w-full text-start gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-accent bg-transparent border-0`),children:[t(k,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),f]})})]});if(T)return t(`div`,{className:r(v,x&&`border border-border rounded-md`,`bg-popover p-1`,y),children:E?t(`div`,{className:`flex justify-center items-center p-2 text-muted text-sm`,children:t(S,{className:`size-4 animate-spin`})}):U()});let Se=!!g,Ce=M??(Se?void 0:typeof _==`string`?_:void 0),we=N??(Se?me:void 0),Te=!!b&&!!l&&(!Array.isArray(l)||l.length>0),W=ie===!0||ie===`true`||he?!0:ie===!1||ie===`false`?!1:void 0;return n(X,{onOpenChange:se,children:[n(`div`,{ref:ae,className:r(`relative`,v),children:[t(Z,{asChild:!0,children:t(`button`,{type:`button`,id:ne,disabled:p||E,"aria-haspopup":`dialog`,"aria-expanded":oe,"aria-controls":pe,"aria-label":Ce,"aria-labelledby":we,"aria-describedby":re,"aria-invalid":W,className:r(E?`flex w-full justify-center items-center gap-2 border border-border rounded-md p-2 text-muted text-sm bg-transparent`:r(x&&(he||W?`border border-destructive`:`border border-border`),`flex w-full flex-row gap-2 items-center justify-between p-2 rounded-md group bg-transparent text-inherit text-start`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,p?`cursor-not-allowed text-muted`:`cursor-pointer hover:bg-muted`,Te&&`pe-10`)),children:E?t(S,{className:`size-4 animate-spin`}):n(e,{children:[n(`div`,{className:r(`flex flex-col w-full rounded-md text-sm min-h-6 items-center justify-center truncate`),children:[g&&t(`div`,{id:me,className:`w-full text-start text-xs font-semibold`,children:g}),n(`div`,{className:r(`w-full text-start `,he&&`text-destructive`),children:[he&&t(St,{description:A,placement:`top`,asChild:!0,children:t(a,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),C?xe():be()]})]}),!p&&t(m,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),Te&&!E&&t(K,{variant:`link`,size:`icon`,disabled:p,title:te||`Clear selection`,onClick:e=>{e.stopPropagation(),u(C?[]:void 0)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},className:`absolute end-2 top-1/2 -translate-y-1/2 hover:bg-muted/20 rounded p-1`,children:ee||t(j,{className:`size-4`})})]}),t(Q,{id:pe,style:{width:`${P}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,y),children:U()})]})}function Hr(e,t){return typeof e==`object`&&e?e[t]:void 0}const Ur={ar:`العربية`,de:`Deutsch`,en:`English`,es:`Español`,fr:`Français`,it:`Italiano`,ja:`日本語`,ko:`한국어`,pt:`Português`,ru:`Русский`,tr:`Türkçe`,zh:`中文`,"zh-TW":`繁體中文`};function Wr({label:e,className:r}={}){let{language:i,setLanguage:a}=he(),{t:o}=R(),s=e===!1?!1:e??o(`language.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center gap-3`:`flex items-center`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),t(Vr,{options:me,value:i,onChange:e=>a(e),optionLabel:e=>Ur[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}const Gr=z(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),Kr=M.forwardRef(({className:e,required:r,...i},a)=>n(De.Root,{ref:a,className:G(Gr(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive-foreground ms-1`,children:`*`})]}));Kr.displayName=De.Root.displayName;function qr({icon:e,status:r,title:i,children:o,className:s}){let c,l,u,d;switch(r){case`error`:c=t(g,{className:`size-5 text-destructive`,"aria-hidden":`true`}),l=`text-destructive`,u=`text-foreground`,d=`bg-destructive border border-destructive`;break;case`warning`:c=t(a,{className:`size-5 text-attention`,"aria-hidden":`true`}),l=``,u=`text-foreground`,d=`bg-attention border border-attention`;break;case`success`:c=t(h,{className:`size-5 text-success`,"aria-hidden":`true`}),l=``,u=`text-foreground`,d=`bg-success border border-success`;break;case`info`:c=t(y,{className:`size-5 text-info`,"aria-hidden":`true`}),l=``,u=`text-foreground`,d=`bg-info border border-info`;break;case`default`:c=t(y,{className:`size-5 text-muted`,"aria-hidden":`true`}),l=``,u=`text-foreground`,d=`bg-muted border border-muted`;break;case`done`:c=t(y,{className:`size-5 text-done`,"aria-hidden":`true`}),l=``,u=`text-foreground`,d=`bg-done border border-done`}return t(`div`,{className:`rounded-md p-4 ${d} ${s}`,children:n(`div`,{className:`flex`,children:[t(`div`,{className:`shrink-0`,children:e??c}),n(`div`,{className:`w-full ms-2 px-1`,children:[i&&t(`h3`,{className:`text-md font-medium mb-2 ${l}`,children:i}),t(`div`,{className:`text-sm ${u} break-words`,children:o})]})]})})}function Jr({title:e,className:r,children:i,action:a,actionLabel:o}){return n(qr,{status:`error`,title:e,className:`${r} flex flex-col items-center justify-center text-center`,children:[t(`pre`,{className:`whitespace-pre-wrap break-words`,children:i}),a&&o&&t(K,{onClick:a,variant:`ghost`,size:`sm`,className:`mt-4`,children:o})]})}function Yr({title:e,className:n,children:r}){return t(qr,{status:`info`,title:e,className:n,children:r})}function Xr({title:e,className:n,children:r}){return t(qr,{status:`warning`,title:e,className:n,children:r})}function Zr({title:e,className:n,children:r}){return t(qr,{status:`success`,title:e,className:n,children:r})}function Qr({title:e,className:n,children:r}){return t(qr,{status:`default`,title:e,className:n,children:r})}function $r({title:e,content:r,onConfirm:i,onCancel:a,isOpen:o,isLoading:s,confirmationValue:c,confirmationLabel:l,confirmationPlaceholder:u}){let{t:d}=R(),f=I(null),[p,m]=L(``);F(()=>{o||m(``)},[o]);let h=!!c,g=!c||p.trim()===c.trim(),_=()=>{!g||s||i()};return n(kn,{isOpen:o,onClose:a,description:`Confirm Modal`,children:[n(`div`,{className:`sm:flex sm:items-start p-2`,children:[t(`div`,{className:`mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10`,children:t(ee,{className:`size-6 text-red-600`,"aria-hidden":`true`})}),n(`div`,{className:`mt-3 text-center sm:ms-4 sm:mt-0 sm:text-start`,children:[t(An,{className:`leading-6`,show:!0,children:e}),t(`div`,{className:`mt-2`,children:t(`div`,{className:`prose text-sm text-gray-500`,children:r})})]})]}),h&&t(`div`,{className:`px-2 pb-2 text-start`,children:t(Bt,{label:l??u,children:t($,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),_())}})})}),n(Mn,{align:`right`,children:[t(K,{variant:`destructive`,onClick:_,isLoading:s,disabled:!g,children:d(`modal.confirm`)}),t(K,{variant:`outline`,onClick:a,ref:f,children:d(`modal.cancel`)})]})]})}function ei(){return ce(ti)}const ti=ae(()=>{}),ni={success:h,error:g,warning:a,info:y},ri={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function ii({data:e,onClose:r}){let[i,a]=L(!0),o=I(null),s=P(()=>{o.current&&=(globalThis.clearTimeout(o.current),null)},[]),c=P(()=>{s(),e.duration&&(o.current=setTimeout(()=>a(!1),e.duration))},[s,e.duration]);F(()=>(c(),s),[s,c]);let l=ni[e.status]||y,u=ri[e.status]||`text-info`;return t(`div`,{"aria-live":`assertive`,className:`pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-100`,children:t(`div`,{className:`flex w-full flex-col items-center space-y-4 sm:items-end`,children:t(ve,{onExitComplete:r,children:i&&t(ye.div,{className:`pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-muted shadow-lg ring-1 ring-border`,initial:{opacity:0,x:8},animate:{opacity:1,x:0,transition:{ease:`easeOut`,duration:.7}},exit:{opacity:0,transition:{ease:`easeIn`,duration:.3}},onMouseEnter:s,onMouseLeave:c,children:t(`div`,{className:`p-5`,children:n(`div`,{className:`flex items-start`,children:[t(`div`,{className:`shrink-0`,children:t(l,{className:`size-6 ${u}`,"aria-hidden":`true`})}),n(`div`,{className:`ms-3 flex-1 pt-0.5 min-w-0`,children:[t(`p`,{className:`text-sm font-semibold text-foreground break-words`,children:e.title}),e.description&&t(`p`,{className:`mt-2 text-sm text-muted break-words whitespace-pre-wrap leading-relaxed`,children:e.description})]}),t(`div`,{className:`ms-4 flex shrink-0`,children:n(`button`,{type:`button`,className:`inline-flex rounded-md bg-muted text-muted hover:text-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background`,onClick:()=>a(!1),children:[t(`span`,{className:`sr-only`,children:`Close`}),t(j,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function ai({children:r}){let[i,a]=L(null),o=P(e=>{a(e)},[]);return n(e,{children:[t(ti.Provider,{value:o,children:r}),i&&t(an,{children:t(ii,{data:i,onClose:()=>o(null)})})]})}function oi({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=R(),s=ei();return t($r,{title:n,content:r,isOpen:!!e,onConfirm:async()=>{if(e)return a(e).then(()=>{s({title:o(`modal.delete.succeeded`),status:`success`})}).catch(e=>{s({title:o(`modal.delete.failed`),description:e instanceof Error?e.message:o(`modal.delete.error`),status:`error`})}).finally(()=>{i(void 0)})},onCancel:()=>{i(void 0)}})}const si=4,ci={tabs:{base:`flex items-center border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`border-transparent text-muted-foreground hover:border-border hover:text-foreground`,active:`border-primary text-primary`,icon:`ms-1 size-4`},pills:{base:`flex items-center rounded-md px-2 py-1 text-xs font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`text-muted-foreground hover:bg-muted/60`,active:`bg-muted text-foreground`,icon:`ms-0.5 size-3.5`}};function li(e,t,n=4){let r=I(null),i=I([]),a=I(null),[o,s]=L({count:e.length,promote:!1}),c=()=>{let o=r.current;if(!o)return;let c=o.clientWidth,l=e.map((e,t)=>i.current[t]?.offsetWidth??0),u=l.reduce((e,t)=>e+t,0)+n*Math.max(0,e.length-1),d=(t,r)=>{let i=0,a=0;for(let o=0;o<e.length;o++){if(o===r)continue;let e=i+(a>0?n:0)+l[o];if(e>t)break;i=e,a+=1}return a},f;if(u<=c)f={count:e.length,promote:!1};else{let r=a.current?.offsetWidth??0,i=Math.max(1,d(c-r-n,-1)),o=e.findIndex(t);f=o<0||o<i?{count:i,promote:!1}:{count:d(c-r-l[o]-n*2,o),promote:!0}}s(e=>e.count===f.count&&e.promote===f.promote?e:f)},l=I(c);l.current=c,ue(()=>{l.current()}),F(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>l.current());return t.observe(e),()=>t.disconnect()},[]);let u=e.findIndex(t),d,f;if(o.promote&&u>=0){let t=e.filter((e,t)=>t!==u);d=[...t.slice(0,o.count),e[u]],f=t.slice(o.count)}else d=e.slice(0,o.count),f=e.slice(o.count);return{containerRef:r,setItemRef:e=>t=>{i.current[e]=t},setMoreRef:e=>{a.current=e},visible:d,overflow:f,activeInOverflow:f.some(t)}}function ui({label:e,triggerClassName:r,icon:i,children:a}){let[o,s]=L(!1),c=I(null),u=I(!1),d=()=>{c.current&&=(clearTimeout(c.current),null)},f=()=>{d(),u.current=!0,s(!0)},p=()=>{d(),c.current=setTimeout(()=>s(!1),150)};return F(()=>()=>clearTimeout(c.current??void 0),[]),n(Yn,{modal:!1,open:o,onOpenChange:e=>{d(),e&&(u.current=!1),s(e)},children:[t(Zn,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:f,onMouseLeave:p,className:r,children:[e,i??t(l,{className:`ms-1 size-4`})]})}),t(Qn,{align:`end`,className:`w-max`,onMouseEnter:d,onMouseLeave:p,onCloseAutoFocus:e=>{u.current&&e.preventDefault()},children:a})]})}function di({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=R(),c=ci[a],{containerRef:u,setItemRef:d,setMoreRef:f,visible:p,overflow:m,activeInOverflow:h}=li(e,e=>e.name===r),g=s(`agent.moreTabs`);return n(`div`,{ref:u,className:G(`relative`,o),children:[n(`div`,{"aria-hidden":!0,className:`pointer-events-none invisible absolute start-0 top-0 flex w-max gap-1`,children:[e.map((e,n)=>t(`button`,{type:`button`,tabIndex:-1,ref:d(n),className:G(c.base,c.inactive),children:e.label},e.name)),n(`button`,{type:`button`,tabIndex:-1,ref:f,className:G(c.base,c.inactive),children:[g,t(l,{className:c.icon})]})]}),n(`div`,{className:G(`flex gap-1 overflow-hidden`,a===`tabs`&&`-mb-px border-b`),children:[p.map(e=>{let n=e.name===r;return t(`button`,{type:`button`,"aria-current":n?`page`:void 0,disabled:e.disabled,onClick:()=>i(e.name),className:G(c.base,n?c.active:c.inactive,`disabled:pointer-events-none disabled:opacity-50`),children:e.label},e.name)}),m.length>0&&t(ui,{label:g,triggerClassName:G(c.base,h?c.active:c.inactive),icon:t(l,{className:c.icon}),children:m.map(e=>t(er,{disabled:e.disabled,onClick:()=>i(e.name),className:G(e.name===r&&`text-primary`),children:e.label},e.name))})]})]})}function fi({children:r,action:i,title:a,description:o,footer:s,className:l,collapsible:u,defaultCollapsed:d=!1,size:p=`md`,clickableHeader:m=!1}){let[h,g]=L(d),_=u&&m,v=p===`sm`,b=v||_,x=t(h?c:f,{className:`size-4 text-muted`}),S=n(e,{children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`div`,{className:`font-semibold ${v?`text-sm`:`text-lg`}`,children:a}),o&&t(St,{description:o,children:t(y,{className:`size-4 text-muted`})})]}),n(`div`,{className:`flex gap-2 items-center`,children:[i,u&&(_?x:t(K,{variant:`ghost`,size:`icon`,onClick:()=>g(!h),children:x}))]})]}),C=v?`px-4 py-2`:`px-4 py-3`,w=v?`px-4 pt-3 pb-3`:`p-4`,T=v?`px-4 pb-3`:`px-4 pb-4`;return n(`div`,{className:`flex flex-col ${b?``:`p-4 gap-2`} rounded-sm border bg-card ${_?`overflow-hidden`:``} ${l??``}`,children:[_?t(`button`,{type:`button`,className:`w-full flex items-center justify-between ${C} hover:bg-muted/50 transition-colors`,onClick:()=>g(!h),children:S}):t(`div`,{className:`flex items-center justify-between ${b?C:``}`,children:S}),!h&&(b?t(`div`,{className:w,children:r}):r),s&&t(`div`,{className:`border-t border-muted flex flex-col-2 text-sm pt-4 ${b?T:``}`,children:s})]})}function pi({className:e,...n}){return t(Oe.Item,{"data-slot":`radio-group-item`,className:G(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:t(Oe.Indicator,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:t(`span`,{className:`bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full`})})})}var mi=class{descriptionOf(e){}selectedClassName(e){return`border-accent-foreground`}};function hi({onSelect:e,selected:r,options:i,adapter:a}){let o=e=>a?a.idOf(e):e.id,s=e=>a?a.labelOf(e):e.label,c=e=>a?a.descriptionOf(e):e.description,l=e=>a?a.selectedClassName(e):`border-primary`;return t(Oe.Root,{"data-slot":`radio-group`,value:r?o(r):void 0,onValueChange:t=>{let n=i.find(e=>o(e)===t);n&&e(n)},className:`space-y-4`,children:i.map(e=>{let i=r?o(r)===o(e):!1;return t(Oe.Item,{value:o(e),className:G(`relative block w-full cursor-pointer rounded-lg border border-border bg-accent px-6 py-4 shadow-2xs text-start`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`sm:flex sm:justify-between`,i&&l(e)),children:t(`span`,{className:`flex items-center`,children:n(`span`,{className:`flex flex-col text-sm`,children:[t(`span`,{className:`font-medium text-text`,children:s(e)}),c(e)&&t(`span`,{className:`text-muted-foreground`,children:c(e)})]})})},o(e))})})}function gi({className:e,direction:n=`horizontal`,orientation:r,...i}){let a=r??n;return t(ke.Group,{"data-slot":`resizable-panel-group`,"data-panel-group-direction":a,orientation:a,className:G(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function _i(e){return typeof e==`number`?`${e}%`:e}function vi({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(ke.Panel,{"data-slot":`resizable-panel`,defaultSize:_i(e),minSize:_i(n),maxSize:_i(r),collapsedSize:_i(i),...a})}function yi({withHandle:e,className:n,...r}){return t(ke.Separator,{"data-slot":`resizable-handle`,className:G(`bg-muted focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:start-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),...r,children:e&&t(`div`,{className:`z-10 flex size-4 items-center justify-center rounded-xs font-semibold`,children:t(C,{className:`size-4 rotate-90`})})})}const bi=M.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(Ae.Root,{ref:a,decorative:r,orientation:n,className:G(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));bi.displayName=Ae.Root.displayName;const xi=M.forwardRef(({className:e,trackClassName:r,rangeClassName:i,thumbClassName:a,value:o,defaultValue:s,min:c=0,max:l=100,"aria-label":u,...d},f)=>{let p=M.useId(),m=Array.isArray(o)?o.length:Array.isArray(s)?s.length:1,h=M.useMemo(()=>Array.from({length:Math.max(1,m)},(e,t)=>`${p}-thumb-${t}`),[p,m]);return n(je.Root,{ref:f,"data-slot":`slider`,value:o,defaultValue:s,min:c,max:l,...d,className:G(`relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,e),children:[t(je.Track,{"data-slot":`slider-track`,className:G(`relative h-1.5 w-full grow overflow-hidden rounded-full bg-muted data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`,r),children:t(je.Range,{"data-slot":`slider-range`,className:G(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),h.map(e=>t(je.Thumb,{"data-slot":`slider-thumb`,"aria-label":u,className:G(`block size-3.5 rounded-full border border-primary bg-background shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,a)},e))]})});xi.displayName=je.Root.displayName;const Si={sm:[`h-5 w-8`,`size-3`,`translate-x-4 rtl:-translate-x-4`],md:[`h-6 w-11`,`size-4`,`translate-x-6 rtl:-translate-x-6`],lg:[`h-8 w-16`,`size-6`,`translate-x-9 rtl:-translate-x-9`]};function Ci({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=Si[r],f=t(Me.Root,{"data-slot":`switch`,checked:i,onCheckedChange:a,disabled:s,...c,className:G(`data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-full border focus-visible:ring-3 aria-invalid:ring-3 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,l,!o&&e),children:t(Me.Thumb,{"data-slot":`switch-thumb`,className:G(`bg-white rounded-full pointer-events-none block ring-0 transition-transform`,u,i?d:`translate-x-1 rtl:-translate-x-1`)})});return o?n(`div`,{className:G(`flex items-center`,e),children:[f,t(`span`,{className:`px-2`,children:o})]}):f}const wi=M.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),Ti=({tabs:e,defaultValue:n,current:r,className:i,fullWidth:a,fullHeight:o,children:s,onTabChange:c,responsive:l=!1,variant:u=`tabs`,updateHash:d=!0,canChangeTab:f})=>{let p=M.useMemo(()=>e.filter(e=>e.is_allowed===void 0||e.is_allowed===!0),[e]),[m,h]=M.useState(()=>{let e=typeof r==`function`?r():r;if(e)return e;let t=window.location.hash,i=t?t.substring(1):void 0;return i&&p.some(e=>e.name===i)?i:n||p[0]?.name});M.useEffect(()=>{let e=typeof r==`function`?r():r;e&&e!==m&&h(e)},[r,m]),M.useEffect(()=>{if(r)return;let e=()=>{let e=window.location.hash,t=e?e.substring(1):void 0;t&&p.some(e=>e.name===t)?h(t):!e&&n&&h(n)};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[r,p,n]);let g=M.useCallback(e=>{if(!(e!==m&&f&&!f(e,m))){if(h(e),d&&!r){let t=window.history.state,n=`${window.location.pathname+window.location.search}#${e}`;window.history.pushState(t,``,n)}c&&c(e)}},[r,c,d,f,m]),_=M.useCallback(e=>{g(e)},[g]);return t(wi.Provider,{value:{tabs:p,size:a?p.length:0,current:m,setTab:_,responsive:l,variant:u,updateHash:d,canChangeTab:f},children:t(Ne.Root,{defaultValue:m||p[0]?.name,value:m,onValueChange:g,className:G(`flex-1 flex flex-col min-h-0 px-2`,o&&`h-full`,i),children:s})})},Ei=({className:r,sticky:i,direction:a})=>{let{tabs:o,size:s,current:c,setTab:l,responsive:u,variant:d,updateHash:f,canChangeTab:p}=M.useContext(wi),m=s!==0,h=M.useCallback(e=>{if(!o||!l||e!==c&&p&&!p(e,c))return;let t=o.find(t=>t.name===e);if(t?.href&&f){let e=window.history.state;window.history.pushState(e,``,t.href)}l(e)},[o,l,f,p,c]);return!o||!l?(console.warn(`TabsBar: No tabs provided or setTab not available`),null):n(e,{children:[u&&t(`div`,{className:`px-2 block lg:hidden`,children:t(Vr,{label:`Tab`,className:G(i&&`sticky top-0 bg-background z-10`,r),options:o,optionLabel:e=>typeof e.label==`string`?e.label:String(e.label),value:o.find(e=>e.name===c),onChange:e=>{h(e.name)}})}),t(Oi,{size:s,variant:d,className:G(m?`w-full`:``,i&&`sticky top-0 bg-background z-10`,a===`vertical`?`flex-col items-start`:`flex-row`,u?`hidden lg:flex`:``,r),children:o.map(e=>t(ki,{className:G(a===`vertical`?`w-full text-start`:``),value:e.name,disabled:e.disabled,href:e.href,variant:d,onClick:()=>h(e.name),children:e.label},e.name))})]})},Di=({className:n})=>{let{tabs:r}=M.useContext(wi);return r?t(e,{children:r.map(e=>t(Ai,{value:e.name,className:n,children:e.content},e.name))}):null},Oi=M.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(wi.Provider,{value:{size:n,variant:r},children:t(Ne.List,{ref:a,className:G(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));Oi.displayName=Ne.List.displayName;const ki=M.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},a)=>{let{size:o}=M.useContext(wi),s=M.useCallback(e=>{if(n){e.preventDefault();let t=window.history.state;window.history.pushState(t,``,n)}i.onClick&&i.onClick(e)},[n,i.onClick]);return t(Ne.Trigger,{ref:a,className:G(r===`tabs`?G(`border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer`,`border-transparent text-muted-foreground hover:border-border hover:text-foreground`,`data-[state=active]:border-primary data-[state=active]:text-primary`,`disabled:pointer-events-none disabled:opacity-50`):G(`px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors`,`tborder border-input bg-muted shadow-xs hover:bg-muted ring-inset`,`data-[state=active]:bg-primary data-[state=active]:text-white data-[state=active]:shadow-sm`,`disabled:pointer-events-none disabled:opacity-50`),e,o?`w-1/${o}`:``),onClick:s,...i})});ki.displayName=Ne.Trigger.displayName;const Ai=M.forwardRef(({className:e,...n},r)=>t(Ne.Content,{ref:r,className:G(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));Ai.displayName=Ne.Content.displayName;const ji=z(`text-foreground`,{variants:{size:{xl:`text-base md:text-lg leading-relaxed`,lg:`text-base leading-relaxed`,default:`text-sm leading-normal`,sm:`text-sm leading-normal`,xs:`text-xs leading-normal`},weight:{normal:`font-normal`,medium:`font-medium`,semibold:`font-semibold`}},defaultVariants:{size:`default`,weight:`normal`}}),Mi=oe(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:G(ji({size:n,weight:r,className:e})),...i}));Mi.displayName=`Text`;function Ni({className:e,minLines:n,maxLines:r,value:i,...a}){let o=I(null),s=n!==void 0||r!==void 0,c=P(()=>{let e=o.current;if(!e)return;let t=getComputedStyle(e),i=parseFloat(t.lineHeight)||parseFloat(t.fontSize)*1.5,a=(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0),s=(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0),c=n??1,l=r??1/0,u=c*i+a+s,d=l===1/0?1/0:l*i+a+s;e.style.height=`auto`;let f=Math.min(Math.max(e.scrollHeight,u),d);e.style.height=`${f}px`,e.style.overflowY=d!==1/0&&e.scrollHeight>d?`auto`:`hidden`},[n,r]);return ue(()=>{s&&c()}),t(`textarea`,{ref:o,"data-slot":`textarea`,value:i,className:G(`py-2 text-sm`,`flex w-full rounded-md border border-input bg-background ring-offset-background`,`placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,s&&`resize-none`,e),...a})}const Pi=ae({theme:`system`,setTheme:()=>null});function Fi({children:e,defaultTheme:n=`system`,storageKey:r=`vite-ui-theme`,...i}){let[a,o]=L(()=>localStorage.getItem(r)||n);F(()=>{let e=window.document.documentElement;if(e.classList.remove(`light`,`dark`),a===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(a)},[a]);let s=P((e,t)=>{t?.persist!==!1&&localStorage.setItem(r,e),o(e)},[r]),c=de(()=>({theme:a,setTheme:s}),[s,a]);return t(Pi.Provider,{...i,value:c,children:e})}const Ii=()=>{let e=ce(Pi);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function Li({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(K,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function Ri({label:e,className:r}={}){let{setTheme:i,theme:a}=Ii(),{t:o}=R(),s=e===!1?!1:e??o(`theme.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center`:`flex items-center gap-1`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),n(`div`,{className:`flex gap-2`,children:[t(Li,{current:a,option:`system`,setTheme:i,icon:t(_,{}),alt:o(`theme.system`)}),t(Li,{current:a,option:`light`,setTheme:i,icon:t(A,{}),alt:o(`theme.light`)}),t(Li,{current:a,option:`dark`,setTheme:i,icon:t(w,{}),alt:o(`theme.dark`)})]})]})}function zi(e,n){return{label:String(e),check:t(n?o:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-accent nowrap`}}function Bi({value:e,options:i,onChange:a,className:o,optionLayout:s,by:c,noCheck:l,filterBy:u}){let{t:d}=R(),[f,p]=L(e),[m,h]=L(``),g=e=>{p(e),a(e)},_=de(()=>typeof c==`string`?(e,t)=>e[c]===t[c]:c||((e,t)=>e===t),[c]);return n(`div`,{className:r(``,o),children:[u&&t($,{type:`text`,placeholder:d(`form.filter`),value:m,onChange:e=>h(e)}),i.map((e,n)=>{if(u&&!u(m)(e))return null;let r=f?_(f,e):!1,i;return s?(i=s(e,r),i=Object.assign(zi(e,r),i)):i=zi(e,r),t(Vi,{option:e,onSelect:g,layout:i,noCheck:l},`option-${n}`)})]})}function Vi({option:e,onSelect:i,layout:a,noCheck:o}){return n(K,{variant:`unstyled`,size:`none`,className:r(`group !flex w-full items-center cursor-pointer gap-x-2 hover:bg-muted`,a.reverse&&`flex-row-reverse`,a.className),onClick:()=>i(e),children:[o?null:t(`div`,{className:``,children:a.check}),t(`div`,{className:`flex-1`,children:a.label})]})}function Hi({isOpen:e,title:r,onClose:i,children:a,panelWidth:o=768,backdrop:s=!1,side:c=`right`,resizable:l=!0,className:u,contentClassName:d}){let[f,p]=L(o),m=e=>{e.preventDefault();let t=!0,n=e.pageX,r=f,i=e=>{if(t){let t=n-e.pageX,i=Math.max(r+t,480);p(i)}},a=()=>{t=!1,document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a)};document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)},h=c===`left`,g=h?`left-0`:`right-0`,_=h?`pr-10 sm:pr-16`:`pl-10 sm:pl-16`,v=h?`border-r`:`border-l`,y=h?`-right-1`:`-left-1`,b=h?`-100%`:`100%`;return t(ve,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(ye.div,{className:`fixed inset-0 bg-black/70`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:i}),t(`div`,{className:`fixed inset-y-0 ${g} overflow-hidden`,children:t(`div`,{className:`absolute inset-0 overflow-hidden`,children:t(`div`,{className:`pointer-events-none fixed inset-y-0 ${g} flex max-w-full ${_}`,children:t(ye.div,{className:`pointer-events-auto ${v}`,style:{width:`${f}px`},initial:{x:b},animate:{x:0},exit:{x:b},transition:{type:`spring`,stiffness:300,damping:30},children:n(`div`,{className:`relative flex h-full`,children:[l&&t(`div`,{"aria-label":`Resize panel`,className:`absolute ${y} top-0 bottom-0 w-3 z-25 cursor-ew-resize hover:bg-indigo-500 transition-colors flex items-center justify-center`,onMouseDown:m,children:t(C,{className:`rotate-90 font-semibold`,strokeWidth:4})}),n(`div`,{className:`flex-1 min-w-0 flex flex-col bg-background shadow-xl ${u}`,children:[r&&t(`div`,{className:`sticky top-0 z-10 bg-background px-2 sm:px-4 py-2 border-b`,children:n(`div`,{className:`flex items-start justify-between`,children:[t(`h2`,{className:`w-full text-base font-semibold leading-6`,children:t(`div`,{className:`text-2xl`,children:r??``})}),t(`div`,{className:`ms-3 flex h-7 items-center`,children:t(Ui,{onClose:i})})]})}),t(`div`,{className:d??`flex-1 overflow-auto px-2 sm:px-4 py-4`,children:t(`div`,{className:`w-full h-full flex-1 flex flex-col`,children:a})})]})]})})})})})]})})}function Ui({onClose:e}){return t(K,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(j,{className:`size-6`,"aria-hidden":`true`})})}function Wi(e){switch(e){case`xs`:return`size-2`;case`sm`:return`size-3`;case`md`:return`size-4`;case`lg`:return`size-5`;case`xl`:return`size-7`;case`2xl`:return`size-10`;default:throw Error(`Unexpected size: ${e}`)}}function Gi({size:e,className:i}){let a=Wi(e||`md`);return n(`svg`,{className:r(`animate-[spin_0.8s_linear_infinite] text-indigo-500`,a,i),xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,role:`img`,"aria-label":`Loading`,children:[t(`title`,{children:`Loading`}),t(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),t(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}function Ki({options:i,value:a,onChange:o,onOptionsChange:s,placeholder:c,className:l,disabled:u,layout:d=`horizontal`,creatable:f=!1,createText:p=`Create "%value%"`,maxDropdownHeight:m=200}){let h=ce(hr),[g,_]=L(``),[v,y]=L(0),[b,x]=L(0),[S,C]=L(null),w=I(null),T=I(null),E=I(null),D=I(null),O=h?.open??!1,k=h?.setOpen??(()=>{});F(()=>{let e=T.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;x(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let A=i.filter(e=>!a.includes(e)&&e.toLowerCase().includes(g.toLowerCase())),ee=f&&g&&!a.includes(g)&&!i.includes(g),te=A.length+ +!!ee;F(()=>{g!==``&&C(null)},[g]),F(()=>{O&&v>=0&&D.current&&E.current&&D.current.scrollIntoView({block:`nearest`,behavior:`smooth`})},[v,O]),F(()=>{O?w.current?.focus():_(``)},[O]),F(()=>{if(!O)return;let e=e=>e instanceof Node&&(T.current?.contains(e)===!0||E.current?.contains(e)===!0),t=t=>{e(t.target)||k(!1)},n=t=>{e(t.target)||k(!1)},r=()=>{k(!1)};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`focusin`,n,!0),window.addEventListener(`blur`,r),document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`focusin`,n,!0),window.removeEventListener(`blur`,r),document.removeEventListener(`visibilitychange`,r)}},[O,k]);let M=e=>{o([...a,e]),_(``),k(!1),y(0),C(null)},N=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),_(``),k(!1),y(0),C(null)},ne=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),C(null)};return n(`div`,{className:r(`relative`,l),children:[t(Z,{asChild:!0,children:n(`div`,{ref:T,className:r(`min-h-[40px] w-full rounded-md border border-input bg-background px-3 py-2`,`flex items-center gap-1`,d===`horizontal`?`flex-wrap`:`flex-col items-stretch`,`cursor-text`,`ring-offset-background`,u&&`opacity-50 cursor-not-allowed`,O?`ring-1 ring-inset ring-ring`:``),onClick:()=>{u||w.current?.focus()},children:[d===`vertical`&&a.length>0&&t(`div`,{className:`flex flex-col gap-1 w-full`,children:a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center justify-between gap-2 px-2 py-1 text-sm bg-primary/20 text-foreground ring-1 ring-primary/30 rounded-md w-full transition-all`,S===i&&`ring-2 ring-red-300 shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[t(`span`,{className:`truncate`,children:e}),t(`button`,{type:`button`,onClick:t=>ne(e,t),disabled:u,className:`hover:bg-primary/30 rounded-sm transition-colors flex-shrink-0`,children:t(j,{className:`h-3 w-3`})})]},e))}),d===`horizontal`&&a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center gap-1 px-2 py-1 text-sm bg-primary/20 text-foreground ring-1 ring-primary/30 rounded-md transition-all`,S===i&&`ring-2 ring-red-300 shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[e,t(`button`,{type:`button`,onClick:t=>ne(e,t),disabled:u,className:`hover:bg-primary/30 rounded-sm transition-colors`,children:t(j,{className:`h-3 w-3`})})]},e)),t(`input`,{ref:w,type:`text`,value:g,onChange:e=>{_(e.target.value),y(0)},onKeyDown:e=>{if(e.key===`Enter`&&O&&te>0){e.preventDefault(),e.stopPropagation(),v===A.length&&ee?N(g):v<A.length&&M(A[v]);return}if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),O?y(e=>e<te-1?e+1:e):k(!0);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),O?y(e=>e>0?e-1:0):k(!0);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),k(!1);return}if(e.key===`Backspace`&&g===``&&a.length>0){e.stopPropagation();let t=a.length-1;S===t?(o(a.slice(0,-1)),C(null)):C(t);return}!O&&e.key.length===1&&k(!0)},onClick:e=>{e.stopPropagation(),u||k(!0)},onFocus:()=>{u||k(!0)},disabled:u,placeholder:a.length===0?c:``,className:r(`flex-1 min-w-[120px] bg-transparent text-sm`,`placeholder:text-muted-foreground`,`border-none outline-none focus:outline-none focus:ring-0 p-0 m-0`,d===`vertical`&&`w-full`)})]})}),t(Q,{style:{width:`${b}px`},className:`p-0 bg-popover border border-border shadow-lg`,align:`start`,side:`bottom`,onOpenAutoFocus:e=>{e.preventDefault()},children:t(`div`,{ref:E,className:`overflow-y-auto`,style:{maxHeight:`${m}px`},children:A.length===0&&!ee?t(`div`,{className:`px-3 py-2 text-sm text-muted-foreground`,children:g?`No options found`:`No more options available`}):n(e,{children:[A.length>0&&t(`ul`,{className:`py-1`,children:A.map((e,n)=>t(`li`,{ref:e=>{n===v&&(D.current=e)},role:`option`,"aria-selected":n===v,tabIndex:0,onClick:()=>M(e),onKeyDown:Vt(()=>M(e)),onMouseEnter:()=>y(n),className:r(`px-3 py-2 text-sm cursor-pointer transition-colors`,n===v?`bg-blue-500/20 text-foreground`:`hover:bg-accent/50`),children:e},e))}),ee&&n(e,{children:[A.length>0&&t(`div`,{className:`border-t border-border`}),t(K,{ref:e=>{v===A.length&&(D.current=e)},variant:`unstyled`,size:`none`,onClick:()=>N(g),onMouseEnter:()=>y(A.length),className:r(`!flex w-full justify-start px-3 py-2 text-sm cursor-pointer transition-colors text-primary`,v===A.length?`bg-blue-500/20`:`hover:bg-accent/50`),children:p.replace(`%value%`,g)})]})]})})})]})}function qi(e){return t(X,{click:!0,children:t(Ki,{...e})})}function Ji({className:e,children:n,...i}){return t(`table`,{className:r(`
284
+ flex items-center justify-center size-6 rounded end-2`,"aria-label":`Clear input`,children:t(Ze,{size:16})})]})});MT.displayName=`Input`;const NT=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(yT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r||`Enter text...`})}),t(CT,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t(MT,{autoFocus:!0,type:`text`,size:`sm`,value:s,onChange:c,onKeyDown:e=>{e.key===`Enter`&&(i(s),o(!1))},placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})})]})})]})};function PT({selectedView:r,selectedDate:i,setSelectedDate:a,setFilters:o,filters:s,handleClose:c,filterGroups:l}){let{t:u}=k(),[d,f]=w([null,null]),[p,m]=w([null,null]),h=l.find(e=>e.name===r),g=h?.multiple,_=new Date;_.setHours(23,59,59,999);let v=[p[0]||d[0],p[1]||d[1]],y=e=>{if(g)Array.isArray(e)?(m([e[0],e[1]]),f([e[0],e[1]])):(m([e,null]),f([e,null]));else{let t=Array.isArray(e)?e[0]:e;if(a(t||void 0),t){let e=new Date(t);e.setHours(0,0,0,0),o([...s,{name:r||``,placeholder:h?.placeholder,value:[{value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}],type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}}};return t(`div`,{className:`p-2`,children:g?n(e,{children:[t(`div`,{children:g?v[0]&&v[1]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:u(`filter.to`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[1]).format(`MMMM DD, YYYY`)})]}):v[0]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`→ Select end date`})]}):t(`span`,{className:`text-muted text-xs`,children:h?.placeholder||h?.name||r||`Select date range`}):i?Q(i).format(`MMMM DD, YYYY`):`Pick a date`}),n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:v,onChange:y,selectRange:!0,returnValue:`range`,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(v[0]){let e=v[0].getTime();if(v[1]){let n=v[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-primary/20 text-primary font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}},`${v[0]?.getTime()}-${v[1]?.getTime()}`)]}),t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:c,children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{if(d[0]){let e=new Date(d[0]),t=d[1]?new Date(d[1]):new Date(d[0]);e.setHours(0,0,0,0),t.setHours(23,59,59,999);let n=[];n.push({value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}),d[1]&&d[0].getTime()!==d[1].getTime()&&n.push({value:t.toISOString(),label:Q(t).format(`LLL dd, y`)}),o([...s,{name:r||``,placeholder:h?.placeholder,value:n,type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}},disabled:!v[0],children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:i,onChange:y,selectRange:!1,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(i&&t===i.getTime())return`bg-primary text-primary-foreground rounded-md font-semibold`}return``}})]})})}function FT({selectedView:e,commandInput:r,setFilters:i,handleClose:a,filterGroups:o}){let[s,c]=w([]),l=e=>{let t=o.find(t=>t.name===e);if(!t)return[];let n=t.options||[];if(!r.trim())return n;if(t.filterBy){let e=r.toLowerCase();return n.filter(n=>n.value!==void 0&&t.filterBy?.(n.value,e))}let i=r.toLowerCase();return n.filter(e=>String(e.value||``).toLowerCase().includes(i))};if(!e)return null;let u=l(e),d=o.find(t=>t.name===e),f=d?.placeholder||d?.name,p=()=>{s.length>0&&i(t=>[...t.filter(t=>t.name!==e),{name:e||``,placeholder:d?.placeholder||``,value:s,type:d?.type||`select`,multiple:d?.multiple||!1}]),a()},m=t=>{let n={value:t.value,label:t.label};d?.multiple?s.some(e=>e.value===t.value)?c(e=>e.filter(e=>e.value!==t.value)):c(e=>[...e,n]):(i(t=>{let r=t.findIndex(t=>t.name===e);if(r>=0){let e=[...t];return e[r]={...e[r],value:[n]},e}return[...t,{name:e||``,placeholder:d?.placeholder||``,value:[n],type:d?.type||`select`,multiple:d?.multiple||!1}]}),a())};return n(`div`,{className:`flex flex-col h-full`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted shrink-0`,children:t(`span`,{children:f})}),t(`div`,{className:`flex-1 overflow-hidden min-h-0`,children:t(`div`,{className:`max-h-[200px] overflow-y-auto`,children:u.length>0&&u.map(e=>{let r=s.some(t=>t.value===e.value);return n(vv,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(OT,{value:e.value||``,labelRenderer:e.labelRenderer||d?.labelRenderer,fallbackLabel:e.label}),d?.multiple&&r&&t(`span`,{className:`ms-auto text-xs text-success`,children:`✓`})]},e.value||`option-${Math.random()}`)})})}),d?.multiple&&t(`div`,{className:`p-2 border-t shrink-0`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),t(U,{size:`sm`,onClick:p,disabled:s.length===0,children:`Apply`})]})})]})}function IT({selectedView:e,setFilters:r,handleClose:i,filterGroups:a}){let[o,s]=w([]),c=a.find(t=>t.name===e);return n(`div`,{className:`p-2 space-y-3`,children:[t(`div`,{className:`space-y-2`,children:t(Ki,{value:o,onChange:s,placeholder:c?.placeholder||`Add ${e}...`,autoFocus:!0})}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:i,children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{o.length>0&&r(t=>[...t.filter(t=>t.name!==e),{name:e,placeholder:c?.placeholder,value:o,type:`stringList`}]),i()},disabled:o.length===0,children:`Apply`})]})]})}function LT({selectedView:e,textValue:r,setTextValue:i,setFilters:a,handleClose:o,filterGroups:s}){let c=()=>{a(t=>[...t,{name:e||``,placeholder:s.find(t=>t.name===e)?.placeholder,value:[{value:r,label:r}],type:`text`}]),o()};return n(`div`,{className:`p-2 flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:s.find(t=>t.name===e)?.placeholder})}),t(MT,{autoFocus:!0,type:`text`,size:`sm`,value:r,onChange:i,onKeyDown:e=>e.key===`Enter`&&c(),placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),t(U,{size:`sm`,onClick:c,disabled:!r.trim(),children:`Apply`})]})})]})}function RT(e,n,r){switch(e.type){case`date`:return t(DT,{filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value.map(e=>e.value||``):[],isRange:e.multiple,setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t.length>0?t.map(e=>({value:e,label:Q(e).format(`LLL dd, y`)})):[]}:n))}});case`text`:return t(NT,{filterType:e.placeholder||e.name,filterValue:Array.isArray(e.value)&&e.value[0]&&typeof e.value[0]==`object`&&e.value[0].value||``,setFilterValue:t=>{n(n=>n.map(n=>n===e?{...n,value:[{value:t,label:t}]}:n))}});case`stringList`:return t(AT,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`string`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))}});default:{let i=r.find(t=>t.name===e.name);return t(kT,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))},options:i?.options||[],labelRenderer:i?.labelRenderer,multiple:e.multiple??i?.multiple})}}}function zT({filters:e,setFilters:r,filterGroups:i}){return t(`div`,{className:`flex gap-2 flex-wrap justify-start`,children:e.filter(e=>e.value?.length>0).map(e=>n(`div`,{className:`flex gap-[1px] items-center text-sm`,children:[t(`div`,{className:`flex gap-1.5 shrink-0 rounded-s bg-muted p-1.5 h-8 items-center`,children:e.placeholder||e.name}),RT(e,r,i),t(U,{variant:`ghost`,size:`icon`,onClick:()=>{r(t=>t.filter(t=>t!==e))},className:`bg-muted rounded-s-none rounded-e-sm size-8 hover:text-primary hover:bg-muted/50 transition shrink-0`,children:t(Ze,{className:`size-6`})})]},`${e.name}-${e.type===`date`?`date`:e.type===`stringList`&&typeof e.value[0]==`string`?e.value.join(`,`):Array.isArray(e.value)?e.value.map(e=>e.value).join(`,`):``}`))})}const BT=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),VT=({filters:e,setFilters:n,filterGroups:r,children:i,inModal:a})=>{let s=new URL(window.location.href).searchParams.toString(),[c]=o.useState(()=>new URLSearchParams(window.location.search).get(`filters`)),l=o.useRef(new Set),u=o.useRef(a||!c);return _(()=>{if(!a&&u.current)try{let t=new URLSearchParams(s);if(e.length>0){let n=e.map(e=>{let t;if(e.type===`stringList`&&Array.isArray(e.value)&&typeof e.value[0]==`string`)t=`[${e.value.map(e=>encodeURIComponent(e)).join(`,`)}]`;else if(Array.isArray(e.value)){if(e.multiple)t=`[${e.value.map(e=>encodeURIComponent(GT(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(GT(e))).join(`,`)}]`;else{let n=e.value[0];t=typeof n==`string`?encodeURIComponent(n):typeof n==`object`&&n?.value!==void 0?encodeURIComponent(String(n.value)):encodeURIComponent(String(n||``))}}else t=encodeURIComponent(e.value||``);return`${encodeURIComponent(e.name)}:${t}`}).join(`;`);t.set(`filters`,n)}else t.delete(`filters`);let n=`${window.location.pathname}?${t.toString()}${window.location.hash}`;window.history.replaceState(window.history.state||{},``,n)}catch(e){console.error(`Failed to update URL with filters:`,e)}},[e,a,s]),_(()=>{if(!(a||!c||r.length===0))try{let e=c.split(`;`),t=[];for(let n of e){let e=n.indexOf(`:`);if(e===-1)continue;let i=n.slice(0,e),a=n.slice(e+1),o=decodeURIComponent(i);if(l.current.has(o))continue;let s=r.find(e=>e.name===o);if(!s)continue;l.current.add(o);let c;if(a.startsWith(`[`)&&a.endsWith(`]`)){let e=a.slice(1,-1);c=e?e.split(`,`).map(e=>decodeURIComponent(e)):[]}else c=[decodeURIComponent(a)];let u;u=s.type===`stringList`?c:s.type===`text`?c.length===1?[{value:c[0],label:c[0]}]:c.map(e=>({value:e,label:e})):c.map(e=>{let t=s.options?.find(t=>t.value===e),n=e;return t?.label?n=String(t.label):t?.labelRenderer?n=String(t.labelRenderer(e)):s.labelRenderer&&(n=String(s.labelRenderer(e))),{value:e,label:n}}),s.multiple&&!a.startsWith(`[`)&&!a.endsWith(`]`)&&(s.type===`stringList`?u=c:Array.isArray(u)||(u=[u])),t.push({name:o,type:s.type,placeholder:s.placeholder,value:u,multiple:s.multiple})}t.length>0&&n(e=>{let n=new Set(t.map(e=>e.name));return[...e.filter(e=>!n.has(e.name)),...t]}),u.current=!0}catch{}},[r,a,c,n]),t(BT.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},HT=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(BT),{t:s}=k(),[c,l]=o.useState(!1),[u,d]=o.useState(null),[f,p]=o.useState(``),m=o.useRef(null),[h,g]=o.useState(),[_,v]=o.useState(``),y=e=>{d(e),p(``),m.current?.focus()},b=()=>{let e=a.map(e=>({...e,options:(e.options??[]).filter(t=>!r.some(n=>n.type===`date`?n.name===e.name:n.name===e.name&&(Array.isArray(n.value)&&typeof n.value[0]==`string`?n.value.some(e=>e===t.value):n.value.some(e=>GT(e)===t.value))))})).filter(e=>(e.options??[]).length>0||e.type===`date`&&!r.some(t=>t.name===e.name)||e.type===`text`&&!r.some(t=>t.name===e.name)||e.type===`stringList`&&!r.some(t=>t.name===e.name));return e.length===0?t(hv,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(vv,{onSelect:()=>y(e.name),className:`group flex gap-2 items-center hover:bg-muted`,children:t(`span`,{children:e.placeholder??e.name})},e.name))},x=()=>{l(!1),setTimeout(()=>{d(null),p(``),g(void 0)},200)};return n(yT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(xT,{asChild:!0,children:n(U,{variant:`outline`,role:`combobox`,"aria-expanded":c,"aria-label":s(`filter.filter`),size:`md`,className:z(`transition group flex gap-1.5`,e),children:[t(He,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(CT,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(dv,{children:[a.find(e=>e.name===u)?.type===`select`&&t(pv,{placeholder:u?s(`filter.filterBy`,{view:u}):s(`filter.filterPlaceholder`),className:`h-9 ring-0`,value:f,onValueChange:e=>{p(e)},ref:m,autoFocus:!0}),t(mv,{children:t(gv,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(PT,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(LT,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(IT,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(FT,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},UT=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(BT);return t(`div`,{className:z(e),children:t(zT,{filters:n,setFilters:r,filterGroups:i})})},WT=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(BT),{t:i}=k();return n.filter(e=>e.value?.length>0).length>0?t(U,{variant:`outline`,size:`md`,className:z(`transition group`,e),onClick:()=>r([]),children:i(`filter.clearAll`)}):null};function GT(e){return typeof e==`string`?e:e.value||``}var KT;(function(e){e.IS=`is`,e.IS_NOT=`is_not`,e.CONTAINS=`contains`,e.BEFORE=`before`,e.AFTER=`after`,e.IS_ANY_OF=`is_any_of`})(KT||={});const qT=p(({className:e,level:n=3,...r},i)=>{let a=`h${n}`;return t(a,{ref:i,className:z({h1:`text-2xl font-medium tracking-tight`,h2:`text-xl font-medium tracking-tight`,h3:`text-lg font-medium`,h4:`text-base font-medium`,h5:`text-sm font-medium`,h6:`text-xs font-medium`}[`h${n}`],`mb-2`,e),...r})});qT.displayName=`Heading`;function JT({options:i,optionLabel:a,groupBy:o,value:s,onChange:c,addNew:l,addNewLabel:u,disabled:d,filterBy:f,label:p,placeholder:m,className:h,popupClass:g,isClearable:y,border:b=!0,multiple:x=!1,by:T,inline:E=!1,isLoading:D=!1,warnOnMissingValue:O=!0,missingValueWarning:k=`Value not in options list, may not be valid`,clearIcon:A,clearTitle:j,"aria-label":M,"aria-labelledby":N,id:P,"aria-describedby":ee,"aria-invalid":te}){let F=C(null),[ne,re]=w(!1),[ie,ae]=w(0),[oe,se]=w(``),ce=v(),le=v(),ue=S(()=>!O||x||s==null||!i?!1:!i.some(e=>typeof T==`string`?YT(e,T)===YT(s,T):typeof T==`function`?T(e,s):ge(e,s)),[O,x,s,i,T]);_(()=>{let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ae(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let de=e=>{if(x){let t=Array.isArray(s)?s:[];fe(e,t)?c(t.filter(t=>!pe(t,e))):c([...t,e])}else c(e)},fe=(e,t)=>!t||t.length===0?!1:t.some(t=>pe(t,e)),pe=(e,t)=>e==null||t==null?e===t:typeof T==`string`?YT(e,T)===YT(t,T):typeof T==`function`?T(e,t):ge(e,t),me=i||[];function he(e){return e?typeof e==`string`?t=>String(YT(t,e)).toLowerCase():e:e=>String(e).toLowerCase()}let _e=oe.toLowerCase(),ve=he(f);me=me.filter(e=>ve(e).includes(_e));let ye=()=>{if(!s||Array.isArray(s)&&s.length===0)return t(`span`,{className:`text-muted`,children:m});let e=Array.isArray(s)?s[0]:s;return a?a(e):e},be=()=>{let e=Array.isArray(s)?s:s?[s]:[];return e.length===0?t(`span`,{className:`text-muted`,children:m}):e.length===1?a?a(e[0]):e[0]:n(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,1).map((e,n)=>t(`span`,{className:`inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded`,children:a?a(e):e},`chip-${n}`)),e.length>1&&n(`span`,{className:`inline-flex items-center px-2 py-1 text-xs bg-muted rounded`,children:[`+`,e.length-1,` more`]})]})},xe=(e,r)=>{let i=x?fe(e,Array.isArray(s)?s:[]):s!=null&&pe(s,e);return t(vv,{onSelect:()=>de(e),className:`w-full`,children:x||E?n(`div`,{className:`w-full flex justify-between items-center cursor-pointer`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Me,{className:`size-4`})]}):n(wT,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Me,{className:`size-4`})]})},`option-${r}`)},Se=(()=>{if(!o)return null;let e=[],t=new Map;for(let n of me){let r=o(n),i=t.get(r);i||(i=[],t.set(r,i),e.push({key:r,items:i})),i.push(n)}return e})(),Ce=()=>n(e,{children:[f&&n(`div`,{className:`flex justify-start items-center mb-1`,children:[t(`div`,{className:`mx-2`,children:t(qe,{className:`size-4`})}),t(MT,{variant:`unstyled`,value:oe,onChange:se,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(dv,{className:`overflow-hidden`,children:n(mv,{className:E?`max-h-full overflow-y-auto`:`max-h-[200px] overflow-y-auto`,onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[t(hv,{children:`No result found.`}),Se?Se.map(e=>t(gv,{heading:e.key,className:`[&_[cmdk-group-heading]]:text-muted [&_[cmdk-group-heading]]:border-b [&_[cmdk-group-heading]]:border-border [&_[cmdk-group-heading]]:ml-[-0.5rem] [&_[cmdk-group-heading]]:text-xs`,children:e.items.map((t,n)=>xe(t,`${e.key}-${n}`))},e.key)):t(gv,{children:me?.map((e,t)=>xe(e,t))})]})}),l&&t(`div`,{className:`p-1`,children:n(`button`,{type:`button`,onClick:l,className:r(`w-full text-start gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-accent bg-transparent border-0`),children:[t(Je,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),u]})})]});if(E)return t(`div`,{className:r(h,b&&`border border-border rounded-md`,`bg-popover p-1`,g),children:D?t(`div`,{className:`flex justify-center items-center p-2 text-muted text-sm`,children:t(Ue,{className:`size-4 animate-spin`})}):Ce()});let we=!!p,Te=M??(we?void 0:typeof m==`string`?m:void 0),Ee=N??(we?le:void 0),De=!!y&&!!s&&(!Array.isArray(s)||s.length>0),Oe=te===!0||te===`true`||ue?!0:te===!1||te===`false`?!1:void 0;return n(yT,{onOpenChange:re,children:[n(`div`,{ref:F,className:r(`relative`,h),children:[t(xT,{asChild:!0,children:t(`button`,{type:`button`,id:P,disabled:d||D,"aria-haspopup":`dialog`,"aria-expanded":ne,"aria-controls":ce,"aria-label":Te,"aria-labelledby":Ee,"aria-describedby":ee,"aria-invalid":Oe,className:r(D?`flex w-full justify-center items-center gap-2 border border-border rounded-md p-2 text-muted text-sm bg-transparent`:r(b&&(ue||Oe?`border border-destructive`:`border border-border`),`flex w-full flex-row gap-2 items-center justify-between p-2 rounded-md group bg-transparent text-inherit text-start`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,d?`cursor-not-allowed text-muted`:`cursor-pointer hover:bg-muted`,De&&`pe-10`)),children:D?t(Ue,{className:`size-4 animate-spin`}):n(e,{children:[n(`div`,{className:r(`flex flex-col w-full rounded-md text-sm min-h-6 items-center justify-center truncate`),children:[p&&t(`div`,{id:le,className:`w-full text-start text-xs font-semibold`,children:p}),n(`div`,{className:r(`w-full text-start `,ue&&`text-destructive`),children:[ue&&t(bi,{description:k,placement:`top`,asChild:!0,children:t(Xe,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?be():ye()]})]}),!d&&t(Ie,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),De&&!D&&t(U,{variant:`link`,size:`icon`,disabled:d,title:j||`Clear selection`,onClick:e=>{e.stopPropagation(),c(x?[]:void 0)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},className:`absolute end-2 top-1/2 -translate-y-1/2 hover:bg-muted/20 rounded p-1`,children:A||t(Ze,{className:`size-4`})})]}),t(CT,{id:ce,style:{width:`${ie}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,g),children:Ce()})]})}function YT(e,t){return typeof e==`object`&&e?e[t]:void 0}const XT={ar:`العربية`,de:`Deutsch`,en:`English`,es:`Español`,fr:`Français`,it:`Italiano`,ja:`日本語`,ko:`한국어`,pt:`Português`,ru:`Русский`,tr:`Türkçe`,zh:`中文`,"zh-TW":`繁體中文`};function ZT({label:e,className:r}={}){let{language:i,setLanguage:a}=O(),{t:o}=k(),s=e===!1?!1:e??o(`language.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center gap-3`:`flex items-center`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),t(JT,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>XT[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var QT=Object.defineProperty,$T=a.forwardRef(((e,t)=>QT(e,`name`,{value:t,configurable:!0}))(function(e,n){return t(H.label,{...e,ref:n,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));const eE=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),tE=a.forwardRef(({className:e,required:r,...i},a)=>n($T,{ref:a,className:z(eE(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive-foreground ms-1`,children:`*`})]}));tE.displayName=$T.displayName;function nE({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(Re,{className:`size-5 text-destructive`,"aria-hidden":`true`}),c=`text-destructive`,l=`text-foreground`,u=`bg-destructive border border-destructive`;break;case`warning`:s=t(Xe,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Le,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(Ve,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(Ve,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(Ve,{className:`size-5 text-done`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-done border border-done`}return t(`div`,{className:`rounded-md p-4 ${u} ${o}`,children:n(`div`,{className:`flex`,children:[t(`div`,{className:`shrink-0`,children:e??s}),n(`div`,{className:`w-full ms-2 px-1`,children:[i&&t(`h3`,{className:`text-md font-medium mb-2 ${c}`,children:i}),t(`div`,{className:`text-sm ${l} break-words`,children:a})]})]})})}function rE({title:e,className:r,children:i,action:a,actionLabel:o}){return n(nE,{status:`error`,title:e,className:`${r} flex flex-col items-center justify-center text-center`,children:[t(`pre`,{className:`whitespace-pre-wrap break-words`,children:i}),a&&o&&t(U,{onClick:a,variant:`ghost`,size:`sm`,className:`mt-4`,children:o})]})}function iE({title:e,className:n,children:r}){return t(nE,{status:`info`,title:e,className:n,children:r})}function aE({title:e,className:n,children:r}){return t(nE,{status:`warning`,title:e,className:n,children:r})}function oE({title:e,className:n,children:r}){return t(nE,{status:`success`,title:e,className:n,children:r})}function sE({title:e,className:n,children:r}){return t(nE,{status:`default`,title:e,className:n,children:r})}function cE({title:e,content:r,onConfirm:i,onCancel:a,isOpen:o,isLoading:s,confirmationValue:c,confirmationLabel:l,confirmationPlaceholder:u}){let{t:d}=k(),f=C(null),[p,m]=w(``);_(()=>{o||m(``)},[o]);let h=!!c,g=!c||p.trim()===c.trim(),v=()=>{!g||s||i()};return n($_,{isOpen:o,onClose:a,description:`Confirm Modal`,children:[n(`div`,{className:`sm:flex sm:items-start p-2`,children:[t(`div`,{className:`mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10`,children:t(Xe,{className:`size-6 text-red-600`,"aria-hidden":`true`})}),n(`div`,{className:`mt-3 text-center sm:ms-4 sm:mt-0 sm:text-start`,children:[t(ev,{className:`leading-6`,show:!0,children:e}),t(`div`,{className:`mt-2`,children:t(`div`,{className:`prose text-sm text-gray-500`,children:r})})]})]}),h&&t(`div`,{className:`px-2 pb-2 text-start`,children:t(zi,{label:l??u,children:t(MT,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(nv,{align:`right`,children:[t(U,{variant:`destructive`,onClick:v,isLoading:s,disabled:!g,children:d(`modal.confirm`)}),t(U,{variant:`outline`,onClick:a,ref:f,children:d(`modal.cancel`)})]})]})}function lE(){return g(uE)}const uE=d(()=>{}),dE={success:Le,error:Re,warning:Xe,info:Ve},fE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function pE({data:e,onClose:r}){let[i,a]=w(!0),o=C(null),s=h(()=>{o.current&&=(globalThis.clearTimeout(o.current),null)},[]),c=h(()=>{s(),e.duration&&(o.current=setTimeout(()=>a(!1),e.duration))},[s,e.duration]);_(()=>(c(),s),[s,c]);let l=dE[e.status]||Ve,u=fE[e.status]||`text-info`;return t(`div`,{"aria-live":`assertive`,className:`pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-100`,children:t(`div`,{className:`flex w-full flex-col items-center space-y-4 sm:items-end`,children:t(Tp,{onExitComplete:r,children:i&&t(vh.div,{className:`pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-muted shadow-lg ring-1 ring-border`,initial:{opacity:0,x:8},animate:{opacity:1,x:0,transition:{ease:`easeOut`,duration:.7}},exit:{opacity:0,transition:{ease:`easeIn`,duration:.3}},onMouseEnter:s,onMouseLeave:c,children:t(`div`,{className:`p-5`,children:n(`div`,{className:`flex items-start`,children:[t(`div`,{className:`shrink-0`,children:t(l,{className:`size-6 ${u}`,"aria-hidden":`true`})}),n(`div`,{className:`ms-3 flex-1 pt-0.5 min-w-0`,children:[t(`p`,{className:`text-sm font-semibold text-foreground break-words`,children:e.title}),e.description&&t(`p`,{className:`mt-2 text-sm text-muted break-words whitespace-pre-wrap leading-relaxed`,children:e.description})]}),t(`div`,{className:`ms-4 flex shrink-0`,children:n(`button`,{type:`button`,className:`inline-flex rounded-md bg-muted text-muted hover:text-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background`,onClick:()=>a(!1),children:[t(`span`,{className:`sr-only`,children:`Close`}),t(Ze,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function mE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(uE.Provider,{value:o,children:r}),i&&t(Ch,{children:t(pE,{data:i,onClose:()=>o(null)})})]})}function hE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=lE();return t(cE,{title:n,content:r,isOpen:!!e,onConfirm:async()=>{if(e)return a(e).then(()=>{s({title:o(`modal.delete.succeeded`),status:`success`})}).catch(e=>{s({title:o(`modal.delete.failed`),description:e instanceof Error?e.message:o(`modal.delete.error`),status:`error`})}).finally(()=>{i(void 0)})},onCancel:()=>{i(void 0)}})}const gE=4,_E={tabs:{base:`flex items-center border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`border-transparent text-muted-foreground hover:border-border hover:text-foreground`,active:`border-primary text-primary`,icon:`ms-1 size-4`},pills:{base:`flex items-center rounded-md px-2 py-1 text-xs font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`text-muted-foreground hover:bg-muted/60`,active:`bg-muted text-foreground`,icon:`ms-0.5 size-3.5`}};function vE(e,t,n=4){let r=C(null),i=C([]),a=C(null),[o,s]=w({count:e.length,promote:!1}),c=()=>{let o=r.current;if(!o)return;let c=o.clientWidth,l=e.map((e,t)=>i.current[t]?.offsetWidth??0),u=l.reduce((e,t)=>e+t,0)+n*Math.max(0,e.length-1),d=(t,r)=>{let i=0,a=0;for(let o=0;o<e.length;o++){if(o===r)continue;let e=i+(a>0?n:0)+l[o];if(e>t)break;i=e,a+=1}return a},f;if(u<=c)f={count:e.length,promote:!1};else{let r=a.current?.offsetWidth??0,i=Math.max(1,d(c-r-n,-1)),o=e.findIndex(t);f=o<0||o<i?{count:i,promote:!1}:{count:d(c-r-l[o]-n*2,o),promote:!0}}s(e=>e.count===f.count&&e.promote===f.promote?e:f)},l=C(c);l.current=c,x(()=>{l.current()}),_(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>l.current());return t.observe(e),()=>t.disconnect()},[]);let u=e.findIndex(t),d,f;if(o.promote&&u>=0){let t=e.filter((e,t)=>t!==u);d=[...t.slice(0,o.count),e[u]],f=t.slice(o.count)}else d=e.slice(0,o.count),f=e.slice(o.count);return{containerRef:r,setItemRef:e=>t=>{i.current[e]=t},setMoreRef:e=>{a.current=e},visible:d,overflow:f,activeInOverflow:f.some(t)}}function yE({label:e,triggerClassName:r,icon:i,children:a}){let[o,s]=w(!1),c=C(null),l=C(!1),u=()=>{c.current&&=(clearTimeout(c.current),null)},d=()=>{u(),l.current=!0,s(!0)},f=()=>{u(),c.current=setTimeout(()=>s(!1),150)};return _(()=>()=>clearTimeout(c.current??void 0),[]),n(Tx,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(Dx,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(Ne,{className:`ms-1 size-4`})]})}),t(Ox,{align:`end`,className:`w-max`,onMouseEnter:u,onMouseLeave:f,onCloseAutoFocus:e=>{l.current&&e.preventDefault()},children:a})]})}function bE({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=k(),c=_E[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=vE(e,e=>e.name===r),h=s(`agent.moreTabs`);return n(`div`,{ref:l,className:z(`relative`,o),children:[n(`div`,{"aria-hidden":!0,className:`pointer-events-none invisible absolute start-0 top-0 flex w-max gap-1`,children:[e.map((e,n)=>t(`button`,{type:`button`,tabIndex:-1,ref:u(n),className:z(c.base,c.inactive),children:e.label},e.name)),n(`button`,{type:`button`,tabIndex:-1,ref:d,className:z(c.base,c.inactive),children:[h,t(Ne,{className:c.icon})]})]}),n(`div`,{className:z(`flex gap-1 overflow-hidden`,a===`tabs`&&`-mb-px border-b`),children:[f.map(e=>{let n=e.name===r;return t(`button`,{type:`button`,"aria-current":n?`page`:void 0,disabled:e.disabled,onClick:()=>i(e.name),className:z(c.base,n?c.active:c.inactive,`disabled:pointer-events-none disabled:opacity-50`),children:e.label},e.name)}),p.length>0&&t(yE,{label:h,triggerClassName:z(c.base,m?c.active:c.inactive),icon:t(Ne,{className:c.icon}),children:p.map(e=>t(Ax,{disabled:e.disabled,onClick:()=>i(e.name),className:z(e.name===r&&`text-primary`),children:e.label},e.name))})]})]})}function xE({children:r,action:i,title:a,description:o,footer:s,className:c,collapsible:l,defaultCollapsed:u=!1,size:d=`md`,clickableHeader:f=!1}){let[p,m]=w(u),h=l&&f,g=d===`sm`,_=g||h,v=t(p?Ne:Fe,{className:`size-4 text-muted`}),y=n(e,{children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`div`,{className:`font-semibold ${g?`text-sm`:`text-lg`}`,children:a}),t(Ii,{description:o,size:`md`})]}),n(`div`,{className:`flex gap-2 items-center`,children:[i,l&&(h?v:t(U,{variant:`ghost`,size:`icon`,onClick:()=>m(!p),children:v}))]})]}),b=g?`px-4 py-2`:`px-4 py-3`,x=g?`px-4 pt-3 pb-3`:`p-4`,S=g?`px-4 pb-3`:`px-4 pb-4`;return n(`div`,{className:`flex flex-col ${_?``:`p-4 gap-2`} rounded-sm border bg-card ${h?`overflow-hidden`:``} ${c??``}`,children:[h?t(`button`,{type:`button`,className:`w-full flex items-center justify-between ${b} hover:bg-muted/50 transition-colors`,onClick:()=>m(!p),children:y}):t(`div`,{className:`flex items-center justify-between ${_?b:``}`,children:y}),!p&&(_?t(`div`,{className:x,children:r}):r),s&&t(`div`,{className:`border-t border-muted flex flex-col-2 text-sm pt-4 ${_?S:``}`,children:s})]})}var SE=Object.defineProperty,CE=(e,t)=>SE(e,`name`,{value:t,configurable:!0}),wE=`Radio`,[TE,EE]=an(wE),[DE,OE]=TE(wE);function kE(e){let{__scopeRadio:n,checked:r=!1,children:i,disabled:o,form:s,name:c,onCheck:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=a.useState(null),[h,g]=a.useState(null),_=a.useRef(!1),[v,y]=a.useReducer(e=>e+1,0),b={checked:r,disabled:o,required:u,name:c,form:s,value:d,control:p,setControl:m,hasConsumerStoppedPropagationRef:_,userInteractionCount:v,onUserInteraction:y,isFormControl:!p||!!s||!!p.closest(`form`),bubbleInput:h,setBubbleInput:g,onCheck:CE(()=>l?.(),`onCheck`)};return t(DE,{scope:n,...b,children:IE(f)?f(b):i})}CE(kE,`RadioProvider`);var AE=`RadioTrigger`,jE=a.forwardRef(CE(function({__scopeRadio:e,onClick:n,...r},i){let{checked:a,disabled:o,value:s,setControl:c,onCheck:l,hasConsumerStoppedPropagationRef:u,onUserInteraction:d,isFormControl:f,bubbleInput:p}=OE(AE,e),m=R(i,c);return t(H.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":LE(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:m,onClick:B(n,e=>{a||(d(),l()),p&&f&&(u.current=e.isPropagationStopped(),u.current||e.stopPropagation())})})},`RadioTrigger`)),ME=`RadioIndicator`,NE=a.forwardRef(CE(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=OE(ME,r);return t(or,{present:i||o.checked,children:t(H.span,{"data-state":LE(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),PE=`RadioBubbleInput`,FE=a.forwardRef(CE(function({__scopeRadio:e,onClick:n,...r},i){let{control:o,checked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m,hasConsumerStoppedPropagationRef:h,userInteractionCount:g}=OE(PE,e),_=R(i,m),v=Pn(o),y=a.useRef(!1),b=a.useRef(s),x=a.useRef(g);a.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=g!==x.current;x.current=g;let i=b.current!==s;b.current=s;let a=!(r&&h.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[p,s,h,g]);let S=a.useRef(s);return t(H.input,{type:`radio`,"aria-hidden":!0,defaultChecked:S.current,required:c,disabled:l,name:u,value:d,form:f,...r,tabIndex:-1,ref:_,onClick:B(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function IE(e){return typeof e==`function`}CE(IE,`isFunction`);function LE(e){return e?`checked`:`unchecked`}CE(LE,`getState`);var RE=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],zE=`RadioGroup`,[BE,VE]=an(zE,[Xv,EE]),HE=Xv(),UE=EE(),[WE,GE]=BE(zE),KE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,name:i,form:o,defaultValue:s,value:c,required:l=!1,disabled:u=!1,orientation:d,dir:f,loop:p=!0,onValueChange:m,...h}=e,g=HE(r),_=fe(f),[v,y]=br({prop:c,defaultProp:s??null,onChange:m,caller:zE}),[b,x]=a.useState(null),S=R(n,x),C=a.useRef(v);return a.useEffect(()=>{let e=o?b?.ownerDocument.getElementById(o):b?.closest(`form`);if(e instanceof HTMLFormElement){let t=CE(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),t(WE,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:t(cy,{asChild:!0,...g,orientation:d,dir:_,loop:p,children:t(H.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),qE=`RadioGroupItemProvider`,JE=`RadioGroupItemTrigger`;function YE(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=GE(qE,n),c=UE(n),l=s.disabled||i;return t(kE,{...c,checked:s.value===r,disabled:l,required:s.required,name:s.name,form:s.form,value:r,onCheck:()=>s.onValueChange(r),internal_do_not_use_render:o,children:a})}CE(YE,`RadioGroupItemProvider`);var XE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=HE(r),s=UE(r),{checked:c,disabled:l}=OE(JE,s.__scopeRadio),u=a.useRef(null),d=R(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=CE(e=>{RE.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=CE(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),t(ly,{asChild:!0,...o,focusable:!l,active:c,children:t(jE,{...s,...i,ref:d,onKeyDown:B(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:B(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),ZE=a.forwardRef(CE(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return t(YE,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(XE,{...c,ref:i,__scopeRadioGroup:a}),r&&t(QE,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),QE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=UE(r);return t(FE,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),$E=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=UE(r);return t(NE,{...a,...i,ref:n})},`RadioGroupIndicator`));function eD({className:e,...n}){return t(ZE,{"data-slot":`radio-group-item`,className:z(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:t($E,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:t(`span`,{className:`bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full`})})})}var tD=class{descriptionOf(e){}selectedClassName(e){return`border-accent-foreground`}};function nD({onSelect:e,selected:r,options:i,adapter:a}){let o=e=>a?a.idOf(e):e.id,s=e=>a?a.labelOf(e):e.label,c=e=>a?a.descriptionOf(e):e.description,l=e=>a?a.selectedClassName(e):`border-primary`;return t(KE,{"data-slot":`radio-group`,value:r?o(r):void 0,onValueChange:t=>{let n=i.find(e=>o(e)===t);n&&e(n)},className:`space-y-4`,children:i.map(e=>{let i=r?o(r)===o(e):!1;return t(ZE,{value:o(e),className:z(`relative block w-full cursor-pointer rounded-lg border border-border bg-accent px-6 py-4 shadow-2xs text-start`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`sm:flex sm:justify-between`,i&&l(e)),children:t(`span`,{className:`flex items-center`,children:n(`span`,{className:`flex flex-col text-sm`,children:[t(`span`,{className:`font-medium text-text`,children:s(e)}),c(e)&&t(`span`,{className:`text-muted-foreground`,children:c(e)})]})})},o(e))})})}function rD({className:e,direction:n=`horizontal`,orientation:r,...i}){let a=r??n;return t(_e.Group,{"data-slot":`resizable-panel-group`,"data-panel-group-direction":a,orientation:a,className:z(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function iD(e){return typeof e==`number`?`${e}%`:e}function aD({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(_e.Panel,{"data-slot":`resizable-panel`,defaultSize:iD(e),minSize:iD(n),maxSize:iD(r),collapsedSize:iD(i),...a})}function oD({withHandle:e,className:n,...r}){return t(_e.Separator,{"data-slot":`resizable-handle`,className:z(`bg-muted focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:start-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),...r,children:e&&t(`div`,{className:`z-10 flex size-4 items-center justify-center rounded-xs font-semibold`,children:t(We,{className:`size-4 rotate-90`})})})}var sD=Object.defineProperty,cD=(e,t)=>sD(e,`name`,{value:t,configurable:!0}),lD=`horizontal`,uD=[`horizontal`,`vertical`],dD=a.forwardRef(cD(function(e,n){let{decorative:r,orientation:i=lD,...a}=e,o=fD(i)?i:lD,s=r?{role:`none`}:{"aria-orientation":o===`vertical`?o:void 0,role:`separator`};return t(H.div,{"data-orientation":o,...s,...a,ref:n})},`Separator`));function fD(e){return uD.includes(e)}cD(fD,`isValidOrientation`);var pD=dD;const mD=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(pD,{ref:a,decorative:r,orientation:n,className:z(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));mD.displayName=pD.displayName;var hD=Object.defineProperty,gD=(e,t)=>hD(e,`name`,{value:t,configurable:!0});function _D(e,[t,n]){return Math.min(n,Math.max(t,e))}gD(_D,`clamp`);var vD=Object.defineProperty,yD=(e,t)=>vD(e,`name`,{value:t,configurable:!0});function bD(e){let t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}yD(bD,`usePrevious`);var xD=Object.defineProperty,$=(e,t)=>xD(e,`name`,{value:t,configurable:!0}),SD=[`PageUp`,`PageDown`],CD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],wD={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},TD=`Slider`,[ED,DD,OD]=Sv(TD),[kD,AD]=an(TD,[OD]),[jD,MD]=kD(TD),ND=a.forwardRef($(function(e,n){let{name:r,min:i=0,max:o=100,step:s=1,orientation:c=`horizontal`,disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[i],value:f,onValueChange:p=$(()=>{},`onValueChange`),onValueCommit:m=$(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=a.useRef(new Set),y=a.useRef(0),b=a.useRef(!1),x=c===`horizontal`?ID:LD,[S,C]=a.useState(null),w=R(n,C),[T=[],E]=br({prop:f,defaultProp:d,onChange:$(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,p(e)},`onChange`)}),D=a.useRef(T),O=a.useRef(T);a.useEffect(()=>{let e=g?S?.ownerDocument.getElementById(g):S?.closest(`form`);if(e instanceof HTMLFormElement){let t=$(()=>E(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,g,E]);function k(e){M(e,tO(T,e))}$(k,`handleSlideStart`);function A(e){M(e,y.current)}$(A,`handleSlideMove`);function j(){String(T)!==String(D.current)&&m(T)}$(j,`handleSlideEnd`);function M(e,t,{commit:n}={commit:!1}){let r=oO(s),a=_D(sO(Math.round((e-i)/s)*s+i,r),[i,o]);E((e=[])=>{let r=QD(e,a,t);if(iO(r,u*s)){y.current=r.indexOf(a);let t=String(r)!==String(e);return t&&n&&m(r),t?r:e}return e})}return $(M,`updateValues`),t(jD,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:y,thumbs:v.current,values:T,orientation:c,form:g,children:t(ED.Provider,{scope:e.__scopeSlider,children:t(ED.Slot,{scope:e.__scopeSlider,children:t(x,{"aria-disabled":l,"data-disabled":l?``:void 0,..._,ref:w,onPointerDown:B(_.onPointerDown,()=>{l||(D.current=T,b.current=!1)}),min:i,max:o,inverted:h,onSlideStart:l?void 0:k,onSlideMove:l?void 0:A,onSlideEnd:l?void 0:j,onHomeKeyDown:()=>{l||(b.current=!0,M(i,0,{commit:!0}))},onEndKeyDown:()=>{l||(b.current=!0,M(o,T.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){b.current=!0;let n=SD.includes(e.key)||e.shiftKey&&CD.includes(e.key)?10:1,r=y.current,a=T[r];M(cO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[PD,FD]=kD(TD,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),ID=a.forwardRef($(function(e,n){let{min:r,max:i,dir:o,inverted:s,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,[p,m]=a.useState(null),h=R(n,m),g=a.useRef(void 0),_=fe(o),v=_===`ltr`,y=v&&!s||!v&&s;function b(e){let t=g.current||p.getBoundingClientRect(),n=aO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),t(PD,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:t(RD,{dir:_,"data-orientation":`horizontal`,...f,ref:h,style:{...f.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=b(e.clientX);c?.(t)},onSlideMove:e=>{let t=b(e.clientX);l?.(t)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:e=>{let t=wD[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),LD=a.forwardRef($(function(e,n){let{min:r,max:i,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...d}=e,f=a.useRef(null),p=R(n,f),m=a.useRef(void 0),h=!o;function g(e){let t=m.current||f.current.getBoundingClientRect(),n=aO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),t(PD,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:t(RD,{"data-orientation":`vertical`,...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=g(e.clientY);s?.(t)},onSlideMove:e=>{let t=g(e.clientY);c?.(t)},onSlideEnd:()=>{m.current=void 0,l?.()},onStepKeyDown:e=>{let t=wD[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),RD=a.forwardRef($(function(e,n){let{__scopeSlider:r,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...u}=e,d=MD(TD,r);return t(H.span,{...u,ref:n,onKeyDown:B(e.onKeyDown,e=>{e.key===`Home`?(s(e),e.preventDefault()):e.key===`End`?(c(e),e.preventDefault()):SD.concat(CD).includes(e.key)&&(l(e),e.preventDefault())}),onPointerDown:B(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),d.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):i(e)}),onPointerMove:B(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:B(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})},`SliderImpl`)),zD=`SliderTrack`,BD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=MD(zD,r);return t(H.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),VD=`SliderRange`,HD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,o=MD(VD,r),s=FD(VD,r),c=R(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>$D(e,o.min,o.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return t(H.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,...i,ref:c,style:{...e.style,[s.startEdge]:d+`%`,[s.endEdge]:f+`%`}})},`SliderRange`)),[UD,WD]=kD(`SliderThumb`),GD=`SliderThumbProvider`;function KD(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=MD(GD,n),c=DD(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=Pn(l),p=!l||!!s.form||!!l.closest(`form`),m=s.values[d],h=r??(s.name?s.name+(s.values.length>1?`[]`:``):void 0),g=m===void 0?0:$D(m,s.min,s.max);a.useEffect(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]);let _={value:m,name:h,form:s.form,isFormControl:p,index:d,thumb:l,onThumbChange:u,percent:g,size:f};return t(UD,{scope:n,..._,children:lO(o)?o(_):i})}$(KD,`SliderThumbProvider`);var qD=`SliderThumbTrigger`,JD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=MD(qD,r),o=FD(qD,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=WD(qD,r),f=R(n,d),p=eO(s,a.values.length),m=u?.[o.size],h=m?nO(m,l,o.direction):0;return t(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[o.startEdge]:`calc(${l}% + ${h}px)`},children:t(ED.ItemSlot,{scope:r,children:t(H.span,{role:`slider`,"aria-label":e[`aria-label`]||p,"aria-valuemin":a.min,"aria-valuenow":c,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?``:void 0,tabIndex:a.disabled?void 0:0,...i,ref:f,style:c===void 0?{display:`none`}:e.style,onFocus:B(e.onFocus,()=>{a.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),YD=a.forwardRef($(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return t(KD,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>n(e,{children:[t(JD,{...s,ref:i,__scopeSlider:a}),o?t(ZD,{__scopeSlider:a},r):null]})})},`SliderThumb`)),XD=`SliderBubbleInput`,ZD=a.forwardRef($(function({__scopeSlider:e,...n},r){let{value:i,name:o,form:s}=WD(XD,e),c=a.useRef(null),l=R(c,r),u=bD(i);return a.useEffect(()=>{let e=c.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(u!==i&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,i),e.dispatchEvent(t)}},[u,i]),t(H.input,{style:{display:`none`},name:o,form:s,...n,ref:l,defaultValue:i})},`SliderBubbleInput`));function QD(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(QD,`getNextSortedValues`);function $D(e,t,n){return _D(100/(n-t)*(e-t),[0,100])}$($D,`convertValueToPercentage`);function eO(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(eO,`getLabel`);function tO(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}$(tO,`getClosestValueIndex`);function nO(e,t,n){let r=e/2;return(r-aO([0,50],[0,r])(t)*n)*n}$(nO,`getThumbInBoundsOffset`);function rO(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$(rO,`getStepsBetweenValues`);function iO(e,t){if(t>0){let n=rO(e);return Math.min(...n)>=t}return!0}$(iO,`hasMinStepsBetweenValues`);function aO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}$(aO,`linearScale`);function oO(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}$(oO,`getDecimalCount`);function sO(e,t){let n=10**t;return Math.round(e*n)/n}$(sO,`roundValue`);function cO(e,{min:t,step:n,direction:r,multiplier:i}){let a=oO(n),o=(e-t)/n,s=Math.round(o),c=sO(s*n+t,a)===sO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),sO(l*n+t,a)}$(cO,`getNextStepValue`);function lO(e){return typeof e==`function`}$(lO,`isFunction`);const uO=a.forwardRef(({className:e,trackClassName:r,rangeClassName:i,thumbClassName:o,value:s,defaultValue:c,min:l=0,max:u=100,"aria-label":d,...f},p)=>{let m=a.useId(),h=Array.isArray(s)?s.length:Array.isArray(c)?c.length:1,g=a.useMemo(()=>Array.from({length:Math.max(1,h)},(e,t)=>`${m}-thumb-${t}`),[m,h]);return n(ND,{ref:p,"data-slot":`slider`,value:s,defaultValue:c,min:l,max:u,...f,className:z(`relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,e),children:[t(BD,{"data-slot":`slider-track`,className:z(`relative h-1.5 w-full grow overflow-hidden rounded-full bg-muted data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`,r),children:t(HD,{"data-slot":`slider-range`,className:z(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(YD,{"data-slot":`slider-thumb`,"aria-label":d,className:z(`block size-3.5 rounded-full border border-primary bg-background shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,o)},e))]})});uO.displayName=ND.displayName;var dO=Object.defineProperty,fO=(e,t)=>dO(e,`name`,{value:t,configurable:!0}),pO=`Switch`,[mO,hO]=an(pO),[gO,_O]=mO(pO);function vO(e){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:o,disabled:s,form:c,name:l,onCheckedChange:u,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[m,h]=br({prop:r,defaultProp:o??!1,onChange:u,caller:pO}),[g,_]=a.useState(null),[v,y]=a.useState(null),b=a.useRef(!1),[x,S]=a.useReducer(e=>e+1,0),C={checked:m,setChecked:h,disabled:s,control:g,setControl:_,name:l,form:c,value:f,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:d,defaultChecked:o,isFormControl:!g||!!c||!!g.closest(`form`),bubbleInput:v,setBubbleInput:y};return t(gO,{scope:n,...C,children:EO(p)?p(C):i})}fO(vO,`SwitchProvider`);var yO=`SwitchTrigger`,bO=a.forwardRef(fO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,form:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=_O(yO,e),v=R(i,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=fO(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,s,p]),t(H.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":DO(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:v,onClick:B(n,e=>{h(),p(e=>!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`SwitchTrigger`)),xO=a.forwardRef(fO(function(r,i){let{__scopeSwitch:a,name:o,checked:s,defaultChecked:c,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=r;return t(vO,{__scopeSwitch:a,checked:s,defaultChecked:c,disabled:u,required:l,onCheckedChange:f,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(bO,{...m,ref:i,__scopeSwitch:a}),r&&t(TO,{__scopeSwitch:a})]})})},`Switch`)),SO=`SwitchThumb`,CO=a.forwardRef(fO(function(e,n){let{__scopeSwitch:r,...i}=e,a=_O(SO,r);return t(H.span,{"data-state":DO(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),wO=`SwitchBubbleInput`,TO=a.forwardRef(fO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=_O(wO,e),v=R(i,_),y=Pn(o),b=a.useRef(!1),x=a.useRef(l),S=a.useRef(c);a.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==S.current;S.current=c;let i=x.current!==l;x.current=l;let a=!(r&&s.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(l);return t(H.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...r,tabIndex:-1,ref:v,onClick:B(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function EO(e){return typeof e==`function`}fO(EO,`isFunction`);function DO(e){return e?`checked`:`unchecked`}fO(DO,`getState`);const OO={sm:[`h-5 w-8`,`size-3`,`translate-x-4 rtl:-translate-x-4`],md:[`h-6 w-11`,`size-4`,`translate-x-6 rtl:-translate-x-6`],lg:[`h-8 w-16`,`size-6`,`translate-x-9 rtl:-translate-x-9`]};function kO({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=OO[r],f=t(xO,{"data-slot":`switch`,checked:i,onCheckedChange:a,disabled:s,...c,className:z(`data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-full border focus-visible:ring-3 aria-invalid:ring-3 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,l,!o&&e),children:t(CO,{"data-slot":`switch-thumb`,className:z(`bg-white rounded-full pointer-events-none block ring-0 transition-transform`,u,i?d:`translate-x-1 rtl:-translate-x-1`)})});return o?n(`div`,{className:z(`flex items-center`,e),children:[f,t(`span`,{className:`px-2`,children:o})]}):f}var AO=Object.defineProperty,jO=(e,t)=>AO(e,`name`,{value:t,configurable:!0}),MO=`Tabs`,[NO,PO]=an(MO,[Xv]),FO=Xv(),[IO,LO]=NO(MO),RO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=`automatic`,...u}=e,d=fe(c),[f,p]=br({prop:i,onChange:a,defaultProp:o??``,caller:MO});return t(IO,{scope:r,baseId:V(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:t(H.div,{dir:d,"data-orientation":s,...u,ref:n})})},`Tabs`)),zO=`TabsList`,BO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=LO(zO,r),s=FO(r);return t(cy,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:t(H.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:n})})},`TabsList`)),VO=`TabsTrigger`,HO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=LO(VO,r),c=FO(r),l=GO(s.baseId,i),u=KO(s.baseId,i),d=i===s.value;return t(ly,{asChild:!0,...c,focusable:!a,active:d,children:t(H.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":u,"data-state":d?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:l,...o,ref:n,onMouseDown:B(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(i):e.preventDefault()}),onKeyDown:B(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:B(e.onFocus,()=>{let e=s.activationMode!==`manual`;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),UO=`TabsContent`,WO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=LO(UO,r),u=GO(l.baseId,i),d=KO(l.baseId,i),f=i===l.value,p=a.useRef(f);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),t(or,{present:o||f,children:({present:r})=>t(H.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...c,ref:n,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:r&&s})})},`TabsContent`));function GO(e,t){return`${e}-trigger-${t}`}jO(GO,`makeTriggerId`);function KO(e,t){return`${e}-content-${t}`}jO(KO,`makeContentId`);var qO=RO,JO=BO,YO=HO,XO=WO;const ZO=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),QO=({tabs:e,defaultValue:n,current:r,className:i,fullWidth:o,fullHeight:s,children:c,onTabChange:l,responsive:u=!1,variant:d=`tabs`,updateHash:f=!0,canChangeTab:p})=>{let m=a.useMemo(()=>e.filter(e=>e.is_allowed===void 0||e.is_allowed===!0),[e]),[h,g]=a.useState(()=>{let e=typeof r==`function`?r():r;if(e)return e;let t=window.location.hash,i=t?t.substring(1):void 0;return i&&m.some(e=>e.name===i)?i:n||m[0]?.name});a.useEffect(()=>{let e=typeof r==`function`?r():r;e&&e!==h&&g(e)},[r,h]),a.useEffect(()=>{if(r)return;let e=()=>{let e=window.location.hash,t=e?e.substring(1):void 0;t&&m.some(e=>e.name===t)?g(t):!e&&n&&g(n)};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[r,m,n]);let _=a.useCallback(e=>{if(!(e!==h&&p&&!p(e,h))){if(g(e),f&&!r){let t=window.history.state,n=`${window.location.pathname+window.location.search}#${e}`;window.history.pushState(t,``,n)}l&&l(e)}},[r,l,f,p,h]),v=a.useCallback(e=>{_(e)},[_]);return t(ZO.Provider,{value:{tabs:m,size:o?m.length:0,current:h,setTab:v,responsive:u,variant:d,updateHash:f,canChangeTab:p},children:t(qO,{defaultValue:h||m[0]?.name,value:h,onValueChange:_,className:z(`flex-1 flex flex-col min-h-0 px-2`,s&&`h-full`,i),children:c})})},$O=({className:r,sticky:i,direction:o})=>{let{tabs:s,size:c,current:l,setTab:u,responsive:d,variant:f,updateHash:p,canChangeTab:m}=a.useContext(ZO),h=c!==0,g=a.useCallback(e=>{if(!s||!u||e!==l&&m&&!m(e,l))return;let t=s.find(t=>t.name===e);if(t?.href&&p){let e=window.history.state;window.history.pushState(e,``,t.href)}u(e)},[s,u,p,m,l]);return!s||!u?(console.warn(`TabsBar: No tabs provided or setTab not available`),null):n(e,{children:[d&&t(`div`,{className:`px-2 block lg:hidden`,children:t(JT,{label:`Tab`,className:z(i&&`sticky top-0 bg-background z-10`,r),options:s,optionLabel:e=>typeof e.label==`string`?e.label:String(e.label),value:s.find(e=>e.name===l),onChange:e=>{g(e.name)}})}),t(tk,{size:c,variant:f,className:z(h?`w-full`:``,i&&`sticky top-0 bg-background z-10`,o===`vertical`?`flex-col items-start`:`flex-row`,d?`hidden lg:flex`:``,r),children:s.map(e=>t(nk,{className:z(o===`vertical`?`w-full text-start`:``),value:e.name,disabled:e.disabled,href:e.href,variant:f,onClick:()=>g(e.name),children:e.label},e.name))})]})},ek=({className:n})=>{let{tabs:r}=a.useContext(ZO);return r?t(e,{children:r.map(e=>t(rk,{value:e.name,className:n,children:e.content},e.name))}):null},tk=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(ZO.Provider,{value:{size:n,variant:r},children:t(JO,{ref:a,className:z(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));tk.displayName=JO.displayName;const nk=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(ZO),c=a.useCallback(e=>{if(n){e.preventDefault();let t=window.history.state;window.history.pushState(t,``,n)}i.onClick&&i.onClick(e)},[n,i.onClick]);return t(YO,{ref:o,className:z(r===`tabs`?z(`border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer`,`border-transparent text-muted-foreground hover:border-border hover:text-foreground`,`data-[state=active]:border-primary data-[state=active]:text-primary`,`disabled:pointer-events-none disabled:opacity-50`):z(`px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors`,`tborder border-input bg-muted shadow-xs hover:bg-muted ring-inset`,`data-[state=active]:bg-primary data-[state=active]:text-white data-[state=active]:shadow-sm`,`disabled:pointer-events-none disabled:opacity-50`),e,s?`w-1/${s}`:``),onClick:c,...i})});nk.displayName=YO.displayName;const rk=a.forwardRef(({className:e,...n},r)=>t(XO,{ref:r,className:z(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));rk.displayName=XO.displayName;const ik=A(`text-foreground`,{variants:{size:{xl:`text-base md:text-lg leading-relaxed`,lg:`text-base leading-relaxed`,default:`text-sm leading-normal`,sm:`text-sm leading-normal`,xs:`text-xs leading-normal`},weight:{normal:`font-normal`,medium:`font-medium`,semibold:`font-semibold`}},defaultVariants:{size:`default`,weight:`normal`}}),ak=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:z(ik({size:n,weight:r,className:e})),...i}));ak.displayName=`Text`;function ok({className:e,minLines:n,maxLines:r,value:i,...a}){let o=C(null),s=n!==void 0||r!==void 0,c=h(()=>{let e=o.current;if(!e)return;let t=getComputedStyle(e),i=parseFloat(t.lineHeight)||parseFloat(t.fontSize)*1.5,a=(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0),s=(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0),c=n??1,l=r??1/0,u=c*i+a+s,d=l===1/0?1/0:l*i+a+s;e.style.height=`auto`;let f=Math.min(Math.max(e.scrollHeight,u),d);e.style.height=`${f}px`,e.style.overflowY=d!==1/0&&e.scrollHeight>d?`auto`:`hidden`},[n,r]);return x(()=>{s&&c()}),t(`textarea`,{ref:o,"data-slot":`textarea`,value:i,className:z(`py-2 text-sm`,`flex w-full rounded-md border border-input bg-background ring-offset-background`,`placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,s&&`resize-none`,e),...a})}const sk=d({theme:`system`,setTheme:()=>null});function ck({children:e,defaultTheme:n=`system`,storageKey:r=`vite-ui-theme`,...i}){let[a,o]=w(()=>localStorage.getItem(r)||n);_(()=>{let e=window.document.documentElement;if(e.classList.remove(`light`,`dark`),a===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(a)},[a]);let s=h((e,t)=>{t?.persist!==!1&&localStorage.setItem(r,e),o(e)},[r]),c=S(()=>({theme:a,setTheme:s}),[s,a]);return t(sk.Provider,{...i,value:c,children:e})}const lk=()=>{let e=g(sk);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function uk({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(U,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function dk({label:e,className:r}={}){let{setTheme:i,theme:a}=lk(),{t:o}=k(),s=e===!1?!1:e??o(`theme.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center`:`flex items-center gap-1`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),n(`div`,{className:`flex gap-2`,children:[t(uk,{current:a,option:`system`,setTheme:i,icon:t(L,{}),alt:o(`theme.system`)}),t(uk,{current:a,option:`light`,setTheme:i,icon:t(Ye,{}),alt:o(`theme.light`)}),t(uk,{current:a,option:`dark`,setTheme:i,icon:t(Ge,{}),alt:o(`theme.dark`)})]})]})}function fk(e,n){return{label:String(e),check:t(n?Me:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-accent nowrap`}}function pk({value:e,options:i,onChange:a,className:o,optionLayout:s,by:c,noCheck:l,filterBy:u}){let{t:d}=k(),[f,p]=w(e),[m,h]=w(``),g=e=>{p(e),a(e)},_=S(()=>typeof c==`string`?(e,t)=>e[c]===t[c]:c||((e,t)=>e===t),[c]);return n(`div`,{className:r(``,o),children:[u&&t(MT,{type:`text`,placeholder:d(`form.filter`),value:m,onChange:e=>h(e)}),i.map((e,n)=>{if(u&&!u(m)(e))return null;let r=f?_(f,e):!1,i;return s?(i=s(e,r),i=Object.assign(fk(e,r),i)):i=fk(e,r),t(mk,{option:e,onSelect:g,layout:i,noCheck:l},`option-${n}`)})]})}function mk({option:e,onSelect:i,layout:a,noCheck:o}){return n(U,{variant:`unstyled`,size:`none`,className:r(`group !flex w-full items-center cursor-pointer gap-x-2 hover:bg-muted`,a.reverse&&`flex-row-reverse`,a.className),onClick:()=>i(e),children:[o?null:t(`div`,{className:``,children:a.check}),t(`div`,{className:`flex-1`,children:a.label})]})}function hk({isOpen:e,title:r,onClose:i,children:a,panelWidth:o=768,backdrop:s=!1,side:c=`right`,resizable:l=!0,className:u,contentClassName:d}){let[f,p]=w(o),m=e=>{e.preventDefault();let t=!0,n=e.pageX,r=f,i=e=>{if(t){let t=n-e.pageX,i=Math.max(r+t,480);p(i)}},a=()=>{t=!1,document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a)};document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)},h=c===`left`,g=h?`left-0`:`right-0`,_=h?`pr-10 sm:pr-16`:`pl-10 sm:pl-16`,v=h?`border-r`:`border-l`,y=h?`-right-1`:`-left-1`,b=h?`-100%`:`100%`;return t(Tp,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(vh.div,{className:`fixed inset-0 bg-black/70`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:i}),t(`div`,{className:`fixed inset-y-0 ${g} overflow-hidden`,children:t(`div`,{className:`absolute inset-0 overflow-hidden`,children:t(`div`,{className:`pointer-events-none fixed inset-y-0 ${g} flex max-w-full ${_}`,children:t(vh.div,{className:`pointer-events-auto ${v}`,style:{width:`${f}px`},initial:{x:b},animate:{x:0},exit:{x:b},transition:{type:`spring`,stiffness:300,damping:30},children:n(`div`,{className:`relative flex h-full`,children:[l&&t(`div`,{"aria-label":`Resize panel`,className:`absolute ${y} top-0 bottom-0 w-3 z-25 cursor-ew-resize hover:bg-indigo-500 transition-colors flex items-center justify-center`,onMouseDown:m,children:t(We,{className:`rotate-90 font-semibold`,strokeWidth:4})}),n(`div`,{className:`flex-1 min-w-0 flex flex-col bg-background shadow-xl ${u}`,children:[r&&t(`div`,{className:`sticky top-0 z-10 bg-background px-2 sm:px-4 py-2 border-b`,children:n(`div`,{className:`flex items-start justify-between`,children:[t(`h2`,{className:`w-full text-base font-semibold leading-6`,children:t(`div`,{className:`text-2xl`,children:r??``})}),t(`div`,{className:`ms-3 flex h-7 items-center`,children:t(gk,{onClose:i})})]})}),t(`div`,{className:d??`flex-1 overflow-auto px-2 sm:px-4 py-4`,children:t(`div`,{className:`w-full h-full flex-1 flex flex-col`,children:a})})]})]})})})})})]})})}function gk({onClose:e}){return t(U,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(Ze,{className:`size-6`,"aria-hidden":`true`})})}function _k(e){switch(e){case`xs`:return`size-2`;case`sm`:return`size-3`;case`md`:return`size-4`;case`lg`:return`size-5`;case`xl`:return`size-7`;case`2xl`:return`size-10`;default:throw Error(`Unexpected size: ${e}`)}}function vk({size:e,className:i}){let a=_k(e||`md`);return n(`svg`,{className:r(`animate-[spin_0.8s_linear_infinite] text-indigo-500`,a,i),xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,role:`img`,"aria-label":`Loading`,children:[t(`title`,{children:`Loading`}),t(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),t(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}function yk({options:i,value:a,onChange:o,onOptionsChange:s,placeholder:c,className:l,disabled:u,layout:d=`horizontal`,creatable:f=!1,createText:p=`Create "%value%"`,maxDropdownHeight:m=200}){let h=g(vT),[v,y]=w(``),[b,x]=w(0),[S,T]=w(0),[E,D]=w(null),O=C(null),k=C(null),A=C(null),j=C(null),M=h?.open??!1,N=h?.setOpen??(()=>{});_(()=>{let e=k.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;T(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let P=i.filter(e=>!a.includes(e)&&e.toLowerCase().includes(v.toLowerCase())),ee=f&&v&&!a.includes(v)&&!i.includes(v),te=P.length+ +!!ee;_(()=>{v!==``&&D(null)},[v]),_(()=>{M&&b>=0&&j.current&&A.current&&j.current.scrollIntoView({block:`nearest`,behavior:`smooth`})},[b,M]),_(()=>{M?O.current?.focus():y(``)},[M]),_(()=>{if(!M)return;let e=e=>e instanceof Node&&(k.current?.contains(e)===!0||A.current?.contains(e)===!0),t=t=>{e(t.target)||N(!1)},n=t=>{e(t.target)||N(!1)},r=()=>{N(!1)};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`focusin`,n,!0),window.addEventListener(`blur`,r),document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`focusin`,n,!0),window.removeEventListener(`blur`,r),document.removeEventListener(`visibilitychange`,r)}},[M,N]);let F=e=>{o([...a,e]),y(``),N(!1),x(0),D(null)},ne=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),y(``),N(!1),x(0),D(null)},re=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),D(null)};return n(`div`,{className:r(`relative`,l),children:[t(xT,{asChild:!0,children:n(`div`,{ref:k,className:r(`min-h-[40px] w-full rounded-md border border-input bg-background px-3 py-2`,`flex items-center gap-1`,d===`horizontal`?`flex-wrap`:`flex-col items-stretch`,`cursor-text`,`ring-offset-background`,u&&`opacity-50 cursor-not-allowed`,M?`ring-1 ring-inset ring-ring`:``),onClick:()=>{u||O.current?.focus()},children:[d===`vertical`&&a.length>0&&t(`div`,{className:`flex flex-col gap-1 w-full`,children:a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center justify-between gap-2 px-2 py-1 text-sm bg-primary/20 text-foreground ring-1 ring-primary/30 rounded-md w-full transition-all`,E===i&&`ring-2 ring-red-300 shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[t(`span`,{className:`truncate`,children:e}),t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-primary/30 rounded-sm transition-colors flex-shrink-0`,children:t(Ze,{className:`h-3 w-3`})})]},e))}),d===`horizontal`&&a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center gap-1 px-2 py-1 text-sm bg-primary/20 text-foreground ring-1 ring-primary/30 rounded-md transition-all`,E===i&&`ring-2 ring-red-300 shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[e,t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-primary/30 rounded-sm transition-colors`,children:t(Ze,{className:`h-3 w-3`})})]},e)),t(`input`,{ref:O,type:`text`,value:v,onChange:e=>{y(e.target.value),x(0)},onKeyDown:e=>{if(e.key===`Enter`&&M&&te>0){e.preventDefault(),e.stopPropagation(),b===P.length&&ee?ne(v):b<P.length&&F(P[b]);return}if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),M?x(e=>e<te-1?e+1:e):N(!0);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),M?x(e=>e>0?e-1:0):N(!0);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),N(!1);return}if(e.key===`Backspace`&&v===``&&a.length>0){e.stopPropagation();let t=a.length-1;E===t?(o(a.slice(0,-1)),D(null)):D(t);return}!M&&e.key.length===1&&N(!0)},onClick:e=>{e.stopPropagation(),u||N(!0)},onFocus:()=>{u||N(!0)},disabled:u,placeholder:a.length===0?c:``,className:r(`flex-1 min-w-[120px] bg-transparent text-sm`,`placeholder:text-muted-foreground`,`border-none outline-none focus:outline-none focus:ring-0 p-0 m-0`,d===`vertical`&&`w-full`)})]})}),t(CT,{style:{width:`${S}px`},className:`p-0 bg-popover border border-border shadow-lg`,align:`start`,side:`bottom`,onOpenAutoFocus:e=>{e.preventDefault()},children:t(`div`,{ref:A,className:`overflow-y-auto`,style:{maxHeight:`${m}px`},children:P.length===0&&!ee?t(`div`,{className:`px-3 py-2 text-sm text-muted-foreground`,children:v?`No options found`:`No more options available`}):n(e,{children:[P.length>0&&t(`ul`,{className:`py-1`,children:P.map((e,n)=>t(`li`,{ref:e=>{n===b&&(j.current=e)},role:`option`,"aria-selected":n===b,tabIndex:0,onClick:()=>F(e),onKeyDown:Bi(()=>F(e)),onMouseEnter:()=>x(n),className:r(`px-3 py-2 text-sm cursor-pointer transition-colors`,n===b?`bg-blue-500/20 text-foreground`:`hover:bg-accent/50`),children:e},e))}),ee&&n(e,{children:[P.length>0&&t(`div`,{className:`border-t border-border`}),t(U,{ref:e=>{b===P.length&&(j.current=e)},variant:`unstyled`,size:`none`,onClick:()=>ne(v),onMouseEnter:()=>x(P.length),className:r(`!flex w-full justify-start px-3 py-2 text-sm cursor-pointer transition-colors text-primary`,b===P.length?`bg-blue-500/20`:`hover:bg-accent/50`),children:p.replace(`%value%`,v)})]})]})})})]})}function bk(e){return t(yT,{click:!0,children:t(yk,{...e})})}function xk({className:e,children:n,...i}){return t(`table`,{className:r(`
90
285
  divide-y divide-border
91
286
  [&>tbody]:divide-y [&>tbody]:divide-border
92
287
  [&_th]:text-start [&_th]:px-3 [&_th]:py-3.5 [&_th]:text-sm [&_th]:font-normal [&_th]:text-muted-foreground
93
288
  [&_td]:px-3 [&_td]:py-4 [&_td]:text-sm
94
- `,e),...i,children:n})}function Yi({children:e}){return t(`thead`,{className:`sticky top-0 bg-background z-10 after:absolute after:bottom-0 after:start-0 after:w-full after:h-px after:bg-muted/20`,children:e})}function Xi({columns:e}){return t(`tr`,{className:`hover:bg-muted`,children:Array(e).fill(0).map((e,n)=>t(`td`,{children:t(`div`,{className:`animate-pulse rounded-xs h-5 bg-muted`})},`skeleton-cell-${n}`))})}function Zi({isLoading:e=!1,columns:n,rows:r=3,children:i}){let a=Array.from({length:r},(e,t)=>`skeleton-row-${t}`);return t(`tbody`,{children:e?a.map(e=>t(Xi,{columns:n},e)):i})}function Qi({className:e,children:n,...i}){return t(`tr`,{className:r(`hover:bg-muted hover:cursor-pointer`,e),...i,children:n})}function $i({scope:e=`col`,children:n,...r}){return t(`th`,{scope:e,...r,children:n})}function ea({sortDirection:e=`none`,onSort:r,sortIndicator:i,disabled:a=!1,children:o,className:s,scope:c=`col`,...l}){return t(`th`,{scope:c,"aria-sort":e,className:s,...l,children:a?n(`span`,{className:`inline-flex items-center gap-1`,children:[o,i?.(e)]}):n(`button`,{type:`button`,onClick:r,className:`inline-flex items-center gap-1 bg-transparent border-0 p-0 m-0 text-inherit font-inherit cursor-pointer hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded-sm`,children:[o,i?.(e)]})})}var ta=class{_value;watchers=[];name;constructor(e,t){this._value=e,this.name=t}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}};function na(e){let t=N.createContext(void 0);return e.Context=t,t.Provider}var ra=class{consume=void 0;_current;constructor(e){this._current=e}set current(e){e!==this._current&&(this._current=e,this.consume?.(e))}get current(){return this._current}withConsumer(e){return this.consume=e,e?.(this.current),this}};function ia(e){let t=e.Context;if(!t)throw Error(`Context not defined for ${e.name}`);return ce(t)}function aa(e){let[t,n]=L(e.value);return F(()=>e.watch(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function oa(e,t){return F(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function sa(e,t){F(()=>e.watch(t),[e,t])}function ca(e){let[t,n]=L(e.current);return F(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function la(e,t){F(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function ua(e,t){F(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}var da=class{compute;_value;watchers=[];unsubscribers=[];name;constructor(e,t,n){this.compute=e,this.name=n,this.recalculate();for(let e of t)this.unsubscribers.push(e.watch(()=>this.recalculate()))}recalculate(){let e=this.compute();if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}get value(){return this._value}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}dispose(){for(let e of this.unsubscribers)e();this.watchers=[]}},fa=class{_value;watchers=[];constructor(e){this._value=e}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}addWatcher(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}};function pa(e){let[t,n]=L(e.value);return F(()=>e.addWatcher(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function ma(e,t){let n=I(null);return F(()=>{let r=r=>{n.current&&!n.current.contains(r.target)&&(t?.(r)||e(r))},i=window.setTimeout(()=>{document.addEventListener(`click`,r)},0);return()=>{window.clearTimeout(i),document.removeEventListener(`click`,r)}},[e,t]),n}function ha(){let[e,t]=L(null);return[e,async e=>{if(!navigator?.clipboard)return console.warn(`Clipboard not supported`),!1;try{return await navigator.clipboard.writeText(e),t(e),!0}catch(e){return console.warn(`Copy failed`,e),t(null),!1}}]}function ga(e){F(()=>{let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=t=>e(t.matches);return t.addEventListener(`change`,n),e(t.matches),()=>t.removeEventListener(`change`,n)},[e])}function _a(e,t){let[n,r]=L(e);return F(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function va(e,t,n){let r=[],i=new EventSource(e);return i.addEventListener(`message`,e=>{let n=JSON.parse(e.data);n&&(r.push(n),t(r.join(``)))}),i.addEventListener(`close`,e=>{i.close(),n(JSON.parse(e.data))}),()=>{i.close()}}function ya(e,t,n){let r=I(t),i=I(n);r.current=t,i.current=n,F(()=>{let t,n=!1,a=e=>r.current(e),o=e=>i.current(e);return typeof e==`function`?e().then(e=>{n||(t=va(e,a,o))}):t=va(e,a,o),()=>{n=!0,t?.()}},[e])}function ba(e){return e instanceof Error?e:Error(String(e))}function xa(e,t){Array.isArray(t)&&(t={deps:t});let n=t||{},[r,i]=L(void 0),[a,o]=L(!1),[s,c]=L(n.defaultValue),l=I(e);l.current=e;let u=I(n);u.current=n;let d=P(()=>{let e=u.current;return e.start?.(),o(!0),l.current().then(t=>{c(t),e.onSuccess?.(t)}).catch(t=>{let n=ba(t);i(n),e.onError?.(n)}).finally(()=>{o(!1),e.end?.()})},[]);return F(()=>{let e=u.current;(!e.condition||e.condition())&&d()},[d,...n.deps??[]]),{data:s,isLoading:a,error:r,setData:c,refetch:d}}function Sa(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),xa(e,t)}function Ca(e=!1){let[t,n]=L(e);return{isOn:t,isOff:!t,set:e=>n(e),on:()=>n(!0),off:()=>n(!1),toggle:()=>n(!t)}}function wa(e,t,n={}){let r=I(t);r.current=t;let i=I(n);i.current=n;let a=n.threshold||1;F(()=>{let t=e.current,n=new IntersectionObserver(e=>{let t=e[0].isIntersecting;i.current.leave?t||r.current(e[0]):t&&r.current(e[0])},{threshold:a});return t&&n.observe(t),()=>{t&&n.unobserve(t)}},[e,a,...n.deps??[]])}function Ta(){let e=I(!0);return F(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const Ea=typeof window<`u`?ue:F;function Da(e,t=[]){let n=e.pageSize||50,[r,i]=L(null),[a,o]=L(e.payload),[s,c]=L(null),[l,u]=L([]),[d,f]=L(null),[p,m]=L(!1),[h,g]=L(0),_=I(0),v=I(e.search);v.current=e.search;let y=e=>{i(null),u([]),f(null),o(e),g(e=>e+1)},b=()=>{d!==null&&i(d)};return F(()=>{_.current+=1;let e=_.current;m(!0),v.current(a,r,n).then(t=>{e===_.current&&(u(r===null?t.result:e=>[...e,...t.result]),f(t.nextPage),c(null))}).catch(t=>{e===_.current&&c(t)}).finally(()=>{e===_.current&&m(!1)})},[...t,a,h,r,n]),wa(e.nextPageTrigger,()=>{!p&&d&&b()},{threshold:.1,deps:[d,p]}),{search:y,refresh:()=>y(a),searchMore:b,result:l,page:r,hasMore:d!==null,error:s,isSearching:p}}function Oa(e,t=[]){return Da({...e,async search(t,n,r){let i=n??0,a=i*r,o=await e.search(t,a,r);return{result:o,nextPage:o.length===0?null:i+1}}},t)}var ka=class{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}};function Aa(e){return new ka(L(e))}function ja(...e){return ge(i(e))}function Ma(e){return typeof e==`object`&&!!e&&`message`in e}function Na(e,t=`An error occurred`){return e instanceof Error?e.message:typeof e==`string`?e:Ma(e)&&typeof e.message==`string`?e.message:t}function Pa(e,t){let n=e.selectionStart,r=e.selectionEnd,i=e.value,a=`${i.slice(0,n)}\n${i.slice(r)}`;t?.(a),requestAnimationFrame(()=>{e.selectionStart=e.selectionEnd=n+1})}export{mr as AnimateChangeInHeight,Fe as Avatar,Ut as Badge,on as Breadcrumbs,K as Button,hn as Card,yn as CardContent,vn as CardDescription,bn as CardFooter,gn as CardHeader,_n as CardTitle,Le as Center,xn as Checkbox,Sn as Collapsible,wn as CollapsibleContent,Cn as CollapsibleTrigger,it as ComboBox,Vn as Command,Hn as CommandDialog,Gn as CommandEmpty,q as CommandGroup,Un as CommandInput,J as CommandItem,Wn as CommandList,Kn as CommandSeparator,qn as CommandShortcut,da as ComputedProperty,$r as ConfirmModal,Dt as CopyButton,Ze as DOMPopup,xr as DateCombobox,Qr as DefaultBox,oi as DeleteModal,Nn as Dialog,In as DialogClose,Rn as DialogContent,zn as DialogDescription,Ln as DialogOverlay,Fn as DialogPortal,Bn as DialogTitle,Pn as DialogTrigger,pt as Divider,Kt as DotBadge,Nt as DropZone,dr as Dropdown,Yn as DropdownMenu,tr as DropdownMenuCheckboxItem,Qn as DropdownMenuContent,$n as DropdownMenuGroup,er as DropdownMenuItem,ir as DropdownMenuLabel,Xn as DropdownMenuPortal,nr as DropdownMenuRadioGroup,rr as DropdownMenuRadioItem,ar as DropdownMenuSeparator,or as DropdownMenuShortcut,sr as DropdownMenuSub,lr as DropdownMenuSubContent,cr as DropdownMenuSubTrigger,Zn as DropdownMenuTrigger,Ot as EmptyCollection,Jr as ErrorBox,Mt as FileUploadInput,Ir as FilterBar,Fr as FilterBtn,Lr as FilterClear,zr as FilterOperator,Pr as FilterProvider,Bt as FormItem,Br as Heading,Yr as InfoBox,$ as Input,qt as InputList,Kr as Label,Wr as LanguageSwitcher,Jt as Link,fr as MenuGroup,pr as MenuItem,Yt as MenuList,qr as MessageBox,kn as Modal,jn as ModalBody,On as ModalContextProvider,Mn as ModalFooter,An as ModalTitle,Li as ModeOption,Ri as ModeToggle,$t as NumberInput,si as OVERFLOW_TAB_GAP_PX,et as OptionAdapter,ui as OverflowMoreMenu,di as OverflowTabsBar,en as Overlay,fi as Panel,X as Popover,_r as PopoverAnchor,vr as PopoverClose,Q as PopoverContent,hr as PopoverContext,Z as PopoverTrigger,Qe as Popup,Je as PopupController,an as Portal,mt as PortalContainerContext,gt as PortalContainerProvider,ta as Property,hi as RadioGroup,mi as RadioGroupAdapter,pi as RadioGroupItem,yi as ResizableHandle,vi as ResizablePanel,gi as ResizablePanelGroup,Xi as RowSkeleton,Vr as SelectBox,Bi as SelectList,Cr as SelectionCombobox,bi as Separator,fa as SharedState,ka as SharedValue,Hi as SidePanel,ft as SimpleCombobox,xi as Slider,ra as Slot,ea as SortableTableHeaderCell,Gi as Spinner,wr as StringListCombobox,tt as StringOptionAdapter,nt as StringOptionAdapterWithCreate,Zt as Styles,Zr as SuccessBox,Ie as SvgAvatar,Ci as Switch,Zi as TBody,Yi as THead,Qi as TR,Ji as Table,$i as TableHeaderCell,Ti as Tabs,Ei as TabsBar,Ai as TabsContent,Oi as TabsList,Di as TabsPanel,ki as TabsTrigger,qi as TagsInput,Mi as Text,Er as TextCombobox,Ni as Textarea,Fi as ThemeProvider,Pi as ThemeProviderContext,ti as ToastContext,ai as ToastProvider,yt as Tooltip,xt as TooltipContent,vt as TooltipProvider,bt as TooltipTrigger,St as VTooltip,Xr as WarningBox,Et as buttonVariants,ja as cn,Ue as computePosition,na as createCompositeStateProvider,Na as errorMessage,rt as getDefaultComboBoxLayout,Pa as insertNewlineAtCursor,Vt as onActivateKey,ma as useClickOutside,ct as useComboboxCtrl,ia as useCompositeState,ha as useCopyToClipboard,ga as useDarkMode,_a as useDebounce,Oa as useDefaultScrollableSearch,ua as useDefineSlot,Lt as useDropZone,ya as useEventSource,xa as useFetch,Sa as useFetchOnce,Ca as useFlag,aa as useGetCompositeStateProperty,wa as useIntersectionObserver,Ta as useIsFirstRendering,Dn as useIsInModal,li as useOverflowTabs,yr as usePopoverContext,Xe as usePopupController,_t as usePortalContainer,Ea as useSafeLayoutEffect,Da as useScrollableSearch,oa as useSetCompositeStateProperty,Aa as useSharedValue,ca as useSlot,Ii as useTheme,ei as useToast,sa as useWatchCompositeStateProperty,pa as useWatchSharedState,la as useWatchSlot};
289
+ `,e),...i,children:n})}function Sk({children:e}){return t(`thead`,{className:`sticky top-0 bg-background z-10 after:absolute after:bottom-0 after:start-0 after:w-full after:h-px after:bg-muted/20`,children:e})}function Ck({columns:e}){return t(`tr`,{className:`hover:bg-muted`,children:Array(e).fill(0).map((e,n)=>t(`td`,{children:t(`div`,{className:`animate-pulse rounded-xs h-5 bg-muted`})},`skeleton-cell-${n}`))})}function wk({isLoading:e=!1,columns:n,rows:r=3,children:i}){let a=Array.from({length:r},(e,t)=>`skeleton-row-${t}`);return t(`tbody`,{children:e?a.map(e=>t(Ck,{columns:n},e)):i})}function Tk({className:e,children:n,...i}){return t(`tr`,{className:r(`hover:bg-muted hover:cursor-pointer`,e),...i,children:n})}function Ek({scope:e=`col`,children:n,...r}){return t(`th`,{scope:e,...r,children:n})}function Dk({sortDirection:e=`none`,onSort:r,sortIndicator:i,disabled:a=!1,children:o,className:s,scope:c=`col`,...l}){return t(`th`,{scope:c,"aria-sort":e,className:s,...l,children:a?n(`span`,{className:`inline-flex items-center gap-1`,children:[o,i?.(e)]}):n(`button`,{type:`button`,onClick:r,className:`inline-flex items-center gap-1 bg-transparent border-0 p-0 m-0 text-inherit font-inherit cursor-pointer hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded-sm`,children:[o,i?.(e)]})})}var Ok=class{_value;watchers=[];name;constructor(e,t){this._value=e,this.name=t}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}};function kk(e){let t=o.createContext(void 0);return e.Context=t,t.Provider}var Ak=class{consume=void 0;_current;constructor(e){this._current=e}set current(e){e!==this._current&&(this._current=e,this.consume?.(e))}get current(){return this._current}withConsumer(e){return this.consume=e,e?.(this.current),this}};function jk(e){let t=e.Context;if(!t)throw Error(`Context not defined for ${e.name}`);return g(t)}function Mk(e){let[t,n]=w(e.value);return _(()=>e.watch(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function Nk(e,t){return _(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function Pk(e,t){_(()=>e.watch(t),[e,t])}function Fk(e){let[t,n]=w(e.current);return _(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function Ik(e,t){_(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function Lk(e,t){_(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}var Rk=class{compute;_value;watchers=[];unsubscribers=[];name;constructor(e,t,n){this.compute=e,this.name=n,this.recalculate();for(let e of t)this.unsubscribers.push(e.watch(()=>this.recalculate()))}recalculate(){let e=this.compute();if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}get value(){return this._value}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}dispose(){for(let e of this.unsubscribers)e();this.watchers=[]}},zk=class{_value;watchers=[];constructor(e){this._value=e}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}addWatcher(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}};function Bk(e){let[t,n]=w(e.value);return _(()=>e.addWatcher(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function Vk(e,t){let n=C(null);return _(()=>{let r=r=>{n.current&&!n.current.contains(r.target)&&(t?.(r)||e(r))},i=window.setTimeout(()=>{document.addEventListener(`click`,r)},0);return()=>{window.clearTimeout(i),document.removeEventListener(`click`,r)}},[e,t]),n}function Hk(){let[e,t]=w(null);return[e,async e=>{if(!navigator?.clipboard)return console.warn(`Clipboard not supported`),!1;try{return await navigator.clipboard.writeText(e),t(e),!0}catch(e){return console.warn(`Copy failed`,e),t(null),!1}}]}function Uk(e){_(()=>{let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=t=>e(t.matches);return t.addEventListener(`change`,n),e(t.matches),()=>t.removeEventListener(`change`,n)},[e])}function Wk(e,t){let[n,r]=w(e);return _(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function Gk(e,t,n){let r=[],i=new EventSource(e);return i.addEventListener(`message`,e=>{let n=JSON.parse(e.data);n&&(r.push(n),t(r.join(``)))}),i.addEventListener(`close`,e=>{i.close(),n(JSON.parse(e.data))}),()=>{i.close()}}function Kk(e,t,n){let r=C(t),i=C(n);r.current=t,i.current=n,_(()=>{let t,n=!1,a=e=>r.current(e),o=e=>i.current(e);return typeof e==`function`?e().then(e=>{n||(t=Gk(e,a,o))}):t=Gk(e,a,o),()=>{n=!0,t?.()}},[e])}function qk(e){return e instanceof Error?e:Error(String(e))}function Jk(e,t){Array.isArray(t)&&(t={deps:t});let n=t||{},[r,i]=w(void 0),[a,o]=w(!1),[s,c]=w(n.defaultValue),l=C(e);l.current=e;let u=C(n);u.current=n;let d=h(()=>{let e=u.current;return e.start?.(),o(!0),l.current().then(t=>{c(t),e.onSuccess?.(t)}).catch(t=>{let n=qk(t);i(n),e.onError?.(n)}).finally(()=>{o(!1),e.end?.()})},[]);return _(()=>{let e=u.current;(!e.condition||e.condition())&&d()},[d,...n.deps??[]]),{data:s,isLoading:a,error:r,setData:c,refetch:d}}function Yk(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),Jk(e,t)}function Xk(e=!1){let[t,n]=w(e);return{isOn:t,isOff:!t,set:e=>n(e),on:()=>n(!0),off:()=>n(!1),toggle:()=>n(!t)}}function Zk(e,t,n={}){let r=C(t);r.current=t;let i=C(n);i.current=n;let a=n.threshold||1;_(()=>{let t=e.current,n=new IntersectionObserver(e=>{let t=e[0].isIntersecting;i.current.leave?t||r.current(e[0]):t&&r.current(e[0])},{threshold:a});return t&&n.observe(t),()=>{t&&n.unobserve(t)}},[e,a,...n.deps??[]])}function Qk(){let e=C(!0);return _(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const $k=typeof window<`u`?x:_;function eA(e,t=[]){let n=e.pageSize||50,[r,i]=w(null),[a,o]=w(e.payload),[s,c]=w(null),[l,u]=w([]),[d,f]=w(null),[p,m]=w(!1),[h,g]=w(0),v=C(0),y=C(e.search);y.current=e.search;let b=e=>{i(null),u([]),f(null),o(e),g(e=>e+1)},x=()=>{d!==null&&i(d)};return _(()=>{v.current+=1;let e=v.current;m(!0),y.current(a,r,n).then(t=>{e===v.current&&(u(r===null?t.result:e=>[...e,...t.result]),f(t.nextPage),c(null))}).catch(t=>{e===v.current&&c(t)}).finally(()=>{e===v.current&&m(!1)})},[...t,a,h,r,n]),Zk(e.nextPageTrigger,()=>{!p&&d&&x()},{threshold:.1,deps:[d,p]}),{search:b,refresh:()=>b(a),searchMore:x,result:l,page:r,hasMore:d!==null,error:s,isSearching:p}}function tA(e,t=[]){return eA({...e,async search(t,n,r){let i=n??0,a=i*r,o=await e.search(t,a,r);return{result:o,nextPage:o.length===0?null:i+1}}},t)}var nA=class{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}};function rA(e){return new nA(w(e))}function iA(...e){return j(i(e))}function aA(e){return typeof e==`object`&&!!e&&`message`in e}function oA(e,t=`An error occurred`){return e instanceof Error?e.message:typeof e==`string`?e:aA(e)&&typeof e.message==`string`?e.message:t}function sA(e,t){let n=e.selectionStart,r=e.selectionEnd,i=e.value,a=`${i.slice(0,n)}\n${i.slice(r)}`;t?.(a),requestAnimationFrame(()=>{e.selectionStart=e.selectionEnd=n+1})}export{Wx as AnimateChangeInHeight,be as Avatar,Hi as Badge,wh as Breadcrumbs,U as Button,Nh as Card,Lh as CardContent,Ih as CardDescription,Rh as CardFooter,Ph as CardHeader,Fh as CardTitle,Se as Center,rg as Checkbox,xg as Collapsible,Cg as CollapsibleContent,Sg as CollapsibleTrigger,vt as ComboBox,dv as Command,fv as CommandDialog,hv as CommandEmpty,gv as CommandGroup,pv as CommandInput,vv as CommandItem,mv as CommandList,_v as CommandSeparator,yv as CommandShortcut,Rk as ComputedProperty,cE as ConfirmModal,Ti as CopyButton,dt as DOMPopup,DT as DateCombobox,sE as DefaultBox,hE as DeleteModal,rv as Dialog,ov as DialogClose,cv as DialogContent,lv as DialogDescription,sv as DialogOverlay,av as DialogPortal,uv as DialogTitle,iv as DialogTrigger,Dt as Divider,Gi as DotBadge,ji as DropZone,Vx as Dropdown,Tx as DropdownMenu,jx as DropdownMenuCheckboxItem,Ox as DropdownMenuContent,kx as DropdownMenuGroup,Ax as DropdownMenuItem,Px as DropdownMenuLabel,Ex as DropdownMenuPortal,Mx as DropdownMenuRadioGroup,Nx as DropdownMenuRadioItem,Fx as DropdownMenuSeparator,Ix as DropdownMenuShortcut,Lx as DropdownMenuSub,zx as DropdownMenuSubContent,Rx as DropdownMenuSubTrigger,Dx as DropdownMenuTrigger,Ei as EmptyCollection,rE as ErrorBox,Ai as FileUploadInput,UT as FilterBar,HT as FilterBtn,WT as FilterClear,KT as FilterOperator,VT as FilterProvider,zi as FormItem,qT as Heading,iE as InfoBox,Ii as InfoTip,MT as Input,Ki as InputList,tE as Label,ZT as LanguageSwitcher,qi as Link,Hx as MenuGroup,Ux as MenuItem,Ji as MenuList,nE as MessageBox,$_ as Modal,tv as ModalBody,Q_ as ModalContextProvider,nv as ModalFooter,ev as ModalTitle,uk as ModeOption,dk as ModeToggle,Qi as NumberInput,gE as OVERFLOW_TAB_GAP_PX,mt as OptionAdapter,yE as OverflowMoreMenu,bE as OverflowTabsBar,yh as Overlay,xE as Panel,yT as Popover,ST as PopoverAnchor,wT as PopoverClose,CT as PopoverContent,vT as PopoverContext,xT as PopoverTrigger,ft as Popup,ct as PopupController,Ch as Portal,fi as PortalContainerContext,mi as PortalContainerProvider,Ok as Property,nD as RadioGroup,tD as RadioGroupAdapter,eD as RadioGroupItem,oD as ResizableHandle,aD as ResizablePanel,rD as ResizablePanelGroup,Ck as RowSkeleton,JT as SelectBox,pk as SelectList,kT as SelectionCombobox,mD as Separator,zk as SharedState,nA as SharedValue,hk as SidePanel,Et as SimpleCombobox,uO as Slider,Ak as Slot,Dk as SortableTableHeaderCell,vk as Spinner,AT as StringListCombobox,ht as StringOptionAdapter,gt as StringOptionAdapterWithCreate,Xi as Styles,oE as SuccessBox,xe as SvgAvatar,kO as Switch,wk as TBody,Sk as THead,Tk as TR,xk as Table,Ek as TableHeaderCell,QO as Tabs,$O as TabsBar,rk as TabsContent,tk as TabsList,ek as TabsPanel,nk as TabsTrigger,bk as TagsInput,ak as Text,NT as TextCombobox,ok as Textarea,ck as ThemeProvider,sk as ThemeProviderContext,uE as ToastContext,mE as ToastProvider,_i as Tooltip,yi as TooltipContent,gi as TooltipProvider,vi as TooltipTrigger,bi as VTooltip,aE as WarningBox,wi as buttonVariants,iA as cn,rt as computePosition,kk as createCompositeStateProvider,oA as errorMessage,_t as getDefaultComboBoxLayout,sA as insertNewlineAtCursor,Bi as onActivateKey,Vk as useClickOutside,St as useComboboxCtrl,jk as useCompositeState,Hk as useCopyToClipboard,Uk as useDarkMode,Wk as useDebounce,tA as useDefaultScrollableSearch,Lk as useDefineSlot,Fi as useDropZone,Kk as useEventSource,Jk as useFetch,Yk as useFetchOnce,Xk as useFlag,Mk as useGetCompositeStateProperty,Zk as useIntersectionObserver,Qk as useIsFirstRendering,Z_ as useIsInModal,vE as useOverflowTabs,TT as usePopoverContext,ut as usePopupController,hi as usePortalContainer,$k as useSafeLayoutEffect,eA as useScrollableSearch,Nk as useSetCompositeStateProperty,rA as useSharedValue,Fk as useSlot,lk as useTheme,lE as useToast,Pk as useWatchCompositeStateProperty,Bk as useWatchSharedState,Ik as useWatchSlot};
95
290
  //# sourceMappingURL=vertesia-ui-core.js.map