ynotsoft-dynamic-form 1.0.37 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dynamic-form.js +720 -715
- package/dist/dynamic-form.umd.cjs +5 -5
- package/dist/index.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
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,D=[...d.branches].some(E=>E.contains(C));!S||D||(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,D=k/2-p[b]/2-1,E=Se(m[y],D),O=Se(m[w],D),I=E,M=k-p[b]-O,R=k/2-p[b]/2+C,F=Gt(I,R,M),$=!c.arrow&&De(r)!=null&&R!==F&&s.reference[b]/2-(R<I?E:O)-p[b]/2<0,z=$?R<I?R-I:R-M:0;return{[h]:g[h]+z,data:{[h]:F,centerOffset:R-F-z,...$&&{alignmentOffset:z}},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),D=[];let E=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&D.push(C[y]),m){const R=ia(r,a,S);D.push(C[R[0]],C[R[1]])}if(E=[...E,{placement:r,overflows:D}],!D.every(R=>R<=0)){var O,I;const R=(((O=s.flip)==null?void 0:O.index)||0)+1,F=k[R];if(F&&(!(m==="alignment"?w!==ue(F):!1)||E.every(A=>ue(A.placement)===w?A.overflows[0]>0:!0)))return{data:{index:R,overflows:E},reset:{placement:F}};let $=(I=E.filter(z=>z.overflows[0]<=0).sort((z,A)=>z.overflows[1]-A.overflows[1])[0])==null?void 0:I.placement;if(!$)switch(h){case"bestFit":{var M;const z=(M=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:M[0];z&&($=z);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),M=ne(f.bottom,0);h?C=b-2*(E!==0||O!==0?E+O:ne(f.left,f.right)):k=p-2*(I!==0||M!==0?I+M:ne(f.top,f.bottom))}await c({...t,availableWidth:C,availableHeight:k});const D=await a.getDimensions(i.floating);return b!==D.width||p!==D.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),D=c!=null,E=oo(c),O=oo(r),I=oo(d),M=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,M);M()}},[S,N,M,E,D]);const F=u.useMemo(()=>({reference:P,floating:k,setReference:w,setFloating:x}),[w,x]),$=u.useMemo(()=>({reference:S,floating:N}),[S,N]),z=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:M,refs:F,elements:$,floatingStyles:z}),[f,M,F,$,z])}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,D=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,M={padding:E,boundary:O.filter(yi),altBoundary:I},{refs:R,floatingStyles:F,placement:$,isPositioned:z,middlewareData:A}=ri({strategy:"fixed",placement:D,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,...M}),c&&li({...M}),di({...M,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",...M})]}),[j,ee]=Mn($),he=xe(b);te(()=>{z&&he?.()},[z,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:{...F,transform:z?F.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:z?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"),`
|
|
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
2
|
.`.concat(Ti,` {
|
|
3
3
|
overflow: hidden `).concat(n,`;
|
|
4
4
|
padding-right: `).concat(i,"px ").concat(n,`;
|
|
@@ -38,13 +38,13 @@
|
|
|
38
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`
|
|
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 D=n.current||N;return sc(D,v,p,D==="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}),[D,E]=et({prop:a,defaultProp:i,onChange:c,caller:Te}),O=u.useRef(null),I=v?b||!!v.closest("form"):!0,[M,R]=u.useState(new Set),F=Array.from(M).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:D,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(z=>new Set(z).add($))},[]),onNativeOptionRemove:u.useCallback($=>{R(z=>{const A=new Set(z);return A.delete($),A})},[]),children:o})}),I?l.jsxs(Cr,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:m,value:D,onChange:$=>E($.target.value),disabled:g,form:b,children:[D===void 0?l.jsx("option",{value:""}):null,Array.from(M)]},F):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,D]=u.useState(null),[E,O]=u.useState(null),I=Pt(o),[M,R]=u.useState(!1),F=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]),z=u.useCallback(()=>$([C,x]),[$,C,x]);u.useEffect(()=>{M&&z()},[M,z]);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=!F.current&&!Q;(w.value!==void 0&&w.value===K||H)&&(D(T),H&&(F.current=!0))},[w.value]),Z=u.useCallback(()=>x?.focus(),[x]),X=u.useCallback((T,K,Q)=>{const H=!F.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:z,selectedItemText:E,position:n,isPositioned:M,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(),D=s.valueNode.getBoundingClientRect(),E=y.getBoundingClientRect();if(s.dir!=="rtl"){const G=E.left-C.left,Y=D.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-D.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,M=p.scrollHeight,R=window.getComputedStyle(d),F=parseInt(R.borderTopWidth,10),$=parseInt(R.paddingTop,10),z=parseInt(R.borderBottomWidth,10),A=parseInt(R.paddingBottom,10),j=F+$+M+A+z,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=F+$+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+z),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,F+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
|
|
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
42
|
${r?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"}
|
|
43
43
|
${a?"cursor-not-allowed opacity-50":""}
|
|
44
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
|
|
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),B=e=>!!e&&!Number.isNaN(Number(e)),Ae=e=>!!e&&Number.isInteger(Number(e)),So=e=>e.endsWith("%")&&B(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=>!_(e)&&!L(e),rd=e=>Ke(e,ts,Xr),_=e=>Yr.test(e),_e=e=>Ke(e,os,ed),Eo=e=>Ke(e,ld,B),Zr=e=>Ke(e,Jr,Xr),sd=e=>Ke(e,es,od),_t=e=>Ke(e,ns,td),L=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(),L,_],P=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],C=()=>[L,_,c],D=()=>[Ge,"full","auto",...C()],E=()=>[Ae,"none","subgrid",L,_],O=()=>["auto",{span:["full",Ae,L,_]},Ae,L,_],I=()=>[Ae,"auto",L,_],M=()=>["auto","min","max","fr",L,_],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...C()],z=()=>[Ge,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],A=()=>[e,L,_],j=()=>[...S(),Qr,Zr,{position:[L,_]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],he=()=>["auto","cover","contain",id,rd,{size:[L,_]}],we=()=>[So,nt,_e],Z=()=>["","none","full",d,L,_],X=()=>["",B,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=()=>[B,So,Qr,Zr],K=()=>["","none",b,L,_],Q=()=>["none",B,L,_],H=()=>["none",B,L,_],G=()=>[B,L,_],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",B],text:[ye],"text-shadow":[ye],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ge,_,L,v]}],container:["container"],columns:[{columns:[B,_,L,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:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[Ae,"auto",L,_]}],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:[B,Ge,"auto","initial","none",_]}],grow:[{grow:["",B,L,_]}],shrink:[{shrink:["",B,L,_]}],order:[{order:[Ae,"first","last","none",L,_]}],"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":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],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:z()}],w:[{w:[i,"screen",...z()]}],"min-w":[{"min-w":[i,"screen","none",...z()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",o,nt,_e]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,L,Eo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",So,_]}],"font-family":[{font:[ad,_,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,L,_]}],"line-clamp":[{"line-clamp":[B,"none",L,Eo]}],leading:[{leading:[s,...C()]}],"list-image":[{"list-image":["none",L,_]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",L,_]}],"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:[B,"from-font","auto",L,_e]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[B,"auto",L,_]}],"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",L,_]}],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",L,_]}],"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,L,_],radial:["",L,_],conic:[Ae,L,_]},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":[B,L,_]}],"outline-w":[{outline:["",B,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":[B,_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:[B,L,_]}],"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":[B]}],"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":[L,_]}],"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":[B]}],"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",L,_]}],filter:[{filter:["","none",L,_]}],blur:[{blur:K()}],brightness:[{brightness:[B,L,_]}],contrast:[{contrast:[B,L,_]}],"drop-shadow":[{"drop-shadow":["","none",h,Lt,_t]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",B,L,_]}],"hue-rotate":[{"hue-rotate":[B,L,_]}],invert:[{invert:["",B,L,_]}],saturate:[{saturate:[B,L,_]}],sepia:[{sepia:["",B,L,_]}],"backdrop-filter":[{"backdrop-filter":["","none",L,_]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[B,L,_]}],"backdrop-contrast":[{"backdrop-contrast":[B,L,_]}],"backdrop-grayscale":[{"backdrop-grayscale":["",B,L,_]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[B,L,_]}],"backdrop-invert":[{"backdrop-invert":["",B,L,_]}],"backdrop-opacity":[{"backdrop-opacity":[B,L,_]}],"backdrop-saturate":[{"backdrop-saturate":[B,L,_]}],"backdrop-sepia":[{"backdrop-sepia":["",B,L,_]}],"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",L,_]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[B,"initial",L,_]}],ease:[{ease:["linear","initial",y,L,_]}],delay:[{delay:[B,L,_]}],animate:[{animate:["none",w,L,_]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,L,_]}],"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:[L,_,"","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",L,_]}],"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",L,_]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[B,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(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:`
|
|
48
48
|
inline-flex items-center justify-between gap-2
|
|
49
49
|
w-full h-9 rounded-md border bg-white
|
|
50
50
|
px-3 py-2 text-sm font-normal shadow-sm
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
|
|
53
53
|
disabled:cursor-not-allowed disabled:opacity-50
|
|
54
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"],D=Math.floor(Math.log(P)/Math.log(k));return parseFloat((P/Math.pow(k,D)).toFixed(2))+" "+C[D]},y=async(P,k)=>{const C=new FormData;C.append("file",P);const D=await fetch(`${p}`,{method:"POST",body:C});if(!D.ok)throw st.toast.error("Upload failed"),new Error("Upload failed");return await D.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),D={...t,[P.name]:C};a(P.name,C),i(D)},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 D=await Promise.all(k.map(O=>y(O,P.name))),E=[...C,...D];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(D){st.toast.error(`Upload failed: ${D.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(D=>D.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 D=!N.current;if(C.target===C.currentTarget&&D&&!y){const E=new CustomEvent(Oo,Id);if(C.currentTarget.dispatchEvent(E),!E.defaultPrevented){const O=S().filter($=>$.focusable),I=O.find($=>$.active),M=O.find($=>$.id===p),F=[I,M,...O].filter(Boolean).map($=>$.ref.current);ps(F,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:`
|
|
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:`
|
|
56
56
|
relative size-4 rounded-full border transition-all
|
|
57
57
|
${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
58
|
data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600
|
|
@@ -87,4 +87,4 @@
|
|
|
87
87
|
`,children:"AM"}),l.jsx("button",{type:"button",onClick:()=>g("PM"),className:`
|
|
88
88
|
px-3 py-1 text-sm font-medium rounded
|
|
89
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
|
|
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"}})}));
|