2 lines
49 KiB
JavaScript
2 lines
49 KiB
JavaScript
import{J as g,w as he,K as d,Q as q,x as Tn,e as Et,d as En,f as On}from"./index-DLMsdH5y.js";import{r as rt,a as z,e as Ot,m as In,u as It,k as ne,g as Nn,f as ht,j as it,c as $,P as _n,b as Mn,l as Dn,h as Ln,i as jn,R as kn,F as Hn,D as Bn}from"./index-CRuYJWww.js";function ni({className:e,...t}){return g.jsx("textarea",{"data-slot":"textarea",className:he("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function gt(e,[t,n]){return Math.min(n,Math.max(t,e))}const Vn=["top","right","bottom","left"],ce=Math.min,Y=Math.max,Me=Math.round,Ne=Math.floor,te=e=>({x:e,y:e}),Fn={left:"right",right:"left",bottom:"top",top:"bottom"},Wn={start:"end",end:"start"};function qe(e,t,n){return Y(e,ce(t,n))}function ie(e,t){return typeof e=="function"?e(t):e}function se(e){return e.split("-")[0]}function be(e){return e.split("-")[1]}function st(e){return e==="x"?"y":"x"}function lt(e){return e==="y"?"height":"width"}const $n=new Set(["top","bottom"]);function ee(e){return $n.has(se(e))?"y":"x"}function ct(e){return st(ee(e))}function zn(e,t,n){n===void 0&&(n=!1);const o=be(e),r=ct(e),s=lt(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=De(i)),[i,De(i)]}function Un(e){const t=De(e);return[Ze(e),t,Ze(t)]}function Ze(e){return e.replace(/start|end/g,t=>Wn[t])}const xt=["left","right"],wt=["right","left"],Kn=["top","bottom"],Yn=["bottom","top"];function Xn(e,t,n){switch(e){case"top":case"bottom":return n?t?wt:xt:t?xt:wt;case"left":case"right":return t?Kn:Yn;default:return[]}}function Gn(e,t,n,o){const r=be(e);let s=Xn(se(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Ze)))),s}function De(e){return e.replace(/left|right|bottom|top/g,t=>Fn[t])}function qn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Nt(e){return typeof e!="number"?qn(e):{top:e,right:e,bottom:e,left:e}}function Le(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function vt(e,t,n){let{reference:o,floating:r}=e;const s=ee(t),i=ct(t),l=lt(i),c=se(t),a=s==="y",f=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,w=o[l]/2-r[l]/2;let m;switch(c){case"top":m={x:f,y:o.y-r.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:u};break;case"left":m={x:o.x-r.width,y:u};break;default:m={x:o.x,y:o.y}}switch(be(t)){case"start":m[i]-=w*(n&&a?-1:1);break;case"end":m[i]+=w*(n&&a?-1:1);break}return m}const Zn=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let a=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:u}=vt(a,o,c),w=o,m={},h=0;for(let p=0;p<l.length;p++){const{name:v,fn:y}=l[p],{x,y:S,data:C,reset:b}=await y({x:f,y:u,initialPlacement:o,placement:w,strategy:r,middlewareData:m,rects:a,platform:i,elements:{reference:e,floating:t}});f=x??f,u=S??u,m={...m,[v]:{...m[v],...C}},b&&h<=50&&(h++,typeof b=="object"&&(b.placement&&(w=b.placement),b.rects&&(a=b.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):b.rects),{x:f,y:u}=vt(a,w,c)),p=-1)}return{x:f,y:u,placement:w,strategy:r,middlewareData:m}};async function Ee(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:w=!1,padding:m=0}=ie(t,e),h=Nt(m),v=l[w?u==="floating"?"reference":"floating":u],y=Le(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:a,rootBoundary:f,strategy:c})),x=u==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),C=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},b=Le(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:S,strategy:c}):x);return{top:(y.top-b.top+h.top)/C.y,bottom:(b.bottom-y.bottom+h.bottom)/C.y,left:(y.left-b.left+h.left)/C.x,right:(b.right-y.right+h.right)/C.x}}const Jn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:l,middlewareData:c}=t,{element:a,padding:f=0}=ie(e,t)||{};if(a==null)return{};const u=Nt(f),w={x:n,y:o},m=ct(r),h=lt(m),p=await i.getDimensions(a),v=m==="y",y=v?"top":"left",x=v?"bottom":"right",S=v?"clientHeight":"clientWidth",C=s.reference[h]+s.reference[m]-w[m]-s.floating[h],b=w[m]-s.reference[m],O=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a));let A=O?O[S]:0;(!A||!await(i.isElement==null?void 0:i.isElement(O)))&&(A=l.floating[S]||s.floating[h]);const N=C/2-b/2,B=A/2-p[h]/2-1,M=ce(u[y],B),D=ce(u[x],B),L=M,_=A-p[h]-D,E=A/2-p[h]/2+N,V=qe(L,E,_),T=!c.arrow&&be(r)!=null&&E!==V&&s.reference[h]/2-(E<L?M:D)-p[h]/2<0,I=T?E<L?E-L:E-_:0;return{[m]:w[m]+I,data:{[m]:V,centerOffset:E-V-I,...T&&{alignmentOffset:I}},reset:T}}}),Qn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:a}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:w,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...v}=ie(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=se(r),x=ee(l),S=se(l)===l,C=await(c.isRTL==null?void 0:c.isRTL(a.floating)),b=w||(S||!p?[De(l)]:Un(l)),O=h!=="none";!w&&O&&b.push(...Gn(l,p,h,C));const A=[l,...b],N=await Ee(t,v),B=[];let M=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&B.push(N[y]),u){const E=zn(r,i,C);B.push(N[E[0]],N[E[1]])}if(M=[...M,{placement:r,overflows:B}],!B.every(E=>E<=0)){var D,L;const E=(((D=s.flip)==null?void 0:D.index)||0)+1,V=A[E];if(V&&(!(u==="alignment"?x!==ee(V):!1)||M.every(P=>ee(P.placement)===x?P.overflows[0]>0:!0)))return{data:{index:E,overflows:M},reset:{placement:V}};let T=(L=M.filter(I=>I.overflows[0]<=0).sort((I,P)=>I.overflows[1]-P.overflows[1])[0])==null?void 0:L.placement;if(!T)switch(m){case"bestFit":{var _;const I=(_=M.filter(P=>{if(O){const j=ee(P.placement);return j===x||j==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(j=>j>0).reduce((j,K)=>j+K,0)]).sort((P,j)=>P[1]-j[1])[0])==null?void 0:_[0];I&&(T=I);break}case"initialPlacement":T=l;break}if(r!==T)return{reset:{placement:T}}}return{}}}};function yt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function St(e){return Vn.some(t=>e[t]>=0)}const eo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=ie(e,t);switch(o){case"referenceHidden":{const s=await Ee(t,{...r,elementContext:"reference"}),i=yt(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:St(i)}}}case"escaped":{const s=await Ee(t,{...r,altBoundary:!0}),i=yt(s,n.floating);return{data:{escapedOffsets:i,escaped:St(i)}}}default:return{}}}}},_t=new Set(["left","top"]);async function to(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=se(n),l=be(n),c=ee(n)==="y",a=_t.has(i)?-1:1,f=s&&c?-1:1,u=ie(t,e);let{mainAxis:w,crossAxis:m,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof h=="number"&&(m=l==="end"?h*-1:h),c?{x:m*f,y:w*a}:{x:w*a,y:m*f}}const no=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:l}=t,c=await to(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},oo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:v=>{let{x:y,y:x}=v;return{x:y,y:x}}},...c}=ie(e,t),a={x:n,y:o},f=await Ee(t,c),u=ee(se(r)),w=st(u);let m=a[w],h=a[u];if(s){const v=w==="y"?"top":"left",y=w==="y"?"bottom":"right",x=m+f[v],S=m-f[y];m=qe(x,m,S)}if(i){const v=u==="y"?"top":"left",y=u==="y"?"bottom":"right",x=h+f[v],S=h-f[y];h=qe(x,h,S)}const p=l.fn({...t,[w]:m,[u]:h});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[w]:s,[u]:i}}}}}},ro=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:a=!0}=ie(e,t),f={x:n,y:o},u=ee(r),w=st(u);let m=f[w],h=f[u];const p=ie(l,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const S=w==="y"?"height":"width",C=s.reference[w]-s.floating[S]+v.mainAxis,b=s.reference[w]+s.reference[S]-v.mainAxis;m<C?m=C:m>b&&(m=b)}if(a){var y,x;const S=w==="y"?"width":"height",C=_t.has(se(r)),b=s.reference[u]-s.floating[S]+(C&&((y=i.offset)==null?void 0:y[u])||0)+(C?0:v.crossAxis),O=s.reference[u]+s.reference[S]+(C?0:((x=i.offset)==null?void 0:x[u])||0)-(C?v.crossAxis:0);h<b?h=b:h>O&&(h=O)}return{[w]:m,[u]:h}}}},io=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...a}=ie(e,t),f=await Ee(t,a),u=se(r),w=be(r),m=ee(r)==="y",{width:h,height:p}=s.floating;let v,y;u==="top"||u==="bottom"?(v=u,y=w===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(y=u,v=w==="end"?"top":"bottom");const x=p-f.top-f.bottom,S=h-f.left-f.right,C=ce(p-f[v],x),b=ce(h-f[y],S),O=!t.middlewareData.shift;let A=C,N=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=S),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(A=x),O&&!w){const M=Y(f.left,0),D=Y(f.right,0),L=Y(f.top,0),_=Y(f.bottom,0);m?N=h-2*(M!==0||D!==0?M+D:Y(f.left,f.right)):A=p-2*(L!==0||_!==0?L+_:Y(f.top,f.bottom))}await c({...t,availableWidth:N,availableHeight:A});const B=await i.getDimensions(l.floating);return h!==B.width||p!==B.height?{reset:{rects:!0}}:{}}}};function He(){return typeof window<"u"}function Ce(e){return Mt(e)?(e.nodeName||"").toLowerCase():"#document"}function X(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function re(e){var t;return(t=(Mt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mt(e){return He()?e instanceof Node||e instanceof X(e).Node:!1}function J(e){return He()?e instanceof Element||e instanceof X(e).Element:!1}function oe(e){return He()?e instanceof HTMLElement||e instanceof X(e).HTMLElement:!1}function bt(e){return!He()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof X(e).ShadowRoot}const so=new Set(["inline","contents"]);function Ie(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Q(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!so.has(r)}const lo=new Set(["table","td","th"]);function co(e){return lo.has(Ce(e))}const ao=[":popover-open",":modal"];function Be(e){return ao.some(t=>{try{return e.matches(t)}catch{return!1}})}const fo=["transform","translate","scale","rotate","perspective"],uo=["transform","translate","scale","rotate","perspective","filter"],po=["paint","layout","strict","content"];function at(e){const t=dt(),n=J(e)?Q(e):e;return fo.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||uo.some(o=>(n.willChange||"").includes(o))||po.some(o=>(n.contain||"").includes(o))}function mo(e){let t=ae(e);for(;oe(t)&&!Se(t);){if(at(t))return t;if(Be(t))return null;t=ae(t)}return null}function dt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ho=new Set(["html","body","#document"]);function Se(e){return ho.has(Ce(e))}function Q(e){return X(e).getComputedStyle(e)}function Ve(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ae(e){if(Ce(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bt(e)&&e.host||re(e);return bt(t)?t.host:t}function Dt(e){const t=ae(e);return Se(t)?e.ownerDocument?e.ownerDocument.body:e.body:oe(t)&&Ie(t)?t:Dt(t)}function Oe(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Dt(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=X(r);if(s){const l=Je(i);return t.concat(i,i.visualViewport||[],Ie(r)?r:[],l&&n?Oe(l):[])}return t.concat(r,Oe(r,[],n))}function Je(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Lt(e){const t=Q(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=oe(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,l=Me(n)!==s||Me(o)!==i;return l&&(n=s,o=i),{width:n,height:o,$:l}}function ft(e){return J(e)?e:e.contextElement}function ye(e){const t=ft(e);if(!oe(t))return te(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Lt(t);let i=(s?Me(n.width):n.width)/o,l=(s?Me(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const go=te(0);function jt(e){const t=X(e);return!dt()||!t.visualViewport?go:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xo(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==X(e)?!1:t}function ge(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=ft(e);let i=te(1);t&&(o?J(o)&&(i=ye(o)):i=ye(e));const l=xo(s,n,o)?jt(s):te(0);let c=(r.left+l.x)/i.x,a=(r.top+l.y)/i.y,f=r.width/i.x,u=r.height/i.y;if(s){const w=X(s),m=o&&J(o)?X(o):o;let h=w,p=Je(h);for(;p&&o&&m!==h;){const v=ye(p),y=p.getBoundingClientRect(),x=Q(p),S=y.left+(p.clientLeft+parseFloat(x.paddingLeft))*v.x,C=y.top+(p.clientTop+parseFloat(x.paddingTop))*v.y;c*=v.x,a*=v.y,f*=v.x,u*=v.y,c+=S,a+=C,h=X(p),p=Je(h)}}return Le({width:f,height:u,x:c,y:a})}function Fe(e,t){const n=Ve(e).scrollLeft;return t?t.left+n:ge(re(e)).left+n}function kt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Fe(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function wo(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=re(o),l=t?Be(t.floating):!1;if(o===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},a=te(1);const f=te(0),u=oe(o);if((u||!u&&!s)&&((Ce(o)!=="body"||Ie(i))&&(c=Ve(o)),oe(o))){const m=ge(o);a=ye(o),f.x=m.x+o.clientLeft,f.y=m.y+o.clientTop}const w=i&&!u&&!s?kt(i,c):te(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+f.x+w.x,y:n.y*a.y-c.scrollTop*a.y+f.y+w.y}}function vo(e){return Array.from(e.getClientRects())}function yo(e){const t=re(e),n=Ve(e),o=e.ownerDocument.body,r=Y(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=Y(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Fe(e);const l=-n.scrollTop;return Q(o).direction==="rtl"&&(i+=Y(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:l}}const Ct=25;function So(e,t){const n=X(e),o=re(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const f=dt();(!f||f&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const a=Fe(o);if(a<=0){const f=o.ownerDocument,u=f.body,w=getComputedStyle(u),m=f.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,h=Math.abs(o.clientWidth-u.clientWidth-m);h<=Ct&&(s-=h)}else a<=Ct&&(s+=a);return{width:s,height:i,x:l,y:c}}const bo=new Set(["absolute","fixed"]);function Co(e,t){const n=ge(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=oe(e)?ye(e):te(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,a=o*s.y;return{width:i,height:l,x:c,y:a}}function Rt(e,t,n){let o;if(t==="viewport")o=So(e,n);else if(t==="document")o=yo(re(e));else if(J(t))o=Co(t,n);else{const r=jt(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Le(o)}function Ht(e,t){const n=ae(e);return n===t||!J(n)||Se(n)?!1:Q(n).position==="fixed"||Ht(n,t)}function Ro(e,t){const n=t.get(e);if(n)return n;let o=Oe(e,[],!1).filter(l=>J(l)&&Ce(l)!=="body"),r=null;const s=Q(e).position==="fixed";let i=s?ae(e):e;for(;J(i)&&!Se(i);){const l=Q(i),c=at(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&bo.has(r.position)||Ie(i)&&!c&&Ht(e,i))?o=o.filter(f=>f!==i):r=l,i=ae(i)}return t.set(e,o),o}function Po(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Be(t)?[]:Ro(t,this._c):[].concat(n),o],l=i[0],c=i.reduce((a,f)=>{const u=Rt(t,f,r);return a.top=Y(u.top,a.top),a.right=ce(u.right,a.right),a.bottom=ce(u.bottom,a.bottom),a.left=Y(u.left,a.left),a},Rt(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ao(e){const{width:t,height:n}=Lt(e);return{width:t,height:n}}function To(e,t,n){const o=oe(t),r=re(t),s=n==="fixed",i=ge(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=te(0);function a(){c.x=Fe(r)}if(o||!o&&!s)if((Ce(t)!=="body"||Ie(r))&&(l=Ve(t)),o){const m=ge(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else r&&a();s&&!o&&r&&a();const f=r&&!o&&!s?kt(r,l):te(0),u=i.left+l.scrollLeft-c.x-f.x,w=i.top+l.scrollTop-c.y-f.y;return{x:u,y:w,width:i.width,height:i.height}}function Xe(e){return Q(e).position==="static"}function Pt(e,t){if(!oe(e)||Q(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return re(e)===n&&(n=n.ownerDocument.body),n}function Bt(e,t){const n=X(e);if(Be(e))return n;if(!oe(e)){let r=ae(e);for(;r&&!Se(r);){if(J(r)&&!Xe(r))return r;r=ae(r)}return n}let o=Pt(e,t);for(;o&&co(o)&&Xe(o);)o=Pt(o,t);return o&&Se(o)&&Xe(o)&&!at(o)?n:o||mo(e)||n}const Eo=async function(e){const t=this.getOffsetParent||Bt,n=this.getDimensions,o=await n(e.floating);return{reference:To(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Oo(e){return Q(e).direction==="rtl"}const Io={convertOffsetParentRelativeRectToViewportRelativeRect:wo,getDocumentElement:re,getClippingRect:Po,getOffsetParent:Bt,getElementRects:Eo,getClientRects:vo,getDimensions:Ao,getScale:ye,isElement:J,isRTL:Oo};function Vt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function No(e,t){let n=null,o;const r=re(e);function s(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const a=e.getBoundingClientRect(),{left:f,top:u,width:w,height:m}=a;if(l||t(),!w||!m)return;const h=Ne(u),p=Ne(r.clientWidth-(f+w)),v=Ne(r.clientHeight-(u+m)),y=Ne(f),S={rootMargin:-h+"px "+-p+"px "+-v+"px "+-y+"px",threshold:Y(0,ce(1,c))||1};let C=!0;function b(O){const A=O[0].intersectionRatio;if(A!==c){if(!C)return i();A?i(!1,A):o=setTimeout(()=>{i(!1,1e-7)},1e3)}A===1&&!Vt(a,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(b,{...S,root:r.ownerDocument})}catch{n=new IntersectionObserver(b,S)}n.observe(e)}return i(!0),s}function _o(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,a=ft(e),f=r||s?[...a?Oe(a):[],...Oe(t)]:[];f.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const u=a&&l?No(a,n):null;let w=-1,m=null;i&&(m=new ResizeObserver(y=>{let[x]=y;x&&x.target===a&&m&&(m.unobserve(t),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(t)})),n()}),a&&!c&&m.observe(a),m.observe(t));let h,p=c?ge(e):null;c&&v();function v(){const y=ge(e);p&&!Vt(p,y)&&n(),p=y,h=requestAnimationFrame(v)}return n(),()=>{var y;f.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),u?.(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(h)}}const Mo=no,Do=oo,Lo=Qn,jo=io,ko=eo,At=Jn,Ho=ro,Bo=(e,t,n)=>{const o=new Map,r={platform:Io,...n},s={...r.platform,_c:o};return Zn(e,t,{...r,platform:s})};var Vo=typeof document<"u",Fo=function(){},_e=Vo?d.useLayoutEffect:Fo;function je(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!je(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!je(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ft(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Tt(e,t){const n=Ft(e);return Math.round(t*n)/n}function Ge(e){const t=d.useRef(e);return _e(()=>{t.current=e}),t}function Wo(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:a}=e,[f,u]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[w,m]=d.useState(o);je(w,o)||m(o);const[h,p]=d.useState(null),[v,y]=d.useState(null),x=d.useCallback(P=>{P!==O.current&&(O.current=P,p(P))},[]),S=d.useCallback(P=>{P!==A.current&&(A.current=P,y(P))},[]),C=s||h,b=i||v,O=d.useRef(null),A=d.useRef(null),N=d.useRef(f),B=c!=null,M=Ge(c),D=Ge(r),L=Ge(a),_=d.useCallback(()=>{if(!O.current||!A.current)return;const P={placement:t,strategy:n,middleware:w};D.current&&(P.platform=D.current),Bo(O.current,A.current,P).then(j=>{const K={...j,isPositioned:L.current!==!1};E.current&&!je(N.current,K)&&(N.current=K,rt.flushSync(()=>{u(K)}))})},[w,t,n,D,L]);_e(()=>{a===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,u(P=>({...P,isPositioned:!1})))},[a]);const E=d.useRef(!1);_e(()=>(E.current=!0,()=>{E.current=!1}),[]),_e(()=>{if(C&&(O.current=C),b&&(A.current=b),C&&b){if(M.current)return M.current(C,b,_);_()}},[C,b,_,M,B]);const V=d.useMemo(()=>({reference:O,floating:A,setReference:x,setFloating:S}),[x,S]),T=d.useMemo(()=>({reference:C,floating:b}),[C,b]),I=d.useMemo(()=>{const P={position:n,left:0,top:0};if(!T.floating)return P;const j=Tt(T.floating,f.x),K=Tt(T.floating,f.y);return l?{...P,transform:"translate("+j+"px, "+K+"px)",...Ft(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:K}},[n,l,T.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:_,refs:V,elements:T,floatingStyles:I}),[f,_,V,T,I])}const $o=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?At({element:o.current,padding:r}).fn(n):{}:o?At({element:o,padding:r}).fn(n):{}}}},zo=(e,t)=>({...Mo(e),options:[e,t]}),Uo=(e,t)=>({...Do(e),options:[e,t]}),Ko=(e,t)=>({...Ho(e),options:[e,t]}),Yo=(e,t)=>({...Lo(e),options:[e,t]}),Xo=(e,t)=>({...jo(e),options:[e,t]}),Go=(e,t)=>({...ko(e),options:[e,t]}),qo=(e,t)=>({...$o(e),options:[e,t]});var Zo="Arrow",Wt=d.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return g.jsx(z.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});Wt.displayName=Zo;var Jo=Wt,ut="Popper",[$t,zt]=Ot(ut),[Qo,Ut]=$t(ut),Kt=e=>{const{__scopePopper:t,children:n}=e,[o,r]=d.useState(null);return g.jsx(Qo,{scope:t,anchor:o,onAnchorChange:r,children:n})};Kt.displayName=ut;var Yt="PopperAnchor",Xt=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Ut(Yt,n),i=d.useRef(null),l=q(t,i),c=d.useRef(null);return d.useEffect(()=>{const a=c.current;c.current=o?.current||i.current,a!==c.current&&s.onAnchorChange(c.current)}),o?null:g.jsx(z.div,{...r,ref:l})});Xt.displayName=Yt;var pt="PopperContent",[er,tr]=$t(pt),Gt=d.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:a=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:w=!1,updatePositionStrategy:m="optimized",onPlaced:h,...p}=e,v=Ut(pt,n),[y,x]=d.useState(null),S=q(t,R=>x(R)),[C,b]=d.useState(null),O=In(C),A=O?.width??0,N=O?.height??0,B=o+(s!=="center"?"-"+s:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(a)?a:[a],L=D.length>0,_={padding:M,boundary:D.filter(or),altBoundary:L},{refs:E,floatingStyles:V,placement:T,isPositioned:I,middlewareData:P}=Wo({strategy:"fixed",placement:B,whileElementsMounted:(...R)=>_o(...R,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[zo({mainAxis:r+N,alignmentAxis:i}),c&&Uo({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Ko():void 0,..._}),c&&Yo({..._}),Xo({..._,apply:({elements:R,rects:F,availableWidth:U,availableHeight:k})=>{const{width:H,height:W}=F.reference,G=R.floating.style;G.setProperty("--radix-popper-available-width",`${U}px`),G.setProperty("--radix-popper-available-height",`${k}px`),G.setProperty("--radix-popper-anchor-width",`${H}px`),G.setProperty("--radix-popper-anchor-height",`${W}px`)}}),C&&qo({element:C,padding:l}),rr({arrowWidth:A,arrowHeight:N}),w&&Go({strategy:"referenceHidden",..._})]}),[j,K]=Jt(T),ue=It(h);ne(()=>{I&&ue?.()},[I,ue]);const Pe=P.arrow?.x,Ae=P.arrow?.y,le=P.arrow?.centerOffset!==0,[ve,pe]=d.useState();return ne(()=>{y&&pe(window.getComputedStyle(y).zIndex)},[y]),g.jsx("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:I?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(er,{scope:n,placedSide:j,onArrowChange:b,arrowX:Pe,arrowY:Ae,shouldHideArrow:le,children:g.jsx(z.div,{"data-side":j,"data-align":K,...p,ref:S,style:{...p.style,animation:I?void 0:"none"}})})})});Gt.displayName=pt;var qt="PopperArrow",nr={top:"bottom",right:"left",bottom:"top",left:"right"},Zt=d.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=tr(qt,o),i=nr[s.placedSide];return g.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:g.jsx(Jo,{...r,ref:n,style:{...r.style,display:"block"}})})});Zt.displayName=qt;function or(e){return e!==null}var rr=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,i=r.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[a,f]=Jt(n),u={start:"0%",center:"50%",end:"100%"}[f],w=(r.arrow?.x??0)+l/2,m=(r.arrow?.y??0)+c/2;let h="",p="";return a==="bottom"?(h=i?u:`${w}px`,p=`${-c}px`):a==="top"?(h=i?u:`${w}px`,p=`${o.floating.height+c}px`):a==="right"?(h=`${-c}px`,p=i?u:`${m}px`):a==="left"&&(h=`${o.floating.width+c}px`,p=i?u:`${m}px`),{data:{x:h,y:p}}}});function Jt(e){const[t,n="center"]=e.split("-");return[t,n]}var ir=Kt,sr=Xt,lr=Gt,cr=Zt;function ar(e){const t=dr(e),n=d.forwardRef((o,r)=>{const{children:s,...i}=o,l=d.Children.toArray(s),c=l.find(ur);if(c){const a=c.props.children,f=l.map(u=>u===c?d.Children.count(a)>1?d.Children.only(null):d.isValidElement(a)?a.props.children:null:u);return g.jsx(t,{...i,ref:r,children:d.isValidElement(a)?d.cloneElement(a,void 0,f):null})}return g.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function dr(e){const t=d.forwardRef((n,o)=>{const{children:r,...s}=n;if(d.isValidElement(r)){const i=mr(r),l=pr(s,r.props);return r.type!==d.Fragment&&(l.ref=o?Tn(o,i):i),d.cloneElement(r,l)}return d.Children.count(r)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fr=Symbol("radix.slottable");function ur(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fr}function pr(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function mr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qt=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),hr="VisuallyHidden",gr=d.forwardRef((e,t)=>g.jsx(z.span,{...e,ref:t,style:{...Qt,...e.style}}));gr.displayName=hr;var xr=[" ","Enter","ArrowUp","ArrowDown"],wr=[" ","Enter"],xe="Select",[We,$e,vr]=Mn(xe),[Re]=Ot(xe,[vr,zt]),ze=zt(),[yr,de]=Re(xe),[Sr,br]=Re(xe),en=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:i,defaultValue:l,onValueChange:c,dir:a,name:f,autoComplete:u,disabled:w,required:m,form:h}=e,p=ze(t),[v,y]=d.useState(null),[x,S]=d.useState(null),[C,b]=d.useState(!1),O=Nn(a),[A,N]=ht({prop:o,defaultProp:r??!1,onChange:s,caller:xe}),[B,M]=ht({prop:i,defaultProp:l,onChange:c,caller:xe}),D=d.useRef(null),L=v?h||!!v.closest("form"):!0,[_,E]=d.useState(new Set),V=Array.from(_).map(T=>T.props.value).join(";");return g.jsx(ir,{...p,children:g.jsxs(yr,{required:m,scope:t,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:b,contentId:it(),value:B,onValueChange:M,open:A,onOpenChange:N,dir:O,triggerPointerDownPosRef:D,disabled:w,children:[g.jsx(We.Provider,{scope:t,children:g.jsx(Sr,{scope:e.__scopeSelect,onNativeOptionAdd:d.useCallback(T=>{E(I=>new Set(I).add(T))},[]),onNativeOptionRemove:d.useCallback(T=>{E(I=>{const P=new Set(I);return P.delete(T),P})},[]),children:n})}),L?g.jsxs(Cn,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:u,value:B,onChange:T=>M(T.target.value),disabled:w,form:h,children:[B===void 0?g.jsx("option",{value:""}):null,Array.from(_)]},V):null]})})};en.displayName=xe;var tn="SelectTrigger",nn=d.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=ze(n),i=de(tn,n),l=i.disabled||o,c=q(t,i.onTriggerChange),a=$e(n),f=d.useRef("touch"),[u,w,m]=Pn(p=>{const v=a().filter(S=>!S.disabled),y=v.find(S=>S.value===i.value),x=An(v,p,y);x!==void 0&&i.onValueChange(x.value)}),h=p=>{l||(i.onOpenChange(!0),m()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return g.jsx(sr,{asChild:!0,...s,children:g.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:l,"data-disabled":l?"":void 0,"data-placeholder":Rn(i.value)?"":void 0,...r,ref:c,onClick:$(r.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&h(p)}),onPointerDown:$(r.onPointerDown,p=>{f.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(h(p),p.preventDefault())}),onKeyDown:$(r.onKeyDown,p=>{const v=u.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&xr.includes(p.key)&&(h(),p.preventDefault())})})})});nn.displayName=tn;var on="SelectValue",rn=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:i="",...l}=e,c=de(on,n),{onValueNodeHasChildrenChange:a}=c,f=s!==void 0,u=q(t,c.onValueNodeChange);return ne(()=>{a(f)},[a,f]),g.jsx(z.span,{...l,ref:u,style:{pointerEvents:"none"},children:Rn(c.value)?g.jsx(g.Fragment,{children:i}):s})});rn.displayName=on;var Cr="SelectIcon",sn=d.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return g.jsx(z.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});sn.displayName=Cr;var Rr="SelectPortal",ln=e=>g.jsx(_n,{asChild:!0,...e});ln.displayName=Rr;var we="SelectContent",cn=d.forwardRef((e,t)=>{const n=de(we,e.__scopeSelect),[o,r]=d.useState();if(ne(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?rt.createPortal(g.jsx(an,{scope:e.__scopeSelect,children:g.jsx(We.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),s):null}return g.jsx(dn,{...e,ref:t})});cn.displayName=we;var Z=10,[an,fe]=Re(we),Pr="SelectContentImpl",Ar=ar("SelectContent.RemoveScroll"),dn=d.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:c,align:a,alignOffset:f,arrowPadding:u,collisionBoundary:w,collisionPadding:m,sticky:h,hideWhenDetached:p,avoidCollisions:v,...y}=e,x=de(we,n),[S,C]=d.useState(null),[b,O]=d.useState(null),A=q(t,R=>C(R)),[N,B]=d.useState(null),[M,D]=d.useState(null),L=$e(n),[_,E]=d.useState(!1),V=d.useRef(!1);d.useEffect(()=>{if(S)return Ln(S)},[S]),jn();const T=d.useCallback(R=>{const[F,...U]=L().map(W=>W.ref.current),[k]=U.slice(-1),H=document.activeElement;for(const W of R)if(W===H||(W?.scrollIntoView({block:"nearest"}),W===F&&b&&(b.scrollTop=0),W===k&&b&&(b.scrollTop=b.scrollHeight),W?.focus(),document.activeElement!==H))return},[L,b]),I=d.useCallback(()=>T([N,S]),[T,N,S]);d.useEffect(()=>{_&&I()},[_,I]);const{onOpenChange:P,triggerPointerDownPosRef:j}=x;d.useEffect(()=>{if(S){let R={x:0,y:0};const F=k=>{R={x:Math.abs(Math.round(k.pageX)-(j.current?.x??0)),y:Math.abs(Math.round(k.pageY)-(j.current?.y??0))}},U=k=>{R.x<=10&&R.y<=10?k.preventDefault():S.contains(k.target)||P(!1),document.removeEventListener("pointermove",F),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",F),document.addEventListener("pointerup",U,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",U,{capture:!0})}}},[S,P,j]),d.useEffect(()=>{const R=()=>P(!1);return window.addEventListener("blur",R),window.addEventListener("resize",R),()=>{window.removeEventListener("blur",R),window.removeEventListener("resize",R)}},[P]);const[K,ue]=Pn(R=>{const F=L().filter(H=>!H.disabled),U=F.find(H=>H.ref.current===document.activeElement),k=An(F,R,U);k&&setTimeout(()=>k.ref.current.focus())}),Pe=d.useCallback((R,F,U)=>{const k=!V.current&&!U;(x.value!==void 0&&x.value===F||k)&&(B(R),k&&(V.current=!0))},[x.value]),Ae=d.useCallback(()=>S?.focus(),[S]),le=d.useCallback((R,F,U)=>{const k=!V.current&&!U;(x.value!==void 0&&x.value===F||k)&&D(R)},[x.value]),ve=o==="popper"?Qe:fn,pe=ve===Qe?{side:l,sideOffset:c,align:a,alignOffset:f,arrowPadding:u,collisionBoundary:w,collisionPadding:m,sticky:h,hideWhenDetached:p,avoidCollisions:v}:{};return g.jsx(an,{scope:n,content:S,viewport:b,onViewportChange:O,itemRefCallback:Pe,selectedItem:N,onItemLeave:Ae,itemTextRefCallback:le,focusSelectedItem:I,selectedItemText:M,position:o,isPositioned:_,searchRef:K,children:g.jsx(kn,{as:Ar,allowPinchZoom:!0,children:g.jsx(Hn,{asChild:!0,trapped:x.open,onMountAutoFocus:R=>{R.preventDefault()},onUnmountAutoFocus:$(r,R=>{x.trigger?.focus({preventScroll:!0}),R.preventDefault()}),children:g.jsx(Bn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:R=>R.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:g.jsx(ve,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:R=>R.preventDefault(),...y,...pe,onPlaced:()=>E(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:$(y.onKeyDown,R=>{const F=R.ctrlKey||R.altKey||R.metaKey;if(R.key==="Tab"&&R.preventDefault(),!F&&R.key.length===1&&ue(R.key),["ArrowUp","ArrowDown","Home","End"].includes(R.key)){let k=L().filter(H=>!H.disabled).map(H=>H.ref.current);if(["ArrowUp","End"].includes(R.key)&&(k=k.slice().reverse()),["ArrowUp","ArrowDown"].includes(R.key)){const H=R.target,W=k.indexOf(H);k=k.slice(W+1)}setTimeout(()=>T(k)),R.preventDefault()}})})})})})})});dn.displayName=Pr;var Tr="SelectItemAlignedPosition",fn=d.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=de(we,n),i=fe(we,n),[l,c]=d.useState(null),[a,f]=d.useState(null),u=q(t,A=>f(A)),w=$e(n),m=d.useRef(!1),h=d.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:y,focusSelectedItem:x}=i,S=d.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&a&&p&&v&&y){const A=s.trigger.getBoundingClientRect(),N=a.getBoundingClientRect(),B=s.valueNode.getBoundingClientRect(),M=y.getBoundingClientRect();if(s.dir!=="rtl"){const H=M.left-N.left,W=B.left-H,G=A.left-W,me=A.width+G,Ue=Math.max(me,N.width),Ke=window.innerWidth-Z,Ye=gt(W,[Z,Math.max(Z,Ke-Ue)]);l.style.minWidth=me+"px",l.style.left=Ye+"px"}else{const H=N.right-M.right,W=window.innerWidth-B.right-H,G=window.innerWidth-A.right-W,me=A.width+G,Ue=Math.max(me,N.width),Ke=window.innerWidth-Z,Ye=gt(W,[Z,Math.max(Z,Ke-Ue)]);l.style.minWidth=me+"px",l.style.right=Ye+"px"}const D=w(),L=window.innerHeight-Z*2,_=p.scrollHeight,E=window.getComputedStyle(a),V=parseInt(E.borderTopWidth,10),T=parseInt(E.paddingTop,10),I=parseInt(E.borderBottomWidth,10),P=parseInt(E.paddingBottom,10),j=V+T+_+P+I,K=Math.min(v.offsetHeight*5,j),ue=window.getComputedStyle(p),Pe=parseInt(ue.paddingTop,10),Ae=parseInt(ue.paddingBottom,10),le=A.top+A.height/2-Z,ve=L-le,pe=v.offsetHeight/2,R=v.offsetTop+pe,F=V+T+R,U=j-F;if(F<=le){const H=D.length>0&&v===D[D.length-1].ref.current;l.style.bottom="0px";const W=a.clientHeight-p.offsetTop-p.offsetHeight,G=Math.max(ve,pe+(H?Ae:0)+W+I),me=F+G;l.style.height=me+"px"}else{const H=D.length>0&&v===D[0].ref.current;l.style.top="0px";const G=Math.max(le,V+p.offsetTop+(H?Pe:0)+pe)+U;l.style.height=G+"px",p.scrollTop=F-le+p.offsetTop}l.style.margin=`${Z}px 0`,l.style.minHeight=K+"px",l.style.maxHeight=L+"px",o?.(),requestAnimationFrame(()=>m.current=!0)}},[w,s.trigger,s.valueNode,l,a,p,v,y,s.dir,o]);ne(()=>S(),[S]);const[C,b]=d.useState();ne(()=>{a&&b(window.getComputedStyle(a).zIndex)},[a]);const O=d.useCallback(A=>{A&&h.current===!0&&(S(),x?.(),h.current=!1)},[S,x]);return g.jsx(Or,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:O,children:g.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:g.jsx(z.div,{...r,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});fn.displayName=Tr;var Er="SelectPopperPosition",Qe=d.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Z,...s}=e,i=ze(n);return g.jsx(lr,{...i,...s,ref:t,align:o,collisionPadding:r,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)"}})});Qe.displayName=Er;var[Or,mt]=Re(we,{}),et="SelectViewport",un=d.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=fe(et,n),i=mt(et,n),l=q(t,s.onViewportChange),c=d.useRef(0);return g.jsxs(g.Fragment,{children:[g.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:o}),g.jsx(We.Slot,{scope:n,children:g.jsx(z.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:$(r.onScroll,a=>{const f=a.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:w}=i;if(w?.current&&u){const m=Math.abs(c.current-f.scrollTop);if(m>0){const h=window.innerHeight-Z*2,p=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),y=Math.max(p,v);if(y<h){const x=y+m,S=Math.min(h,x),C=x-S;u.style.height=S+"px",u.style.bottom==="0px"&&(f.scrollTop=C>0?C:0,u.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});un.displayName=et;var pn="SelectGroup",[Ir,Nr]=Re(pn),_r=d.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=it();return g.jsx(Ir,{scope:n,id:r,children:g.jsx(z.div,{role:"group","aria-labelledby":r,...o,ref:t})})});_r.displayName=pn;var mn="SelectLabel",Mr=d.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Nr(mn,n);return g.jsx(z.div,{id:r.id,...o,ref:t})});Mr.displayName=mn;var ke="SelectItem",[Dr,hn]=Re(ke),gn=d.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...i}=e,l=de(ke,n),c=fe(ke,n),a=l.value===o,[f,u]=d.useState(s??""),[w,m]=d.useState(!1),h=q(t,x=>c.itemRefCallback?.(x,o,r)),p=it(),v=d.useRef("touch"),y=()=>{r||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")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 g.jsx(Dr,{scope:n,value:o,disabled:r,textId:p,isSelected:a,onItemTextChange:d.useCallback(x=>{u(S=>S||(x?.textContent??"").trim())},[]),children:g.jsx(We.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:g.jsx(z.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":a&&w,"data-state":a?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:h,onFocus:$(i.onFocus,()=>m(!0)),onBlur:$(i.onBlur,()=>m(!1)),onClick:$(i.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:$(i.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:$(i.onPointerDown,x=>{v.current=x.pointerType}),onPointerMove:$(i.onPointerMove,x=>{v.current=x.pointerType,r?c.onItemLeave?.():v.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$(i.onPointerLeave,x=>{x.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:$(i.onKeyDown,x=>{c.searchRef?.current!==""&&x.key===" "||(wr.includes(x.key)&&y(),x.key===" "&&x.preventDefault())})})})})});gn.displayName=ke;var Te="SelectItemText",xn=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,i=de(Te,n),l=fe(Te,n),c=hn(Te,n),a=br(Te,n),[f,u]=d.useState(null),w=q(t,y=>u(y),c.onItemTextChange,y=>l.itemTextRefCallback?.(y,c.value,c.disabled)),m=f?.textContent,h=d.useMemo(()=>g.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=a;return ne(()=>(p(h),()=>v(h)),[p,v,h]),g.jsxs(g.Fragment,{children:[g.jsx(z.span,{id:c.textId,...s,ref:w}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?rt.createPortal(s.children,i.valueNode):null]})});xn.displayName=Te;var wn="SelectItemIndicator",vn=d.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return hn(wn,n).isSelected?g.jsx(z.span,{"aria-hidden":!0,...o,ref:t}):null});vn.displayName=wn;var tt="SelectScrollUpButton",yn=d.forwardRef((e,t)=>{const n=fe(tt,e.__scopeSelect),o=mt(tt,e.__scopeSelect),[r,s]=d.useState(!1),i=q(t,o.onScrollButtonChange);return ne(()=>{if(n.viewport&&n.isPositioned){let l=function(){const a=c.scrollTop>0;s(a)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),r?g.jsx(bn,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});yn.displayName=tt;var nt="SelectScrollDownButton",Sn=d.forwardRef((e,t)=>{const n=fe(nt,e.__scopeSelect),o=mt(nt,e.__scopeSelect),[r,s]=d.useState(!1),i=q(t,o.onScrollButtonChange);return ne(()=>{if(n.viewport&&n.isPositioned){let l=function(){const a=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<a;s(f)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),r?g.jsx(bn,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Sn.displayName=nt;var bn=d.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=fe("SelectScrollButton",n),i=d.useRef(null),l=$e(n),c=d.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),ne(()=>{l().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),g.jsx(z.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:$(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:$(r.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:$(r.onPointerLeave,()=>{c()})})}),Lr="SelectSeparator",jr=d.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return g.jsx(z.div,{"aria-hidden":!0,...o,ref:t})});jr.displayName=Lr;var ot="SelectArrow",kr=d.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ze(n),s=de(ot,n),i=fe(ot,n);return s.open&&i.position==="popper"?g.jsx(cr,{...r,...o,ref:t}):null});kr.displayName=ot;var Hr="SelectBubbleInput",Cn=d.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=d.useRef(null),s=q(o,r),i=Dn(t);return d.useEffect(()=>{const l=r.current;if(!l)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&f){const u=new Event("change",{bubbles:!0});f.call(l,t),l.dispatchEvent(u)}},[i,t]),g.jsx(z.select,{...n,style:{...Qt,...n.style},ref:s,defaultValue:t})});Cn.displayName=Hr;function Rn(e){return e===""||e===void 0}function Pn(e){const t=It(e),n=d.useRef(""),o=d.useRef(0),r=d.useCallback(i=>{const l=n.current+i;t(l),(function c(a){n.current=a,window.clearTimeout(o.current),a!==""&&(o.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),s=d.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function An(e,t,n){const r=t.length>1&&Array.from(t).every(a=>a===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Br(e,Math.max(s,0));r.length===1&&(i=i.filter(a=>a!==n));const c=i.find(a=>a.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function Br(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Vr=en,Fr=nn,Wr=rn,$r=sn,zr=ln,Ur=cn,Kr=un,Yr=gn,Xr=xn,Gr=vn,qr=yn,Zr=Sn;function oi({...e}){return g.jsx(Vr,{"data-slot":"select",...e})}function ri({...e}){return g.jsx(Wr,{"data-slot":"select-value",...e})}function ii({className:e,size:t="default",children:n,...o}){return g.jsxs(Fr,{"data-slot":"select-trigger","data-size":t,className:he("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[n,g.jsx($r,{asChild:!0,children:g.jsx(Et,{className:"size-4 opacity-50"})})]})}function si({className:e,children:t,position:n="item-aligned",align:o="center",...r}){return g.jsx(zr,{children:g.jsxs(Ur,{"data-slot":"select-content",className:he("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:o,...r,children:[g.jsx(Jr,{}),g.jsx(Kr,{className:he("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),g.jsx(Qr,{})]})})}function li({className:e,children:t,...n}){return g.jsxs(Yr,{"data-slot":"select-item",className:he("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[g.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:g.jsx(Gr,{children:g.jsx(En,{className:"size-4"})})}),g.jsx(Xr,{children:t})]})}function Jr({className:e,...t}){return g.jsx(qr,{"data-slot":"select-scroll-up-button",className:he("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(On,{className:"size-4"})})}function Qr({className:e,...t}){return g.jsx(Zr,{"data-slot":"select-scroll-down-button",className:he("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Et,{className:"size-4"})})}export{oi as S,ni as T,si as a,li as b,ii as c,ri as d};
|