ynotsoft-dynamic-form 1.0.39 → 1.0.41

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.
@@ -1,90 +1,95 @@
1
- (function(oe,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-hot-toast"),require("dayjs"),require("react-select"),require("react-select/animated"),require("react-dom"),require("react-day-picker"),require("react-day-picker/dist/style.css")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-hot-toast","dayjs","react-select","react-select/animated","react-dom","react-day-picker","react-day-picker/dist/style.css"],l):(oe=typeof globalThis<"u"?globalThis:oe||self,l(oe.YnotsoftDynamicForm={},oe.jsxRuntime,oe.React,oe.ReactHotToast,oe.dayjs,oe.ReactSelect,oe.ReactSelectAnimated,oe.ReactDOM,oe.ReactDayPicker))})(this,(function(oe,l,V,st,Do,Ns,As,Fo,$o){"use strict";function Ro(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const u=Ro(V),at=Ro(Fo);function Os(e){return l.jsx("input",{type:"hidden",name:e.name,value:e.value},e.name)}function Is({field:e,formValues:t,handleChange:o,handleBlur:n,error:r}){const s=e.disabled&&e.disabled(t),a=e.options||[],i=As(),c=t[e.name]||[];return l.jsxs(l.Fragment,{children:[l.jsx(Ns,{components:i,isMulti:!0,isDisabled:s,name:e.label,value:c,onChange:d=>o(e.name,d),options:a,placeholder:e.placeholder,closeMenuOnSelect:!1,onBlur:()=>n(e.name),className:r?"border-red-500":"",styles:{control:d=>({...d,borderColor:r?"#ef4444":d.borderColor,"&:hover":{borderColor:r?"#ef4444":d["&:hover"]?.borderColor}})}}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}function Bo(e,[t,o]){return Math.min(o,Math.max(t,e))}function W(e,t,{checkForDefaultPrevented:o=!0}={}){return function(r){if(e?.(r),o===!1||!r.defaultPrevented)return t?.(r)}}function Oe(e,t=[]){let o=[];function n(s,a){const i=u.createContext(a),c=o.length;o=[...o,a];const d=m=>{const{scope:g,children:h,...b}=m,p=g?.[e]?.[c]||i,v=u.useMemo(()=>b,Object.values(b));return l.jsx(p.Provider,{value:v,children:h})};d.displayName=s+"Provider";function f(m,g){const h=g?.[e]?.[c]||i,b=u.useContext(h);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${s}\``)}return[d,f]}const r=()=>{const s=o.map(a=>u.createContext(a));return function(i){const c=i?.[e]||s;return u.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return r.scopeName=e,[n,Ts(r,...t)]}function Ts(...e){const t=e[0];if(e.length===1)return t;const o=()=>{const n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const a=n.reduce((i,{useScope:c,scopeName:d})=>{const m=c(s)[`__scope${d}`];return{...i,...m}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return o.scopeName=t.scopeName,o}function zo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Rt(...e){return t=>{let o=!1;const n=e.map(r=>{const s=zo(r,t);return!o&&typeof s=="function"&&(o=!0),s});if(o)return()=>{for(let r=0;r<n.length;r++){const s=n[r];typeof s=="function"?s():zo(e[r],null)}}}}function q(...e){return u.useCallback(Rt(...e),e)}function qe(e){const t=Ms(e),o=u.forwardRef((n,r)=>{const{children:s,...a}=n,i=u.Children.toArray(s),c=i.find(Ls);if(c){const d=c.props.children,f=i.map(m=>m===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:m);return l.jsx(t,{...a,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return l.jsx(t,{...a,ref:r,children:s})});return o.displayName=`${e}.Slot`,o}function Ms(e){const t=u.forwardRef((o,n)=>{const{children:r,...s}=o;if(u.isValidElement(r)){const a=Fs(r),i=Ds(s,r.props);return r.type!==u.Fragment&&(i.ref=n?Rt(n,a):a),u.cloneElement(r,i)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _s=Symbol("radix.slottable");function Ls(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_s}function Ds(e,t){const o={...t};for(const n in t){const r=e[n],s=t[n];/^on[A-Z]/.test(n)?r&&s?o[n]=(...i)=>{const c=s(...i);return r(...i),c}:r&&(o[n]=r):n==="style"?o[n]={...r,...s}:n==="className"&&(o[n]=[r,s].filter(Boolean).join(" "))}return{...e,...o}}function Fs(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}function Wo(e){const t=e+"CollectionProvider",[o,n]=Oe(t),[r,s]=o(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:v,children:y}=p,w=V.useRef(null),x=V.useRef(new Map).current;return l.jsx(r,{scope:v,itemMap:x,collectionRef:w,children:y})};a.displayName=t;const i=e+"CollectionSlot",c=qe(i),d=V.forwardRef((p,v)=>{const{scope:y,children:w}=p,x=s(i,y),S=q(v,x.collectionRef);return l.jsx(c,{ref:S,children:w})});d.displayName=i;const f=e+"CollectionItemSlot",m="data-radix-collection-item",g=qe(f),h=V.forwardRef((p,v)=>{const{scope:y,children:w,...x}=p,S=V.useRef(null),N=q(v,S),P=s(f,y);return V.useEffect(()=>(P.itemMap.set(S,{ref:S,...x}),()=>void P.itemMap.delete(S))),l.jsx(g,{[m]:"",ref:N,children:w})});h.displayName=f;function b(p){const v=s(e+"CollectionConsumer",p);return V.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${m}]`));return Array.from(v.itemMap.values()).sort((P,k)=>x.indexOf(P.ref.current)-x.indexOf(k.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:d,ItemSlot:h},b,n]}var $s=u.createContext(void 0);function Bt(e){const t=u.useContext($s);return e||t||"ltr"}var Rs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],U=Rs.reduce((e,t)=>{const o=qe(`Primitive.${t}`),n=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Bs(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function xe(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...o)=>t.current?.(...o),[])}function zs(e,t=globalThis?.document){const o=xe(e);u.useEffect(()=>{const n=r=>{r.key==="Escape"&&o(r)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[o,t])}var Ws="DismissableLayer",zt="dismissableLayer.update",Vs="dismissableLayer.pointerDownOutside",Hs="dismissableLayer.focusOutside",Vo,Ho=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wt=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...c}=e,d=u.useContext(Ho),[f,m]=u.useState(null),g=f?.ownerDocument??globalThis?.document,[,h]=u.useState({}),b=q(t,k=>m(k)),p=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(v),w=f?p.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=w>=y,N=Gs(k=>{const C=k.target,F=[...d.branches].some(E=>E.contains(C));!S||F||(r?.(k),a?.(k),k.defaultPrevented||i?.())},g),P=Ks(k=>{const C=k.target;[...d.branches].some(E=>E.contains(C))||(s?.(k),a?.(k),k.defaultPrevented||i?.())},g);return zs(k=>{w===d.layers.size-1&&(n?.(k),!k.defaultPrevented&&i&&(k.preventDefault(),i()))},g),u.useEffect(()=>{if(f)return o&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Vo=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Uo(),()=>{o&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Vo)}},[f,g,o,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Uo())},[f,d]),u.useEffect(()=>{const k=()=>h({});return document.addEventListener(zt,k),()=>document.removeEventListener(zt,k)},[]),l.jsx(U.div,{...c,ref:b,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:W(e.onFocusCapture,P.onFocusCapture),onBlurCapture:W(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,N.onPointerDownCapture)})});Wt.displayName=Ws;var Us="DismissableLayerBranch",js=u.forwardRef((e,t)=>{const o=u.useContext(Ho),n=u.useRef(null),r=q(t,n);return u.useEffect(()=>{const s=n.current;if(s)return o.branches.add(s),()=>{o.branches.delete(s)}},[o.branches]),l.jsx(U.div,{...e,ref:r})});js.displayName=Us;function Gs(e,t=globalThis?.document){const o=xe(e),n=u.useRef(!1),r=u.useRef(()=>{});return u.useEffect(()=>{const s=i=>{if(i.target&&!n.current){let c=function(){jo(Vs,o,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,o]),{onPointerDownCapture:()=>n.current=!0}}function Ks(e,t=globalThis?.document){const o=xe(e),n=u.useRef(!1);return u.useEffect(()=>{const r=s=>{s.target&&!n.current&&jo(Hs,o,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,o]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Uo(){const e=new CustomEvent(zt);document.dispatchEvent(e)}function jo(e,t,o,{discrete:n}){const r=o.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:o});t&&r.addEventListener(e,t,{once:!0}),n?Bs(r,s):r.dispatchEvent(s)}var Vt=0;function Go(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ko()),document.body.insertAdjacentElement("beforeend",e[1]??Ko()),Vt++,()=>{Vt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Vt--}},[])}function Ko(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ht="focusScope.autoFocusOnMount",Ut="focusScope.autoFocusOnUnmount",Yo={bubbles:!1,cancelable:!0},Ys="FocusScope",jt=u.forwardRef((e,t)=>{const{loop:o=!1,trapped:n=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...a}=e,[i,c]=u.useState(null),d=xe(r),f=xe(s),m=u.useRef(null),g=q(t,p=>c(p)),h=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(n){let p=function(x){if(h.paused||!i)return;const S=x.target;i.contains(S)?m.current=S:Ce(m.current,{select:!0})},v=function(x){if(h.paused||!i)return;const S=x.relatedTarget;S!==null&&(i.contains(S)||Ce(m.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&Ce(i)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver(y);return i&&w.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[n,i,h.paused]),u.useEffect(()=>{if(i){Zo.add(h);const p=document.activeElement;if(!i.contains(p)){const y=new CustomEvent(Ht,Yo);i.addEventListener(Ht,d),i.dispatchEvent(y),y.defaultPrevented||(qs(ea(qo(i)),{select:!0}),document.activeElement===p&&Ce(i))}return()=>{i.removeEventListener(Ht,d),setTimeout(()=>{const y=new CustomEvent(Ut,Yo);i.addEventListener(Ut,f),i.dispatchEvent(y),y.defaultPrevented||Ce(p??document.body,{select:!0}),i.removeEventListener(Ut,f),Zo.remove(h)},0)}}},[i,d,f,h]);const b=u.useCallback(p=>{if(!o&&!n||h.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(v&&y){const w=p.currentTarget,[x,S]=Xs(w);x&&S?!p.shiftKey&&y===S?(p.preventDefault(),o&&Ce(x,{select:!0})):p.shiftKey&&y===x&&(p.preventDefault(),o&&Ce(S,{select:!0})):y===w&&p.preventDefault()}},[o,n,h.paused]);return l.jsx(U.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});jt.displayName=Ys;function qs(e,{select:t=!1}={}){const o=document.activeElement;for(const n of e)if(Ce(n,{select:t}),document.activeElement!==o)return}function Xs(e){const t=qo(e),o=Xo(t,e),n=Xo(t.reverse(),e);return[o,n]}function qo(e){const t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const r=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||r?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)t.push(o.currentNode);return t}function Xo(e,t){for(const o of e)if(!Zs(o,{upTo:t}))return o}function Zs(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Qs(e){return e instanceof HTMLInputElement&&"select"in e}function Ce(e,{select:t=!1}={}){if(e&&e.focus){const o=document.activeElement;e.focus({preventScroll:!0}),e!==o&&Qs(e)&&t&&e.select()}}var Zo=Js();function Js(){let e=[];return{add(t){const o=e[0];t!==o&&o?.pause(),e=Qo(e,t),e.unshift(t)},remove(t){e=Qo(e,t),e[0]?.resume()}}}function Qo(e,t){const o=[...e],n=o.indexOf(t);return n!==-1&&o.splice(n,1),o}function ea(e){return e.filter(t=>t.tagName!=="A")}var te=globalThis?.document?u.useLayoutEffect:()=>{},ta=u[" useId ".trim().toString()]||(()=>{}),oa=0;function Xe(e){const[t,o]=u.useState(ta());return te(()=>{o(n=>n??String(oa++))},[e]),e||(t?`radix-${t}`:"")}const na=["top","right","bottom","left"],Se=Math.min,ne=Math.max,it=Math.round,ct=Math.floor,de=e=>({x:e,y:e}),ra={left:"right",right:"left",bottom:"top",top:"bottom"},sa={start:"end",end:"start"};function Gt(e,t,o){return ne(e,Se(t,o))}function ve(e,t){return typeof e=="function"?e(t):e}function be(e){return e.split("-")[0]}function De(e){return e.split("-")[1]}function Kt(e){return e==="x"?"y":"x"}function Yt(e){return e==="y"?"height":"width"}const aa=new Set(["top","bottom"]);function ue(e){return aa.has(be(e))?"y":"x"}function qt(e){return Kt(ue(e))}function ia(e,t,o){o===void 0&&(o=!1);const n=De(e),r=qt(e),s=Yt(r);let a=r==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=lt(a)),[a,lt(a)]}function ca(e){const t=lt(e);return[Xt(e),t,Xt(t)]}function Xt(e){return e.replace(/start|end/g,t=>sa[t])}const Jo=["left","right"],en=["right","left"],la=["top","bottom"],da=["bottom","top"];function ua(e,t,o){switch(e){case"top":case"bottom":return o?t?en:Jo:t?Jo:en;case"left":case"right":return t?la:da;default:return[]}}function fa(e,t,o,n){const r=De(e);let s=ua(be(e),o==="start",n);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(Xt)))),s}function lt(e){return e.replace(/left|right|bottom|top/g,t=>ra[t])}function pa(e){return{top:0,right:0,bottom:0,left:0,...e}}function tn(e){return typeof e!="number"?pa(e):{top:e,right:e,bottom:e,left:e}}function dt(e){const{x:t,y:o,width:n,height:r}=e;return{width:n,height:r,top:o,left:t,right:t+n,bottom:o+r,x:t,y:o}}function on(e,t,o){let{reference:n,floating:r}=e;const s=ue(t),a=qt(t),i=Yt(a),c=be(t),d=s==="y",f=n.x+n.width/2-r.width/2,m=n.y+n.height/2-r.height/2,g=n[i]/2-r[i]/2;let h;switch(c){case"top":h={x:f,y:n.y-r.height};break;case"bottom":h={x:f,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:m};break;case"left":h={x:n.x-r.width,y:m};break;default:h={x:n.x,y:n.y}}switch(De(t)){case"start":h[a]-=g*(o&&d?-1:1);break;case"end":h[a]+=g*(o&&d?-1:1);break}return h}const ma=async(e,t,o)=>{const{placement:n="bottom",strategy:r="absolute",middleware:s=[],platform:a}=o,i=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:m}=on(d,n,c),g=n,h={},b=0;for(let p=0;p<i.length;p++){const{name:v,fn:y}=i[p],{x:w,y:x,data:S,reset:N}=await y({x:f,y:m,initialPlacement:n,placement:g,strategy:r,middlewareData:h,rects:d,platform:a,elements:{reference:e,floating:t}});f=w??f,m=x??m,h={...h,[v]:{...h[v],...S}},N&&b<=50&&(b++,typeof N=="object"&&(N.placement&&(g=N.placement),N.rects&&(d=N.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):N.rects),{x:f,y:m}=on(d,g,c)),p=-1)}return{x:f,y:m,placement:g,strategy:r,middlewareData:h}};async function Ze(e,t){var o;t===void 0&&(t={});const{x:n,y:r,platform:s,rects:a,elements:i,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:m="floating",altBoundary:g=!1,padding:h=0}=ve(t,e),b=tn(h),v=i[g?m==="floating"?"reference":"floating":m],y=dt(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(v)))==null||o?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:d,rootBoundary:f,strategy:c})),w=m==="floating"?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),S=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},N=dt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-N.top+b.top)/S.y,bottom:(N.bottom-y.bottom+b.bottom)/S.y,left:(y.left-N.left+b.left)/S.x,right:(N.right-y.right+b.right)/S.x}}const ha=e=>({name:"arrow",options:e,async fn(t){const{x:o,y:n,placement:r,rects:s,platform:a,elements:i,middlewareData:c}=t,{element:d,padding:f=0}=ve(e,t)||{};if(d==null)return{};const m=tn(f),g={x:o,y:n},h=qt(r),b=Yt(h),p=await a.getDimensions(d),v=h==="y",y=v?"top":"left",w=v?"bottom":"right",x=v?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[h]-g[h]-s.floating[b],N=g[h]-s.reference[h],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let k=P?P[x]:0;(!k||!await(a.isElement==null?void 0:a.isElement(P)))&&(k=i.floating[x]||s.floating[b]);const C=S/2-N/2,F=k/2-p[b]/2-1,E=Se(m[y],F),O=Se(m[w],F),I=E,L=k-p[b]-O,R=k/2-p[b]/2+C,D=Gt(I,R,L),$=!c.arrow&&De(r)!=null&&R!==D&&s.reference[b]/2-(R<I?E:O)-p[b]/2<0,B=$?R<I?R-I:R-L:0;return{[h]:g[h]+B,data:{[h]:D,centerOffset:R-D-B,...$&&{alignmentOffset:B}},reset:$}}}),ga=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var o,n;const{placement:r,middlewareData:s,rects:a,initialPlacement:i,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:p=!0,...v}=ve(e,t);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const y=be(r),w=ue(i),x=be(i)===i,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=g||(x||!p?[lt(i)]:ca(i)),P=b!=="none";!g&&P&&N.push(...fa(i,p,b,S));const k=[i,...N],C=await Ze(t,v),F=[];let E=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&F.push(C[y]),m){const R=ia(r,a,S);F.push(C[R[0]],C[R[1]])}if(E=[...E,{placement:r,overflows:F}],!F.every(R=>R<=0)){var O,I;const R=(((O=s.flip)==null?void 0:O.index)||0)+1,D=k[R];if(D&&(!(m==="alignment"?w!==ue(D):!1)||E.every(A=>ue(A.placement)===w?A.overflows[0]>0:!0)))return{data:{index:R,overflows:E},reset:{placement:D}};let $=(I=E.filter(B=>B.overflows[0]<=0).sort((B,A)=>B.overflows[1]-A.overflows[1])[0])==null?void 0:I.placement;if(!$)switch(h){case"bestFit":{var L;const B=(L=E.filter(A=>{if(P){const j=ue(A.placement);return j===w||j==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(j=>j>0).reduce((j,ee)=>j+ee,0)]).sort((A,j)=>A[1]-j[1])[0])==null?void 0:L[0];B&&($=B);break}case"initialPlacement":$=i;break}if(r!==$)return{reset:{placement:$}}}return{}}}};function nn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rn(e){return na.some(t=>e[t]>=0)}const va=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:o}=t,{strategy:n="referenceHidden",...r}=ve(e,t);switch(n){case"referenceHidden":{const s=await Ze(t,{...r,elementContext:"reference"}),a=nn(s,o.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:rn(a)}}}case"escaped":{const s=await Ze(t,{...r,altBoundary:!0}),a=nn(s,o.floating);return{data:{escapedOffsets:a,escaped:rn(a)}}}default:return{}}}}},sn=new Set(["left","top"]);async function ba(e,t){const{placement:o,platform:n,elements:r}=e,s=await(n.isRTL==null?void 0:n.isRTL(r.floating)),a=be(o),i=De(o),c=ue(o)==="y",d=sn.has(a)?-1:1,f=s&&c?-1:1,m=ve(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return i&&typeof b=="number"&&(h=i==="end"?b*-1:b),c?{x:h*f,y:g*d}:{x:g*d,y:h*f}}const ya=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var o,n;const{x:r,y:s,placement:a,middlewareData:i}=t,c=await ba(t,e);return a===((o=i.offset)==null?void 0:o.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:a}}}}},wa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:n,placement:r}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:i={fn:v=>{let{x:y,y:w}=v;return{x:y,y:w}}},...c}=ve(e,t),d={x:o,y:n},f=await Ze(t,c),m=ue(be(r)),g=Kt(m);let h=d[g],b=d[m];if(s){const v=g==="y"?"top":"left",y=g==="y"?"bottom":"right",w=h+f[v],x=h-f[y];h=Gt(w,h,x)}if(a){const v=m==="y"?"top":"left",y=m==="y"?"bottom":"right",w=b+f[v],x=b-f[y];b=Gt(w,b,x)}const p=i.fn({...t,[g]:h,[m]:b});return{...p,data:{x:p.x-o,y:p.y-n,enabled:{[g]:s,[m]:a}}}}}},xa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:o,y:n,placement:r,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:c=!0,crossAxis:d=!0}=ve(e,t),f={x:o,y:n},m=ue(r),g=Kt(m);let h=f[g],b=f[m];const p=ve(i,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const x=g==="y"?"height":"width",S=s.reference[g]-s.floating[x]+v.mainAxis,N=s.reference[g]+s.reference[x]-v.mainAxis;h<S?h=S:h>N&&(h=N)}if(d){var y,w;const x=g==="y"?"width":"height",S=sn.has(be(r)),N=s.reference[m]-s.floating[x]+(S&&((y=a.offset)==null?void 0:y[m])||0)+(S?0:v.crossAxis),P=s.reference[m]+s.reference[x]+(S?0:((w=a.offset)==null?void 0:w[m])||0)-(S?v.crossAxis:0);b<N?b=N:b>P&&(b=P)}return{[g]:h,[m]:b}}}},Ca=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var o,n;const{placement:r,rects:s,platform:a,elements:i}=t,{apply:c=()=>{},...d}=ve(e,t),f=await Ze(t,d),m=be(r),g=De(r),h=ue(r)==="y",{width:b,height:p}=s.floating;let v,y;m==="top"||m==="bottom"?(v=m,y=g===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(y=m,v=g==="end"?"top":"bottom");const w=p-f.top-f.bottom,x=b-f.left-f.right,S=Se(p-f[v],w),N=Se(b-f[y],x),P=!t.middlewareData.shift;let k=S,C=N;if((o=t.middlewareData.shift)!=null&&o.enabled.x&&(C=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=w),P&&!g){const E=ne(f.left,0),O=ne(f.right,0),I=ne(f.top,0),L=ne(f.bottom,0);h?C=b-2*(E!==0||O!==0?E+O:ne(f.left,f.right)):k=p-2*(I!==0||L!==0?I+L:ne(f.top,f.bottom))}await c({...t,availableWidth:C,availableHeight:k});const F=await a.getDimensions(i.floating);return b!==F.width||p!==F.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function Fe(e){return an(e)?(e.nodeName||"").toLowerCase():"#document"}function re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fe(e){var t;return(t=(an(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function an(e){return ut()?e instanceof Node||e instanceof re(e).Node:!1}function ae(e){return ut()?e instanceof Element||e instanceof re(e).Element:!1}function pe(e){return ut()?e instanceof HTMLElement||e instanceof re(e).HTMLElement:!1}function cn(e){return!ut()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}const Sa=new Set(["inline","contents"]);function Qe(e){const{overflow:t,overflowX:o,overflowY:n,display:r}=ie(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+o)&&!Sa.has(r)}const Ea=new Set(["table","td","th"]);function ka(e){return Ea.has(Fe(e))}const Pa=[":popover-open",":modal"];function ft(e){return Pa.some(t=>{try{return e.matches(t)}catch{return!1}})}const Na=["transform","translate","scale","rotate","perspective"],Aa=["transform","translate","scale","rotate","perspective","filter"],Oa=["paint","layout","strict","content"];function Zt(e){const t=Qt(),o=ae(e)?ie(e):e;return Na.some(n=>o[n]?o[n]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!t&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!t&&(o.filter?o.filter!=="none":!1)||Aa.some(n=>(o.willChange||"").includes(n))||Oa.some(n=>(o.contain||"").includes(n))}function Ia(e){let t=Ee(e);for(;pe(t)&&!$e(t);){if(Zt(t))return t;if(ft(t))return null;t=Ee(t)}return null}function Qt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ta=new Set(["html","body","#document"]);function $e(e){return Ta.has(Fe(e))}function ie(e){return re(e).getComputedStyle(e)}function pt(e){return ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ee(e){if(Fe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cn(e)&&e.host||fe(e);return cn(t)?t.host:t}function ln(e){const t=Ee(e);return $e(t)?e.ownerDocument?e.ownerDocument.body:e.body:pe(t)&&Qe(t)?t:ln(t)}function Je(e,t,o){var n;t===void 0&&(t=[]),o===void 0&&(o=!0);const r=ln(e),s=r===((n=e.ownerDocument)==null?void 0:n.body),a=re(r);if(s){const i=Jt(a);return t.concat(a,a.visualViewport||[],Qe(r)?r:[],i&&o?Je(i):[])}return t.concat(r,Je(r,[],o))}function Jt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dn(e){const t=ie(e);let o=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const r=pe(e),s=r?e.offsetWidth:o,a=r?e.offsetHeight:n,i=it(o)!==s||it(n)!==a;return i&&(o=s,n=a),{width:o,height:n,$:i}}function eo(e){return ae(e)?e:e.contextElement}function Re(e){const t=eo(e);if(!pe(t))return de(1);const o=t.getBoundingClientRect(),{width:n,height:r,$:s}=dn(t);let a=(s?it(o.width):o.width)/n,i=(s?it(o.height):o.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const Ma=de(0);function un(e){const t=re(e);return!Qt()||!t.visualViewport?Ma:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _a(e,t,o){return t===void 0&&(t=!1),!o||t&&o!==re(e)?!1:t}function Ie(e,t,o,n){t===void 0&&(t=!1),o===void 0&&(o=!1);const r=e.getBoundingClientRect(),s=eo(e);let a=de(1);t&&(n?ae(n)&&(a=Re(n)):a=Re(e));const i=_a(s,o,n)?un(s):de(0);let c=(r.left+i.x)/a.x,d=(r.top+i.y)/a.y,f=r.width/a.x,m=r.height/a.y;if(s){const g=re(s),h=n&&ae(n)?re(n):n;let b=g,p=Jt(b);for(;p&&n&&h!==b;){const v=Re(p),y=p.getBoundingClientRect(),w=ie(p),x=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*v.x,S=y.top+(p.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,d*=v.y,f*=v.x,m*=v.y,c+=x,d+=S,b=re(p),p=Jt(b)}}return dt({width:f,height:m,x:c,y:d})}function mt(e,t){const o=pt(e).scrollLeft;return t?t.left+o:Ie(fe(e)).left+o}function fn(e,t){const o=e.getBoundingClientRect(),n=o.left+t.scrollLeft-mt(e,o),r=o.top+t.scrollTop;return{x:n,y:r}}function La(e){let{elements:t,rect:o,offsetParent:n,strategy:r}=e;const s=r==="fixed",a=fe(n),i=t?ft(t.floating):!1;if(n===a||i&&s)return o;let c={scrollLeft:0,scrollTop:0},d=de(1);const f=de(0),m=pe(n);if((m||!m&&!s)&&((Fe(n)!=="body"||Qe(a))&&(c=pt(n)),pe(n))){const h=Ie(n);d=Re(n),f.x=h.x+n.clientLeft,f.y=h.y+n.clientTop}const g=a&&!m&&!s?fn(a,c):de(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+f.x+g.x,y:o.y*d.y-c.scrollTop*d.y+f.y+g.y}}function Da(e){return Array.from(e.getClientRects())}function Fa(e){const t=fe(e),o=pt(e),n=e.ownerDocument.body,r=ne(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ne(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-o.scrollLeft+mt(e);const i=-o.scrollTop;return ie(n).direction==="rtl"&&(a+=ne(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:a,y:i}}const pn=25;function $a(e,t){const o=re(e),n=fe(e),r=o.visualViewport;let s=n.clientWidth,a=n.clientHeight,i=0,c=0;if(r){s=r.width,a=r.height;const f=Qt();(!f||f&&t==="fixed")&&(i=r.offsetLeft,c=r.offsetTop)}const d=mt(n);if(d<=0){const f=n.ownerDocument,m=f.body,g=getComputedStyle(m),h=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(n.clientWidth-m.clientWidth-h);b<=pn&&(s-=b)}else d<=pn&&(s+=d);return{width:s,height:a,x:i,y:c}}const Ra=new Set(["absolute","fixed"]);function Ba(e,t){const o=Ie(e,!0,t==="fixed"),n=o.top+e.clientTop,r=o.left+e.clientLeft,s=pe(e)?Re(e):de(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,c=r*s.x,d=n*s.y;return{width:a,height:i,x:c,y:d}}function mn(e,t,o){let n;if(t==="viewport")n=$a(e,o);else if(t==="document")n=Fa(fe(e));else if(ae(t))n=Ba(t,o);else{const r=un(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return dt(n)}function hn(e,t){const o=Ee(e);return o===t||!ae(o)||$e(o)?!1:ie(o).position==="fixed"||hn(o,t)}function za(e,t){const o=t.get(e);if(o)return o;let n=Je(e,[],!1).filter(i=>ae(i)&&Fe(i)!=="body"),r=null;const s=ie(e).position==="fixed";let a=s?Ee(e):e;for(;ae(a)&&!$e(a);){const i=ie(a),c=Zt(a);!c&&i.position==="fixed"&&(r=null),(s?!c&&!r:!c&&i.position==="static"&&!!r&&Ra.has(r.position)||Qe(a)&&!c&&hn(e,a))?n=n.filter(f=>f!==a):r=i,a=Ee(a)}return t.set(e,n),n}function Wa(e){let{element:t,boundary:o,rootBoundary:n,strategy:r}=e;const a=[...o==="clippingAncestors"?ft(t)?[]:za(t,this._c):[].concat(o),n],i=a[0],c=a.reduce((d,f)=>{const m=mn(t,f,r);return d.top=ne(m.top,d.top),d.right=Se(m.right,d.right),d.bottom=Se(m.bottom,d.bottom),d.left=ne(m.left,d.left),d},mn(t,i,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Va(e){const{width:t,height:o}=dn(e);return{width:t,height:o}}function Ha(e,t,o){const n=pe(t),r=fe(t),s=o==="fixed",a=Ie(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const c=de(0);function d(){c.x=mt(r)}if(n||!n&&!s)if((Fe(t)!=="body"||Qe(r))&&(i=pt(t)),n){const h=Ie(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else r&&d();s&&!n&&r&&d();const f=r&&!n&&!s?fn(r,i):de(0),m=a.left+i.scrollLeft-c.x-f.x,g=a.top+i.scrollTop-c.y-f.y;return{x:m,y:g,width:a.width,height:a.height}}function to(e){return ie(e).position==="static"}function gn(e,t){if(!pe(e)||ie(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;return fe(e)===o&&(o=o.ownerDocument.body),o}function vn(e,t){const o=re(e);if(ft(e))return o;if(!pe(e)){let r=Ee(e);for(;r&&!$e(r);){if(ae(r)&&!to(r))return r;r=Ee(r)}return o}let n=gn(e,t);for(;n&&ka(n)&&to(n);)n=gn(n,t);return n&&$e(n)&&to(n)&&!Zt(n)?o:n||Ia(e)||o}const Ua=async function(e){const t=this.getOffsetParent||vn,o=this.getDimensions,n=await o(e.floating);return{reference:Ha(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ja(e){return ie(e).direction==="rtl"}const Ga={convertOffsetParentRelativeRectToViewportRelativeRect:La,getDocumentElement:fe,getClippingRect:Wa,getOffsetParent:vn,getElementRects:Ua,getClientRects:Da,getDimensions:Va,getScale:Re,isElement:ae,isRTL:ja};function bn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ka(e,t){let o=null,n;const r=fe(e);function s(){var i;clearTimeout(n),(i=o)==null||i.disconnect(),o=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:f,top:m,width:g,height:h}=d;if(i||t(),!g||!h)return;const b=ct(m),p=ct(r.clientWidth-(f+g)),v=ct(r.clientHeight-(m+h)),y=ct(f),x={rootMargin:-b+"px "+-p+"px "+-v+"px "+-y+"px",threshold:ne(0,Se(1,c))||1};let S=!0;function N(P){const k=P[0].intersectionRatio;if(k!==c){if(!S)return a();k?a(!1,k):n=setTimeout(()=>{a(!1,1e-7)},1e3)}k===1&&!bn(d,e.getBoundingClientRect())&&a(),S=!1}try{o=new IntersectionObserver(N,{...x,root:r.ownerDocument})}catch{o=new IntersectionObserver(N,x)}o.observe(e)}return a(!0),s}function Ya(e,t,o,n){n===void 0&&(n={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=eo(e),f=r||s?[...d?Je(d):[],...Je(t)]:[];f.forEach(y=>{r&&y.addEventListener("scroll",o,{passive:!0}),s&&y.addEventListener("resize",o)});const m=d&&i?Ka(d,o):null;let g=-1,h=null;a&&(h=new ResizeObserver(y=>{let[w]=y;w&&w.target===d&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),o()}),d&&!c&&h.observe(d),h.observe(t));let b,p=c?Ie(e):null;c&&v();function v(){const y=Ie(e);p&&!bn(p,y)&&o(),p=y,b=requestAnimationFrame(v)}return o(),()=>{var y;f.forEach(w=>{r&&w.removeEventListener("scroll",o),s&&w.removeEventListener("resize",o)}),m?.(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(b)}}const qa=ya,Xa=wa,Za=ga,Qa=Ca,Ja=va,yn=ha,ei=xa,ti=(e,t,o)=>{const n=new Map,r={platform:Ga,...o},s={...r.platform,_c:n};return ma(e,t,{...r,platform:s})};var oi=typeof document<"u",ni=function(){},ht=oi?V.useLayoutEffect:ni;function gt(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 o,n,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(n=o;n--!==0;)if(!gt(e[n],t[n]))return!1;return!0}if(r=Object.keys(e),o=r.length,o!==Object.keys(t).length)return!1;for(n=o;n--!==0;)if(!{}.hasOwnProperty.call(t,r[n]))return!1;for(n=o;n--!==0;){const s=r[n];if(!(s==="_owner"&&e.$$typeof)&&!gt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function wn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xn(e,t){const o=wn(e);return Math.round(t*o)/o}function oo(e){const t=u.useRef(e);return ht(()=>{t.current=e}),t}function ri(e){e===void 0&&(e={});const{placement:t="bottom",strategy:o="absolute",middleware:n=[],platform:r,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:c,open:d}=e,[f,m]=u.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[g,h]=u.useState(n);gt(g,n)||h(n);const[b,p]=u.useState(null),[v,y]=u.useState(null),w=u.useCallback(A=>{A!==P.current&&(P.current=A,p(A))},[]),x=u.useCallback(A=>{A!==k.current&&(k.current=A,y(A))},[]),S=s||b,N=a||v,P=u.useRef(null),k=u.useRef(null),C=u.useRef(f),F=c!=null,E=oo(c),O=oo(r),I=oo(d),L=u.useCallback(()=>{if(!P.current||!k.current)return;const A={placement:t,strategy:o,middleware:g};O.current&&(A.platform=O.current),ti(P.current,k.current,A).then(j=>{const ee={...j,isPositioned:I.current!==!1};R.current&&!gt(C.current,ee)&&(C.current=ee,at.flushSync(()=>{m(ee)}))})},[g,t,o,O,I]);ht(()=>{d===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,m(A=>({...A,isPositioned:!1})))},[d]);const R=u.useRef(!1);ht(()=>(R.current=!0,()=>{R.current=!1}),[]),ht(()=>{if(S&&(P.current=S),N&&(k.current=N),S&&N){if(E.current)return E.current(S,N,L);L()}},[S,N,L,E,F]);const D=u.useMemo(()=>({reference:P,floating:k,setReference:w,setFloating:x}),[w,x]),$=u.useMemo(()=>({reference:S,floating:N}),[S,N]),B=u.useMemo(()=>{const A={position:o,left:0,top:0};if(!$.floating)return A;const j=xn($.floating,f.x),ee=xn($.floating,f.y);return i?{...A,transform:"translate("+j+"px, "+ee+"px)",...wn($.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:j,top:ee}},[o,i,$.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:L,refs:D,elements:$,floatingStyles:B}),[f,L,D,$,B])}const si=e=>{function t(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){const{element:n,padding:r}=typeof e=="function"?e(o):e;return n&&t(n)?n.current!=null?yn({element:n.current,padding:r}).fn(o):{}:n?yn({element:n,padding:r}).fn(o):{}}}},ai=(e,t)=>({...qa(e),options:[e,t]}),ii=(e,t)=>({...Xa(e),options:[e,t]}),ci=(e,t)=>({...ei(e),options:[e,t]}),li=(e,t)=>({...Za(e),options:[e,t]}),di=(e,t)=>({...Qa(e),options:[e,t]}),ui=(e,t)=>({...Ja(e),options:[e,t]}),fi=(e,t)=>({...si(e),options:[e,t]});var pi="Arrow",Cn=u.forwardRef((e,t)=>{const{children:o,width:n=10,height:r=5,...s}=e;return l.jsx(U.svg,{...s,ref:t,width:n,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Cn.displayName=pi;var mi=Cn;function Sn(e){const[t,o]=u.useState(void 0);return te(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let a,i;if("borderBoxSize"in s){const c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;o({width:a,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else o(void 0)},[e]),t}var no="Popper",[En,vt]=Oe(no),[hi,kn]=En(no),Pn=e=>{const{__scopePopper:t,children:o}=e,[n,r]=u.useState(null);return l.jsx(hi,{scope:t,anchor:n,onAnchorChange:r,children:o})};Pn.displayName=no;var Nn="PopperAnchor",An=u.forwardRef((e,t)=>{const{__scopePopper:o,virtualRef:n,...r}=e,s=kn(Nn,o),a=u.useRef(null),i=q(t,a),c=u.useRef(null);return u.useEffect(()=>{const d=c.current;c.current=n?.current||a.current,d!==c.current&&s.onAnchorChange(c.current)}),n?null:l.jsx(U.div,{...r,ref:i})});An.displayName=Nn;var ro="PopperContent",[gi,vi]=En(ro),On=u.forwardRef((e,t)=>{const{__scopePopper:o,side:n="bottom",sideOffset:r=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:h="optimized",onPlaced:b,...p}=e,v=kn(ro,o),[y,w]=u.useState(null),x=q(t,T=>w(T)),[S,N]=u.useState(null),P=Sn(S),k=P?.width??0,C=P?.height??0,F=n+(s!=="center"?"-"+s:""),E=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},O=Array.isArray(d)?d:[d],I=O.length>0,L={padding:E,boundary:O.filter(yi),altBoundary:I},{refs:R,floatingStyles:D,placement:$,isPositioned:B,middlewareData:A}=ri({strategy:"fixed",placement:F,whileElementsMounted:(...T)=>Ya(...T,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[ai({mainAxis:r+C,alignmentAxis:a}),c&&ii({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?ci():void 0,...L}),c&&li({...L}),di({...L,apply:({elements:T,rects:K,availableWidth:Q,availableHeight:H})=>{const{width:G,height:Y}=K.reference,se=T.floating.style;se.setProperty("--radix-popper-available-width",`${Q}px`),se.setProperty("--radix-popper-available-height",`${H}px`),se.setProperty("--radix-popper-anchor-width",`${G}px`),se.setProperty("--radix-popper-anchor-height",`${Y}px`)}}),S&&fi({element:S,padding:i}),wi({arrowWidth:k,arrowHeight:C}),g&&ui({strategy:"referenceHidden",...L})]}),[j,ee]=Mn($),he=xe(b);te(()=>{B&&he?.()},[B,he]);const we=A.arrow?.x,Z=A.arrow?.y,X=A.arrow?.centerOffset!==0,[le,ge]=u.useState();return te(()=>{y&&ge(window.getComputedStyle(y).zIndex)},[y]),l.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:B?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(gi,{scope:o,placedSide:j,onArrowChange:N,arrowX:we,arrowY:Z,shouldHideArrow:X,children:l.jsx(U.div,{"data-side":j,"data-align":ee,...p,ref:x,style:{...p.style,animation:B?void 0:"none"}})})})});On.displayName=ro;var In="PopperArrow",bi={top:"bottom",right:"left",bottom:"top",left:"right"},Tn=u.forwardRef(function(t,o){const{__scopePopper:n,...r}=t,s=vi(In,n),a=bi[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]: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:l.jsx(mi,{...r,ref:o,style:{...r.style,display:"block"}})})});Tn.displayName=In;function yi(e){return e!==null}var wi=e=>({name:"transformOrigin",options:e,fn(t){const{placement:o,rects:n,middlewareData:r}=t,a=r.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,f]=Mn(o),m={start:"0%",center:"50%",end:"100%"}[f],g=(r.arrow?.x??0)+i/2,h=(r.arrow?.y??0)+c/2;let b="",p="";return d==="bottom"?(b=a?m:`${g}px`,p=`${-c}px`):d==="top"?(b=a?m:`${g}px`,p=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,p=a?m:`${h}px`):d==="left"&&(b=`${n.floating.width+c}px`,p=a?m:`${h}px`),{data:{x:b,y:p}}}});function Mn(e){const[t,o="center"]=e.split("-");return[t,o]}var _n=Pn,so=An,Ln=On,Dn=Tn,xi="Portal",ao=u.forwardRef((e,t)=>{const{container:o,...n}=e,[r,s]=u.useState(!1);te(()=>s(!0),[]);const a=o||r&&globalThis?.document?.body;return a?Fo.createPortal(l.jsx(U.div,{...n,ref:t}),a):null});ao.displayName=xi;var Ci=u[" useInsertionEffect ".trim().toString()]||te;function et({prop:e,defaultProp:t,onChange:o=()=>{},caller:n}){const[r,s,a]=Si({defaultProp:t,onChange:o}),i=e!==void 0,c=i?e:r;{const f=u.useRef(e!==void 0);u.useEffect(()=>{const m=f.current;m!==i&&console.warn(`${n} is changing from ${m?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=i},[i,n])}const d=u.useCallback(f=>{if(i){const m=Ei(f)?f(e):f;m!==e&&a.current?.(m)}else s(f)},[i,e,s,a]);return[c,d]}function Si({defaultProp:e,onChange:t}){const[o,n]=u.useState(e),r=u.useRef(o),s=u.useRef(t);return Ci(()=>{s.current=t},[t]),u.useEffect(()=>{r.current!==o&&(s.current?.(o),r.current=o)},[o,r]),[o,n,s]}function Ei(e){return typeof e=="function"}function Fn(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])}var $n=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"}),ki="VisuallyHidden",Pi=u.forwardRef((e,t)=>l.jsx(U.span,{...e,ref:t,style:{...$n,...e.style}}));Pi.displayName=ki;var Ni=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Be=new WeakMap,bt=new WeakMap,yt={},io=0,Rn=function(e){return e&&(e.host||Rn(e.parentNode))},Ai=function(e,t){return t.map(function(o){if(e.contains(o))return o;var n=Rn(o);return n&&e.contains(n)?n:(console.error("aria-hidden",o,"in not contained inside",e,". Doing nothing"),null)}).filter(function(o){return!!o})},Oi=function(e,t,o,n){var r=Ai(t,Array.isArray(e)?e:[e]);yt[o]||(yt[o]=new WeakMap);var s=yt[o],a=[],i=new Set,c=new Set(r),d=function(m){!m||i.has(m)||(i.add(m),d(m.parentNode))};r.forEach(d);var f=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(g){if(i.has(g))f(g);else try{var h=g.getAttribute(n),b=h!==null&&h!=="false",p=(Be.get(g)||0)+1,v=(s.get(g)||0)+1;Be.set(g,p),s.set(g,v),a.push(g),p===1&&b&&bt.set(g,!0),v===1&&g.setAttribute(o,"true"),b||g.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",g,y)}})};return f(t),i.clear(),io++,function(){a.forEach(function(m){var g=Be.get(m)-1,h=s.get(m)-1;Be.set(m,g),s.set(m,h),g||(bt.has(m)||m.removeAttribute(n),bt.delete(m)),h||m.removeAttribute(o)}),io--,io||(Be=new WeakMap,Be=new WeakMap,bt=new WeakMap,yt={})}},Bn=function(e,t,o){o===void 0&&(o="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),r=Ni(e);return r?(n.push.apply(n,Array.from(r.querySelectorAll("[aria-live], script"))),Oi(n,r,o,"aria-hidden")):function(){return null}},me=function(){return me=Object.assign||function(t){for(var o,n=1,r=arguments.length;n<r;n++){o=arguments[n];for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])}return t},me.apply(this,arguments)};function zn(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]]);return o}function Ii(e,t,o){if(o||arguments.length===2)for(var n=0,r=t.length,s;n<r;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var wt="right-scroll-bar-position",xt="width-before-scroll-bar",Ti="with-scroll-bars-hidden",Mi="--removed-body-scroll-bar-size";function co(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function _i(e,t){var o=V.useState(function(){return{value:e,callback:t,facade:{get current(){return o.value},set current(n){var r=o.value;r!==n&&(o.value=n,o.callback(n,r))}}}})[0];return o.callback=t,o.facade}var Li=typeof window<"u"?u.useLayoutEffect:u.useEffect,Wn=new WeakMap;function Di(e,t){var o=_i(null,function(n){return e.forEach(function(r){return co(r,n)})});return Li(function(){var n=Wn.get(o);if(n){var r=new Set(n),s=new Set(e),a=o.current;r.forEach(function(i){s.has(i)||co(i,null)}),s.forEach(function(i){r.has(i)||co(i,a)})}Wn.set(o,e)},[e]),o}function Fi(e){return e}function $i(e,t){t===void 0&&(t=Fi);var o=[],n=!1,r={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:e},useMedium:function(s){var a=t(s,n);return o.push(a),function(){o=o.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(n=!0;o.length;){var a=o;o=[],a.forEach(s)}o={push:function(i){return s(i)},filter:function(){return o}}},assignMedium:function(s){n=!0;var a=[];if(o.length){var i=o;o=[],i.forEach(s),a=o}var c=function(){var f=a;a=[],f.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),o={push:function(f){a.push(f),d()},filter:function(f){return a=a.filter(f),o}}}};return r}function Ri(e){e===void 0&&(e={});var t=$i(null);return t.options=me({async:!0,ssr:!1},e),t}var Vn=function(e){var t=e.sideCar,o=zn(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return u.createElement(n,me({},o))};Vn.isSideCarExport=!0;function Bi(e,t){return e.useMedium(t),Vn}var Hn=Ri(),lo=function(){},Ct=u.forwardRef(function(e,t){var o=u.useRef(null),n=u.useState({onScrollCapture:lo,onWheelCapture:lo,onTouchMoveCapture:lo}),r=n[0],s=n[1],a=e.forwardProps,i=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,m=e.shards,g=e.sideCar,h=e.noRelative,b=e.noIsolation,p=e.inert,v=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,x=e.gapMode,S=zn(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=g,P=Di([o,t]),k=me(me({},S),r);return u.createElement(u.Fragment,null,f&&u.createElement(N,{sideCar:Hn,removeScrollBar:d,shards:m,noRelative:h,noIsolation:b,inert:p,setCallbacks:s,allowPinchZoom:!!v,lockRef:o,gapMode:x}),a?u.cloneElement(u.Children.only(i),me(me({},k),{ref:P})):u.createElement(w,me({},k,{className:c,ref:P}),i))});Ct.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ct.classNames={fullWidth:xt,zeroRight:wt};var zi=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Wi(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=zi();return t&&e.setAttribute("nonce",t),e}function Vi(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Hi(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ui=function(){var e=0,t=null;return{add:function(o){e==0&&(t=Wi())&&(Vi(t,o),Hi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ji=function(){var e=Ui();return function(t,o){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&o])}},Un=function(){var e=ji(),t=function(o){var n=o.styles,r=o.dynamic;return e(n,r),null};return t},Gi={left:0,top:0,right:0,gap:0},uo=function(e){return parseInt(e||"",10)||0},Ki=function(e){var t=window.getComputedStyle(document.body),o=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[uo(o),uo(n),uo(r)]},Yi=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Gi;var t=Ki(e),o=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-o+t[2]-t[0])}},qi=Un(),ze="data-scroll-locked",Xi=function(e,t,o,n){var r=e.left,s=e.top,a=e.right,i=e.gap;return o===void 0&&(o="margin"),`
2
- .`.concat(Ti,` {
3
- overflow: hidden `).concat(n,`;
4
- padding-right: `).concat(i,"px ").concat(n,`;
1
+ (function(te,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-hot-toast"),require("dayjs"),require("react-select"),require("react-select/animated"),require("react-dom"),require("react-day-picker"),require("react-day-picker/dist/style.css")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-hot-toast","dayjs","react-select","react-select/animated","react-dom","react-day-picker","react-day-picker/dist/style.css"],l):(te=typeof globalThis<"u"?globalThis:te||self,l(te.YnotsoftDynamicForm={},te.jsxRuntime,te.React,te.ReactHotToast,te.dayjs,te.ReactSelect,te.ReactSelectAnimated,te.ReactDOM,te.ReactDayPicker))})(this,(function(te,l,V,st,Lr,Ms,_s,Fr,$r){"use strict";function Br(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const u=Br(V),at=Br(Fr);function Ds(e){return l.jsx("input",{type:"hidden",name:e.name,value:e.value},e.name)}function Ls({field:e,formValues:t,handleChange:r,handleBlur:o,error:n}){const s=e.disabled&&e.disabled(t),a=e.options||[],i=_s(),c=t[e.name]||[];return l.jsxs(l.Fragment,{children:[l.jsx(Ms,{components:i,isMulti:!0,isDisabled:s,name:e.label,value:c,onChange:d=>r(e.name,d),options:a,placeholder:e.placeholder,closeMenuOnSelect:!1,onBlur:()=>o(e.name),className:n?"border-red-500":"",styles:{control:d=>({...d,borderColor:n?"#ef4444":d.borderColor,"&:hover":{borderColor:n?"#ef4444":d["&:hover"]?.borderColor}})}}),n&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:n})]})}function Rr(e,[t,r]){return Math.min(r,Math.max(t,e))}function W(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),r===!1||!n.defaultPrevented)return t?.(n)}}function Ie(e,t=[]){let r=[];function o(s,a){const i=u.createContext(a),c=r.length;r=[...r,a];const d=p=>{const{scope:g,children:h,...b}=p,m=g?.[e]?.[c]||i,v=u.useMemo(()=>b,Object.values(b));return l.jsx(m.Provider,{value:v,children:h})};d.displayName=s+"Provider";function f(p,g){const h=g?.[e]?.[c]||i,b=u.useContext(h);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,f]}const n=()=>{const s=r.map(a=>u.createContext(a));return function(i){const c=i?.[e]||s;return u.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return n.scopeName=e,[o,Fs(n,...t)]}function Fs(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(s){const a=o.reduce((i,{useScope:c,scopeName:d})=>{const p=c(s)[`__scope${d}`];return{...i,...p}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function zr(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Rt(...e){return t=>{let r=!1;const o=e.map(n=>{const s=zr(n,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let n=0;n<o.length;n++){const s=o[n];typeof s=="function"?s():zr(e[n],null)}}}}function Y(...e){return u.useCallback(Rt(...e),e)}function re(e){const t=$s(e),r=u.forwardRef((o,n)=>{const{children:s,...a}=o,i=u.Children.toArray(s),c=i.find(Rs);if(c){const d=c.props.children,f=i.map(p=>p===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...a,ref:n,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return l.jsx(t,{...a,ref:n,children:s})});return r.displayName=`${e}.Slot`,r}function $s(e){const t=u.forwardRef((r,o)=>{const{children:n,...s}=r;if(u.isValidElement(n)){const a=Ws(n),i=zs(s,n.props);return n.type!==u.Fragment&&(i.ref=o?Rt(o,a):a),u.cloneElement(n,i)}return u.Children.count(n)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bs=Symbol("radix.slottable");function Rs(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bs}function zs(e,t){const r={...t};for(const o in t){const n=e[o],s=t[o];/^on[A-Z]/.test(o)?n&&s?r[o]=(...i)=>{const c=s(...i);return n(...i),c}:n&&(r[o]=n):o==="style"?r[o]={...n,...s}:o==="className"&&(r[o]=[n,s].filter(Boolean).join(" "))}return{...e,...r}}function Ws(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Wr(e){const t=e+"CollectionProvider",[r,o]=Ie(t),[n,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:v,children:y}=m,w=V.useRef(null),x=V.useRef(new Map).current;return l.jsx(n,{scope:v,itemMap:x,collectionRef:w,children:y})};a.displayName=t;const i=e+"CollectionSlot",c=re(i),d=V.forwardRef((m,v)=>{const{scope:y,children:w}=m,x=s(i,y),C=Y(v,x.collectionRef);return l.jsx(c,{ref:C,children:w})});d.displayName=i;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=re(f),h=V.forwardRef((m,v)=>{const{scope:y,children:w,...x}=m,C=V.useRef(null),k=Y(v,C),N=s(f,y);return V.useEffect(()=>(N.itemMap.set(C,{ref:C,...x}),()=>void N.itemMap.delete(C))),l.jsx(g,{[p]:"",ref:k,children:w})});h.displayName=f;function b(m){const v=s(e+"CollectionConsumer",m);return V.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${p}]`));return Array.from(v.itemMap.values()).sort((N,P)=>x.indexOf(N.ref.current)-x.indexOf(P.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:d,ItemSlot:h},b,o]}var Vs=u.createContext(void 0);function zt(e){const t=u.useContext(Vs);return e||t||"ltr"}var Hs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vr=Hs.reduce((e,t)=>{const r=re(`Primitive.${t}`),o=u.forwardRef((n,s)=>{const{asChild:a,...i}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Us(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function Se(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...r)=>t.current?.(...r),[])}function js(e,t=globalThis?.document){const r=Se(e);u.useEffect(()=>{const o=n=>{n.key==="Escape"&&r(n)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var Gs="DismissableLayer",Wt="dismissableLayer.update",Ks="dismissableLayer.pointerDownOutside",Ys="dismissableLayer.focusOutside",Hr,Ur=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vt=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:n,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...c}=e,d=u.useContext(Ur),[f,p]=u.useState(null),g=f?.ownerDocument??globalThis?.document,[,h]=u.useState({}),b=Y(t,P=>p(P)),m=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),w=f?m.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,C=w>=y,k=Zs(P=>{const S=P.target,$=[...d.branches].some(E=>E.contains(S));!C||$||(n?.(P),a?.(P),P.defaultPrevented||i?.())},g),N=Qs(P=>{const S=P.target;[...d.branches].some(E=>E.contains(S))||(s?.(P),a?.(P),P.defaultPrevented||i?.())},g);return js(P=>{w===d.layers.size-1&&(o?.(P),!P.defaultPrevented&&i&&(P.preventDefault(),i()))},g),u.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Hr=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),jr(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Hr)}},[f,g,r,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),jr())},[f,d]),u.useEffect(()=>{const P=()=>h({});return document.addEventListener(Wt,P),()=>document.removeEventListener(Wt,P)},[]),l.jsx(Vr.div,{...c,ref:b,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:W(e.onFocusCapture,N.onFocusCapture),onBlurCapture:W(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,k.onPointerDownCapture)})});Vt.displayName=Gs;var qs="DismissableLayerBranch",Xs=u.forwardRef((e,t)=>{const r=u.useContext(Ur),o=u.useRef(null),n=Y(t,o);return u.useEffect(()=>{const s=o.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),l.jsx(Vr.div,{...e,ref:n})});Xs.displayName=qs;function Zs(e,t=globalThis?.document){const r=Se(e),o=u.useRef(!1),n=u.useRef(()=>{});return u.useEffect(()=>{const s=i=>{if(i.target&&!o.current){let c=function(){Gr(Ks,r,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",n.current),n.current=c,t.addEventListener("click",n.current,{once:!0})):c()}else t.removeEventListener("click",n.current);o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",n.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function Qs(e,t=globalThis?.document){const r=Se(e),o=u.useRef(!1);return u.useEffect(()=>{const n=s=>{s.target&&!o.current&&Gr(Ys,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",n),()=>t.removeEventListener("focusin",n)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function jr(){const e=new CustomEvent(Wt);document.dispatchEvent(e)}function Gr(e,t,r,{discrete:o}){const n=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?Us(n,s):n.dispatchEvent(s)}var Ht=0;function Kr(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Yr()),document.body.insertAdjacentElement("beforeend",e[1]??Yr()),Ht++,()=>{Ht===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ht--}},[])}function Yr(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Js=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ea=Js.reduce((e,t)=>{const r=re(`Primitive.${t}`),o=u.forwardRef((n,s)=>{const{asChild:a,...i}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Ut="focusScope.autoFocusOnMount",jt="focusScope.autoFocusOnUnmount",qr={bubbles:!1,cancelable:!0},ta="FocusScope",Gt=u.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:n,onUnmountAutoFocus:s,...a}=e,[i,c]=u.useState(null),d=Se(n),f=Se(s),p=u.useRef(null),g=Y(t,m=>c(m)),h=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(o){let m=function(x){if(h.paused||!i)return;const C=x.target;i.contains(C)?p.current=C:Ce(p.current,{select:!0})},v=function(x){if(h.paused||!i)return;const C=x.relatedTarget;C!==null&&(i.contains(C)||Ce(p.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const k of x)k.removedNodes.length>0&&Ce(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const w=new MutationObserver(y);return i&&w.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),w.disconnect()}}},[o,i,h.paused]),u.useEffect(()=>{if(i){Qr.add(h);const m=document.activeElement;if(!i.contains(m)){const y=new CustomEvent(Ut,qr);i.addEventListener(Ut,d),i.dispatchEvent(y),y.defaultPrevented||(ra(ia(Xr(i)),{select:!0}),document.activeElement===m&&Ce(i))}return()=>{i.removeEventListener(Ut,d),setTimeout(()=>{const y=new CustomEvent(jt,qr);i.addEventListener(jt,f),i.dispatchEvent(y),y.defaultPrevented||Ce(m??document.body,{select:!0}),i.removeEventListener(jt,f),Qr.remove(h)},0)}}},[i,d,f,h]);const b=u.useCallback(m=>{if(!r&&!o||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const w=m.currentTarget,[x,C]=oa(w);x&&C?!m.shiftKey&&y===C?(m.preventDefault(),r&&Ce(x,{select:!0})):m.shiftKey&&y===x&&(m.preventDefault(),r&&Ce(C,{select:!0})):y===w&&m.preventDefault()}},[r,o,h.paused]);return l.jsx(ea.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});Gt.displayName=ta;function ra(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(Ce(o,{select:t}),document.activeElement!==r)return}function oa(e){const t=Xr(e),r=Zr(t,e),o=Zr(t.reverse(),e);return[r,o]}function Xr(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const n=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||n?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Zr(e,t){for(const r of e)if(!na(r,{upTo:t}))return r}function na(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function sa(e){return e instanceof HTMLInputElement&&"select"in e}function Ce(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&sa(e)&&t&&e.select()}}var Qr=aa();function aa(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Jr(e,t),e.unshift(t)},remove(t){e=Jr(e,t),e[0]?.resume()}}}function Jr(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function ia(e){return e.filter(t=>t.tagName!=="A")}var ee=globalThis?.document?u.useLayoutEffect:()=>{},ca=u[" useId ".trim().toString()]||(()=>{}),la=0;function Xe(e){const[t,r]=u.useState(ca());return ee(()=>{r(o=>o??String(la++))},[e]),e||(t?`radix-${t}`:"")}const da=["top","right","bottom","left"],Ee=Math.min,oe=Math.max,it=Math.round,ct=Math.floor,ue=e=>({x:e,y:e}),ua={left:"right",right:"left",bottom:"top",top:"bottom"},fa={start:"end",end:"start"};function Kt(e,t,r){return oe(e,Ee(t,r))}function be(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function Fe(e){return e.split("-")[1]}function Yt(e){return e==="x"?"y":"x"}function qt(e){return e==="y"?"height":"width"}const pa=new Set(["top","bottom"]);function fe(e){return pa.has(ye(e))?"y":"x"}function Xt(e){return Yt(fe(e))}function ma(e,t,r){r===void 0&&(r=!1);const o=Fe(e),n=Xt(e),s=qt(n);let a=n==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=lt(a)),[a,lt(a)]}function ha(e){const t=lt(e);return[Zt(e),t,Zt(t)]}function Zt(e){return e.replace(/start|end/g,t=>fa[t])}const eo=["left","right"],to=["right","left"],ga=["top","bottom"],va=["bottom","top"];function ba(e,t,r){switch(e){case"top":case"bottom":return r?t?to:eo:t?eo:to;case"left":case"right":return t?ga:va;default:return[]}}function ya(e,t,r,o){const n=Fe(e);let s=ba(ye(e),r==="start",o);return n&&(s=s.map(a=>a+"-"+n),t&&(s=s.concat(s.map(Zt)))),s}function lt(e){return e.replace(/left|right|bottom|top/g,t=>ua[t])}function wa(e){return{top:0,right:0,bottom:0,left:0,...e}}function ro(e){return typeof e!="number"?wa(e):{top:e,right:e,bottom:e,left:e}}function dt(e){const{x:t,y:r,width:o,height:n}=e;return{width:o,height:n,top:r,left:t,right:t+o,bottom:r+n,x:t,y:r}}function oo(e,t,r){let{reference:o,floating:n}=e;const s=fe(t),a=Xt(t),i=qt(a),c=ye(t),d=s==="y",f=o.x+o.width/2-n.width/2,p=o.y+o.height/2-n.height/2,g=o[i]/2-n[i]/2;let h;switch(c){case"top":h={x:f,y:o.y-n.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:p};break;case"left":h={x:o.x-n.width,y:p};break;default:h={x:o.x,y:o.y}}switch(Fe(t)){case"start":h[a]-=g*(r&&d?-1:1);break;case"end":h[a]+=g*(r&&d?-1:1);break}return h}const xa=async(e,t,r)=>{const{placement:o="bottom",strategy:n="absolute",middleware:s=[],platform:a}=r,i=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:n}),{x:f,y:p}=oo(d,o,c),g=o,h={},b=0;for(let m=0;m<i.length;m++){const{name:v,fn:y}=i[m],{x:w,y:x,data:C,reset:k}=await y({x:f,y:p,initialPlacement:o,placement:g,strategy:n,middlewareData:h,rects:d,platform:a,elements:{reference:e,floating:t}});f=w??f,p=x??p,h={...h,[v]:{...h[v],...C}},k&&b<=50&&(b++,typeof k=="object"&&(k.placement&&(g=k.placement),k.rects&&(d=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:n}):k.rects),{x:f,y:p}=oo(d,g,c)),m=-1)}return{x:f,y:p,placement:g,strategy:n,middlewareData:h}};async function Ze(e,t){var r;t===void 0&&(t={});const{x:o,y:n,platform:s,rects:a,elements:i,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:g=!1,padding:h=0}=be(t,e),b=ro(h),v=i[g?p==="floating"?"reference":"floating":p],y=dt(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(v)))==null||r?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:d,rootBoundary:f,strategy:c})),w=p==="floating"?{x:o,y:n,width:a.floating.width,height:a.floating.height}:a.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),C=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},k=dt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-k.top+b.top)/C.y,bottom:(k.bottom-y.bottom+b.bottom)/C.y,left:(y.left-k.left+b.left)/C.x,right:(k.right-y.right+b.right)/C.x}}const Sa=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:o,placement:n,rects:s,platform:a,elements:i,middlewareData:c}=t,{element:d,padding:f=0}=be(e,t)||{};if(d==null)return{};const p=ro(f),g={x:r,y:o},h=Xt(n),b=qt(h),m=await a.getDimensions(d),v=h==="y",y=v?"top":"left",w=v?"bottom":"right",x=v?"clientHeight":"clientWidth",C=s.reference[b]+s.reference[h]-g[h]-s.floating[b],k=g[h]-s.reference[h],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let P=N?N[x]:0;(!P||!await(a.isElement==null?void 0:a.isElement(N)))&&(P=i.floating[x]||s.floating[b]);const S=C/2-k/2,$=P/2-m[b]/2-1,E=Ee(p[y],$),O=Ee(p[w],$),I=E,L=P-m[b]-O,B=P/2-m[b]/2+S,T=Kt(I,B,L),F=!c.arrow&&Fe(n)!=null&&B!==T&&s.reference[b]/2-(B<I?E:O)-m[b]/2<0,R=F?B<I?B-I:B-L:0;return{[h]:g[h]+R,data:{[h]:T,centerOffset:B-T-R,...F&&{alignmentOffset:R}},reset:F}}}),Ca=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;const{placement:n,middlewareData:s,rects:a,initialPlacement:i,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:m=!0,...v}=be(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const y=ye(n),w=fe(i),x=ye(i)===i,C=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=g||(x||!m?[lt(i)]:ha(i)),N=b!=="none";!g&&N&&k.push(...ya(i,m,b,C));const P=[i,...k],S=await Ze(t,v),$=[];let E=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&$.push(S[y]),p){const B=ma(n,a,C);$.push(S[B[0]],S[B[1]])}if(E=[...E,{placement:n,overflows:$}],!$.every(B=>B<=0)){var O,I;const B=(((O=s.flip)==null?void 0:O.index)||0)+1,T=P[B];if(T&&(!(p==="alignment"?w!==fe(T):!1)||E.every(A=>fe(A.placement)===w?A.overflows[0]>0:!0)))return{data:{index:B,overflows:E},reset:{placement:T}};let F=(I=E.filter(R=>R.overflows[0]<=0).sort((R,A)=>R.overflows[1]-A.overflows[1])[0])==null?void 0:I.placement;if(!F)switch(h){case"bestFit":{var L;const R=(L=E.filter(A=>{if(N){const U=fe(A.placement);return U===w||U==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(U=>U>0).reduce((U,J)=>U+J,0)]).sort((A,U)=>A[1]-U[1])[0])==null?void 0:L[0];R&&(F=R);break}case"initialPlacement":F=i;break}if(n!==F)return{reset:{placement:F}}}return{}}}};function no(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function so(e){return da.some(t=>e[t]>=0)}const Ea=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:o="referenceHidden",...n}=be(e,t);switch(o){case"referenceHidden":{const s=await Ze(t,{...n,elementContext:"reference"}),a=no(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:so(a)}}}case"escaped":{const s=await Ze(t,{...n,altBoundary:!0}),a=no(s,r.floating);return{data:{escapedOffsets:a,escaped:so(a)}}}default:return{}}}}},ao=new Set(["left","top"]);async function Pa(e,t){const{placement:r,platform:o,elements:n}=e,s=await(o.isRTL==null?void 0:o.isRTL(n.floating)),a=ye(r),i=Fe(r),c=fe(r)==="y",d=ao.has(a)?-1:1,f=s&&c?-1:1,p=be(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&typeof b=="number"&&(h=i==="end"?b*-1:b),c?{x:h*f,y:g*d}:{x:g*d,y:h*f}}const Na=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;const{x:n,y:s,placement:a,middlewareData:i}=t,c=await Pa(t,e);return a===((r=i.offset)==null?void 0:r.placement)&&(o=i.arrow)!=null&&o.alignmentOffset?{}:{x:n+c.x,y:s+c.y,data:{...c,placement:a}}}}},ka=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:o,placement:n}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:i={fn:v=>{let{x:y,y:w}=v;return{x:y,y:w}}},...c}=be(e,t),d={x:r,y:o},f=await Ze(t,c),p=fe(ye(n)),g=Yt(p);let h=d[g],b=d[p];if(s){const v=g==="y"?"top":"left",y=g==="y"?"bottom":"right",w=h+f[v],x=h-f[y];h=Kt(w,h,x)}if(a){const v=p==="y"?"top":"left",y=p==="y"?"bottom":"right",w=b+f[v],x=b-f[y];b=Kt(w,b,x)}const m=i.fn({...t,[g]:h,[p]:b});return{...m,data:{x:m.x-r,y:m.y-o,enabled:{[g]:s,[p]:a}}}}}},Aa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:o,placement:n,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:c=!0,crossAxis:d=!0}=be(e,t),f={x:r,y:o},p=fe(n),g=Yt(p);let h=f[g],b=f[p];const m=be(i,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const x=g==="y"?"height":"width",C=s.reference[g]-s.floating[x]+v.mainAxis,k=s.reference[g]+s.reference[x]-v.mainAxis;h<C?h=C:h>k&&(h=k)}if(d){var y,w;const x=g==="y"?"width":"height",C=ao.has(ye(n)),k=s.reference[p]-s.floating[x]+(C&&((y=a.offset)==null?void 0:y[p])||0)+(C?0:v.crossAxis),N=s.reference[p]+s.reference[x]+(C?0:((w=a.offset)==null?void 0:w[p])||0)-(C?v.crossAxis:0);b<k?b=k:b>N&&(b=N)}return{[g]:h,[p]:b}}}},Oa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;const{placement:n,rects:s,platform:a,elements:i}=t,{apply:c=()=>{},...d}=be(e,t),f=await Ze(t,d),p=ye(n),g=Fe(n),h=fe(n)==="y",{width:b,height:m}=s.floating;let v,y;p==="top"||p==="bottom"?(v=p,y=g===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(y=p,v=g==="end"?"top":"bottom");const w=m-f.top-f.bottom,x=b-f.left-f.right,C=Ee(m-f[v],w),k=Ee(b-f[y],x),N=!t.middlewareData.shift;let P=C,S=k;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(S=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(P=w),N&&!g){const E=oe(f.left,0),O=oe(f.right,0),I=oe(f.top,0),L=oe(f.bottom,0);h?S=b-2*(E!==0||O!==0?E+O:oe(f.left,f.right)):P=m-2*(I!==0||L!==0?I+L:oe(f.top,f.bottom))}await c({...t,availableWidth:S,availableHeight:P});const $=await a.getDimensions(i.floating);return b!==$.width||m!==$.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function $e(e){return io(e)?(e.nodeName||"").toLowerCase():"#document"}function ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pe(e){var t;return(t=(io(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function io(e){return ut()?e instanceof Node||e instanceof ne(e).Node:!1}function ie(e){return ut()?e instanceof Element||e instanceof ne(e).Element:!1}function me(e){return ut()?e instanceof HTMLElement||e instanceof ne(e).HTMLElement:!1}function co(e){return!ut()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ne(e).ShadowRoot}const Ia=new Set(["inline","contents"]);function Qe(e){const{overflow:t,overflowX:r,overflowY:o,display:n}=ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!Ia.has(n)}const Ta=new Set(["table","td","th"]);function Ma(e){return Ta.has($e(e))}const _a=[":popover-open",":modal"];function ft(e){return _a.some(t=>{try{return e.matches(t)}catch{return!1}})}const Da=["transform","translate","scale","rotate","perspective"],La=["transform","translate","scale","rotate","perspective","filter"],Fa=["paint","layout","strict","content"];function Qt(e){const t=Jt(),r=ie(e)?ce(e):e;return Da.some(o=>r[o]?r[o]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||La.some(o=>(r.willChange||"").includes(o))||Fa.some(o=>(r.contain||"").includes(o))}function $a(e){let t=Pe(e);for(;me(t)&&!Be(t);){if(Qt(t))return t;if(ft(t))return null;t=Pe(t)}return null}function Jt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ba=new Set(["html","body","#document"]);function Be(e){return Ba.has($e(e))}function ce(e){return ne(e).getComputedStyle(e)}function pt(e){return ie(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pe(e){if($e(e)==="html")return e;const t=e.assignedSlot||e.parentNode||co(e)&&e.host||pe(e);return co(t)?t.host:t}function lo(e){const t=Pe(e);return Be(t)?e.ownerDocument?e.ownerDocument.body:e.body:me(t)&&Qe(t)?t:lo(t)}function Je(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);const n=lo(e),s=n===((o=e.ownerDocument)==null?void 0:o.body),a=ne(n);if(s){const i=er(a);return t.concat(a,a.visualViewport||[],Qe(n)?n:[],i&&r?Je(i):[])}return t.concat(n,Je(n,[],r))}function er(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uo(e){const t=ce(e);let r=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const n=me(e),s=n?e.offsetWidth:r,a=n?e.offsetHeight:o,i=it(r)!==s||it(o)!==a;return i&&(r=s,o=a),{width:r,height:o,$:i}}function tr(e){return ie(e)?e:e.contextElement}function Re(e){const t=tr(e);if(!me(t))return ue(1);const r=t.getBoundingClientRect(),{width:o,height:n,$:s}=uo(t);let a=(s?it(r.width):r.width)/o,i=(s?it(r.height):r.height)/n;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const Ra=ue(0);function fo(e){const t=ne(e);return!Jt()||!t.visualViewport?Ra:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function za(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==ne(e)?!1:t}function Te(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);const n=e.getBoundingClientRect(),s=tr(e);let a=ue(1);t&&(o?ie(o)&&(a=Re(o)):a=Re(e));const i=za(s,r,o)?fo(s):ue(0);let c=(n.left+i.x)/a.x,d=(n.top+i.y)/a.y,f=n.width/a.x,p=n.height/a.y;if(s){const g=ne(s),h=o&&ie(o)?ne(o):o;let b=g,m=er(b);for(;m&&o&&h!==b;){const v=Re(m),y=m.getBoundingClientRect(),w=ce(m),x=y.left+(m.clientLeft+parseFloat(w.paddingLeft))*v.x,C=y.top+(m.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,d*=v.y,f*=v.x,p*=v.y,c+=x,d+=C,b=ne(m),m=er(b)}}return dt({width:f,height:p,x:c,y:d})}function mt(e,t){const r=pt(e).scrollLeft;return t?t.left+r:Te(pe(e)).left+r}function po(e,t){const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-mt(e,r),n=r.top+t.scrollTop;return{x:o,y:n}}function Wa(e){let{elements:t,rect:r,offsetParent:o,strategy:n}=e;const s=n==="fixed",a=pe(o),i=t?ft(t.floating):!1;if(o===a||i&&s)return r;let c={scrollLeft:0,scrollTop:0},d=ue(1);const f=ue(0),p=me(o);if((p||!p&&!s)&&(($e(o)!=="body"||Qe(a))&&(c=pt(o)),me(o))){const h=Te(o);d=Re(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}const g=a&&!p&&!s?po(a,c):ue(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+f.x+g.x,y:r.y*d.y-c.scrollTop*d.y+f.y+g.y}}function Va(e){return Array.from(e.getClientRects())}function Ha(e){const t=pe(e),r=pt(e),o=e.ownerDocument.body,n=oe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=oe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-r.scrollLeft+mt(e);const i=-r.scrollTop;return ce(o).direction==="rtl"&&(a+=oe(t.clientWidth,o.clientWidth)-n),{width:n,height:s,x:a,y:i}}const mo=25;function Ua(e,t){const r=ne(e),o=pe(e),n=r.visualViewport;let s=o.clientWidth,a=o.clientHeight,i=0,c=0;if(n){s=n.width,a=n.height;const f=Jt();(!f||f&&t==="fixed")&&(i=n.offsetLeft,c=n.offsetTop)}const d=mt(o);if(d<=0){const f=o.ownerDocument,p=f.body,g=getComputedStyle(p),h=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(o.clientWidth-p.clientWidth-h);b<=mo&&(s-=b)}else d<=mo&&(s+=d);return{width:s,height:a,x:i,y:c}}const ja=new Set(["absolute","fixed"]);function Ga(e,t){const r=Te(e,!0,t==="fixed"),o=r.top+e.clientTop,n=r.left+e.clientLeft,s=me(e)?Re(e):ue(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,c=n*s.x,d=o*s.y;return{width:a,height:i,x:c,y:d}}function ho(e,t,r){let o;if(t==="viewport")o=Ua(e,r);else if(t==="document")o=Ha(pe(e));else if(ie(t))o=Ga(t,r);else{const n=fo(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return dt(o)}function go(e,t){const r=Pe(e);return r===t||!ie(r)||Be(r)?!1:ce(r).position==="fixed"||go(r,t)}function Ka(e,t){const r=t.get(e);if(r)return r;let o=Je(e,[],!1).filter(i=>ie(i)&&$e(i)!=="body"),n=null;const s=ce(e).position==="fixed";let a=s?Pe(e):e;for(;ie(a)&&!Be(a);){const i=ce(a),c=Qt(a);!c&&i.position==="fixed"&&(n=null),(s?!c&&!n:!c&&i.position==="static"&&!!n&&ja.has(n.position)||Qe(a)&&!c&&go(e,a))?o=o.filter(f=>f!==a):n=i,a=Pe(a)}return t.set(e,o),o}function Ya(e){let{element:t,boundary:r,rootBoundary:o,strategy:n}=e;const a=[...r==="clippingAncestors"?ft(t)?[]:Ka(t,this._c):[].concat(r),o],i=a[0],c=a.reduce((d,f)=>{const p=ho(t,f,n);return d.top=oe(p.top,d.top),d.right=Ee(p.right,d.right),d.bottom=Ee(p.bottom,d.bottom),d.left=oe(p.left,d.left),d},ho(t,i,n));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function qa(e){const{width:t,height:r}=uo(e);return{width:t,height:r}}function Xa(e,t,r){const o=me(t),n=pe(t),s=r==="fixed",a=Te(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const c=ue(0);function d(){c.x=mt(n)}if(o||!o&&!s)if(($e(t)!=="body"||Qe(n))&&(i=pt(t)),o){const h=Te(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else n&&d();s&&!o&&n&&d();const f=n&&!o&&!s?po(n,i):ue(0),p=a.left+i.scrollLeft-c.x-f.x,g=a.top+i.scrollTop-c.y-f.y;return{x:p,y:g,width:a.width,height:a.height}}function rr(e){return ce(e).position==="static"}function vo(e,t){if(!me(e)||ce(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return pe(e)===r&&(r=r.ownerDocument.body),r}function bo(e,t){const r=ne(e);if(ft(e))return r;if(!me(e)){let n=Pe(e);for(;n&&!Be(n);){if(ie(n)&&!rr(n))return n;n=Pe(n)}return r}let o=vo(e,t);for(;o&&Ma(o)&&rr(o);)o=vo(o,t);return o&&Be(o)&&rr(o)&&!Qt(o)?r:o||$a(e)||r}const Za=async function(e){const t=this.getOffsetParent||bo,r=this.getDimensions,o=await r(e.floating);return{reference:Xa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Qa(e){return ce(e).direction==="rtl"}const Ja={convertOffsetParentRelativeRectToViewportRelativeRect:Wa,getDocumentElement:pe,getClippingRect:Ya,getOffsetParent:bo,getElementRects:Za,getClientRects:Va,getDimensions:qa,getScale:Re,isElement:ie,isRTL:Qa};function yo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ei(e,t){let r=null,o;const n=pe(e);function s(){var i;clearTimeout(o),(i=r)==null||i.disconnect(),r=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:f,top:p,width:g,height:h}=d;if(i||t(),!g||!h)return;const b=ct(p),m=ct(n.clientWidth-(f+g)),v=ct(n.clientHeight-(p+h)),y=ct(f),x={rootMargin:-b+"px "+-m+"px "+-v+"px "+-y+"px",threshold:oe(0,Ee(1,c))||1};let C=!0;function k(N){const P=N[0].intersectionRatio;if(P!==c){if(!C)return a();P?a(!1,P):o=setTimeout(()=>{a(!1,1e-7)},1e3)}P===1&&!yo(d,e.getBoundingClientRect())&&a(),C=!1}try{r=new IntersectionObserver(k,{...x,root:n.ownerDocument})}catch{r=new IntersectionObserver(k,x)}r.observe(e)}return a(!0),s}function ti(e,t,r,o){o===void 0&&(o={});const{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=tr(e),f=n||s?[...d?Je(d):[],...Je(t)]:[];f.forEach(y=>{n&&y.addEventListener("scroll",r,{passive:!0}),s&&y.addEventListener("resize",r)});const p=d&&i?ei(d,r):null;let g=-1,h=null;a&&(h=new ResizeObserver(y=>{let[w]=y;w&&w.target===d&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),r()}),d&&!c&&h.observe(d),h.observe(t));let b,m=c?Te(e):null;c&&v();function v(){const y=Te(e);m&&!yo(m,y)&&r(),m=y,b=requestAnimationFrame(v)}return r(),()=>{var y;f.forEach(w=>{n&&w.removeEventListener("scroll",r),s&&w.removeEventListener("resize",r)}),p?.(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(b)}}const ri=Na,oi=ka,ni=Ca,si=Oa,ai=Ea,wo=Sa,ii=Aa,ci=(e,t,r)=>{const o=new Map,n={platform:Ja,...r},s={...n.platform,_c:o};return xa(e,t,{...n,platform:s})};var li=typeof document<"u",di=function(){},ht=li?V.useLayoutEffect:di;function gt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,o,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!gt(e[o],t[o]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,n[o]))return!1;for(o=r;o--!==0;){const s=n[o];if(!(s==="_owner"&&e.$$typeof)&&!gt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function xo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function So(e,t){const r=xo(e);return Math.round(t*r)/r}function or(e){const t=u.useRef(e);return ht(()=>{t.current=e}),t}function ui(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:n,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:c,open:d}=e,[f,p]=u.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[g,h]=u.useState(o);gt(g,o)||h(o);const[b,m]=u.useState(null),[v,y]=u.useState(null),w=u.useCallback(A=>{A!==N.current&&(N.current=A,m(A))},[]),x=u.useCallback(A=>{A!==P.current&&(P.current=A,y(A))},[]),C=s||b,k=a||v,N=u.useRef(null),P=u.useRef(null),S=u.useRef(f),$=c!=null,E=or(c),O=or(n),I=or(d),L=u.useCallback(()=>{if(!N.current||!P.current)return;const A={placement:t,strategy:r,middleware:g};O.current&&(A.platform=O.current),ci(N.current,P.current,A).then(U=>{const J={...U,isPositioned:I.current!==!1};B.current&&!gt(S.current,J)&&(S.current=J,at.flushSync(()=>{p(J)}))})},[g,t,r,O,I]);ht(()=>{d===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,p(A=>({...A,isPositioned:!1})))},[d]);const B=u.useRef(!1);ht(()=>(B.current=!0,()=>{B.current=!1}),[]),ht(()=>{if(C&&(N.current=C),k&&(P.current=k),C&&k){if(E.current)return E.current(C,k,L);L()}},[C,k,L,E,$]);const T=u.useMemo(()=>({reference:N,floating:P,setReference:w,setFloating:x}),[w,x]),F=u.useMemo(()=>({reference:C,floating:k}),[C,k]),R=u.useMemo(()=>{const A={position:r,left:0,top:0};if(!F.floating)return A;const U=So(F.floating,f.x),J=So(F.floating,f.y);return i?{...A,transform:"translate("+U+"px, "+J+"px)",...xo(F.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:U,top:J}},[r,i,F.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:L,refs:T,elements:F,floatingStyles:R}),[f,L,T,F,R])}const fi=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:o,padding:n}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?wo({element:o.current,padding:n}).fn(r):{}:o?wo({element:o,padding:n}).fn(r):{}}}},pi=(e,t)=>({...ri(e),options:[e,t]}),mi=(e,t)=>({...oi(e),options:[e,t]}),hi=(e,t)=>({...ii(e),options:[e,t]}),gi=(e,t)=>({...ni(e),options:[e,t]}),vi=(e,t)=>({...si(e),options:[e,t]}),bi=(e,t)=>({...ai(e),options:[e,t]}),yi=(e,t)=>({...fi(e),options:[e,t]});var wi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xi=wi.reduce((e,t)=>{const r=re(`Primitive.${t}`),o=u.forwardRef((n,s)=>{const{asChild:a,...i}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Si="Arrow",Co=u.forwardRef((e,t)=>{const{children:r,width:o=10,height:n=5,...s}=e;return l.jsx(xi.svg,{...s,ref:t,width:o,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Co.displayName=Si;var Ci=Co,Ei=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Eo=Ei.reduce((e,t)=>{const r=re(`Primitive.${t}`),o=u.forwardRef((n,s)=>{const{asChild:a,...i}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Po(e){const[t,r]=u.useState(void 0);return ee(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const s=n[0];let a,i;if("borderBoxSize"in s){const c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;r({width:a,height:i})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var nr="Popper",[No,vt]=Ie(nr),[Pi,ko]=No(nr),Ao=e=>{const{__scopePopper:t,children:r}=e,[o,n]=u.useState(null);return l.jsx(Pi,{scope:t,anchor:o,onAnchorChange:n,children:r})};Ao.displayName=nr;var Oo="PopperAnchor",Io=u.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:o,...n}=e,s=ko(Oo,r),a=u.useRef(null),i=Y(t,a),c=u.useRef(null);return u.useEffect(()=>{const d=c.current;c.current=o?.current||a.current,d!==c.current&&s.onAnchorChange(c.current)}),o?null:l.jsx(Eo.div,{...n,ref:i})});Io.displayName=Oo;var sr="PopperContent",[Ni,ki]=No(sr),To=u.forwardRef((e,t)=>{const{__scopePopper:r,side:o="bottom",sideOffset:n=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:h="optimized",onPlaced:b,...m}=e,v=ko(sr,r),[y,w]=u.useState(null),x=Y(t,M=>w(M)),[C,k]=u.useState(null),N=Po(C),P=N?.width??0,S=N?.height??0,$=o+(s!=="center"?"-"+s:""),E=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},O=Array.isArray(d)?d:[d],I=O.length>0,L={padding:E,boundary:O.filter(Oi),altBoundary:I},{refs:B,floatingStyles:T,placement:F,isPositioned:R,middlewareData:A}=ui({strategy:"fixed",placement:$,whileElementsMounted:(...M)=>ti(...M,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[pi({mainAxis:n+S,alignmentAxis:a}),c&&mi({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?hi():void 0,...L}),c&&gi({...L}),vi({...L,apply:({elements:M,rects:G,availableWidth:Z,availableHeight:H})=>{const{width:j,height:K}=G.reference,ae=M.floating.style;ae.setProperty("--radix-popper-available-width",`${Z}px`),ae.setProperty("--radix-popper-available-height",`${H}px`),ae.setProperty("--radix-popper-anchor-width",`${j}px`),ae.setProperty("--radix-popper-anchor-height",`${K}px`)}}),C&&yi({element:C,padding:i}),Ii({arrowWidth:P,arrowHeight:S}),g&&bi({strategy:"referenceHidden",...L})]}),[U,J]=Do(F),ge=Se(b);ee(()=>{R&&ge?.()},[R,ge]);const xe=A.arrow?.x,X=A.arrow?.y,q=A.arrow?.centerOffset!==0,[de,ve]=u.useState();return ee(()=>{y&&ve(window.getComputedStyle(y).zIndex)},[y]),l.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:R?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Ni,{scope:r,placedSide:U,onArrowChange:k,arrowX:xe,arrowY:X,shouldHideArrow:q,children:l.jsx(Eo.div,{"data-side":U,"data-align":J,...m,ref:x,style:{...m.style,animation:R?void 0:"none"}})})})});To.displayName=sr;var Mo="PopperArrow",Ai={top:"bottom",right:"left",bottom:"top",left:"right"},_o=u.forwardRef(function(t,r){const{__scopePopper:o,...n}=t,s=ki(Mo,o),a=Ai[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]: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:l.jsx(Ci,{...n,ref:r,style:{...n.style,display:"block"}})})});_o.displayName=Mo;function Oi(e){return e!==null}var Ii=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:o,middlewareData:n}=t,a=n.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,f]=Do(r),p={start:"0%",center:"50%",end:"100%"}[f],g=(n.arrow?.x??0)+i/2,h=(n.arrow?.y??0)+c/2;let b="",m="";return d==="bottom"?(b=a?p:`${g}px`,m=`${-c}px`):d==="top"?(b=a?p:`${g}px`,m=`${o.floating.height+c}px`):d==="right"?(b=`${-c}px`,m=a?p:`${h}px`):d==="left"&&(b=`${o.floating.width+c}px`,m=a?p:`${h}px`),{data:{x:b,y:m}}}});function Do(e){const[t,r="center"]=e.split("-");return[t,r]}var Lo=Ao,ar=Io,Fo=To,$o=_o,Ti=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Mi=Ti.reduce((e,t)=>{const r=re(`Primitive.${t}`),o=u.forwardRef((n,s)=>{const{asChild:a,...i}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),_i="Portal",ir=u.forwardRef((e,t)=>{const{container:r,...o}=e,[n,s]=u.useState(!1);ee(()=>s(!0),[]);const a=r||n&&globalThis?.document?.body;return a?Fr.createPortal(l.jsx(Mi.div,{...o,ref:t}),a):null});ir.displayName=_i;var Di=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],se=Di.reduce((e,t)=>{const r=re(`Primitive.${t}`),o=u.forwardRef((n,s)=>{const{asChild:a,...i}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Li=u[" useInsertionEffect ".trim().toString()]||ee;function et({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[n,s,a]=Fi({defaultProp:t,onChange:r}),i=e!==void 0,c=i?e:n;{const f=u.useRef(e!==void 0);u.useEffect(()=>{const p=f.current;p!==i&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=i},[i,o])}const d=u.useCallback(f=>{if(i){const p=$i(f)?f(e):f;p!==e&&a.current?.(p)}else s(f)},[i,e,s,a]);return[c,d]}function Fi({defaultProp:e,onChange:t}){const[r,o]=u.useState(e),n=u.useRef(r),s=u.useRef(t);return Li(()=>{s.current=t},[t]),u.useEffect(()=>{n.current!==r&&(s.current?.(r),n.current=r)},[r,n]),[r,o,s]}function $i(e){return typeof e=="function"}function Bo(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])}var Bi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ri=Bi.reduce((e,t)=>{const r=re(`Primitive.${t}`),o=u.forwardRef((n,s)=>{const{asChild:a,...i}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Ro=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"}),zi="VisuallyHidden",Wi=u.forwardRef((e,t)=>l.jsx(Ri.span,{...e,ref:t,style:{...Ro,...e.style}}));Wi.displayName=zi;var Vi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ze=new WeakMap,bt=new WeakMap,yt={},cr=0,zo=function(e){return e&&(e.host||zo(e.parentNode))},Hi=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=zo(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Ui=function(e,t,r,o){var n=Hi(t,Array.isArray(e)?e:[e]);yt[r]||(yt[r]=new WeakMap);var s=yt[r],a=[],i=new Set,c=new Set(n),d=function(p){!p||i.has(p)||(i.add(p),d(p.parentNode))};n.forEach(d);var f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(g){if(i.has(g))f(g);else try{var h=g.getAttribute(o),b=h!==null&&h!=="false",m=(ze.get(g)||0)+1,v=(s.get(g)||0)+1;ze.set(g,m),s.set(g,v),a.push(g),m===1&&b&&bt.set(g,!0),v===1&&g.setAttribute(r,"true"),b||g.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",g,y)}})};return f(t),i.clear(),cr++,function(){a.forEach(function(p){var g=ze.get(p)-1,h=s.get(p)-1;ze.set(p,g),s.set(p,h),g||(bt.has(p)||p.removeAttribute(o),bt.delete(p)),h||p.removeAttribute(r)}),cr--,cr||(ze=new WeakMap,ze=new WeakMap,bt=new WeakMap,yt={})}},Wo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),n=Vi(e);return n?(o.push.apply(o,Array.from(n.querySelectorAll("[aria-live], script"))),Ui(o,n,r,"aria-hidden")):function(){return null}},he=function(){return he=Object.assign||function(t){for(var r,o=1,n=arguments.length;o<n;o++){r=arguments[o];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},he.apply(this,arguments)};function Vo(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r}function ji(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,s;o<n;o++)(s||!(o in t))&&(s||(s=Array.prototype.slice.call(t,0,o)),s[o]=t[o]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var wt="right-scroll-bar-position",xt="width-before-scroll-bar",Gi="with-scroll-bars-hidden",Ki="--removed-body-scroll-bar-size";function lr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yi(e,t){var r=V.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var n=r.value;n!==o&&(r.value=o,r.callback(o,n))}}}})[0];return r.callback=t,r.facade}var qi=typeof window<"u"?u.useLayoutEffect:u.useEffect,Ho=new WeakMap;function Xi(e,t){var r=Yi(null,function(o){return e.forEach(function(n){return lr(n,o)})});return qi(function(){var o=Ho.get(r);if(o){var n=new Set(o),s=new Set(e),a=r.current;n.forEach(function(i){s.has(i)||lr(i,null)}),s.forEach(function(i){n.has(i)||lr(i,a)})}Ho.set(r,e)},[e]),r}function Zi(e){return e}function Qi(e,t){t===void 0&&(t=Zi);var r=[],o=!1,n={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var a=t(s,o);return r.push(a),function(){r=r.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(o=!0;r.length;){var a=r;r=[],a.forEach(s)}r={push:function(i){return s(i)},filter:function(){return r}}},assignMedium:function(s){o=!0;var a=[];if(r.length){var i=r;r=[],i.forEach(s),a=r}var c=function(){var f=a;a=[],f.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(f){a.push(f),d()},filter:function(f){return a=a.filter(f),r}}}};return n}function Ji(e){e===void 0&&(e={});var t=Qi(null);return t.options=he({async:!0,ssr:!1},e),t}var Uo=function(e){var t=e.sideCar,r=Vo(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return u.createElement(o,he({},r))};Uo.isSideCarExport=!0;function ec(e,t){return e.useMedium(t),Uo}var jo=Ji(),dr=function(){},St=u.forwardRef(function(e,t){var r=u.useRef(null),o=u.useState({onScrollCapture:dr,onWheelCapture:dr,onTouchMoveCapture:dr}),n=o[0],s=o[1],a=e.forwardProps,i=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,p=e.shards,g=e.sideCar,h=e.noRelative,b=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,x=e.gapMode,C=Vo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=g,N=Xi([r,t]),P=he(he({},C),n);return u.createElement(u.Fragment,null,f&&u.createElement(k,{sideCar:jo,removeScrollBar:d,shards:p,noRelative:h,noIsolation:b,inert:m,setCallbacks:s,allowPinchZoom:!!v,lockRef:r,gapMode:x}),a?u.cloneElement(u.Children.only(i),he(he({},P),{ref:N})):u.createElement(w,he({},P,{className:c,ref:N}),i))});St.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},St.classNames={fullWidth:xt,zeroRight:wt};var tc=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rc(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tc();return t&&e.setAttribute("nonce",t),e}function oc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function nc(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sc=function(){var e=0,t=null;return{add:function(r){e==0&&(t=rc())&&(oc(t,r),nc(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ac=function(){var e=sc();return function(t,r){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Go=function(){var e=ac(),t=function(r){var o=r.styles,n=r.dynamic;return e(o,n),null};return t},ic={left:0,top:0,right:0,gap:0},ur=function(e){return parseInt(e||"",10)||0},cc=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],n=t[e==="padding"?"paddingRight":"marginRight"];return[ur(r),ur(o),ur(n)]},lc=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ic;var t=cc(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},dc=Go(),We="data-scroll-locked",uc=function(e,t,r,o){var n=e.left,s=e.top,a=e.right,i=e.gap;return r===void 0&&(r="margin"),`
2
+ .`.concat(Gi,` {
3
+ overflow: hidden `).concat(o,`;
4
+ padding-right: `).concat(i,"px ").concat(o,`;
5
5
  }
6
- body[`).concat(ze,`] {
7
- overflow: hidden `).concat(n,`;
6
+ body[`).concat(We,`] {
7
+ overflow: hidden `).concat(o,`;
8
8
  overscroll-behavior: contain;
9
- `).concat([t&&"position: relative ".concat(n,";"),o==="margin"&&`
10
- padding-left: `.concat(r,`px;
9
+ `).concat([t&&"position: relative ".concat(o,";"),r==="margin"&&`
10
+ padding-left: `.concat(n,`px;
11
11
  padding-top: `).concat(s,`px;
12
12
  padding-right: `).concat(a,`px;
13
13
  margin-left:0;
14
14
  margin-top:0;
15
- margin-right: `).concat(i,"px ").concat(n,`;
16
- `),o==="padding"&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),`
15
+ margin-right: `).concat(i,"px ").concat(o,`;
16
+ `),r==="padding"&&"padding-right: ".concat(i,"px ").concat(o,";")].filter(Boolean).join(""),`
17
17
  }
18
18
 
19
19
  .`).concat(wt,` {
20
- right: `).concat(i,"px ").concat(n,`;
20
+ right: `).concat(i,"px ").concat(o,`;
21
21
  }
22
22
 
23
23
  .`).concat(xt,` {
24
- margin-right: `).concat(i,"px ").concat(n,`;
24
+ margin-right: `).concat(i,"px ").concat(o,`;
25
25
  }
26
26
 
27
27
  .`).concat(wt," .").concat(wt,` {
28
- right: 0 `).concat(n,`;
28
+ right: 0 `).concat(o,`;
29
29
  }
30
30
 
31
31
  .`).concat(xt," .").concat(xt,` {
32
- margin-right: 0 `).concat(n,`;
32
+ margin-right: 0 `).concat(o,`;
33
33
  }
34
34
 
35
- body[`).concat(ze,`] {
36
- `).concat(Mi,": ").concat(i,`px;
35
+ body[`).concat(We,`] {
36
+ `).concat(Ki,": ").concat(i,`px;
37
37
  }
38
- `)},jn=function(){var e=parseInt(document.body.getAttribute(ze)||"0",10);return isFinite(e)?e:0},Zi=function(){u.useEffect(function(){return document.body.setAttribute(ze,(jn()+1).toString()),function(){var e=jn()-1;e<=0?document.body.removeAttribute(ze):document.body.setAttribute(ze,e.toString())}},[])},Qi=function(e){var t=e.noRelative,o=e.noImportant,n=e.gapMode,r=n===void 0?"margin":n;Zi();var s=u.useMemo(function(){return Yi(r)},[r]);return u.createElement(qi,{styles:Xi(s,!t,r,o?"":"!important")})},fo=!1;if(typeof window<"u")try{var St=Object.defineProperty({},"passive",{get:function(){return fo=!0,!0}});window.addEventListener("test",St,St),window.removeEventListener("test",St,St)}catch{fo=!1}var We=fo?{passive:!1}:!1,Ji=function(e){return e.tagName==="TEXTAREA"},Gn=function(e,t){if(!(e instanceof Element))return!1;var o=window.getComputedStyle(e);return o[t]!=="hidden"&&!(o.overflowY===o.overflowX&&!Ji(e)&&o[t]==="visible")},ec=function(e){return Gn(e,"overflowY")},tc=function(e){return Gn(e,"overflowX")},Kn=function(e,t){var o=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Yn(e,n);if(r){var s=qn(e,n),a=s[1],i=s[2];if(a>i)return!0}n=n.parentNode}while(n&&n!==o.body);return!1},oc=function(e){var t=e.scrollTop,o=e.scrollHeight,n=e.clientHeight;return[t,o,n]},nc=function(e){var t=e.scrollLeft,o=e.scrollWidth,n=e.clientWidth;return[t,o,n]},Yn=function(e,t){return e==="v"?ec(t):tc(t)},qn=function(e,t){return e==="v"?oc(t):nc(t)},rc=function(e,t){return e==="h"&&t==="rtl"?-1:1},sc=function(e,t,o,n,r){var s=rc(e,window.getComputedStyle(t).direction),a=s*n,i=o.target,c=t.contains(i),d=!1,f=a>0,m=0,g=0;do{if(!i)break;var h=qn(e,i),b=h[0],p=h[1],v=h[2],y=p-v-s*b;(b||y)&&Yn(e,i)&&(m+=y,g+=b);var w=i.parentNode;i=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(f&&Math.abs(m)<1||!f&&Math.abs(g)<1)&&(d=!0),d},Et=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Xn=function(e){return[e.deltaX,e.deltaY]},Zn=function(e){return e&&"current"in e?e.current:e},ac=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ic=function(e){return`
38
+ `)},Ko=function(){var e=parseInt(document.body.getAttribute(We)||"0",10);return isFinite(e)?e:0},fc=function(){u.useEffect(function(){return document.body.setAttribute(We,(Ko()+1).toString()),function(){var e=Ko()-1;e<=0?document.body.removeAttribute(We):document.body.setAttribute(We,e.toString())}},[])},pc=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,n=o===void 0?"margin":o;fc();var s=u.useMemo(function(){return lc(n)},[n]);return u.createElement(dc,{styles:uc(s,!t,n,r?"":"!important")})},fr=!1;if(typeof window<"u")try{var Ct=Object.defineProperty({},"passive",{get:function(){return fr=!0,!0}});window.addEventListener("test",Ct,Ct),window.removeEventListener("test",Ct,Ct)}catch{fr=!1}var Ve=fr?{passive:!1}:!1,mc=function(e){return e.tagName==="TEXTAREA"},Yo=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!mc(e)&&r[t]==="visible")},hc=function(e){return Yo(e,"overflowY")},gc=function(e){return Yo(e,"overflowX")},qo=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var n=Xo(e,o);if(n){var s=Zo(e,o),a=s[1],i=s[2];if(a>i)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},vc=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},bc=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},Xo=function(e,t){return e==="v"?hc(t):gc(t)},Zo=function(e,t){return e==="v"?vc(t):bc(t)},yc=function(e,t){return e==="h"&&t==="rtl"?-1:1},wc=function(e,t,r,o,n){var s=yc(e,window.getComputedStyle(t).direction),a=s*o,i=r.target,c=t.contains(i),d=!1,f=a>0,p=0,g=0;do{if(!i)break;var h=Zo(e,i),b=h[0],m=h[1],v=h[2],y=m-v-s*b;(b||y)&&Xo(e,i)&&(p+=y,g+=b);var w=i.parentNode;i=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(f&&Math.abs(p)<1||!f&&Math.abs(g)<1)&&(d=!0),d},Et=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qo=function(e){return[e.deltaX,e.deltaY]},Jo=function(e){return e&&"current"in e?e.current:e},xc=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Sc=function(e){return`
39
39
  .block-interactivity-`.concat(e,` {pointer-events: none;}
40
40
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
- `)},cc=0,Ve=[];function lc(e){var t=u.useRef([]),o=u.useRef([0,0]),n=u.useRef(),r=u.useState(cc++)[0],s=u.useState(Un)[0],a=u.useRef(e);u.useEffect(function(){a.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var p=Ii([e.lockRef.current],(e.shards||[]).map(Zn),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var i=u.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var y=Et(p),w=o.current,x="deltaX"in p?p.deltaX:w[0]-y[0],S="deltaY"in p?p.deltaY:w[1]-y[1],N,P=p.target,k=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in p&&k==="h"&&P.type==="range")return!1;var C=Kn(k,P);if(!C)return!0;if(C?N=k:(N=k==="v"?"h":"v",C=Kn(k,P)),!C)return!1;if(!n.current&&"changedTouches"in p&&(x||S)&&(n.current=N),!N)return!0;var F=n.current||N;return sc(F,v,p,F==="h"?x:S)},[]),c=u.useCallback(function(p){var v=p;if(!(!Ve.length||Ve[Ve.length-1]!==s)){var y="deltaY"in v?Xn(v):Et(v),w=t.current.filter(function(N){return N.name===v.type&&(N.target===v.target||v.target===N.shadowParent)&&ac(N.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var x=(a.current.shards||[]).map(Zn).filter(Boolean).filter(function(N){return N.contains(v.target)}),S=x.length>0?i(v,x[0]):!a.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),d=u.useCallback(function(p,v,y,w){var x={name:p,delta:v,target:y,should:w,shadowParent:dc(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),f=u.useCallback(function(p){o.current=Et(p),n.current=void 0},[]),m=u.useCallback(function(p){d(p.type,Xn(p),p.target,i(p,e.lockRef.current))},[]),g=u.useCallback(function(p){d(p.type,Et(p),p.target,i(p,e.lockRef.current))},[]);u.useEffect(function(){return Ve.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",c,We),document.addEventListener("touchmove",c,We),document.addEventListener("touchstart",f,We),function(){Ve=Ve.filter(function(p){return p!==s}),document.removeEventListener("wheel",c,We),document.removeEventListener("touchmove",c,We),document.removeEventListener("touchstart",f,We)}},[]);var h=e.removeScrollBar,b=e.inert;return u.createElement(u.Fragment,null,b?u.createElement(s,{styles:ic(r)}):null,h?u.createElement(Qi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dc(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const uc=Bi(Hn,lc);var po=u.forwardRef(function(e,t){return u.createElement(Ct,me({},e,{ref:t,sideCar:uc}))});po.classNames=Ct.classNames;var fc=[" ","Enter","ArrowUp","ArrowDown"],pc=[" ","Enter"],Te="Select",[kt,Pt,mc]=Wo(Te),[He]=Oe(Te,[mc,vt]),Nt=vt(),[hc,ke]=He(Te),[gc,vc]=He(Te),Qn=e=>{const{__scopeSelect:t,children:o,open:n,defaultOpen:r,onOpenChange:s,value:a,defaultValue:i,onValueChange:c,dir:d,name:f,autoComplete:m,disabled:g,required:h,form:b}=e,p=Nt(t),[v,y]=u.useState(null),[w,x]=u.useState(null),[S,N]=u.useState(!1),P=Bt(d),[k,C]=et({prop:n,defaultProp:r??!1,onChange:s,caller:Te}),[F,E]=et({prop:a,defaultProp:i,onChange:c,caller:Te}),O=u.useRef(null),I=v?b||!!v.closest("form"):!0,[L,R]=u.useState(new Set),D=Array.from(L).map($=>$.props.value).join(";");return l.jsx(_n,{...p,children:l.jsxs(hc,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:w,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:N,contentId:Xe(),value:F,onValueChange:E,open:k,onOpenChange:C,dir:P,triggerPointerDownPosRef:O,disabled:g,children:[l.jsx(kt.Provider,{scope:t,children:l.jsx(gc,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback($=>{R(B=>new Set(B).add($))},[]),onNativeOptionRemove:u.useCallback($=>{R(B=>{const A=new Set(B);return A.delete($),A})},[]),children:o})}),I?l.jsxs(Cr,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:m,value:F,onChange:$=>E($.target.value),disabled:g,form:b,children:[F===void 0?l.jsx("option",{value:""}):null,Array.from(L)]},D):null]})})};Qn.displayName=Te;var Jn="SelectTrigger",er=u.forwardRef((e,t)=>{const{__scopeSelect:o,disabled:n=!1,...r}=e,s=Nt(o),a=ke(Jn,o),i=a.disabled||n,c=q(t,a.onTriggerChange),d=Pt(o),f=u.useRef("touch"),[m,g,h]=Er(p=>{const v=d().filter(x=>!x.disabled),y=v.find(x=>x.value===a.value),w=kr(v,p,y);w!==void 0&&a.onValueChange(w.value)}),b=p=>{i||(a.onOpenChange(!0),h()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return l.jsx(so,{asChild:!0,...s,children:l.jsx(U.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Sr(a.value)?"":void 0,...r,ref:c,onClick:W(r.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&b(p)}),onPointerDown:W(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"&&(b(p),p.preventDefault())}),onKeyDown:W(r.onKeyDown,p=>{const v=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&g(p.key),!(v&&p.key===" ")&&fc.includes(p.key)&&(b(),p.preventDefault())})})})});er.displayName=Jn;var tr="SelectValue",or=u.forwardRef((e,t)=>{const{__scopeSelect:o,className:n,style:r,children:s,placeholder:a="",...i}=e,c=ke(tr,o),{onValueNodeHasChildrenChange:d}=c,f=s!==void 0,m=q(t,c.onValueNodeChange);return te(()=>{d(f)},[d,f]),l.jsx(U.span,{...i,ref:m,style:{pointerEvents:"none"},children:Sr(c.value)?l.jsx(l.Fragment,{children:a}):s})});or.displayName=tr;var bc="SelectIcon",nr=u.forwardRef((e,t)=>{const{__scopeSelect:o,children:n,...r}=e;return l.jsx(U.span,{"aria-hidden":!0,...r,ref:t,children:n||"▼"})});nr.displayName=bc;var yc="SelectPortal",rr=e=>l.jsx(ao,{asChild:!0,...e});rr.displayName=yc;var Me="SelectContent",sr=u.forwardRef((e,t)=>{const o=ke(Me,e.__scopeSelect),[n,r]=u.useState();if(te(()=>{r(new DocumentFragment)},[]),!o.open){const s=n;return s?at.createPortal(l.jsx(ar,{scope:e.__scopeSelect,children:l.jsx(kt.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(ir,{...e,ref:t})});sr.displayName=Me;var ce=10,[ar,Pe]=He(Me),wc="SelectContentImpl",xc=qe("SelectContent.RemoveScroll"),ir=u.forwardRef((e,t)=>{const{__scopeSelect:o,position:n="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:c,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:g,collisionPadding:h,sticky:b,hideWhenDetached:p,avoidCollisions:v,...y}=e,w=ke(Me,o),[x,S]=u.useState(null),[N,P]=u.useState(null),k=q(t,T=>S(T)),[C,F]=u.useState(null),[E,O]=u.useState(null),I=Pt(o),[L,R]=u.useState(!1),D=u.useRef(!1);u.useEffect(()=>{if(x)return Bn(x)},[x]),Go();const $=u.useCallback(T=>{const[K,...Q]=I().map(Y=>Y.ref.current),[H]=Q.slice(-1),G=document.activeElement;for(const Y of T)if(Y===G||(Y?.scrollIntoView({block:"nearest"}),Y===K&&N&&(N.scrollTop=0),Y===H&&N&&(N.scrollTop=N.scrollHeight),Y?.focus(),document.activeElement!==G))return},[I,N]),B=u.useCallback(()=>$([C,x]),[$,C,x]);u.useEffect(()=>{L&&B()},[L,B]);const{onOpenChange:A,triggerPointerDownPosRef:j}=w;u.useEffect(()=>{if(x){let T={x:0,y:0};const K=H=>{T={x:Math.abs(Math.round(H.pageX)-(j.current?.x??0)),y:Math.abs(Math.round(H.pageY)-(j.current?.y??0))}},Q=H=>{T.x<=10&&T.y<=10?H.preventDefault():x.contains(H.target)||A(!1),document.removeEventListener("pointermove",K),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",K),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",Q,{capture:!0})}}},[x,A,j]),u.useEffect(()=>{const T=()=>A(!1);return window.addEventListener("blur",T),window.addEventListener("resize",T),()=>{window.removeEventListener("blur",T),window.removeEventListener("resize",T)}},[A]);const[ee,he]=Er(T=>{const K=I().filter(G=>!G.disabled),Q=K.find(G=>G.ref.current===document.activeElement),H=kr(K,T,Q);H&&setTimeout(()=>H.ref.current.focus())}),we=u.useCallback((T,K,Q)=>{const H=!D.current&&!Q;(w.value!==void 0&&w.value===K||H)&&(F(T),H&&(D.current=!0))},[w.value]),Z=u.useCallback(()=>x?.focus(),[x]),X=u.useCallback((T,K,Q)=>{const H=!D.current&&!Q;(w.value!==void 0&&w.value===K||H)&&O(T)},[w.value]),le=n==="popper"?mo:cr,ge=le===mo?{side:i,sideOffset:c,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:g,collisionPadding:h,sticky:b,hideWhenDetached:p,avoidCollisions:v}:{};return l.jsx(ar,{scope:o,content:x,viewport:N,onViewportChange:P,itemRefCallback:we,selectedItem:C,onItemLeave:Z,itemTextRefCallback:X,focusSelectedItem:B,selectedItemText:E,position:n,isPositioned:L,searchRef:ee,children:l.jsx(po,{as:xc,allowPinchZoom:!0,children:l.jsx(jt,{asChild:!0,trapped:w.open,onMountAutoFocus:T=>{T.preventDefault()},onUnmountAutoFocus:W(r,T=>{w.trigger?.focus({preventScroll:!0}),T.preventDefault()}),children:l.jsx(Wt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:T=>T.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:l.jsx(le,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:T=>T.preventDefault(),...y,...ge,onPlaced:()=>R(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:W(y.onKeyDown,T=>{const K=T.ctrlKey||T.altKey||T.metaKey;if(T.key==="Tab"&&T.preventDefault(),!K&&T.key.length===1&&he(T.key),["ArrowUp","ArrowDown","Home","End"].includes(T.key)){let H=I().filter(G=>!G.disabled).map(G=>G.ref.current);if(["ArrowUp","End"].includes(T.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(T.key)){const G=T.target,Y=H.indexOf(G);H=H.slice(Y+1)}setTimeout(()=>$(H)),T.preventDefault()}})})})})})})});ir.displayName=wc;var Cc="SelectItemAlignedPosition",cr=u.forwardRef((e,t)=>{const{__scopeSelect:o,onPlaced:n,...r}=e,s=ke(Me,o),a=Pe(Me,o),[i,c]=u.useState(null),[d,f]=u.useState(null),m=q(t,k=>f(k)),g=Pt(o),h=u.useRef(!1),b=u.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:y,focusSelectedItem:w}=a,x=u.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&d&&p&&v&&y){const k=s.trigger.getBoundingClientRect(),C=d.getBoundingClientRect(),F=s.valueNode.getBoundingClientRect(),E=y.getBoundingClientRect();if(s.dir!=="rtl"){const G=E.left-C.left,Y=F.left-G,se=k.left-Y,Le=k.width+se,Mo=Math.max(Le,C.width),_o=window.innerWidth-ce,Lo=Bo(Y,[ce,Math.max(ce,_o-Mo)]);i.style.minWidth=Le+"px",i.style.left=Lo+"px"}else{const G=C.right-E.right,Y=window.innerWidth-F.right-G,se=window.innerWidth-k.right-Y,Le=k.width+se,Mo=Math.max(Le,C.width),_o=window.innerWidth-ce,Lo=Bo(Y,[ce,Math.max(ce,_o-Mo)]);i.style.minWidth=Le+"px",i.style.right=Lo+"px"}const O=g(),I=window.innerHeight-ce*2,L=p.scrollHeight,R=window.getComputedStyle(d),D=parseInt(R.borderTopWidth,10),$=parseInt(R.paddingTop,10),B=parseInt(R.borderBottomWidth,10),A=parseInt(R.paddingBottom,10),j=D+$+L+A+B,ee=Math.min(v.offsetHeight*5,j),he=window.getComputedStyle(p),we=parseInt(he.paddingTop,10),Z=parseInt(he.paddingBottom,10),X=k.top+k.height/2-ce,le=I-X,ge=v.offsetHeight/2,T=v.offsetTop+ge,K=D+$+T,Q=j-K;if(K<=X){const G=O.length>0&&v===O[O.length-1].ref.current;i.style.bottom="0px";const Y=d.clientHeight-p.offsetTop-p.offsetHeight,se=Math.max(le,ge+(G?Z:0)+Y+B),Le=K+se;i.style.height=Le+"px"}else{const G=O.length>0&&v===O[0].ref.current;i.style.top="0px";const se=Math.max(X,D+p.offsetTop+(G?we:0)+ge)+Q;i.style.height=se+"px",p.scrollTop=K-X+p.offsetTop}i.style.margin=`${ce}px 0`,i.style.minHeight=ee+"px",i.style.maxHeight=I+"px",n?.(),requestAnimationFrame(()=>h.current=!0)}},[g,s.trigger,s.valueNode,i,d,p,v,y,s.dir,n]);te(()=>x(),[x]);const[S,N]=u.useState();te(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const P=u.useCallback(k=>{k&&b.current===!0&&(x(),w?.(),b.current=!1)},[x,w]);return l.jsx(Ec,{scope:o,contentWrapper:i,shouldExpandOnScrollRef:h,onScrollButtonChange:P,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(U.div,{...r,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});cr.displayName=Cc;var Sc="SelectPopperPosition",mo=u.forwardRef((e,t)=>{const{__scopeSelect:o,align:n="start",collisionPadding:r=ce,...s}=e,a=Nt(o);return l.jsx(Ln,{...a,...s,ref:t,align:n,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)"}})});mo.displayName=Sc;var[Ec,ho]=He(Me,{}),go="SelectViewport",lr=u.forwardRef((e,t)=>{const{__scopeSelect:o,nonce:n,...r}=e,s=Pe(go,o),a=ho(go,o),i=q(t,s.onViewportChange),c=u.useRef(0);return l.jsxs(l.Fragment,{children:[l.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:n}),l.jsx(kt.Slot,{scope:o,children:l.jsx(U.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:W(r.onScroll,d=>{const f=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:g}=a;if(g?.current&&m){const h=Math.abs(c.current-f.scrollTop);if(h>0){const b=window.innerHeight-ce*2,p=parseFloat(m.style.minHeight),v=parseFloat(m.style.height),y=Math.max(p,v);if(y<b){const w=y+h,x=Math.min(b,w),S=w-x;m.style.height=x+"px",m.style.bottom==="0px"&&(f.scrollTop=S>0?S:0,m.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});lr.displayName=go;var dr="SelectGroup",[kc,Pc]=He(dr),ur=u.forwardRef((e,t)=>{const{__scopeSelect:o,...n}=e,r=Xe();return l.jsx(kc,{scope:o,id:r,children:l.jsx(U.div,{role:"group","aria-labelledby":r,...n,ref:t})})});ur.displayName=dr;var fr="SelectLabel",pr=u.forwardRef((e,t)=>{const{__scopeSelect:o,...n}=e,r=Pc(fr,o);return l.jsx(U.div,{id:r.id,...n,ref:t})});pr.displayName=fr;var At="SelectItem",[Nc,mr]=He(At),hr=u.forwardRef((e,t)=>{const{__scopeSelect:o,value:n,disabled:r=!1,textValue:s,...a}=e,i=ke(At,o),c=Pe(At,o),d=i.value===n,[f,m]=u.useState(s??""),[g,h]=u.useState(!1),b=q(t,w=>c.itemRefCallback?.(w,n,r)),p=Xe(),v=u.useRef("touch"),y=()=>{r||(i.onValueChange(n),i.onOpenChange(!1))};if(n==="")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 l.jsx(Nc,{scope:o,value:n,disabled:r,textId:p,isSelected:d,onItemTextChange:u.useCallback(w=>{m(x=>x||(w?.textContent??"").trim())},[]),children:l.jsx(kt.ItemSlot,{scope:o,value:n,disabled:r,textValue:f,children:l.jsx(U.div,{role:"option","aria-labelledby":p,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:b,onFocus:W(a.onFocus,()=>h(!0)),onBlur:W(a.onBlur,()=>h(!1)),onClick:W(a.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:W(a.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:W(a.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:W(a.onPointerMove,w=>{v.current=w.pointerType,r?c.onItemLeave?.():v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:W(a.onPointerLeave,w=>{w.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:W(a.onKeyDown,w=>{c.searchRef?.current!==""&&w.key===" "||(pc.includes(w.key)&&y(),w.key===" "&&w.preventDefault())})})})})});hr.displayName=At;var tt="SelectItemText",gr=u.forwardRef((e,t)=>{const{__scopeSelect:o,className:n,style:r,...s}=e,a=ke(tt,o),i=Pe(tt,o),c=mr(tt,o),d=vc(tt,o),[f,m]=u.useState(null),g=q(t,y=>m(y),c.onItemTextChange,y=>i.itemTextRefCallback?.(y,c.value,c.disabled)),h=f?.textContent,b=u.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=d;return te(()=>(p(b),()=>v(b)),[p,v,b]),l.jsxs(l.Fragment,{children:[l.jsx(U.span,{id:c.textId,...s,ref:g}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?at.createPortal(s.children,a.valueNode):null]})});gr.displayName=tt;var vr="SelectItemIndicator",Ac=u.forwardRef((e,t)=>{const{__scopeSelect:o,...n}=e;return mr(vr,o).isSelected?l.jsx(U.span,{"aria-hidden":!0,...n,ref:t}):null});Ac.displayName=vr;var vo="SelectScrollUpButton",br=u.forwardRef((e,t)=>{const o=Pe(vo,e.__scopeSelect),n=ho(vo,e.__scopeSelect),[r,s]=u.useState(!1),a=q(t,n.onScrollButtonChange);return te(()=>{if(o.viewport&&o.isPositioned){let i=function(){const d=c.scrollTop>0;s(d)};const c=o.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[o.viewport,o.isPositioned]),r?l.jsx(yr,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=o;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});br.displayName=vo;var bo="SelectScrollDownButton",Oc=u.forwardRef((e,t)=>{const o=Pe(bo,e.__scopeSelect),n=ho(bo,e.__scopeSelect),[r,s]=u.useState(!1),a=q(t,n.onScrollButtonChange);return te(()=>{if(o.viewport&&o.isPositioned){let i=function(){const d=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<d;s(f)};const c=o.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[o.viewport,o.isPositioned]),r?l.jsx(yr,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=o;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});Oc.displayName=bo;var yr=u.forwardRef((e,t)=>{const{__scopeSelect:o,onAutoScroll:n,...r}=e,s=Pe("SelectScrollButton",o),a=u.useRef(null),i=Pt(o),c=u.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),te(()=>{i().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),l.jsx(U.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:W(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:W(r.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:W(r.onPointerLeave,()=>{c()})})}),Ic="SelectSeparator",wr=u.forwardRef((e,t)=>{const{__scopeSelect:o,...n}=e;return l.jsx(U.div,{"aria-hidden":!0,...n,ref:t})});wr.displayName=Ic;var yo="SelectArrow",xr=u.forwardRef((e,t)=>{const{__scopeSelect:o,...n}=e,r=Nt(o),s=ke(yo,o),a=Pe(yo,o);return s.open&&a.position==="popper"?l.jsx(Dn,{...r,...n,ref:t}):null});xr.displayName=yo;var Tc="SelectBubbleInput",Cr=u.forwardRef(({__scopeSelect:e,value:t,...o},n)=>{const r=u.useRef(null),s=q(n,r),a=Fn(t);return u.useEffect(()=>{const i=r.current;if(!i)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&f){const m=new Event("change",{bubbles:!0});f.call(i,t),i.dispatchEvent(m)}},[a,t]),l.jsx(U.select,{...o,style:{...$n,...o.style},ref:s,defaultValue:t})});Cr.displayName=Tc;function Sr(e){return e===""||e===void 0}function Er(e){const t=xe(e),o=u.useRef(""),n=u.useRef(0),r=u.useCallback(a=>{const i=o.current+a;t(i),(function c(d){o.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(i)},[t]),s=u.useCallback(()=>{o.current="",window.clearTimeout(n.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(n.current),[]),[o,r,s]}function kr(e,t,o){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=o?e.indexOf(o):-1;let a=Mc(e,Math.max(s,0));r.length===1&&(a=a.filter(d=>d!==o));const c=a.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==o?c:void 0}function Mc(e,t){return e.map((o,n)=>e[(t+n)%e.length])}var _c=Qn,Lc=er,Dc=or,Fc=nr,$c=rr,Rc=sr,Bc=lr,zc=ur,Wc=pr,Vc=hr,Hc=gr,Uc=br,jc=wr,Pr=xr;const Gc=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Kc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,n)=>n?n.toUpperCase():o.toLowerCase()),Nr=e=>{const t=Kc(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ar=(...e)=>e.filter((t,o,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===o).join(" ").trim(),Yc=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 Xc=V.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:n,className:r="",children:s,iconNode:a,...i},c)=>V.createElement("svg",{ref:c,...qc,width:t,height:t,stroke:e,strokeWidth:n?Number(o)*24/Number(t):o,className:Ar("lucide",r),...!s&&!Yc(i)&&{"aria-hidden":"true"},...i},[...a.map(([d,f])=>V.createElement(d,f)),...Array.isArray(s)?s:[s]]));const Ue=(e,t)=>{const o=V.forwardRef(({className:n,...r},s)=>V.createElement(Xc,{ref:s,iconNode:t,className:Ar(`lucide-${Gc(Nr(e))}`,`lucide-${e}`,n),...r}));return o.displayName=Nr(e),o};const Zc=Ue("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Qc=Ue("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Jc=Ue("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const el=Ue("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const tl=Ue("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const ol=Ue("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);function nl({field:e,formValues:t,handleChange:o,handleBlur:n,error:r}){const s=t[e.name]||"",a=typeof e.disabled=="function"?e.disabled(t):e.disabled,i=e.options||[];return l.jsxs(l.Fragment,{children:[l.jsxs(_c,{value:s,onValueChange:c=>o(e.name,c),disabled:a,children:[l.jsxs(Lc,{id:e.name,onBlur:()=>n(e.name),className:`inline-flex items-center justify-between w-full h-10 rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 bg-background transition-all
42
- ${r?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"}
41
+ `)},Cc=0,He=[];function Ec(e){var t=u.useRef([]),r=u.useRef([0,0]),o=u.useRef(),n=u.useState(Cc++)[0],s=u.useState(Go)[0],a=u.useRef(e);u.useEffect(function(){a.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(n));var m=ji([e.lockRef.current],(e.shards||[]).map(Jo),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(n))})}}},[e.inert,e.lockRef.current,e.shards]);var i=u.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var y=Et(m),w=r.current,x="deltaX"in m?m.deltaX:w[0]-y[0],C="deltaY"in m?m.deltaY:w[1]-y[1],k,N=m.target,P=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in m&&P==="h"&&N.type==="range")return!1;var S=qo(P,N);if(!S)return!0;if(S?k=P:(k=P==="v"?"h":"v",S=qo(P,N)),!S)return!1;if(!o.current&&"changedTouches"in m&&(x||C)&&(o.current=k),!k)return!0;var $=o.current||k;return wc($,v,m,$==="h"?x:C)},[]),c=u.useCallback(function(m){var v=m;if(!(!He.length||He[He.length-1]!==s)){var y="deltaY"in v?Qo(v):Et(v),w=t.current.filter(function(k){return k.name===v.type&&(k.target===v.target||v.target===k.shadowParent)&&xc(k.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var x=(a.current.shards||[]).map(Jo).filter(Boolean).filter(function(k){return k.contains(v.target)}),C=x.length>0?i(v,x[0]):!a.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),d=u.useCallback(function(m,v,y,w){var x={name:m,delta:v,target:y,should:w,shadowParent:Pc(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),f=u.useCallback(function(m){r.current=Et(m),o.current=void 0},[]),p=u.useCallback(function(m){d(m.type,Qo(m),m.target,i(m,e.lockRef.current))},[]),g=u.useCallback(function(m){d(m.type,Et(m),m.target,i(m,e.lockRef.current))},[]);u.useEffect(function(){return He.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",c,Ve),document.addEventListener("touchmove",c,Ve),document.addEventListener("touchstart",f,Ve),function(){He=He.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,Ve),document.removeEventListener("touchmove",c,Ve),document.removeEventListener("touchstart",f,Ve)}},[]);var h=e.removeScrollBar,b=e.inert;return u.createElement(u.Fragment,null,b?u.createElement(s,{styles:Sc(n)}):null,h?u.createElement(pc,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Pc(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Nc=ec(jo,Ec);var pr=u.forwardRef(function(e,t){return u.createElement(St,he({},e,{ref:t,sideCar:Nc}))});pr.classNames=St.classNames;var kc=[" ","Enter","ArrowUp","ArrowDown"],Ac=[" ","Enter"],Me="Select",[Pt,Nt,Oc]=Wr(Me),[Ue]=Ie(Me,[Oc,vt]),kt=vt(),[Ic,Ne]=Ue(Me),[Tc,Mc]=Ue(Me),en=e=>{const{__scopeSelect:t,children:r,open:o,defaultOpen:n,onOpenChange:s,value:a,defaultValue:i,onValueChange:c,dir:d,name:f,autoComplete:p,disabled:g,required:h,form:b}=e,m=kt(t),[v,y]=u.useState(null),[w,x]=u.useState(null),[C,k]=u.useState(!1),N=zt(d),[P,S]=et({prop:o,defaultProp:n??!1,onChange:s,caller:Me}),[$,E]=et({prop:a,defaultProp:i,onChange:c,caller:Me}),O=u.useRef(null),I=v?b||!!v.closest("form"):!0,[L,B]=u.useState(new Set),T=Array.from(L).map(F=>F.props.value).join(";");return l.jsx(Lo,{...m,children:l.jsxs(Ic,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:w,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:k,contentId:Xe(),value:$,onValueChange:E,open:P,onOpenChange:S,dir:N,triggerPointerDownPosRef:O,disabled:g,children:[l.jsx(Pt.Provider,{scope:t,children:l.jsx(Tc,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(F=>{B(R=>new Set(R).add(F))},[]),onNativeOptionRemove:u.useCallback(F=>{B(R=>{const A=new Set(R);return A.delete(F),A})},[]),children:r})}),I?l.jsxs(Pn,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:$,onChange:F=>E(F.target.value),disabled:g,form:b,children:[$===void 0?l.jsx("option",{value:""}):null,Array.from(L)]},T):null]})})};en.displayName=Me;var tn="SelectTrigger",rn=u.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:o=!1,...n}=e,s=kt(r),a=Ne(tn,r),i=a.disabled||o,c=Y(t,a.onTriggerChange),d=Nt(r),f=u.useRef("touch"),[p,g,h]=kn(m=>{const v=d().filter(x=>!x.disabled),y=v.find(x=>x.value===a.value),w=An(v,m,y);w!==void 0&&a.onValueChange(w.value)}),b=m=>{i||(a.onOpenChange(!0),h()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return l.jsx(ar,{asChild:!0,...s,children:l.jsx(se.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Nn(a.value)?"":void 0,...n,ref:c,onClick:W(n.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&b(m)}),onPointerDown:W(n.onPointerDown,m=>{f.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(b(m),m.preventDefault())}),onKeyDown:W(n.onKeyDown,m=>{const v=p.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(v&&m.key===" ")&&kc.includes(m.key)&&(b(),m.preventDefault())})})})});rn.displayName=tn;var on="SelectValue",nn=u.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:n,children:s,placeholder:a="",...i}=e,c=Ne(on,r),{onValueNodeHasChildrenChange:d}=c,f=s!==void 0,p=Y(t,c.onValueNodeChange);return ee(()=>{d(f)},[d,f]),l.jsx(se.span,{...i,ref:p,style:{pointerEvents:"none"},children:Nn(c.value)?l.jsx(l.Fragment,{children:a}):s})});nn.displayName=on;var _c="SelectIcon",sn=u.forwardRef((e,t)=>{const{__scopeSelect:r,children:o,...n}=e;return l.jsx(se.span,{"aria-hidden":!0,...n,ref:t,children:o||"▼"})});sn.displayName=_c;var Dc="SelectPortal",an=e=>l.jsx(ir,{asChild:!0,...e});an.displayName=Dc;var _e="SelectContent",cn=u.forwardRef((e,t)=>{const r=Ne(_e,e.__scopeSelect),[o,n]=u.useState();if(ee(()=>{n(new DocumentFragment)},[]),!r.open){const s=o;return s?at.createPortal(l.jsx(ln,{scope:e.__scopeSelect,children:l.jsx(Pt.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(dn,{...e,ref:t})});cn.displayName=_e;var le=10,[ln,ke]=Ue(_e),Lc="SelectContentImpl",Fc=re("SelectContent.RemoveScroll"),dn=u.forwardRef((e,t)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:h,sticky:b,hideWhenDetached:m,avoidCollisions:v,...y}=e,w=Ne(_e,r),[x,C]=u.useState(null),[k,N]=u.useState(null),P=Y(t,M=>C(M)),[S,$]=u.useState(null),[E,O]=u.useState(null),I=Nt(r),[L,B]=u.useState(!1),T=u.useRef(!1);u.useEffect(()=>{if(x)return Wo(x)},[x]),Kr();const F=u.useCallback(M=>{const[G,...Z]=I().map(K=>K.ref.current),[H]=Z.slice(-1),j=document.activeElement;for(const K of M)if(K===j||(K?.scrollIntoView({block:"nearest"}),K===G&&k&&(k.scrollTop=0),K===H&&k&&(k.scrollTop=k.scrollHeight),K?.focus(),document.activeElement!==j))return},[I,k]),R=u.useCallback(()=>F([S,x]),[F,S,x]);u.useEffect(()=>{L&&R()},[L,R]);const{onOpenChange:A,triggerPointerDownPosRef:U}=w;u.useEffect(()=>{if(x){let M={x:0,y:0};const G=H=>{M={x:Math.abs(Math.round(H.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(H.pageY)-(U.current?.y??0))}},Z=H=>{M.x<=10&&M.y<=10?H.preventDefault():x.contains(H.target)||A(!1),document.removeEventListener("pointermove",G),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",Z,{capture:!0})}}},[x,A,U]),u.useEffect(()=>{const M=()=>A(!1);return window.addEventListener("blur",M),window.addEventListener("resize",M),()=>{window.removeEventListener("blur",M),window.removeEventListener("resize",M)}},[A]);const[J,ge]=kn(M=>{const G=I().filter(j=>!j.disabled),Z=G.find(j=>j.ref.current===document.activeElement),H=An(G,M,Z);H&&setTimeout(()=>H.ref.current.focus())}),xe=u.useCallback((M,G,Z)=>{const H=!T.current&&!Z;(w.value!==void 0&&w.value===G||H)&&($(M),H&&(T.current=!0))},[w.value]),X=u.useCallback(()=>x?.focus(),[x]),q=u.useCallback((M,G,Z)=>{const H=!T.current&&!Z;(w.value!==void 0&&w.value===G||H)&&O(M)},[w.value]),de=o==="popper"?mr:un,ve=de===mr?{side:i,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:h,sticky:b,hideWhenDetached:m,avoidCollisions:v}:{};return l.jsx(ln,{scope:r,content:x,viewport:k,onViewportChange:N,itemRefCallback:xe,selectedItem:S,onItemLeave:X,itemTextRefCallback:q,focusSelectedItem:R,selectedItemText:E,position:o,isPositioned:L,searchRef:J,children:l.jsx(pr,{as:Fc,allowPinchZoom:!0,children:l.jsx(Gt,{asChild:!0,trapped:w.open,onMountAutoFocus:M=>{M.preventDefault()},onUnmountAutoFocus:W(n,M=>{w.trigger?.focus({preventScroll:!0}),M.preventDefault()}),children:l.jsx(Vt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:M=>M.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:l.jsx(de,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:M=>M.preventDefault(),...y,...ve,onPlaced:()=>B(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:W(y.onKeyDown,M=>{const G=M.ctrlKey||M.altKey||M.metaKey;if(M.key==="Tab"&&M.preventDefault(),!G&&M.key.length===1&&ge(M.key),["ArrowUp","ArrowDown","Home","End"].includes(M.key)){let H=I().filter(j=>!j.disabled).map(j=>j.ref.current);if(["ArrowUp","End"].includes(M.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(M.key)){const j=M.target,K=H.indexOf(j);H=H.slice(K+1)}setTimeout(()=>F(H)),M.preventDefault()}})})})})})})});dn.displayName=Lc;var $c="SelectItemAlignedPosition",un=u.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:o,...n}=e,s=Ne(_e,r),a=ke(_e,r),[i,c]=u.useState(null),[d,f]=u.useState(null),p=Y(t,P=>f(P)),g=Nt(r),h=u.useRef(!1),b=u.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:y,focusSelectedItem:w}=a,x=u.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&d&&m&&v&&y){const P=s.trigger.getBoundingClientRect(),S=d.getBoundingClientRect(),$=s.valueNode.getBoundingClientRect(),E=y.getBoundingClientRect();if(s.dir!=="rtl"){const j=E.left-S.left,K=$.left-j,ae=P.left-K,Le=P.width+ae,Mr=Math.max(Le,S.width),_r=window.innerWidth-le,Dr=Rr(K,[le,Math.max(le,_r-Mr)]);i.style.minWidth=Le+"px",i.style.left=Dr+"px"}else{const j=S.right-E.right,K=window.innerWidth-$.right-j,ae=window.innerWidth-P.right-K,Le=P.width+ae,Mr=Math.max(Le,S.width),_r=window.innerWidth-le,Dr=Rr(K,[le,Math.max(le,_r-Mr)]);i.style.minWidth=Le+"px",i.style.right=Dr+"px"}const O=g(),I=window.innerHeight-le*2,L=m.scrollHeight,B=window.getComputedStyle(d),T=parseInt(B.borderTopWidth,10),F=parseInt(B.paddingTop,10),R=parseInt(B.borderBottomWidth,10),A=parseInt(B.paddingBottom,10),U=T+F+L+A+R,J=Math.min(v.offsetHeight*5,U),ge=window.getComputedStyle(m),xe=parseInt(ge.paddingTop,10),X=parseInt(ge.paddingBottom,10),q=P.top+P.height/2-le,de=I-q,ve=v.offsetHeight/2,M=v.offsetTop+ve,G=T+F+M,Z=U-G;if(G<=q){const j=O.length>0&&v===O[O.length-1].ref.current;i.style.bottom="0px";const K=d.clientHeight-m.offsetTop-m.offsetHeight,ae=Math.max(de,ve+(j?X:0)+K+R),Le=G+ae;i.style.height=Le+"px"}else{const j=O.length>0&&v===O[0].ref.current;i.style.top="0px";const ae=Math.max(q,T+m.offsetTop+(j?xe:0)+ve)+Z;i.style.height=ae+"px",m.scrollTop=G-q+m.offsetTop}i.style.margin=`${le}px 0`,i.style.minHeight=J+"px",i.style.maxHeight=I+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[g,s.trigger,s.valueNode,i,d,m,v,y,s.dir,o]);ee(()=>x(),[x]);const[C,k]=u.useState();ee(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const N=u.useCallback(P=>{P&&b.current===!0&&(x(),w?.(),b.current=!1)},[x,w]);return l.jsx(Rc,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:l.jsx(se.div,{...n,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});un.displayName=$c;var Bc="SelectPopperPosition",mr=u.forwardRef((e,t)=>{const{__scopeSelect:r,align:o="start",collisionPadding:n=le,...s}=e,a=kt(r);return l.jsx(Fo,{...a,...s,ref:t,align:o,collisionPadding:n,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)"}})});mr.displayName=Bc;var[Rc,hr]=Ue(_e,{}),gr="SelectViewport",fn=u.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:o,...n}=e,s=ke(gr,r),a=hr(gr,r),i=Y(t,s.onViewportChange),c=u.useRef(0);return l.jsxs(l.Fragment,{children:[l.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}),l.jsx(Pt.Slot,{scope:r,children:l.jsx(se.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:W(n.onScroll,d=>{const f=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=a;if(g?.current&&p){const h=Math.abs(c.current-f.scrollTop);if(h>0){const b=window.innerHeight-le*2,m=parseFloat(p.style.minHeight),v=parseFloat(p.style.height),y=Math.max(m,v);if(y<b){const w=y+h,x=Math.min(b,w),C=w-x;p.style.height=x+"px",p.style.bottom==="0px"&&(f.scrollTop=C>0?C:0,p.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});fn.displayName=gr;var pn="SelectGroup",[zc,Wc]=Ue(pn),mn=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,n=Xe();return l.jsx(zc,{scope:r,id:n,children:l.jsx(se.div,{role:"group","aria-labelledby":n,...o,ref:t})})});mn.displayName=pn;var hn="SelectLabel",gn=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,n=Wc(hn,r);return l.jsx(se.div,{id:n.id,...o,ref:t})});gn.displayName=hn;var At="SelectItem",[Vc,vn]=Ue(At),bn=u.forwardRef((e,t)=>{const{__scopeSelect:r,value:o,disabled:n=!1,textValue:s,...a}=e,i=Ne(At,r),c=ke(At,r),d=i.value===o,[f,p]=u.useState(s??""),[g,h]=u.useState(!1),b=Y(t,w=>c.itemRefCallback?.(w,o,n)),m=Xe(),v=u.useRef("touch"),y=()=>{n||(i.onValueChange(o),i.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 l.jsx(Vc,{scope:r,value:o,disabled:n,textId:m,isSelected:d,onItemTextChange:u.useCallback(w=>{p(x=>x||(w?.textContent??"").trim())},[]),children:l.jsx(Pt.ItemSlot,{scope:r,value:o,disabled:n,textValue:f,children:l.jsx(se.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...a,ref:b,onFocus:W(a.onFocus,()=>h(!0)),onBlur:W(a.onBlur,()=>h(!1)),onClick:W(a.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:W(a.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:W(a.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:W(a.onPointerMove,w=>{v.current=w.pointerType,n?c.onItemLeave?.():v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:W(a.onPointerLeave,w=>{w.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:W(a.onKeyDown,w=>{c.searchRef?.current!==""&&w.key===" "||(Ac.includes(w.key)&&y(),w.key===" "&&w.preventDefault())})})})})});bn.displayName=At;var tt="SelectItemText",yn=u.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:n,...s}=e,a=Ne(tt,r),i=ke(tt,r),c=vn(tt,r),d=Mc(tt,r),[f,p]=u.useState(null),g=Y(t,y=>p(y),c.onItemTextChange,y=>i.itemTextRefCallback?.(y,c.value,c.disabled)),h=f?.textContent,b=u.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=d;return ee(()=>(m(b),()=>v(b)),[m,v,b]),l.jsxs(l.Fragment,{children:[l.jsx(se.span,{id:c.textId,...s,ref:g}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?at.createPortal(s.children,a.valueNode):null]})});yn.displayName=tt;var wn="SelectItemIndicator",Hc=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return vn(wn,r).isSelected?l.jsx(se.span,{"aria-hidden":!0,...o,ref:t}):null});Hc.displayName=wn;var vr="SelectScrollUpButton",xn=u.forwardRef((e,t)=>{const r=ke(vr,e.__scopeSelect),o=hr(vr,e.__scopeSelect),[n,s]=u.useState(!1),a=Y(t,o.onScrollButtonChange);return ee(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=c.scrollTop>0;s(d)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),n?l.jsx(Sn,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});xn.displayName=vr;var br="SelectScrollDownButton",Uc=u.forwardRef((e,t)=>{const r=ke(br,e.__scopeSelect),o=hr(br,e.__scopeSelect),[n,s]=u.useState(!1),a=Y(t,o.onScrollButtonChange);return ee(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<d;s(f)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),n?l.jsx(Sn,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});Uc.displayName=br;var Sn=u.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:o,...n}=e,s=ke("SelectScrollButton",r),a=u.useRef(null),i=Nt(r),c=u.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),ee(()=>{i().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),l.jsx(se.div,{"aria-hidden":!0,...n,ref:t,style:{flexShrink:0,...n.style},onPointerDown:W(n.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:W(n.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:W(n.onPointerLeave,()=>{c()})})}),jc="SelectSeparator",Cn=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return l.jsx(se.div,{"aria-hidden":!0,...o,ref:t})});Cn.displayName=jc;var yr="SelectArrow",En=u.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,n=kt(r),s=Ne(yr,r),a=ke(yr,r);return s.open&&a.position==="popper"?l.jsx($o,{...n,...o,ref:t}):null});En.displayName=yr;var Gc="SelectBubbleInput",Pn=u.forwardRef(({__scopeSelect:e,value:t,...r},o)=>{const n=u.useRef(null),s=Y(o,n),a=Bo(t);return u.useEffect(()=>{const i=n.current;if(!i)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&f){const p=new Event("change",{bubbles:!0});f.call(i,t),i.dispatchEvent(p)}},[a,t]),l.jsx(se.select,{...r,style:{...Ro,...r.style},ref:s,defaultValue:t})});Pn.displayName=Gc;function Nn(e){return e===""||e===void 0}function kn(e){const t=Se(e),r=u.useRef(""),o=u.useRef(0),n=u.useCallback(a=>{const i=r.current+a;t(i),(function c(d){r.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>c(""),1e3))})(i)},[t]),s=u.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,n,s]}function An(e,t,r){const n=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let a=Kc(e,Math.max(s,0));n.length===1&&(a=a.filter(d=>d!==r));const c=a.find(d=>d.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==r?c:void 0}function Kc(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var Yc=en,qc=rn,Xc=nn,Zc=sn,Qc=an,Jc=cn,el=fn,tl=mn,rl=gn,ol=bn,nl=yn,sl=xn,al=Cn,On=En;const il=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cl=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,o)=>o?o.toUpperCase():r.toLowerCase()),In=e=>{const t=cl(e);return t.charAt(0).toUpperCase()+t.slice(1)},Tn=(...e)=>e.filter((t,r,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===r).join(" ").trim(),ll=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var dl={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 ul=V.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:s,iconNode:a,...i},c)=>V.createElement("svg",{ref:c,...dl,width:t,height:t,stroke:e,strokeWidth:o?Number(r)*24/Number(t):r,className:Tn("lucide",n),...!s&&!ll(i)&&{"aria-hidden":"true"},...i},[...a.map(([d,f])=>V.createElement(d,f)),...Array.isArray(s)?s:[s]]));const je=(e,t)=>{const r=V.forwardRef(({className:o,...n},s)=>V.createElement(ul,{ref:s,iconNode:t,className:Tn(`lucide-${il(In(e))}`,`lucide-${e}`,o),...n}));return r.displayName=In(e),r};const fl=je("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const pl=je("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const ml=je("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const hl=je("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const gl=je("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const vl=je("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);function bl({field:e,formValues:t,handleChange:r,handleBlur:o,error:n}){const s=t[e.name]||"",a=typeof e.disabled=="function"?e.disabled(t):e.disabled,i=e.options||[];return l.jsxs(l.Fragment,{children:[l.jsxs(Yc,{value:s,onValueChange:c=>r(e.name,c),disabled:a,children:[l.jsxs(qc,{id:e.name,onBlur:()=>o(e.name),className:`inline-flex items-center justify-between w-full h-10 rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 bg-background transition-all
42
+ ${n?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"}
43
43
  ${a?"cursor-not-allowed opacity-50":""}
44
- `,children:[l.jsx(Dc,{placeholder:e.placeholder||`Select ${e.label?.toLowerCase()||""}`}),l.jsx(Fc,{className:"ml-2 text-gray-500",children:l.jsx(Zc,{className:"w-4 h-4"})})]}),l.jsx($c,{children:l.jsxs(Rc,{className:"bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[var(--radix-select-trigger-width)]",position:"popper",sideOffset:5,children:[l.jsx(Uc,{className:"flex items-center justify-center h-6 text-gray-500 bg-gray-50",children:l.jsx(Pr,{className:"fill-white stroke-gray-200"})}),l.jsxs(Bc,{className:"p-1",children:[e.groupLabel&&l.jsx(zc,{children:l.jsx(Wc,{className:"px-2 py-1 text-xs text-gray-500 uppercase tracking-wide",children:e.groupLabel})}),i.map(c=>l.jsx(Vc,{value:c.value,className:`relative flex items-center px-3 py-2 text-sm rounded cursor-pointer select-none
44
+ `,children:[l.jsx(Xc,{placeholder:e.placeholder||`Select ${e.label?.toLowerCase()||""}`}),l.jsx(Zc,{className:"ml-2 text-gray-500",children:l.jsx(fl,{className:"w-4 h-4"})})]}),l.jsx(Qc,{children:l.jsxs(Jc,{className:"bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[var(--radix-select-trigger-width)]",position:"popper",sideOffset:5,children:[l.jsx(sl,{className:"flex items-center justify-center h-6 text-gray-500 bg-gray-50",children:l.jsx(On,{className:"fill-white stroke-gray-200"})}),l.jsxs(el,{className:"p-1",children:[e.groupLabel&&l.jsx(tl,{children:l.jsx(rl,{className:"px-2 py-1 text-xs text-gray-500 uppercase tracking-wide",children:e.groupLabel})}),i.map(c=>l.jsx(ol,{value:c.value,className:`relative flex items-center px-3 py-2 text-sm rounded cursor-pointer select-none
45
45
  data-[state=checked]:bg-blue-50
46
46
  data-[state=checked]:text-blue-600
47
- `,children:l.jsx(Hc,{children:c.label})},c.value)),e.separator&&l.jsx(jc,{className:"my-1 h-px bg-gray-200"})]}),l.jsx(Pr,{className:"fill-white stroke-gray-200"})]})})]}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}function rl({field:e,formValues:t,handleChange:o,handleBlur:n,error:r}){const s=e.readOnly&&e.disabled;return l.jsxs(l.Fragment,{children:[l.jsx("input",{...e.props,type:"email",value:t[e.name]||"",onChange:a=>o(e.name,a.target.value),onBlur:()=>n(e.name),disabled:s,name:e.name,placeholder:e.placeholder,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${r?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${s?"bg-gray-100 text-gray-500 cursor-not-allowed":"bg-background"}`}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}function Or({field:e,formValues:t,handleChange:o,handleBlur:n,touched:r,error:s}){const a=e.readOnly||e.disabled;return l.jsxs(l.Fragment,{children:[l.jsx("input",{...e.props,id:e.name,type:e.type||"text",value:t[e.name]||"",onChange:i=>o(e.name,i.target.value),onBlur:()=>n(e.name),disabled:a,name:e.name,placeholder:e.placeholder,min:e.minLength,max:e.maxLength,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${s?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-50 text-gray-500":"bg-background"}`}),s&&l.jsx("p",{className:"mt-1 text-sm text-red-600",children:s})]})}function sl({field:e,formValues:t}){const o=t[e.name]||e.content||"";return l.jsx("div",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,id:e.name.toLowerCase()+"_id",children:l.jsx("div",{className:"w-full px-3 py-2 border rounded-md overflow-y-auto max-h-40 prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:o}})},e.name)}function al({field:e,formValues:t,handleChange:o,handleBlur:n,error:r}){const s=e.disabled&&e.disabled(t);return l.jsxs("div",{className:"mt-1",children:[l.jsxs("div",{className:"space-x-2",children:[l.jsx("input",{...e.props,id:"id_"+e.name,type:"checkbox",checked:t[e.name]||!1,onChange:a=>o(e.name,a.target.checked),onBlur:()=>n(e.name),disabled:s,className:`rounded border-gray-300 ${s?"opacity-50 cursor-not-allowed":""} ${r?"border-red-500":""}`}),l.jsxs("label",{className:"",htmlFor:"id_"+e.name,children:[e.label,e.required&&l.jsx("span",{className:"text-red-500",children:"*"})]})]}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}function il(e,t){return u.useReducer((o,n)=>t[o][n]??o,e)}var Ot=e=>{const{present:t,children:o}=e,n=cl(t),r=typeof o=="function"?o({present:n.isPresent}):u.Children.only(o),s=q(n.ref,ll(r));return typeof o=="function"||n.isPresent?u.cloneElement(r,{ref:s}):null};Ot.displayName="Presence";function cl(e){const[t,o]=u.useState(),n=u.useRef(null),r=u.useRef(e),s=u.useRef("none"),a=e?"mounted":"unmounted",[i,c]=il(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=It(n.current);s.current=i==="mounted"?d:"none"},[i]),te(()=>{const d=n.current,f=r.current;if(f!==e){const g=s.current,h=It(d);e?c("MOUNT"):h==="none"||d?.display==="none"?c("UNMOUNT"):c(f&&g!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),te(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,m=h=>{const p=It(n.current).includes(CSS.escape(h.animationName));if(h.target===t&&p&&(c("ANIMATION_END"),!r.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},g=h=>{h.target===t&&(s.current=It(n.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:u.useCallback(d=>{n.current=d?getComputedStyle(d):null,o(d)},[])}}function It(e){return e?.animationName||"none"}function ll(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Tt="Popover",[Ir]=Oe(Tt,[vt]),ot=vt(),[dl,Ne]=Ir(Tt),Tr=e=>{const{__scopePopover:t,children:o,open:n,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,i=ot(t),c=u.useRef(null),[d,f]=u.useState(!1),[m,g]=et({prop:n,defaultProp:r??!1,onChange:s,caller:Tt});return l.jsx(_n,{...i,children:l.jsx(dl,{scope:t,contentId:Xe(),triggerRef:c,open:m,onOpenChange:g,onOpenToggle:u.useCallback(()=>g(h=>!h),[g]),hasCustomAnchor:d,onCustomAnchorAdd:u.useCallback(()=>f(!0),[]),onCustomAnchorRemove:u.useCallback(()=>f(!1),[]),modal:a,children:o})})};Tr.displayName=Tt;var Mr="PopoverAnchor",ul=u.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=Ne(Mr,o),s=ot(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=r;return u.useEffect(()=>(a(),()=>i()),[a,i]),l.jsx(so,{...s,...n,ref:t})});ul.displayName=Mr;var _r="PopoverTrigger",Lr=u.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=Ne(_r,o),s=ot(o),a=q(t,r.triggerRef),i=l.jsx(U.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Br(r.open),...n,ref:a,onClick:W(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?i:l.jsx(so,{asChild:!0,...s,children:i})});Lr.displayName=_r;var wo="PopoverPortal",[fl,pl]=Ir(wo,{forceMount:void 0}),Dr=e=>{const{__scopePopover:t,forceMount:o,children:n,container:r}=e,s=Ne(wo,t);return l.jsx(fl,{scope:t,forceMount:o,children:l.jsx(Ot,{present:o||s.open,children:l.jsx(ao,{asChild:!0,container:r,children:n})})})};Dr.displayName=wo;var je="PopoverContent",Fr=u.forwardRef((e,t)=>{const o=pl(je,e.__scopePopover),{forceMount:n=o.forceMount,...r}=e,s=Ne(je,e.__scopePopover);return l.jsx(Ot,{present:n||s.open,children:s.modal?l.jsx(hl,{...r,ref:t}):l.jsx(gl,{...r,ref:t})})});Fr.displayName=je;var ml=qe("PopoverContent.RemoveScroll"),hl=u.forwardRef((e,t)=>{const o=Ne(je,e.__scopePopover),n=u.useRef(null),r=q(t,n),s=u.useRef(!1);return u.useEffect(()=>{const a=n.current;if(a)return Bn(a)},[]),l.jsx(po,{as:ml,allowPinchZoom:!0,children:l.jsx($r,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:W(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:W(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,d=i.button===2||c;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:W(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),gl=u.forwardRef((e,t)=>{const o=Ne(je,e.__scopePopover),n=u.useRef(!1),r=u.useRef(!1);return l.jsx($r,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||o.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),$r=u.forwardRef((e,t)=>{const{__scopePopover:o,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,...m}=e,g=Ne(je,o),h=ot(o);return Go(),l.jsx(jt,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:s,children:l.jsx(Wt,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:l.jsx(Ln,{"data-state":Br(g.open),role:"dialog",id:g.contentId,...h,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Rr="PopoverClose",vl=u.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=Ne(Rr,o);return l.jsx(U.button,{type:"button",...n,ref:t,onClick:W(e.onClick,()=>r.onOpenChange(!1))})});vl.displayName=Rr;var bl="PopoverArrow",yl=u.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=ot(o);return l.jsx(Dn,{...r,...n,ref:t})});yl.displayName=bl;function Br(e){return e?"open":"closed"}var wl=Tr,xl=Lr,Cl=Dr,Sl=Fr;function zr(e){var t,o,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(o=zr(e[t]))&&(n&&(n+=" "),n+=o)}else for(o in e)e[o]&&(n&&(n+=" "),n+=o);return n}function El(){for(var e,t,o=0,n="",r=arguments.length;o<r;o++)(e=arguments[o])&&(t=zr(e))&&(n&&(n+=" "),n+=t);return n}const kl=(e,t)=>{const o=new Array(e.length+t.length);for(let n=0;n<e.length;n++)o[n]=e[n];for(let n=0;n<t.length;n++)o[e.length+n]=t[n];return o},Pl=(e,t)=>({classGroupId:e,validator:t}),Wr=(e=new Map,t=null,o)=>({nextPart:e,validators:t,classGroupId:o}),Mt="-",Vr=[],Nl="arbitrary..",Al=e=>{const t=Il(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Ol(a);const i=a.split(Mt),c=i[0]===""&&i.length>1?1:0;return Hr(i,c,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const c=n[a],d=o[a];return c?d?kl(d,c):c:d||Vr}return o[a]||Vr}}},Hr=(e,t,o)=>{if(e.length-t===0)return o.classGroupId;const r=e[t],s=o.nextPart.get(r);if(s){const d=Hr(e,t+1,s);if(d)return d}const a=o.validators;if(a===null)return;const i=t===0?e.join(Mt):e.slice(t).join(Mt),c=a.length;for(let d=0;d<c;d++){const f=a[d];if(f.validator(i))return f.classGroupId}},Ol=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),o=t.indexOf(":"),n=t.slice(0,o);return n?Nl+n:void 0})(),Il=e=>{const{theme:t,classGroups:o}=e;return Tl(o,t)},Tl=(e,t)=>{const o=Wr();for(const n in e){const r=e[n];xo(r,o,n,t)}return o},xo=(e,t,o,n)=>{const r=e.length;for(let s=0;s<r;s++){const a=e[s];Ml(a,t,o,n)}},Ml=(e,t,o,n)=>{if(typeof e=="string"){_l(e,t,o);return}if(typeof e=="function"){Ll(e,t,o,n);return}Dl(e,t,o,n)},_l=(e,t,o)=>{const n=e===""?t:Ur(t,e);n.classGroupId=o},Ll=(e,t,o,n)=>{if(Fl(e)){xo(e(n),t,o,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Pl(o,e))},Dl=(e,t,o,n)=>{const r=Object.entries(e),s=r.length;for(let a=0;a<s;a++){const[i,c]=r[a];xo(c,Ur(t,i),o,n)}},Ur=(e,t)=>{let o=e;const n=t.split(Mt),r=n.length;for(let s=0;s<r;s++){const a=n[s];let i=o.nextPart.get(a);i||(i=Wr(),o.nextPart.set(a,i)),o=i}return o},Fl=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,$l=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=Object.create(null),n=Object.create(null);const r=(s,a)=>{o[s]=a,t++,t>e&&(t=0,n=o,o=Object.create(null))};return{get(s){let a=o[s];if(a!==void 0)return a;if((a=n[s])!==void 0)return r(s,a),a},set(s,a){s in o?o[s]=a:r(s,a)}}},Co="!",jr=":",Rl=[],Gr=(e,t,o,n,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:o,maybePostfixModifierPosition:n,isExternal:r}),Bl=e=>{const{prefix:t,experimentalParseClassName:o}=e;let n=r=>{const s=[];let a=0,i=0,c=0,d;const f=r.length;for(let p=0;p<f;p++){const v=r[p];if(a===0&&i===0){if(v===jr){s.push(r.slice(c,p)),c=p+1;continue}if(v==="/"){d=p;continue}}v==="["?a++:v==="]"?a--:v==="("?i++:v===")"&&i--}const m=s.length===0?r:r.slice(c);let g=m,h=!1;m.endsWith(Co)?(g=m.slice(0,-1),h=!0):m.startsWith(Co)&&(g=m.slice(1),h=!0);const b=d&&d>c?d-c:void 0;return Gr(s,h,g,b)};if(t){const r=t+jr,s=n;n=a=>a.startsWith(r)?s(a.slice(r.length)):Gr(Rl,!1,a,void 0,!0)}if(o){const r=n;n=s=>o({className:s,parseClassName:r})}return n},zl=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((o,n)=>{t.set(o,1e6+n)}),o=>{const n=[];let r=[];for(let s=0;s<o.length;s++){const a=o[s],i=a[0]==="[",c=t.has(a);i||c?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Wl=e=>({cache:$l(e.cacheSize),parseClassName:Bl(e),sortModifiers:zl(e),...Al(e)}),Vl=/\s+/,Hl=(e,t)=>{const{parseClassName:o,getClassGroupId:n,getConflictingClassGroupIds:r,sortModifiers:s}=t,a=[],i=e.trim().split(Vl);let c="";for(let d=i.length-1;d>=0;d-=1){const f=i[d],{isExternal:m,modifiers:g,hasImportantModifier:h,baseClassName:b,maybePostfixModifierPosition:p}=o(f);if(m){c=f+(c.length>0?" "+c:c);continue}let v=!!p,y=n(v?b.substring(0,p):b);if(!y){if(!v){c=f+(c.length>0?" "+c:c);continue}if(y=n(b),!y){c=f+(c.length>0?" "+c:c);continue}v=!1}const w=g.length===0?"":g.length===1?g[0]:s(g).join(":"),x=h?w+Co:w,S=x+y;if(a.indexOf(S)>-1)continue;a.push(S);const N=r(y,v);for(let P=0;P<N.length;++P){const k=N[P];a.push(x+k)}c=f+(c.length>0?" "+c:c)}return c},Ul=(...e)=>{let t=0,o,n,r="";for(;t<e.length;)(o=e[t++])&&(n=Kr(o))&&(r&&(r+=" "),r+=n);return r},Kr=e=>{if(typeof e=="string")return e;let t,o="";for(let n=0;n<e.length;n++)e[n]&&(t=Kr(e[n]))&&(o&&(o+=" "),o+=t);return o},jl=(e,...t)=>{let o,n,r,s;const a=c=>{const d=t.reduce((f,m)=>m(f),e());return o=Wl(d),n=o.cache.get,r=o.cache.set,s=i,i(c)},i=c=>{const d=n(c);if(d)return d;const f=Hl(c,o);return r(c,f),f};return s=a,(...c)=>s(Ul(...c))},Gl=[],J=e=>{const t=o=>o[e]||Gl;return t.isThemeGetter=!0,t},Yr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Kl=/^\d+\/\d+$/,Yl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ql=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Xl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Zl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ql=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ge=e=>Kl.test(e),z=e=>!!e&&!Number.isNaN(Number(e)),Ae=e=>!!e&&Number.isInteger(Number(e)),So=e=>e.endsWith("%")&&z(e.slice(0,-1)),ye=e=>Yl.test(e),Jl=()=>!0,ed=e=>ql.test(e)&&!Xl.test(e),Xr=()=>!1,td=e=>Zl.test(e),od=e=>Ql.test(e),nd=e=>!M(e)&&!_(e),rd=e=>Ke(e,ts,Xr),M=e=>Yr.test(e),_e=e=>Ke(e,os,ed),Eo=e=>Ke(e,ld,z),Zr=e=>Ke(e,Jr,Xr),sd=e=>Ke(e,es,od),_t=e=>Ke(e,ns,td),_=e=>qr.test(e),nt=e=>Ye(e,os),ad=e=>Ye(e,dd),Qr=e=>Ye(e,Jr),id=e=>Ye(e,ts),cd=e=>Ye(e,es),Lt=e=>Ye(e,ns,!0),Ke=(e,t,o)=>{const n=Yr.exec(e);return n?n[1]?t(n[1]):o(n[2]):!1},Ye=(e,t,o=!1)=>{const n=qr.exec(e);return n?n[1]?t(n[1]):o:!1},Jr=e=>e==="position"||e==="percentage",es=e=>e==="image"||e==="url",ts=e=>e==="length"||e==="size"||e==="bg-size",os=e=>e==="length",ld=e=>e==="number",dd=e=>e==="family-name",ns=e=>e==="shadow",ud=jl(()=>{const e=J("color"),t=J("font"),o=J("text"),n=J("font-weight"),r=J("tracking"),s=J("leading"),a=J("breakpoint"),i=J("container"),c=J("spacing"),d=J("radius"),f=J("shadow"),m=J("inset-shadow"),g=J("text-shadow"),h=J("drop-shadow"),b=J("blur"),p=J("perspective"),v=J("aspect"),y=J("ease"),w=J("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...S(),_,M],P=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],C=()=>[_,M,c],F=()=>[Ge,"full","auto",...C()],E=()=>[Ae,"none","subgrid",_,M],O=()=>["auto",{span:["full",Ae,_,M]},Ae,_,M],I=()=>[Ae,"auto",_,M],L=()=>["auto","min","max","fr",_,M],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...C()],B=()=>[Ge,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],A=()=>[e,_,M],j=()=>[...S(),Qr,Zr,{position:[_,M]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],he=()=>["auto","cover","contain",id,rd,{size:[_,M]}],we=()=>[So,nt,_e],Z=()=>["","none","full",d,_,M],X=()=>["",z,nt,_e],le=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>[z,So,Qr,Zr],K=()=>["","none",b,_,M],Q=()=>["none",z,_,M],H=()=>["none",z,_,M],G=()=>[z,_,M],Y=()=>[Ge,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ye],breakpoint:[ye],color:[Jl],container:[ye],"drop-shadow":[ye],ease:["in","out","in-out"],font:[nd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ye],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ye],shadow:[ye],spacing:["px",z],text:[ye],"text-shadow":[ye],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ge,M,_,v]}],container:["container"],columns:[{columns:[z,M,_,i]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[Ae,"auto",_,M]}],basis:[{basis:[Ge,"full","auto",i,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[z,Ge,"auto","initial","none",M]}],grow:[{grow:["",z,_,M]}],shrink:[{shrink:["",z,_,M]}],order:[{order:[Ae,"first","last","none",_,M]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[i,"screen",...B()]}],"min-w":[{"min-w":[i,"screen","none",...B()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",o,nt,_e]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,_,Eo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",So,M]}],"font-family":[{font:[ad,M,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,_,M]}],"line-clamp":[{"line-clamp":[z,"none",_,Eo]}],leading:[{leading:[s,...C()]}],"list-image":[{"list-image":["none",_,M]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_,M]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[z,"from-font","auto",_,_e]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[z,"auto",_,M]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_,M]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",_,M]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:he()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ae,_,M],radial:["",_,M],conic:[Ae,_,M]},cd,sd]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:we()}],"gradient-via-pos":[{via:we()}],"gradient-to-pos":[{to:we()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[z,_,M]}],"outline-w":[{outline:["",z,nt,_e]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",f,Lt,_t]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",m,Lt,_t]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[z,_e]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",g,Lt,_t]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[z,_,M]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[z]}],"mask-image-linear-from-pos":[{"mask-linear-from":T()}],"mask-image-linear-to-pos":[{"mask-linear-to":T()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":T()}],"mask-image-t-to-pos":[{"mask-t-to":T()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":T()}],"mask-image-r-to-pos":[{"mask-r-to":T()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":T()}],"mask-image-b-to-pos":[{"mask-b-to":T()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":T()}],"mask-image-l-to-pos":[{"mask-l-to":T()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":T()}],"mask-image-x-to-pos":[{"mask-x-to":T()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":T()}],"mask-image-y-to-pos":[{"mask-y-to":T()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[_,M]}],"mask-image-radial-from-pos":[{"mask-radial-from":T()}],"mask-image-radial-to-pos":[{"mask-radial-to":T()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[z]}],"mask-image-conic-from-pos":[{"mask-conic-from":T()}],"mask-image-conic-to-pos":[{"mask-conic-to":T()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:he()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_,M]}],filter:[{filter:["","none",_,M]}],blur:[{blur:K()}],brightness:[{brightness:[z,_,M]}],contrast:[{contrast:[z,_,M]}],"drop-shadow":[{"drop-shadow":["","none",h,Lt,_t]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",z,_,M]}],"hue-rotate":[{"hue-rotate":[z,_,M]}],invert:[{invert:["",z,_,M]}],saturate:[{saturate:[z,_,M]}],sepia:[{sepia:["",z,_,M]}],"backdrop-filter":[{"backdrop-filter":["","none",_,M]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[z,_,M]}],"backdrop-contrast":[{"backdrop-contrast":[z,_,M]}],"backdrop-grayscale":[{"backdrop-grayscale":["",z,_,M]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[z,_,M]}],"backdrop-invert":[{"backdrop-invert":["",z,_,M]}],"backdrop-opacity":[{"backdrop-opacity":[z,_,M]}],"backdrop-saturate":[{"backdrop-saturate":[z,_,M]}],"backdrop-sepia":[{"backdrop-sepia":["",z,_,M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_,M]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[z,"initial",_,M]}],ease:[{ease:["linear","initial",y,_,M]}],delay:[{delay:[z,_,M]}],animate:[{animate:["none",w,_,M]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,_,M]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:Q()}],"rotate-x":[{"rotate-x":Q()}],"rotate-y":[{"rotate-y":Q()}],"rotate-z":[{"rotate-z":Q()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":["scale-3d"],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[_,M,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",_,M]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_,M]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[z,nt,_e,Eo]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Dt(...e){return ud(El(e))}function ko({...e}){return l.jsx(wl,{"data-slot":"popover",...e})}function Po({...e}){return l.jsx(xl,{"data-slot":"popover-trigger",...e})}function No({className:e,align:t="center",sideOffset:o=4,...n}){return l.jsx(Cl,{children:l.jsx(Sl,{"data-slot":"popover-content",align:t,sideOffset:o,className:Dt("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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}function fd({field:e,formValues:t,handleChange:o,handleBlur:n,error:r}){const[s,a]=V.useState(!1),i=t[e.name]??{from:null,to:null},c=f=>o(e.name,f),d=()=>o(e.name,{from:null,to:null});return l.jsxs("div",{children:[l.jsxs(ko,{open:s,onOpenChange:a,children:[l.jsx(Po,{asChild:!0,children:l.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),onKeyDown:f=>f.key==="Enter"&&a(!0),className:`
47
+ `,children:l.jsx(nl,{children:c.label})},c.value)),e.separator&&l.jsx(al,{className:"my-1 h-px bg-gray-200"})]}),l.jsx(On,{className:"fill-white stroke-gray-200"})]})})]}),n&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:n})]})}function yl({field:e,formValues:t,handleChange:r,handleBlur:o,error:n}){const s=e.readOnly&&e.disabled;return l.jsxs(l.Fragment,{children:[l.jsx("input",{...e.props,type:"email",value:t[e.name]||"",onChange:a=>r(e.name,a.target.value),onBlur:()=>o(e.name),disabled:s,name:e.name,placeholder:e.placeholder,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${n?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${s?"bg-gray-100 text-gray-500 cursor-not-allowed":"bg-background"}`}),n&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:n})]})}function Mn({field:e,formValues:t,handleChange:r,handleBlur:o,touched:n,error:s}){const a=e.readOnly||e.disabled;return l.jsxs(l.Fragment,{children:[l.jsx("input",{...e.props,id:e.name,type:e.type||"",value:t[e.name]||"",onChange:i=>r(e.name,i.target.value),onBlur:()=>o(e.name),disabled:a,name:e.name,placeholder:e.placeholder||"",min:e.minLength,max:e.maxLength,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${s?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-50 text-gray-500":"bg-background"}`}),s&&l.jsx("p",{className:"mt-1 text-sm text-red-600",children:s})]})}function wl({field:e,formValues:t}){const r=t[e.name]||e.content||"";return l.jsx("div",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,id:e.name.toLowerCase()+"_id",children:l.jsx("div",{className:"w-full px-3 py-2 border rounded-md overflow-y-auto max-h-40 prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:r}})},e.name)}function xl({field:e,formValues:t,handleChange:r,handleBlur:o,error:n}){const s=typeof e.disabled=="function"?e.disabled(t):e.disabled,a=e.options||[],i=e.inline||e.layout==="inline";if(a.length>0){const c=t[e.name]||[],d=(f,p)=>{let g;p?g=[...c,f]:g=c.filter(h=>h!==f),r(e.name,g)};return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:i?"flex flex-wrap gap-9":"space-y-3",children:a.map(f=>{const p=typeof f=="object"?f.value:f,g=typeof f=="object"?f.label:f,h=typeof f=="object"?f.description:f,b=`${e.name}-${p}`,m=c.includes(p);return l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("div",{className:"flex h-6 items-center",children:l.jsx("input",{type:"checkbox",id:b,checked:m,onChange:v=>d(p,v.target.checked),onBlur:()=>o(e.name),disabled:s,className:`
48
+ size-4 rounded border-gray-300 text-blue-600 transition-all
49
+ focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
50
+ ${s?"opacity-50 cursor-not-allowed bg-gray-100":"cursor-pointer hover:border-blue-400"}
51
+ ${n?"border-red-500":""}
52
+ `})}),l.jsxs("div",{className:"ml-3 text-sm",children:[l.jsx("label",{htmlFor:b,className:`font-medium ${s?"text-gray-500":"text-gray-900 cursor-pointer"}`,children:g}),h&&!i&&l.jsx("p",{className:`text-sm ${s?"text-gray-400":"text-gray-500"}`,children:h})]})]},p)})}),n&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:n})]})}return l.jsxs("div",{className:"mt-1",children:[l.jsxs("div",{className:"space-x-2",children:[l.jsx("input",{...e.props,id:"id_"+e.name,type:"checkbox",checked:t[e.name]||!1,onChange:c=>r(e.name,c.target.checked),onBlur:()=>o(e.name),disabled:s,className:`rounded border-gray-300 ${s?"opacity-50 cursor-not-allowed":""} ${n?"border-red-500":""}`}),l.jsxs("label",{className:"",htmlFor:"id_"+e.name,children:[e.label,e.required&&l.jsx("span",{className:"text-red-500",children:"*"})]})]}),n&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:n})]})}function Sl(e,t){return u.useReducer((r,o)=>t[r][o]??r,e)}var Ot=e=>{const{present:t,children:r}=e,o=Cl(t),n=typeof r=="function"?r({present:o.isPresent}):u.Children.only(r),s=Y(o.ref,El(n));return typeof r=="function"||o.isPresent?u.cloneElement(n,{ref:s}):null};Ot.displayName="Presence";function Cl(e){const[t,r]=u.useState(),o=u.useRef(null),n=u.useRef(e),s=u.useRef("none"),a=e?"mounted":"unmounted",[i,c]=Sl(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=It(o.current);s.current=i==="mounted"?d:"none"},[i]),ee(()=>{const d=o.current,f=n.current;if(f!==e){const g=s.current,h=It(d);e?c("MOUNT"):h==="none"||d?.display==="none"?c("UNMOUNT"):c(f&&g!==h?"ANIMATION_OUT":"UNMOUNT"),n.current=e}},[e,c]),ee(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=h=>{const m=It(o.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(c("ANIMATION_END"),!n.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},g=h=>{h.target===t&&(s.current=It(o.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:u.useCallback(d=>{o.current=d?getComputedStyle(d):null,r(d)},[])}}function It(e){return e?.animationName||"none"}function El(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Pl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_n=Pl.reduce((e,t)=>{const r=re(`Primitive.${t}`),o=u.forwardRef((n,s)=>{const{asChild:a,...i}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Tt="Popover",[Dn]=Ie(Tt,[vt]),rt=vt(),[Nl,Ae]=Dn(Tt),Ln=e=>{const{__scopePopover:t,children:r,open:o,defaultOpen:n,onOpenChange:s,modal:a=!1}=e,i=rt(t),c=u.useRef(null),[d,f]=u.useState(!1),[p,g]=et({prop:o,defaultProp:n??!1,onChange:s,caller:Tt});return l.jsx(Lo,{...i,children:l.jsx(Nl,{scope:t,contentId:Xe(),triggerRef:c,open:p,onOpenChange:g,onOpenToggle:u.useCallback(()=>g(h=>!h),[g]),hasCustomAnchor:d,onCustomAnchorAdd:u.useCallback(()=>f(!0),[]),onCustomAnchorRemove:u.useCallback(()=>f(!1),[]),modal:a,children:r})})};Ln.displayName=Tt;var Fn="PopoverAnchor",kl=u.forwardRef((e,t)=>{const{__scopePopover:r,...o}=e,n=Ae(Fn,r),s=rt(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=n;return u.useEffect(()=>(a(),()=>i()),[a,i]),l.jsx(ar,{...s,...o,ref:t})});kl.displayName=Fn;var $n="PopoverTrigger",Bn=u.forwardRef((e,t)=>{const{__scopePopover:r,...o}=e,n=Ae($n,r),s=rt(r),a=Y(t,n.triggerRef),i=l.jsx(_n.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":Hn(n.open),...o,ref:a,onClick:W(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?i:l.jsx(ar,{asChild:!0,...s,children:i})});Bn.displayName=$n;var wr="PopoverPortal",[Al,Ol]=Dn(wr,{forceMount:void 0}),Rn=e=>{const{__scopePopover:t,forceMount:r,children:o,container:n}=e,s=Ae(wr,t);return l.jsx(Al,{scope:t,forceMount:r,children:l.jsx(Ot,{present:r||s.open,children:l.jsx(ir,{asChild:!0,container:n,children:o})})})};Rn.displayName=wr;var Ge="PopoverContent",zn=u.forwardRef((e,t)=>{const r=Ol(Ge,e.__scopePopover),{forceMount:o=r.forceMount,...n}=e,s=Ae(Ge,e.__scopePopover);return l.jsx(Ot,{present:o||s.open,children:s.modal?l.jsx(Tl,{...n,ref:t}):l.jsx(Ml,{...n,ref:t})})});zn.displayName=Ge;var Il=re("PopoverContent.RemoveScroll"),Tl=u.forwardRef((e,t)=>{const r=Ae(Ge,e.__scopePopover),o=u.useRef(null),n=Y(t,o),s=u.useRef(!1);return u.useEffect(()=>{const a=o.current;if(a)return Wo(a)},[]),l.jsx(pr,{as:Il,allowPinchZoom:!0,children:l.jsx(Wn,{...e,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:W(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:W(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,d=i.button===2||c;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:W(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ml=u.forwardRef((e,t)=>{const r=Ae(Ge,e.__scopePopover),o=u.useRef(!1),n=u.useRef(!1);return l.jsx(Wn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||r.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,n.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;r.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),Wn=u.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,...p}=e,g=Ae(Ge,r),h=rt(r);return Kr(),l.jsx(Gt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:n,onUnmountAutoFocus:s,children:l.jsx(Vt,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:l.jsx(Fo,{"data-state":Hn(g.open),role:"dialog",id:g.contentId,...h,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Vn="PopoverClose",_l=u.forwardRef((e,t)=>{const{__scopePopover:r,...o}=e,n=Ae(Vn,r);return l.jsx(_n.button,{type:"button",...o,ref:t,onClick:W(e.onClick,()=>n.onOpenChange(!1))})});_l.displayName=Vn;var Dl="PopoverArrow",Ll=u.forwardRef((e,t)=>{const{__scopePopover:r,...o}=e,n=rt(r);return l.jsx($o,{...n,...o,ref:t})});Ll.displayName=Dl;function Hn(e){return e?"open":"closed"}var Fl=Ln,$l=Bn,Bl=Rn,Rl=zn;function Un(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=Un(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function zl(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=Un(e))&&(o&&(o+=" "),o+=t);return o}const Wl=(e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r},Vl=(e,t)=>({classGroupId:e,validator:t}),jn=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Mt="-",Gn=[],Hl="arbitrary..",Ul=e=>{const t=Gl(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return jl(a);const i=a.split(Mt),c=i[0]===""&&i.length>1?1:0;return Kn(i,c,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const c=o[a],d=r[a];return c?d?Wl(d,c):c:d||Gn}return r[a]||Gn}}},Kn=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const n=e[t],s=r.nextPart.get(n);if(s){const d=Kn(e,t+1,s);if(d)return d}const a=r.validators;if(a===null)return;const i=t===0?e.join(Mt):e.slice(t).join(Mt),c=a.length;for(let d=0;d<c;d++){const f=a[d];if(f.validator(i))return f.classGroupId}},jl=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?Hl+o:void 0})(),Gl=e=>{const{theme:t,classGroups:r}=e;return Kl(r,t)},Kl=(e,t)=>{const r=jn();for(const o in e){const n=e[o];xr(n,r,o,t)}return r},xr=(e,t,r,o)=>{const n=e.length;for(let s=0;s<n;s++){const a=e[s];Yl(a,t,r,o)}},Yl=(e,t,r,o)=>{if(typeof e=="string"){ql(e,t,r);return}if(typeof e=="function"){Xl(e,t,r,o);return}Zl(e,t,r,o)},ql=(e,t,r)=>{const o=e===""?t:Yn(t,e);o.classGroupId=r},Xl=(e,t,r,o)=>{if(Ql(e)){xr(e(o),t,r,o);return}t.validators===null&&(t.validators=[]),t.validators.push(Vl(r,e))},Zl=(e,t,r,o)=>{const n=Object.entries(e),s=n.length;for(let a=0;a<s;a++){const[i,c]=n[a];xr(c,Yn(t,i),r,o)}},Yn=(e,t)=>{let r=e;const o=t.split(Mt),n=o.length;for(let s=0;s<n;s++){const a=o[s];let i=r.nextPart.get(a);i||(i=jn(),r.nextPart.set(a,i)),r=i}return r},Ql=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Jl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),o=Object.create(null);const n=(s,a)=>{r[s]=a,t++,t>e&&(t=0,o=r,r=Object.create(null))};return{get(s){let a=r[s];if(a!==void 0)return a;if((a=o[s])!==void 0)return n(s,a),a},set(s,a){s in r?r[s]=a:n(s,a)}}},Sr="!",qn=":",ed=[],Xn=(e,t,r,o,n)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:n}),td=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=n=>{const s=[];let a=0,i=0,c=0,d;const f=n.length;for(let m=0;m<f;m++){const v=n[m];if(a===0&&i===0){if(v===qn){s.push(n.slice(c,m)),c=m+1;continue}if(v==="/"){d=m;continue}}v==="["?a++:v==="]"?a--:v==="("?i++:v===")"&&i--}const p=s.length===0?n:n.slice(c);let g=p,h=!1;p.endsWith(Sr)?(g=p.slice(0,-1),h=!0):p.startsWith(Sr)&&(g=p.slice(1),h=!0);const b=d&&d>c?d-c:void 0;return Xn(s,h,g,b)};if(t){const n=t+qn,s=o;o=a=>a.startsWith(n)?s(a.slice(n.length)):Xn(ed,!1,a,void 0,!0)}if(r){const n=o;o=s=>r({className:s,parseClassName:n})}return o},rd=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,o)=>{t.set(r,1e6+o)}),r=>{const o=[];let n=[];for(let s=0;s<r.length;s++){const a=r[s],i=a[0]==="[",c=t.has(a);i||c?(n.length>0&&(n.sort(),o.push(...n),n=[]),o.push(a)):n.push(a)}return n.length>0&&(n.sort(),o.push(...n)),o}},od=e=>({cache:Jl(e.cacheSize),parseClassName:td(e),sortModifiers:rd(e),...Ul(e)}),nd=/\s+/,sd=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:s}=t,a=[],i=e.trim().split(nd);let c="";for(let d=i.length-1;d>=0;d-=1){const f=i[d],{isExternal:p,modifiers:g,hasImportantModifier:h,baseClassName:b,maybePostfixModifierPosition:m}=r(f);if(p){c=f+(c.length>0?" "+c:c);continue}let v=!!m,y=o(v?b.substring(0,m):b);if(!y){if(!v){c=f+(c.length>0?" "+c:c);continue}if(y=o(b),!y){c=f+(c.length>0?" "+c:c);continue}v=!1}const w=g.length===0?"":g.length===1?g[0]:s(g).join(":"),x=h?w+Sr:w,C=x+y;if(a.indexOf(C)>-1)continue;a.push(C);const k=n(y,v);for(let N=0;N<k.length;++N){const P=k[N];a.push(x+P)}c=f+(c.length>0?" "+c:c)}return c},ad=(...e)=>{let t=0,r,o,n="";for(;t<e.length;)(r=e[t++])&&(o=Zn(r))&&(n&&(n+=" "),n+=o);return n},Zn=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=Zn(e[o]))&&(r&&(r+=" "),r+=t);return r},id=(e,...t)=>{let r,o,n,s;const a=c=>{const d=t.reduce((f,p)=>p(f),e());return r=od(d),o=r.cache.get,n=r.cache.set,s=i,i(c)},i=c=>{const d=o(c);if(d)return d;const f=sd(c,r);return n(c,f),f};return s=a,(...c)=>s(ad(...c))},cd=[],Q=e=>{const t=r=>r[e]||cd;return t.isThemeGetter=!0,t},Qn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Jn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ld=/^\d+\/\d+$/,dd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ud=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,fd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,md=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ke=e=>ld.test(e),z=e=>!!e&&!Number.isNaN(Number(e)),Oe=e=>!!e&&Number.isInteger(Number(e)),Cr=e=>e.endsWith("%")&&z(e.slice(0,-1)),we=e=>dd.test(e),hd=()=>!0,gd=e=>ud.test(e)&&!fd.test(e),es=()=>!1,vd=e=>pd.test(e),bd=e=>md.test(e),yd=e=>!_(e)&&!D(e),wd=e=>Ye(e,ss,es),_=e=>Qn.test(e),De=e=>Ye(e,as,gd),Er=e=>Ye(e,Pd,z),ts=e=>Ye(e,os,es),xd=e=>Ye(e,ns,bd),_t=e=>Ye(e,is,vd),D=e=>Jn.test(e),ot=e=>qe(e,as),Sd=e=>qe(e,Nd),rs=e=>qe(e,os),Cd=e=>qe(e,ss),Ed=e=>qe(e,ns),Dt=e=>qe(e,is,!0),Ye=(e,t,r)=>{const o=Qn.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},qe=(e,t,r=!1)=>{const o=Jn.exec(e);return o?o[1]?t(o[1]):r:!1},os=e=>e==="position"||e==="percentage",ns=e=>e==="image"||e==="url",ss=e=>e==="length"||e==="size"||e==="bg-size",as=e=>e==="length",Pd=e=>e==="number",Nd=e=>e==="family-name",is=e=>e==="shadow",kd=id(()=>{const e=Q("color"),t=Q("font"),r=Q("text"),o=Q("font-weight"),n=Q("tracking"),s=Q("leading"),a=Q("breakpoint"),i=Q("container"),c=Q("spacing"),d=Q("radius"),f=Q("shadow"),p=Q("inset-shadow"),g=Q("text-shadow"),h=Q("drop-shadow"),b=Q("blur"),m=Q("perspective"),v=Q("aspect"),y=Q("ease"),w=Q("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...C(),D,_],N=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],S=()=>[D,_,c],$=()=>[Ke,"full","auto",...S()],E=()=>[Oe,"none","subgrid",D,_],O=()=>["auto",{span:["full",Oe,D,_]},Oe,D,_],I=()=>[Oe,"auto",D,_],L=()=>["auto","min","max","fr",D,_],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],T=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...S()],R=()=>[Ke,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],A=()=>[e,D,_],U=()=>[...C(),rs,ts,{position:[D,_]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ge=()=>["auto","cover","contain",Cd,wd,{size:[D,_]}],xe=()=>[Cr,ot,De],X=()=>["","none","full",d,D,_],q=()=>["",z,ot,De],de=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>[z,Cr,rs,ts],G=()=>["","none",b,D,_],Z=()=>["none",z,D,_],H=()=>["none",z,D,_],j=()=>[z,D,_],K=()=>[Ke,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[we],breakpoint:[we],color:[hd],container:[we],"drop-shadow":[we],ease:["in","out","in-out"],font:[yd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[we],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[we],shadow:[we],spacing:["px",z],text:[we],"text-shadow":[we],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ke,_,D,v]}],container:["container"],columns:[{columns:[z,_,D,i]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Oe,"auto",D,_]}],basis:[{basis:[Ke,"full","auto",i,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[z,Ke,"auto","initial","none",_]}],grow:[{grow:["",z,D,_]}],shrink:[{shrink:["",z,D,_]}],order:[{order:[Oe,"first","last","none",D,_]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...T(),"normal"]}],"justify-self":[{"justify-self":["auto",...T()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...T(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...T(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...T(),"baseline"]}],"place-self":[{"place-self":["auto",...T()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:R()}],w:[{w:[i,"screen",...R()]}],"min-w":[{"min-w":[i,"screen","none",...R()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...R()]}],h:[{h:["screen","lh",...R()]}],"min-h":[{"min-h":["screen","lh","none",...R()]}],"max-h":[{"max-h":["screen","lh",...R()]}],"font-size":[{text:["base",r,ot,De]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,D,Er]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cr,_]}],"font-family":[{font:[Sd,_,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,D,_]}],"line-clamp":[{"line-clamp":[z,"none",D,Er]}],leading:[{leading:[s,...S()]}],"list-image":[{"list-image":["none",D,_]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",D,_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[z,"from-font","auto",D,De]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[z,"auto",D,_]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",D,_]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",D,_]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:ge()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Oe,D,_],radial:["",D,_],conic:[Oe,D,_]},Ed,xd]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:xe()}],"gradient-via-pos":[{via:xe()}],"gradient-to-pos":[{to:xe()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[z,D,_]}],"outline-w":[{outline:["",z,ot,De]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",f,Dt,_t]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",p,Dt,_t]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[z,De]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",g,Dt,_t]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[z,D,_]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[z]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[D,_]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[z]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:ge()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",D,_]}],filter:[{filter:["","none",D,_]}],blur:[{blur:G()}],brightness:[{brightness:[z,D,_]}],contrast:[{contrast:[z,D,_]}],"drop-shadow":[{"drop-shadow":["","none",h,Dt,_t]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",z,D,_]}],"hue-rotate":[{"hue-rotate":[z,D,_]}],invert:[{invert:["",z,D,_]}],saturate:[{saturate:[z,D,_]}],sepia:[{sepia:["",z,D,_]}],"backdrop-filter":[{"backdrop-filter":["","none",D,_]}],"backdrop-blur":[{"backdrop-blur":G()}],"backdrop-brightness":[{"backdrop-brightness":[z,D,_]}],"backdrop-contrast":[{"backdrop-contrast":[z,D,_]}],"backdrop-grayscale":[{"backdrop-grayscale":["",z,D,_]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[z,D,_]}],"backdrop-invert":[{"backdrop-invert":["",z,D,_]}],"backdrop-opacity":[{"backdrop-opacity":[z,D,_]}],"backdrop-saturate":[{"backdrop-saturate":[z,D,_]}],"backdrop-sepia":[{"backdrop-sepia":["",z,D,_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",D,_]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[z,"initial",D,_]}],ease:[{ease:["linear","initial",y,D,_]}],delay:[{delay:[z,D,_]}],animate:[{animate:["none",w,D,_]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,D,_]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Z()}],"rotate-x":[{"rotate-x":Z()}],"rotate-y":[{"rotate-y":Z()}],"rotate-z":[{"rotate-z":Z()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":["scale-3d"],skew:[{skew:j()}],"skew-x":[{"skew-x":j()}],"skew-y":[{"skew-y":j()}],transform:[{transform:[D,_,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",D,_]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",D,_]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[z,ot,De,Er]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Lt(...e){return kd(zl(e))}function Pr({...e}){return l.jsx(Fl,{"data-slot":"popover",...e})}function Nr({...e}){return l.jsx($l,{"data-slot":"popover-trigger",...e})}function kr({className:e,align:t="center",sideOffset:r=4,...o}){return l.jsx(Bl,{children:l.jsx(Rl,{"data-slot":"popover-content",align:t,sideOffset:r,className:Lt("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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o})})}function Ad({field:e,formValues:t,handleChange:r,handleBlur:o,error:n}){const[s,a]=V.useState(!1),i=t[e.name]??{from:null,to:null},c=f=>r(e.name,f),d=()=>r(e.name,{from:null,to:null});return l.jsxs("div",{children:[l.jsxs(Pr,{open:s,onOpenChange:a,children:[l.jsx(Nr,{asChild:!0,children:l.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),onKeyDown:f=>f.key==="Enter"&&a(!0),className:`
48
53
  inline-flex items-center justify-between gap-2
49
54
  w-full h-9 rounded-md border bg-white
50
55
  px-3 py-2 text-sm font-normal shadow-sm
51
56
  hover:bg-gray-50 hover:text-gray-900
52
57
  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
53
58
  disabled:cursor-not-allowed disabled:opacity-50
54
- ${r?"border-red-500 focus-visible:ring-red-500":"border-gray-300 focus-visible:ring-blue-500"}
55
- `,children:[i.from?i.to?l.jsxs("span",{children:[i.from.toLocaleDateString()," –"," ",i.to.toLocaleDateString()]}):l.jsx("span",{children:i.from.toLocaleDateString()}):l.jsx("span",{className:"text-muted-foreground",children:e.placeholder||"Select date range"}),l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-chevron-down opacity-70",children:l.jsx("path",{d:"m6 9 6 6 6-6"})})]})}),l.jsxs(No,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto",children:[l.jsx($o.DayPicker,{mode:"range",selected:i,onSelect:c,showOutsideDays:!0,className:"rounded-md bg-white p-3 text-xs"}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 p-3",children:[l.jsx("button",{type:"button",onClick:d,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),l.jsx("button",{type:"button",onClick:()=>a(!1),className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})]}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}function rs({field:e,formValues:t,error:o,fileUploads:n,setFileUploads:r,fileInputRefs:s,handleChange:a,onFieldsChange:i,api_URL:c}){const d=e.type==="multifile",f=n[e.name]||{},m=t[e.name],g=d?m||[]:[m].filter(Boolean),h=e.disabled&&e.disabled(t),b=`px-4 py-2 bg-gray-100 border rounded hover:bg-gray-200 ${h?"cursor-not-allowed":""}`,p=c?`${c}uploads`:null;!p&&e.uploadEndpoint&&console.error(`api_URL prop is required when using FileField with upload functionality for field "${e.name}"`);const v=P=>{if(P===0)return"0 Bytes";const k=1024,C=["Bytes","KB","MB","GB"],F=Math.floor(Math.log(P)/Math.log(k));return parseFloat((P/Math.pow(k,F)).toFixed(2))+" "+C[F]},y=async(P,k)=>{const C=new FormData;C.append("file",P);const F=await fetch(`${p}`,{method:"POST",body:C});if(!F.ok)throw st.toast.error("Upload failed"),new Error("Upload failed");return await F.json()},w=async(P,k)=>{if(!k)return;if(P.maxSize&&k.size>P.maxSize)throw new Error(`File size must not exceed ${v(P.maxSize)}`);const C=await y(k,P.name),F={...t,[P.name]:C};a(P.name,C),i(F)},x=async(P,k)=>{const C=t[P.name]||[];if(C.length+k.length>P.maxFiles)throw new Error(`Maximum ${P.maxFiles} files allowed`);k.forEach(O=>{if(P.maxSize&&O.size>P.maxSize)throw new Error(`Each file must not exceed ${v(P.maxSize)}`)});const F=await Promise.all(k.map(O=>y(O,P.name))),E=[...C,...F];a(P.name,E),i({...t,[P.name]:E})},S=async(P,k)=>{const C=Array.from(k);try{e.type==="file"?await w(e,C[0]):e.type==="multifile"&&await x(e,C),s.current[P]&&(s.current[P].value="")}catch(F){st.toast.error(`Upload failed: ${F.message}`)}},N=async(P,k)=>{let C;e.type==="file"?C="":C=(t[P]||[]).filter(E=>E!==k),a(P,C),i({...t,[P]:C}),s.current[P]&&(s.current[P].value="")};return l.jsxs("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,children:[l.jsxs("label",{className:"block font-medium mb-1",children:[e.label,e.required&&l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"items-center space-x-2",children:[l.jsxs("button",{type:"button",disabled:h,onClick:()=>s.current[e.name].click(),className:b,children:["Choose ",d?"Files":"File"]}),d&&g.length>0&&l.jsxs("span",{className:"text-sm text-gray-600",children:[g.length," of ",e.maxFiles," files uploaded"]})]}),l.jsx("input",{ref:P=>s.current[e.name]=P,type:"file",accept:e.accept,multiple:d,className:"hidden",onChange:P=>S(e.name,P.target.files)}),l.jsx("div",{className:"space-y-2",children:g.map((P,k)=>{const C=Object.values(f).find(F=>F.file===P);return l.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[C&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-sm",children:C.fileName}),l.jsxs("span",{className:"text-xs text-gray-500",children:["(",v(C.fileSize),")"]})]}),!C&&l.jsx("span",{className:"text-sm",children:P.original_name})]}),l.jsx("button",{type:"button",onClick:()=>N(e.name,P),className:"text-red-500 hover:text-red-700 ml-3",children:"Remove"})]},P)})}),Object.entries(f).map(([P,k])=>k.status==="uploading"?l.jsxs("div",{className:"relative pt-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:["Uploading ",P]}),l.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:[k.progress,"%"]})]}),l.jsx("div",{className:"overflow-hidden h-2 mt-1 text-xs flex rounded bg-blue-200",children:l.jsx("div",{className:"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500",style:{width:`${k.progress}%`}})})]},P):null)]}),o&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:o})]},e.name)}function pd({field:e,formValues:t,handleChange:o,handleBlur:n,error:r,charCount:s,setCharCounts:a}){const i=V.useRef(null),c=t[e.name]||"",d=typeof e.disabled=="function"?e.disabled(t):e.disabled||e.readOnly,f=()=>{const g=i.current;g&&(g.style.height="auto",g.style.height=`${g.scrollHeight+2}px`)};V.useEffect(()=>{f()},[c]);const m=g=>{o(e.name,g.target.value),f(),a&&a(h=>({...h,[e.name]:g.target.value.length}))};return l.jsxs("div",{className:"space-y-2",children:[l.jsx("textarea",{...e.props,ref:i,id:e.name,name:e.name,placeholder:e.placeholder||"",value:c,onChange:m,onBlur:()=>n(e.name),disabled:d,maxLength:e.maxLength,rows:e.rows||3,className:`flex w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none overflow-y-auto ${r?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${d?"bg-gray-50 text-gray-500":"bg-background"}`,style:{minHeight:"80px",maxHeight:"400px"}}),l.jsx("div",{className:"flex justify-between items-center",children:e.maxLength&&!e.readOnly&&l.jsxs("span",{className:"text-xs text-gray-500",children:[s||0,"/",e.maxLength," characters"]})}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}function md({field:e,formValues:t,handleChange:o,handleBlur:n,error:r}){return l.jsxs("div",{children:[l.jsx("input",{type:"datetime-local",value:e.value||"",onChange:s=>o(e.name,s.target.value),onBlur:n,className:`border rounded px-3 py-2 w-full ${r?"border-red-500 focus:ring-red-500":"border-gray-300 focus:ring-blue-500"}`,placeholder:"Select date and time"}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r}),l.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Note: Install @mui/x-date-pickers for enhanced date picker functionality"})]})}var hd=Symbol.for("react.lazy"),Ft=u[" use ".trim().toString()];function gd(e){return typeof e=="object"&&e!==null&&"then"in e}function ss(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===hd&&"_payload"in e&&gd(e._payload)}function vd(e){const t=bd(e),o=u.forwardRef((n,r)=>{let{children:s,...a}=n;ss(s)&&typeof Ft=="function"&&(s=Ft(s._payload));const i=u.Children.toArray(s),c=i.find(wd);if(c){const d=c.props.children,f=i.map(m=>m===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:m);return l.jsx(t,{...a,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return l.jsx(t,{...a,ref:r,children:s})});return o.displayName=`${e}.Slot`,o}function bd(e){const t=u.forwardRef((o,n)=>{let{children:r,...s}=o;if(ss(r)&&typeof Ft=="function"&&(r=Ft(r._payload)),u.isValidElement(r)){const a=Cd(r),i=xd(s,r.props);return r.type!==u.Fragment&&(i.ref=n?Rt(n,a):a),u.cloneElement(r,i)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yd=Symbol("radix.slottable");function wd(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yd}function xd(e,t){const o={...t};for(const n in t){const r=e[n],s=t[n];/^on[A-Z]/.test(n)?r&&s?o[n]=(...i)=>{const c=s(...i);return r(...i),c}:r&&(o[n]=r):n==="style"?o[n]={...r,...s}:n==="className"&&(o[n]=[r,s].filter(Boolean).join(" "))}return{...e,...o}}function Cd(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Sd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ed=Sd.reduce((e,t)=>{const o=vd(`Primitive.${t}`),n=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),kd="Separator",as="horizontal",Pd=["horizontal","vertical"],is=u.forwardRef((e,t)=>{const{decorative:o,orientation:n=as,...r}=e,s=Nd(n)?n:as,i=o?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return l.jsx(Ed.div,{"data-orientation":s,...i,...r,ref:t})});is.displayName=kd;function Nd(e){return Pd.includes(e)}var Ad=is;function Ao({className:e,orientation:t="horizontal",decorative:o=!0,...n}){return l.jsx(Ad,{"data-slot":"separator",decorative:o,orientation:t,className:Dt("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...n})}function Od({field:e}){return e?.label?l.jsxs("div",{className:"relative flex items-center py-4",children:[l.jsx(Ao,{className:"flex-1 h-px bg-gray-300"}),l.jsx("span",{className:"px-3 font-medium text-gray-600 bg-white",children:e.label}),l.jsx(Ao,{className:"flex-1 h-px bg-gray-300"})]}):l.jsx(Ao,{className:"my-4 h-px bg-gray-300"})}var Oo="rovingFocusGroup.onEntryFocus",Id={bubbles:!1,cancelable:!0},rt="RovingFocusGroup",[Io,cs,Td]=Wo(rt),[Md,ls]=Oe(rt,[Td]),[_d,Ld]=Md(rt),ds=u.forwardRef((e,t)=>l.jsx(Io.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Io.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Dd,{...e,ref:t})})}));ds.displayName=rt;var Dd=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:o,orientation:n,loop:r=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...m}=e,g=u.useRef(null),h=q(t,g),b=Bt(s),[p,v]=et({prop:a,defaultProp:i??null,onChange:c,caller:rt}),[y,w]=u.useState(!1),x=xe(d),S=cs(o),N=u.useRef(!1),[P,k]=u.useState(0);return u.useEffect(()=>{const C=g.current;if(C)return C.addEventListener(Oo,x),()=>C.removeEventListener(Oo,x)},[x]),l.jsx(_d,{scope:o,orientation:n,dir:b,loop:r,currentTabStopId:p,onItemFocus:u.useCallback(C=>v(C),[v]),onItemShiftTab:u.useCallback(()=>w(!0),[]),onFocusableItemAdd:u.useCallback(()=>k(C=>C+1),[]),onFocusableItemRemove:u.useCallback(()=>k(C=>C-1),[]),children:l.jsx(U.div,{tabIndex:y||P===0?-1:0,"data-orientation":n,...m,ref:h,style:{outline:"none",...e.style},onMouseDown:W(e.onMouseDown,()=>{N.current=!0}),onFocus:W(e.onFocus,C=>{const F=!N.current;if(C.target===C.currentTarget&&F&&!y){const E=new CustomEvent(Oo,Id);if(C.currentTarget.dispatchEvent(E),!E.defaultPrevented){const O=S().filter($=>$.focusable),I=O.find($=>$.active),L=O.find($=>$.id===p),D=[I,L,...O].filter(Boolean).map($=>$.ref.current);ps(D,f)}}N.current=!1}),onBlur:W(e.onBlur,()=>w(!1))})})}),us="RovingFocusGroupItem",fs=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:o,focusable:n=!0,active:r=!1,tabStopId:s,children:a,...i}=e,c=Xe(),d=s||c,f=Ld(us,o),m=f.currentTabStopId===d,g=cs(o),{onFocusableItemAdd:h,onFocusableItemRemove:b,currentTabStopId:p}=f;return u.useEffect(()=>{if(n)return h(),()=>b()},[n,h,b]),l.jsx(Io.ItemSlot,{scope:o,id:d,focusable:n,active:r,children:l.jsx(U.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:W(e.onMouseDown,v=>{n?f.onItemFocus(d):v.preventDefault()}),onFocus:W(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:W(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){f.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=Rd(v,f.orientation,f.dir);if(y!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let x=g().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const S=x.indexOf(v.currentTarget);x=f.loop?Bd(x,S+1):x.slice(S+1)}setTimeout(()=>ps(x))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:p!=null}):a})})});fs.displayName=us;var Fd={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $d(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Rd(e,t,o){const n=$d(e.key,o);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Fd[n]}function ps(e,t=!1){const o=document.activeElement;for(const n of e)if(n===o||(n.focus({preventScroll:t}),document.activeElement!==o))return}function Bd(e,t){return e.map((o,n)=>e[(t+n)%e.length])}var zd=ds,Wd=fs,To="Radio",[Vd,ms]=Oe(To),[Hd,Ud]=Vd(To),hs=u.forwardRef((e,t)=>{const{__scopeRadio:o,name:n,checked:r=!1,required:s,disabled:a,value:i="on",onCheck:c,form:d,...f}=e,[m,g]=u.useState(null),h=q(t,v=>g(v)),b=u.useRef(!1),p=m?d||!!m.closest("form"):!0;return l.jsxs(Hd,{scope:o,checked:r,disabled:a,children:[l.jsx(U.button,{type:"button",role:"radio","aria-checked":r,"data-state":ys(r),"data-disabled":a?"":void 0,disabled:a,value:i,...f,ref:h,onClick:W(e.onClick,v=>{r||c?.(),p&&(b.current=v.isPropagationStopped(),b.current||v.stopPropagation())})}),p&&l.jsx(bs,{control:m,bubbles:!b.current,name:n,value:i,checked:r,required:s,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});hs.displayName=To;var gs="RadioIndicator",vs=u.forwardRef((e,t)=>{const{__scopeRadio:o,forceMount:n,...r}=e,s=Ud(gs,o);return l.jsx(Ot,{present:n||s.checked,children:l.jsx(U.span,{"data-state":ys(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})})});vs.displayName=gs;var jd="RadioBubbleInput",bs=u.forwardRef(({__scopeRadio:e,control:t,checked:o,bubbles:n=!0,...r},s)=>{const a=u.useRef(null),i=q(a,s),c=Fn(o),d=Sn(t);return u.useEffect(()=>{const f=a.current;if(!f)return;const m=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==o&&h){const b=new Event("click",{bubbles:n});h.call(f,o),f.dispatchEvent(b)}},[c,o,n]),l.jsx(U.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...r,tabIndex:-1,ref:i,style:{...r.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});bs.displayName=jd;function ys(e){return e?"checked":"unchecked"}var Gd=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],$t="RadioGroup",[Kd]=Oe($t,[ls,ms]),ws=ls(),xs=ms(),[Yd,qd]=Kd($t),Cs=u.forwardRef((e,t)=>{const{__scopeRadioGroup:o,name:n,defaultValue:r,value:s,required:a=!1,disabled:i=!1,orientation:c,dir:d,loop:f=!0,onValueChange:m,...g}=e,h=ws(o),b=Bt(d),[p,v]=et({prop:s,defaultProp:r??null,onChange:m,caller:$t});return l.jsx(Yd,{scope:o,name:n,required:a,disabled:i,value:p,onValueChange:v,children:l.jsx(zd,{asChild:!0,...h,orientation:c,dir:b,loop:f,children:l.jsx(U.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":i?"":void 0,dir:b,...g,ref:t})})})});Cs.displayName=$t;var Ss="RadioGroupItem",Es=u.forwardRef((e,t)=>{const{__scopeRadioGroup:o,disabled:n,...r}=e,s=qd(Ss,o),a=s.disabled||n,i=ws(o),c=xs(o),d=u.useRef(null),f=q(t,d),m=s.value===r.value,g=u.useRef(!1);return u.useEffect(()=>{const h=p=>{Gd.includes(p.key)&&(g.current=!0)},b=()=>g.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",b)}},[]),l.jsx(Wd,{asChild:!0,...i,focusable:!a,active:m,children:l.jsx(hs,{disabled:a,required:s.required,checked:m,...c,...r,name:s.name,ref:f,onCheck:()=>s.onValueChange(r.value),onKeyDown:W(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:W(r.onFocus,()=>{g.current&&d.current?.click()})})})});Es.displayName=Ss;var Xd="RadioGroupIndicator",ks=u.forwardRef((e,t)=>{const{__scopeRadioGroup:o,...n}=e,r=xs(o);return l.jsx(vs,{...r,...n,ref:t})});ks.displayName=Xd;var Zd=Cs,Qd=Es,Jd=ks;function eu({className:e,...t}){return l.jsx(Zd,{"data-slot":"radio-group",className:Dt("grid gap-3",e),...t})}function tu({className:e,...t}){return l.jsx(Qd,{"data-slot":"radio-group-item",className:Dt("border-input text-primary 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 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx(Jd,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:l.jsx(tl,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function ou({field:e,formValues:t,handleChange:o,handleBlur:n,error:r}){const s=t[e.name]||"",a=typeof e.disabled=="function"?e.disabled(t):e.disabled,i=e.options||[],c=e.inline||!1;return l.jsxs(l.Fragment,{children:[l.jsx(eu,{value:s,onValueChange:d=>o(e.name,d),onBlur:()=>n(e.name),disabled:a,className:c?"flex flex-wrap gap-4":"space-y-3","aria-label":e.label||e.name,children:i.map(d=>{const f=typeof d=="object"?d.value:d,m=typeof d=="object"?d.label:d,g=typeof d=="object"?d.description:null,h=`${e.name}-${f}`;return l.jsxs("div",{className:"relative flex items-start",children:[l.jsx("div",{className:"flex h-6 items-center",children:l.jsx(tu,{value:f,id:h,disabled:a,className:`
59
+ ${n?"border-red-500 focus-visible:ring-red-500":"border-gray-300 focus-visible:ring-blue-500"}
60
+ `,children:[i.from?i.to?l.jsxs("span",{children:[i.from.toLocaleDateString()," –"," ",i.to.toLocaleDateString()]}):l.jsx("span",{children:i.from.toLocaleDateString()}):l.jsx("span",{className:"text-muted-foreground",children:e.placeholder||"Select date range"}),l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-chevron-down opacity-70",children:l.jsx("path",{d:"m6 9 6 6 6-6"})})]})}),l.jsxs(kr,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto",children:[l.jsx($r.DayPicker,{mode:"range",selected:i,onSelect:c,showOutsideDays:!0,className:"rounded-md bg-white p-3 text-xs"}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 p-3",children:[l.jsx("button",{type:"button",onClick:d,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),l.jsx("button",{type:"button",onClick:()=>a(!1),className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})]}),n&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:n})]})}function cs({field:e,formValues:t,error:r,fileUploads:o,setFileUploads:n,fileInputRefs:s,handleChange:a,onFieldsChange:i,api_URL:c}){const d=e.type==="multifile",f=o[e.name]||{},p=t[e.name],g=d?p||[]:[p].filter(Boolean),h=e.disabled&&e.disabled(t),b=`px-4 py-2 bg-gray-100 border rounded hover:bg-gray-200 ${h?"cursor-not-allowed":""}`,m=c?`${c}uploads`:null;!m&&e.uploadEndpoint&&console.error(`api_URL prop is required when using FileField with upload functionality for field "${e.name}"`);const v=N=>{if(N===0)return"0 Bytes";const P=1024,S=["Bytes","KB","MB","GB"],$=Math.floor(Math.log(N)/Math.log(P));return parseFloat((N/Math.pow(P,$)).toFixed(2))+" "+S[$]},y=async(N,P)=>{const S=new FormData;S.append("file",N);const $=await fetch(`${m}`,{method:"POST",body:S});if(!$.ok)throw st.toast.error("Upload failed"),new Error("Upload failed");return await $.json()},w=async(N,P)=>{if(!P)return;if(N.maxSize&&P.size>N.maxSize)throw new Error(`File size must not exceed ${v(N.maxSize)}`);const S=await y(P,N.name),$={...t,[N.name]:S};a(N.name,S),i($)},x=async(N,P)=>{const S=t[N.name]||[];if(S.length+P.length>N.maxFiles)throw new Error(`Maximum ${N.maxFiles} files allowed`);P.forEach(O=>{if(N.maxSize&&O.size>N.maxSize)throw new Error(`Each file must not exceed ${v(N.maxSize)}`)});const $=await Promise.all(P.map(O=>y(O,N.name))),E=[...S,...$];a(N.name,E),i({...t,[N.name]:E})},C=async(N,P)=>{const S=Array.from(P);try{e.type==="file"?await w(e,S[0]):e.type==="multifile"&&await x(e,S),s.current[N]&&(s.current[N].value="")}catch($){st.toast.error(`Upload failed: ${$.message}`)}},k=async(N,P)=>{let S;e.type==="file"?S="":S=(t[N]||[]).filter(E=>E!==P),a(N,S),i({...t,[N]:S}),s.current[N]&&(s.current[N].value="")};return l.jsxs("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,children:[l.jsxs("label",{className:"block font-medium mb-1",children:[e.label,e.required&&l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"items-center space-x-2",children:[l.jsxs("button",{type:"button",disabled:h,onClick:()=>s.current[e.name].click(),className:b,children:["Choose ",d?"Files":"File"]}),d&&g.length>0&&l.jsxs("span",{className:"text-sm text-gray-600",children:[g.length," of ",e.maxFiles," files uploaded"]})]}),l.jsx("input",{ref:N=>s.current[e.name]=N,type:"file",accept:e.accept,multiple:d,className:"hidden",onChange:N=>C(e.name,N.target.files)}),l.jsx("div",{className:"space-y-2",children:g.map((N,P)=>{const S=Object.values(f).find($=>$.file===N);return l.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[S&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-sm",children:S.fileName}),l.jsxs("span",{className:"text-xs text-gray-500",children:["(",v(S.fileSize),")"]})]}),!S&&l.jsx("span",{className:"text-sm",children:N.original_name})]}),l.jsx("button",{type:"button",onClick:()=>k(e.name,N),className:"text-red-500 hover:text-red-700 ml-3",children:"Remove"})]},N)})}),Object.entries(f).map(([N,P])=>P.status==="uploading"?l.jsxs("div",{className:"relative pt-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:["Uploading ",N]}),l.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:[P.progress,"%"]})]}),l.jsx("div",{className:"overflow-hidden h-2 mt-1 text-xs flex rounded bg-blue-200",children:l.jsx("div",{className:"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500",style:{width:`${P.progress}%`}})})]},N):null)]}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]},e.name)}function Od({field:e,formValues:t,handleChange:r,handleBlur:o,error:n,charCount:s,setCharCounts:a}){const i=V.useRef(null),c=t[e.name]||"",d=typeof e.disabled=="function"?e.disabled(t):e.disabled||e.readOnly,f=()=>{const g=i.current;g&&(g.style.height="auto",g.style.height=`${g.scrollHeight+2}px`)};V.useEffect(()=>{f()},[c]);const p=g=>{r(e.name,g.target.value),f(),a&&a(h=>({...h,[e.name]:g.target.value.length}))};return l.jsxs("div",{className:"space-y-2",children:[l.jsx("textarea",{...e.props,ref:i,id:e.name,name:e.name,placeholder:e.placeholder||"",value:c,onChange:p,onBlur:()=>o(e.name),disabled:d,maxLength:e.maxLength,rows:e.rows||3,className:`flex w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none overflow-y-auto ${n?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${d?"bg-gray-50 text-gray-500":"bg-background"}`,style:{minHeight:"80px",maxHeight:"400px"}}),l.jsx("div",{className:"flex justify-between items-center",children:e.maxLength&&!e.readOnly&&l.jsxs("span",{className:"text-xs text-gray-500",children:[s||0,"/",e.maxLength," characters"]})}),n&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:n})]})}function Id({field:e,formValues:t,handleChange:r,handleBlur:o,error:n}){return l.jsxs("div",{children:[l.jsx("input",{type:"datetime-local",value:e.value||"",onChange:s=>r(e.name,s.target.value),onBlur:o,className:`border rounded px-3 py-2 w-full ${n?"border-red-500 focus:ring-red-500":"border-gray-300 focus:ring-blue-500"}`,placeholder:"Select date and time"}),n&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:n}),l.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Note: Install @mui/x-date-pickers for enhanced date picker functionality"})]})}var Td=Symbol.for("react.lazy"),Ft=u[" use ".trim().toString()];function Md(e){return typeof e=="object"&&e!==null&&"then"in e}function ls(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Td&&"_payload"in e&&Md(e._payload)}function _d(e){const t=Dd(e),r=u.forwardRef((o,n)=>{let{children:s,...a}=o;ls(s)&&typeof Ft=="function"&&(s=Ft(s._payload));const i=u.Children.toArray(s),c=i.find(Fd);if(c){const d=c.props.children,f=i.map(p=>p===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...a,ref:n,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return l.jsx(t,{...a,ref:n,children:s})});return r.displayName=`${e}.Slot`,r}function Dd(e){const t=u.forwardRef((r,o)=>{let{children:n,...s}=r;if(ls(n)&&typeof Ft=="function"&&(n=Ft(n._payload)),u.isValidElement(n)){const a=Bd(n),i=$d(s,n.props);return n.type!==u.Fragment&&(i.ref=o?Rt(o,a):a),u.cloneElement(n,i)}return u.Children.count(n)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ld=Symbol("radix.slottable");function Fd(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ld}function $d(e,t){const r={...t};for(const o in t){const n=e[o],s=t[o];/^on[A-Z]/.test(o)?n&&s?r[o]=(...i)=>{const c=s(...i);return n(...i),c}:n&&(r[o]=n):o==="style"?r[o]={...n,...s}:o==="className"&&(r[o]=[n,s].filter(Boolean).join(" "))}return{...e,...r}}function Bd(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Rd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zd=Rd.reduce((e,t)=>{const r=_d(`Primitive.${t}`),o=u.forwardRef((n,s)=>{const{asChild:a,...i}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Wd="Separator",ds="horizontal",Vd=["horizontal","vertical"],us=u.forwardRef((e,t)=>{const{decorative:r,orientation:o=ds,...n}=e,s=Hd(o)?o:ds,i=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return l.jsx(zd.div,{"data-orientation":s,...i,...n,ref:t})});us.displayName=Wd;function Hd(e){return Vd.includes(e)}var Ud=us;function Ar({className:e,orientation:t="horizontal",decorative:r=!0,...o}){return l.jsx(Ud,{"data-slot":"separator",decorative:r,orientation:t,className:Lt("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...o})}function jd({field:e}){return e?.label?l.jsxs("div",{className:"relative flex items-center py-4",children:[l.jsx(Ar,{className:"flex-1 h-px bg-gray-300"}),l.jsx("span",{className:"px-3 font-medium text-gray-600 bg-white",children:e.label}),l.jsx(Ar,{className:"flex-1 h-px bg-gray-300"})]}):l.jsx(Ar,{className:"my-4 h-px bg-gray-300"})}var Gd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$t=Gd.reduce((e,t)=>{const r=re(`Primitive.${t}`),o=u.forwardRef((n,s)=>{const{asChild:a,...i}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Kd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fs=Kd.reduce((e,t)=>{const r=re(`Primitive.${t}`),o=u.forwardRef((n,s)=>{const{asChild:a,...i}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Or="rovingFocusGroup.onEntryFocus",Yd={bubbles:!1,cancelable:!0},nt="RovingFocusGroup",[Ir,ps,qd]=Wr(nt),[Xd,ms]=Ie(nt,[qd]),[Zd,Qd]=Xd(nt),hs=u.forwardRef((e,t)=>l.jsx(Ir.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Ir.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Jd,{...e,ref:t})})}));hs.displayName=nt;var Jd=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:n=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,g=u.useRef(null),h=Y(t,g),b=zt(s),[m,v]=et({prop:a,defaultProp:i??null,onChange:c,caller:nt}),[y,w]=u.useState(!1),x=Se(d),C=ps(r),k=u.useRef(!1),[N,P]=u.useState(0);return u.useEffect(()=>{const S=g.current;if(S)return S.addEventListener(Or,x),()=>S.removeEventListener(Or,x)},[x]),l.jsx(Zd,{scope:r,orientation:o,dir:b,loop:n,currentTabStopId:m,onItemFocus:u.useCallback(S=>v(S),[v]),onItemShiftTab:u.useCallback(()=>w(!0),[]),onFocusableItemAdd:u.useCallback(()=>P(S=>S+1),[]),onFocusableItemRemove:u.useCallback(()=>P(S=>S-1),[]),children:l.jsx(fs.div,{tabIndex:y||N===0?-1:0,"data-orientation":o,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:W(e.onMouseDown,()=>{k.current=!0}),onFocus:W(e.onFocus,S=>{const $=!k.current;if(S.target===S.currentTarget&&$&&!y){const E=new CustomEvent(Or,Yd);if(S.currentTarget.dispatchEvent(E),!E.defaultPrevented){const O=C().filter(F=>F.focusable),I=O.find(F=>F.active),L=O.find(F=>F.id===m),T=[I,L,...O].filter(Boolean).map(F=>F.ref.current);bs(T,f)}}k.current=!1}),onBlur:W(e.onBlur,()=>w(!1))})})}),gs="RovingFocusGroupItem",vs=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:n=!1,tabStopId:s,children:a,...i}=e,c=Xe(),d=s||c,f=Qd(gs,r),p=f.currentTabStopId===d,g=ps(r),{onFocusableItemAdd:h,onFocusableItemRemove:b,currentTabStopId:m}=f;return u.useEffect(()=>{if(o)return h(),()=>b()},[o,h,b]),l.jsx(Ir.ItemSlot,{scope:r,id:d,focusable:o,active:n,children:l.jsx(fs.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:W(e.onMouseDown,v=>{o?f.onItemFocus(d):v.preventDefault()}),onFocus:W(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:W(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){f.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=ru(v,f.orientation,f.dir);if(y!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let x=g().filter(C=>C.focusable).map(C=>C.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const C=x.indexOf(v.currentTarget);x=f.loop?ou(x,C+1):x.slice(C+1)}setTimeout(()=>bs(x))}}),children:typeof a=="function"?a({isCurrentTabStop:p,hasTabStop:m!=null}):a})})});vs.displayName=gs;var eu={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tu(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ru(e,t,r){const o=tu(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return eu[o]}function bs(e,t=!1){const r=document.activeElement;for(const o of e)if(o===r||(o.focus({preventScroll:t}),document.activeElement!==r))return}function ou(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var nu=hs,su=vs,Tr="Radio",[au,ys]=Ie(Tr),[iu,cu]=au(Tr),ws=u.forwardRef((e,t)=>{const{__scopeRadio:r,name:o,checked:n=!1,required:s,disabled:a,value:i="on",onCheck:c,form:d,...f}=e,[p,g]=u.useState(null),h=Y(t,v=>g(v)),b=u.useRef(!1),m=p?d||!!p.closest("form"):!0;return l.jsxs(iu,{scope:r,checked:n,disabled:a,children:[l.jsx($t.button,{type:"button",role:"radio","aria-checked":n,"data-state":Es(n),"data-disabled":a?"":void 0,disabled:a,value:i,...f,ref:h,onClick:W(e.onClick,v=>{n||c?.(),m&&(b.current=v.isPropagationStopped(),b.current||v.stopPropagation())})}),m&&l.jsx(Cs,{control:p,bubbles:!b.current,name:o,value:i,checked:n,required:s,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});ws.displayName=Tr;var xs="RadioIndicator",Ss=u.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:o,...n}=e,s=cu(xs,r);return l.jsx(Ot,{present:o||s.checked,children:l.jsx($t.span,{"data-state":Es(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})})});Ss.displayName=xs;var lu="RadioBubbleInput",Cs=u.forwardRef(({__scopeRadio:e,control:t,checked:r,bubbles:o=!0,...n},s)=>{const a=u.useRef(null),i=Y(a,s),c=Bo(r),d=Po(t);return u.useEffect(()=>{const f=a.current;if(!f)return;const p=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(p,"checked").set;if(c!==r&&h){const b=new Event("click",{bubbles:o});h.call(f,r),f.dispatchEvent(b)}},[c,r,o]),l.jsx($t.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...n,tabIndex:-1,ref:i,style:{...n.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Cs.displayName=lu;function Es(e){return e?"checked":"unchecked"}var du=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Bt="RadioGroup",[uu]=Ie(Bt,[ms,ys]),Ps=ms(),Ns=ys(),[fu,pu]=uu(Bt),ks=u.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:o,defaultValue:n,value:s,required:a=!1,disabled:i=!1,orientation:c,dir:d,loop:f=!0,onValueChange:p,...g}=e,h=Ps(r),b=zt(d),[m,v]=et({prop:s,defaultProp:n??null,onChange:p,caller:Bt});return l.jsx(fu,{scope:r,name:o,required:a,disabled:i,value:m,onValueChange:v,children:l.jsx(nu,{asChild:!0,...h,orientation:c,dir:b,loop:f,children:l.jsx($t.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":i?"":void 0,dir:b,...g,ref:t})})})});ks.displayName=Bt;var As="RadioGroupItem",Os=u.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:o,...n}=e,s=pu(As,r),a=s.disabled||o,i=Ps(r),c=Ns(r),d=u.useRef(null),f=Y(t,d),p=s.value===n.value,g=u.useRef(!1);return u.useEffect(()=>{const h=m=>{du.includes(m.key)&&(g.current=!0)},b=()=>g.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",b)}},[]),l.jsx(su,{asChild:!0,...i,focusable:!a,active:p,children:l.jsx(ws,{disabled:a,required:s.required,checked:p,...c,...n,name:s.name,ref:f,onCheck:()=>s.onValueChange(n.value),onKeyDown:W(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:W(n.onFocus,()=>{g.current&&d.current?.click()})})})});Os.displayName=As;var mu="RadioGroupIndicator",Is=u.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...o}=e,n=Ns(r);return l.jsx(Ss,{...n,...o,ref:t})});Is.displayName=mu;var hu=ks,gu=Os,vu=Is;function bu({className:e,...t}){return l.jsx(hu,{"data-slot":"radio-group",className:Lt("grid gap-3",e),...t})}function yu({className:e,...t}){return l.jsx(gu,{"data-slot":"radio-group-item",className:Lt("border-input text-primary 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 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx(vu,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:l.jsx(gl,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function wu({field:e,formValues:t,handleChange:r,handleBlur:o,error:n}){const s=t[e.name]||"",a=typeof e.disabled=="function"?e.disabled(t):e.disabled,i=e.options||[],c=e.inline||!1;return l.jsxs(l.Fragment,{children:[l.jsx(bu,{value:s,onValueChange:d=>r(e.name,d),onBlur:()=>o(e.name),disabled:a,className:c?"flex flex-wrap gap-4":"space-y-3","aria-label":e.label||e.name,children:i.map(d=>{const f=typeof d=="object"?d.value:d,p=typeof d=="object"?d.label:d,g=typeof d=="object"?d.description:null,h=`${e.name}-${f}`;return l.jsxs("div",{className:"relative flex items-start",children:[l.jsx("div",{className:"flex h-6 items-center",children:l.jsx(yu,{value:f,id:h,disabled:a,className:`
56
61
  relative size-4 rounded-full border transition-all
57
62
  ${a?"border-gray-300 bg-gray-100 cursor-not-allowed":"border-gray-300 bg-white hover:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"}
58
63
  data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600
59
- `})}),l.jsxs("div",{className:"ml-3 text-sm",children:[l.jsx("label",{htmlFor:h,className:`font-medium ${a?"text-gray-500":"text-gray-900 cursor-pointer"}`,children:m}),g&&!c&&l.jsx("p",{className:`text-sm ${a?"text-gray-400":"text-gray-500"}`,children:g})]})]},f)})}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}function nu({field:e}){const t=e.text||e.label||"",o=e.description||"",n=e.size||"lg",r=e.underline||!1,s=e.align||"left",a=e.className||"",i={sm:"text-base font-semibold",md:"text-lg font-semibold",lg:"text-xl font-bold",xl:"text-2xl font-bold","2xl":"text-3xl font-bold","3xl":"text-4xl font-bold","4xl":"text-5xl font-bold"},c={left:"text-left",center:"text-center",right:"text-right"},d=`
60
- ${i[n]||i.lg}
64
+ `})}),l.jsxs("div",{className:"ml-3 text-sm",children:[l.jsx("label",{htmlFor:h,className:`font-medium ${a?"text-gray-500":"text-gray-900 cursor-pointer"}`,children:p}),g&&!c&&l.jsx("p",{className:`text-sm ${a?"text-gray-400":"text-gray-500"}`,children:g})]})]},f)})}),n&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:n})]})}function xu({field:e}){const t=e.text||e.label||"",r=e.description||"",o=e.size||"lg",n=e.underline||!1,s=e.align||"left",a=e.className||"",i={sm:"text-base font-semibold",md:"text-lg font-semibold",lg:"text-xl font-bold",xl:"text-2xl font-bold","2xl":"text-3xl font-bold","3xl":"text-4xl font-bold","4xl":"text-5xl font-bold"},c={left:"text-left",center:"text-center",right:"text-right"},d=`
65
+ ${i[o]||i.lg}
61
66
  ${c[s]||c.left}
62
- ${r?"border-b-2 border-gray-300 pb-2":""}
67
+ ${n?"border-b-2 border-gray-300 pb-2":""}
63
68
  ${a}
64
69
  text-gray-900
65
70
  `.trim(),f=`
66
71
  mt-1 text-sm text-gray-600
67
72
  ${c[s]||c.left}
68
- `.trim();return l.jsxs("div",{className:"my-4",children:[l.jsx("h2",{className:d,children:t}),o&&l.jsx("p",{className:f,children:o})]})}function ru({field:e,formValues:t,handleChange:o,handleBlur:n,error:r}){const[s,a]=V.useState(!1),i=t[e.name]??null,c=f=>o(e.name,f),d=()=>o(e.name,null);return l.jsxs("div",{children:[l.jsxs(ko,{open:s,onOpenChange:a,children:[l.jsx(Po,{asChild:!0,children:l.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),onKeyDown:f=>f.key==="Enter"&&a(!0),className:`
73
+ `.trim();return l.jsxs("div",{className:"my-4",children:[l.jsx("h2",{className:d,children:t}),r&&l.jsx("p",{className:f,children:r})]})}function Su({field:e,formValues:t,handleChange:r,handleBlur:o,error:n}){const[s,a]=V.useState(!1),i=t[e.name]??null,c=f=>r(e.name,f),d=()=>r(e.name,null);return l.jsxs("div",{children:[l.jsxs(Pr,{open:s,onOpenChange:a,children:[l.jsx(Nr,{asChild:!0,children:l.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),onKeyDown:f=>f.key==="Enter"&&a(!0),className:`
69
74
  inline-flex items-center justify-between gap-2
70
75
  w-full h-9 rounded-md border bg-white
71
76
  px-3 py-2 text-sm font-normal shadow-sm
72
77
  hover:bg-gray-50 hover:text-gray-900
73
78
  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
74
79
  disabled:cursor-not-allowed disabled:opacity-50
75
- ${r?"border-red-500 focus-visible:ring-red-500":"border-gray-300 focus-visible:ring-blue-500"}
76
- `,children:[i?l.jsx("span",{children:i.toLocaleDateString()}):l.jsx("span",{className:"text-muted-foreground",children:e.placeholder||"Select date"}),l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-chevron-down opacity-70",children:l.jsx("path",{d:"m6 9 6 6 6-6"})})]})}),l.jsxs(No,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto",children:[l.jsx($o.DayPicker,{mode:"single",selected:i,onSelect:c,showOutsideDays:!0,className:"rounded-md bg-white p-3 text-xs"}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 p-3",children:[l.jsx("button",{type:"button",onClick:d,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),l.jsx("button",{type:"button",onClick:()=>a(!1),className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})]}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}function su({field:e,formValues:t,handleChange:o,handleBlur:n,error:r}){const[s,a]=V.useState(!1),[i,c]=V.useState("12"),[d,f]=V.useState("00"),[m,g]=V.useState("PM"),h=t[e.name]||"";V.useEffect(()=>{if(h){const S=h.match(/(\d{1,2}):(\d{2})\s*(AM|PM)/i);S&&(c(S[1].padStart(2,"0")),f(S[2]),g(S[3].toUpperCase()))}},[h]);const b=()=>{const S=`${i}:${d} ${m}`;o(e.name,S),a(!1)},p=()=>{o(e.name,""),c("12"),f("00"),g("PM")},v=()=>{const S=parseInt(i);c((S%12+1).toString().padStart(2,"0"))},y=()=>{const S=parseInt(i);c((S===1?12:S-1).toString().padStart(2,"0"))},w=()=>{const S=parseInt(d);f(((S+5)%60).toString().padStart(2,"0"))},x=()=>{const S=parseInt(d);f((S===0?55:S-5).toString().padStart(2,"0"))};return l.jsxs("div",{children:[l.jsxs(ko,{open:s,onOpenChange:a,children:[l.jsx(Po,{asChild:!0,children:l.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),className:`
80
+ ${n?"border-red-500 focus-visible:ring-red-500":"border-gray-300 focus-visible:ring-blue-500"}
81
+ `,children:[i?l.jsx("span",{children:i.toLocaleDateString()}):l.jsx("span",{className:"text-muted-foreground",children:e.placeholder||"Select date"}),l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-chevron-down opacity-70",children:l.jsx("path",{d:"m6 9 6 6 6-6"})})]})}),l.jsxs(kr,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto",children:[l.jsx($r.DayPicker,{mode:"single",selected:i,onSelect:c,showOutsideDays:!0,className:"rounded-md bg-white p-3 text-xs"}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 p-3",children:[l.jsx("button",{type:"button",onClick:d,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),l.jsx("button",{type:"button",onClick:()=>a(!1),className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})]}),n&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:n})]})}function Cu({field:e,formValues:t,handleChange:r,handleBlur:o,error:n}){const[s,a]=V.useState(!1),[i,c]=V.useState("12"),[d,f]=V.useState("00"),[p,g]=V.useState("PM"),h=t[e.name]||"";V.useEffect(()=>{if(h){const C=h.match(/(\d{1,2}):(\d{2})\s*(AM|PM)/i);C&&(c(C[1].padStart(2,"0")),f(C[2]),g(C[3].toUpperCase()))}},[h]);const b=()=>{const C=`${i}:${d} ${p}`;r(e.name,C),a(!1)},m=()=>{r(e.name,""),c("12"),f("00"),g("PM")},v=()=>{const C=parseInt(i);c((C%12+1).toString().padStart(2,"0"))},y=()=>{const C=parseInt(i);c((C===1?12:C-1).toString().padStart(2,"0"))},w=()=>{const C=parseInt(d);f(((C+5)%60).toString().padStart(2,"0"))},x=()=>{const C=parseInt(d);f((C===0?55:C-5).toString().padStart(2,"0"))};return l.jsxs("div",{children:[l.jsxs(Pr,{open:s,onOpenChange:a,children:[l.jsx(Nr,{asChild:!0,children:l.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),className:`
77
82
  inline-flex items-center justify-between gap-2
78
83
  w-full h-9 rounded-md border bg-white
79
84
  px-3 py-2 text-sm font-normal shadow-sm
80
85
  hover:bg-gray-50 hover:text-gray-900
81
86
  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
82
87
  disabled:cursor-not-allowed disabled:opacity-50
83
- ${r?"border-red-500 focus-visible:ring-red-500":"border-gray-300 focus-visible:ring-blue-500"}
84
- `,children:[h?l.jsx("span",{children:h}):l.jsx("span",{className:"text-gray-400",children:e.placeholder||"Select time"}),l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-clock opacity-70",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("polyline",{points:"12 6 12 12 16 14"})]})]})}),l.jsx(No,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-4 shadow-md w-64",children:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"flex items-center justify-center gap-2",children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("button",{type:"button",onClick:v,className:"p-1 hover:bg-gray-100 rounded",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("polyline",{points:"18 15 12 9 6 15"})})}),l.jsx("input",{type:"text",value:i,onChange:S=>{const N=S.target.value.replace(/\D/g,"");(N===""||parseInt(N)>=1&&parseInt(N)<=12)&&c(N.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),l.jsx("button",{type:"button",onClick:y,className:"p-1 hover:bg-gray-100 rounded",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),l.jsx("span",{className:"text-2xl font-semibold",children:":"}),l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("button",{type:"button",onClick:w,className:"p-1 hover:bg-gray-100 rounded",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("polyline",{points:"18 15 12 9 6 15"})})}),l.jsx("input",{type:"text",value:d,onChange:S=>{const N=S.target.value.replace(/\D/g,"");(N===""||parseInt(N)>=0&&parseInt(N)<=59)&&f(N.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),l.jsx("button",{type:"button",onClick:x,className:"p-1 hover:bg-gray-100 rounded",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),l.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[l.jsx("button",{type:"button",onClick:()=>g("AM"),className:`
88
+ ${n?"border-red-500 focus-visible:ring-red-500":"border-gray-300 focus-visible:ring-blue-500"}
89
+ `,children:[h?l.jsx("span",{children:h}):l.jsx("span",{className:"text-gray-400",children:e.placeholder||"Select time"}),l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-clock opacity-70",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("polyline",{points:"12 6 12 12 16 14"})]})]})}),l.jsx(kr,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-4 shadow-md w-64",children:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"flex items-center justify-center gap-2",children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("button",{type:"button",onClick:v,className:"p-1 hover:bg-gray-100 rounded",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("polyline",{points:"18 15 12 9 6 15"})})}),l.jsx("input",{type:"text",value:i,onChange:C=>{const k=C.target.value.replace(/\D/g,"");(k===""||parseInt(k)>=1&&parseInt(k)<=12)&&c(k.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),l.jsx("button",{type:"button",onClick:y,className:"p-1 hover:bg-gray-100 rounded",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),l.jsx("span",{className:"text-2xl font-semibold",children:":"}),l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("button",{type:"button",onClick:w,className:"p-1 hover:bg-gray-100 rounded",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("polyline",{points:"18 15 12 9 6 15"})})}),l.jsx("input",{type:"text",value:d,onChange:C=>{const k=C.target.value.replace(/\D/g,"");(k===""||parseInt(k)>=0&&parseInt(k)<=59)&&f(k.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),l.jsx("button",{type:"button",onClick:x,className:"p-1 hover:bg-gray-100 rounded",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),l.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[l.jsx("button",{type:"button",onClick:()=>g("AM"),className:`
85
90
  px-3 py-1 text-sm font-medium rounded
86
- ${m==="AM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
91
+ ${p==="AM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
87
92
  `,children:"AM"}),l.jsx("button",{type:"button",onClick:()=>g("PM"),className:`
88
93
  px-3 py-1 text-sm font-medium rounded
89
- ${m==="PM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
90
- `,children:"PM"})]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 pt-3",children:[l.jsx("button",{type:"button",onClick:p,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),l.jsx("button",{type:"button",onClick:b,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})})]}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}function au({message:e}){return l.jsx("div",{className:"rounded-lg bg-red-50 border border-red-100 p-4 shadow-sm",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(el,{"aria-hidden":"true",className:"size-5 text-red-500 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-red-900",children:e})]})})}function iu({message:e}){return l.jsx("div",{className:"rounded-lg bg-amber-50 border border-amber-100 p-4 shadow-sm",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Qc,{"aria-hidden":"true",className:"size-5 text-amber-600 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-amber-900",children:e})]})})}function cu({message:e}){return l.jsx("div",{className:"rounded-lg bg-green-50 border border-green-100 p-4 shadow-sm",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Jc,{"aria-hidden":"true",className:"size-5 text-green-600 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-green-900",children:e})]})})}function lu({message:e}){return l.jsx("div",{className:"rounded-lg bg-blue-50 border border-blue-100 p-4 shadow-sm",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(ol,{"aria-hidden":"true",className:"size-5 text-blue-600 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-blue-900",children:e})]})})}function du({field:e}){const{variant:t="info",message:o,content:n}=e,r=o||n||"";switch(t.toLowerCase()){case"error":case"danger":return l.jsx(au,{message:r});case"success":return l.jsx(cu,{message:r});case"warning":case"warn":return l.jsx(iu,{message:r});case"info":case"information":default:return l.jsx(lu,{message:r})}}const Ps=({apiClient:e,api_URL:t,footerMode:o="normal",formDefinition:n,sendFormValues:r,children:s,defaultValues:a={},onFieldsChange:i=()=>{}})=>{const[c,d]=V.useState({...a}),[f,m]=V.useState({}),[g,h]=V.useState({}),[b,p]=V.useState({}),v=["hidden","html","linebreak","header","alert"],y=V.useMemo(()=>({file:rs,multifile:rs,dateRange:fd,date:ru,dayTimePicker:md,time:su,hidden:Os,multiselect:Is,select:nl,email:rl,litertext:sl,checkbox:al,radiogroup:ou,input:Or,textarea:pd,header:nu,alert:du,linebreak:Od}),[]),w=async(E,O=null)=>{if(!e){const I=`apiClient prop is required when using fields with optionsUrl. Field "${E.name}" requires optionsUrl but no apiClient was provided.`;console.error(I),st.toast.error(I);return}try{const I=await e(`/${E.optionsUrl}`);let L=[];E.type==="select"?L=[{value:"",label:`Select ${E.label.toLowerCase()}`},...I.data]:L=[...I.data.map(R=>({value:R.value,label:R.label}))],n.fields.forEach(R=>{R.name===E.name&&(R.options=L)})}catch(I){console.error(`Failed to load options for ${E.name}:`,I)}finally{}};V.useEffect(()=>{if(n?.fields&&n.fields.length>0){if(!n.fields.some(I=>I.value))return;n.fields.forEach(I=>{I.optionsUrl&&w(I)});const O={};n.fields.forEach(I=>{O[I.name]=a[I.name]??I.value??(I.type==="multiselect"?[]:"")}),d(O)}},[n]);const x=(E,O,I)=>{if(typeof E.disabled=="function"&&E.disabled(I)||E.disabled===!0)return null;const L=typeof O=="object"&&O!==null&&!Array.isArray(O)&&!(O instanceof Date),R=O==null||typeof O=="string"&&O.trim()===""||Array.isArray(O)&&O.length===0||E.type==="checkbox"&&O===!1||L&&Object.keys(O).length===0;if(E.required&&R)return`${E.label} is required`;if(R&&!E.required)return null;if(E.validate){const D=E.validate(O,I);if(D)return D}if(E.type==="email"&&O&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(O))return"Please enter a valid email address";if(E.type==="number"){if(E.min!==void 0&&O<E.min)return`${E.label} must be at least ${E.min}`;if(E.max!==void 0&&O>E.max)return`${E.label} must be no more than ${E.max}`}return E.type==="date"&&O&&!Do(O).isValid()?`${E.label} must be a valid date`:E.maxLength&&O&&O.length>E.maxLength?`${E.label} must not exceed ${E.maxLength} characters`:null},S=(E,O)=>{const I=n.fields.find(D=>D.name===E);if(!I)return;const L={...c};I.type==="multiselect"?L[E]=Array.isArray(O)?O:Array.from(O.target.selectedOptions).map(D=>D.value):I.type==="dateRange"?L[E]=[{startDate:O[0].from,endDate:O[0].to,key:"selection"}]:I.type==="dayTimePicker"?L[E]=O?Do(O).format("YYYY-MM-DD HH:mm:ss"):"":L[E]=O,I.type==="select"&&n.fields.forEach(D=>{D.showIf&&!D.showIf(L)&&(L[D.name]=D.type==="multiselect"?[]:"")}),n.fields.forEach(D=>{typeof D.disabled=="function"&&D.disabled(L)&&(L[D.name]=D.type==="multiselect"?[]:"")}),d(L);const R={};n.fields.forEach(D=>{const $=typeof D.disabled=="function"?D.disabled(c):!!D.disabled;if((!D.showIf||D.showIf(c))&&!$){const B=x(D,c[D.name],c);B&&(R[D.name]=B)}}),m(R),m(R)},N=E=>{h({...g,[E]:!0})},P=E=>{E.preventDefault();const O={};n.fields.forEach(L=>{O[L.name]=!0}),h(O);const I={};n.fields.forEach(L=>{if((!L.showIf||L.showIf(c))&&(!L.disabled||!L.disabled(c))){const R=x(L,c[L.name],c);R&&(I[L.name]=R)}}),m(I),Object.keys(I).length===0?r(c):st.toast.error("Please correct the errors in the form")};V.useEffect(()=>{i(c)},[c,i]);const k={green:"border-green-500 bg-green-50",blue:"border-blue-500 bg-blue-50",red:"border-red-500 bg-red-50",yellow:"border-yellow-500 bg-yellow-50",purple:"border-purple-500 bg-purple-50",indigo:"border-indigo-500 bg-indigo-50",gray:"border-gray-500 bg-gray-50",pink:"border-pink-500 bg-pink-50",orange:"border-orange-500 bg-orange-50"};function C(E,O,I){if(v.includes(O.type))return l.jsx("div",{className:O.fieldClass||"col-span-full",children:E});const L=O.containerStyle,R=O.color||"blue",D=L==="card"?`rounded-lg border text-card-foreground shadow-sm p-4 ${O.containerClassName||k[R]||k.blue}`:"",$=l.jsxs(l.Fragment,{children:[O.label&&l.jsxs("label",{htmlFor:O.name,className:"block text-sm font-medium mb-1",children:[O.label,O.required&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),l.jsx("div",{children:E})]});return l.jsx("div",{className:`mb-4 ${O.fieldClass||"col-span-8"}`,children:L==="card"?l.jsx("div",{className:D,children:$}):$})}const F=E=>{if(E.showIf&&!E.showIf(c))return null;const O=y[E.type]||Or;c[E.name]===void 0&&(c[E.name]=E.value!==void 0?E.value:E.type==="multiselect"?[]:"");const I=g[E.name]&&f[E.name]?f[E.name]:null;return C(l.jsx(O,{field:E,formValues:c,handleChange:S,handleBlur:()=>N(E.name),setCharCounts:p,charCount:b[E.name]||0,api_URL:t,error:I}),E)};return l.jsxs("form",{onSubmit:P,className:"grid grid-cols-12 gap-x-4 mx-auto w-full ",children:[n?n.fields.map(E=>l.jsx("div",{className:"col-span-full",children:F(E)},E.name)):l.jsx("div",{children:"Loading..."}),l.jsx("div",{className:o==="sticky"?"absolute col-span-full w-full bottom-0 bg-white py-4 flex justify-end gap-2 z-50":"col-span-full mt-4 flex justify-end gap-2",children:s})]})};oe.DynamicForm=Ps,oe.default=Ps,Object.defineProperties(oe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
94
+ ${p==="PM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
95
+ `,children:"PM"})]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 pt-3",children:[l.jsx("button",{type:"button",onClick:m,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),l.jsx("button",{type:"button",onClick:b,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})})]}),n&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:n})]})}function Eu({message:e}){return l.jsx("div",{className:"rounded-lg bg-red-50 border border-red-100 p-4 shadow-sm",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(hl,{"aria-hidden":"true",className:"size-5 text-red-500 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-red-900",children:e})]})})}function Pu({message:e}){return l.jsx("div",{className:"rounded-lg bg-amber-50 border border-amber-100 p-4 shadow-sm",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(pl,{"aria-hidden":"true",className:"size-5 text-amber-600 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-amber-900",children:e})]})})}function Nu({message:e}){return l.jsx("div",{className:"rounded-lg bg-green-50 border border-green-100 p-4 shadow-sm",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(ml,{"aria-hidden":"true",className:"size-5 text-green-600 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-green-900",children:e})]})})}function ku({message:e}){return l.jsx("div",{className:"rounded-lg bg-blue-50 border border-blue-100 p-4 shadow-sm",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(vl,{"aria-hidden":"true",className:"size-5 text-blue-600 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-blue-900",children:e})]})})}function Au({field:e}){const{variant:t="info",message:r,content:o}=e,n=r||o||"";switch(t.toLowerCase()){case"error":case"danger":return l.jsx(Eu,{message:n});case"success":return l.jsx(Nu,{message:n});case"warning":case"warn":return l.jsx(Pu,{message:n});case"info":case"information":default:return l.jsx(ku,{message:n})}}const Ts=({apiClient:e,api_URL:t,footerMode:r="normal",formDefinition:o,sendFormValues:n,children:s,defaultValues:a={},onFieldsChange:i=()=>{}})=>{const[c,d]=V.useState({...a}),[f,p]=V.useState({}),[g,h]=V.useState({}),[b,m]=V.useState({}),v=["hidden","html","linebreak","header","alert"],y=V.useMemo(()=>({file:cs,multifile:cs,dateRange:Ad,date:Su,dayTimePicker:Id,time:Cu,hidden:Ds,multiselect:Ls,select:bl,email:yl,litertext:wl,checkbox:xl,radiogroup:wu,input:Mn,textarea:Od,header:xu,alert:Au,linebreak:jd}),[]),w=async(E,O=null)=>{if(!e){const I=`apiClient prop is required when using fields with optionsUrl. Field "${E.name}" requires optionsUrl but no apiClient was provided.`;console.error(I),st.toast.error(I);return}try{const I=await e(`/${E.optionsUrl}`);let L=[];E.type==="select"?L=[{value:"",label:`Select ${E.label.toLowerCase()}`},...I.data]:L=[...I.data.map(B=>({value:B.value,label:B.label}))],o.fields.forEach(B=>{B.name===E.name&&(B.options=L)})}catch(I){console.error(`Failed to load options for ${E.name}:`,I)}finally{}};V.useEffect(()=>{if(o?.fields&&o.fields.length>0){if(!o.fields.some(I=>I.value))return;o.fields.forEach(I=>{I.optionsUrl&&w(I)});const O={};o.fields.forEach(I=>{const L=I.type==="multiselect"||I.type==="checkbox"&&I.options&&I.options.length>0;O[I.name]=a[I.name]??I.value??(L?[]:"")}),d(O)}},[o]);const x=(E,O,I)=>{if(typeof E.disabled=="function"&&E.disabled(I)||E.disabled===!0)return null;const L=typeof O=="object"&&O!==null&&!Array.isArray(O)&&!(O instanceof Date),B=O==null||typeof O=="string"&&O.trim()===""||Array.isArray(O)&&O.length===0||E.type==="checkbox"&&O===!1||L&&Object.keys(O).length===0;if(E.required&&B)return`${E.label} is required`;if(B&&!E.required)return null;if(E.validate){const T=E.validate(O,I);if(T)return T}if(E.type==="email"&&O&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(O))return"Please enter a valid email address";if(E.type==="number"){if(E.min!==void 0&&O<E.min)return`${E.label} must be at least ${E.min}`;if(E.max!==void 0&&O>E.max)return`${E.label} must be no more than ${E.max}`}return E.type==="date"&&O&&!Lr(O).isValid()?`${E.label} must be a valid date`:E.maxLength&&O&&O.length>E.maxLength?`${E.label} must not exceed ${E.maxLength} characters`:null},C=(E,O)=>{const I=o.fields.find(T=>T.name===E);if(!I)return;const L={...c};I.type==="multiselect"?L[E]=Array.isArray(O)?O:Array.from(O.target.selectedOptions).map(T=>T.value):I.type==="dateRange"?L[E]=[{startDate:O[0].from,endDate:O[0].to,key:"selection"}]:I.type==="dayTimePicker"?L[E]=O?Lr(O).format("YYYY-MM-DD HH:mm:ss"):"":L[E]=O,I.type==="select"&&o.fields.forEach(T=>{if(T.showIf&&!T.showIf(L)){const F=T.type==="multiselect"||T.type==="checkbox"&&T.options&&T.options.length>0;L[T.name]=F?[]:""}}),o.fields.forEach(T=>{if(typeof T.disabled=="function"&&T.disabled(L)){const F=T.type==="multiselect"||T.type==="checkbox"&&T.options&&T.options.length>0;L[T.name]=F?[]:""}}),d(L);const B={};o.fields.forEach(T=>{const F=typeof T.disabled=="function"?T.disabled(c):!!T.disabled;if((!T.showIf||T.showIf(c))&&!F){const R=x(T,c[T.name],c);R&&(B[T.name]=R)}}),p(B),p(B)},k=E=>{h({...g,[E]:!0})},N=E=>{E.preventDefault();const O={};o.fields.forEach(L=>{O[L.name]=!0}),h(O);const I={};o.fields.forEach(L=>{if((!L.showIf||L.showIf(c))&&(!L.disabled||!L.disabled(c))){const B=x(L,c[L.name],c);B&&(I[L.name]=B)}}),p(I),Object.keys(I).length===0?n(c):st.toast.error("Please correct the errors in the form")};V.useEffect(()=>{i(c)},[c,i]);const P={green:"border-green-500 bg-green-50",blue:"border-blue-500 bg-blue-50",red:"border-red-500 bg-red-50",yellow:"border-yellow-500 bg-yellow-50",purple:"border-purple-500 bg-purple-50",indigo:"border-indigo-500 bg-indigo-50",gray:"border-gray-500 bg-gray-50",pink:"border-pink-500 bg-pink-50",orange:"border-orange-500 bg-orange-50"};function S(E,O,I){if(v.includes(O.type))return l.jsx("div",{className:O.fieldClass||"col-span-full",children:E});const L=O.containerStyle,B=O.color||"blue",T=L==="card"?`rounded-lg border text-card-foreground shadow-sm p-4 ${O.containerClassName||P[B]||P.blue}`:"",F=l.jsxs(l.Fragment,{children:[O.label&&l.jsxs("label",{htmlFor:O.name,className:"block text-sm font-medium mb-1",children:[O.label,O.required&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),l.jsx("div",{children:E})]});return l.jsx("div",{className:`mb-4 ${O.fieldClass||"col-span-8"}`,children:L==="card"?l.jsx("div",{className:T,children:F}):F})}const $=E=>{if(E.showIf&&!E.showIf(c))return null;const O=y[E.type]||Mn;c[E.name]===void 0&&(c[E.name]=E.value!==void 0?E.value:E.type==="multiselect"?[]:"");const I=g[E.name]&&f[E.name]?f[E.name]:null;return S(l.jsx(O,{field:E,formValues:c,handleChange:C,handleBlur:()=>k(E.name),setCharCounts:m,charCount:b[E.name]||0,api_URL:t,error:I}),E)};return l.jsxs("form",{onSubmit:N,className:"grid grid-cols-12 gap-x-4 mx-auto w-full ",children:[o?o.fields.map(E=>l.jsx("div",{className:"col-span-full",children:$(E)},E.name+E.type)):l.jsx("div",{children:"Loading..."}),l.jsx("div",{className:r==="sticky"?"absolute col-span-full w-full bottom-0 bg-white py-4 flex justify-end gap-2 z-50":"col-span-full mt-4 flex justify-end gap-2",children:s})]})};te.DynamicForm=Ts,te.default=Ts,Object.defineProperties(te,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));