@matthiaskrijgsman/mat-ui 0.0.4 → 0.0.5

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.
@@ -125,5 +125,5 @@ React keys must be passed directly to JSX without using spread:
125
125
  `,...r,children:i&&i.map((a,l)=>h.jsx("option",{value:a.value,disabled:a.disabled,children:a.label},l))}),h.jsxs(Bt,{children:[o&&h.jsx(Ft,{}),h.jsx(St,{Icon:qe})]})]}),h.jsx(ht,{children:s}),h.jsx(mt,{children:o})]})},Ee=t=>{const{children:e,onClick:n,selected:s,disabled:i=!1}=t;return h.jsxs("div",{onClick:()=>!i&&n&&n(),className:V("hover:bg-gray-100 active:bg-gray-200 px-4 py-2 rounded-xl cursor-pointer transition-all duration-150 select-none flex flex-row gap-3 items-center",s&&!i&&"bg-blue-50 hover:bg-blue-100 active:bg-blue-100",i&&"text-gray-400 cursor-not-allowed hover:bg-transparent active:bg-transparent"),children:[h.jsx("div",{className:"flex-1",children:e}),s&&!i&&h.jsx("div",{className:"shrink-0",children:h.jsx(Rd,{className:"h-5 w-5"})})]})};function Ze(){return typeof window<"u"}function te(t){return Vs(t)?(t.nodeName||"").toLowerCase():"#document"}function tt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function pt(t){var e;return(e=(Vs(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Vs(t){return Ze()?t instanceof Node||t instanceof tt(t).Node:!1}function G(t){return Ze()?t instanceof Element||t instanceof tt(t).Element:!1}function gt(t){return Ze()?t instanceof HTMLElement||t instanceof tt(t).HTMLElement:!1}function ks(t){return!Ze()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof tt(t).ShadowRoot}const _d=new Set(["inline","contents"]);function Ae(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=lt(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&!_d.has(i)}const $d=new Set(["table","td","th"]);function Wd(t){return $d.has(te(t))}const Ud=[":popover-open",":modal"];function Je(t){return Ud.some(e=>{try{return t.matches(e)}catch{return!1}})}const zd=["transform","translate","scale","rotate","perspective"],Kd=["transform","translate","scale","rotate","perspective","filter"],Yd=["paint","layout","strict","content"];function Ns(t){const e=Os(),n=G(t)?lt(t):t;return zd.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Kd.some(s=>(n.willChange||"").includes(s))||Yd.some(s=>(n.contain||"").includes(s))}function Hd(t){let e=Rt(t);for(;gt(e)&&!ee(e);){if(Ns(e))return e;if(Je(e))return null;e=Rt(e)}return null}function Os(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Gd=new Set(["html","body","#document"]);function ee(t){return Gd.has(te(t))}function lt(t){return tt(t).getComputedStyle(t)}function Qe(t){return G(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Rt(t){if(te(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ks(t)&&t.host||pt(t);return ks(e)?e.host:e}function Zo(t){const e=Rt(t);return ee(e)?t.ownerDocument?t.ownerDocument.body:t.body:gt(e)&&Ae(e)?e:Zo(e)}function Re(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Zo(t),o=i===((s=t.ownerDocument)==null?void 0:s.body),r=tt(i);if(o){const a=Is(r);return e.concat(r,r.visualViewport||[],Ae(i)?i:[],a&&n?Re(a):[])}return e.concat(i,Re(i,[],n))}function Is(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const je=Math.min,rt=Math.max,tn=Math.round,en=Math.floor,yt=t=>({x:t,y:t});function Jo(t,e){return typeof t=="function"?t(e):t}function Ls(t){return t.split("-")[0]}function Qo(t){return t.split("-")[1]}function Xd(t){return t==="x"?"y":"x"}function qd(t){return t==="y"?"height":"width"}const Zd=new Set(["top","bottom"]);function Fs(t){return Zd.has(Ls(t))?"y":"x"}function Jd(t){return Xd(Fs(t))}function Qd(t){return{top:0,right:0,bottom:0,left:0,...t}}function th(t){return typeof t!="number"?Qd(t):{top:t,right:t,bottom:t,left:t}}function nn(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}/*!
126
126
  * tabbable 6.2.0
127
127
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
128
- */var eh=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Bs=eh.join(","),ta=typeof Element>"u",Me=ta?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,sn=!ta&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},rn=function t(e,n){var s;n===void 0&&(n=!0);var i=e==null||(s=e.getAttribute)===null||s===void 0?void 0:s.call(e,"inert"),o=i===""||i==="true",r=o||n&&e&&t(e.parentNode);return r},nh=function(e){var n,s=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return s===""||s==="true"},sh=function(e,n,s){if(rn(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(Bs));return n&&Me.call(e,Bs)&&i.unshift(e),i=i.filter(s),i},ih=function t(e,n,s){for(var i=[],o=Array.from(e);o.length;){var r=o.shift();if(!rn(r,!1))if(r.tagName==="SLOT"){var a=r.assignedElements(),l=a.length?a:r.children,u=t(l,!0,s);s.flatten?i.push.apply(i,u):i.push({scopeParent:r,candidates:u})}else{var c=Me.call(r,Bs);c&&s.filter(r)&&(n||!e.includes(r))&&i.push(r);var f=r.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(r),d=!rn(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(r));if(f&&d){var m=t(f===!0?r.children:f.children,!0,s);s.flatten?i.push.apply(i,m):i.push({scopeParent:r,candidates:m})}else o.unshift.apply(o,r.children)}}return i},ea=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},na=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||nh(e))&&!ea(e)?0:e.tabIndex},rh=function(e,n){var s=na(e);return s<0&&n&&!ea(e)?0:s},oh=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},sa=function(e){return e.tagName==="INPUT"},ah=function(e){return sa(e)&&e.type==="hidden"},lh=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(s){return s.tagName==="SUMMARY"});return n},ch=function(e,n){for(var s=0;s<e.length;s++)if(e[s].checked&&e[s].form===n)return e[s]},uh=function(e){if(!e.name)return!0;var n=e.form||sn(e),s=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=s(window.CSS.escape(e.name));else try{i=s(e.name)}catch(r){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",r.message),!1}var o=ch(i,e.form);return!o||o===e},fh=function(e){return sa(e)&&e.type==="radio"},dh=function(e){return fh(e)&&!uh(e)},hh=function(e){var n,s=e&&sn(e),i=(n=s)===null||n===void 0?void 0:n.host,o=!1;if(s&&s!==e){var r,a,l;for(o=!!((r=i)!==null&&r!==void 0&&(a=r.ownerDocument)!==null&&a!==void 0&&a.contains(i)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!o&&i;){var u,c,f;s=sn(i),i=(u=s)===null||u===void 0?void 0:u.host,o=!!((c=i)!==null&&c!==void 0&&(f=c.ownerDocument)!==null&&f!==void 0&&f.contains(i))}}return o},ia=function(e){var n=e.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},mh=function(e,n){var s=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var o=Me.call(e,"details>summary:first-of-type"),r=o?e.parentElement:e;if(Me.call(r,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="legacy-full"){if(typeof i=="function"){for(var a=e;e;){var l=e.parentElement,u=sn(e);if(l&&!l.shadowRoot&&i(l)===!0)return ia(e);e.assignedSlot?e=e.assignedSlot:!l&&u!==e.ownerDocument?e=u.host:e=l}e=a}if(hh(e))return!e.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return ia(e);return!1},ph=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var i=n.children.item(s);if(i.tagName==="LEGEND")return Me.call(n,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}n=n.parentElement}return!1},gh=function(e,n){return!(n.disabled||rn(n)||ah(n)||mh(n,e)||lh(n)||ph(n))},ra=function(e,n){return!(dh(n)||na(n)<0||!gh(e,n))},yh=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},vh=function t(e){var n=[],s=[];return e.forEach(function(i,o){var r=!!i.scopeParent,a=r?i.scopeParent:i,l=rh(a,r),u=r?t(i.candidates):a;l===0?r?n.push.apply(n,u):n.push(a):s.push({documentOrder:o,tabIndex:l,item:i,isScope:r,content:u})}),s.sort(oh).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},oa=function(e,n){n=n||{};var s;return n.getShadowRoot?s=ih([e],n.includeContainer,{filter:ra.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:yh}):s=sh(e,n.includeContainer,ra.bind(null,n)),vh(s)};function xh(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function bh(){return/apple/i.test(navigator.vendor)}function wh(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function Th(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&ks(n)){let s=e;for(;s;){if(t===s)return!0;s=s.parentNode||s.host}}return!1}function _s(t){return t?.ownerDocument||document}var Sh=typeof document<"u",Ph=function(){},jt=Sh?T.useLayoutEffect:Ph;const Ch={...P}.useInsertionEffect||(t=>t());function Eh(t){const e=P.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Ch(()=>{e.current=t}),P.useCallback(function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return e.current==null?void 0:e.current(...s)},[])}const aa=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function la(t,e){const n=oa(t,aa()),s=n.length;if(s===0)return;const i=wh(_s(t)),o=n.indexOf(i),r=o===-1?e===1?0:s-1:o+e;return n[r]}function Ah(t){return la(_s(t).body,1)||t}function Rh(t){return la(_s(t).body,-1)||t}function $s(t,e){const n=e||t.currentTarget,s=t.relatedTarget;return!s||!Th(n,s)}function jh(t){oa(t,aa()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ca(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function ua(t,e,n){let{reference:s,floating:i}=t;const o=Fs(e),r=Jd(e),a=qd(r),l=Ls(e),u=o==="y",c=s.x+s.width/2-i.width/2,f=s.y+s.height/2-i.height/2,d=s[a]/2-i[a]/2;let m;switch(l){case"top":m={x:c,y:s.y-i.height};break;case"bottom":m={x:c,y:s.y+s.height};break;case"right":m={x:s.x+s.width,y:f};break;case"left":m={x:s.x-i.width,y:f};break;default:m={x:s.x,y:s.y}}switch(Qo(e)){case"start":m[r]-=d*(n&&u?-1:1);break;case"end":m[r]+=d*(n&&u?-1:1);break}return m}const Mh=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e));let u=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:f}=ua(u,s,l),d=s,m={},p=0;for(let g=0;g<a.length;g++){const{name:x,fn:y}=a[g],{x:w,y:v,data:E,reset:S}=await y({x:c,y:f,initialPlacement:s,placement:d,strategy:i,middlewareData:m,rects:u,platform:r,elements:{reference:t,floating:e}});c=w??c,f=v??f,m={...m,[x]:{...m[x],...E}},S&&p<=50&&(p++,typeof S=="object"&&(S.placement&&(d=S.placement),S.rects&&(u=S.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:c,y:f}=ua(u,d,l)),g=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:m}};async function Dh(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:o,rects:r,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=Jo(e,t),p=th(m),x=a[d?f==="floating"?"reference":"floating":f],y=nn(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),w=f==="floating"?{x:s,y:i,width:r.floating.width,height:r.floating.height}:r.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),E=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},S=nn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:v,strategy:l}):w);return{top:(y.top-S.top+p.top)/E.y,bottom:(S.bottom-y.bottom+p.bottom)/E.y,left:(y.left-S.left+p.left)/E.x,right:(S.right-y.right+p.right)/E.x}}const Vh=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,s;const{placement:i,rects:o,platform:r,elements:a}=e,{apply:l=()=>{},...u}=Jo(t,e),c=await Dh(e,u),f=Ls(i),d=Qo(i),m=Fs(i)==="y",{width:p,height:g}=o.floating;let x,y;f==="top"||f==="bottom"?(x=f,y=d===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,x=d==="end"?"top":"bottom");const w=g-c.top-c.bottom,v=p-c.left-c.right,E=je(g-c[x],w),S=je(p-c[y],v),C=!e.middlewareData.shift;let A=E,R=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(R=v),(s=e.middlewareData.shift)!=null&&s.enabled.y&&(A=w),C&&!d){const O=rt(c.left,0),U=rt(c.right,0),et=rt(c.top,0),I=rt(c.bottom,0);m?R=p-2*(O!==0||U!==0?O+U:rt(c.left,c.right)):A=g-2*(et!==0||I!==0?et+I:rt(c.top,c.bottom))}await l({...e,availableWidth:R,availableHeight:A});const N=await r.getDimensions(a.floating);return p!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function fa(t){const e=lt(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=gt(t),o=i?t.offsetWidth:n,r=i?t.offsetHeight:s,a=tn(n)!==o||tn(s)!==r;return a&&(n=o,s=r),{width:n,height:s,$:a}}function Ws(t){return G(t)?t:t.contextElement}function ne(t){const e=Ws(t);if(!gt(e))return yt(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:o}=fa(e);let r=(o?tn(n.width):n.width)/s,a=(o?tn(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const kh=yt(0);function da(t){const e=tt(t);return!Os()||!e.visualViewport?kh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Nh(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==tt(t)?!1:e}function _t(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Ws(t);let r=yt(1);e&&(s?G(s)&&(r=ne(s)):r=ne(t));const a=Nh(o,n,s)?da(o):yt(0);let l=(i.left+a.x)/r.x,u=(i.top+a.y)/r.y,c=i.width/r.x,f=i.height/r.y;if(o){const d=tt(o),m=s&&G(s)?tt(s):s;let p=d,g=Is(p);for(;g&&s&&m!==p;){const x=ne(g),y=g.getBoundingClientRect(),w=lt(g),v=y.left+(g.clientLeft+parseFloat(w.paddingLeft))*x.x,E=y.top+(g.clientTop+parseFloat(w.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,f*=x.y,l+=v,u+=E,p=tt(g),g=Is(p)}}return nn({width:c,height:f,x:l,y:u})}function on(t,e){const n=Qe(t).scrollLeft;return e?e.left+n:_t(pt(t)).left+n}function ha(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-on(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function Oh(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const o=i==="fixed",r=pt(s),a=e?Je(e.floating):!1;if(s===r||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=yt(1);const c=yt(0),f=gt(s);if((f||!f&&!o)&&((te(s)!=="body"||Ae(r))&&(l=Qe(s)),gt(s))){const m=_t(s);u=ne(s),c.x=m.x+s.clientLeft,c.y=m.y+s.clientTop}const d=r&&!f&&!o?ha(r,l):yt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:n.y*u.y-l.scrollTop*u.y+c.y+d.y}}function Ih(t){return Array.from(t.getClientRects())}function Lh(t){const e=pt(t),n=Qe(t),s=t.ownerDocument.body,i=rt(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),o=rt(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let r=-n.scrollLeft+on(t);const a=-n.scrollTop;return lt(s).direction==="rtl"&&(r+=rt(e.clientWidth,s.clientWidth)-i),{width:i,height:o,x:r,y:a}}const ma=25;function Fh(t,e){const n=tt(t),s=pt(t),i=n.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(i){o=i.width,r=i.height;const c=Os();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=on(s);if(u<=0){const c=s.ownerDocument,f=c.body,d=getComputedStyle(f),m=c.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(s.clientWidth-f.clientWidth-m);p<=ma&&(o-=p)}else u<=ma&&(o+=u);return{width:o,height:r,x:a,y:l}}const Bh=new Set(["absolute","fixed"]);function _h(t,e){const n=_t(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,o=gt(t)?ne(t):yt(1),r=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,u=s*o.y;return{width:r,height:a,x:l,y:u}}function pa(t,e,n){let s;if(e==="viewport")s=Fh(t,n);else if(e==="document")s=Lh(pt(t));else if(G(e))s=_h(e,n);else{const i=da(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return nn(s)}function ga(t,e){const n=Rt(t);return n===e||!G(n)||ee(n)?!1:lt(n).position==="fixed"||ga(n,e)}function $h(t,e){const n=e.get(t);if(n)return n;let s=Re(t,[],!1).filter(a=>G(a)&&te(a)!=="body"),i=null;const o=lt(t).position==="fixed";let r=o?Rt(t):t;for(;G(r)&&!ee(r);){const a=lt(r),l=Ns(r);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&Bh.has(i.position)||Ae(r)&&!l&&ga(t,r))?s=s.filter(c=>c!==r):i=a,r=Rt(r)}return e.set(t,s),s}function Wh(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const r=[...n==="clippingAncestors"?Je(e)?[]:$h(e,this._c):[].concat(n),s],a=r[0],l=r.reduce((u,c)=>{const f=pa(e,c,i);return u.top=rt(f.top,u.top),u.right=je(f.right,u.right),u.bottom=je(f.bottom,u.bottom),u.left=rt(f.left,u.left),u},pa(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Uh(t){const{width:e,height:n}=fa(t);return{width:e,height:n}}function zh(t,e,n){const s=gt(e),i=pt(e),o=n==="fixed",r=_t(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=yt(0);function u(){l.x=on(i)}if(s||!s&&!o)if((te(e)!=="body"||Ae(i))&&(a=Qe(e)),s){const m=_t(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else i&&u();o&&!s&&i&&u();const c=i&&!s&&!o?ha(i,a):yt(0),f=r.left+a.scrollLeft-l.x-c.x,d=r.top+a.scrollTop-l.y-c.y;return{x:f,y:d,width:r.width,height:r.height}}function Us(t){return lt(t).position==="static"}function ya(t,e){if(!gt(t)||lt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return pt(t)===n&&(n=n.ownerDocument.body),n}function va(t,e){const n=tt(t);if(Je(t))return n;if(!gt(t)){let i=Rt(t);for(;i&&!ee(i);){if(G(i)&&!Us(i))return i;i=Rt(i)}return n}let s=ya(t,e);for(;s&&Wd(s)&&Us(s);)s=ya(s,e);return s&&ee(s)&&Us(s)&&!Ns(s)?n:s||Hd(t)||n}const Kh=async function(t){const e=this.getOffsetParent||va,n=this.getDimensions,s=await n(t.floating);return{reference:zh(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Yh(t){return lt(t).direction==="rtl"}const Hh={convertOffsetParentRelativeRectToViewportRelativeRect:Oh,getDocumentElement:pt,getClippingRect:Wh,getOffsetParent:va,getElementRects:Kh,getClientRects:Ih,getDimensions:Uh,getScale:ne,isElement:G,isRTL:Yh};function xa(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Gh(t,e){let n=null,s;const i=pt(t);function o(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function r(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=t.getBoundingClientRect(),{left:c,top:f,width:d,height:m}=u;if(a||e(),!d||!m)return;const p=en(f),g=en(i.clientWidth-(c+d)),x=en(i.clientHeight-(f+m)),y=en(c),v={rootMargin:-p+"px "+-g+"px "+-x+"px "+-y+"px",threshold:rt(0,je(1,l))||1};let E=!0;function S(C){const A=C[0].intersectionRatio;if(A!==l){if(!E)return r();A?r(!1,A):s=setTimeout(()=>{r(!1,1e-7)},1e3)}A===1&&!xa(u,t.getBoundingClientRect())&&r(),E=!1}try{n=new IntersectionObserver(S,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,v)}n.observe(t)}return r(!0),o}function Xh(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,u=Ws(t),c=i||o?[...u?Re(u):[],...Re(e)]:[];c.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const f=u&&a?Gh(u,n):null;let d=-1,m=null;r&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(e)})),n()}),u&&!l&&m.observe(u),m.observe(e));let p,g=l?_t(t):null;l&&x();function x(){const y=_t(t);g&&!xa(g,y)&&n(),g=y,p=requestAnimationFrame(x)}return n(),()=>{var y;c.forEach(w=>{i&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),f?.(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const qh=Vh,Zh=(t,e,n)=>{const s=new Map,i={platform:Hh,...n},o={...i.platform,_c:s};return Mh(t,e,{...i,platform:o})};var Jh=typeof document<"u",Qh=function(){},an=Jh?T.useLayoutEffect:Qh;function ln(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,s,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(s=n;s--!==0;)if(!ln(t[s],e[s]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(e,i[s]))return!1;for(s=n;s--!==0;){const o=i[s];if(!(o==="_owner"&&t.$$typeof)&&!ln(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function ba(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function wa(t,e){const n=ba(t);return Math.round(e*n)/n}function zs(t){const e=P.useRef(t);return an(()=>{e.current=t}),e}function tm(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:o,floating:r}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,f]=P.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,m]=P.useState(s);ln(d,s)||m(s);const[p,g]=P.useState(null),[x,y]=P.useState(null),w=P.useCallback(k=>{k!==C.current&&(C.current=k,g(k))},[]),v=P.useCallback(k=>{k!==A.current&&(A.current=k,y(k))},[]),E=o||p,S=r||x,C=P.useRef(null),A=P.useRef(null),R=P.useRef(c),N=l!=null,O=zs(l),U=zs(i),et=zs(u),I=P.useCallback(()=>{if(!C.current||!A.current)return;const k={placement:e,strategy:n,middleware:d};U.current&&(k.platform=U.current),Zh(C.current,A.current,k).then(J=>{const b={...J,isPositioned:et.current!==!1};K.current&&!ln(R.current,b)&&(R.current=b,Zs.flushSync(()=>{f(b)}))})},[d,e,n,U,et]);an(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(k=>({...k,isPositioned:!1})))},[u]);const K=P.useRef(!1);an(()=>(K.current=!0,()=>{K.current=!1}),[]),an(()=>{if(E&&(C.current=E),S&&(A.current=S),E&&S){if(O.current)return O.current(E,S,I);I()}},[E,S,I,O,N]);const vt=P.useMemo(()=>({reference:C,floating:A,setReference:w,setFloating:v}),[w,v]),ct=P.useMemo(()=>({reference:E,floating:S}),[E,S]),_=P.useMemo(()=>{const k={position:n,left:0,top:0};if(!ct.floating)return k;const J=wa(ct.floating,c.x),b=wa(ct.floating,c.y);return a?{...k,transform:"translate("+J+"px, "+b+"px)",...ba(ct.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:b}},[n,a,ct.floating,c.x,c.y]);return P.useMemo(()=>({...c,update:I,refs:vt,elements:ct,floatingStyles:_}),[c,I,vt,ct,_])}const em=(t,e)=>({...qh(t),options:[t,e]}),nm={...P};let Ta=!1,sm=0;const Sa=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+sm++;function im(){const[t,e]=P.useState(()=>Ta?Sa():void 0);return jt(()=>{t==null&&e(Sa())},[]),P.useEffect(()=>{Ta=!0},[]),t}const Pa=nm.useId||im;let Ks;process.env.NODE_ENV!=="production"&&(Ks=new Set);function rm(){for(var t,e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];const i="Floating UI: "+n.join(" ");if(!((t=Ks)!=null&&t.has(i))){var o;(o=Ks)==null||o.add(i),console.error(i)}}function om(){const t=new Map;return{emit(e,n){var s;(s=t.get(e))==null||s.forEach(i=>i(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var s;(s=t.get(e))==null||s.delete(n)}}}const am=P.createContext(null),lm=P.createContext(null),cm=()=>{var t;return((t=P.useContext(am))==null?void 0:t.id)||null},um=()=>P.useContext(lm);function Ca(t){return"data-floating-ui-"+t}const Ea={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Aa=P.forwardRef(function(e,n){const[s,i]=P.useState();jt(()=>{bh()&&i("button")},[]);const o={ref:n,tabIndex:0,role:s,"aria-hidden":s?void 0:!0,[Ca("focus-guard")]:"",style:Ea};return h.jsx("span",{...e,...o})}),Ra=P.createContext(null),ja=Ca("portal");function fm(t){t===void 0&&(t={});const{id:e,root:n}=t,s=Pa(),i=dm(),[o,r]=P.useState(null),a=P.useRef(null);return jt(()=>()=>{o?.remove(),queueMicrotask(()=>{a.current=null})},[o]),jt(()=>{if(!s||a.current)return;const l=e?document.getElementById(e):null;if(!l)return;const u=document.createElement("div");u.id=s,u.setAttribute(ja,""),l.appendChild(u),a.current=u,r(u)},[e,s]),jt(()=>{if(n===null||!s||a.current)return;let l=n||i?.portalNode;l&&!Vs(l)&&(l=l.current),l=l||document.body;let u=null;e&&(u=document.createElement("div"),u.id=e,l.appendChild(u));const c=document.createElement("div");c.id=s,c.setAttribute(ja,""),l=u||l,l.appendChild(c),a.current=c,r(c)},[e,n,s,i]),o}function Ma(t){const{children:e,id:n,root:s,preserveTabOrder:i=!0}=t,o=fm({id:n,root:s}),[r,a]=P.useState(null),l=P.useRef(null),u=P.useRef(null),c=P.useRef(null),f=P.useRef(null),d=r?.modal,m=r?.open,p=!!r&&!r.modal&&r.open&&i&&!!(s||o);return P.useEffect(()=>{if(!o||!i||d)return;function g(x){o&&$s(x)&&(x.type==="focusin"?ca:jh)(o)}return o.addEventListener("focusin",g,!0),o.addEventListener("focusout",g,!0),()=>{o.removeEventListener("focusin",g,!0),o.removeEventListener("focusout",g,!0)}},[o,i,d]),P.useEffect(()=>{o&&(m||ca(o))},[m,o]),h.jsxs(Ra.Provider,{value:P.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:f,portalNode:o,setFocusManagerState:a}),[i,o]),children:[p&&o&&h.jsx(Aa,{"data-type":"outside",ref:l,onFocus:g=>{if($s(g,o)){var x;(x=c.current)==null||x.focus()}else{const y=r?r.domReference:null,w=Rh(y);w?.focus()}}}),p&&o&&h.jsx("span",{"aria-owns":o.id,style:Ea}),o&&Zs.createPortal(e,o),p&&o&&h.jsx(Aa,{"data-type":"outside",ref:u,onFocus:g=>{if($s(g,o)){var x;(x=f.current)==null||x.focus()}else{const y=r?r.domReference:null,w=Ah(y);w?.focus(),r?.closeOnFocusOut&&r?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}const dm=()=>P.useContext(Ra);let cn=0;const Da="--floating-ui-scrollbar-width";function hm(){const t=xh(),e=/iP(hone|ad|od)|iOS/.test(t)||t==="MacIntel"&&navigator.maxTouchPoints>1,n=document.body.style,i=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,r=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(Da,o+"px"),o&&(n[i]=o+"px"),e){var l,u;const c=((l=window.visualViewport)==null?void 0:l.offsetLeft)||0,f=((u=window.visualViewport)==null?void 0:u.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(f))+"px",left:-(r-Math.floor(c))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[i]:""}),n.removeProperty(Da),e&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(r,a))}}let Va=()=>{};const ka=P.forwardRef(function(e,n){const{lockScroll:s=!1,...i}=e;return jt(()=>{if(s)return cn++,cn===1&&(Va=hm()),()=>{cn--,cn===0&&Va()}},[s]),h.jsx("div",{ref:n,...i,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}})});function mm(t){const{open:e=!1,onOpenChange:n,elements:s}=t,i=Pa(),o=P.useRef({}),[r]=P.useState(()=>om()),a=cm()!=null;if(process.env.NODE_ENV!=="production"){const m=s.reference;m&&!G(m)&&rm("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=P.useState(s.reference),c=Eh((m,p,g)=>{o.current.openEvent=m?p:void 0,r.emit("openchange",{open:m,event:p,reason:g,nested:a}),n?.(m,p,g)}),f=P.useMemo(()=>({setPositionReference:u}),[]),d=P.useMemo(()=>({reference:l||s.reference||null,floating:s.floating||null,domReference:s.reference}),[l,s.reference,s.floating]);return P.useMemo(()=>({dataRef:o,open:e,onOpenChange:c,elements:d,events:r,floatingId:i,refs:f}),[e,c,d,r,i,f])}function pm(t){t===void 0&&(t={});const{nodeId:e}=t,n=mm({...t,elements:{reference:null,floating:null,...t.elements}}),s=t.rootContext||n,i=s.elements,[o,r]=P.useState(null),[a,l]=P.useState(null),c=i?.domReference||o,f=P.useRef(null),d=um();jt(()=>{c&&(f.current=c)},[c]);const m=tm({...t,elements:{...i,...a&&{reference:a}}}),p=P.useCallback(v=>{const E=G(v)?{getBoundingClientRect:()=>v.getBoundingClientRect(),getClientRects:()=>v.getClientRects(),contextElement:v}:v;l(E),m.refs.setReference(E)},[m.refs]),g=P.useCallback(v=>{(G(v)||v===null)&&(f.current=v,r(v)),(G(m.refs.reference.current)||m.refs.reference.current===null||v!==null&&!G(v))&&m.refs.setReference(v)},[m.refs]),x=P.useMemo(()=>({...m.refs,setReference:g,setPositionReference:p,domReference:f}),[m.refs,g,p]),y=P.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),w=P.useMemo(()=>({...m,...s,refs:x,elements:y,nodeId:e}),[m,x,y,e,s]);return jt(()=>{s.dataRef.current.floatingContext=w;const v=d?.nodesRef.current.find(E=>E.id===e);v&&(v.context=w)}),P.useMemo(()=>({...m,context:w,refs:x,elements:y}),[m,x,y,w])}const gm={top:"bottom center","top-start":"bottom left","top-end":"bottom right",right:"left center","right-start":"top left","right-end":"bottom left",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"top right","left-end":"bottom right"},Na=P.memo(({open:t,children:e,className:n,onOutsideClick:s,floatingStyles:i,setFloating:o,placement:r})=>h.jsx(Ma,{children:h.jsx(ss,{children:t&&h.jsxs(h.Fragment,{children:[s&&h.jsx(ka,{onClick:s}),h.jsx("div",{ref:o,style:i,className:"z-10",children:h.jsx(Pe.div,{className:n,style:{transformOrigin:gm[r]},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeInOut"},children:e})})]})})})),se=t=>{const{placement:e="bottom",onOutsideClick:n,fullWidth:s,minWidth:i,maxWidth:o}=t,r=P.useMemo(()=>[em({apply({rects:f,elements:d}){s&&(d.floating.style.width=`${f.reference.width}px`),i&&(d.floating.style.minWidth=`${i}px`),o&&(d.floating.style.maxWidth=`${o}px`)}})],[s,o,i]),{refs:a,floatingStyles:l}=pm({placement:e,middleware:r,whileElementsMounted:Xh}),u=P.useRef({onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:e});u.current={onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:e};const c=P.useMemo(()=>{const f=d=>{const{floatingStyles:m,setFloating:p,onOutsideClick:g,placement:x}=u.current,{className:y,open:w,children:v}=d;return h.jsx(Na,{open:w,className:y,onOutsideClick:g,floatingStyles:m,setFloating:p,placement:x,children:v})};return P.memo(f)},[]);return{anchorRef:a.setReference,Popover:c}},ym="flex flex-col bg-white border mt-1 border-gray-200 rounded-xl shadow-lg p-3 overflow-y-auto relative",ie=t=>{const{className:e,children:n,...s}=t;return h.jsx("div",{className:V(ym,e),...s,children:n})},un=(t,e)=>{T.useEffect(()=>{if(!t)return;const n=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[t,e])},Oa=t=>{const{className:e,label:n,description:s,options:i,onChange:o,value:r,placeholder:a,maxHeight:l=300,error:u}=t,[c,f]=T.useState(!1),d=P.useRef(null),m=i?.find(x=>x.value===r);un(c,()=>f(!1)),T.useEffect(()=>{c&&d.current?.focus({preventScroll:!0})},[c]);const{anchorRef:p,Popover:g}=se({placement:"bottom",fullWidth:!0,onOutsideClick:()=>f(!1)});return h.jsxs("div",{className:V("flex flex-col",e),children:[h.jsx(Lt,{children:n}),h.jsxs("div",{className:"relative flex w-full flex-col",ref:p,children:[h.jsxs("div",{ref:d,role:"button",tabIndex:0,className:V("flex flex-row items-center h-12 pl-4 pr-10 border border-gray-200 text-gray-900 placeholder:text-gray-400 bg-white transition-all duration-150 rounded-xl shadow-sm ring-0 ring-gray-900/10 focus:ring-4 focus:outline-none select-none",u&&"border-red-600 ring-red-600/20 !pr-10",c&&"ring-4"),onKeyDown:x=>x.key===" "&&f(y=>!y),onClick:()=>f(!c),children:[m&&h.jsx("span",{children:m.label}),!m&&a&&h.jsx("span",{className:"text-gray-500",children:a})]}),h.jsxs(Bt,{children:[u&&h.jsx(Ft,{}),!!r&&h.jsx(St,{Icon:Ce,onClick:()=>o(null)}),h.jsx(St,{Icon:qe})]}),h.jsx(g,{open:c,children:h.jsx(ie,{className:"!p-0",style:{maxHeight:l},children:h.jsx("div",{className:"flex flex-col p-2 gap-1",children:i.map(x=>{const y=x.value===r;return h.jsx(Ee,{onClick:()=>{!x.disabled&&o&&(o(x.value),f(!1))},selected:y,disabled:x.disabled,children:x.label},String(x.value))})})})})]}),h.jsx(ht,{children:s}),h.jsx(mt,{children:u})]})},vm=t=>{const{className:e,label:n,description:s,options:i,onChange:o,onSearch:r,value:a,placeholder:l,maxHeight:u=300,error:c}=t,[f,d]=T.useState(!1),[m,p]=T.useState(i),[g,x]=T.useState(""),y=P.useRef(null),w=P.useRef(null),v=i?.find(C=>C.value===a);un(f,()=>d(!1)),T.useEffect(()=>{p(r(g))},[g,i,r]),T.useEffect(()=>{f&&w.current?.focus()},[f]);const{anchorRef:E,Popover:S}=se({placement:"bottom",fullWidth:!0,onOutsideClick:()=>d(!1)});return h.jsxs("div",{className:V("flex flex-col",e),children:[h.jsx(Lt,{children:n}),h.jsxs("div",{className:"relative flex w-full flex-col",ref:E,children:[h.jsxs("div",{ref:y,role:"button",tabIndex:0,className:V("flex flex-row items-center h-12 pl-4 pr-10 border border-gray-200 text-gray-900 placeholder:text-gray-400 bg-white transition-all duration-150 rounded-xl shadow-sm ring-0 ring-gray-900/10 focus:ring-4 focus:outline-none select-none",c&&"border-red-600 ring-red-600/20 !pr-10",f&&"ring-4"),onKeyDown:C=>C.key===" "&&d(A=>!A),onClick:()=>d(!f),children:[v&&h.jsx("span",{children:v.label}),!v&&l&&h.jsx("span",{className:"text-gray-500",children:l})]}),h.jsxs(Bt,{children:[c&&h.jsx(Ft,{}),!!a&&h.jsx(St,{Icon:Ce,onClick:()=>o(null)}),h.jsx(St,{Icon:qe})]}),h.jsx(S,{open:f,children:h.jsxs(ie,{className:"gap-0 !p-0",style:{maxHeight:u},children:[h.jsxs("div",{className:"sticky top-0 border-b border-b-gray-200 py-1 bg-white/50 backdrop-blur-sm",children:[h.jsx("input",{ref:w,type:"text",placeholder:"Search",value:g,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-gray-400",onChange:C=>x(C.target.value)}),h.jsx(Ms,{className:"absolute text-gray-500 left-4 top-4 h-4 w-4"})]}),h.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[g!==""&&h.jsxs(h.Fragment,{children:[m.length===0&&h.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:h.jsx(qo,{className:"h-6 w-6 text-gray-900"})}),m.map(C=>{const A=C.value===a;return h.jsx(Ee,{onClick:()=>{!C.disabled&&o&&(o(C.value),d(!1))},selected:A,disabled:C.disabled,children:C.label},String(C.value))})]}),g===""&&h.jsx(h.Fragment,{children:i.map(C=>{const A=C.value===a;return h.jsx(Ee,{onClick:()=>{!C.disabled&&o&&(o(C.value),d(!1))},selected:A,disabled:C.disabled,children:C.label},String(C.value))})})]})]})})]}),h.jsx(ht,{children:s}),h.jsx(mt,{children:c})]})},xm=(t,e)=>{const[n,s]=T.useState(t);return T.useEffect(()=>{const i=setTimeout(()=>{s(t)},e);return()=>{clearTimeout(i)}},[t,e]),n},bm=t=>{const{className:e,label:n,description:s,onChange:i,fetchOptionsByQuery:o,fetchOptionByValue:r,onSearchDebounceMs:a=300,value:l,placeholder:u,maxHeight:c=300,error:f}=t,[d,m]=T.useState(!1),p=P.useRef(null),[g,x]=T.useState(""),[y,w]=T.useState([]),[v,E]=T.useState(null),S=P.useRef(null),[C,A]=T.useState(!1),[R,N]=T.useState(!1);un(d,()=>m(!1));const O=xm(g,a);T.useEffect(()=>{(async()=>{A(!0);const K=await o(O);w(K),A(!1)})()},[O,o]),T.useEffect(()=>{if(l==null){E(null);return}const I=y?.find(K=>K.value===l);I?E(I):(async()=>{N(!0);const vt=await r(l);E(vt),N(!1)})()},[r,y,l]),T.useEffect(()=>{d&&S.current?.focus()},[d]);const{anchorRef:U,Popover:et}=se({placement:"bottom",fullWidth:!0,onOutsideClick:()=>m(!1)});return h.jsxs("div",{className:V("flex flex-col",e),children:[h.jsx(Lt,{children:n}),h.jsxs("div",{className:"relative flex w-full flex-col",ref:U,children:[h.jsxs("div",{ref:p,role:"button",tabIndex:0,className:V("flex flex-row items-center h-12 pl-4 pr-10 border border-gray-200 text-gray-900 placeholder:text-gray-400 bg-white transition-all duration-150 rounded-xl shadow-sm ring-0 ring-gray-900/10 focus:ring-4 focus:outline-none select-none",f&&"border-red-600 ring-red-600/20 !pr-10",d&&"ring-4"),onKeyDown:I=>I.key===" "&&m(K=>!K),onClick:()=>m(!d),children:[!R&&v&&h.jsx("span",{children:v.label}),!R&&!v&&u&&h.jsx("span",{children:u}),R&&h.jsx(Xe,{className:"h-4 w-4 text-gray-600"})]}),h.jsxs(Bt,{children:[f&&h.jsx(Ft,{}),!!l&&h.jsx(St,{Icon:Ce,onClick:()=>i(null)}),h.jsx(St,{Icon:qe})]}),h.jsx(et,{open:d,children:h.jsxs(ie,{className:"gap-0 !p-0",style:{maxHeight:c},children:[h.jsxs("div",{className:"sticky top-0 border-b border-b-gray-200 py-1 bg-white/50 backdrop-blur-sm",children:[h.jsx("input",{ref:S,type:"text",placeholder:"Search",value:g,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-gray-400",onChange:I=>x(I.target.value)}),h.jsx(Ms,{className:"absolute text-gray-500 left-4 top-4 h-4 w-4"})]}),h.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[!C&&y.length===0&&h.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:h.jsx(qo,{className:"h-6 w-6 text-gray-900"})}),C&&h.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:h.jsx(Xe,{className:"h-6 w-6 text-gray-900"})}),!C&&h.jsx(h.Fragment,{children:y.map(I=>{const K=I.value===l;return h.jsx(Ee,{onClick:()=>{!I.disabled&&i&&(i(I.value),m(!1))},selected:K,disabled:I.disabled,children:I.label},String(I.value))})})]})]})})]}),h.jsx(ht,{children:s}),h.jsx(mt,{children:f})]})},wm=P.forwardRef((t,e)=>{const{className:n,children:s,...i}=t;return h.jsx("div",{ref:e,className:V("flex flex-col gap-6 border border-gray-200 rounded-xl bg-white shadow-sm px-6 py-6",n),...i,children:s})}),Tm=t=>{const{className:e,vertical:n=!1,...s}=t;return h.jsx("div",{className:V(n?"w-px h-full bg-gray-200":"w-full h-px bg-gray-200",e),...s})},Sm=t=>{const{children:e,content:n,className:s,placement:i="top",minWidth:o=100,maxWidth:r=200}=t,[a,l]=T.useState(!1),{anchorRef:u,Popover:c}=se({placement:i,minWidth:o,maxWidth:r});return h.jsxs("span",{ref:u,className:s,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[e,h.jsx(c,{open:a,children:h.jsx(ie,{children:n})})]})},Pm=t=>{const{open:e,onDismiss:n,enableDismissOnOutsideClick:s,enableDismissOnEscKey:i,enableDismissButton:o,className:r,children:a,maxWidth:l=600}=t;return un(!!i&&e,n||(()=>{})),h.jsx(ss,{children:e&&h.jsxs(Ma,{children:[h.jsx(Pe.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:h.jsx(ka,{className:"bg-gray-400/30 backdrop-blur-[1px]",onClick:s?n:void 0,lockScroll:!0})}),h.jsx("div",{className:"fixed inset-0 flex flex-col items-center pointer-events-none p-4 lg:p-12 overflow-y-auto",children:h.jsxs(Pe.div,{className:V("flex flex-col bg-white rounded-xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",r),style:{transformOrigin:"bottom",maxWidth:l},initial:{opacity:0,scale:.98,translateY:10},animate:{opacity:1,scale:1,translateY:0},exit:{opacity:0,scale:.98,translateY:10},transition:{duration:.15,ease:"easeInOut"},children:[o&&h.jsx(Xo,{Icon:Ce,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},Ia={red:"bg-red-100 text-red-700 ring-red-200",orange:"bg-orange-100 text-orange-700 ring-orange-200",amber:"bg-amber-100 text-amber-700 ring-amber-200",yellow:"bg-yellow-100 text-yellow-700 ring-yellow-200",lime:"bg-lime-100 text-lime-700 ring-lime-200",green:"bg-green-100 text-green-700 ring-green-200",emerald:"bg-emerald-100 text-emerald-700 ring-emerald-200",teal:"bg-teal-100 text-teal-700 ring-teal-200",cyan:"bg-cyan-100 text-cyan-700 ring-cyan-200",sky:"bg-sky-100 text-sky-700 ring-sky-200",blue:"bg-blue-100 text-blue-700 ring-blue-200",indigo:"bg-indigo-100 text-indigo-700 ring-indigo-200",violet:"bg-violet-100 text-violet-700 ring-violet-200",purple:"bg-purple-100 text-purple-700 ring-purple-200",fuchsia:"bg-fuchsia-100 text-fuchsia-700 ring-fuchsia-200",pink:"bg-pink-100 text-pink-700 ring-pink-200",rose:"bg-rose-100 text-rose-700 ring-rose-200",slate:"bg-slate-100 text-slate-700 ring-slate-200",gray:"bg-gray-100 text-gray-700 ring-gray-200",zinc:"bg-zinc-100 text-zinc-700 ring-zinc-200",neutral:"bg-neutral-100 text-neutral-700 ring-neutral-200",stone:"bg-stone-100 text-stone-700 ring-stone-200",white:"bg-white text-gray-900 ring-stone-200",black:"bg-black text-white ring-stone-200"},Ys=P.forwardRef((t,e)=>{const{className:n,children:s,onClick:i,showCloseIcon:o,Icon:r,color:a="gray"}=t,l=V("inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",Ia[a],n);return i?h.jsx("div",{ref:e,children:h.jsxs("button",{className:V("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4",l),onClick:i,children:[r&&h.jsx(r,{className:"h-4 w-4 shrink-0"}),h.jsx("div",{className:"break-all line-clamp-1 text-left",children:s}),o&&h.jsx(Ce,{className:"h-4 w-4 shrink-0"})]})}):h.jsxs("div",{className:l,ref:e,children:[r&&h.jsx(r,{className:"h-4 w-4 shrink-0"}),h.jsx("div",{className:"break-all line-clamp-1 text-left",children:s})]})}),Cm=t=>{const{className:e,tabs:n}=t;return h.jsx("div",{className:V("h-12 bg-gray-100 p-1 rounded-xl inline-flex flex-row space-x-1 overflow-x-auto",e),children:n.map((s,i)=>{const o=V("shrink-0 px-4 h-full inline-flex flex-row items-center font-semibold rounded-xl cursor-pointer border border-transparent ing-0 hover:bg-gray-200 active:bg-gray-300/80 transition-all duration-150 select-none focus:outline-none focus:ring-0",s.active&&"bg-white shadow-sm !border-gray-300");return s.href?h.jsx("a",{href:s.href,className:o,children:s.label},i):h.jsx("button",{className:o,onClick:s.onClick,children:s.label},i)})})},Em="inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 hover:bg-gray-100 active:bg-gray-200 rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent text-gray-900 bg-transparent ring-gray-900/10",fn=P.forwardRef((t,e)=>{const{className:n,children:s,Icon:i,...o}=t;return h.jsxs("button",{ref:e,className:V(Em,n),...o,children:[i&&h.jsx(i,{className:"h-5 w-5"}),s]})}),Am=t=>{const{columns:e,rows:n}=t;return h.jsx("div",{className:"border border-gray-200 rounded-xl shadow-sm overflow-hidden",children:h.jsxs("table",{className:"table-fixed",children:[h.jsx("colgroup",{children:e.map(s=>h.jsx("col",{width:250},s.id))}),h.jsx("thead",{children:h.jsx("tr",{className:"divide-gray-200 divide-x text-left bg-gray-50 text-gray-400 border-b border-b-gray-200",children:e.map(s=>h.jsx("th",{className:"font-medium h-[3rem] relative hover:bg-gray-100 cursor-pointer active:bg-gray-200 transition-colors duration-150",children:h.jsx("div",{className:"absolute inset-0",children:h.jsx("div",{className:"flex items-center h-full w-full px-4",children:s.header})})},s.id))})}),h.jsx("tbody",{className:"divide-y divide-gray-200",children:n.map((s,i)=>h.jsx("tr",{className:"divide-gray-200 divide-x",children:e.map(o=>h.jsx("td",{className:"h-[3rem] relative",children:h.jsx("div",{className:"absolute inset-0 ",children:h.jsx("div",{className:"flex items-center h-full w-full px-4",children:o.renderCell(s)})})},o.id))},i))})]})})},Rm=[{id:1,email:"matthiaskrijgsman@gmail.com",firstname:"Matthias",lastname:"Krijgsman",status:"active"},{id:2,email:"dennis@snijder.io",firstname:"Dennis",lastname:"Snijder",status:"inactive"},{id:3,email:"arcokrijgsman@gmail.com",firstname:"Arco",lastname:"Krijgsman",status:"active"}],jm=[{id:"id",header:"ID",renderCell:t=>t.id},{id:"email",header:"Email",renderCell:t=>h.jsx(Ys,{Icon:kd,onClick:()=>{},children:t.email})},{id:"firstname",header:"First Name",renderCell:t=>t.firstname},{id:"lastname",header:"Last Name",renderCell:t=>t.lastname},{id:"status",header:"Status",renderCell:()=>h.jsx(Dm,{})}],Mm=()=>h.jsxs("div",{className:"flex flex-col gap-6",children:[h.jsxs("div",{className:"flex flex-row items-center justify-start gap-3",children:[h.jsx(Ds,{Icon:Ms,placeholder:"Search..."}),h.jsx(Go,{Icon:Dd})]}),h.jsx(Am,{columns:jm,rows:Rm}),h.jsx(Oa,{options:[{label:"Option 1",value:1},{label:"Option 2",value:2},{label:"Option 3",value:3}],value:null,onChange:()=>{}})]}),Dm=()=>{const[t,e]=T.useState(!1),{Popover:n,anchorRef:s}=se({fullWidth:!0,onOutsideClick:()=>e(!1),minWidth:150});return h.jsxs(h.Fragment,{children:[h.jsx(Ys,{onClick:()=>e(!0),ref:s,children:"Test"}),h.jsx(n,{open:t,children:h.jsxs(ie,{children:[h.jsx(fn,{children:"Option 1"}),h.jsx(fn,{children:"Option 2"}),h.jsx(fn,{children:"Option 3"})]})})]})};M.Badge=Ys,M.BadgeColor=Ia,M.Button=bd,M.ButtonIconRound=Xo,M.ButtonIconSquare=Go,M.Divider=Tm,M.Input=Ds,M.InputCheck=Fd,M.InputDescription=ht,M.InputError=mt,M.InputErrorIcon=Ft,M.InputIconButton=St,M.InputIconButtonTray=Bt,M.InputLabel=Lt,M.InputPassword=Nd,M.InputRadio=Id,M.InputSelect=Oa,M.InputSelectNative=Bd,M.InputSelectOption=Ee,M.InputSelectSearchable=vm,M.InputSelectSearchableAsync=bm,M.InputTextArea=Od,M.InputToggle=Ld,M.Modal=Pm,M.Panel=wm,M.PopoverBase=Na,M.PopoverButton=fn,M.PopoverPanel=ie,M.Spinner=Xe,M.TabButtons=Cm,M.Test=Mm,M.Tooltip=Sm,M.usePopover=se,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})}));
128
+ */var eh=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Bs=eh.join(","),ta=typeof Element>"u",Me=ta?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,sn=!ta&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},rn=function t(e,n){var s;n===void 0&&(n=!0);var i=e==null||(s=e.getAttribute)===null||s===void 0?void 0:s.call(e,"inert"),o=i===""||i==="true",r=o||n&&e&&t(e.parentNode);return r},nh=function(e){var n,s=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return s===""||s==="true"},sh=function(e,n,s){if(rn(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(Bs));return n&&Me.call(e,Bs)&&i.unshift(e),i=i.filter(s),i},ih=function t(e,n,s){for(var i=[],o=Array.from(e);o.length;){var r=o.shift();if(!rn(r,!1))if(r.tagName==="SLOT"){var a=r.assignedElements(),l=a.length?a:r.children,u=t(l,!0,s);s.flatten?i.push.apply(i,u):i.push({scopeParent:r,candidates:u})}else{var c=Me.call(r,Bs);c&&s.filter(r)&&(n||!e.includes(r))&&i.push(r);var f=r.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(r),d=!rn(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(r));if(f&&d){var m=t(f===!0?r.children:f.children,!0,s);s.flatten?i.push.apply(i,m):i.push({scopeParent:r,candidates:m})}else o.unshift.apply(o,r.children)}}return i},ea=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},na=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||nh(e))&&!ea(e)?0:e.tabIndex},rh=function(e,n){var s=na(e);return s<0&&n&&!ea(e)?0:s},oh=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},sa=function(e){return e.tagName==="INPUT"},ah=function(e){return sa(e)&&e.type==="hidden"},lh=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(s){return s.tagName==="SUMMARY"});return n},ch=function(e,n){for(var s=0;s<e.length;s++)if(e[s].checked&&e[s].form===n)return e[s]},uh=function(e){if(!e.name)return!0;var n=e.form||sn(e),s=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=s(window.CSS.escape(e.name));else try{i=s(e.name)}catch(r){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",r.message),!1}var o=ch(i,e.form);return!o||o===e},fh=function(e){return sa(e)&&e.type==="radio"},dh=function(e){return fh(e)&&!uh(e)},hh=function(e){var n,s=e&&sn(e),i=(n=s)===null||n===void 0?void 0:n.host,o=!1;if(s&&s!==e){var r,a,l;for(o=!!((r=i)!==null&&r!==void 0&&(a=r.ownerDocument)!==null&&a!==void 0&&a.contains(i)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!o&&i;){var u,c,f;s=sn(i),i=(u=s)===null||u===void 0?void 0:u.host,o=!!((c=i)!==null&&c!==void 0&&(f=c.ownerDocument)!==null&&f!==void 0&&f.contains(i))}}return o},ia=function(e){var n=e.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},mh=function(e,n){var s=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var o=Me.call(e,"details>summary:first-of-type"),r=o?e.parentElement:e;if(Me.call(r,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="legacy-full"){if(typeof i=="function"){for(var a=e;e;){var l=e.parentElement,u=sn(e);if(l&&!l.shadowRoot&&i(l)===!0)return ia(e);e.assignedSlot?e=e.assignedSlot:!l&&u!==e.ownerDocument?e=u.host:e=l}e=a}if(hh(e))return!e.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return ia(e);return!1},ph=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var i=n.children.item(s);if(i.tagName==="LEGEND")return Me.call(n,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}n=n.parentElement}return!1},gh=function(e,n){return!(n.disabled||rn(n)||ah(n)||mh(n,e)||lh(n)||ph(n))},ra=function(e,n){return!(dh(n)||na(n)<0||!gh(e,n))},yh=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},vh=function t(e){var n=[],s=[];return e.forEach(function(i,o){var r=!!i.scopeParent,a=r?i.scopeParent:i,l=rh(a,r),u=r?t(i.candidates):a;l===0?r?n.push.apply(n,u):n.push(a):s.push({documentOrder:o,tabIndex:l,item:i,isScope:r,content:u})}),s.sort(oh).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},oa=function(e,n){n=n||{};var s;return n.getShadowRoot?s=ih([e],n.includeContainer,{filter:ra.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:yh}):s=sh(e,n.includeContainer,ra.bind(null,n)),vh(s)};function xh(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function bh(){return/apple/i.test(navigator.vendor)}function wh(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function Th(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&ks(n)){let s=e;for(;s;){if(t===s)return!0;s=s.parentNode||s.host}}return!1}function _s(t){return t?.ownerDocument||document}var Sh=typeof document<"u",Ph=function(){},jt=Sh?T.useLayoutEffect:Ph;const Ch={...P}.useInsertionEffect||(t=>t());function Eh(t){const e=P.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Ch(()=>{e.current=t}),P.useCallback(function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return e.current==null?void 0:e.current(...s)},[])}const aa=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function la(t,e){const n=oa(t,aa()),s=n.length;if(s===0)return;const i=wh(_s(t)),o=n.indexOf(i),r=o===-1?e===1?0:s-1:o+e;return n[r]}function Ah(t){return la(_s(t).body,1)||t}function Rh(t){return la(_s(t).body,-1)||t}function $s(t,e){const n=e||t.currentTarget,s=t.relatedTarget;return!s||!Th(n,s)}function jh(t){oa(t,aa()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ca(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function ua(t,e,n){let{reference:s,floating:i}=t;const o=Fs(e),r=Jd(e),a=qd(r),l=Ls(e),u=o==="y",c=s.x+s.width/2-i.width/2,f=s.y+s.height/2-i.height/2,d=s[a]/2-i[a]/2;let m;switch(l){case"top":m={x:c,y:s.y-i.height};break;case"bottom":m={x:c,y:s.y+s.height};break;case"right":m={x:s.x+s.width,y:f};break;case"left":m={x:s.x-i.width,y:f};break;default:m={x:s.x,y:s.y}}switch(Qo(e)){case"start":m[r]-=d*(n&&u?-1:1);break;case"end":m[r]+=d*(n&&u?-1:1);break}return m}const Mh=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e));let u=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:f}=ua(u,s,l),d=s,m={},p=0;for(let g=0;g<a.length;g++){const{name:x,fn:y}=a[g],{x:w,y:v,data:E,reset:S}=await y({x:c,y:f,initialPlacement:s,placement:d,strategy:i,middlewareData:m,rects:u,platform:r,elements:{reference:t,floating:e}});c=w??c,f=v??f,m={...m,[x]:{...m[x],...E}},S&&p<=50&&(p++,typeof S=="object"&&(S.placement&&(d=S.placement),S.rects&&(u=S.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:c,y:f}=ua(u,d,l)),g=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:m}};async function Dh(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:o,rects:r,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=Jo(e,t),p=th(m),x=a[d?f==="floating"?"reference":"floating":f],y=nn(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),w=f==="floating"?{x:s,y:i,width:r.floating.width,height:r.floating.height}:r.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),E=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},S=nn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:v,strategy:l}):w);return{top:(y.top-S.top+p.top)/E.y,bottom:(S.bottom-y.bottom+p.bottom)/E.y,left:(y.left-S.left+p.left)/E.x,right:(S.right-y.right+p.right)/E.x}}const Vh=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,s;const{placement:i,rects:o,platform:r,elements:a}=e,{apply:l=()=>{},...u}=Jo(t,e),c=await Dh(e,u),f=Ls(i),d=Qo(i),m=Fs(i)==="y",{width:p,height:g}=o.floating;let x,y;f==="top"||f==="bottom"?(x=f,y=d===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,x=d==="end"?"top":"bottom");const w=g-c.top-c.bottom,v=p-c.left-c.right,E=je(g-c[x],w),S=je(p-c[y],v),C=!e.middlewareData.shift;let A=E,R=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(R=v),(s=e.middlewareData.shift)!=null&&s.enabled.y&&(A=w),C&&!d){const O=rt(c.left,0),U=rt(c.right,0),et=rt(c.top,0),I=rt(c.bottom,0);m?R=p-2*(O!==0||U!==0?O+U:rt(c.left,c.right)):A=g-2*(et!==0||I!==0?et+I:rt(c.top,c.bottom))}await l({...e,availableWidth:R,availableHeight:A});const N=await r.getDimensions(a.floating);return p!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function fa(t){const e=lt(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=gt(t),o=i?t.offsetWidth:n,r=i?t.offsetHeight:s,a=tn(n)!==o||tn(s)!==r;return a&&(n=o,s=r),{width:n,height:s,$:a}}function Ws(t){return G(t)?t:t.contextElement}function ne(t){const e=Ws(t);if(!gt(e))return yt(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:o}=fa(e);let r=(o?tn(n.width):n.width)/s,a=(o?tn(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const kh=yt(0);function da(t){const e=tt(t);return!Os()||!e.visualViewport?kh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Nh(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==tt(t)?!1:e}function _t(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Ws(t);let r=yt(1);e&&(s?G(s)&&(r=ne(s)):r=ne(t));const a=Nh(o,n,s)?da(o):yt(0);let l=(i.left+a.x)/r.x,u=(i.top+a.y)/r.y,c=i.width/r.x,f=i.height/r.y;if(o){const d=tt(o),m=s&&G(s)?tt(s):s;let p=d,g=Is(p);for(;g&&s&&m!==p;){const x=ne(g),y=g.getBoundingClientRect(),w=lt(g),v=y.left+(g.clientLeft+parseFloat(w.paddingLeft))*x.x,E=y.top+(g.clientTop+parseFloat(w.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,f*=x.y,l+=v,u+=E,p=tt(g),g=Is(p)}}return nn({width:c,height:f,x:l,y:u})}function on(t,e){const n=Qe(t).scrollLeft;return e?e.left+n:_t(pt(t)).left+n}function ha(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-on(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function Oh(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const o=i==="fixed",r=pt(s),a=e?Je(e.floating):!1;if(s===r||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=yt(1);const c=yt(0),f=gt(s);if((f||!f&&!o)&&((te(s)!=="body"||Ae(r))&&(l=Qe(s)),gt(s))){const m=_t(s);u=ne(s),c.x=m.x+s.clientLeft,c.y=m.y+s.clientTop}const d=r&&!f&&!o?ha(r,l):yt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:n.y*u.y-l.scrollTop*u.y+c.y+d.y}}function Ih(t){return Array.from(t.getClientRects())}function Lh(t){const e=pt(t),n=Qe(t),s=t.ownerDocument.body,i=rt(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),o=rt(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let r=-n.scrollLeft+on(t);const a=-n.scrollTop;return lt(s).direction==="rtl"&&(r+=rt(e.clientWidth,s.clientWidth)-i),{width:i,height:o,x:r,y:a}}const ma=25;function Fh(t,e){const n=tt(t),s=pt(t),i=n.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(i){o=i.width,r=i.height;const c=Os();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=on(s);if(u<=0){const c=s.ownerDocument,f=c.body,d=getComputedStyle(f),m=c.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(s.clientWidth-f.clientWidth-m);p<=ma&&(o-=p)}else u<=ma&&(o+=u);return{width:o,height:r,x:a,y:l}}const Bh=new Set(["absolute","fixed"]);function _h(t,e){const n=_t(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,o=gt(t)?ne(t):yt(1),r=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,u=s*o.y;return{width:r,height:a,x:l,y:u}}function pa(t,e,n){let s;if(e==="viewport")s=Fh(t,n);else if(e==="document")s=Lh(pt(t));else if(G(e))s=_h(e,n);else{const i=da(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return nn(s)}function ga(t,e){const n=Rt(t);return n===e||!G(n)||ee(n)?!1:lt(n).position==="fixed"||ga(n,e)}function $h(t,e){const n=e.get(t);if(n)return n;let s=Re(t,[],!1).filter(a=>G(a)&&te(a)!=="body"),i=null;const o=lt(t).position==="fixed";let r=o?Rt(t):t;for(;G(r)&&!ee(r);){const a=lt(r),l=Ns(r);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&Bh.has(i.position)||Ae(r)&&!l&&ga(t,r))?s=s.filter(c=>c!==r):i=a,r=Rt(r)}return e.set(t,s),s}function Wh(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const r=[...n==="clippingAncestors"?Je(e)?[]:$h(e,this._c):[].concat(n),s],a=r[0],l=r.reduce((u,c)=>{const f=pa(e,c,i);return u.top=rt(f.top,u.top),u.right=je(f.right,u.right),u.bottom=je(f.bottom,u.bottom),u.left=rt(f.left,u.left),u},pa(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Uh(t){const{width:e,height:n}=fa(t);return{width:e,height:n}}function zh(t,e,n){const s=gt(e),i=pt(e),o=n==="fixed",r=_t(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=yt(0);function u(){l.x=on(i)}if(s||!s&&!o)if((te(e)!=="body"||Ae(i))&&(a=Qe(e)),s){const m=_t(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else i&&u();o&&!s&&i&&u();const c=i&&!s&&!o?ha(i,a):yt(0),f=r.left+a.scrollLeft-l.x-c.x,d=r.top+a.scrollTop-l.y-c.y;return{x:f,y:d,width:r.width,height:r.height}}function Us(t){return lt(t).position==="static"}function ya(t,e){if(!gt(t)||lt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return pt(t)===n&&(n=n.ownerDocument.body),n}function va(t,e){const n=tt(t);if(Je(t))return n;if(!gt(t)){let i=Rt(t);for(;i&&!ee(i);){if(G(i)&&!Us(i))return i;i=Rt(i)}return n}let s=ya(t,e);for(;s&&Wd(s)&&Us(s);)s=ya(s,e);return s&&ee(s)&&Us(s)&&!Ns(s)?n:s||Hd(t)||n}const Kh=async function(t){const e=this.getOffsetParent||va,n=this.getDimensions,s=await n(t.floating);return{reference:zh(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Yh(t){return lt(t).direction==="rtl"}const Hh={convertOffsetParentRelativeRectToViewportRelativeRect:Oh,getDocumentElement:pt,getClippingRect:Wh,getOffsetParent:va,getElementRects:Kh,getClientRects:Ih,getDimensions:Uh,getScale:ne,isElement:G,isRTL:Yh};function xa(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Gh(t,e){let n=null,s;const i=pt(t);function o(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function r(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=t.getBoundingClientRect(),{left:c,top:f,width:d,height:m}=u;if(a||e(),!d||!m)return;const p=en(f),g=en(i.clientWidth-(c+d)),x=en(i.clientHeight-(f+m)),y=en(c),v={rootMargin:-p+"px "+-g+"px "+-x+"px "+-y+"px",threshold:rt(0,je(1,l))||1};let E=!0;function S(C){const A=C[0].intersectionRatio;if(A!==l){if(!E)return r();A?r(!1,A):s=setTimeout(()=>{r(!1,1e-7)},1e3)}A===1&&!xa(u,t.getBoundingClientRect())&&r(),E=!1}try{n=new IntersectionObserver(S,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,v)}n.observe(t)}return r(!0),o}function Xh(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,u=Ws(t),c=i||o?[...u?Re(u):[],...Re(e)]:[];c.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const f=u&&a?Gh(u,n):null;let d=-1,m=null;r&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(e)})),n()}),u&&!l&&m.observe(u),m.observe(e));let p,g=l?_t(t):null;l&&x();function x(){const y=_t(t);g&&!xa(g,y)&&n(),g=y,p=requestAnimationFrame(x)}return n(),()=>{var y;c.forEach(w=>{i&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),f?.(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const qh=Vh,Zh=(t,e,n)=>{const s=new Map,i={platform:Hh,...n},o={...i.platform,_c:s};return Mh(t,e,{...i,platform:o})};var Jh=typeof document<"u",Qh=function(){},an=Jh?T.useLayoutEffect:Qh;function ln(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,s,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(s=n;s--!==0;)if(!ln(t[s],e[s]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(e,i[s]))return!1;for(s=n;s--!==0;){const o=i[s];if(!(o==="_owner"&&t.$$typeof)&&!ln(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function ba(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function wa(t,e){const n=ba(t);return Math.round(e*n)/n}function zs(t){const e=P.useRef(t);return an(()=>{e.current=t}),e}function tm(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:o,floating:r}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,f]=P.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,m]=P.useState(s);ln(d,s)||m(s);const[p,g]=P.useState(null),[x,y]=P.useState(null),w=P.useCallback(k=>{k!==C.current&&(C.current=k,g(k))},[]),v=P.useCallback(k=>{k!==A.current&&(A.current=k,y(k))},[]),E=o||p,S=r||x,C=P.useRef(null),A=P.useRef(null),R=P.useRef(c),N=l!=null,O=zs(l),U=zs(i),et=zs(u),I=P.useCallback(()=>{if(!C.current||!A.current)return;const k={placement:e,strategy:n,middleware:d};U.current&&(k.platform=U.current),Zh(C.current,A.current,k).then(J=>{const b={...J,isPositioned:et.current!==!1};K.current&&!ln(R.current,b)&&(R.current=b,Zs.flushSync(()=>{f(b)}))})},[d,e,n,U,et]);an(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(k=>({...k,isPositioned:!1})))},[u]);const K=P.useRef(!1);an(()=>(K.current=!0,()=>{K.current=!1}),[]),an(()=>{if(E&&(C.current=E),S&&(A.current=S),E&&S){if(O.current)return O.current(E,S,I);I()}},[E,S,I,O,N]);const vt=P.useMemo(()=>({reference:C,floating:A,setReference:w,setFloating:v}),[w,v]),ct=P.useMemo(()=>({reference:E,floating:S}),[E,S]),_=P.useMemo(()=>{const k={position:n,left:0,top:0};if(!ct.floating)return k;const J=wa(ct.floating,c.x),b=wa(ct.floating,c.y);return a?{...k,transform:"translate("+J+"px, "+b+"px)",...ba(ct.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:b}},[n,a,ct.floating,c.x,c.y]);return P.useMemo(()=>({...c,update:I,refs:vt,elements:ct,floatingStyles:_}),[c,I,vt,ct,_])}const em=(t,e)=>({...qh(t),options:[t,e]}),nm={...P};let Ta=!1,sm=0;const Sa=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+sm++;function im(){const[t,e]=P.useState(()=>Ta?Sa():void 0);return jt(()=>{t==null&&e(Sa())},[]),P.useEffect(()=>{Ta=!0},[]),t}const Pa=nm.useId||im;let Ks;process.env.NODE_ENV!=="production"&&(Ks=new Set);function rm(){for(var t,e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];const i="Floating UI: "+n.join(" ");if(!((t=Ks)!=null&&t.has(i))){var o;(o=Ks)==null||o.add(i),console.error(i)}}function om(){const t=new Map;return{emit(e,n){var s;(s=t.get(e))==null||s.forEach(i=>i(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var s;(s=t.get(e))==null||s.delete(n)}}}const am=P.createContext(null),lm=P.createContext(null),cm=()=>{var t;return((t=P.useContext(am))==null?void 0:t.id)||null},um=()=>P.useContext(lm);function Ca(t){return"data-floating-ui-"+t}const Ea={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Aa=P.forwardRef(function(e,n){const[s,i]=P.useState();jt(()=>{bh()&&i("button")},[]);const o={ref:n,tabIndex:0,role:s,"aria-hidden":s?void 0:!0,[Ca("focus-guard")]:"",style:Ea};return h.jsx("span",{...e,...o})}),Ra=P.createContext(null),ja=Ca("portal");function fm(t){t===void 0&&(t={});const{id:e,root:n}=t,s=Pa(),i=dm(),[o,r]=P.useState(null),a=P.useRef(null);return jt(()=>()=>{o?.remove(),queueMicrotask(()=>{a.current=null})},[o]),jt(()=>{if(!s||a.current)return;const l=e?document.getElementById(e):null;if(!l)return;const u=document.createElement("div");u.id=s,u.setAttribute(ja,""),l.appendChild(u),a.current=u,r(u)},[e,s]),jt(()=>{if(n===null||!s||a.current)return;let l=n||i?.portalNode;l&&!Vs(l)&&(l=l.current),l=l||document.body;let u=null;e&&(u=document.createElement("div"),u.id=e,l.appendChild(u));const c=document.createElement("div");c.id=s,c.setAttribute(ja,""),l=u||l,l.appendChild(c),a.current=c,r(c)},[e,n,s,i]),o}function Ma(t){const{children:e,id:n,root:s,preserveTabOrder:i=!0}=t,o=fm({id:n,root:s}),[r,a]=P.useState(null),l=P.useRef(null),u=P.useRef(null),c=P.useRef(null),f=P.useRef(null),d=r?.modal,m=r?.open,p=!!r&&!r.modal&&r.open&&i&&!!(s||o);return P.useEffect(()=>{if(!o||!i||d)return;function g(x){o&&$s(x)&&(x.type==="focusin"?ca:jh)(o)}return o.addEventListener("focusin",g,!0),o.addEventListener("focusout",g,!0),()=>{o.removeEventListener("focusin",g,!0),o.removeEventListener("focusout",g,!0)}},[o,i,d]),P.useEffect(()=>{o&&(m||ca(o))},[m,o]),h.jsxs(Ra.Provider,{value:P.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:f,portalNode:o,setFocusManagerState:a}),[i,o]),children:[p&&o&&h.jsx(Aa,{"data-type":"outside",ref:l,onFocus:g=>{if($s(g,o)){var x;(x=c.current)==null||x.focus()}else{const y=r?r.domReference:null,w=Rh(y);w?.focus()}}}),p&&o&&h.jsx("span",{"aria-owns":o.id,style:Ea}),o&&Zs.createPortal(e,o),p&&o&&h.jsx(Aa,{"data-type":"outside",ref:u,onFocus:g=>{if($s(g,o)){var x;(x=f.current)==null||x.focus()}else{const y=r?r.domReference:null,w=Ah(y);w?.focus(),r?.closeOnFocusOut&&r?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}const dm=()=>P.useContext(Ra);let cn=0;const Da="--floating-ui-scrollbar-width";function hm(){const t=xh(),e=/iP(hone|ad|od)|iOS/.test(t)||t==="MacIntel"&&navigator.maxTouchPoints>1,n=document.body.style,i=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,r=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(Da,o+"px"),o&&(n[i]=o+"px"),e){var l,u;const c=((l=window.visualViewport)==null?void 0:l.offsetLeft)||0,f=((u=window.visualViewport)==null?void 0:u.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(f))+"px",left:-(r-Math.floor(c))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[i]:""}),n.removeProperty(Da),e&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(r,a))}}let Va=()=>{};const ka=P.forwardRef(function(e,n){const{lockScroll:s=!1,...i}=e;return jt(()=>{if(s)return cn++,cn===1&&(Va=hm()),()=>{cn--,cn===0&&Va()}},[s]),h.jsx("div",{ref:n,...i,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}})});function mm(t){const{open:e=!1,onOpenChange:n,elements:s}=t,i=Pa(),o=P.useRef({}),[r]=P.useState(()=>om()),a=cm()!=null;if(process.env.NODE_ENV!=="production"){const m=s.reference;m&&!G(m)&&rm("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=P.useState(s.reference),c=Eh((m,p,g)=>{o.current.openEvent=m?p:void 0,r.emit("openchange",{open:m,event:p,reason:g,nested:a}),n?.(m,p,g)}),f=P.useMemo(()=>({setPositionReference:u}),[]),d=P.useMemo(()=>({reference:l||s.reference||null,floating:s.floating||null,domReference:s.reference}),[l,s.reference,s.floating]);return P.useMemo(()=>({dataRef:o,open:e,onOpenChange:c,elements:d,events:r,floatingId:i,refs:f}),[e,c,d,r,i,f])}function pm(t){t===void 0&&(t={});const{nodeId:e}=t,n=mm({...t,elements:{reference:null,floating:null,...t.elements}}),s=t.rootContext||n,i=s.elements,[o,r]=P.useState(null),[a,l]=P.useState(null),c=i?.domReference||o,f=P.useRef(null),d=um();jt(()=>{c&&(f.current=c)},[c]);const m=tm({...t,elements:{...i,...a&&{reference:a}}}),p=P.useCallback(v=>{const E=G(v)?{getBoundingClientRect:()=>v.getBoundingClientRect(),getClientRects:()=>v.getClientRects(),contextElement:v}:v;l(E),m.refs.setReference(E)},[m.refs]),g=P.useCallback(v=>{(G(v)||v===null)&&(f.current=v,r(v)),(G(m.refs.reference.current)||m.refs.reference.current===null||v!==null&&!G(v))&&m.refs.setReference(v)},[m.refs]),x=P.useMemo(()=>({...m.refs,setReference:g,setPositionReference:p,domReference:f}),[m.refs,g,p]),y=P.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),w=P.useMemo(()=>({...m,...s,refs:x,elements:y,nodeId:e}),[m,x,y,e,s]);return jt(()=>{s.dataRef.current.floatingContext=w;const v=d?.nodesRef.current.find(E=>E.id===e);v&&(v.context=w)}),P.useMemo(()=>({...m,context:w,refs:x,elements:y}),[m,x,y,w])}const gm={top:"bottom center","top-start":"bottom left","top-end":"bottom right",right:"left center","right-start":"top left","right-end":"bottom left",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"top right","left-end":"bottom right"},Na=P.memo(({open:t,children:e,className:n,onOutsideClick:s,floatingStyles:i,setFloating:o,placement:r})=>h.jsx(Ma,{children:h.jsx(ss,{children:t&&h.jsxs(h.Fragment,{children:[s&&h.jsx(ka,{onClick:s}),h.jsx("div",{ref:o,style:i,className:"z-10",children:h.jsx(Pe.div,{className:n,style:{transformOrigin:gm[r]},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeInOut"},children:e})})]})})})),se=t=>{const{placement:e="bottom",onOutsideClick:n,fullWidth:s,minWidth:i,maxWidth:o}=t,r=P.useMemo(()=>[em({apply({rects:f,elements:d}){s&&(d.floating.style.width=`${f.reference.width}px`),i&&(d.floating.style.minWidth=`${i}px`),o&&(d.floating.style.maxWidth=`${o}px`)}})],[s,o,i]),{refs:a,floatingStyles:l}=pm({placement:e,middleware:r,whileElementsMounted:Xh}),u=P.useRef({onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:e});u.current={onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:e};const c=P.useMemo(()=>{const f=d=>{const{floatingStyles:m,setFloating:p,onOutsideClick:g,placement:x}=u.current,{className:y,open:w,children:v}=d;return h.jsx(Na,{open:w,className:y,onOutsideClick:g,floatingStyles:m,setFloating:p,placement:x,children:v})};return P.memo(f)},[]);return{anchorRef:a.setReference,Popover:c}},ym="flex flex-col bg-white border mt-1 border-gray-200 rounded-xl shadow-lg p-3 overflow-y-auto relative",ie=t=>{const{className:e,children:n,...s}=t;return h.jsx("div",{className:V(ym,e),...s,children:n})},un=(t,e)=>{T.useEffect(()=>{if(!t)return;const n=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[t,e])},Oa=t=>{const{className:e,label:n,description:s,options:i,onChange:o,value:r,placeholder:a,maxHeight:l=300,error:u}=t,[c,f]=T.useState(!1),d=P.useRef(null),m=i?.find(x=>x.value===r);un(c,()=>f(!1)),T.useEffect(()=>{c&&d.current?.focus({preventScroll:!0})},[c]);const{anchorRef:p,Popover:g}=se({placement:"bottom",fullWidth:!0,onOutsideClick:()=>f(!1)});return h.jsxs("div",{className:V("flex flex-col",e),children:[h.jsx(Lt,{children:n}),h.jsxs("div",{className:"relative flex w-full flex-col",ref:p,children:[h.jsxs("div",{ref:d,role:"button",tabIndex:0,className:V("flex flex-row items-center h-12 pl-4 pr-10 border border-gray-200 text-gray-900 placeholder:text-gray-400 bg-white transition-all duration-150 rounded-xl shadow-sm ring-0 ring-gray-900/10 focus:ring-4 focus:outline-none select-none",u&&"border-red-600 ring-red-600/20 !pr-10",c&&"ring-4"),onKeyDown:x=>x.key===" "&&f(y=>!y),onClick:()=>f(!c),children:[m&&h.jsx("span",{children:m.label}),!m&&a&&h.jsx("span",{className:"text-gray-500",children:a})]}),h.jsxs(Bt,{children:[u&&h.jsx(Ft,{}),!!r&&h.jsx(St,{Icon:Ce,onClick:()=>o(null)}),h.jsx(St,{Icon:qe})]}),h.jsx(g,{open:c,children:h.jsx(ie,{className:"!p-0",style:{maxHeight:l},children:h.jsx("div",{className:"flex flex-col p-2 gap-1",children:i.map(x=>{const y=x.value===r;return h.jsx(Ee,{onClick:()=>{!x.disabled&&o&&(o(x.value),f(!1))},selected:y,disabled:x.disabled,children:x.label},String(x.value))})})})})]}),h.jsx(ht,{children:s}),h.jsx(mt,{children:u})]})},vm=t=>{const{className:e,label:n,description:s,options:i,onChange:o,onSearch:r,value:a,placeholder:l,maxHeight:u=300,error:c}=t,[f,d]=T.useState(!1),[m,p]=T.useState(i),[g,x]=T.useState(""),y=P.useRef(null),w=P.useRef(null),v=i?.find(C=>C.value===a);un(f,()=>d(!1)),T.useEffect(()=>{p(r(g))},[g,i,r]),T.useEffect(()=>{f&&w.current?.focus()},[f]);const{anchorRef:E,Popover:S}=se({placement:"bottom",fullWidth:!0,onOutsideClick:()=>d(!1)});return h.jsxs("div",{className:V("flex flex-col",e),children:[h.jsx(Lt,{children:n}),h.jsxs("div",{className:"relative flex w-full flex-col",ref:E,children:[h.jsxs("div",{ref:y,role:"button",tabIndex:0,className:V("flex flex-row items-center h-12 pl-4 pr-10 border border-gray-200 text-gray-900 placeholder:text-gray-400 bg-white transition-all duration-150 rounded-xl shadow-sm ring-0 ring-gray-900/10 focus:ring-4 focus:outline-none select-none",c&&"border-red-600 ring-red-600/20 !pr-10",f&&"ring-4"),onKeyDown:C=>C.key===" "&&d(A=>!A),onClick:()=>d(!f),children:[v&&h.jsx("span",{children:v.label}),!v&&l&&h.jsx("span",{className:"text-gray-500",children:l})]}),h.jsxs(Bt,{children:[c&&h.jsx(Ft,{}),!!a&&h.jsx(St,{Icon:Ce,onClick:()=>o(null)}),h.jsx(St,{Icon:qe})]}),h.jsx(S,{open:f,children:h.jsxs(ie,{className:"gap-0 !p-0",style:{maxHeight:u},children:[h.jsxs("div",{className:"sticky top-0 border-b border-b-gray-200 py-1 bg-white/50 backdrop-blur-sm",children:[h.jsx("input",{ref:w,type:"text",placeholder:"Search",value:g,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-gray-400",onChange:C=>x(C.target.value)}),h.jsx(Ms,{className:"absolute text-gray-500 left-4 top-4 h-4 w-4"})]}),h.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[g!==""&&h.jsxs(h.Fragment,{children:[m.length===0&&h.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:h.jsx(qo,{className:"h-6 w-6 text-gray-900"})}),m.map(C=>{const A=C.value===a;return h.jsx(Ee,{onClick:()=>{!C.disabled&&o&&(o(C.value),d(!1))},selected:A,disabled:C.disabled,children:C.label},String(C.value))})]}),g===""&&h.jsx(h.Fragment,{children:i.map(C=>{const A=C.value===a;return h.jsx(Ee,{onClick:()=>{!C.disabled&&o&&(o(C.value),d(!1))},selected:A,disabled:C.disabled,children:C.label},String(C.value))})})]})]})})]}),h.jsx(ht,{children:s}),h.jsx(mt,{children:c})]})},xm=(t,e)=>{const[n,s]=T.useState(t);return T.useEffect(()=>{const i=setTimeout(()=>{s(t)},e);return()=>{clearTimeout(i)}},[t,e]),n},bm=t=>{const{className:e,label:n,description:s,onChange:i,fetchOptionsByQuery:o,fetchOptionByValue:r,onSearchDebounceMs:a=300,value:l,placeholder:u,maxHeight:c=300,error:f}=t,[d,m]=T.useState(!1),p=P.useRef(null),[g,x]=T.useState(""),[y,w]=T.useState([]),[v,E]=T.useState(null),S=P.useRef(null),[C,A]=T.useState(!1),[R,N]=T.useState(!1);un(d,()=>m(!1));const O=xm(g,a);T.useEffect(()=>{(async()=>{A(!0);const K=await o(O);w(K),A(!1)})()},[O,o]),T.useEffect(()=>{if(l==null){E(null);return}const I=y?.find(K=>K.value===l);I?E(I):(async()=>{N(!0);const vt=await r(l);E(vt),N(!1)})()},[r,y,l]),T.useEffect(()=>{d&&S.current?.focus()},[d]);const{anchorRef:U,Popover:et}=se({placement:"bottom",fullWidth:!0,onOutsideClick:()=>m(!1)});return h.jsxs("div",{className:V("flex flex-col",e),children:[h.jsx(Lt,{children:n}),h.jsxs("div",{className:"relative flex w-full flex-col",ref:U,children:[h.jsxs("div",{ref:p,role:"button",tabIndex:0,className:V("flex flex-row items-center h-12 pl-4 pr-10 border border-gray-200 text-gray-900 placeholder:text-gray-400 bg-white transition-all duration-150 rounded-xl shadow-sm ring-0 ring-gray-900/10 focus:ring-4 focus:outline-none select-none",f&&"border-red-600 ring-red-600/20 !pr-10",d&&"ring-4"),onKeyDown:I=>I.key===" "&&m(K=>!K),onClick:()=>m(!d),children:[!R&&v&&h.jsx("span",{children:v.label}),!R&&!v&&u&&h.jsx("span",{children:u}),R&&h.jsx(Xe,{className:"h-4 w-4 text-gray-600"})]}),h.jsxs(Bt,{children:[f&&h.jsx(Ft,{}),!!l&&h.jsx(St,{Icon:Ce,onClick:()=>i(null)}),h.jsx(St,{Icon:qe})]}),h.jsx(et,{open:d,children:h.jsxs(ie,{className:"gap-0 !p-0",style:{maxHeight:c},children:[h.jsxs("div",{className:"sticky top-0 border-b border-b-gray-200 py-1 bg-white/50 backdrop-blur-sm",children:[h.jsx("input",{ref:S,type:"text",placeholder:"Search",value:g,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-gray-400",onChange:I=>x(I.target.value)}),h.jsx(Ms,{className:"absolute text-gray-500 left-4 top-4 h-4 w-4"})]}),h.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[!C&&y.length===0&&h.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:h.jsx(qo,{className:"h-6 w-6 text-gray-900"})}),C&&h.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:h.jsx(Xe,{className:"h-6 w-6 text-gray-900"})}),!C&&h.jsx(h.Fragment,{children:y.map(I=>{const K=I.value===l;return h.jsx(Ee,{onClick:()=>{!I.disabled&&i&&(i(I.value),m(!1))},selected:K,disabled:I.disabled,children:I.label},String(I.value))})})]})]})})]}),h.jsx(ht,{children:s}),h.jsx(mt,{children:f})]})},wm=P.forwardRef((t,e)=>{const{className:n,children:s,...i}=t;return h.jsx("div",{ref:e,className:V("flex flex-col gap-6 border border-gray-200 rounded-xl bg-white shadow-sm px-6 py-6",n),...i,children:s})}),Tm=t=>{const{className:e,vertical:n=!1,...s}=t;return h.jsx("div",{className:V(n?"w-px h-full bg-gray-200":"w-full h-px bg-gray-200",e),...s})},Sm=t=>{const{children:e,content:n,className:s,placement:i="top",minWidth:o=100,maxWidth:r=200}=t,[a,l]=T.useState(!1),{anchorRef:u,Popover:c}=se({placement:i,minWidth:o,maxWidth:r});return h.jsxs("span",{ref:u,className:s,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[e,h.jsx(c,{open:a,children:h.jsx(ie,{children:n})})]})},Pm=t=>{const{open:e,onDismiss:n,enableDismissOnOutsideClick:s,enableDismissOnEscKey:i,enableDismissButton:o,className:r,children:a,maxWidth:l=600}=t;return un(!!i&&e,n||(()=>{})),h.jsx(ss,{children:e&&h.jsxs(Ma,{children:[h.jsx(Pe.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:h.jsx(ka,{className:"bg-gray-400/30 backdrop-blur-[1px] z-10",onClick:s?n:void 0,lockScroll:!0})}),h.jsx("div",{className:"fixed inset-0 flex flex-col items-center pointer-events-none p-4 lg:p-12 overflow-y-auto z-20",children:h.jsxs(Pe.div,{className:V("flex flex-col bg-white rounded-xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",r),style:{transformOrigin:"bottom",maxWidth:l},initial:{opacity:0,scale:.98,translateY:10},animate:{opacity:1,scale:1,translateY:0},exit:{opacity:0,scale:.98,translateY:10},transition:{duration:.15,ease:"easeInOut"},children:[o&&h.jsx(Xo,{Icon:Ce,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},Ia={red:"bg-red-100 text-red-700 ring-red-200",orange:"bg-orange-100 text-orange-700 ring-orange-200",amber:"bg-amber-100 text-amber-700 ring-amber-200",yellow:"bg-yellow-100 text-yellow-700 ring-yellow-200",lime:"bg-lime-100 text-lime-700 ring-lime-200",green:"bg-green-100 text-green-700 ring-green-200",emerald:"bg-emerald-100 text-emerald-700 ring-emerald-200",teal:"bg-teal-100 text-teal-700 ring-teal-200",cyan:"bg-cyan-100 text-cyan-700 ring-cyan-200",sky:"bg-sky-100 text-sky-700 ring-sky-200",blue:"bg-blue-100 text-blue-700 ring-blue-200",indigo:"bg-indigo-100 text-indigo-700 ring-indigo-200",violet:"bg-violet-100 text-violet-700 ring-violet-200",purple:"bg-purple-100 text-purple-700 ring-purple-200",fuchsia:"bg-fuchsia-100 text-fuchsia-700 ring-fuchsia-200",pink:"bg-pink-100 text-pink-700 ring-pink-200",rose:"bg-rose-100 text-rose-700 ring-rose-200",slate:"bg-slate-100 text-slate-700 ring-slate-200",gray:"bg-gray-100 text-gray-700 ring-gray-200",zinc:"bg-zinc-100 text-zinc-700 ring-zinc-200",neutral:"bg-neutral-100 text-neutral-700 ring-neutral-200",stone:"bg-stone-100 text-stone-700 ring-stone-200",white:"bg-white text-gray-900 ring-stone-200",black:"bg-black text-white ring-stone-200"},Ys=P.forwardRef((t,e)=>{const{className:n,children:s,onClick:i,showCloseIcon:o,Icon:r,color:a="gray"}=t,l=V("inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",Ia[a],n);return i?h.jsx("div",{ref:e,children:h.jsxs("button",{className:V("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4",l),onClick:i,children:[r&&h.jsx(r,{className:"h-4 w-4 shrink-0"}),h.jsx("div",{className:"break-all line-clamp-1 text-left",children:s}),o&&h.jsx(Ce,{className:"h-4 w-4 shrink-0"})]})}):h.jsxs("div",{className:l,ref:e,children:[r&&h.jsx(r,{className:"h-4 w-4 shrink-0"}),h.jsx("div",{className:"break-all line-clamp-1 text-left",children:s})]})}),Cm=t=>{const{className:e,tabs:n}=t;return h.jsx("div",{className:V("h-12 bg-gray-100 p-1 rounded-xl inline-flex flex-row space-x-1 overflow-x-auto",e),children:n.map((s,i)=>{const o=V("shrink-0 px-4 h-full inline-flex flex-row items-center font-semibold rounded-xl cursor-pointer border border-transparent ing-0 hover:bg-gray-200 active:bg-gray-300/80 transition-all duration-150 select-none focus:outline-none focus:ring-0",s.active&&"bg-white shadow-sm !border-gray-300");return s.href?h.jsx("a",{href:s.href,className:o,children:s.label},i):h.jsx("button",{className:o,onClick:s.onClick,children:s.label},i)})})},Em="inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 hover:bg-gray-100 active:bg-gray-200 rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent text-gray-900 bg-transparent ring-gray-900/10",fn=P.forwardRef((t,e)=>{const{className:n,children:s,Icon:i,...o}=t;return h.jsxs("button",{ref:e,className:V(Em,n),...o,children:[i&&h.jsx(i,{className:"h-5 w-5"}),s]})}),Am=t=>{const{columns:e,rows:n}=t;return h.jsx("div",{className:"border border-gray-200 rounded-xl shadow-sm overflow-hidden",children:h.jsxs("table",{className:"table-fixed",children:[h.jsx("colgroup",{children:e.map(s=>h.jsx("col",{width:250},s.id))}),h.jsx("thead",{children:h.jsx("tr",{className:"divide-gray-200 divide-x text-left bg-gray-50 text-gray-400 border-b border-b-gray-200",children:e.map(s=>h.jsx("th",{className:"font-medium h-[3rem] relative hover:bg-gray-100 cursor-pointer active:bg-gray-200 transition-colors duration-150",children:h.jsx("div",{className:"absolute inset-0",children:h.jsx("div",{className:"flex items-center h-full w-full px-4",children:s.header})})},s.id))})}),h.jsx("tbody",{className:"divide-y divide-gray-200",children:n.map((s,i)=>h.jsx("tr",{className:"divide-gray-200 divide-x",children:e.map(o=>h.jsx("td",{className:"h-[3rem] relative",children:h.jsx("div",{className:"absolute inset-0 ",children:h.jsx("div",{className:"flex items-center h-full w-full px-4",children:o.renderCell(s)})})},o.id))},i))})]})})},Rm=[{id:1,email:"matthiaskrijgsman@gmail.com",firstname:"Matthias",lastname:"Krijgsman",status:"active"},{id:2,email:"dennis@snijder.io",firstname:"Dennis",lastname:"Snijder",status:"inactive"},{id:3,email:"arcokrijgsman@gmail.com",firstname:"Arco",lastname:"Krijgsman",status:"active"}],jm=[{id:"id",header:"ID",renderCell:t=>t.id},{id:"email",header:"Email",renderCell:t=>h.jsx(Ys,{Icon:kd,onClick:()=>{},children:t.email})},{id:"firstname",header:"First Name",renderCell:t=>t.firstname},{id:"lastname",header:"Last Name",renderCell:t=>t.lastname},{id:"status",header:"Status",renderCell:()=>h.jsx(Dm,{})}],Mm=()=>h.jsxs("div",{className:"flex flex-col gap-6",children:[h.jsxs("div",{className:"flex flex-row items-center justify-start gap-3",children:[h.jsx(Ds,{Icon:Ms,placeholder:"Search..."}),h.jsx(Go,{Icon:Dd})]}),h.jsx(Am,{columns:jm,rows:Rm}),h.jsx(Oa,{options:[{label:"Option 1",value:1},{label:"Option 2",value:2},{label:"Option 3",value:3}],value:null,onChange:()=>{}})]}),Dm=()=>{const[t,e]=T.useState(!1),{Popover:n,anchorRef:s}=se({fullWidth:!0,onOutsideClick:()=>e(!1),minWidth:150});return h.jsxs(h.Fragment,{children:[h.jsx(Ys,{onClick:()=>e(!0),ref:s,children:"Test"}),h.jsx(n,{open:t,children:h.jsxs(ie,{children:[h.jsx(fn,{children:"Option 1"}),h.jsx(fn,{children:"Option 2"}),h.jsx(fn,{children:"Option 3"})]})})]})};M.Badge=Ys,M.BadgeColor=Ia,M.Button=bd,M.ButtonIconRound=Xo,M.ButtonIconSquare=Go,M.Divider=Tm,M.Input=Ds,M.InputCheck=Fd,M.InputDescription=ht,M.InputError=mt,M.InputErrorIcon=Ft,M.InputIconButton=St,M.InputIconButtonTray=Bt,M.InputLabel=Lt,M.InputPassword=Nd,M.InputRadio=Id,M.InputSelect=Oa,M.InputSelectNative=Bd,M.InputSelectOption=Ee,M.InputSelectSearchable=vm,M.InputSelectSearchableAsync=bm,M.InputTextArea=Od,M.InputToggle=Ld,M.Modal=Pm,M.Panel=wm,M.PopoverBase=Na,M.PopoverButton=fn,M.PopoverPanel=ie,M.Spinner=Xe,M.TabButtons=Cm,M.Test=Mm,M.Tooltip=Sm,M.usePopover=se,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})}));
129
129
  //# sourceMappingURL=index.umd.cjs.map