rently-components 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -6671,7 +6671,7 @@ const sl = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], il = Po("chevron-do
6671
6671
  $c,
6672
6672
  {
6673
6673
  className: ee(
6674
- "text-sm px-3 py-2 rounded-lg bg-bg-1 cursor-pointer hover:bg-bg-2 outline-none",
6674
+ "text-sm px-3 py-2 rounded-lg bg-bg-1 text-text-1 cursor-pointer hover:bg-bg-2 outline-none",
6675
6675
  t
6676
6676
  ),
6677
6677
  ...n,
@@ -6752,7 +6752,7 @@ const sl = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], il = Po("chevron-do
6752
6752
  defaultValue: r,
6753
6753
  children: [
6754
6754
  /* @__PURE__ */ x.jsx(ll, { error: a, className: o, children: /* @__PURE__ */ x.jsx(ul, { placeholder: t }) }),
6755
- /* @__PURE__ */ x.jsx(dl, { className: s, children: e.map((c) => /* @__PURE__ */ x.jsx(cl, { value: c.value, children: c.label })) })
6755
+ /* @__PURE__ */ x.jsx(dl, { className: s, children: e.map((c, l) => /* @__PURE__ */ x.jsx(cl, { value: c.value, children: c.label }, l)) })
6756
6756
  ]
6757
6757
  }
6758
6758
  ), bl = ({
package/dist/index.umd.js CHANGED
@@ -43,4 +43,4 @@ React keys must be passed directly to JSX without using spread:
43
43
  `)},rr=function(){var e=parseInt(document.body.getAttribute(De)||"0",10);return isFinite(e)?e:0},Si=function(){u.useEffect(function(){return document.body.setAttribute(De,(rr()+1).toString()),function(){var e=rr()-1;e<=0?document.body.removeAttribute(De):document.body.setAttribute(De,e.toString())}},[])},Ci=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Si();var s=u.useMemo(function(){return wi(o)},[o]);return u.createElement(xi,{styles:yi(s,!t,o,n?"":"!important")})},zt=!1;if(typeof window<"u")try{var lt=Object.defineProperty({},"passive",{get:function(){return zt=!0,!0}});window.addEventListener("test",lt,lt),window.removeEventListener("test",lt,lt)}catch{zt=!1}var Fe=zt?{passive:!1}:!1,Ei=function(e){return e.tagName==="TEXTAREA"},or=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ei(e)&&n[t]==="visible")},Ri=function(e){return or(e,"overflowY")},ki=function(e){return or(e,"overflowX")},sr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ir(e,r);if(o){var s=ar(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Pi=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ai=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ir=function(e,t){return e==="v"?Ri(t):ki(t)},ar=function(e,t){return e==="v"?Pi(t):Ai(t)},Ti=function(e,t){return e==="h"&&t==="rtl"?-1:1},Oi=function(e,t,n,r,o){var s=Ti(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),l=!1,f=i>0,p=0,g=0;do{if(!a)break;var h=ar(e,a),v=h[0],d=h[1],m=h[2],b=d-m-s*v;(v||b)&&ir(e,a)&&(p+=b,g+=v);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(f&&Math.abs(p)<1||!f&&Math.abs(g)<1)&&(l=!0),l},ut=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cr=function(e){return[e.deltaX,e.deltaY]},lr=function(e){return e&&"current"in e?e.current:e},Ni=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_i=function(e){return`
44
44
  .block-interactivity-`.concat(e,` {pointer-events: none;}
45
45
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
46
- `)},Ii=0,Be=[];function Mi(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),o=u.useState(Ii++)[0],s=u.useState(nr)[0],i=u.useRef(e);u.useEffect(function(){i.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var d=ti([e.lockRef.current],(e.shards||[]).map(lr),!0).filter(Boolean);return d.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),d.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=u.useCallback(function(d,m){if("touches"in d&&d.touches.length===2||d.type==="wheel"&&d.ctrlKey)return!i.current.allowPinchZoom;var b=ut(d),w=n.current,y="deltaX"in d?d.deltaX:w[0]-b[0],E="deltaY"in d?d.deltaY:w[1]-b[1],k,N=d.target,A=Math.abs(y)>Math.abs(E)?"h":"v";if("touches"in d&&A==="h"&&N.type==="range")return!1;var P=window.getSelection(),M=P&&P.anchorNode,B=M?M===N||M.contains(N):!1;if(B)return!1;var V=sr(A,N);if(!V)return!0;if(V?k=A:(k=A==="v"?"h":"v",V=sr(A,N)),!V)return!1;if(!r.current&&"changedTouches"in d&&(y||E)&&(r.current=k),!k)return!0;var W=r.current||k;return Oi(W,m,d,W==="h"?y:E)},[]),c=u.useCallback(function(d){var m=d;if(!(!Be.length||Be[Be.length-1]!==s)){var b="deltaY"in m?cr(m):ut(m),w=t.current.filter(function(k){return k.name===m.type&&(k.target===m.target||m.target===k.shadowParent)&&Ni(k.delta,b)})[0];if(w&&w.should){m.cancelable&&m.preventDefault();return}if(!w){var y=(i.current.shards||[]).map(lr).filter(Boolean).filter(function(k){return k.contains(m.target)}),E=y.length>0?a(m,y[0]):!i.current.noIsolation;E&&m.cancelable&&m.preventDefault()}}},[]),l=u.useCallback(function(d,m,b,w){var y={name:d,delta:m,target:b,should:w,shadowParent:ji(b)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(E){return E!==y})},1)},[]),f=u.useCallback(function(d){n.current=ut(d),r.current=void 0},[]),p=u.useCallback(function(d){l(d.type,cr(d),d.target,a(d,e.lockRef.current))},[]),g=u.useCallback(function(d){l(d.type,ut(d),d.target,a(d,e.lockRef.current))},[]);u.useEffect(function(){return Be.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",c,Fe),document.addEventListener("touchmove",c,Fe),document.addEventListener("touchstart",f,Fe),function(){Be=Be.filter(function(d){return d!==s}),document.removeEventListener("wheel",c,Fe),document.removeEventListener("touchmove",c,Fe),document.removeEventListener("touchstart",f,Fe)}},[]);var h=e.removeScrollBar,v=e.inert;return u.createElement(u.Fragment,null,v?u.createElement(s,{styles:_i(o)}):null,h?u.createElement(Ci,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ji(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Li=ui(tr,Mi);var ur=u.forwardRef(function(e,t){return u.createElement(ct,me({},e,{ref:t,sideCar:Li}))});ur.classNames=ct.classNames;var Di=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},We=new WeakMap,dt=new WeakMap,ft={},Vt=0,dr=function(e){return e&&(e.host||dr(e.parentNode))},Fi=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=dr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Bi=function(e,t,n,r){var o=Fi(t,Array.isArray(e)?e:[e]);ft[n]||(ft[n]=new WeakMap);var s=ft[n],i=[],a=new Set,c=new Set(o),l=function(p){!p||a.has(p)||(a.add(p),l(p.parentNode))};o.forEach(l);var f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(g){if(a.has(g))f(g);else try{var h=g.getAttribute(r),v=h!==null&&h!=="false",d=(We.get(g)||0)+1,m=(s.get(g)||0)+1;We.set(g,d),s.set(g,m),i.push(g),d===1&&v&&dt.set(g,!0),m===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",g,b)}})};return f(t),a.clear(),Vt++,function(){i.forEach(function(p){var g=We.get(p)-1,h=s.get(p)-1;We.set(p,g),s.set(p,h),g||(dt.has(p)||p.removeAttribute(r),dt.delete(p)),h||p.removeAttribute(n)}),Vt--,Vt||(We=new WeakMap,We=new WeakMap,dt=new WeakMap,ft={})}},Wi=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Di(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Bi(r,o,n,"aria-hidden")):function(){return null}};function fr(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function pr(e){const[t,n]=u.useState(void 0);return ie(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const zi=["top","right","bottom","left"],Ee=Math.min,ce=Math.max,pt=Math.round,mt=Math.floor,he=e=>({x:e,y:e}),Vi={left:"right",right:"left",bottom:"top",top:"bottom"},$i={start:"end",end:"start"};function $t(e,t,n){return ce(e,Ee(t,n))}function xe(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function ze(e){return e.split("-")[1]}function Ht(e){return e==="x"?"y":"x"}function Ut(e){return e==="y"?"height":"width"}const Hi=new Set(["top","bottom"]);function ge(e){return Hi.has(ye(e))?"y":"x"}function Yt(e){return Ht(ge(e))}function Ui(e,t,n){n===void 0&&(n=!1);const r=ze(e),o=Yt(e),s=Ut(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ht(i)),[i,ht(i)]}function Yi(e){const t=ht(e);return[Gt(e),t,Gt(t)]}function Gt(e){return e.replace(/start|end/g,t=>$i[t])}const mr=["left","right"],hr=["right","left"],Gi=["top","bottom"],Ki=["bottom","top"];function Xi(e,t,n){switch(e){case"top":case"bottom":return n?t?hr:mr:t?mr:hr;case"left":case"right":return t?Gi:Ki;default:return[]}}function qi(e,t,n,r){const o=ze(e);let s=Xi(ye(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Gt)))),s}function ht(e){return e.replace(/left|right|bottom|top/g,t=>Vi[t])}function Zi(e){return{top:0,right:0,bottom:0,left:0,...e}}function gr(e){return typeof e!="number"?Zi(e):{top:e,right:e,bottom:e,left:e}}function gt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function vr(e,t,n){let{reference:r,floating:o}=e;const s=ge(t),i=Yt(t),a=Ut(i),c=ye(t),l=s==="y",f=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,g=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:f,y:r.y-o.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:p};break;case"left":h={x:r.x-o.width,y:p};break;default:h={x:r.x,y:r.y}}switch(ze(t)){case"start":h[i]-=g*(n&&l?-1:1);break;case"end":h[i]+=g*(n&&l?-1:1);break}return h}const Ji=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=vr(l,r,c),g=r,h={},v=0;for(let d=0;d<a.length;d++){const{name:m,fn:b}=a[d],{x:w,y,data:E,reset:k}=await b({x:f,y:p,initialPlacement:r,placement:g,strategy:o,middlewareData:h,rects:l,platform:i,elements:{reference:e,floating:t}});f=w??f,p=y??p,h={...h,[m]:{...h[m],...E}},k&&v<=50&&(v++,typeof k=="object"&&(k.placement&&(g=k.placement),k.rects&&(l=k.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:f,y:p}=vr(l,g,c)),d=-1)}return{x:f,y:p,placement:g,strategy:o,middlewareData:h}};async function Xe(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:g=!1,padding:h=0}=xe(t,e),v=gr(h),m=a[g?p==="floating"?"reference":"floating":p],b=gt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:f,strategy:c})),w=p==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},k=gt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:y,strategy:c}):w);return{top:(b.top-k.top+v.top)/E.y,bottom:(k.bottom-b.bottom+v.bottom)/E.y,left:(b.left-k.left+v.left)/E.x,right:(k.right-b.right+v.right)/E.x}}const Qi=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:f=0}=xe(e,t)||{};if(l==null)return{};const p=gr(f),g={x:n,y:r},h=Yt(o),v=Ut(h),d=await i.getDimensions(l),m=h==="y",b=m?"top":"left",w=m?"bottom":"right",y=m?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[h]-g[h]-s.floating[v],k=g[h]-s.reference[h],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let A=N?N[y]:0;(!A||!await(i.isElement==null?void 0:i.isElement(N)))&&(A=a.floating[y]||s.floating[v]);const P=E/2-k/2,M=A/2-d[v]/2-1,B=Ee(p[b],M),V=Ee(p[w],M),W=B,$=A-d[v]-V,z=A/2-d[v]/2+P,H=$t(W,z,$),I=!c.arrow&&ze(o)!=null&&z!==H&&s.reference[v]/2-(z<W?B:V)-d[v]/2<0,D=I?z<W?z-W:z-$:0;return{[h]:g[h]+D,data:{[h]:H,centerOffset:z-H-D,...I&&{alignmentOffset:D}},reset:I}}}),ea=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:d=!0,...m}=xe(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=ye(o),w=ge(a),y=ye(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(l.floating)),k=g||(y||!d?[ht(a)]:Yi(a)),N=v!=="none";!g&&N&&k.push(...qi(a,d,v,E));const A=[a,...k],P=await Xe(t,m),M=[];let B=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&M.push(P[b]),p){const z=Ui(o,i,E);M.push(P[z[0]],P[z[1]])}if(B=[...B,{placement:o,overflows:M}],!M.every(z=>z<=0)){var V,W;const z=(((V=s.flip)==null?void 0:V.index)||0)+1,H=A[z];if(H&&(!(p==="alignment"?w!==ge(H):!1)||B.every(C=>ge(C.placement)===w?C.overflows[0]>0:!0)))return{data:{index:z,overflows:B},reset:{placement:H}};let I=(W=B.filter(D=>D.overflows[0]<=0).sort((D,C)=>D.overflows[1]-C.overflows[1])[0])==null?void 0:W.placement;if(!I)switch(h){case"bestFit":{var $;const D=($=B.filter(C=>{if(N){const G=ge(C.placement);return G===w||G==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(G=>G>0).reduce((G,te)=>G+te,0)]).sort((C,G)=>C[1]-G[1])[0])==null?void 0:$[0];D&&(I=D);break}case"initialPlacement":I=a;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function br(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wr(e){return zi.some(t=>e[t]>=0)}const ta=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=xe(e,t);switch(r){case"referenceHidden":{const s=await Xe(t,{...o,elementContext:"reference"}),i=br(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:wr(i)}}}case"escaped":{const s=await Xe(t,{...o,altBoundary:!0}),i=br(s,n.floating);return{data:{escapedOffsets:i,escaped:wr(i)}}}default:return{}}}}},xr=new Set(["left","top"]);async function na(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ye(n),a=ze(n),c=ge(n)==="y",l=xr.has(i)?-1:1,f=s&&c?-1:1,p=xe(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof v=="number"&&(h=a==="end"?v*-1:v),c?{x:h*f,y:g*l}:{x:g*l,y:h*f}}const ra=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await na(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},oa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:m=>{let{x:b,y:w}=m;return{x:b,y:w}}},...c}=xe(e,t),l={x:n,y:r},f=await Xe(t,c),p=ge(ye(o)),g=Ht(p);let h=l[g],v=l[p];if(s){const m=g==="y"?"top":"left",b=g==="y"?"bottom":"right",w=h+f[m],y=h-f[b];h=$t(w,h,y)}if(i){const m=p==="y"?"top":"left",b=p==="y"?"bottom":"right",w=v+f[m],y=v-f[b];v=$t(w,v,y)}const d=a.fn({...t,[g]:h,[p]:v});return{...d,data:{x:d.x-n,y:d.y-r,enabled:{[g]:s,[p]:i}}}}}},sa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=xe(e,t),f={x:n,y:r},p=ge(o),g=Ht(p);let h=f[g],v=f[p];const d=xe(a,t),m=typeof d=="number"?{mainAxis:d,crossAxis:0}:{mainAxis:0,crossAxis:0,...d};if(c){const y=g==="y"?"height":"width",E=s.reference[g]-s.floating[y]+m.mainAxis,k=s.reference[g]+s.reference[y]-m.mainAxis;h<E?h=E:h>k&&(h=k)}if(l){var b,w;const y=g==="y"?"width":"height",E=xr.has(ye(o)),k=s.reference[p]-s.floating[y]+(E&&((b=i.offset)==null?void 0:b[p])||0)+(E?0:m.crossAxis),N=s.reference[p]+s.reference[y]+(E?0:((w=i.offset)==null?void 0:w[p])||0)-(E?m.crossAxis:0);v<k?v=k:v>N&&(v=N)}return{[g]:h,[p]:v}}}},ia=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=xe(e,t),f=await Xe(t,l),p=ye(o),g=ze(o),h=ge(o)==="y",{width:v,height:d}=s.floating;let m,b;p==="top"||p==="bottom"?(m=p,b=g===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=p,m=g==="end"?"top":"bottom");const w=d-f.top-f.bottom,y=v-f.left-f.right,E=Ee(d-f[m],w),k=Ee(v-f[b],y),N=!t.middlewareData.shift;let A=E,P=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=w),N&&!g){const B=ce(f.left,0),V=ce(f.right,0),W=ce(f.top,0),$=ce(f.bottom,0);h?P=v-2*(B!==0||V!==0?B+V:ce(f.left,f.right)):A=d-2*(W!==0||$!==0?W+$:ce(f.top,f.bottom))}await c({...t,availableWidth:P,availableHeight:A});const M=await i.getDimensions(a.floating);return v!==M.width||d!==M.height?{reset:{rects:!0}}:{}}}};function vt(){return typeof window<"u"}function Ve(e){return yr(e)?(e.nodeName||"").toLowerCase():"#document"}function le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ve(e){var t;return(t=(yr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yr(e){return vt()?e instanceof Node||e instanceof le(e).Node:!1}function de(e){return vt()?e instanceof Element||e instanceof le(e).Element:!1}function be(e){return vt()?e instanceof HTMLElement||e instanceof le(e).HTMLElement:!1}function Sr(e){return!vt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof le(e).ShadowRoot}const aa=new Set(["inline","contents"]);function qe(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!aa.has(o)}const ca=new Set(["table","td","th"]);function la(e){return ca.has(Ve(e))}const ua=[":popover-open",":modal"];function bt(e){return ua.some(t=>{try{return e.matches(t)}catch{return!1}})}const da=["transform","translate","scale","rotate","perspective"],fa=["transform","translate","scale","rotate","perspective","filter"],pa=["paint","layout","strict","content"];function Kt(e){const t=Xt(),n=de(e)?fe(e):e;return da.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||fa.some(r=>(n.willChange||"").includes(r))||pa.some(r=>(n.contain||"").includes(r))}function ma(e){let t=Re(e);for(;be(t)&&!$e(t);){if(Kt(t))return t;if(bt(t))return null;t=Re(t)}return null}function Xt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ha=new Set(["html","body","#document"]);function $e(e){return ha.has(Ve(e))}function fe(e){return le(e).getComputedStyle(e)}function wt(e){return de(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Re(e){if(Ve(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Sr(e)&&e.host||ve(e);return Sr(t)?t.host:t}function Cr(e){const t=Re(e);return $e(t)?e.ownerDocument?e.ownerDocument.body:e.body:be(t)&&qe(t)?t:Cr(t)}function Ze(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Cr(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=le(o);if(s){const a=qt(i);return t.concat(i,i.visualViewport||[],qe(o)?o:[],a&&n?Ze(a):[])}return t.concat(o,Ze(o,[],n))}function qt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Er(e){const t=fe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=be(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=pt(n)!==s||pt(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Zt(e){return de(e)?e:e.contextElement}function He(e){const t=Zt(e);if(!be(t))return he(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Er(t);let i=(s?pt(n.width):n.width)/r,a=(s?pt(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const ga=he(0);function Rr(e){const t=le(e);return!Xt()||!t.visualViewport?ga:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function va(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==le(e)?!1:t}function Oe(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Zt(e);let i=he(1);t&&(r?de(r)&&(i=He(r)):i=He(e));const a=va(s,n,r)?Rr(s):he(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,f=o.width/i.x,p=o.height/i.y;if(s){const g=le(s),h=r&&de(r)?le(r):r;let v=g,d=qt(v);for(;d&&r&&h!==v;){const m=He(d),b=d.getBoundingClientRect(),w=fe(d),y=b.left+(d.clientLeft+parseFloat(w.paddingLeft))*m.x,E=b.top+(d.clientTop+parseFloat(w.paddingTop))*m.y;c*=m.x,l*=m.y,f*=m.x,p*=m.y,c+=y,l+=E,v=le(d),d=qt(v)}}return gt({width:f,height:p,x:c,y:l})}function xt(e,t){const n=wt(e).scrollLeft;return t?t.left+n:Oe(ve(e)).left+n}function kr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-xt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function ba(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ve(r),a=t?bt(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=he(1);const f=he(0),p=be(r);if((p||!p&&!s)&&((Ve(r)!=="body"||qe(i))&&(c=wt(r)),be(r))){const h=Oe(r);l=He(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const g=i&&!p&&!s?kr(i,c):he(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+f.x+g.x,y:n.y*l.y-c.scrollTop*l.y+f.y+g.y}}function wa(e){return Array.from(e.getClientRects())}function xa(e){const t=ve(e),n=wt(e),r=e.ownerDocument.body,o=ce(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ce(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+xt(e);const a=-n.scrollTop;return fe(r).direction==="rtl"&&(i+=ce(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Pr=25;function ya(e,t){const n=le(e),r=ve(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const f=Xt();(!f||f&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=xt(r);if(l<=0){const f=r.ownerDocument,p=f.body,g=getComputedStyle(p),h=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(r.clientWidth-p.clientWidth-h);v<=Pr&&(s-=v)}else l<=Pr&&(s+=l);return{width:s,height:i,x:a,y:c}}const Sa=new Set(["absolute","fixed"]);function Ca(e,t){const n=Oe(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=be(e)?He(e):he(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function Ar(e,t,n){let r;if(t==="viewport")r=ya(e,n);else if(t==="document")r=xa(ve(e));else if(de(t))r=Ca(t,n);else{const o=Rr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return gt(r)}function Tr(e,t){const n=Re(e);return n===t||!de(n)||$e(n)?!1:fe(n).position==="fixed"||Tr(n,t)}function Ea(e,t){const n=t.get(e);if(n)return n;let r=Ze(e,[],!1).filter(a=>de(a)&&Ve(a)!=="body"),o=null;const s=fe(e).position==="fixed";let i=s?Re(e):e;for(;de(i)&&!$e(i);){const a=fe(i),c=Kt(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&Sa.has(o.position)||qe(i)&&!c&&Tr(e,i))?r=r.filter(f=>f!==i):o=a,i=Re(i)}return t.set(e,r),r}function Ra(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?bt(t)?[]:Ea(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,f)=>{const p=Ar(t,f,o);return l.top=ce(p.top,l.top),l.right=Ee(p.right,l.right),l.bottom=Ee(p.bottom,l.bottom),l.left=ce(p.left,l.left),l},Ar(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ka(e){const{width:t,height:n}=Er(e);return{width:t,height:n}}function Pa(e,t,n){const r=be(t),o=ve(t),s=n==="fixed",i=Oe(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=he(0);function l(){c.x=xt(o)}if(r||!r&&!s)if((Ve(t)!=="body"||qe(o))&&(a=wt(t)),r){const h=Oe(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&l();s&&!r&&o&&l();const f=o&&!r&&!s?kr(o,a):he(0),p=i.left+a.scrollLeft-c.x-f.x,g=i.top+a.scrollTop-c.y-f.y;return{x:p,y:g,width:i.width,height:i.height}}function Jt(e){return fe(e).position==="static"}function Or(e,t){if(!be(e)||fe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ve(e)===n&&(n=n.ownerDocument.body),n}function Nr(e,t){const n=le(e);if(bt(e))return n;if(!be(e)){let o=Re(e);for(;o&&!$e(o);){if(de(o)&&!Jt(o))return o;o=Re(o)}return n}let r=Or(e,t);for(;r&&la(r)&&Jt(r);)r=Or(r,t);return r&&$e(r)&&Jt(r)&&!Kt(r)?n:r||ma(e)||n}const Aa=async function(e){const t=this.getOffsetParent||Nr,n=this.getDimensions,r=await n(e.floating);return{reference:Pa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ta(e){return fe(e).direction==="rtl"}const Oa={convertOffsetParentRelativeRectToViewportRelativeRect:ba,getDocumentElement:ve,getClippingRect:Ra,getOffsetParent:Nr,getElementRects:Aa,getClientRects:wa,getDimensions:ka,getScale:He,isElement:de,isRTL:Ta};function _r(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Na(e,t){let n=null,r;const o=ve(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:f,top:p,width:g,height:h}=l;if(a||t(),!g||!h)return;const v=mt(p),d=mt(o.clientWidth-(f+g)),m=mt(o.clientHeight-(p+h)),b=mt(f),y={rootMargin:-v+"px "+-d+"px "+-m+"px "+-b+"px",threshold:ce(0,Ee(1,c))||1};let E=!0;function k(N){const A=N[0].intersectionRatio;if(A!==c){if(!E)return i();A?i(!1,A):r=setTimeout(()=>{i(!1,1e-7)},1e3)}A===1&&!_r(l,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(k,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,y)}n.observe(e)}return i(!0),s}function _a(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Zt(e),f=o||s?[...l?Ze(l):[],...Ze(t)]:[];f.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const p=l&&a?Na(l,n):null;let g=-1,h=null;i&&(h=new ResizeObserver(b=>{let[w]=b;w&&w.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let v,d=c?Oe(e):null;c&&m();function m(){const b=Oe(e);d&&!_r(d,b)&&n(),d=b,v=requestAnimationFrame(m)}return n(),()=>{var b;f.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),p?.(),(b=h)==null||b.disconnect(),h=null,c&&cancelAnimationFrame(v)}}const Ia=ra,Ma=oa,ja=ea,La=ia,Da=ta,Ir=Qi,Fa=sa,Ba=(e,t,n)=>{const r=new Map,o={platform:Oa,...n},s={...o.platform,_c:r};return Ji(e,t,{...o,platform:s})};var Wa=typeof document<"u",za=function(){},yt=Wa?Q.useLayoutEffect:za;function St(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,o;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(!St(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!St(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Mr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jr(e,t){const n=Mr(e);return Math.round(t*n)/n}function Qt(e){const t=u.useRef(e);return yt(()=>{t.current=e}),t}function Va(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[f,p]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,h]=u.useState(r);St(g,r)||h(r);const[v,d]=u.useState(null),[m,b]=u.useState(null),w=u.useCallback(C=>{C!==N.current&&(N.current=C,d(C))},[]),y=u.useCallback(C=>{C!==A.current&&(A.current=C,b(C))},[]),E=s||v,k=i||m,N=u.useRef(null),A=u.useRef(null),P=u.useRef(f),M=c!=null,B=Qt(c),V=Qt(o),W=Qt(l),$=u.useCallback(()=>{if(!N.current||!A.current)return;const C={placement:t,strategy:n,middleware:g};V.current&&(C.platform=V.current),Ba(N.current,A.current,C).then(G=>{const te={...G,isPositioned:W.current!==!1};z.current&&!St(P.current,te)&&(P.current=te,Qe.flushSync(()=>{p(te)}))})},[g,t,n,V,W]);yt(()=>{l===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p(C=>({...C,isPositioned:!1})))},[l]);const z=u.useRef(!1);yt(()=>(z.current=!0,()=>{z.current=!1}),[]),yt(()=>{if(E&&(N.current=E),k&&(A.current=k),E&&k){if(B.current)return B.current(E,k,$);$()}},[E,k,$,B,M]);const H=u.useMemo(()=>({reference:N,floating:A,setReference:w,setFloating:y}),[w,y]),I=u.useMemo(()=>({reference:E,floating:k}),[E,k]),D=u.useMemo(()=>{const C={position:n,left:0,top:0};if(!I.floating)return C;const G=jr(I.floating,f.x),te=jr(I.floating,f.y);return a?{...C,transform:"translate("+G+"px, "+te+"px)",...Mr(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:te}},[n,a,I.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:$,refs:H,elements:I,floatingStyles:D}),[f,$,H,I,D])}const $a=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ir({element:r.current,padding:o}).fn(n):{}:r?Ir({element:r,padding:o}).fn(n):{}}}},Ha=(e,t)=>({...Ia(e),options:[e,t]}),Ua=(e,t)=>({...Ma(e),options:[e,t]}),Ya=(e,t)=>({...Fa(e),options:[e,t]}),Ga=(e,t)=>({...ja(e),options:[e,t]}),Ka=(e,t)=>({...La(e),options:[e,t]}),Xa=(e,t)=>({...Da(e),options:[e,t]}),qa=(e,t)=>({...$a(e),options:[e,t]});var Za="Arrow",Lr=u.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return x.jsx(Z.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});Lr.displayName=Za;var Ja=Lr,en="Popper",[Dr,Fr]=st(en),[Qa,Br]=Dr(en),Wr=e=>{const{__scopePopper:t,children:n}=e,[r,o]=u.useState(null);return x.jsx(Qa,{scope:t,anchor:r,onAnchorChange:o,children:n})};Wr.displayName=en;var zr="PopperAnchor",Vr=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Br(zr,n),i=u.useRef(null),a=re(t,i),c=u.useRef(null);return u.useEffect(()=>{const l=c.current;c.current=r?.current||i.current,l!==c.current&&s.onAnchorChange(c.current)}),r?null:x.jsx(Z.div,{...o,ref:a})});Vr.displayName=zr;var tn="PopperContent",[ec,tc]=Dr(tn),$r=u.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:h="optimized",onPlaced:v,...d}=e,m=Br(tn,n),[b,w]=u.useState(null),y=re(t,R=>w(R)),[E,k]=u.useState(null),N=pr(E),A=N?.width??0,P=N?.height??0,M=r+(s!=="center"?"-"+s:""),B=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},V=Array.isArray(l)?l:[l],W=V.length>0,$={padding:B,boundary:V.filter(rc),altBoundary:W},{refs:z,floatingStyles:H,placement:I,isPositioned:D,middlewareData:C}=Va({strategy:"fixed",placement:M,whileElementsMounted:(...R)=>_a(...R,{animationFrame:h==="always"}),elements:{reference:m.anchor},middleware:[Ha({mainAxis:o+P,alignmentAxis:i}),c&&Ua({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Ya():void 0,...$}),c&&Ga({...$}),Ka({...$,apply:({elements:R,rects:U,availableWidth:q,availableHeight:Y})=>{const{width:K,height:X}=U.reference,ue=R.floating.style;ue.setProperty("--radix-popper-available-width",`${q}px`),ue.setProperty("--radix-popper-available-height",`${Y}px`),ue.setProperty("--radix-popper-anchor-width",`${K}px`),ue.setProperty("--radix-popper-anchor-height",`${X}px`)}}),E&&qa({element:E,padding:a}),oc({arrowWidth:A,arrowHeight:P}),g&&Xa({strategy:"referenceHidden",...$})]}),[G,te]=Yr(I),S=Te(v);ie(()=>{D&&S?.()},[D,S]);const _=C.arrow?.x,j=C.arrow?.y,L=C.arrow?.centerOffset!==0,[oe,ae]=u.useState();return ie(()=>{b&&ae(window.getComputedStyle(b).zIndex)},[b]),x.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:D?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[C.transformOrigin?.x,C.transformOrigin?.y].join(" "),...C.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(ec,{scope:n,placedSide:G,onArrowChange:k,arrowX:_,arrowY:j,shouldHideArrow:L,children:x.jsx(Z.div,{"data-side":G,"data-align":te,...d,ref:y,style:{...d.style,animation:D?void 0:"none"}})})})});$r.displayName=tn;var Hr="PopperArrow",nc={top:"bottom",right:"left",bottom:"top",left:"right"},Ur=u.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=tc(Hr,r),i=nc[s.placedSide];return x.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:x.jsx(Ja,{...o,ref:n,style:{...o.style,display:"block"}})})});Ur.displayName=Hr;function rc(e){return e!==null}var oc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,f]=Yr(n),p={start:"0%",center:"50%",end:"100%"}[f],g=(o.arrow?.x??0)+a/2,h=(o.arrow?.y??0)+c/2;let v="",d="";return l==="bottom"?(v=i?p:`${g}px`,d=`${-c}px`):l==="top"?(v=i?p:`${g}px`,d=`${r.floating.height+c}px`):l==="right"?(v=`${-c}px`,d=i?p:`${h}px`):l==="left"&&(v=`${r.floating.width+c}px`,d=i?p:`${h}px`),{data:{x:v,y:d}}}});function Yr(e){const[t,n="center"]=e.split("-");return[t,n]}var sc=Wr,ic=Vr,ac=$r,cc=Ur;function Gr(e,[t,n]){return Math.min(n,Math.max(t,e))}var lc=[" ","Enter","ArrowUp","ArrowDown"],uc=[" ","Enter"],Ne="Select",[Ct,Et,dc]=Os(Ne),[Ue]=st(Ne,[dc,Fr]),Rt=Fr(),[fc,ke]=Ue(Ne),[pc,mc]=Ue(Ne),Kr=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:f,autoComplete:p,disabled:g,required:h,form:v}=e,d=Rt(t),[m,b]=u.useState(null),[w,y]=u.useState(null),[E,k]=u.useState(!1),N=Ds(l),[A,P]=_t({prop:r,defaultProp:o??!1,onChange:s,caller:Ne}),[M,B]=_t({prop:i,defaultProp:a,onChange:c,caller:Ne}),V=u.useRef(null),W=m?v||!!m.closest("form"):!0,[$,z]=u.useState(new Set),H=Array.from($).map(I=>I.props.value).join(";");return x.jsx(sc,{...d,children:x.jsxs(fc,{required:h,scope:t,trigger:m,onTriggerChange:b,valueNode:w,onValueNodeChange:y,valueNodeHasChildren:E,onValueNodeHasChildrenChange:k,contentId:It(),value:M,onValueChange:B,open:A,onOpenChange:P,dir:N,triggerPointerDownPosRef:V,disabled:g,children:[x.jsx(Ct.Provider,{scope:t,children:x.jsx(pc,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(I=>{z(D=>new Set(D).add(I))},[]),onNativeOptionRemove:u.useCallback(I=>{z(D=>{const C=new Set(D);return C.delete(I),C})},[]),children:n})}),W?x.jsxs(ho,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:M,onChange:I=>B(I.target.value),disabled:g,form:v,children:[M===void 0?x.jsx("option",{value:""}):null,Array.from($)]},H):null]})})};Kr.displayName=Ne;var Xr="SelectTrigger",qr=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Rt(n),i=ke(Xr,n),a=i.disabled||r,c=re(t,i.onTriggerChange),l=Et(n),f=u.useRef("touch"),[p,g,h]=vo(d=>{const m=l().filter(y=>!y.disabled),b=m.find(y=>y.value===i.value),w=bo(m,d,b);w!==void 0&&i.onValueChange(w.value)}),v=d=>{a||(i.onOpenChange(!0),h()),d&&(i.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return x.jsx(ic,{asChild:!0,...s,children:x.jsx(Z.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":go(i.value)?"":void 0,...o,ref:c,onClick:J(o.onClick,d=>{d.currentTarget.focus(),f.current!=="mouse"&&v(d)}),onPointerDown:J(o.onPointerDown,d=>{f.current=d.pointerType;const m=d.target;m.hasPointerCapture(d.pointerId)&&m.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(v(d),d.preventDefault())}),onKeyDown:J(o.onKeyDown,d=>{const m=p.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&g(d.key),!(m&&d.key===" ")&&lc.includes(d.key)&&(v(),d.preventDefault())})})})});qr.displayName=Xr;var Zr="SelectValue",Jr=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=ke(Zr,n),{onValueNodeHasChildrenChange:l}=c,f=s!==void 0,p=re(t,c.onValueNodeChange);return ie(()=>{l(f)},[l,f]),x.jsx(Z.span,{...a,ref:p,style:{pointerEvents:"none"},children:go(c.value)?x.jsx(x.Fragment,{children:i}):s})});Jr.displayName=Zr;var hc="SelectIcon",Qr=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return x.jsx(Z.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Qr.displayName=hc;var gc="SelectPortal",eo=e=>x.jsx(qn,{asChild:!0,...e});eo.displayName=gc;var _e="SelectContent",to=u.forwardRef((e,t)=>{const n=ke(_e,e.__scopeSelect),[r,o]=u.useState();if(ie(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Qe.createPortal(x.jsx(no,{scope:e.__scopeSelect,children:x.jsx(Ct.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),s):null}return x.jsx(ro,{...e,ref:t})});to.displayName=_e;var pe=10,[no,Pe]=Ue(_e),vc="SelectContentImpl",bc=ot("SelectContent.RemoveScroll"),ro=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:h,sticky:v,hideWhenDetached:d,avoidCollisions:m,...b}=e,w=ke(_e,n),[y,E]=u.useState(null),[k,N]=u.useState(null),A=re(t,R=>E(R)),[P,M]=u.useState(null),[B,V]=u.useState(null),W=Et(n),[$,z]=u.useState(!1),H=u.useRef(!1);u.useEffect(()=>{if(y)return Wi(y)},[y]),ei();const I=u.useCallback(R=>{const[U,...q]=W().map(X=>X.ref.current),[Y]=q.slice(-1),K=document.activeElement;for(const X of R)if(X===K||(X?.scrollIntoView({block:"nearest"}),X===U&&k&&(k.scrollTop=0),X===Y&&k&&(k.scrollTop=k.scrollHeight),X?.focus(),document.activeElement!==K))return},[W,k]),D=u.useCallback(()=>I([P,y]),[I,P,y]);u.useEffect(()=>{$&&D()},[$,D]);const{onOpenChange:C,triggerPointerDownPosRef:G}=w;u.useEffect(()=>{if(y){let R={x:0,y:0};const U=Y=>{R={x:Math.abs(Math.round(Y.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(Y.pageY)-(G.current?.y??0))}},q=Y=>{R.x<=10&&R.y<=10?Y.preventDefault():y.contains(Y.target)||C(!1),document.removeEventListener("pointermove",U),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",q,{capture:!0})}}},[y,C,G]),u.useEffect(()=>{const R=()=>C(!1);return window.addEventListener("blur",R),window.addEventListener("resize",R),()=>{window.removeEventListener("blur",R),window.removeEventListener("resize",R)}},[C]);const[te,S]=vo(R=>{const U=W().filter(K=>!K.disabled),q=U.find(K=>K.ref.current===document.activeElement),Y=bo(U,R,q);Y&&setTimeout(()=>Y.ref.current.focus())}),_=u.useCallback((R,U,q)=>{const Y=!H.current&&!q;(w.value!==void 0&&w.value===U||Y)&&(M(R),Y&&(H.current=!0))},[w.value]),j=u.useCallback(()=>y?.focus(),[y]),L=u.useCallback((R,U,q)=>{const Y=!H.current&&!q;(w.value!==void 0&&w.value===U||Y)&&V(R)},[w.value]),oe=r==="popper"?nn:oo,ae=oe===nn?{side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:h,sticky:v,hideWhenDetached:d,avoidCollisions:m}:{};return x.jsx(no,{scope:n,content:y,viewport:k,onViewportChange:N,itemRefCallback:_,selectedItem:P,onItemLeave:j,itemTextRefCallback:L,focusSelectedItem:D,selectedItemText:B,position:r,isPositioned:$,searchRef:te,children:x.jsx(ur,{as:bc,allowPinchZoom:!0,children:x.jsx(Un,{asChild:!0,trapped:w.open,onMountAutoFocus:R=>{R.preventDefault()},onUnmountAutoFocus:J(o,R=>{w.trigger?.focus({preventScroll:!0}),R.preventDefault()}),children:x.jsx(zn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:R=>R.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:x.jsx(oe,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:R=>R.preventDefault(),...b,...ae,onPlaced:()=>z(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:J(b.onKeyDown,R=>{const U=R.ctrlKey||R.altKey||R.metaKey;if(R.key==="Tab"&&R.preventDefault(),!U&&R.key.length===1&&S(R.key),["ArrowUp","ArrowDown","Home","End"].includes(R.key)){let Y=W().filter(K=>!K.disabled).map(K=>K.ref.current);if(["ArrowUp","End"].includes(R.key)&&(Y=Y.slice().reverse()),["ArrowUp","ArrowDown"].includes(R.key)){const K=R.target,X=Y.indexOf(K);Y=Y.slice(X+1)}setTimeout(()=>I(Y)),R.preventDefault()}})})})})})})});ro.displayName=vc;var wc="SelectItemAlignedPosition",oo=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=ke(_e,n),i=Pe(_e,n),[a,c]=u.useState(null),[l,f]=u.useState(null),p=re(t,A=>f(A)),g=Et(n),h=u.useRef(!1),v=u.useRef(!0),{viewport:d,selectedItem:m,selectedItemText:b,focusSelectedItem:w}=i,y=u.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&d&&m&&b){const A=s.trigger.getBoundingClientRect(),P=l.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),B=b.getBoundingClientRect();if(s.dir!=="rtl"){const K=B.left-P.left,X=M.left-K,ue=A.left-X,Ie=A.width+ue,ln=Math.max(Ie,P.width),un=window.innerWidth-pe,dn=Gr(X,[pe,Math.max(pe,un-ln)]);a.style.minWidth=Ie+"px",a.style.left=dn+"px"}else{const K=P.right-B.right,X=window.innerWidth-M.right-K,ue=window.innerWidth-A.right-X,Ie=A.width+ue,ln=Math.max(Ie,P.width),un=window.innerWidth-pe,dn=Gr(X,[pe,Math.max(pe,un-ln)]);a.style.minWidth=Ie+"px",a.style.right=dn+"px"}const V=g(),W=window.innerHeight-pe*2,$=d.scrollHeight,z=window.getComputedStyle(l),H=parseInt(z.borderTopWidth,10),I=parseInt(z.paddingTop,10),D=parseInt(z.borderBottomWidth,10),C=parseInt(z.paddingBottom,10),G=H+I+$+C+D,te=Math.min(m.offsetHeight*5,G),S=window.getComputedStyle(d),_=parseInt(S.paddingTop,10),j=parseInt(S.paddingBottom,10),L=A.top+A.height/2-pe,oe=W-L,ae=m.offsetHeight/2,R=m.offsetTop+ae,U=H+I+R,q=G-U;if(U<=L){const K=V.length>0&&m===V[V.length-1].ref.current;a.style.bottom="0px";const X=l.clientHeight-d.offsetTop-d.offsetHeight,ue=Math.max(oe,ae+(K?j:0)+X+D),Ie=U+ue;a.style.height=Ie+"px"}else{const K=V.length>0&&m===V[0].ref.current;a.style.top="0px";const ue=Math.max(L,H+d.offsetTop+(K?_:0)+ae)+q;a.style.height=ue+"px",d.scrollTop=U-L+d.offsetTop}a.style.margin=`${pe}px 0`,a.style.minHeight=te+"px",a.style.maxHeight=W+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[g,s.trigger,s.valueNode,a,l,d,m,b,s.dir,r]);ie(()=>y(),[y]);const[E,k]=u.useState();ie(()=>{l&&k(window.getComputedStyle(l).zIndex)},[l]);const N=u.useCallback(A=>{A&&v.current===!0&&(y(),w?.(),v.current=!1)},[y,w]);return x.jsx(yc,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:x.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:x.jsx(Z.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});oo.displayName=wc;var xc="SelectPopperPosition",nn=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=pe,...s}=e,i=Rt(n);return x.jsx(ac,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nn.displayName=xc;var[yc,rn]=Ue(_e,{}),on="SelectViewport",so=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Pe(on,n),i=rn(on,n),a=re(t,s.onViewportChange),c=u.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),x.jsx(Ct.Slot,{scope:n,children:x.jsx(Z.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:J(o.onScroll,l=>{const f=l.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=i;if(g?.current&&p){const h=Math.abs(c.current-f.scrollTop);if(h>0){const v=window.innerHeight-pe*2,d=parseFloat(p.style.minHeight),m=parseFloat(p.style.height),b=Math.max(d,m);if(b<v){const w=b+h,y=Math.min(v,w),E=w-y;p.style.height=y+"px",p.style.bottom==="0px"&&(f.scrollTop=E>0?E:0,p.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});so.displayName=on;var io="SelectGroup",[Sc,Cc]=Ue(io),Ec=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=It();return x.jsx(Sc,{scope:n,id:o,children:x.jsx(Z.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Ec.displayName=io;var ao="SelectLabel",Rc=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Cc(ao,n);return x.jsx(Z.div,{id:o.id,...r,ref:t})});Rc.displayName=ao;var kt="SelectItem",[kc,co]=Ue(kt),lo=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=ke(kt,n),c=Pe(kt,n),l=a.value===r,[f,p]=u.useState(s??""),[g,h]=u.useState(!1),v=re(t,w=>c.itemRefCallback?.(w,r,o)),d=It(),m=u.useRef("touch"),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.jsx(kc,{scope:n,value:r,disabled:o,textId:d,isSelected:l,onItemTextChange:u.useCallback(w=>{p(y=>y||(w?.textContent??"").trim())},[]),children:x.jsx(Ct.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:x.jsx(Z.div,{role:"option","aria-labelledby":d,"data-highlighted":g?"":void 0,"aria-selected":l&&g,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:v,onFocus:J(i.onFocus,()=>h(!0)),onBlur:J(i.onBlur,()=>h(!1)),onClick:J(i.onClick,()=>{m.current!=="mouse"&&b()}),onPointerUp:J(i.onPointerUp,()=>{m.current==="mouse"&&b()}),onPointerDown:J(i.onPointerDown,w=>{m.current=w.pointerType}),onPointerMove:J(i.onPointerMove,w=>{m.current=w.pointerType,o?c.onItemLeave?.():m.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(i.onPointerLeave,w=>{w.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:J(i.onKeyDown,w=>{c.searchRef?.current!==""&&w.key===" "||(uc.includes(w.key)&&b(),w.key===" "&&w.preventDefault())})})})})});lo.displayName=kt;var Je="SelectItemText",uo=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=ke(Je,n),a=Pe(Je,n),c=co(Je,n),l=mc(Je,n),[f,p]=u.useState(null),g=re(t,b=>p(b),c.onItemTextChange,b=>a.itemTextRefCallback?.(b,c.value,c.disabled)),h=f?.textContent,v=u.useMemo(()=>x.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:d,onNativeOptionRemove:m}=l;return ie(()=>(d(v),()=>m(v)),[d,m,v]),x.jsxs(x.Fragment,{children:[x.jsx(Z.span,{id:c.textId,...s,ref:g}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Qe.createPortal(s.children,i.valueNode):null]})});uo.displayName=Je;var fo="SelectItemIndicator",po=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return co(fo,n).isSelected?x.jsx(Z.span,{"aria-hidden":!0,...r,ref:t}):null});po.displayName=fo;var sn="SelectScrollUpButton",Pc=u.forwardRef((e,t)=>{const n=Pe(sn,e.__scopeSelect),r=rn(sn,e.__scopeSelect),[o,s]=u.useState(!1),i=re(t,r.onScrollButtonChange);return ie(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(mo,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Pc.displayName=sn;var an="SelectScrollDownButton",Ac=u.forwardRef((e,t)=>{const n=Pe(an,e.__scopeSelect),r=rn(an,e.__scopeSelect),[o,s]=u.useState(!1),i=re(t,r.onScrollButtonChange);return ie(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<l;s(f)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(mo,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Ac.displayName=an;var mo=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Pe("SelectScrollButton",n),i=u.useRef(null),a=Et(n),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),ie(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),x.jsx(Z.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:J(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:J(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:J(o.onPointerLeave,()=>{c()})})}),Tc="SelectSeparator",Oc=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x.jsx(Z.div,{"aria-hidden":!0,...r,ref:t})});Oc.displayName=Tc;var cn="SelectArrow",Nc=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Rt(n),s=ke(cn,n),i=Pe(cn,n);return s.open&&i.position==="popper"?x.jsx(cc,{...o,...r,ref:t}):null});Nc.displayName=cn;var _c="SelectBubbleInput",ho=u.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=u.useRef(null),s=re(r,o),i=fr(t);return u.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&f){const p=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(p)}},[i,t]),x.jsx(Z.select,{...n,style:{...Fn,...n.style},ref:s,defaultValue:t})});ho.displayName=_c;function go(e){return e===""||e===void 0}function vo(e){const t=Te(e),n=u.useRef(""),r=u.useRef(0),o=u.useCallback(i=>{const a=n.current+i;t(a),(function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=u.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function bo(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Ic(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Ic(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Mc=Kr,jc=qr,Lc=Jr,Dc=Qr,Fc=eo,Bc=to,Wc=so,zc=lo,Vc=uo,$c=po,Pt="Switch",[Hc]=st(Pt),[Uc,Yc]=Hc(Pt),wo=u.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c="on",onCheckedChange:l,form:f,...p}=e,[g,h]=u.useState(null),v=re(t,y=>h(y)),d=u.useRef(!1),m=g?f||!!g.closest("form"):!0,[b,w]=_t({prop:o,defaultProp:s??!1,onChange:l,caller:Pt});return x.jsxs(Uc,{scope:n,checked:b,disabled:a,children:[x.jsx(Z.button,{type:"button",role:"switch","aria-checked":b,"aria-required":i,"data-state":Co(b),"data-disabled":a?"":void 0,disabled:a,value:c,...p,ref:v,onClick:J(e.onClick,y=>{w(E=>!E),m&&(d.current=y.isPropagationStopped(),d.current||y.stopPropagation())})}),m&&x.jsx(So,{control:g,bubbles:!d.current,name:r,value:c,checked:b,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});wo.displayName=Pt;var xo="SwitchThumb",yo=u.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Yc(xo,n);return x.jsx(Z.span,{"data-state":Co(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});yo.displayName=xo;var Gc="SwitchBubbleInput",So=u.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=u.useRef(null),a=re(i,s),c=fr(n),l=pr(t);return u.useEffect(()=>{const f=i.current;if(!f)return;const p=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(p,"checked").set;if(c!==n&&h){const v=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(v)}},[c,n,r]),x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});So.displayName=Gc;function Co(e){return e?"checked":"unchecked"}var Kc=wo,Xc=yo;const qc=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Zc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Eo=e=>{const t=Zc(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ro=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Jc=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Qc={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"};const el=Q.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>Q.createElement("svg",{ref:c,...Qc,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ro("lucide",o),...!s&&!Jc(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,f])=>Q.createElement(l,f)),...Array.isArray(s)?s:[s]]));const ko=(e,t)=>{const n=Q.forwardRef(({className:r,...o},s)=>Q.createElement(el,{ref:s,iconNode:t,className:Ro(`lucide-${qc(Eo(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Eo(e),n};const tl=ko("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const nl=ko("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),rl=e=>x.jsx(Mc,{...e}),ol=({children:e,className:t,...n})=>x.jsxs(zc,{className:ee("text-sm px-3 py-2 rounded-lg bg-bg-1 cursor-pointer hover:bg-bg-2 outline-none",t),...n,children:[x.jsxs(Vc,{children:[" ",e]}),x.jsx("span",{className:"absolute right-2 items-center justify-center",children:x.jsx($c,{children:x.jsx(tl,{className:"w-4 h-4 text-text-2"})})})]}),sl=({className:e,error:t,children:n,...r})=>x.jsxs(jc,{className:ee("bg-bg-1 *:data-[slot=select-value]:overflow-hidden whitespace-nowrap flex justify-between data-[placeholder]:text-text-2 text-text-1 flex items-center gap-3 rounded-lg text-sm cursor-pointer px-3 h-10 border border-border-1 outline-none","data-[state=open]:ring-2 data-[state=open]:ring-border-1/80",e,t&&"border-danger text-danger data-[slot=select-value]:text-danger/80"),"aria-label":"select-trigger",...r,children:[n,x.jsx(Dc,{asChild:!0,children:x.jsx(nl,{className:ee("w-5 h-5 text-text-2",t&&"text-danger/80")})})]}),il=({className:e,...t})=>x.jsx(Lc,{"data-slot":"select-value",className:e,style:{display:"none"},...t}),al=({children:e,className:t,...n})=>x.jsx(Fc,{children:x.jsx(Bc,{"data-slot":"select-content",className:ee("rounded-lg min-w-42 bg-bg-1 border border-border-2 data-[state=open]:animate-popover-in shadow-sm",t),position:"popper",...n,children:x.jsx(Wc,{children:e})})}),cl=({options:e,placeholder:t,onChange:n,defaultValue:r,className:o,contentClassName:s,value:i,error:a})=>x.jsxs(rl,{onValueChange:n,value:i,defaultValue:r,children:[x.jsx(sl,{error:a,className:o,children:x.jsx(il,{placeholder:t})}),x.jsx(al,{className:s,children:e.map(c=>x.jsx(ol,{value:c.value,children:c.label}))})]}),ll=({sections:e,containerClassName:t,pathname:n,open:r,textHeader:o,IconHeader:s,setOpen:i})=>x.jsxs("div",{className:ee("fixed top-0 left-0 inset-0 shrink-0 overflow-hidden z-999 transition-all",r?"pointer-events-auto lg:w-72":"pointer-events-none lg:pointer-events-auto lg:w-21",t),children:[x.jsx("div",{className:ee("bg-overlay w-full h-full transition-opacity lg:hidden",r?"opacity-100":"opacity-0"),onClick:()=>i(!1)}),x.jsxs("nav",{className:ee("absolute px-5 w-72 py-5 top-0 shrink-0 transition-all left-0 h-full bg-bg-1 lg:border-r lg:border-r-border-2",r?"translate-x-0":"-translate-x-full lg:translate-x-0 lg:w-21"),children:[x.jsxs("div",{className:"flex gap-3 items-center mb-7",children:[x.jsx("div",{className:"w-11 h-10 rounded-lg bg-primary-500 shrink-0 flex items-center justify-center",children:x.jsx(s,{className:"w-5 h-5 text-text-3"})}),x.jsx("span",{className:ee("text-text-1 transition-opacity font-bold text-2xl",r?"opacity-100":"opacity-0"),children:o})]}),x.jsx("div",{className:"flex flex-col gap-8",children:e.map(({options:a,title:c,id:l})=>x.jsxs("section",{children:[x.jsx("p",{className:ee("mb-2 text-text-2 text-sm transition-opacity",r?"opacity-100":"opacity-0"),children:c}),a.map(({label:f,href:p,Icon:g,onClick:h},v)=>{const d=n.startsWith(p);return x.jsxs("button",{onClick:h,className:ee("h-10 w-full transition-[width] rounded-lg overflow-hidden text-sm text-text-2 px-3 cursor-pointer flex items-center gap-3",d&&"bg-primary-500 text-text-3",r?"w-full":"w-11"),children:[x.jsx(g,{className:ee("w-5 h-5 text-text-2 shrink-0",d&&"text-text-3")}),x.jsx("p",{className:ee("transition-opacity",r?"opacity-100":"opacity-0"),children:f})]},v)})]},l))})]})]}),ul=({steps:e,currentStep:t=0,className:n,labelClassName:r})=>x.jsx("div",{className:ee("flex items-center gap-4",n),children:e.map((o,s)=>{const i=t>=s;return x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"flex flex-col items-center",children:x.jsxs("button",{className:ee("relative w-10 h-10 rounded-lg cursor-pointer bg-bg-1 text-text-2 border border-border-2 font-bold",i&&"bg-primary-500 border-none text-text-3"),children:[s+1,x.jsx("p",{className:ee("absolute left-1/2 -translate-x-1/2 top-full text-center w-fit text-sm font-normal translate-y-px",i&&"text-text-1",r),children:o.label})]},s)}),s+1<e.length&&x.jsx("div",{className:"h-px w-full bg-border-2"})]})})}),Po=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ao=bn,dl=((e,t)=>n=>{var r;if(t?.variants==null)return Ao(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(l=>{const f=n?.[l],p=s?.[l];if(f===null)return null;const g=Po(f)||Po(p);return o[l][g]}),a=n&&Object.entries(n).reduce((l,f)=>{let[p,g]=f;return g===void 0||(l[p]=g),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,f)=>{let{class:p,className:g,...h}=f;return Object.entries(h).every(v=>{let[d,m]=v;return Array.isArray(m)?m.includes({...s,...a}[d]):{...s,...a}[d]===m})?[...l,p,g]:l},[]);return Ao(e,i,c,n?.class,n?.className)})("h-10 px-3 text-sm flex items-center gap-3 rounded-lg cursor-pointer transition-[background-color] w-fit",{variants:{variant:{filled:"bg-primary-500 text-text-3 font-medium hover:bg-primary-400",outlined:"border border-border-2 bg-bg-1 text-text-1 hover:bg-bg-1/50",ghost:"bg-bg-1 text-text-1 font-medium hover:bg-bg-1/50",icon:"h-10 w-10 bg-bg-1 hover:bg-bg-1/50"}}}),fl=({variant:e,className:t,children:n,...r})=>x.jsx("button",{className:ee(dl({variant:e,className:t})),...r,children:n}),pl=e=>x.jsx(Kc,{className:"h-6 w-10 bg-bg-1 rounded-full relative cursor-pointer data-[state=checked]:bg-primary-500 border-border-2 border",...e,children:x.jsx(Xc,{className:"transition-transform will-change-transform block w-5 h-5 bg-text-2 rounded-full translate-x-0.5 data-[state=checked]:translate-x-4 data-[state=checked]:bg-text-3"})}),ml=({text:e="Badge",type:t="success"})=>{const n={success:"bg-bg-success text-success border-success",error:"bg-bg-danger text-danger border-danger",warning:"bg-bg-warning text-warning border-warning"};return x.jsx("div",{className:ee("text-sm px-3 py-1 rounded-lg border outline-none",n[t]),children:e})};se.Badge=ml,se.Button=fl,se.Input=ws,se.Select=cl,se.SideNavigation=ll,se.Stepper=ul,se.Switch=pl,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})}));
46
+ `)},Ii=0,Be=[];function Mi(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),o=u.useState(Ii++)[0],s=u.useState(nr)[0],i=u.useRef(e);u.useEffect(function(){i.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var d=ti([e.lockRef.current],(e.shards||[]).map(lr),!0).filter(Boolean);return d.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),d.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=u.useCallback(function(d,m){if("touches"in d&&d.touches.length===2||d.type==="wheel"&&d.ctrlKey)return!i.current.allowPinchZoom;var b=ut(d),w=n.current,y="deltaX"in d?d.deltaX:w[0]-b[0],E="deltaY"in d?d.deltaY:w[1]-b[1],k,N=d.target,A=Math.abs(y)>Math.abs(E)?"h":"v";if("touches"in d&&A==="h"&&N.type==="range")return!1;var P=window.getSelection(),M=P&&P.anchorNode,B=M?M===N||M.contains(N):!1;if(B)return!1;var V=sr(A,N);if(!V)return!0;if(V?k=A:(k=A==="v"?"h":"v",V=sr(A,N)),!V)return!1;if(!r.current&&"changedTouches"in d&&(y||E)&&(r.current=k),!k)return!0;var W=r.current||k;return Oi(W,m,d,W==="h"?y:E)},[]),c=u.useCallback(function(d){var m=d;if(!(!Be.length||Be[Be.length-1]!==s)){var b="deltaY"in m?cr(m):ut(m),w=t.current.filter(function(k){return k.name===m.type&&(k.target===m.target||m.target===k.shadowParent)&&Ni(k.delta,b)})[0];if(w&&w.should){m.cancelable&&m.preventDefault();return}if(!w){var y=(i.current.shards||[]).map(lr).filter(Boolean).filter(function(k){return k.contains(m.target)}),E=y.length>0?a(m,y[0]):!i.current.noIsolation;E&&m.cancelable&&m.preventDefault()}}},[]),l=u.useCallback(function(d,m,b,w){var y={name:d,delta:m,target:b,should:w,shadowParent:ji(b)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(E){return E!==y})},1)},[]),f=u.useCallback(function(d){n.current=ut(d),r.current=void 0},[]),p=u.useCallback(function(d){l(d.type,cr(d),d.target,a(d,e.lockRef.current))},[]),g=u.useCallback(function(d){l(d.type,ut(d),d.target,a(d,e.lockRef.current))},[]);u.useEffect(function(){return Be.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",c,Fe),document.addEventListener("touchmove",c,Fe),document.addEventListener("touchstart",f,Fe),function(){Be=Be.filter(function(d){return d!==s}),document.removeEventListener("wheel",c,Fe),document.removeEventListener("touchmove",c,Fe),document.removeEventListener("touchstart",f,Fe)}},[]);var h=e.removeScrollBar,v=e.inert;return u.createElement(u.Fragment,null,v?u.createElement(s,{styles:_i(o)}):null,h?u.createElement(Ci,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ji(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Li=ui(tr,Mi);var ur=u.forwardRef(function(e,t){return u.createElement(ct,me({},e,{ref:t,sideCar:Li}))});ur.classNames=ct.classNames;var Di=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},We=new WeakMap,dt=new WeakMap,ft={},Vt=0,dr=function(e){return e&&(e.host||dr(e.parentNode))},Fi=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=dr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Bi=function(e,t,n,r){var o=Fi(t,Array.isArray(e)?e:[e]);ft[n]||(ft[n]=new WeakMap);var s=ft[n],i=[],a=new Set,c=new Set(o),l=function(p){!p||a.has(p)||(a.add(p),l(p.parentNode))};o.forEach(l);var f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(g){if(a.has(g))f(g);else try{var h=g.getAttribute(r),v=h!==null&&h!=="false",d=(We.get(g)||0)+1,m=(s.get(g)||0)+1;We.set(g,d),s.set(g,m),i.push(g),d===1&&v&&dt.set(g,!0),m===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",g,b)}})};return f(t),a.clear(),Vt++,function(){i.forEach(function(p){var g=We.get(p)-1,h=s.get(p)-1;We.set(p,g),s.set(p,h),g||(dt.has(p)||p.removeAttribute(r),dt.delete(p)),h||p.removeAttribute(n)}),Vt--,Vt||(We=new WeakMap,We=new WeakMap,dt=new WeakMap,ft={})}},Wi=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Di(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Bi(r,o,n,"aria-hidden")):function(){return null}};function fr(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function pr(e){const[t,n]=u.useState(void 0);return ie(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const zi=["top","right","bottom","left"],Ee=Math.min,ce=Math.max,pt=Math.round,mt=Math.floor,he=e=>({x:e,y:e}),Vi={left:"right",right:"left",bottom:"top",top:"bottom"},$i={start:"end",end:"start"};function $t(e,t,n){return ce(e,Ee(t,n))}function xe(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function ze(e){return e.split("-")[1]}function Ht(e){return e==="x"?"y":"x"}function Ut(e){return e==="y"?"height":"width"}const Hi=new Set(["top","bottom"]);function ge(e){return Hi.has(ye(e))?"y":"x"}function Yt(e){return Ht(ge(e))}function Ui(e,t,n){n===void 0&&(n=!1);const r=ze(e),o=Yt(e),s=Ut(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ht(i)),[i,ht(i)]}function Yi(e){const t=ht(e);return[Gt(e),t,Gt(t)]}function Gt(e){return e.replace(/start|end/g,t=>$i[t])}const mr=["left","right"],hr=["right","left"],Gi=["top","bottom"],Ki=["bottom","top"];function Xi(e,t,n){switch(e){case"top":case"bottom":return n?t?hr:mr:t?mr:hr;case"left":case"right":return t?Gi:Ki;default:return[]}}function qi(e,t,n,r){const o=ze(e);let s=Xi(ye(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Gt)))),s}function ht(e){return e.replace(/left|right|bottom|top/g,t=>Vi[t])}function Zi(e){return{top:0,right:0,bottom:0,left:0,...e}}function gr(e){return typeof e!="number"?Zi(e):{top:e,right:e,bottom:e,left:e}}function gt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function vr(e,t,n){let{reference:r,floating:o}=e;const s=ge(t),i=Yt(t),a=Ut(i),c=ye(t),l=s==="y",f=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,g=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:f,y:r.y-o.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:p};break;case"left":h={x:r.x-o.width,y:p};break;default:h={x:r.x,y:r.y}}switch(ze(t)){case"start":h[i]-=g*(n&&l?-1:1);break;case"end":h[i]+=g*(n&&l?-1:1);break}return h}const Ji=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=vr(l,r,c),g=r,h={},v=0;for(let d=0;d<a.length;d++){const{name:m,fn:b}=a[d],{x:w,y,data:E,reset:k}=await b({x:f,y:p,initialPlacement:r,placement:g,strategy:o,middlewareData:h,rects:l,platform:i,elements:{reference:e,floating:t}});f=w??f,p=y??p,h={...h,[m]:{...h[m],...E}},k&&v<=50&&(v++,typeof k=="object"&&(k.placement&&(g=k.placement),k.rects&&(l=k.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:f,y:p}=vr(l,g,c)),d=-1)}return{x:f,y:p,placement:g,strategy:o,middlewareData:h}};async function Xe(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:g=!1,padding:h=0}=xe(t,e),v=gr(h),m=a[g?p==="floating"?"reference":"floating":p],b=gt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:f,strategy:c})),w=p==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},k=gt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:y,strategy:c}):w);return{top:(b.top-k.top+v.top)/E.y,bottom:(k.bottom-b.bottom+v.bottom)/E.y,left:(b.left-k.left+v.left)/E.x,right:(k.right-b.right+v.right)/E.x}}const Qi=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:f=0}=xe(e,t)||{};if(l==null)return{};const p=gr(f),g={x:n,y:r},h=Yt(o),v=Ut(h),d=await i.getDimensions(l),m=h==="y",b=m?"top":"left",w=m?"bottom":"right",y=m?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[h]-g[h]-s.floating[v],k=g[h]-s.reference[h],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let A=N?N[y]:0;(!A||!await(i.isElement==null?void 0:i.isElement(N)))&&(A=a.floating[y]||s.floating[v]);const P=E/2-k/2,M=A/2-d[v]/2-1,B=Ee(p[b],M),V=Ee(p[w],M),W=B,$=A-d[v]-V,z=A/2-d[v]/2+P,H=$t(W,z,$),I=!c.arrow&&ze(o)!=null&&z!==H&&s.reference[v]/2-(z<W?B:V)-d[v]/2<0,D=I?z<W?z-W:z-$:0;return{[h]:g[h]+D,data:{[h]:H,centerOffset:z-H-D,...I&&{alignmentOffset:D}},reset:I}}}),ea=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:d=!0,...m}=xe(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=ye(o),w=ge(a),y=ye(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(l.floating)),k=g||(y||!d?[ht(a)]:Yi(a)),N=v!=="none";!g&&N&&k.push(...qi(a,d,v,E));const A=[a,...k],P=await Xe(t,m),M=[];let B=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&M.push(P[b]),p){const z=Ui(o,i,E);M.push(P[z[0]],P[z[1]])}if(B=[...B,{placement:o,overflows:M}],!M.every(z=>z<=0)){var V,W;const z=(((V=s.flip)==null?void 0:V.index)||0)+1,H=A[z];if(H&&(!(p==="alignment"?w!==ge(H):!1)||B.every(C=>ge(C.placement)===w?C.overflows[0]>0:!0)))return{data:{index:z,overflows:B},reset:{placement:H}};let I=(W=B.filter(D=>D.overflows[0]<=0).sort((D,C)=>D.overflows[1]-C.overflows[1])[0])==null?void 0:W.placement;if(!I)switch(h){case"bestFit":{var $;const D=($=B.filter(C=>{if(N){const G=ge(C.placement);return G===w||G==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(G=>G>0).reduce((G,te)=>G+te,0)]).sort((C,G)=>C[1]-G[1])[0])==null?void 0:$[0];D&&(I=D);break}case"initialPlacement":I=a;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function br(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wr(e){return zi.some(t=>e[t]>=0)}const ta=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=xe(e,t);switch(r){case"referenceHidden":{const s=await Xe(t,{...o,elementContext:"reference"}),i=br(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:wr(i)}}}case"escaped":{const s=await Xe(t,{...o,altBoundary:!0}),i=br(s,n.floating);return{data:{escapedOffsets:i,escaped:wr(i)}}}default:return{}}}}},xr=new Set(["left","top"]);async function na(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ye(n),a=ze(n),c=ge(n)==="y",l=xr.has(i)?-1:1,f=s&&c?-1:1,p=xe(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof v=="number"&&(h=a==="end"?v*-1:v),c?{x:h*f,y:g*l}:{x:g*l,y:h*f}}const ra=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await na(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},oa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:m=>{let{x:b,y:w}=m;return{x:b,y:w}}},...c}=xe(e,t),l={x:n,y:r},f=await Xe(t,c),p=ge(ye(o)),g=Ht(p);let h=l[g],v=l[p];if(s){const m=g==="y"?"top":"left",b=g==="y"?"bottom":"right",w=h+f[m],y=h-f[b];h=$t(w,h,y)}if(i){const m=p==="y"?"top":"left",b=p==="y"?"bottom":"right",w=v+f[m],y=v-f[b];v=$t(w,v,y)}const d=a.fn({...t,[g]:h,[p]:v});return{...d,data:{x:d.x-n,y:d.y-r,enabled:{[g]:s,[p]:i}}}}}},sa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=xe(e,t),f={x:n,y:r},p=ge(o),g=Ht(p);let h=f[g],v=f[p];const d=xe(a,t),m=typeof d=="number"?{mainAxis:d,crossAxis:0}:{mainAxis:0,crossAxis:0,...d};if(c){const y=g==="y"?"height":"width",E=s.reference[g]-s.floating[y]+m.mainAxis,k=s.reference[g]+s.reference[y]-m.mainAxis;h<E?h=E:h>k&&(h=k)}if(l){var b,w;const y=g==="y"?"width":"height",E=xr.has(ye(o)),k=s.reference[p]-s.floating[y]+(E&&((b=i.offset)==null?void 0:b[p])||0)+(E?0:m.crossAxis),N=s.reference[p]+s.reference[y]+(E?0:((w=i.offset)==null?void 0:w[p])||0)-(E?m.crossAxis:0);v<k?v=k:v>N&&(v=N)}return{[g]:h,[p]:v}}}},ia=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=xe(e,t),f=await Xe(t,l),p=ye(o),g=ze(o),h=ge(o)==="y",{width:v,height:d}=s.floating;let m,b;p==="top"||p==="bottom"?(m=p,b=g===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=p,m=g==="end"?"top":"bottom");const w=d-f.top-f.bottom,y=v-f.left-f.right,E=Ee(d-f[m],w),k=Ee(v-f[b],y),N=!t.middlewareData.shift;let A=E,P=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=w),N&&!g){const B=ce(f.left,0),V=ce(f.right,0),W=ce(f.top,0),$=ce(f.bottom,0);h?P=v-2*(B!==0||V!==0?B+V:ce(f.left,f.right)):A=d-2*(W!==0||$!==0?W+$:ce(f.top,f.bottom))}await c({...t,availableWidth:P,availableHeight:A});const M=await i.getDimensions(a.floating);return v!==M.width||d!==M.height?{reset:{rects:!0}}:{}}}};function vt(){return typeof window<"u"}function Ve(e){return yr(e)?(e.nodeName||"").toLowerCase():"#document"}function le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ve(e){var t;return(t=(yr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yr(e){return vt()?e instanceof Node||e instanceof le(e).Node:!1}function de(e){return vt()?e instanceof Element||e instanceof le(e).Element:!1}function be(e){return vt()?e instanceof HTMLElement||e instanceof le(e).HTMLElement:!1}function Sr(e){return!vt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof le(e).ShadowRoot}const aa=new Set(["inline","contents"]);function qe(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!aa.has(o)}const ca=new Set(["table","td","th"]);function la(e){return ca.has(Ve(e))}const ua=[":popover-open",":modal"];function bt(e){return ua.some(t=>{try{return e.matches(t)}catch{return!1}})}const da=["transform","translate","scale","rotate","perspective"],fa=["transform","translate","scale","rotate","perspective","filter"],pa=["paint","layout","strict","content"];function Kt(e){const t=Xt(),n=de(e)?fe(e):e;return da.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||fa.some(r=>(n.willChange||"").includes(r))||pa.some(r=>(n.contain||"").includes(r))}function ma(e){let t=Re(e);for(;be(t)&&!$e(t);){if(Kt(t))return t;if(bt(t))return null;t=Re(t)}return null}function Xt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ha=new Set(["html","body","#document"]);function $e(e){return ha.has(Ve(e))}function fe(e){return le(e).getComputedStyle(e)}function wt(e){return de(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Re(e){if(Ve(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Sr(e)&&e.host||ve(e);return Sr(t)?t.host:t}function Cr(e){const t=Re(e);return $e(t)?e.ownerDocument?e.ownerDocument.body:e.body:be(t)&&qe(t)?t:Cr(t)}function Ze(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Cr(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=le(o);if(s){const a=qt(i);return t.concat(i,i.visualViewport||[],qe(o)?o:[],a&&n?Ze(a):[])}return t.concat(o,Ze(o,[],n))}function qt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Er(e){const t=fe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=be(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=pt(n)!==s||pt(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Zt(e){return de(e)?e:e.contextElement}function He(e){const t=Zt(e);if(!be(t))return he(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Er(t);let i=(s?pt(n.width):n.width)/r,a=(s?pt(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const ga=he(0);function Rr(e){const t=le(e);return!Xt()||!t.visualViewport?ga:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function va(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==le(e)?!1:t}function Oe(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Zt(e);let i=he(1);t&&(r?de(r)&&(i=He(r)):i=He(e));const a=va(s,n,r)?Rr(s):he(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,f=o.width/i.x,p=o.height/i.y;if(s){const g=le(s),h=r&&de(r)?le(r):r;let v=g,d=qt(v);for(;d&&r&&h!==v;){const m=He(d),b=d.getBoundingClientRect(),w=fe(d),y=b.left+(d.clientLeft+parseFloat(w.paddingLeft))*m.x,E=b.top+(d.clientTop+parseFloat(w.paddingTop))*m.y;c*=m.x,l*=m.y,f*=m.x,p*=m.y,c+=y,l+=E,v=le(d),d=qt(v)}}return gt({width:f,height:p,x:c,y:l})}function xt(e,t){const n=wt(e).scrollLeft;return t?t.left+n:Oe(ve(e)).left+n}function kr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-xt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function ba(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ve(r),a=t?bt(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=he(1);const f=he(0),p=be(r);if((p||!p&&!s)&&((Ve(r)!=="body"||qe(i))&&(c=wt(r)),be(r))){const h=Oe(r);l=He(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const g=i&&!p&&!s?kr(i,c):he(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+f.x+g.x,y:n.y*l.y-c.scrollTop*l.y+f.y+g.y}}function wa(e){return Array.from(e.getClientRects())}function xa(e){const t=ve(e),n=wt(e),r=e.ownerDocument.body,o=ce(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ce(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+xt(e);const a=-n.scrollTop;return fe(r).direction==="rtl"&&(i+=ce(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Pr=25;function ya(e,t){const n=le(e),r=ve(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const f=Xt();(!f||f&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=xt(r);if(l<=0){const f=r.ownerDocument,p=f.body,g=getComputedStyle(p),h=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(r.clientWidth-p.clientWidth-h);v<=Pr&&(s-=v)}else l<=Pr&&(s+=l);return{width:s,height:i,x:a,y:c}}const Sa=new Set(["absolute","fixed"]);function Ca(e,t){const n=Oe(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=be(e)?He(e):he(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function Ar(e,t,n){let r;if(t==="viewport")r=ya(e,n);else if(t==="document")r=xa(ve(e));else if(de(t))r=Ca(t,n);else{const o=Rr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return gt(r)}function Tr(e,t){const n=Re(e);return n===t||!de(n)||$e(n)?!1:fe(n).position==="fixed"||Tr(n,t)}function Ea(e,t){const n=t.get(e);if(n)return n;let r=Ze(e,[],!1).filter(a=>de(a)&&Ve(a)!=="body"),o=null;const s=fe(e).position==="fixed";let i=s?Re(e):e;for(;de(i)&&!$e(i);){const a=fe(i),c=Kt(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&Sa.has(o.position)||qe(i)&&!c&&Tr(e,i))?r=r.filter(f=>f!==i):o=a,i=Re(i)}return t.set(e,r),r}function Ra(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?bt(t)?[]:Ea(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,f)=>{const p=Ar(t,f,o);return l.top=ce(p.top,l.top),l.right=Ee(p.right,l.right),l.bottom=Ee(p.bottom,l.bottom),l.left=ce(p.left,l.left),l},Ar(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ka(e){const{width:t,height:n}=Er(e);return{width:t,height:n}}function Pa(e,t,n){const r=be(t),o=ve(t),s=n==="fixed",i=Oe(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=he(0);function l(){c.x=xt(o)}if(r||!r&&!s)if((Ve(t)!=="body"||qe(o))&&(a=wt(t)),r){const h=Oe(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&l();s&&!r&&o&&l();const f=o&&!r&&!s?kr(o,a):he(0),p=i.left+a.scrollLeft-c.x-f.x,g=i.top+a.scrollTop-c.y-f.y;return{x:p,y:g,width:i.width,height:i.height}}function Jt(e){return fe(e).position==="static"}function Or(e,t){if(!be(e)||fe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ve(e)===n&&(n=n.ownerDocument.body),n}function Nr(e,t){const n=le(e);if(bt(e))return n;if(!be(e)){let o=Re(e);for(;o&&!$e(o);){if(de(o)&&!Jt(o))return o;o=Re(o)}return n}let r=Or(e,t);for(;r&&la(r)&&Jt(r);)r=Or(r,t);return r&&$e(r)&&Jt(r)&&!Kt(r)?n:r||ma(e)||n}const Aa=async function(e){const t=this.getOffsetParent||Nr,n=this.getDimensions,r=await n(e.floating);return{reference:Pa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ta(e){return fe(e).direction==="rtl"}const Oa={convertOffsetParentRelativeRectToViewportRelativeRect:ba,getDocumentElement:ve,getClippingRect:Ra,getOffsetParent:Nr,getElementRects:Aa,getClientRects:wa,getDimensions:ka,getScale:He,isElement:de,isRTL:Ta};function _r(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Na(e,t){let n=null,r;const o=ve(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:f,top:p,width:g,height:h}=l;if(a||t(),!g||!h)return;const v=mt(p),d=mt(o.clientWidth-(f+g)),m=mt(o.clientHeight-(p+h)),b=mt(f),y={rootMargin:-v+"px "+-d+"px "+-m+"px "+-b+"px",threshold:ce(0,Ee(1,c))||1};let E=!0;function k(N){const A=N[0].intersectionRatio;if(A!==c){if(!E)return i();A?i(!1,A):r=setTimeout(()=>{i(!1,1e-7)},1e3)}A===1&&!_r(l,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(k,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,y)}n.observe(e)}return i(!0),s}function _a(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Zt(e),f=o||s?[...l?Ze(l):[],...Ze(t)]:[];f.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const p=l&&a?Na(l,n):null;let g=-1,h=null;i&&(h=new ResizeObserver(b=>{let[w]=b;w&&w.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let v,d=c?Oe(e):null;c&&m();function m(){const b=Oe(e);d&&!_r(d,b)&&n(),d=b,v=requestAnimationFrame(m)}return n(),()=>{var b;f.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),p?.(),(b=h)==null||b.disconnect(),h=null,c&&cancelAnimationFrame(v)}}const Ia=ra,Ma=oa,ja=ea,La=ia,Da=ta,Ir=Qi,Fa=sa,Ba=(e,t,n)=>{const r=new Map,o={platform:Oa,...n},s={...o.platform,_c:r};return Ji(e,t,{...o,platform:s})};var Wa=typeof document<"u",za=function(){},yt=Wa?Q.useLayoutEffect:za;function St(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,o;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(!St(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!St(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Mr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jr(e,t){const n=Mr(e);return Math.round(t*n)/n}function Qt(e){const t=u.useRef(e);return yt(()=>{t.current=e}),t}function Va(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[f,p]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,h]=u.useState(r);St(g,r)||h(r);const[v,d]=u.useState(null),[m,b]=u.useState(null),w=u.useCallback(C=>{C!==N.current&&(N.current=C,d(C))},[]),y=u.useCallback(C=>{C!==A.current&&(A.current=C,b(C))},[]),E=s||v,k=i||m,N=u.useRef(null),A=u.useRef(null),P=u.useRef(f),M=c!=null,B=Qt(c),V=Qt(o),W=Qt(l),$=u.useCallback(()=>{if(!N.current||!A.current)return;const C={placement:t,strategy:n,middleware:g};V.current&&(C.platform=V.current),Ba(N.current,A.current,C).then(G=>{const te={...G,isPositioned:W.current!==!1};z.current&&!St(P.current,te)&&(P.current=te,Qe.flushSync(()=>{p(te)}))})},[g,t,n,V,W]);yt(()=>{l===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p(C=>({...C,isPositioned:!1})))},[l]);const z=u.useRef(!1);yt(()=>(z.current=!0,()=>{z.current=!1}),[]),yt(()=>{if(E&&(N.current=E),k&&(A.current=k),E&&k){if(B.current)return B.current(E,k,$);$()}},[E,k,$,B,M]);const H=u.useMemo(()=>({reference:N,floating:A,setReference:w,setFloating:y}),[w,y]),I=u.useMemo(()=>({reference:E,floating:k}),[E,k]),D=u.useMemo(()=>{const C={position:n,left:0,top:0};if(!I.floating)return C;const G=jr(I.floating,f.x),te=jr(I.floating,f.y);return a?{...C,transform:"translate("+G+"px, "+te+"px)",...Mr(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:te}},[n,a,I.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:$,refs:H,elements:I,floatingStyles:D}),[f,$,H,I,D])}const $a=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ir({element:r.current,padding:o}).fn(n):{}:r?Ir({element:r,padding:o}).fn(n):{}}}},Ha=(e,t)=>({...Ia(e),options:[e,t]}),Ua=(e,t)=>({...Ma(e),options:[e,t]}),Ya=(e,t)=>({...Fa(e),options:[e,t]}),Ga=(e,t)=>({...ja(e),options:[e,t]}),Ka=(e,t)=>({...La(e),options:[e,t]}),Xa=(e,t)=>({...Da(e),options:[e,t]}),qa=(e,t)=>({...$a(e),options:[e,t]});var Za="Arrow",Lr=u.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return x.jsx(Z.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});Lr.displayName=Za;var Ja=Lr,en="Popper",[Dr,Fr]=st(en),[Qa,Br]=Dr(en),Wr=e=>{const{__scopePopper:t,children:n}=e,[r,o]=u.useState(null);return x.jsx(Qa,{scope:t,anchor:r,onAnchorChange:o,children:n})};Wr.displayName=en;var zr="PopperAnchor",Vr=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Br(zr,n),i=u.useRef(null),a=re(t,i),c=u.useRef(null);return u.useEffect(()=>{const l=c.current;c.current=r?.current||i.current,l!==c.current&&s.onAnchorChange(c.current)}),r?null:x.jsx(Z.div,{...o,ref:a})});Vr.displayName=zr;var tn="PopperContent",[ec,tc]=Dr(tn),$r=u.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:h="optimized",onPlaced:v,...d}=e,m=Br(tn,n),[b,w]=u.useState(null),y=re(t,R=>w(R)),[E,k]=u.useState(null),N=pr(E),A=N?.width??0,P=N?.height??0,M=r+(s!=="center"?"-"+s:""),B=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},V=Array.isArray(l)?l:[l],W=V.length>0,$={padding:B,boundary:V.filter(rc),altBoundary:W},{refs:z,floatingStyles:H,placement:I,isPositioned:D,middlewareData:C}=Va({strategy:"fixed",placement:M,whileElementsMounted:(...R)=>_a(...R,{animationFrame:h==="always"}),elements:{reference:m.anchor},middleware:[Ha({mainAxis:o+P,alignmentAxis:i}),c&&Ua({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Ya():void 0,...$}),c&&Ga({...$}),Ka({...$,apply:({elements:R,rects:U,availableWidth:q,availableHeight:Y})=>{const{width:K,height:X}=U.reference,ue=R.floating.style;ue.setProperty("--radix-popper-available-width",`${q}px`),ue.setProperty("--radix-popper-available-height",`${Y}px`),ue.setProperty("--radix-popper-anchor-width",`${K}px`),ue.setProperty("--radix-popper-anchor-height",`${X}px`)}}),E&&qa({element:E,padding:a}),oc({arrowWidth:A,arrowHeight:P}),g&&Xa({strategy:"referenceHidden",...$})]}),[G,te]=Yr(I),S=Te(v);ie(()=>{D&&S?.()},[D,S]);const _=C.arrow?.x,j=C.arrow?.y,L=C.arrow?.centerOffset!==0,[oe,ae]=u.useState();return ie(()=>{b&&ae(window.getComputedStyle(b).zIndex)},[b]),x.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:D?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[C.transformOrigin?.x,C.transformOrigin?.y].join(" "),...C.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(ec,{scope:n,placedSide:G,onArrowChange:k,arrowX:_,arrowY:j,shouldHideArrow:L,children:x.jsx(Z.div,{"data-side":G,"data-align":te,...d,ref:y,style:{...d.style,animation:D?void 0:"none"}})})})});$r.displayName=tn;var Hr="PopperArrow",nc={top:"bottom",right:"left",bottom:"top",left:"right"},Ur=u.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=tc(Hr,r),i=nc[s.placedSide];return x.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:x.jsx(Ja,{...o,ref:n,style:{...o.style,display:"block"}})})});Ur.displayName=Hr;function rc(e){return e!==null}var oc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,f]=Yr(n),p={start:"0%",center:"50%",end:"100%"}[f],g=(o.arrow?.x??0)+a/2,h=(o.arrow?.y??0)+c/2;let v="",d="";return l==="bottom"?(v=i?p:`${g}px`,d=`${-c}px`):l==="top"?(v=i?p:`${g}px`,d=`${r.floating.height+c}px`):l==="right"?(v=`${-c}px`,d=i?p:`${h}px`):l==="left"&&(v=`${r.floating.width+c}px`,d=i?p:`${h}px`),{data:{x:v,y:d}}}});function Yr(e){const[t,n="center"]=e.split("-");return[t,n]}var sc=Wr,ic=Vr,ac=$r,cc=Ur;function Gr(e,[t,n]){return Math.min(n,Math.max(t,e))}var lc=[" ","Enter","ArrowUp","ArrowDown"],uc=[" ","Enter"],Ne="Select",[Ct,Et,dc]=Os(Ne),[Ue]=st(Ne,[dc,Fr]),Rt=Fr(),[fc,ke]=Ue(Ne),[pc,mc]=Ue(Ne),Kr=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:f,autoComplete:p,disabled:g,required:h,form:v}=e,d=Rt(t),[m,b]=u.useState(null),[w,y]=u.useState(null),[E,k]=u.useState(!1),N=Ds(l),[A,P]=_t({prop:r,defaultProp:o??!1,onChange:s,caller:Ne}),[M,B]=_t({prop:i,defaultProp:a,onChange:c,caller:Ne}),V=u.useRef(null),W=m?v||!!m.closest("form"):!0,[$,z]=u.useState(new Set),H=Array.from($).map(I=>I.props.value).join(";");return x.jsx(sc,{...d,children:x.jsxs(fc,{required:h,scope:t,trigger:m,onTriggerChange:b,valueNode:w,onValueNodeChange:y,valueNodeHasChildren:E,onValueNodeHasChildrenChange:k,contentId:It(),value:M,onValueChange:B,open:A,onOpenChange:P,dir:N,triggerPointerDownPosRef:V,disabled:g,children:[x.jsx(Ct.Provider,{scope:t,children:x.jsx(pc,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(I=>{z(D=>new Set(D).add(I))},[]),onNativeOptionRemove:u.useCallback(I=>{z(D=>{const C=new Set(D);return C.delete(I),C})},[]),children:n})}),W?x.jsxs(ho,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:M,onChange:I=>B(I.target.value),disabled:g,form:v,children:[M===void 0?x.jsx("option",{value:""}):null,Array.from($)]},H):null]})})};Kr.displayName=Ne;var Xr="SelectTrigger",qr=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Rt(n),i=ke(Xr,n),a=i.disabled||r,c=re(t,i.onTriggerChange),l=Et(n),f=u.useRef("touch"),[p,g,h]=vo(d=>{const m=l().filter(y=>!y.disabled),b=m.find(y=>y.value===i.value),w=bo(m,d,b);w!==void 0&&i.onValueChange(w.value)}),v=d=>{a||(i.onOpenChange(!0),h()),d&&(i.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return x.jsx(ic,{asChild:!0,...s,children:x.jsx(Z.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":go(i.value)?"":void 0,...o,ref:c,onClick:J(o.onClick,d=>{d.currentTarget.focus(),f.current!=="mouse"&&v(d)}),onPointerDown:J(o.onPointerDown,d=>{f.current=d.pointerType;const m=d.target;m.hasPointerCapture(d.pointerId)&&m.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(v(d),d.preventDefault())}),onKeyDown:J(o.onKeyDown,d=>{const m=p.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&g(d.key),!(m&&d.key===" ")&&lc.includes(d.key)&&(v(),d.preventDefault())})})})});qr.displayName=Xr;var Zr="SelectValue",Jr=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=ke(Zr,n),{onValueNodeHasChildrenChange:l}=c,f=s!==void 0,p=re(t,c.onValueNodeChange);return ie(()=>{l(f)},[l,f]),x.jsx(Z.span,{...a,ref:p,style:{pointerEvents:"none"},children:go(c.value)?x.jsx(x.Fragment,{children:i}):s})});Jr.displayName=Zr;var hc="SelectIcon",Qr=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return x.jsx(Z.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Qr.displayName=hc;var gc="SelectPortal",eo=e=>x.jsx(qn,{asChild:!0,...e});eo.displayName=gc;var _e="SelectContent",to=u.forwardRef((e,t)=>{const n=ke(_e,e.__scopeSelect),[r,o]=u.useState();if(ie(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Qe.createPortal(x.jsx(no,{scope:e.__scopeSelect,children:x.jsx(Ct.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),s):null}return x.jsx(ro,{...e,ref:t})});to.displayName=_e;var pe=10,[no,Pe]=Ue(_e),vc="SelectContentImpl",bc=ot("SelectContent.RemoveScroll"),ro=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:h,sticky:v,hideWhenDetached:d,avoidCollisions:m,...b}=e,w=ke(_e,n),[y,E]=u.useState(null),[k,N]=u.useState(null),A=re(t,R=>E(R)),[P,M]=u.useState(null),[B,V]=u.useState(null),W=Et(n),[$,z]=u.useState(!1),H=u.useRef(!1);u.useEffect(()=>{if(y)return Wi(y)},[y]),ei();const I=u.useCallback(R=>{const[U,...q]=W().map(X=>X.ref.current),[Y]=q.slice(-1),K=document.activeElement;for(const X of R)if(X===K||(X?.scrollIntoView({block:"nearest"}),X===U&&k&&(k.scrollTop=0),X===Y&&k&&(k.scrollTop=k.scrollHeight),X?.focus(),document.activeElement!==K))return},[W,k]),D=u.useCallback(()=>I([P,y]),[I,P,y]);u.useEffect(()=>{$&&D()},[$,D]);const{onOpenChange:C,triggerPointerDownPosRef:G}=w;u.useEffect(()=>{if(y){let R={x:0,y:0};const U=Y=>{R={x:Math.abs(Math.round(Y.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(Y.pageY)-(G.current?.y??0))}},q=Y=>{R.x<=10&&R.y<=10?Y.preventDefault():y.contains(Y.target)||C(!1),document.removeEventListener("pointermove",U),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",q,{capture:!0})}}},[y,C,G]),u.useEffect(()=>{const R=()=>C(!1);return window.addEventListener("blur",R),window.addEventListener("resize",R),()=>{window.removeEventListener("blur",R),window.removeEventListener("resize",R)}},[C]);const[te,S]=vo(R=>{const U=W().filter(K=>!K.disabled),q=U.find(K=>K.ref.current===document.activeElement),Y=bo(U,R,q);Y&&setTimeout(()=>Y.ref.current.focus())}),_=u.useCallback((R,U,q)=>{const Y=!H.current&&!q;(w.value!==void 0&&w.value===U||Y)&&(M(R),Y&&(H.current=!0))},[w.value]),j=u.useCallback(()=>y?.focus(),[y]),L=u.useCallback((R,U,q)=>{const Y=!H.current&&!q;(w.value!==void 0&&w.value===U||Y)&&V(R)},[w.value]),oe=r==="popper"?nn:oo,ae=oe===nn?{side:a,sideOffset:c,align:l,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:h,sticky:v,hideWhenDetached:d,avoidCollisions:m}:{};return x.jsx(no,{scope:n,content:y,viewport:k,onViewportChange:N,itemRefCallback:_,selectedItem:P,onItemLeave:j,itemTextRefCallback:L,focusSelectedItem:D,selectedItemText:B,position:r,isPositioned:$,searchRef:te,children:x.jsx(ur,{as:bc,allowPinchZoom:!0,children:x.jsx(Un,{asChild:!0,trapped:w.open,onMountAutoFocus:R=>{R.preventDefault()},onUnmountAutoFocus:J(o,R=>{w.trigger?.focus({preventScroll:!0}),R.preventDefault()}),children:x.jsx(zn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:R=>R.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:x.jsx(oe,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:R=>R.preventDefault(),...b,...ae,onPlaced:()=>z(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:J(b.onKeyDown,R=>{const U=R.ctrlKey||R.altKey||R.metaKey;if(R.key==="Tab"&&R.preventDefault(),!U&&R.key.length===1&&S(R.key),["ArrowUp","ArrowDown","Home","End"].includes(R.key)){let Y=W().filter(K=>!K.disabled).map(K=>K.ref.current);if(["ArrowUp","End"].includes(R.key)&&(Y=Y.slice().reverse()),["ArrowUp","ArrowDown"].includes(R.key)){const K=R.target,X=Y.indexOf(K);Y=Y.slice(X+1)}setTimeout(()=>I(Y)),R.preventDefault()}})})})})})})});ro.displayName=vc;var wc="SelectItemAlignedPosition",oo=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=ke(_e,n),i=Pe(_e,n),[a,c]=u.useState(null),[l,f]=u.useState(null),p=re(t,A=>f(A)),g=Et(n),h=u.useRef(!1),v=u.useRef(!0),{viewport:d,selectedItem:m,selectedItemText:b,focusSelectedItem:w}=i,y=u.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&d&&m&&b){const A=s.trigger.getBoundingClientRect(),P=l.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),B=b.getBoundingClientRect();if(s.dir!=="rtl"){const K=B.left-P.left,X=M.left-K,ue=A.left-X,Ie=A.width+ue,ln=Math.max(Ie,P.width),un=window.innerWidth-pe,dn=Gr(X,[pe,Math.max(pe,un-ln)]);a.style.minWidth=Ie+"px",a.style.left=dn+"px"}else{const K=P.right-B.right,X=window.innerWidth-M.right-K,ue=window.innerWidth-A.right-X,Ie=A.width+ue,ln=Math.max(Ie,P.width),un=window.innerWidth-pe,dn=Gr(X,[pe,Math.max(pe,un-ln)]);a.style.minWidth=Ie+"px",a.style.right=dn+"px"}const V=g(),W=window.innerHeight-pe*2,$=d.scrollHeight,z=window.getComputedStyle(l),H=parseInt(z.borderTopWidth,10),I=parseInt(z.paddingTop,10),D=parseInt(z.borderBottomWidth,10),C=parseInt(z.paddingBottom,10),G=H+I+$+C+D,te=Math.min(m.offsetHeight*5,G),S=window.getComputedStyle(d),_=parseInt(S.paddingTop,10),j=parseInt(S.paddingBottom,10),L=A.top+A.height/2-pe,oe=W-L,ae=m.offsetHeight/2,R=m.offsetTop+ae,U=H+I+R,q=G-U;if(U<=L){const K=V.length>0&&m===V[V.length-1].ref.current;a.style.bottom="0px";const X=l.clientHeight-d.offsetTop-d.offsetHeight,ue=Math.max(oe,ae+(K?j:0)+X+D),Ie=U+ue;a.style.height=Ie+"px"}else{const K=V.length>0&&m===V[0].ref.current;a.style.top="0px";const ue=Math.max(L,H+d.offsetTop+(K?_:0)+ae)+q;a.style.height=ue+"px",d.scrollTop=U-L+d.offsetTop}a.style.margin=`${pe}px 0`,a.style.minHeight=te+"px",a.style.maxHeight=W+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[g,s.trigger,s.valueNode,a,l,d,m,b,s.dir,r]);ie(()=>y(),[y]);const[E,k]=u.useState();ie(()=>{l&&k(window.getComputedStyle(l).zIndex)},[l]);const N=u.useCallback(A=>{A&&v.current===!0&&(y(),w?.(),v.current=!1)},[y,w]);return x.jsx(yc,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:x.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:x.jsx(Z.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});oo.displayName=wc;var xc="SelectPopperPosition",nn=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=pe,...s}=e,i=Rt(n);return x.jsx(ac,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nn.displayName=xc;var[yc,rn]=Ue(_e,{}),on="SelectViewport",so=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Pe(on,n),i=rn(on,n),a=re(t,s.onViewportChange),c=u.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),x.jsx(Ct.Slot,{scope:n,children:x.jsx(Z.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:J(o.onScroll,l=>{const f=l.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=i;if(g?.current&&p){const h=Math.abs(c.current-f.scrollTop);if(h>0){const v=window.innerHeight-pe*2,d=parseFloat(p.style.minHeight),m=parseFloat(p.style.height),b=Math.max(d,m);if(b<v){const w=b+h,y=Math.min(v,w),E=w-y;p.style.height=y+"px",p.style.bottom==="0px"&&(f.scrollTop=E>0?E:0,p.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});so.displayName=on;var io="SelectGroup",[Sc,Cc]=Ue(io),Ec=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=It();return x.jsx(Sc,{scope:n,id:o,children:x.jsx(Z.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Ec.displayName=io;var ao="SelectLabel",Rc=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Cc(ao,n);return x.jsx(Z.div,{id:o.id,...r,ref:t})});Rc.displayName=ao;var kt="SelectItem",[kc,co]=Ue(kt),lo=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=ke(kt,n),c=Pe(kt,n),l=a.value===r,[f,p]=u.useState(s??""),[g,h]=u.useState(!1),v=re(t,w=>c.itemRefCallback?.(w,r,o)),d=It(),m=u.useRef("touch"),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.jsx(kc,{scope:n,value:r,disabled:o,textId:d,isSelected:l,onItemTextChange:u.useCallback(w=>{p(y=>y||(w?.textContent??"").trim())},[]),children:x.jsx(Ct.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:x.jsx(Z.div,{role:"option","aria-labelledby":d,"data-highlighted":g?"":void 0,"aria-selected":l&&g,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:v,onFocus:J(i.onFocus,()=>h(!0)),onBlur:J(i.onBlur,()=>h(!1)),onClick:J(i.onClick,()=>{m.current!=="mouse"&&b()}),onPointerUp:J(i.onPointerUp,()=>{m.current==="mouse"&&b()}),onPointerDown:J(i.onPointerDown,w=>{m.current=w.pointerType}),onPointerMove:J(i.onPointerMove,w=>{m.current=w.pointerType,o?c.onItemLeave?.():m.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(i.onPointerLeave,w=>{w.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:J(i.onKeyDown,w=>{c.searchRef?.current!==""&&w.key===" "||(uc.includes(w.key)&&b(),w.key===" "&&w.preventDefault())})})})})});lo.displayName=kt;var Je="SelectItemText",uo=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=ke(Je,n),a=Pe(Je,n),c=co(Je,n),l=mc(Je,n),[f,p]=u.useState(null),g=re(t,b=>p(b),c.onItemTextChange,b=>a.itemTextRefCallback?.(b,c.value,c.disabled)),h=f?.textContent,v=u.useMemo(()=>x.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:d,onNativeOptionRemove:m}=l;return ie(()=>(d(v),()=>m(v)),[d,m,v]),x.jsxs(x.Fragment,{children:[x.jsx(Z.span,{id:c.textId,...s,ref:g}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Qe.createPortal(s.children,i.valueNode):null]})});uo.displayName=Je;var fo="SelectItemIndicator",po=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return co(fo,n).isSelected?x.jsx(Z.span,{"aria-hidden":!0,...r,ref:t}):null});po.displayName=fo;var sn="SelectScrollUpButton",Pc=u.forwardRef((e,t)=>{const n=Pe(sn,e.__scopeSelect),r=rn(sn,e.__scopeSelect),[o,s]=u.useState(!1),i=re(t,r.onScrollButtonChange);return ie(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(mo,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Pc.displayName=sn;var an="SelectScrollDownButton",Ac=u.forwardRef((e,t)=>{const n=Pe(an,e.__scopeSelect),r=rn(an,e.__scopeSelect),[o,s]=u.useState(!1),i=re(t,r.onScrollButtonChange);return ie(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<l;s(f)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(mo,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Ac.displayName=an;var mo=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Pe("SelectScrollButton",n),i=u.useRef(null),a=Et(n),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),ie(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),x.jsx(Z.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:J(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:J(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:J(o.onPointerLeave,()=>{c()})})}),Tc="SelectSeparator",Oc=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x.jsx(Z.div,{"aria-hidden":!0,...r,ref:t})});Oc.displayName=Tc;var cn="SelectArrow",Nc=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Rt(n),s=ke(cn,n),i=Pe(cn,n);return s.open&&i.position==="popper"?x.jsx(cc,{...o,...r,ref:t}):null});Nc.displayName=cn;var _c="SelectBubbleInput",ho=u.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=u.useRef(null),s=re(r,o),i=fr(t);return u.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&f){const p=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(p)}},[i,t]),x.jsx(Z.select,{...n,style:{...Fn,...n.style},ref:s,defaultValue:t})});ho.displayName=_c;function go(e){return e===""||e===void 0}function vo(e){const t=Te(e),n=u.useRef(""),r=u.useRef(0),o=u.useCallback(i=>{const a=n.current+i;t(a),(function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=u.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function bo(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Ic(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Ic(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Mc=Kr,jc=qr,Lc=Jr,Dc=Qr,Fc=eo,Bc=to,Wc=so,zc=lo,Vc=uo,$c=po,Pt="Switch",[Hc]=st(Pt),[Uc,Yc]=Hc(Pt),wo=u.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c="on",onCheckedChange:l,form:f,...p}=e,[g,h]=u.useState(null),v=re(t,y=>h(y)),d=u.useRef(!1),m=g?f||!!g.closest("form"):!0,[b,w]=_t({prop:o,defaultProp:s??!1,onChange:l,caller:Pt});return x.jsxs(Uc,{scope:n,checked:b,disabled:a,children:[x.jsx(Z.button,{type:"button",role:"switch","aria-checked":b,"aria-required":i,"data-state":Co(b),"data-disabled":a?"":void 0,disabled:a,value:c,...p,ref:v,onClick:J(e.onClick,y=>{w(E=>!E),m&&(d.current=y.isPropagationStopped(),d.current||y.stopPropagation())})}),m&&x.jsx(So,{control:g,bubbles:!d.current,name:r,value:c,checked:b,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});wo.displayName=Pt;var xo="SwitchThumb",yo=u.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Yc(xo,n);return x.jsx(Z.span,{"data-state":Co(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});yo.displayName=xo;var Gc="SwitchBubbleInput",So=u.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=u.useRef(null),a=re(i,s),c=fr(n),l=pr(t);return u.useEffect(()=>{const f=i.current;if(!f)return;const p=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(p,"checked").set;if(c!==n&&h){const v=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(v)}},[c,n,r]),x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});So.displayName=Gc;function Co(e){return e?"checked":"unchecked"}var Kc=wo,Xc=yo;const qc=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Zc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Eo=e=>{const t=Zc(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ro=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Jc=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Qc={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"};const el=Q.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>Q.createElement("svg",{ref:c,...Qc,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ro("lucide",o),...!s&&!Jc(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,f])=>Q.createElement(l,f)),...Array.isArray(s)?s:[s]]));const ko=(e,t)=>{const n=Q.forwardRef(({className:r,...o},s)=>Q.createElement(el,{ref:s,iconNode:t,className:Ro(`lucide-${qc(Eo(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Eo(e),n};const tl=ko("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const nl=ko("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),rl=e=>x.jsx(Mc,{...e}),ol=({children:e,className:t,...n})=>x.jsxs(zc,{className:ee("text-sm px-3 py-2 rounded-lg bg-bg-1 text-text-1 cursor-pointer hover:bg-bg-2 outline-none",t),...n,children:[x.jsxs(Vc,{children:[" ",e]}),x.jsx("span",{className:"absolute right-2 items-center justify-center",children:x.jsx($c,{children:x.jsx(tl,{className:"w-4 h-4 text-text-2"})})})]}),sl=({className:e,error:t,children:n,...r})=>x.jsxs(jc,{className:ee("bg-bg-1 *:data-[slot=select-value]:overflow-hidden whitespace-nowrap flex justify-between data-[placeholder]:text-text-2 text-text-1 flex items-center gap-3 rounded-lg text-sm cursor-pointer px-3 h-10 border border-border-1 outline-none","data-[state=open]:ring-2 data-[state=open]:ring-border-1/80",e,t&&"border-danger text-danger data-[slot=select-value]:text-danger/80"),"aria-label":"select-trigger",...r,children:[n,x.jsx(Dc,{asChild:!0,children:x.jsx(nl,{className:ee("w-5 h-5 text-text-2",t&&"text-danger/80")})})]}),il=({className:e,...t})=>x.jsx(Lc,{"data-slot":"select-value",className:e,style:{display:"none"},...t}),al=({children:e,className:t,...n})=>x.jsx(Fc,{children:x.jsx(Bc,{"data-slot":"select-content",className:ee("rounded-lg min-w-42 bg-bg-1 border border-border-2 data-[state=open]:animate-popover-in shadow-sm",t),position:"popper",...n,children:x.jsx(Wc,{children:e})})}),cl=({options:e,placeholder:t,onChange:n,defaultValue:r,className:o,contentClassName:s,value:i,error:a})=>x.jsxs(rl,{onValueChange:n,value:i,defaultValue:r,children:[x.jsx(sl,{error:a,className:o,children:x.jsx(il,{placeholder:t})}),x.jsx(al,{className:s,children:e.map((c,l)=>x.jsx(ol,{value:c.value,children:c.label},l))})]}),ll=({sections:e,containerClassName:t,pathname:n,open:r,textHeader:o,IconHeader:s,setOpen:i})=>x.jsxs("div",{className:ee("fixed top-0 left-0 inset-0 shrink-0 overflow-hidden z-999 transition-all",r?"pointer-events-auto lg:w-72":"pointer-events-none lg:pointer-events-auto lg:w-21",t),children:[x.jsx("div",{className:ee("bg-overlay w-full h-full transition-opacity lg:hidden",r?"opacity-100":"opacity-0"),onClick:()=>i(!1)}),x.jsxs("nav",{className:ee("absolute px-5 w-72 py-5 top-0 shrink-0 transition-all left-0 h-full bg-bg-1 lg:border-r lg:border-r-border-2",r?"translate-x-0":"-translate-x-full lg:translate-x-0 lg:w-21"),children:[x.jsxs("div",{className:"flex gap-3 items-center mb-7",children:[x.jsx("div",{className:"w-11 h-10 rounded-lg bg-primary-500 shrink-0 flex items-center justify-center",children:x.jsx(s,{className:"w-5 h-5 text-text-3"})}),x.jsx("span",{className:ee("text-text-1 transition-opacity font-bold text-2xl",r?"opacity-100":"opacity-0"),children:o})]}),x.jsx("div",{className:"flex flex-col gap-8",children:e.map(({options:a,title:c,id:l})=>x.jsxs("section",{children:[x.jsx("p",{className:ee("mb-2 text-text-2 text-sm transition-opacity",r?"opacity-100":"opacity-0"),children:c}),a.map(({label:f,href:p,Icon:g,onClick:h},v)=>{const d=n.startsWith(p);return x.jsxs("button",{onClick:h,className:ee("h-10 w-full transition-[width] rounded-lg overflow-hidden text-sm text-text-2 px-3 cursor-pointer flex items-center gap-3",d&&"bg-primary-500 text-text-3",r?"w-full":"w-11"),children:[x.jsx(g,{className:ee("w-5 h-5 text-text-2 shrink-0",d&&"text-text-3")}),x.jsx("p",{className:ee("transition-opacity",r?"opacity-100":"opacity-0"),children:f})]},v)})]},l))})]})]}),ul=({steps:e,currentStep:t=0,className:n,labelClassName:r})=>x.jsx("div",{className:ee("flex items-center gap-4",n),children:e.map((o,s)=>{const i=t>=s;return x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"flex flex-col items-center",children:x.jsxs("button",{className:ee("relative w-10 h-10 rounded-lg cursor-pointer bg-bg-1 text-text-2 border border-border-2 font-bold",i&&"bg-primary-500 border-none text-text-3"),children:[s+1,x.jsx("p",{className:ee("absolute left-1/2 -translate-x-1/2 top-full text-center w-fit text-sm font-normal translate-y-px",i&&"text-text-1",r),children:o.label})]},s)}),s+1<e.length&&x.jsx("div",{className:"h-px w-full bg-border-2"})]})})}),Po=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ao=bn,dl=((e,t)=>n=>{var r;if(t?.variants==null)return Ao(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(l=>{const f=n?.[l],p=s?.[l];if(f===null)return null;const g=Po(f)||Po(p);return o[l][g]}),a=n&&Object.entries(n).reduce((l,f)=>{let[p,g]=f;return g===void 0||(l[p]=g),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,f)=>{let{class:p,className:g,...h}=f;return Object.entries(h).every(v=>{let[d,m]=v;return Array.isArray(m)?m.includes({...s,...a}[d]):{...s,...a}[d]===m})?[...l,p,g]:l},[]);return Ao(e,i,c,n?.class,n?.className)})("h-10 px-3 text-sm flex items-center gap-3 rounded-lg cursor-pointer transition-[background-color] w-fit",{variants:{variant:{filled:"bg-primary-500 text-text-3 font-medium hover:bg-primary-400",outlined:"border border-border-2 bg-bg-1 text-text-1 hover:bg-bg-1/50",ghost:"bg-bg-1 text-text-1 font-medium hover:bg-bg-1/50",icon:"h-10 w-10 bg-bg-1 hover:bg-bg-1/50"}}}),fl=({variant:e,className:t,children:n,...r})=>x.jsx("button",{className:ee(dl({variant:e,className:t})),...r,children:n}),pl=e=>x.jsx(Kc,{className:"h-6 w-10 bg-bg-1 rounded-full relative cursor-pointer data-[state=checked]:bg-primary-500 border-border-2 border",...e,children:x.jsx(Xc,{className:"transition-transform will-change-transform block w-5 h-5 bg-text-2 rounded-full translate-x-0.5 data-[state=checked]:translate-x-4 data-[state=checked]:bg-text-3"})}),ml=({text:e="Badge",type:t="success"})=>{const n={success:"bg-bg-success text-success border-success",error:"bg-bg-danger text-danger border-danger",warning:"bg-bg-warning text-warning border-warning"};return x.jsx("div",{className:ee("text-sm px-3 py-1 rounded-lg border outline-none",n[t]),children:e})};se.Badge=ml,se.Button=fl,se.Input=ws,se.Select=cl,se.SideNavigation=ll,se.Stepper=ul,se.Switch=pl,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rently-components",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "description": "React component library for Rently",
6
6
  "keywords": [