@kaushalparajuli/react-crud-ui 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +53 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5423 -5274
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),le=require("react"),na=require("react-dom"),Cf=require("react-router-dom");function oa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const l=oa(le),vr=oa(na);function ii(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ye(...e){return t=>{let r=!1;const n=e.map(o=>{const s=ii(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():ii(e[o],null)}}}}function oe(...e){return l.useCallback(ye(...e),e)}var Ef=Symbol.for("react.lazy"),Gr=l[" use ".trim().toString()];function Nf(e){return typeof e=="object"&&e!==null&&"then"in e}function sa(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Ef&&"_payload"in e&&Nf(e._payload)}function ia(e){const t=_f(e),r=l.forwardRef((n,o)=>{let{children:s,...i}=n;sa(s)&&typeof Gr=="function"&&(s=Gr(s._payload));const a=l.Children.toArray(s),c=a.find(jf);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var Rf=ia("Slot");function _f(e){const t=l.forwardRef((r,n)=>{let{children:o,...s}=r;if(sa(o)&&typeof Gr=="function"&&(o=Gr(o._payload)),l.isValidElement(o)){const i=Tf(o),a=Af(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pf=Symbol("radix.slottable");function jf(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pf}function Af(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Tf(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function aa(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=aa(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function la(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=aa(e))&&(n&&(n+=" "),n+=t);return n}const ai=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,li=la,an=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return li(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(d=>{const p=r==null?void 0:r[d],f=s==null?void 0:s[d];if(p===null)return null;const m=ai(p)||ai(f);return o[d][m]}),a=r&&Object.entries(r).reduce((d,p)=>{let[f,m]=p;return m===void 0||(d[f]=m),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,p)=>{let{class:f,className:m,...g}=p;return Object.entries(g).every(v=>{let[h,y]=v;return Array.isArray(y)?y.includes({...s,...a}[h]):{...s,...a}[h]===y})?[...d,f,m]:d},[]);return li(e,i,c,r==null?void 0:r.class,r==null?void 0:r.className)},Ro="-",Mf=e=>{const t=If(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const a=i.split(Ro);return a[0]===""&&a.length!==1&&a.shift(),ca(a,t)||Df(i)},getConflictingClassGroupIds:(i,a)=>{const c=r[i]||[];return a&&n[i]?[...c,...n[i]]:c}}},ca=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?ca(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Ro);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},ci=/^\[(.+)\]$/,Df=e=>{if(ci.test(e)){const t=ci.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},If=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Of(Object.entries(e.classGroups),r).forEach(([s,i])=>{io(i,n,s,t)}),n},io=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:ui(t,o);s.classGroupId=r;return}if(typeof o=="function"){if(kf(o)){io(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([s,i])=>{io(i,ui(t,s),r,n)})})},ui=(e,t)=>{let r=e;return t.split(Ro).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},kf=e=>e.isThemeGetter,Of=(e,t)=>t?e.map(([r,n])=>{const o=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[r,o]}):e,$f=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(s,i)=>{r.set(s,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let i=r.get(s);if(i!==void 0)return i;if((i=n.get(s))!==void 0)return o(s,i),i},set(s,i){r.has(s)?r.set(s,i):o(s,i)}}},ua="!",Lf=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],s=t.length,i=a=>{const c=[];let d=0,p=0,f;for(let y=0;y<a.length;y++){let x=a[y];if(d===0){if(x===o&&(n||a.slice(y,y+s)===t)){c.push(a.slice(p,y)),p=y+s;continue}if(x==="/"){f=y;continue}}x==="["?d++:x==="]"&&d--}const m=c.length===0?a:a.substring(p),g=m.startsWith(ua),v=g?m.substring(1):m,h=f&&f>p?f-p:void 0;return{modifiers:c,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:h}};return r?a=>r({className:a,parseClassName:i}):i},Ff=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Vf=e=>({cache:$f(e.cacheSize),parseClassName:Lf(e),...Mf(e)}),Wf=/\s+/,Bf=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Wf);let a="";for(let c=i.length-1;c>=0;c-=1){const d=i[c],{modifiers:p,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:g}=r(d);let v=!!g,h=n(v?m.substring(0,g):m);if(!h){if(!v){a=d+(a.length>0?" "+a:a);continue}if(h=n(m),!h){a=d+(a.length>0?" "+a:a);continue}v=!1}const y=Ff(p).join(":"),x=f?y+ua:y,b=x+h;if(s.includes(b))continue;s.push(b);const w=o(h,v);for(let S=0;S<w.length;++S){const E=w[S];s.push(x+E)}a=d+(a.length>0?" "+a:a)}return a};function Hf(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=da(t))&&(n&&(n+=" "),n+=r);return n}const da=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=da(e[n]))&&(r&&(r+=" "),r+=t);return r};function Uf(e,...t){let r,n,o,s=i;function i(c){const d=t.reduce((p,f)=>f(p),e());return r=Vf(d),n=r.cache.get,o=r.cache.set,s=a,a(c)}function a(c){const d=n(c);if(d)return d;const p=Bf(c,r);return o(c,p),p}return function(){return s(Hf.apply(null,arguments))}}const me=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},fa=/^\[(?:([a-z-]+):)?(.+)\]$/i,zf=/^\d+\/\d+$/,Gf=new Set(["px","full","screen"]),Kf=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Yf=/\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$/,qf=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Xf=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zf=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lt=e=>Vt(e)||Gf.has(e)||zf.test(e),ft=e=>Kt(e,"length",sp),Vt=e=>!!e&&!Number.isNaN(Number(e)),Gn=e=>Kt(e,"number",Vt),tr=e=>!!e&&Number.isInteger(Number(e)),Qf=e=>e.endsWith("%")&&Vt(e.slice(0,-1)),ne=e=>fa.test(e),pt=e=>Kf.test(e),Jf=new Set(["length","size","percentage"]),ep=e=>Kt(e,Jf,pa),tp=e=>Kt(e,"position",pa),rp=new Set(["image","url"]),np=e=>Kt(e,rp,ap),op=e=>Kt(e,"",ip),rr=()=>!0,Kt=(e,t,r)=>{const n=fa.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},sp=e=>Yf.test(e)&&!qf.test(e),pa=()=>!1,ip=e=>Xf.test(e),ap=e=>Zf.test(e),lp=()=>{const e=me("colors"),t=me("spacing"),r=me("blur"),n=me("brightness"),o=me("borderColor"),s=me("borderRadius"),i=me("borderSpacing"),a=me("borderWidth"),c=me("contrast"),d=me("grayscale"),p=me("hueRotate"),f=me("invert"),m=me("gap"),g=me("gradientColorStops"),v=me("gradientColorStopPositions"),h=me("inset"),y=me("margin"),x=me("opacity"),b=me("padding"),w=me("saturate"),S=me("scale"),E=me("sepia"),j=me("skew"),_=me("space"),I=me("translate"),D=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",ne,t],R=()=>[ne,t],W=()=>["",lt,ft],B=()=>["auto",Vt,ne],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],k=()=>["","0",ne],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[Vt,ne];return{cacheSize:500,separator:":",theme:{colors:[rr],spacing:[lt,ft],blur:["none","",pt,ne],brightness:F(),borderColor:[e],borderRadius:["none","","full",pt,ne],borderSpacing:R(),borderWidth:W(),contrast:F(),grayscale:k(),hueRotate:F(),invert:k(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[Qf,ft],inset:A(),margin:A(),opacity:F(),padding:R(),saturate:F(),scale:F(),sepia:k(),skew:F(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[pt]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"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"],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:[...q(),ne]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",tr,ne]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:k()}],shrink:[{shrink:k()}],order:[{order:["first","last","none",tr,ne]}],"grid-cols":[{"grid-cols":[rr]}],"col-start-end":[{col:["auto",{span:["full",tr,ne]},ne]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[rr]}],"row-start-end":[{row:["auto",{span:[tr,ne]},ne]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[pt]},pt]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",pt,ft]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Gn]}],"font-family":[{font:[rr]}],"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:["tighter","tight","normal","wide","wider","widest",ne]}],"line-clamp":[{"line-clamp":["none",Vt,Gn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",lt,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",lt,ft]}],"underline-offset":[{"underline-offset":["auto",lt,ne]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),tp]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ep]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},np]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:H()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[lt,ne]}],"outline-w":[{outline:[lt,ft]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[lt,ft]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",pt,op]}],"shadow-color":[{shadow:[rr]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",pt,ne]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[tr,ne]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[lt,ft,Gn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},cp=Uf(lp);function M(...e){return cp(la(e))}function up(e,t="USD",r="en-US"){return new Intl.NumberFormat(r,{style:"currency",currency:t,minimumFractionDigits:2}).format(e)}function _o(e,t={},r="en-US"){if(!e)return"";const n={year:"numeric",month:"long",day:"numeric"};return new Date(e).toLocaleDateString(r,{...n,...t})}function Wr(e,t="en-US"){return e?new Date(e).toLocaleString(t,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}function dp(e){if(!e)return"";const t=new Date,r=new Date(e),n=Math.floor((t-r)/1e3);return n<60?"Just now":n<3600?`${Math.floor(n/60)} minutes ago`:n<86400?`${Math.floor(n/3600)} hours ago`:n<2592e3?`${Math.floor(n/86400)} days ago`:_o(e)}function fp(e,t=50){return e?e.length<=t?e:e.slice(0,t)+"...":""}function ma(e,t=300){let r;return function(...o){const s=()=>{clearTimeout(r),e(...o)};clearTimeout(r),r=setTimeout(s,t)}}function pp(){return Math.random().toString(36).substring(2,9)}function mp(e){return JSON.parse(JSON.stringify(e))}function hp(e){return e==null?!0:Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:typeof e=="string"?e.trim()==="":!1}function gp(e,t,r=void 0){const n=t.split(".");let o=e;for(const s of n){if(o==null)return r;o=o[s]}return o!==void 0?o:r}/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),pe=require("react"),aa=require("react-dom"),gr=require("react-router-dom");function la(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const l=la(pe),Rr=la(aa);function ci(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function we(...e){return t=>{let r=!1;const n=e.map(o=>{const s=ci(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():ci(e[o],null)}}}}function se(...e){return l.useCallback(we(...e),e)}var Nf=Symbol.for("react.lazy"),Xr=l[" use ".trim().toString()];function Rf(e){return typeof e=="object"&&e!==null&&"then"in e}function ca(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Nf&&"_payload"in e&&Rf(e._payload)}function ua(e){const t=_f(e),r=l.forwardRef((n,o)=>{let{children:s,...a}=n;ca(s)&&typeof Xr=="function"&&(s=Xr(s._payload));const i=l.Children.toArray(s),u=i.find(Af);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var jf=ua("Slot");function _f(e){const t=l.forwardRef((r,n)=>{let{children:o,...s}=r;if(ca(o)&&typeof Xr=="function"&&(o=Xr(o._payload)),l.isValidElement(o)){const a=Mf(o),i=Tf(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pf=Symbol("radix.slottable");function Af(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pf}function Tf(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Mf(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function da(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=da(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function fa(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=da(e))&&(n&&(n+=" "),n+=t);return n}const ui=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,di=fa,dn=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return di(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:s}=t,a=Object.keys(o).map(d=>{const p=r==null?void 0:r[d],f=s==null?void 0:s[d];if(p===null)return null;const m=ui(p)||ui(f);return o[d][m]}),i=r&&Object.entries(r).reduce((d,p)=>{let[f,m]=p;return m===void 0||(d[f]=m),d},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,p)=>{let{class:f,className:m,...g}=p;return Object.entries(g).every(v=>{let[h,x]=v;return Array.isArray(x)?x.includes({...s,...i}[h]):{...s,...i}[h]===x})?[...d,f,m]:d},[]);return di(e,a,u,r==null?void 0:r.class,r==null?void 0:r.className)},Po="-",Df=e=>{const t=kf(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const i=a.split(Po);return i[0]===""&&i.length!==1&&i.shift(),pa(i,t)||If(a)},getConflictingClassGroupIds:(a,i)=>{const u=r[a]||[];return i&&n[a]?[...u,...n[a]]:u}}},pa=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?pa(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Po);return(a=t.validators.find(({validator:i})=>i(s)))==null?void 0:a.classGroupId},fi=/^\[(.+)\]$/,If=e=>{if(fi.test(e)){const t=fi.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},kf=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return $f(Object.entries(e.classGroups),r).forEach(([s,a])=>{ao(a,n,s,t)}),n},ao=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:pi(t,o);s.classGroupId=r;return}if(typeof o=="function"){if(Of(o)){ao(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([s,a])=>{ao(a,pi(t,s),r,n)})})},pi=(e,t)=>{let r=e;return t.split(Po).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Of=e=>e.isThemeGetter,$f=(e,t)=>t?e.map(([r,n])=>{const o=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,i])=>[t+a,i])):s);return[r,o]}):e,Lf=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(s,a)=>{r.set(s,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let a=r.get(s);if(a!==void 0)return a;if((a=n.get(s))!==void 0)return o(s,a),a},set(s,a){r.has(s)?r.set(s,a):o(s,a)}}},ma="!",Ff=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],s=t.length,a=i=>{const u=[];let d=0,p=0,f;for(let x=0;x<i.length;x++){let y=i[x];if(d===0){if(y===o&&(n||i.slice(x,x+s)===t)){u.push(i.slice(p,x)),p=x+s;continue}if(y==="/"){f=x;continue}}y==="["?d++:y==="]"&&d--}const m=u.length===0?i:i.substring(p),g=m.startsWith(ma),v=g?m.substring(1):m,h=f&&f>p?f-p:void 0;return{modifiers:u,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:h}};return r?i=>r({className:i,parseClassName:a}):a},Vf=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Wf=e=>({cache:Lf(e.cacheSize),parseClassName:Ff(e),...Df(e)}),Bf=/\s+/,Hf=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,s=[],a=e.trim().split(Bf);let i="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{modifiers:p,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:g}=r(d);let v=!!g,h=n(v?m.substring(0,g):m);if(!h){if(!v){i=d+(i.length>0?" "+i:i);continue}if(h=n(m),!h){i=d+(i.length>0?" "+i:i);continue}v=!1}const x=Vf(p).join(":"),y=f?x+ma:x,b=y+h;if(s.includes(b))continue;s.push(b);const S=o(h,v);for(let C=0;C<S.length;++C){const E=S[C];s.push(y+E)}i=d+(i.length>0?" "+i:i)}return i};function Uf(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=ha(t))&&(n&&(n+=" "),n+=r);return n}const ha=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=ha(e[n]))&&(r&&(r+=" "),r+=t);return r};function zf(e,...t){let r,n,o,s=a;function a(u){const d=t.reduce((p,f)=>f(p),e());return r=Wf(d),n=r.cache.get,o=r.cache.set,s=i,i(u)}function i(u){const d=n(u);if(d)return d;const p=Hf(u,r);return o(u,p),p}return function(){return s(Uf.apply(null,arguments))}}const xe=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},ga=/^\[(?:([a-z-]+):)?(.+)\]$/i,Gf=/^\d+\/\d+$/,Kf=new Set(["px","full","screen"]),Yf=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qf=/\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$/,Xf=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Zf=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qf=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ft=e=>Ut(e)||Kf.has(e)||Gf.test(e),xt=e=>er(e,"length",ip),Ut=e=>!!e&&!Number.isNaN(Number(e)),Kn=e=>er(e,"number",Ut),ar=e=>!!e&&Number.isInteger(Number(e)),Jf=e=>e.endsWith("%")&&Ut(e.slice(0,-1)),oe=e=>ga.test(e),yt=e=>Yf.test(e),ep=new Set(["length","size","percentage"]),tp=e=>er(e,ep,va),rp=e=>er(e,"position",va),np=new Set(["image","url"]),op=e=>er(e,np,lp),sp=e=>er(e,"",ap),lr=()=>!0,er=(e,t,r)=>{const n=ga.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},ip=e=>qf.test(e)&&!Xf.test(e),va=()=>!1,ap=e=>Zf.test(e),lp=e=>Qf.test(e),cp=()=>{const e=xe("colors"),t=xe("spacing"),r=xe("blur"),n=xe("brightness"),o=xe("borderColor"),s=xe("borderRadius"),a=xe("borderSpacing"),i=xe("borderWidth"),u=xe("contrast"),d=xe("grayscale"),p=xe("hueRotate"),f=xe("invert"),m=xe("gap"),g=xe("gradientColorStops"),v=xe("gradientColorStopPositions"),h=xe("inset"),x=xe("margin"),y=xe("opacity"),b=xe("padding"),S=xe("saturate"),C=xe("scale"),E=xe("sepia"),_=xe("skew"),R=xe("space"),k=xe("translate"),M=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",oe,t],P=()=>[oe,t],$=()=>["",ft,xt],z=()=>["auto",Ut,oe],X=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",oe],re=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[Ut,oe];return{cacheSize:500,separator:":",theme:{colors:[lr],spacing:[ft,xt],blur:["none","",yt,oe],brightness:L(),borderColor:[e],borderRadius:["none","","full",yt,oe],borderSpacing:P(),borderWidth:$(),contrast:L(),grayscale:D(),hueRotate:L(),invert:D(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[Jf,xt],inset:V(),margin:V(),opacity:L(),padding:P(),saturate:L(),scale:L(),sepia:D(),skew:L(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",oe]}],container:["container"],columns:[{columns:[yt]}],"break-after":[{"break-after":re()}],"break-before":[{"break-before":re()}],"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"],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:[...X(),oe]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ar,oe]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",oe]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",ar,oe]}],"grid-cols":[{"grid-cols":[lr]}],"col-start-end":[{col:["auto",{span:["full",ar,oe]},oe]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[lr]}],"row-start-end":[{row:["auto",{span:[ar,oe]},oe]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",oe]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",oe,t]}],"min-w":[{"min-w":[oe,t,"min","max","fit"]}],"max-w":[{"max-w":[oe,t,"none","full","min","max","fit","prose",{screen:[yt]},yt]}],h:[{h:[oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",yt,xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Kn]}],"font-family":[{font:[lr]}],"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:["tighter","tight","normal","wide","wider","widest",oe]}],"line-clamp":[{"line-clamp":["none",Ut,Kn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ft,oe]}],"list-image":[{"list-image":["none",oe]}],"list-style-type":[{list:["none","disc","decimal",oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ft,xt]}],"underline-offset":[{"underline-offset":["auto",ft,oe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...X(),rp]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",tp]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},op]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:H()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[ft,oe]}],"outline-w":[{outline:[ft,xt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ft,xt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",yt,sp]}],"shadow-color":[{shadow:[lr]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",yt,oe]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",oe]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",oe]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[ar,oe]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",oe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",oe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ft,xt,Kn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},up=zf(cp);function A(...e){return up(fa(e))}function dp(e,t="USD",r="en-US"){return new Intl.NumberFormat(r,{style:"currency",currency:t,minimumFractionDigits:2}).format(e)}function Ao(e,t={},r="en-US"){if(!e)return"";const n={year:"numeric",month:"long",day:"numeric"};return new Date(e).toLocaleDateString(r,{...n,...t})}function Gr(e,t="en-US"){return e?new Date(e).toLocaleString(t,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}function fp(e){if(!e)return"";const t=new Date,r=new Date(e),n=Math.floor((t-r)/1e3);return n<60?"Just now":n<3600?`${Math.floor(n/60)} minutes ago`:n<86400?`${Math.floor(n/3600)} hours ago`:n<2592e3?`${Math.floor(n/86400)} days ago`:Ao(e)}function pp(e,t=50){return e?e.length<=t?e:e.slice(0,t)+"...":""}function xa(e,t=300){let r;return function(...o){const s=()=>{clearTimeout(r),e(...o)};clearTimeout(r),r=setTimeout(s,t)}}function mp(){return Math.random().toString(36).substring(2,9)}function hp(e){return JSON.parse(JSON.stringify(e))}function gp(e){return e==null?!0:Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:typeof e=="string"?e.trim()==="":!1}function vp(e,t,r=void 0){const n=t.split(".");let o=e;for(const s of n){if(o==null)return r;o=o[s]}return o!==void 0?o:r}/**
|
|
2
2
|
* @license lucide-react v0.460.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const xp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ya=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
|
|
7
7
|
* @license lucide-react v0.460.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
@@ -13,211 +13,211 @@
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const
|
|
16
|
+
*/const bp=pe.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:a,...i},u)=>pe.createElement("svg",{ref:u,...yp,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ya("lucide",o),...i},[...a.map(([d,p])=>pe.createElement(d,p)),...Array.isArray(s)?s:[s]]));/**
|
|
17
17
|
* @license lucide-react v0.460.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const fe=(e,t)=>{const r=pe.forwardRef(({className:n,...o},s)=>pe.createElement(bp,{ref:s,iconNode:t,className:ya(`lucide-${xp(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
|
|
22
22
|
* @license lucide-react v0.460.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const
|
|
26
|
+
*/const wp=fe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
27
27
|
* @license lucide-react v0.460.0 - ISC
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const
|
|
31
|
+
*/const mt=fe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
32
32
|
* @license lucide-react v0.460.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const
|
|
36
|
+
*/const Sp=fe("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
|
|
37
37
|
* @license lucide-react v0.460.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const
|
|
41
|
+
*/const Cp=fe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
42
42
|
* @license lucide-react v0.460.0 - ISC
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const
|
|
46
|
+
*/const mi=fe("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
47
47
|
* @license lucide-react v0.460.0 - ISC
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
50
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const
|
|
51
|
+
*/const vr=fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
52
52
|
* @license lucide-react v0.460.0 - ISC
|
|
53
53
|
*
|
|
54
54
|
* This source code is licensed under the ISC license.
|
|
55
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const
|
|
56
|
+
*/const To=fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
57
57
|
* @license lucide-react v0.460.0 - ISC
|
|
58
58
|
*
|
|
59
59
|
* This source code is licensed under the ISC license.
|
|
60
60
|
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const
|
|
61
|
+
*/const Ep=fe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
62
62
|
* @license lucide-react v0.460.0 - ISC
|
|
63
63
|
*
|
|
64
64
|
* This source code is licensed under the ISC license.
|
|
65
65
|
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const
|
|
66
|
+
*/const ba=fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
67
67
|
* @license lucide-react v0.460.0 - ISC
|
|
68
68
|
*
|
|
69
69
|
* This source code is licensed under the ISC license.
|
|
70
70
|
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const
|
|
71
|
+
*/const Np=fe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
72
72
|
* @license lucide-react v0.460.0 - ISC
|
|
73
73
|
*
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const
|
|
76
|
+
*/const Rp=fe("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
|
|
77
77
|
* @license lucide-react v0.460.0 - ISC
|
|
78
78
|
*
|
|
79
79
|
* This source code is licensed under the ISC license.
|
|
80
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const
|
|
81
|
+
*/const jp=fe("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
|
|
82
82
|
* @license lucide-react v0.460.0 - ISC
|
|
83
83
|
*
|
|
84
84
|
* This source code is licensed under the ISC license.
|
|
85
85
|
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const _p=
|
|
86
|
+
*/const _p=fe("CircleAlert",[["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"}]]);/**
|
|
87
87
|
* @license lucide-react v0.460.0 - ISC
|
|
88
88
|
*
|
|
89
89
|
* This source code is licensed under the ISC license.
|
|
90
90
|
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const Pp=
|
|
91
|
+
*/const Pp=fe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
92
92
|
* @license lucide-react v0.460.0 - ISC
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the ISC license.
|
|
95
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const
|
|
96
|
+
*/const wa=fe("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
|
|
97
97
|
* @license lucide-react v0.460.0 - ISC
|
|
98
98
|
*
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const
|
|
101
|
+
*/const Ap=fe("CircleX",[["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"}]]);/**
|
|
102
102
|
* @license lucide-react v0.460.0 - ISC
|
|
103
103
|
*
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const
|
|
106
|
+
*/const Tp=fe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
107
107
|
* @license lucide-react v0.460.0 - ISC
|
|
108
108
|
*
|
|
109
109
|
* This source code is licensed under the ISC license.
|
|
110
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const
|
|
111
|
+
*/const Mp=fe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
112
112
|
* @license lucide-react v0.460.0 - ISC
|
|
113
113
|
*
|
|
114
114
|
* This source code is licensed under the ISC license.
|
|
115
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const
|
|
116
|
+
*/const Dp=fe("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
117
117
|
* @license lucide-react v0.460.0 - ISC
|
|
118
118
|
*
|
|
119
119
|
* This source code is licensed under the ISC license.
|
|
120
120
|
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const
|
|
121
|
+
*/const Ip=fe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
122
122
|
* @license lucide-react v0.460.0 - ISC
|
|
123
123
|
*
|
|
124
124
|
* This source code is licensed under the ISC license.
|
|
125
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const
|
|
126
|
+
*/const hi=fe("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/**
|
|
127
127
|
* @license lucide-react v0.460.0 - ISC
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const
|
|
131
|
+
*/const kp=fe("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
|
|
132
132
|
* @license lucide-react v0.460.0 - ISC
|
|
133
133
|
*
|
|
134
134
|
* This source code is licensed under the ISC license.
|
|
135
135
|
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const
|
|
136
|
+
*/const gi=fe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
137
137
|
* @license lucide-react v0.460.0 - ISC
|
|
138
138
|
*
|
|
139
139
|
* This source code is licensed under the ISC license.
|
|
140
140
|
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const
|
|
141
|
+
*/const Tt=fe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
142
142
|
* @license lucide-react v0.460.0 - ISC
|
|
143
143
|
*
|
|
144
144
|
* This source code is licensed under the ISC license.
|
|
145
145
|
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const
|
|
146
|
+
*/const lo=fe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
147
147
|
* @license lucide-react v0.460.0 - ISC
|
|
148
148
|
*
|
|
149
149
|
* This source code is licensed under the ISC license.
|
|
150
150
|
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const
|
|
151
|
+
*/const Op=fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
152
152
|
* @license lucide-react v0.460.0 - ISC
|
|
153
153
|
*
|
|
154
154
|
* This source code is licensed under the ISC license.
|
|
155
155
|
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const
|
|
156
|
+
*/const Sa=fe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
157
157
|
* @license lucide-react v0.460.0 - ISC
|
|
158
158
|
*
|
|
159
159
|
* This source code is licensed under the ISC license.
|
|
160
160
|
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const
|
|
161
|
+
*/const vi=fe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
162
162
|
* @license lucide-react v0.460.0 - ISC
|
|
163
163
|
*
|
|
164
164
|
* This source code is licensed under the ISC license.
|
|
165
165
|
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const
|
|
166
|
+
*/const Mo=fe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
167
167
|
* @license lucide-react v0.460.0 - ISC
|
|
168
168
|
*
|
|
169
169
|
* This source code is licensed under the ISC license.
|
|
170
170
|
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const
|
|
171
|
+
*/const co=fe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
172
172
|
* @license lucide-react v0.460.0 - ISC
|
|
173
173
|
*
|
|
174
174
|
* This source code is licensed under the ISC license.
|
|
175
175
|
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const ln=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),wa=an("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),de=l.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,loading:o=!1,children:s,disabled:i,...a},c)=>{const d=n?Rf:"button";return u.jsxs(d,{className:M(wa({variant:t,size:r,className:e})),ref:c,disabled:i||o,...a,children:[o&&u.jsx(Ht,{className:"mr-2 h-4 w-4 animate-spin"}),s]})});de.displayName="Button";const gt=l.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:M("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));gt.displayName="Card";const yr=l.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:M("flex flex-col space-y-1.5 p-6",e),...t}));yr.displayName="CardHeader";const xr=l.forwardRef(({className:e,...t},r)=>u.jsx("h3",{ref:r,className:M("text-2xl font-semibold leading-none tracking-tight",e),...t}));xr.displayName="CardTitle";const br=l.forwardRef(({className:e,...t},r)=>u.jsx("p",{ref:r,className:M("text-sm text-muted-foreground",e),...t}));br.displayName="CardDescription";const vt=l.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:M("p-6 pt-0",e),...t}));vt.displayName="CardContent";const Sa=l.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:M("flex items-center p-6 pt-0",e),...t}));Sa.displayName="CardFooter";const Ca=an("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-500 text-white hover:bg-green-600",warning:"border-transparent bg-yellow-500 text-white hover:bg-yellow-600",info:"border-transparent bg-blue-500 text-white hover:bg-blue-600"}},defaultVariants:{variant:"default"}});function or({className:e,variant:t,...r}){return u.jsx("div",{className:M(Ca({variant:t}),e),...r})}const cn=l.forwardRef(({className:e,type:t,...r},n)=>u.jsx("input",{type:t,className:M("flex h-10 w-full rounded-md border border-input bg-background 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",e),ref:n,...r}));cn.displayName="Input";var $p=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wr=$p.reduce((e,t)=>{const r=ia(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Lp="Label",Ea=l.forwardRef((e,t)=>u.jsx(wr.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Ea.displayName=Lp;var Na=Ea;const Fp=an("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Sr=l.forwardRef(({className:e,...t},r)=>u.jsx(Na,{ref:r,className:M(Fp(),e),...t}));Sr.displayName=Na.displayName;const Ao=l.forwardRef(({className:e,...t},r)=>u.jsx("textarea",{className:M("flex min-h-[80px] w-full rounded-md border border-input bg-background 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",e),ref:r,...t}));Ao.displayName="Textarea";function Vp(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,Wp(o,...t)]}function Wp(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function z(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var we=globalThis!=null&&globalThis.document?l.useLayoutEffect:()=>{},Bp=l[" useInsertionEffect ".trim().toString()]||we;function tt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,i]=Hp({defaultProp:t,onChange:r}),a=e!==void 0,c=a?e:o;{const p=l.useRef(e!==void 0);l.useEffect(()=>{const f=p.current;f!==a&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${a?"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.`),p.current=a},[a,n])}const d=l.useCallback(p=>{var f;if(a){const m=Up(p)?p(e):p;m!==e&&((f=i.current)==null||f.call(i,m))}else s(p)},[a,e,s,i]);return[c,d]}function Hp({defaultProp:e,onChange:t}){const[r,n]=l.useState(e),o=l.useRef(r),s=l.useRef(t);return Bp(()=>{s.current=t},[t]),l.useEffect(()=>{var i;o.current!==r&&((i=s.current)==null||i.call(s,r),o.current=r)},[r,o]),[r,n,s]}function Up(e){return typeof e=="function"}function To(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Mo(e){const[t,r]=l.useState(void 0);return we(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,a=d.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}function zp(e,t){return l.useReducer((r,n)=>t[r][n]??r,e)}var Te=e=>{const{present:t,children:r}=e,n=Gp(t),o=typeof r=="function"?r({present:n.isPresent}):l.Children.only(r),s=oe(n.ref,Kp(o));return typeof r=="function"||n.isPresent?l.cloneElement(o,{ref:s}):null};Te.displayName="Presence";function Gp(e){const[t,r]=l.useState(),n=l.useRef(null),o=l.useRef(e),s=l.useRef("none"),i=e?"mounted":"unmounted",[a,c]=zp(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const d=kr(n.current);s.current=a==="mounted"?d:"none"},[a]),we(()=>{const d=n.current,p=o.current;if(p!==e){const m=s.current,g=kr(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(p&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),we(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,f=g=>{const h=kr(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&h&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=g=>{g.target===t&&(s.current=kr(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:l.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function kr(e){return(e==null?void 0:e.animationName)||"none"}function Kp(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Yp(e){const t=qp(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(Zp);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function qp(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Jp(o),a=Qp(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xp=Symbol("radix.slottable");function Zp(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xp}function Qp(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Jp(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var em=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Do=em.reduce((e,t)=>{const r=Yp(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),un="Checkbox",[tm]=Vp(un),[rm,Io]=tm(un);function nm(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:d,value:p="on",internal_do_not_use_render:f}=e,[m,g]=tt({prop:r,defaultProp:o??!1,onChange:c,caller:un}),[v,h]=l.useState(null),[y,x]=l.useState(null),b=l.useRef(!1),w=v?!!i||!!v.closest("form"):!0,S={checked:m,disabled:s,setChecked:g,control:v,setControl:h,name:a,form:i,value:p,hasConsumerStoppedPropagationRef:b,required:d,defaultChecked:yt(o)?!1:o,isFormControl:w,bubbleInput:y,setBubbleInput:x};return u.jsx(rm,{scope:t,...S,children:om(f)?f(S):n})}var Ra="CheckboxTrigger",_a=l.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},o)=>{const{control:s,value:i,disabled:a,checked:c,required:d,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:g,bubbleInput:v}=Io(Ra,e),h=oe(o,p),y=l.useRef(c);return l.useEffect(()=>{const x=s==null?void 0:s.form;if(x){const b=()=>f(y.current);return x.addEventListener("reset",b),()=>x.removeEventListener("reset",b)}},[s,f]),u.jsx(Do.button,{type:"button",role:"checkbox","aria-checked":yt(c)?"mixed":c,"aria-required":d,"data-state":Ma(c),"data-disabled":a?"":void 0,disabled:a,value:i,...n,ref:h,onKeyDown:z(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:z(r,x=>{f(b=>yt(b)?!0:!b),v&&g&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})});_a.displayName=Ra;var ko=l.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:o,defaultChecked:s,required:i,disabled:a,value:c,onCheckedChange:d,form:p,...f}=e;return u.jsx(nm,{__scopeCheckbox:r,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:d,name:n,form:p,value:c,internal_do_not_use_render:({isFormControl:m})=>u.jsxs(u.Fragment,{children:[u.jsx(_a,{...f,ref:t,__scopeCheckbox:r}),m&&u.jsx(Ta,{__scopeCheckbox:r})]})})});ko.displayName=un;var Pa="CheckboxIndicator",ja=l.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...o}=e,s=Io(Pa,r);return u.jsx(Te,{present:n||yt(s.checked)||s.checked===!0,children:u.jsx(Do.span,{"data-state":Ma(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});ja.displayName=Pa;var Aa="CheckboxBubbleInput",Ta=l.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:c,name:d,value:p,form:f,bubbleInput:m,setBubbleInput:g}=Io(Aa,e),v=oe(r,g),h=To(s),y=Mo(n);l.useEffect(()=>{const b=m;if(!b)return;const w=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(w,"checked").set,j=!o.current;if(h!==s&&E){const _=new Event("click",{bubbles:j});b.indeterminate=yt(s),E.call(b,yt(s)?!1:s),b.dispatchEvent(_)}},[m,h,s,o]);const x=l.useRef(yt(s)?!1:s);return u.jsx(Do.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:a,disabled:c,name:d,value:p,form:f,...t,tabIndex:-1,ref:v,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ta.displayName=Aa;function om(e){return typeof e=="function"}function yt(e){return e==="indeterminate"}function Ma(e){return yt(e)?"indeterminate":e?"checked":"unchecked"}const dr=l.forwardRef(({className:e,...t},r)=>u.jsx(ko,{ref:r,className:M("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:u.jsx(ja,{className:M("flex items-center justify-center text-current"),children:u.jsx(ur,{className:"h-4 w-4"})})}));dr.displayName=ko.displayName;function sm(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,im(o,...t)]}function im(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function am(e){const t=lm(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(um);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function lm(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=fm(o),a=dm(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cm=Symbol("radix.slottable");function um(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cm}function dm(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function fm(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var pm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Da=pm.reduce((e,t)=>{const r=am(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),dn="Switch",[mm]=sm(dn),[hm,gm]=mm(dn),Ia=l.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:o,defaultChecked:s,required:i,disabled:a,value:c="on",onCheckedChange:d,form:p,...f}=e,[m,g]=l.useState(null),v=oe(t,w=>g(w)),h=l.useRef(!1),y=m?p||!!m.closest("form"):!0,[x,b]=tt({prop:o,defaultProp:s??!1,onChange:d,caller:dn});return u.jsxs(hm,{scope:r,checked:x,disabled:a,children:[u.jsx(Da.button,{type:"button",role:"switch","aria-checked":x,"aria-required":i,"data-state":La(x),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:v,onClick:z(e.onClick,w=>{b(S=>!S),y&&(h.current=w.isPropagationStopped(),h.current||w.stopPropagation())})}),y&&u.jsx($a,{control:m,bubbles:!h.current,name:n,value:c,checked:x,required:i,disabled:a,form:p,style:{transform:"translateX(-100%)"}})]})});Ia.displayName=dn;var ka="SwitchThumb",Oa=l.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=gm(ka,r);return u.jsx(Da.span,{"data-state":La(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});Oa.displayName=ka;var vm="SwitchBubbleInput",$a=l.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...o},s)=>{const i=l.useRef(null),a=oe(i,s),c=To(r),d=Mo(t);return l.useEffect(()=>{const p=i.current;if(!p)return;const f=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&g){const v=new Event("click",{bubbles:n});g.call(p,r),p.dispatchEvent(v)}},[c,r,n]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:a,style:{...o.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});$a.displayName=vm;function La(e){return e?"checked":"unchecked"}var Fa=Ia,ym=Oa;const Oo=l.forwardRef(({className:e,...t},r)=>u.jsx(Fa,{className:M("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:u.jsx(ym,{className:M("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Oo.displayName=Fa.displayName;function xm({className:e,...t}){return u.jsx("div",{className:M("animate-pulse rounded-md bg-muted",e),...t})}var bm="Separator",mi="horizontal",wm=["horizontal","vertical"],Va=l.forwardRef((e,t)=>{const{decorative:r,orientation:n=mi,...o}=e,s=Sm(n)?n:mi,a=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return u.jsx(wr.div,{"data-orientation":s,...a,...o,ref:t})});Va.displayName=bm;function Sm(e){return wm.includes(e)}var Wa=Va;const $o=l.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},o)=>u.jsx(Wa,{ref:o,decorative:r,orientation:t,className:M("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));$o.displayName=Wa.displayName;function ao(e,[t,r]){return Math.min(r,Math.max(t,e))}function Cm(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,Em(o,...t)]}function Em(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function hi(e){const t=Nm(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(_m);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Nm(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=jm(o),a=Pm(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Rm=Symbol("radix.slottable");function _m(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Rm}function Pm(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function jm(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Lo(e){const t=e+"CollectionProvider",[r,n]=Cm(t),[o,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:y,children:x}=h,b=le.useRef(null),w=le.useRef(new Map).current;return u.jsx(o,{scope:y,itemMap:w,collectionRef:b,children:x})};i.displayName=t;const a=e+"CollectionSlot",c=hi(a),d=le.forwardRef((h,y)=>{const{scope:x,children:b}=h,w=s(a,x),S=oe(y,w.collectionRef);return u.jsx(c,{ref:S,children:b})});d.displayName=a;const p=e+"CollectionItemSlot",f="data-radix-collection-item",m=hi(p),g=le.forwardRef((h,y)=>{const{scope:x,children:b,...w}=h,S=le.useRef(null),E=oe(y,S),j=s(p,x);return le.useEffect(()=>(j.itemMap.set(S,{ref:S,...w}),()=>void j.itemMap.delete(S))),u.jsx(m,{[f]:"",ref:E,children:b})});g.displayName=p;function v(h){const y=s(e+"CollectionConsumer",h);return le.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((j,_)=>w.indexOf(j.ref.current)-w.indexOf(_.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:d,ItemSlot:g},v,n]}function Am(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,Tm(o,...t)]}function Tm(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var Mm=l.createContext(void 0);function Cr(e){const t=l.useContext(Mm);return e||t||"ltr"}function Dm(e){const t=Im(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(Om);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Im(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Lm(o),a=$m(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var km=Symbol("radix.slottable");function Om(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===km}function $m(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Lm(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Fm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ba=Fm.reduce((e,t)=>{const r=Dm(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Vm(e,t){e&&vr.flushSync(()=>e.dispatchEvent(t))}function Ce(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function Wm(e,t=globalThis==null?void 0:globalThis.document){const r=Ce(e);l.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Bm="DismissableLayer",lo="dismissableLayer.update",Hm="dismissableLayer.pointerDownOutside",Um="dismissableLayer.focusOutside",gi,Ha=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Er=l.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,d=l.useContext(Ha),[p,f]=l.useState(null),m=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=l.useState({}),v=oe(t,_=>f(_)),h=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=h.indexOf(y),b=p?h.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=x,E=Km(_=>{const I=_.target,D=[...d.branches].some(O=>O.contains(I));!S||D||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},m),j=Ym(_=>{const I=_.target;[...d.branches].some(O=>O.contains(I))||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},m);return Wm(_=>{b===d.layers.size-1&&(n==null||n(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},m),l.useEffect(()=>{if(p)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(gi=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),vi(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=gi)}},[p,m,r,d]),l.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),vi())},[p,d]),l.useEffect(()=>{const _=()=>g({});return document.addEventListener(lo,_),()=>document.removeEventListener(lo,_)},[]),u.jsx(Ba.div,{...c,ref:v,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:z(e.onFocusCapture,j.onFocusCapture),onBlurCapture:z(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:z(e.onPointerDownCapture,E.onPointerDownCapture)})});Er.displayName=Bm;var zm="DismissableLayerBranch",Gm=l.forwardRef((e,t)=>{const r=l.useContext(Ha),n=l.useRef(null),o=oe(t,n);return l.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),u.jsx(Ba.div,{...e,ref:o})});Gm.displayName=zm;function Km(e,t=globalThis==null?void 0:globalThis.document){const r=Ce(e),n=l.useRef(!1),o=l.useRef(()=>{});return l.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){Ua(Hm,r,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Ym(e,t=globalThis==null?void 0:globalThis.document){const r=Ce(e),n=l.useRef(!1);return l.useEffect(()=>{const o=s=>{s.target&&!n.current&&Ua(Um,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function vi(){const e=new CustomEvent(lo);document.dispatchEvent(e)}function Ua(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Vm(o,s):o.dispatchEvent(s)}var Kn=0;function Fo(){l.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yi()),document.body.insertAdjacentElement("beforeend",e[1]??yi()),Kn++,()=>{Kn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Kn--}},[])}function yi(){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}function qm(e){const t=Xm(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(Qm);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Xm(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=eh(o),a=Jm(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zm=Symbol("radix.slottable");function Qm(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zm}function Jm(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function eh(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var th=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rh=th.reduce((e,t)=>{const r=qm(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Yn="focusScope.autoFocusOnMount",qn="focusScope.autoFocusOnUnmount",xi={bubbles:!1,cancelable:!0},nh="FocusScope",fn=l.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=l.useState(null),d=Ce(o),p=Ce(s),f=l.useRef(null),m=oe(t,h=>c(h)),g=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(n){let h=function(w){if(g.paused||!a)return;const S=w.target;a.contains(S)?f.current=S:mt(f.current,{select:!0})},y=function(w){if(g.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||mt(f.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&mt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),b.disconnect()}}},[n,a,g.paused]),l.useEffect(()=>{if(a){wi.add(g);const h=document.activeElement;if(!a.contains(h)){const x=new CustomEvent(Yn,xi);a.addEventListener(Yn,d),a.dispatchEvent(x),x.defaultPrevented||(oh(ch(za(a)),{select:!0}),document.activeElement===h&&mt(a))}return()=>{a.removeEventListener(Yn,d),setTimeout(()=>{const x=new CustomEvent(qn,xi);a.addEventListener(qn,p),a.dispatchEvent(x),x.defaultPrevented||mt(h??document.body,{select:!0}),a.removeEventListener(qn,p),wi.remove(g)},0)}}},[a,d,p,g]);const v=l.useCallback(h=>{if(!r&&!n||g.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,x=document.activeElement;if(y&&x){const b=h.currentTarget,[w,S]=sh(b);w&&S?!h.shiftKey&&x===S?(h.preventDefault(),r&&mt(w,{select:!0})):h.shiftKey&&x===w&&(h.preventDefault(),r&&mt(S,{select:!0})):x===b&&h.preventDefault()}},[r,n,g.paused]);return u.jsx(rh.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});fn.displayName=nh;function oh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(mt(n,{select:t}),document.activeElement!==r)return}function sh(e){const t=za(e),r=bi(t,e),n=bi(t.reverse(),e);return[r,n]}function za(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function bi(e,t){for(const r of e)if(!ih(r,{upTo:t}))return r}function ih(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 ah(e){return e instanceof HTMLInputElement&&"select"in e}function mt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&ah(e)&&t&&e.select()}}var wi=lh();function lh(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Si(e,t),e.unshift(t)},remove(t){var r;e=Si(e,t),(r=e[0])==null||r.resume()}}}function Si(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function ch(e){return e.filter(t=>t.tagName!=="A")}var uh=l[" useId ".trim().toString()]||(()=>{}),dh=0;function Oe(e){const[t,r]=l.useState(uh());return we(()=>{r(n=>n??String(dh++))},[e]),e||(t?`radix-${t}`:"")}const fh=["top","right","bottom","left"],xt=Math.min,Ie=Math.max,Kr=Math.round,Or=Math.floor,et=e=>({x:e,y:e}),ph={left:"right",right:"left",bottom:"top",top:"bottom"},mh={start:"end",end:"start"};function co(e,t,r){return Ie(e,xt(t,r))}function ut(e,t){return typeof e=="function"?e(t):e}function dt(e){return e.split("-")[0]}function Yt(e){return e.split("-")[1]}function Vo(e){return e==="x"?"y":"x"}function Wo(e){return e==="y"?"height":"width"}const hh=new Set(["top","bottom"]);function Je(e){return hh.has(dt(e))?"y":"x"}function Bo(e){return Vo(Je(e))}function gh(e,t,r){r===void 0&&(r=!1);const n=Yt(e),o=Bo(e),s=Wo(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Yr(i)),[i,Yr(i)]}function vh(e){const t=Yr(e);return[uo(e),t,uo(t)]}function uo(e){return e.replace(/start|end/g,t=>mh[t])}const Ci=["left","right"],Ei=["right","left"],yh=["top","bottom"],xh=["bottom","top"];function bh(e,t,r){switch(e){case"top":case"bottom":return r?t?Ei:Ci:t?Ci:Ei;case"left":case"right":return t?yh:xh;default:return[]}}function wh(e,t,r,n){const o=Yt(e);let s=bh(dt(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(uo)))),s}function Yr(e){return e.replace(/left|right|bottom|top/g,t=>ph[t])}function Sh(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ga(e){return typeof e!="number"?Sh(e):{top:e,right:e,bottom:e,left:e}}function qr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Ni(e,t,r){let{reference:n,floating:o}=e;const s=Je(t),i=Bo(t),a=Wo(i),c=dt(t),d=s==="y",p=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,m=n[a]/2-o[a]/2;let g;switch(c){case"top":g={x:p,y:n.y-o.height};break;case"bottom":g={x:p,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:f};break;case"left":g={x:n.x-o.width,y:f};break;default:g={x:n.x,y:n.y}}switch(Yt(t)){case"start":g[i]-=m*(r&&d?-1:1);break;case"end":g[i]+=m*(r&&d?-1:1);break}return g}const Ch=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:f}=Ni(d,n,c),m=n,g={},v=0;for(let h=0;h<a.length;h++){const{name:y,fn:x}=a[h],{x:b,y:w,data:S,reset:E}=await x({x:p,y:f,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:i,elements:{reference:e,floating:t}});p=b??p,f=w??f,g={...g,[y]:{...g[y],...S}},E&&v<=50&&(v++,typeof E=="object"&&(E.placement&&(m=E.placement),E.rects&&(d=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:p,y:f}=Ni(d,m,c)),h=-1)}return{x:p,y:f,placement:m,strategy:o,middlewareData:g}};async function fr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:m=!1,padding:g=0}=ut(t,e),v=Ga(g),y=a[m?f==="floating"?"reference":"floating":f],x=qr(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(y)))==null||r?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:d,rootBoundary:p,strategy:c})),b=f==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},E=qr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:c}):b);return{top:(x.top-E.top+v.top)/S.y,bottom:(E.bottom-x.bottom+v.bottom)/S.y,left:(x.left-E.left+v.left)/S.x,right:(E.right-x.right+v.right)/S.x}}const Eh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:d,padding:p=0}=ut(e,t)||{};if(d==null)return{};const f=Ga(p),m={x:r,y:n},g=Bo(o),v=Wo(g),h=await i.getDimensions(d),y=g==="y",x=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",S=s.reference[v]+s.reference[g]-m[g]-s.floating[v],E=m[g]-s.reference[g],j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let _=j?j[w]:0;(!_||!await(i.isElement==null?void 0:i.isElement(j)))&&(_=a.floating[w]||s.floating[v]);const I=S/2-E/2,D=_/2-h[v]/2-1,O=xt(f[x],D),A=xt(f[b],D),R=O,W=_-h[v]-A,B=_/2-h[v]/2+I,q=co(R,B,W),H=!c.arrow&&Yt(o)!=null&&B!==q&&s.reference[v]/2-(B<R?O:A)-h[v]/2<0,U=H?B<R?B-R:B-W:0;return{[g]:m[g]+U,data:{[g]:q,centerOffset:B-q-U,...H&&{alignmentOffset:U}},reset:H}}}),Nh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:d}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...y}=ut(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const x=dt(o),b=Je(a),w=dt(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),E=m||(w||!h?[Yr(a)]:vh(a)),j=v!=="none";!m&&j&&E.push(...wh(a,h,v,S));const _=[a,...E],I=await fr(t,y),D=[];let O=((n=s.flip)==null?void 0:n.overflows)||[];if(p&&D.push(I[x]),f){const B=gh(o,i,S);D.push(I[B[0]],I[B[1]])}if(O=[...O,{placement:o,overflows:D}],!D.every(B=>B<=0)){var A,R;const B=(((A=s.flip)==null?void 0:A.index)||0)+1,q=_[B];if(q&&(!(f==="alignment"?b!==Je(q):!1)||O.every($=>Je($.placement)===b?$.overflows[0]>0:!0)))return{data:{index:B,overflows:O},reset:{placement:q}};let H=(R=O.filter(U=>U.overflows[0]<=0).sort((U,$)=>U.overflows[1]-$.overflows[1])[0])==null?void 0:R.placement;if(!H)switch(g){case"bestFit":{var W;const U=(W=O.filter($=>{if(j){const k=Je($.placement);return k===b||k==="y"}return!0}).map($=>[$.placement,$.overflows.filter(k=>k>0).reduce((k,ee)=>k+ee,0)]).sort(($,k)=>$[1]-k[1])[0])==null?void 0:W[0];U&&(H=U);break}case"initialPlacement":H=a;break}if(o!==H)return{reset:{placement:H}}}return{}}}};function Ri(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _i(e){return fh.some(t=>e[t]>=0)}const Rh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=ut(e,t);switch(n){case"referenceHidden":{const s=await fr(t,{...o,elementContext:"reference"}),i=Ri(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:_i(i)}}}case"escaped":{const s=await fr(t,{...o,altBoundary:!0}),i=Ri(s,r.floating);return{data:{escapedOffsets:i,escaped:_i(i)}}}default:return{}}}}},Ka=new Set(["left","top"]);async function _h(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=dt(r),a=Yt(r),c=Je(r)==="y",d=Ka.has(i)?-1:1,p=s&&c?-1:1,f=ut(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),c?{x:g*p,y:m*d}:{x:m*d,y:g*p}}const Ph=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await _h(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},jh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...c}=ut(e,t),d={x:r,y:n},p=await fr(t,c),f=Je(dt(o)),m=Vo(f);let g=d[m],v=d[f];if(s){const y=m==="y"?"top":"left",x=m==="y"?"bottom":"right",b=g+p[y],w=g-p[x];g=co(b,g,w)}if(i){const y=f==="y"?"top":"left",x=f==="y"?"bottom":"right",b=v+p[y],w=v-p[x];v=co(b,v,w)}const h=a.fn({...t,[m]:g,[f]:v});return{...h,data:{x:h.x-r,y:h.y-n,enabled:{[m]:s,[f]:i}}}}}},Ah=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:d=!0}=ut(e,t),p={x:r,y:n},f=Je(o),m=Vo(f);let g=p[m],v=p[f];const h=ut(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const w=m==="y"?"height":"width",S=s.reference[m]-s.floating[w]+y.mainAxis,E=s.reference[m]+s.reference[w]-y.mainAxis;g<S?g=S:g>E&&(g=E)}if(d){var x,b;const w=m==="y"?"width":"height",S=Ka.has(dt(o)),E=s.reference[f]-s.floating[w]+(S&&((x=i.offset)==null?void 0:x[f])||0)+(S?0:y.crossAxis),j=s.reference[f]+s.reference[w]+(S?0:((b=i.offset)==null?void 0:b[f])||0)-(S?y.crossAxis:0);v<E?v=E:v>j&&(v=j)}return{[m]:g,[f]:v}}}},Th=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...d}=ut(e,t),p=await fr(t,d),f=dt(o),m=Yt(o),g=Je(o)==="y",{width:v,height:h}=s.floating;let y,x;f==="top"||f==="bottom"?(y=f,x=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,y=m==="end"?"top":"bottom");const b=h-p.top-p.bottom,w=v-p.left-p.right,S=xt(h-p[y],b),E=xt(v-p[x],w),j=!t.middlewareData.shift;let _=S,I=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(I=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(_=b),j&&!m){const O=Ie(p.left,0),A=Ie(p.right,0),R=Ie(p.top,0),W=Ie(p.bottom,0);g?I=v-2*(O!==0||A!==0?O+A:Ie(p.left,p.right)):_=h-2*(R!==0||W!==0?R+W:Ie(p.top,p.bottom))}await c({...t,availableWidth:I,availableHeight:_});const D=await i.getDimensions(a.floating);return v!==D.width||h!==D.height?{reset:{rects:!0}}:{}}}};function pn(){return typeof window<"u"}function qt(e){return Ya(e)?(e.nodeName||"").toLowerCase():"#document"}function $e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nt(e){var t;return(t=(Ya(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ya(e){return pn()?e instanceof Node||e instanceof $e(e).Node:!1}function Ge(e){return pn()?e instanceof Element||e instanceof $e(e).Element:!1}function rt(e){return pn()?e instanceof HTMLElement||e instanceof $e(e).HTMLElement:!1}function Pi(e){return!pn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $e(e).ShadowRoot}const Mh=new Set(["inline","contents"]);function Nr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Ke(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Mh.has(o)}const Dh=new Set(["table","td","th"]);function Ih(e){return Dh.has(qt(e))}const kh=[":popover-open",":modal"];function mn(e){return kh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Oh=["transform","translate","scale","rotate","perspective"],$h=["transform","translate","scale","rotate","perspective","filter"],Lh=["paint","layout","strict","content"];function Ho(e){const t=Uo(),r=Ge(e)?Ke(e):e;return Oh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||$h.some(n=>(r.willChange||"").includes(n))||Lh.some(n=>(r.contain||"").includes(n))}function Fh(e){let t=bt(e);for(;rt(t)&&!Ut(t);){if(Ho(t))return t;if(mn(t))return null;t=bt(t)}return null}function Uo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Vh=new Set(["html","body","#document"]);function Ut(e){return Vh.has(qt(e))}function Ke(e){return $e(e).getComputedStyle(e)}function hn(e){return Ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bt(e){if(qt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pi(e)&&e.host||nt(e);return Pi(t)?t.host:t}function qa(e){const t=bt(e);return Ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:rt(t)&&Nr(t)?t:qa(t)}function pr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=qa(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=$e(o);if(s){const a=fo(i);return t.concat(i,i.visualViewport||[],Nr(o)?o:[],a&&r?pr(a):[])}return t.concat(o,pr(o,[],r))}function fo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xa(e){const t=Ke(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=rt(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,a=Kr(r)!==s||Kr(n)!==i;return a&&(r=s,n=i),{width:r,height:n,$:a}}function zo(e){return Ge(e)?e:e.contextElement}function Wt(e){const t=zo(e);if(!rt(t))return et(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=Xa(t);let i=(s?Kr(r.width):r.width)/n,a=(s?Kr(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Wh=et(0);function Za(e){const t=$e(e);return!Uo()||!t.visualViewport?Wh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==$e(e)?!1:t}function _t(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=zo(e);let i=et(1);t&&(n?Ge(n)&&(i=Wt(n)):i=Wt(e));const a=Bh(s,r,n)?Za(s):et(0);let c=(o.left+a.x)/i.x,d=(o.top+a.y)/i.y,p=o.width/i.x,f=o.height/i.y;if(s){const m=$e(s),g=n&&Ge(n)?$e(n):n;let v=m,h=fo(v);for(;h&&n&&g!==v;){const y=Wt(h),x=h.getBoundingClientRect(),b=Ke(h),w=x.left+(h.clientLeft+parseFloat(b.paddingLeft))*y.x,S=x.top+(h.clientTop+parseFloat(b.paddingTop))*y.y;c*=y.x,d*=y.y,p*=y.x,f*=y.y,c+=w,d+=S,v=$e(h),h=fo(v)}}return qr({width:p,height:f,x:c,y:d})}function gn(e,t){const r=hn(e).scrollLeft;return t?t.left+r:_t(nt(e)).left+r}function Qa(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-gn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Hh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",i=nt(n),a=t?mn(t.floating):!1;if(n===i||a&&s)return r;let c={scrollLeft:0,scrollTop:0},d=et(1);const p=et(0),f=rt(n);if((f||!f&&!s)&&((qt(n)!=="body"||Nr(i))&&(c=hn(n)),rt(n))){const g=_t(n);d=Wt(n),p.x=g.x+n.clientLeft,p.y=g.y+n.clientTop}const m=i&&!f&&!s?Qa(i,c):et(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+p.x+m.x,y:r.y*d.y-c.scrollTop*d.y+p.y+m.y}}function Uh(e){return Array.from(e.getClientRects())}function zh(e){const t=nt(e),r=hn(e),n=e.ownerDocument.body,o=Ie(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Ie(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+gn(e);const a=-r.scrollTop;return Ke(n).direction==="rtl"&&(i+=Ie(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:a}}const ji=25;function Gh(e,t){const r=$e(e),n=nt(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const p=Uo();(!p||p&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const d=gn(n);if(d<=0){const p=n.ownerDocument,f=p.body,m=getComputedStyle(f),g=p.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,v=Math.abs(n.clientWidth-f.clientWidth-g);v<=ji&&(s-=v)}else d<=ji&&(s+=d);return{width:s,height:i,x:a,y:c}}const Kh=new Set(["absolute","fixed"]);function Yh(e,t){const r=_t(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=rt(e)?Wt(e):et(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,d=n*s.y;return{width:i,height:a,x:c,y:d}}function Ai(e,t,r){let n;if(t==="viewport")n=Gh(e,r);else if(t==="document")n=zh(nt(e));else if(Ge(t))n=Yh(t,r);else{const o=Za(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return qr(n)}function Ja(e,t){const r=bt(e);return r===t||!Ge(r)||Ut(r)?!1:Ke(r).position==="fixed"||Ja(r,t)}function qh(e,t){const r=t.get(e);if(r)return r;let n=pr(e,[],!1).filter(a=>Ge(a)&&qt(a)!=="body"),o=null;const s=Ke(e).position==="fixed";let i=s?bt(e):e;for(;Ge(i)&&!Ut(i);){const a=Ke(i),c=Ho(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&Kh.has(o.position)||Nr(i)&&!c&&Ja(e,i))?n=n.filter(p=>p!==i):o=a,i=bt(i)}return t.set(e,n),n}function Xh(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?mn(t)?[]:qh(t,this._c):[].concat(r),n],a=i[0],c=i.reduce((d,p)=>{const f=Ai(t,p,o);return d.top=Ie(f.top,d.top),d.right=xt(f.right,d.right),d.bottom=xt(f.bottom,d.bottom),d.left=Ie(f.left,d.left),d},Ai(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Zh(e){const{width:t,height:r}=Xa(e);return{width:t,height:r}}function Qh(e,t,r){const n=rt(t),o=nt(t),s=r==="fixed",i=_t(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=et(0);function d(){c.x=gn(o)}if(n||!n&&!s)if((qt(t)!=="body"||Nr(o))&&(a=hn(t)),n){const g=_t(t,!0,s,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();s&&!n&&o&&d();const p=o&&!n&&!s?Qa(o,a):et(0),f=i.left+a.scrollLeft-c.x-p.x,m=i.top+a.scrollTop-c.y-p.y;return{x:f,y:m,width:i.width,height:i.height}}function Xn(e){return Ke(e).position==="static"}function Ti(e,t){if(!rt(e)||Ke(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return nt(e)===r&&(r=r.ownerDocument.body),r}function el(e,t){const r=$e(e);if(mn(e))return r;if(!rt(e)){let o=bt(e);for(;o&&!Ut(o);){if(Ge(o)&&!Xn(o))return o;o=bt(o)}return r}let n=Ti(e,t);for(;n&&Ih(n)&&Xn(n);)n=Ti(n,t);return n&&Ut(n)&&Xn(n)&&!Ho(n)?r:n||Fh(e)||r}const Jh=async function(e){const t=this.getOffsetParent||el,r=this.getDimensions,n=await r(e.floating);return{reference:Qh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function eg(e){return Ke(e).direction==="rtl"}const tg={convertOffsetParentRelativeRectToViewportRelativeRect:Hh,getDocumentElement:nt,getClippingRect:Xh,getOffsetParent:el,getElementRects:Jh,getClientRects:Uh,getDimensions:Zh,getScale:Wt,isElement:Ge,isRTL:eg};function tl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rg(e,t){let r=null,n;const o=nt(e);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:p,top:f,width:m,height:g}=d;if(a||t(),!m||!g)return;const v=Or(f),h=Or(o.clientWidth-(p+m)),y=Or(o.clientHeight-(f+g)),x=Or(p),w={rootMargin:-v+"px "+-h+"px "+-y+"px "+-x+"px",threshold:Ie(0,xt(1,c))||1};let S=!0;function E(j){const _=j[0].intersectionRatio;if(_!==c){if(!S)return i();_?i(!1,_):n=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!tl(d,e.getBoundingClientRect())&&i(),S=!1}try{r=new IntersectionObserver(E,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(E,w)}r.observe(e)}return i(!0),s}function ng(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=zo(e),p=o||s?[...d?pr(d):[],...pr(t)]:[];p.forEach(x=>{o&&x.addEventListener("scroll",r,{passive:!0}),s&&x.addEventListener("resize",r)});const f=d&&a?rg(d,r):null;let m=-1,g=null;i&&(g=new ResizeObserver(x=>{let[b]=x;b&&b.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let v,h=c?_t(e):null;c&&y();function y(){const x=_t(e);h&&!tl(h,x)&&r(),h=x,v=requestAnimationFrame(y)}return r(),()=>{var x;p.forEach(b=>{o&&b.removeEventListener("scroll",r),s&&b.removeEventListener("resize",r)}),f==null||f(),(x=g)==null||x.disconnect(),g=null,c&&cancelAnimationFrame(v)}}const og=Ph,sg=jh,ig=Nh,ag=Th,lg=Rh,Mi=Eh,cg=Ah,ug=(e,t,r)=>{const n=new Map,o={platform:tg,...r},s={...o.platform,_c:n};return Ch(e,t,{...o,platform:s})};var dg=typeof document<"u",fg=function(){},Hr=dg?le.useLayoutEffect:fg;function Xr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Xr(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!Xr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function rl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Di(e,t){const r=rl(e);return Math.round(t*r)/r}function Zn(e){const t=l.useRef(e);return Hr(()=>{t.current=e}),t}function pg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:d}=e,[p,f]=l.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=l.useState(n);Xr(m,n)||g(n);const[v,h]=l.useState(null),[y,x]=l.useState(null),b=l.useCallback($=>{$!==j.current&&(j.current=$,h($))},[]),w=l.useCallback($=>{$!==_.current&&(_.current=$,x($))},[]),S=s||v,E=i||y,j=l.useRef(null),_=l.useRef(null),I=l.useRef(p),D=c!=null,O=Zn(c),A=Zn(o),R=Zn(d),W=l.useCallback(()=>{if(!j.current||!_.current)return;const $={placement:t,strategy:r,middleware:m};A.current&&($.platform=A.current),ug(j.current,_.current,$).then(k=>{const ee={...k,isPositioned:R.current!==!1};B.current&&!Xr(I.current,ee)&&(I.current=ee,vr.flushSync(()=>{f(ee)}))})},[m,t,r,A,R]);Hr(()=>{d===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[d]);const B=l.useRef(!1);Hr(()=>(B.current=!0,()=>{B.current=!1}),[]),Hr(()=>{if(S&&(j.current=S),E&&(_.current=E),S&&E){if(O.current)return O.current(S,E,W);W()}},[S,E,W,O,D]);const q=l.useMemo(()=>({reference:j,floating:_,setReference:b,setFloating:w}),[b,w]),H=l.useMemo(()=>({reference:S,floating:E}),[S,E]),U=l.useMemo(()=>{const $={position:r,left:0,top:0};if(!H.floating)return $;const k=Di(H.floating,p.x),ee=Di(H.floating,p.y);return a?{...$,transform:"translate("+k+"px, "+ee+"px)",...rl(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:k,top:ee}},[r,a,H.floating,p.x,p.y]);return l.useMemo(()=>({...p,update:W,refs:q,elements:H,floatingStyles:U}),[p,W,q,H,U])}const mg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Mi({element:n.current,padding:o}).fn(r):{}:n?Mi({element:n,padding:o}).fn(r):{}}}},hg=(e,t)=>({...og(e),options:[e,t]}),gg=(e,t)=>({...sg(e),options:[e,t]}),vg=(e,t)=>({...cg(e),options:[e,t]}),yg=(e,t)=>({...ig(e),options:[e,t]}),xg=(e,t)=>({...ag(e),options:[e,t]}),bg=(e,t)=>({...lg(e),options:[e,t]}),wg=(e,t)=>({...mg(e),options:[e,t]});function Sg(e){const t=Cg(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(Ng);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Cg(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=_g(o),a=Rg(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Eg=Symbol("radix.slottable");function Ng(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Eg}function Rg(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function _g(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Pg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],jg=Pg.reduce((e,t)=>{const r=Sg(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ag="Arrow",nl=l.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return u.jsx(jg.svg,{...s,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});nl.displayName=Ag;var Tg=nl;function Mg(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,Dg(o,...t)]}function Dg(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function Ig(e){const t=kg(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find($g);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function kg(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Fg(o),a=Lg(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Og=Symbol("radix.slottable");function $g(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Og}function Lg(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Fg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Vg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ol=Vg.reduce((e,t)=>{const r=Ig(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Go="Popper",[sl,Xt]=Mg(Go),[Wg,il]=sl(Go),al=e=>{const{__scopePopper:t,children:r}=e,[n,o]=l.useState(null);return u.jsx(Wg,{scope:t,anchor:n,onAnchorChange:o,children:r})};al.displayName=Go;var ll="PopperAnchor",cl=l.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=il(ll,r),i=l.useRef(null),a=oe(t,i),c=l.useRef(null);return l.useEffect(()=>{const d=c.current;c.current=(n==null?void 0:n.current)||i.current,d!==c.current&&s.onAnchorChange(c.current)}),n?null:u.jsx(ol.div,{...o,ref:a})});cl.displayName=ll;var Ko="PopperContent",[Bg,Hg]=sl(Ko),ul=l.forwardRef((e,t)=>{var T,Z,K,J,Q,te;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:v,...h}=e,y=il(Ko,r),[x,b]=l.useState(null),w=oe(t,Re=>b(Re)),[S,E]=l.useState(null),j=Mo(S),_=(j==null?void 0:j.width)??0,I=(j==null?void 0:j.height)??0,D=n+(s!=="center"?"-"+s:""),O=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},A=Array.isArray(d)?d:[d],R=A.length>0,W={padding:O,boundary:A.filter(zg),altBoundary:R},{refs:B,floatingStyles:q,placement:H,isPositioned:U,middlewareData:$}=pg({strategy:"fixed",placement:D,whileElementsMounted:(...Re)=>ng(...Re,{animationFrame:g==="always"}),elements:{reference:y.anchor},middleware:[hg({mainAxis:o+I,alignmentAxis:i}),c&&gg({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?vg():void 0,...W}),c&&yg({...W}),xg({...W,apply:({elements:Re,rects:_e,availableWidth:Ee,availableHeight:st})=>{const{width:We,height:Be}=_e.reference,qe=Re.floating.style;qe.setProperty("--radix-popper-available-width",`${Ee}px`),qe.setProperty("--radix-popper-available-height",`${st}px`),qe.setProperty("--radix-popper-anchor-width",`${We}px`),qe.setProperty("--radix-popper-anchor-height",`${Be}px`)}}),S&&wg({element:S,padding:a}),Gg({arrowWidth:_,arrowHeight:I}),m&&bg({strategy:"referenceHidden",...W})]}),[k,ee]=pl(H),F=Ce(v);we(()=>{U&&(F==null||F())},[U,F]);const re=(T=$.arrow)==null?void 0:T.x,ce=(Z=$.arrow)==null?void 0:Z.y,pe=((K=$.arrow)==null?void 0:K.centerOffset)!==0,[he,ge]=l.useState();return we(()=>{x&&ge(window.getComputedStyle(x).zIndex)},[x]),u.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:U?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(J=$.transformOrigin)==null?void 0:J.x,(Q=$.transformOrigin)==null?void 0:Q.y].join(" "),...((te=$.hide)==null?void 0:te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(Bg,{scope:r,placedSide:k,onArrowChange:E,arrowX:re,arrowY:ce,shouldHideArrow:pe,children:u.jsx(ol.div,{"data-side":k,"data-align":ee,...h,ref:w,style:{...h.style,animation:U?void 0:"none"}})})})});ul.displayName=Ko;var dl="PopperArrow",Ug={top:"bottom",right:"left",bottom:"top",left:"right"},fl=l.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Hg(dl,n),i=Ug[s.placedSide];return u.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:u.jsx(Tg,{...o,ref:r,style:{...o.style,display:"block"}})})});fl.displayName=dl;function zg(e){return e!==null}var Gg=e=>({name:"transformOrigin",options:e,fn(t){var y,x,b;const{placement:r,rects:n,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,p]=pl(r),f={start:"0%",center:"50%",end:"100%"}[p],m=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,g=(((b=o.arrow)==null?void 0:b.y)??0)+c/2;let v="",h="";return d==="bottom"?(v=i?f:`${m}px`,h=`${-c}px`):d==="top"?(v=i?f:`${m}px`,h=`${n.floating.height+c}px`):d==="right"?(v=`${-c}px`,h=i?f:`${g}px`):d==="left"&&(v=`${n.floating.width+c}px`,h=i?f:`${g}px`),{data:{x:v,y:h}}}});function pl(e){const[t,r="center"]=e.split("-");return[t,r]}var vn=al,Yo=cl,qo=ul,Xo=fl;function Kg(e){const t=Yg(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(Xg);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Yg(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Qg(o),a=Zg(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qg=Symbol("radix.slottable");function Xg(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qg}function Zg(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Qg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Jg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ev=Jg.reduce((e,t)=>{const r=Kg(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),tv="Portal",yn=l.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,s]=l.useState(!1);we(()=>s(!0),[]);const i=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?na.createPortal(u.jsx(ev.div,{...n,ref:t}),i):null});yn.displayName=tv;function ml(e){const t=rv(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(ov);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function rv(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=iv(o),a=sv(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nv=Symbol("radix.slottable");function ov(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nv}function sv(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function iv(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var av=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Le=av.reduce((e,t)=>{const r=ml(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lv(e){const t=cv(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(dv);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function cv(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=pv(o),a=fv(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uv=Symbol("radix.slottable");function dv(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uv}function fv(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function pv(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var mv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hv=mv.reduce((e,t)=>{const r=lv(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),hl=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"}),gv="VisuallyHidden",gl=l.forwardRef((e,t)=>u.jsx(hv.span,{...e,ref:t,style:{...hl,...e.style}}));gl.displayName=gv;var vv=gl,yv=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},It=new WeakMap,$r=new WeakMap,Lr={},Qn=0,vl=function(e){return e&&(e.host||vl(e.parentNode))},xv=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=vl(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},bv=function(e,t,r,n){var o=xv(t,Array.isArray(e)?e:[e]);Lr[r]||(Lr[r]=new WeakMap);var s=Lr[r],i=[],a=new Set,c=new Set(o),d=function(f){!f||a.has(f)||(a.add(f),d(f.parentNode))};o.forEach(d);var p=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(m){if(a.has(m))p(m);else try{var g=m.getAttribute(n),v=g!==null&&g!=="false",h=(It.get(m)||0)+1,y=(s.get(m)||0)+1;It.set(m,h),s.set(m,y),i.push(m),h===1&&v&&$r.set(m,!0),y===1&&m.setAttribute(r,"true"),v||m.setAttribute(n,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return p(t),a.clear(),Qn++,function(){i.forEach(function(f){var m=It.get(f)-1,g=s.get(f)-1;It.set(f,m),s.set(f,g),m||($r.has(f)||f.removeAttribute(n),$r.delete(f)),g||f.removeAttribute(r)}),Qn--,Qn||(It=new WeakMap,It=new WeakMap,$r=new WeakMap,Lr={})}},Zo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=yv(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),bv(n,o,r,"aria-hidden")):function(){return null}},Qe=function(){return Qe=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Qe.apply(this,arguments)};function yl(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function wv(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,s;n<o;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))}var Ur="right-scroll-bar-position",zr="width-before-scroll-bar",Sv="with-scroll-bars-hidden",Cv="--removed-body-scroll-bar-size";function Jn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ev(e,t){var r=le.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Nv=typeof window<"u"?l.useLayoutEffect:l.useEffect,Ii=new WeakMap;function Rv(e,t){var r=Ev(null,function(n){return e.forEach(function(o){return Jn(o,n)})});return Nv(function(){var n=Ii.get(r);if(n){var o=new Set(n),s=new Set(e),i=r.current;o.forEach(function(a){s.has(a)||Jn(a,null)}),s.forEach(function(a){o.has(a)||Jn(a,i)})}Ii.set(r,e)},[e]),r}function _v(e){return e}function Pv(e,t){t===void 0&&(t=_v);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var i=t(s,n);return r.push(i),function(){r=r.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(n=!0;r.length;){var i=r;r=[],i.forEach(s)}r={push:function(a){return s(a)},filter:function(){return r}}},assignMedium:function(s){n=!0;var i=[];if(r.length){var a=r;r=[],a.forEach(s),i=r}var c=function(){var p=i;i=[],p.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(p){i.push(p),d()},filter:function(p){return i=i.filter(p),r}}}};return o}function jv(e){e===void 0&&(e={});var t=Pv(null);return t.options=Qe({async:!0,ssr:!1},e),t}var xl=function(e){var t=e.sideCar,r=yl(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 l.createElement(n,Qe({},r))};xl.isSideCarExport=!0;function Av(e,t){return e.useMedium(t),xl}var bl=jv(),eo=function(){},xn=l.forwardRef(function(e,t){var r=l.useRef(null),n=l.useState({onScrollCapture:eo,onWheelCapture:eo,onTouchMoveCapture:eo}),o=n[0],s=n[1],i=e.forwardProps,a=e.children,c=e.className,d=e.removeScrollBar,p=e.enabled,f=e.shards,m=e.sideCar,g=e.noRelative,v=e.noIsolation,h=e.inert,y=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,w=e.gapMode,S=yl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,j=Rv([r,t]),_=Qe(Qe({},S),o);return l.createElement(l.Fragment,null,p&&l.createElement(E,{sideCar:bl,removeScrollBar:d,shards:f,noRelative:g,noIsolation:v,inert:h,setCallbacks:s,allowPinchZoom:!!y,lockRef:r,gapMode:w}),i?l.cloneElement(l.Children.only(a),Qe(Qe({},_),{ref:j})):l.createElement(b,Qe({},_,{className:c,ref:j}),a))});xn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xn.classNames={fullWidth:zr,zeroRight:Ur};var Tv=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Mv(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Tv();return t&&e.setAttribute("nonce",t),e}function Dv(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Iv(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var kv=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Mv())&&(Dv(t,r),Iv(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ov=function(){var e=kv();return function(t,r){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},wl=function(){var e=Ov(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},$v={left:0,top:0,right:0,gap:0},to=function(e){return parseInt(e||"",10)||0},Lv=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[to(r),to(n),to(o)]},Fv=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $v;var t=Lv(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Vv=wl(),Bt="data-scroll-locked",Wv=function(e,t,r,n){var o=e.left,s=e.top,i=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
176
|
+
*/const xr=fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ca=dn("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ae=l.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,loading:o=!1,children:s,disabled:a,...i},u)=>{const d=n?jf:"button";return c.jsxs(d,{className:A(Ca({variant:t,size:r,className:e})),ref:u,disabled:a||o,...i,children:[o&&c.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin"}),s]})});ae.displayName="Button";const Ge=l.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:A("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ge.displayName="Card";const Kt=l.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:A("flex flex-col space-y-1.5 p-6",e),...t}));Kt.displayName="CardHeader";const Yt=l.forwardRef(({className:e,...t},r)=>c.jsx("h3",{ref:r,className:A("text-2xl font-semibold leading-none tracking-tight",e),...t}));Yt.displayName="CardTitle";const qt=l.forwardRef(({className:e,...t},r)=>c.jsx("p",{ref:r,className:A("text-sm text-muted-foreground",e),...t}));qt.displayName="CardDescription";const Ke=l.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:A("p-6 pt-0",e),...t}));Ke.displayName="CardContent";const Ea=l.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:A("flex items-center p-6 pt-0",e),...t}));Ea.displayName="CardFooter";const Na=dn("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-500 text-white hover:bg-green-600",warning:"border-transparent bg-yellow-500 text-white hover:bg-yellow-600",info:"border-transparent bg-blue-500 text-white hover:bg-blue-600"}},defaultVariants:{variant:"default"}});function ur({className:e,variant:t,...r}){return c.jsx("div",{className:A(Na({variant:t}),e),...r})}const fn=l.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:A("flex h-10 w-full rounded-md border border-input bg-background 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",e),ref:n,...r}));fn.displayName="Input";var $p=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],jr=$p.reduce((e,t)=>{const r=ua(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Lp="Label",Ra=l.forwardRef((e,t)=>c.jsx(jr.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Ra.displayName=Lp;var ja=Ra;const Fp=dn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),_r=l.forwardRef(({className:e,...t},r)=>c.jsx(ja,{ref:r,className:A(Fp(),e),...t}));_r.displayName=ja.displayName;const Do=l.forwardRef(({className:e,...t},r)=>c.jsx("textarea",{className:A("flex min-h-[80px] w-full rounded-md border border-input bg-background 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",e),ref:r,...t}));Do.displayName="Textarea";function Vp(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a),u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,Wp(o,...t)]}function Wp(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function G(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var Ee=globalThis!=null&&globalThis.document?l.useLayoutEffect:()=>{},Bp=l[" useInsertionEffect ".trim().toString()]||Ee;function lt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,a]=Hp({defaultProp:t,onChange:r}),i=e!==void 0,u=i?e:o;{const p=l.useRef(e!==void 0);l.useEffect(()=>{const f=p.current;f!==i&&console.warn(`${n} is changing from ${f?"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.`),p.current=i},[i,n])}const d=l.useCallback(p=>{var f;if(i){const m=Up(p)?p(e):p;m!==e&&((f=a.current)==null||f.call(a,m))}else s(p)},[i,e,s,a]);return[u,d]}function Hp({defaultProp:e,onChange:t}){const[r,n]=l.useState(e),o=l.useRef(r),s=l.useRef(t);return Bp(()=>{s.current=t},[t]),l.useEffect(()=>{var a;o.current!==r&&((a=s.current)==null||a.call(s,r),o.current=r)},[r,o]),[r,n,s]}function Up(e){return typeof e=="function"}function Io(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ko(e){const[t,r]=l.useState(void 0);return Ee(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,i;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;r({width:a,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}function zp(e,t){return l.useReducer((r,n)=>t[r][n]??r,e)}var Ie=e=>{const{present:t,children:r}=e,n=Gp(t),o=typeof r=="function"?r({present:n.isPresent}):l.Children.only(r),s=se(n.ref,Kp(o));return typeof r=="function"||n.isPresent?l.cloneElement(o,{ref:s}):null};Ie.displayName="Presence";function Gp(e){const[t,r]=l.useState(),n=l.useRef(null),o=l.useRef(e),s=l.useRef("none"),a=e?"mounted":"unmounted",[i,u]=zp(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const d=Vr(n.current);s.current=i==="mounted"?d:"none"},[i]),Ee(()=>{const d=n.current,p=o.current;if(p!==e){const m=s.current,g=Vr(d);e?u("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(p&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Ee(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,f=g=>{const h=Vr(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&h&&(u("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=g=>{g.target===t&&(s.current=Vr(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:l.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Vr(e){return(e==null?void 0:e.animationName)||"none"}function Kp(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Yp(e){const t=qp(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(Zp);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function qp(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=Jp(o),i=Qp(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xp=Symbol("radix.slottable");function Zp(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xp}function Qp(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Jp(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var em=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oo=em.reduce((e,t)=>{const r=Yp(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),pn="Checkbox",[tm]=Vp(pn),[rm,$o]=tm(pn);function nm(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:o,disabled:s,form:a,name:i,onCheckedChange:u,required:d,value:p="on",internal_do_not_use_render:f}=e,[m,g]=lt({prop:r,defaultProp:o??!1,onChange:u,caller:pn}),[v,h]=l.useState(null),[x,y]=l.useState(null),b=l.useRef(!1),S=v?!!a||!!v.closest("form"):!0,C={checked:m,disabled:s,setChecked:g,control:v,setControl:h,name:i,form:a,value:p,hasConsumerStoppedPropagationRef:b,required:d,defaultChecked:St(o)?!1:o,isFormControl:S,bubbleInput:x,setBubbleInput:y};return c.jsx(rm,{scope:t,...C,children:om(f)?f(C):n})}var _a="CheckboxTrigger",Pa=l.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},o)=>{const{control:s,value:a,disabled:i,checked:u,required:d,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:g,bubbleInput:v}=$o(_a,e),h=se(o,p),x=l.useRef(u);return l.useEffect(()=>{const y=s==null?void 0:s.form;if(y){const b=()=>f(x.current);return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[s,f]),c.jsx(Oo.button,{type:"button",role:"checkbox","aria-checked":St(u)?"mixed":u,"aria-required":d,"data-state":Ia(u),"data-disabled":i?"":void 0,disabled:i,value:a,...n,ref:h,onKeyDown:G(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:G(r,y=>{f(b=>St(b)?!0:!b),v&&g&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})})});Pa.displayName=_a;var Lo=l.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:o,defaultChecked:s,required:a,disabled:i,value:u,onCheckedChange:d,form:p,...f}=e;return c.jsx(nm,{__scopeCheckbox:r,checked:o,defaultChecked:s,disabled:i,required:a,onCheckedChange:d,name:n,form:p,value:u,internal_do_not_use_render:({isFormControl:m})=>c.jsxs(c.Fragment,{children:[c.jsx(Pa,{...f,ref:t,__scopeCheckbox:r}),m&&c.jsx(Da,{__scopeCheckbox:r})]})})});Lo.displayName=pn;var Aa="CheckboxIndicator",Ta=l.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...o}=e,s=$o(Aa,r);return c.jsx(Ie,{present:n||St(s.checked)||s.checked===!0,children:c.jsx(Oo.span,{"data-state":Ia(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ta.displayName=Aa;var Ma="CheckboxBubbleInput",Da=l.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:a,required:i,disabled:u,name:d,value:p,form:f,bubbleInput:m,setBubbleInput:g}=$o(Ma,e),v=se(r,g),h=Io(s),x=ko(n);l.useEffect(()=>{const b=m;if(!b)return;const S=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(S,"checked").set,_=!o.current;if(h!==s&&E){const R=new Event("click",{bubbles:_});b.indeterminate=St(s),E.call(b,St(s)?!1:s),b.dispatchEvent(R)}},[m,h,s,o]);const y=l.useRef(St(s)?!1:s);return c.jsx(Oo.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??y.current,required:i,disabled:u,name:d,value:p,form:f,...t,tabIndex:-1,ref:v,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Da.displayName=Ma;function om(e){return typeof e=="function"}function St(e){return e==="indeterminate"}function Ia(e){return St(e)?"indeterminate":e?"checked":"unchecked"}const yr=l.forwardRef(({className:e,...t},r)=>c.jsx(Lo,{ref:r,className:A("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:c.jsx(Ta,{className:A("flex items-center justify-center text-current"),children:c.jsx(vr,{className:"h-4 w-4"})})}));yr.displayName=Lo.displayName;function sm(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a),u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,im(o,...t)]}function im(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function am(e){const t=lm(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(um);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function lm(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=fm(o),i=dm(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cm=Symbol("radix.slottable");function um(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cm}function dm(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function fm(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var pm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ka=pm.reduce((e,t)=>{const r=am(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),mn="Switch",[mm]=sm(mn),[hm,gm]=mm(mn),Oa=l.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:o,defaultChecked:s,required:a,disabled:i,value:u="on",onCheckedChange:d,form:p,...f}=e,[m,g]=l.useState(null),v=se(t,S=>g(S)),h=l.useRef(!1),x=m?p||!!m.closest("form"):!0,[y,b]=lt({prop:o,defaultProp:s??!1,onChange:d,caller:mn});return c.jsxs(hm,{scope:r,checked:y,disabled:i,children:[c.jsx(ka.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":Va(y),"data-disabled":i?"":void 0,disabled:i,value:u,...f,ref:v,onClick:G(e.onClick,S=>{b(C=>!C),x&&(h.current=S.isPropagationStopped(),h.current||S.stopPropagation())})}),x&&c.jsx(Fa,{control:m,bubbles:!h.current,name:n,value:u,checked:y,required:a,disabled:i,form:p,style:{transform:"translateX(-100%)"}})]})});Oa.displayName=mn;var $a="SwitchThumb",La=l.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=gm($a,r);return c.jsx(ka.span,{"data-state":Va(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});La.displayName=$a;var vm="SwitchBubbleInput",Fa=l.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...o},s)=>{const a=l.useRef(null),i=se(a,s),u=Io(r),d=ko(t);return l.useEffect(()=>{const p=a.current;if(!p)return;const f=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(f,"checked").set;if(u!==r&&g){const v=new Event("click",{bubbles:n});g.call(p,r),p.dispatchEvent(v)}},[u,r,n]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:i,style:{...o.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Fa.displayName=vm;function Va(e){return e?"checked":"unchecked"}var Wa=Oa,xm=La;const Fo=l.forwardRef(({className:e,...t},r)=>c.jsx(Wa,{className:A("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:c.jsx(xm,{className:A("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Fo.displayName=Wa.displayName;function ym({className:e,...t}){return c.jsx("div",{className:A("animate-pulse rounded-md bg-muted",e),...t})}var bm="Separator",xi="horizontal",wm=["horizontal","vertical"],Ba=l.forwardRef((e,t)=>{const{decorative:r,orientation:n=xi,...o}=e,s=Sm(n)?n:xi,i=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(jr.div,{"data-orientation":s,...i,...o,ref:t})});Ba.displayName=bm;function Sm(e){return wm.includes(e)}var Ha=Ba;const Vo=l.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},o)=>c.jsx(Ha,{ref:o,decorative:r,orientation:t,className:A("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Vo.displayName=Ha.displayName;function uo(e,[t,r]){return Math.min(r,Math.max(t,e))}function Cm(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a),u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,Em(o,...t)]}function Em(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function yi(e){const t=Nm(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(jm);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Nm(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=Pm(o),i=_m(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Rm=Symbol("radix.slottable");function jm(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Rm}function _m(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Pm(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Wo(e){const t=e+"CollectionProvider",[r,n]=Cm(t),[o,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:x,children:y}=h,b=pe.useRef(null),S=pe.useRef(new Map).current;return c.jsx(o,{scope:x,itemMap:S,collectionRef:b,children:y})};a.displayName=t;const i=e+"CollectionSlot",u=yi(i),d=pe.forwardRef((h,x)=>{const{scope:y,children:b}=h,S=s(i,y),C=se(x,S.collectionRef);return c.jsx(u,{ref:C,children:b})});d.displayName=i;const p=e+"CollectionItemSlot",f="data-radix-collection-item",m=yi(p),g=pe.forwardRef((h,x)=>{const{scope:y,children:b,...S}=h,C=pe.useRef(null),E=se(x,C),_=s(p,y);return pe.useEffect(()=>(_.itemMap.set(C,{ref:C,...S}),()=>void _.itemMap.delete(C))),c.jsx(m,{[f]:"",ref:E,children:b})});g.displayName=p;function v(h){const x=s(e+"CollectionConsumer",h);return pe.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const S=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((_,R)=>S.indexOf(_.ref.current)-S.indexOf(R.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:a,Slot:d,ItemSlot:g},v,n]}function Am(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a),u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,Tm(o,...t)]}function Tm(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}var Mm=l.createContext(void 0);function Pr(e){const t=l.useContext(Mm);return e||t||"ltr"}function Dm(e){const t=Im(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(Om);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Im(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=Lm(o),i=$m(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var km=Symbol("radix.slottable");function Om(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===km}function $m(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Lm(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Fm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ua=Fm.reduce((e,t)=>{const r=Dm(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Vm(e,t){e&&Rr.flushSync(()=>e.dispatchEvent(t))}function Re(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function Wm(e,t=globalThis==null?void 0:globalThis.document){const r=Re(e);l.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Bm="DismissableLayer",fo="dismissableLayer.update",Hm="dismissableLayer.pointerDownOutside",Um="dismissableLayer.focusOutside",bi,za=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ar=l.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...u}=e,d=l.useContext(za),[p,f]=l.useState(null),m=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=l.useState({}),v=se(t,R=>f(R)),h=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=h.indexOf(x),b=p?h.indexOf(p):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,C=b>=y,E=Km(R=>{const k=R.target,M=[...d.branches].some(O=>O.contains(k));!C||M||(o==null||o(R),a==null||a(R),R.defaultPrevented||i==null||i())},m),_=Ym(R=>{const k=R.target;[...d.branches].some(O=>O.contains(k))||(s==null||s(R),a==null||a(R),R.defaultPrevented||i==null||i())},m);return Wm(R=>{b===d.layers.size-1&&(n==null||n(R),!R.defaultPrevented&&i&&(R.preventDefault(),i()))},m),l.useEffect(()=>{if(p)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(bi=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),wi(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=bi)}},[p,m,r,d]),l.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),wi())},[p,d]),l.useEffect(()=>{const R=()=>g({});return document.addEventListener(fo,R),()=>document.removeEventListener(fo,R)},[]),c.jsx(Ua.div,{...u,ref:v,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:G(e.onFocusCapture,_.onFocusCapture),onBlurCapture:G(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:G(e.onPointerDownCapture,E.onPointerDownCapture)})});Ar.displayName=Bm;var zm="DismissableLayerBranch",Gm=l.forwardRef((e,t)=>{const r=l.useContext(za),n=l.useRef(null),o=se(t,n);return l.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),c.jsx(Ua.div,{...e,ref:o})});Gm.displayName=zm;function Km(e,t=globalThis==null?void 0:globalThis.document){const r=Re(e),n=l.useRef(!1),o=l.useRef(()=>{});return l.useEffect(()=>{const s=i=>{if(i.target&&!n.current){let u=function(){Ga(Hm,r,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Ym(e,t=globalThis==null?void 0:globalThis.document){const r=Re(e),n=l.useRef(!1);return l.useEffect(()=>{const o=s=>{s.target&&!n.current&&Ga(Um,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function wi(){const e=new CustomEvent(fo);document.dispatchEvent(e)}function Ga(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Vm(o,s):o.dispatchEvent(s)}var Yn=0;function Bo(){l.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Si()),document.body.insertAdjacentElement("beforeend",e[1]??Si()),Yn++,()=>{Yn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Yn--}},[])}function Si(){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}function qm(e){const t=Xm(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(Qm);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Xm(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=eh(o),i=Jm(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zm=Symbol("radix.slottable");function Qm(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zm}function Jm(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function eh(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var th=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rh=th.reduce((e,t)=>{const r=qm(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),qn="focusScope.autoFocusOnMount",Xn="focusScope.autoFocusOnUnmount",Ci={bubbles:!1,cancelable:!0},nh="FocusScope",hn=l.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,u]=l.useState(null),d=Re(o),p=Re(s),f=l.useRef(null),m=se(t,h=>u(h)),g=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(n){let h=function(S){if(g.paused||!i)return;const C=S.target;i.contains(C)?f.current=C:bt(f.current,{select:!0})},x=function(S){if(g.paused||!i)return;const C=S.relatedTarget;C!==null&&(i.contains(C)||bt(f.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&bt(i)};document.addEventListener("focusin",h),document.addEventListener("focusout",x);const b=new MutationObserver(y);return i&&b.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",x),b.disconnect()}}},[n,i,g.paused]),l.useEffect(()=>{if(i){Ni.add(g);const h=document.activeElement;if(!i.contains(h)){const y=new CustomEvent(qn,Ci);i.addEventListener(qn,d),i.dispatchEvent(y),y.defaultPrevented||(oh(ch(Ka(i)),{select:!0}),document.activeElement===h&&bt(i))}return()=>{i.removeEventListener(qn,d),setTimeout(()=>{const y=new CustomEvent(Xn,Ci);i.addEventListener(Xn,p),i.dispatchEvent(y),y.defaultPrevented||bt(h??document.body,{select:!0}),i.removeEventListener(Xn,p),Ni.remove(g)},0)}}},[i,d,p,g]);const v=l.useCallback(h=>{if(!r&&!n||g.paused)return;const x=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,y=document.activeElement;if(x&&y){const b=h.currentTarget,[S,C]=sh(b);S&&C?!h.shiftKey&&y===C?(h.preventDefault(),r&&bt(S,{select:!0})):h.shiftKey&&y===S&&(h.preventDefault(),r&&bt(C,{select:!0})):y===b&&h.preventDefault()}},[r,n,g.paused]);return c.jsx(rh.div,{tabIndex:-1,...a,ref:m,onKeyDown:v})});hn.displayName=nh;function oh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(bt(n,{select:t}),document.activeElement!==r)return}function sh(e){const t=Ka(e),r=Ei(t,e),n=Ei(t.reverse(),e);return[r,n]}function Ka(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ei(e,t){for(const r of e)if(!ih(r,{upTo:t}))return r}function ih(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 ah(e){return e instanceof HTMLInputElement&&"select"in e}function bt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&ah(e)&&t&&e.select()}}var Ni=lh();function lh(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Ri(e,t),e.unshift(t)},remove(t){var r;e=Ri(e,t),(r=e[0])==null||r.resume()}}}function Ri(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function ch(e){return e.filter(t=>t.tagName!=="A")}var uh=l[" useId ".trim().toString()]||(()=>{}),dh=0;function He(e){const[t,r]=l.useState(uh());return Ee(()=>{r(n=>n??String(dh++))},[e]),e||(t?`radix-${t}`:"")}const fh=["top","right","bottom","left"],Ct=Math.min,We=Math.max,Zr=Math.round,Wr=Math.floor,at=e=>({x:e,y:e}),ph={left:"right",right:"left",bottom:"top",top:"bottom"},mh={start:"end",end:"start"};function po(e,t,r){return We(e,Ct(t,r))}function ht(e,t){return typeof e=="function"?e(t):e}function gt(e){return e.split("-")[0]}function tr(e){return e.split("-")[1]}function Ho(e){return e==="x"?"y":"x"}function Uo(e){return e==="y"?"height":"width"}const hh=new Set(["top","bottom"]);function it(e){return hh.has(gt(e))?"y":"x"}function zo(e){return Ho(it(e))}function gh(e,t,r){r===void 0&&(r=!1);const n=tr(e),o=zo(e),s=Uo(o);let a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Qr(a)),[a,Qr(a)]}function vh(e){const t=Qr(e);return[mo(e),t,mo(t)]}function mo(e){return e.replace(/start|end/g,t=>mh[t])}const ji=["left","right"],_i=["right","left"],xh=["top","bottom"],yh=["bottom","top"];function bh(e,t,r){switch(e){case"top":case"bottom":return r?t?_i:ji:t?ji:_i;case"left":case"right":return t?xh:yh;default:return[]}}function wh(e,t,r,n){const o=tr(e);let s=bh(gt(e),r==="start",n);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(mo)))),s}function Qr(e){return e.replace(/left|right|bottom|top/g,t=>ph[t])}function Sh(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ya(e){return typeof e!="number"?Sh(e):{top:e,right:e,bottom:e,left:e}}function Jr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Pi(e,t,r){let{reference:n,floating:o}=e;const s=it(t),a=zo(t),i=Uo(a),u=gt(t),d=s==="y",p=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,m=n[i]/2-o[i]/2;let g;switch(u){case"top":g={x:p,y:n.y-o.height};break;case"bottom":g={x:p,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:f};break;case"left":g={x:n.x-o.width,y:f};break;default:g={x:n.x,y:n.y}}switch(tr(t)){case"start":g[a]-=m*(r&&d?-1:1);break;case"end":g[a]+=m*(r&&d?-1:1);break}return g}const Ch=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:a}=r,i=s.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:f}=Pi(d,n,u),m=n,g={},v=0;for(let h=0;h<i.length;h++){const{name:x,fn:y}=i[h],{x:b,y:S,data:C,reset:E}=await y({x:p,y:f,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:a,elements:{reference:e,floating:t}});p=b??p,f=S??f,g={...g,[x]:{...g[x],...C}},E&&v<=50&&(v++,typeof E=="object"&&(E.placement&&(m=E.placement),E.rects&&(d=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:p,y:f}=Pi(d,m,u)),h=-1)}return{x:p,y:f,placement:m,strategy:o,middlewareData:g}};async function br(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:a,elements:i,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:m=!1,padding:g=0}=ht(t,e),v=Ya(g),x=i[m?f==="floating"?"reference":"floating":f],y=Jr(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(x)))==null||r?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:d,rootBoundary:p,strategy:u})),b=f==="floating"?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),C=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},E=Jr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:b,offsetParent:S,strategy:u}):b);return{top:(y.top-E.top+v.top)/C.y,bottom:(E.bottom-y.bottom+v.bottom)/C.y,left:(y.left-E.left+v.left)/C.x,right:(E.right-y.right+v.right)/C.x}}const Eh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:a,elements:i,middlewareData:u}=t,{element:d,padding:p=0}=ht(e,t)||{};if(d==null)return{};const f=Ya(p),m={x:r,y:n},g=zo(o),v=Uo(g),h=await a.getDimensions(d),x=g==="y",y=x?"top":"left",b=x?"bottom":"right",S=x?"clientHeight":"clientWidth",C=s.reference[v]+s.reference[g]-m[g]-s.floating[v],E=m[g]-s.reference[g],_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let R=_?_[S]:0;(!R||!await(a.isElement==null?void 0:a.isElement(_)))&&(R=i.floating[S]||s.floating[v]);const k=C/2-E/2,M=R/2-h[v]/2-1,O=Ct(f[y],M),V=Ct(f[b],M),P=O,$=R-h[v]-V,z=R/2-h[v]/2+k,X=po(P,z,$),H=!u.arrow&&tr(o)!=null&&z!==X&&s.reference[v]/2-(z<P?O:V)-h[v]/2<0,I=H?z<P?z-P:z-$:0;return{[g]:m[g]+I,data:{[g]:X,centerOffset:z-X-I,...H&&{alignmentOffset:I}},reset:H}}}),Nh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:u,elements:d}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...x}=ht(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const y=gt(o),b=it(i),S=gt(i)===i,C=await(u.isRTL==null?void 0:u.isRTL(d.floating)),E=m||(S||!h?[Qr(i)]:vh(i)),_=v!=="none";!m&&_&&E.push(...wh(i,h,v,C));const R=[i,...E],k=await br(t,x),M=[];let O=((n=s.flip)==null?void 0:n.overflows)||[];if(p&&M.push(k[y]),f){const z=gh(o,a,C);M.push(k[z[0]],k[z[1]])}if(O=[...O,{placement:o,overflows:M}],!M.every(z=>z<=0)){var V,P;const z=(((V=s.flip)==null?void 0:V.index)||0)+1,X=R[z];if(X&&(!(f==="alignment"?b!==it(X):!1)||O.every(U=>it(U.placement)===b?U.overflows[0]>0:!0)))return{data:{index:z,overflows:O},reset:{placement:X}};let H=(P=O.filter(I=>I.overflows[0]<=0).sort((I,U)=>I.overflows[1]-U.overflows[1])[0])==null?void 0:P.placement;if(!H)switch(g){case"bestFit":{var $;const I=($=O.filter(U=>{if(_){const D=it(U.placement);return D===b||D==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(D=>D>0).reduce((D,re)=>D+re,0)]).sort((U,D)=>U[1]-D[1])[0])==null?void 0:$[0];I&&(H=I);break}case"initialPlacement":H=i;break}if(o!==H)return{reset:{placement:H}}}return{}}}};function Ai(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ti(e){return fh.some(t=>e[t]>=0)}const Rh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=ht(e,t);switch(n){case"referenceHidden":{const s=await br(t,{...o,elementContext:"reference"}),a=Ai(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ti(a)}}}case"escaped":{const s=await br(t,{...o,altBoundary:!0}),a=Ai(s,r.floating);return{data:{escapedOffsets:a,escaped:Ti(a)}}}default:return{}}}}},qa=new Set(["left","top"]);async function jh(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=gt(r),i=tr(r),u=it(r)==="y",d=qa.has(a)?-1:1,p=s&&u?-1:1,f=ht(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return i&&typeof v=="number"&&(g=i==="end"?v*-1:v),u?{x:g*p,y:m*d}:{x:m*d,y:g*p}}const _h=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:a,middlewareData:i}=t,u=await jh(t,e);return a===((r=i.offset)==null?void 0:r.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:a}}}}},Ph=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:i={fn:x=>{let{x:y,y:b}=x;return{x:y,y:b}}},...u}=ht(e,t),d={x:r,y:n},p=await br(t,u),f=it(gt(o)),m=Ho(f);let g=d[m],v=d[f];if(s){const x=m==="y"?"top":"left",y=m==="y"?"bottom":"right",b=g+p[x],S=g-p[y];g=po(b,g,S)}if(a){const x=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=v+p[x],S=v-p[y];v=po(b,v,S)}const h=i.fn({...t,[m]:g,[f]:v});return{...h,data:{x:h.x-r,y:h.y-n,enabled:{[m]:s,[f]:a}}}}}},Ah=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:u=!0,crossAxis:d=!0}=ht(e,t),p={x:r,y:n},f=it(o),m=Ho(f);let g=p[m],v=p[f];const h=ht(i,t),x=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const S=m==="y"?"height":"width",C=s.reference[m]-s.floating[S]+x.mainAxis,E=s.reference[m]+s.reference[S]-x.mainAxis;g<C?g=C:g>E&&(g=E)}if(d){var y,b;const S=m==="y"?"width":"height",C=qa.has(gt(o)),E=s.reference[f]-s.floating[S]+(C&&((y=a.offset)==null?void 0:y[f])||0)+(C?0:x.crossAxis),_=s.reference[f]+s.reference[S]+(C?0:((b=a.offset)==null?void 0:b[f])||0)-(C?x.crossAxis:0);v<E?v=E:v>_&&(v=_)}return{[m]:g,[f]:v}}}},Th=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:a,elements:i}=t,{apply:u=()=>{},...d}=ht(e,t),p=await br(t,d),f=gt(o),m=tr(o),g=it(o)==="y",{width:v,height:h}=s.floating;let x,y;f==="top"||f==="bottom"?(x=f,y=m===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(y=f,x=m==="end"?"top":"bottom");const b=h-p.top-p.bottom,S=v-p.left-p.right,C=Ct(h-p[x],b),E=Ct(v-p[y],S),_=!t.middlewareData.shift;let R=C,k=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(k=S),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(R=b),_&&!m){const O=We(p.left,0),V=We(p.right,0),P=We(p.top,0),$=We(p.bottom,0);g?k=v-2*(O!==0||V!==0?O+V:We(p.left,p.right)):R=h-2*(P!==0||$!==0?P+$:We(p.top,p.bottom))}await u({...t,availableWidth:k,availableHeight:R});const M=await a.getDimensions(i.floating);return v!==M.width||h!==M.height?{reset:{rects:!0}}:{}}}};function gn(){return typeof window<"u"}function rr(e){return Xa(e)?(e.nodeName||"").toLowerCase():"#document"}function Ue(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ut(e){var t;return(t=(Xa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Xa(e){return gn()?e instanceof Node||e instanceof Ue(e).Node:!1}function et(e){return gn()?e instanceof Element||e instanceof Ue(e).Element:!1}function ct(e){return gn()?e instanceof HTMLElement||e instanceof Ue(e).HTMLElement:!1}function Mi(e){return!gn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ue(e).ShadowRoot}const Mh=new Set(["inline","contents"]);function Tr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=tt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Mh.has(o)}const Dh=new Set(["table","td","th"]);function Ih(e){return Dh.has(rr(e))}const kh=[":popover-open",":modal"];function vn(e){return kh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Oh=["transform","translate","scale","rotate","perspective"],$h=["transform","translate","scale","rotate","perspective","filter"],Lh=["paint","layout","strict","content"];function Go(e){const t=Ko(),r=et(e)?tt(e):e;return Oh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||$h.some(n=>(r.willChange||"").includes(n))||Lh.some(n=>(r.contain||"").includes(n))}function Fh(e){let t=Et(e);for(;ct(t)&&!Xt(t);){if(Go(t))return t;if(vn(t))return null;t=Et(t)}return null}function Ko(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Vh=new Set(["html","body","#document"]);function Xt(e){return Vh.has(rr(e))}function tt(e){return Ue(e).getComputedStyle(e)}function xn(e){return et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Et(e){if(rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Mi(e)&&e.host||ut(e);return Mi(t)?t.host:t}function Za(e){const t=Et(e);return Xt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ct(t)&&Tr(t)?t:Za(t)}function wr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Za(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),a=Ue(o);if(s){const i=ho(a);return t.concat(a,a.visualViewport||[],Tr(o)?o:[],i&&r?wr(i):[])}return t.concat(o,wr(o,[],r))}function ho(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qa(e){const t=tt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=ct(e),s=o?e.offsetWidth:r,a=o?e.offsetHeight:n,i=Zr(r)!==s||Zr(n)!==a;return i&&(r=s,n=a),{width:r,height:n,$:i}}function Yo(e){return et(e)?e:e.contextElement}function zt(e){const t=Yo(e);if(!ct(t))return at(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=Qa(t);let a=(s?Zr(r.width):r.width)/n,i=(s?Zr(r.height):r.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const Wh=at(0);function Ja(e){const t=Ue(e);return!Ko()||!t.visualViewport?Wh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ue(e)?!1:t}function Mt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=Yo(e);let a=at(1);t&&(n?et(n)&&(a=zt(n)):a=zt(e));const i=Bh(s,r,n)?Ja(s):at(0);let u=(o.left+i.x)/a.x,d=(o.top+i.y)/a.y,p=o.width/a.x,f=o.height/a.y;if(s){const m=Ue(s),g=n&&et(n)?Ue(n):n;let v=m,h=ho(v);for(;h&&n&&g!==v;){const x=zt(h),y=h.getBoundingClientRect(),b=tt(h),S=y.left+(h.clientLeft+parseFloat(b.paddingLeft))*x.x,C=y.top+(h.clientTop+parseFloat(b.paddingTop))*x.y;u*=x.x,d*=x.y,p*=x.x,f*=x.y,u+=S,d+=C,v=Ue(h),h=ho(v)}}return Jr({width:p,height:f,x:u,y:d})}function yn(e,t){const r=xn(e).scrollLeft;return t?t.left+r:Mt(ut(e)).left+r}function el(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-yn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Hh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",a=ut(n),i=t?vn(t.floating):!1;if(n===a||i&&s)return r;let u={scrollLeft:0,scrollTop:0},d=at(1);const p=at(0),f=ct(n);if((f||!f&&!s)&&((rr(n)!=="body"||Tr(a))&&(u=xn(n)),ct(n))){const g=Mt(n);d=zt(n),p.x=g.x+n.clientLeft,p.y=g.y+n.clientTop}const m=a&&!f&&!s?el(a,u):at(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+p.x+m.x,y:r.y*d.y-u.scrollTop*d.y+p.y+m.y}}function Uh(e){return Array.from(e.getClientRects())}function zh(e){const t=ut(e),r=xn(e),n=e.ownerDocument.body,o=We(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=We(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+yn(e);const i=-r.scrollTop;return tt(n).direction==="rtl"&&(a+=We(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:a,y:i}}const Di=25;function Gh(e,t){const r=Ue(e),n=ut(e),o=r.visualViewport;let s=n.clientWidth,a=n.clientHeight,i=0,u=0;if(o){s=o.width,a=o.height;const p=Ko();(!p||p&&t==="fixed")&&(i=o.offsetLeft,u=o.offsetTop)}const d=yn(n);if(d<=0){const p=n.ownerDocument,f=p.body,m=getComputedStyle(f),g=p.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,v=Math.abs(n.clientWidth-f.clientWidth-g);v<=Di&&(s-=v)}else d<=Di&&(s+=d);return{width:s,height:a,x:i,y:u}}const Kh=new Set(["absolute","fixed"]);function Yh(e,t){const r=Mt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=ct(e)?zt(e):at(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,u=o*s.x,d=n*s.y;return{width:a,height:i,x:u,y:d}}function Ii(e,t,r){let n;if(t==="viewport")n=Gh(e,r);else if(t==="document")n=zh(ut(e));else if(et(t))n=Yh(t,r);else{const o=Ja(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jr(n)}function tl(e,t){const r=Et(e);return r===t||!et(r)||Xt(r)?!1:tt(r).position==="fixed"||tl(r,t)}function qh(e,t){const r=t.get(e);if(r)return r;let n=wr(e,[],!1).filter(i=>et(i)&&rr(i)!=="body"),o=null;const s=tt(e).position==="fixed";let a=s?Et(e):e;for(;et(a)&&!Xt(a);){const i=tt(a),u=Go(a);!u&&i.position==="fixed"&&(o=null),(s?!u&&!o:!u&&i.position==="static"&&!!o&&Kh.has(o.position)||Tr(a)&&!u&&tl(e,a))?n=n.filter(p=>p!==a):o=i,a=Et(a)}return t.set(e,n),n}function Xh(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?vn(t)?[]:qh(t,this._c):[].concat(r),n],i=a[0],u=a.reduce((d,p)=>{const f=Ii(t,p,o);return d.top=We(f.top,d.top),d.right=Ct(f.right,d.right),d.bottom=Ct(f.bottom,d.bottom),d.left=We(f.left,d.left),d},Ii(t,i,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Zh(e){const{width:t,height:r}=Qa(e);return{width:t,height:r}}function Qh(e,t,r){const n=ct(t),o=ut(t),s=r==="fixed",a=Mt(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const u=at(0);function d(){u.x=yn(o)}if(n||!n&&!s)if((rr(t)!=="body"||Tr(o))&&(i=xn(t)),n){const g=Mt(t,!0,s,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else o&&d();s&&!n&&o&&d();const p=o&&!n&&!s?el(o,i):at(0),f=a.left+i.scrollLeft-u.x-p.x,m=a.top+i.scrollTop-u.y-p.y;return{x:f,y:m,width:a.width,height:a.height}}function Zn(e){return tt(e).position==="static"}function ki(e,t){if(!ct(e)||tt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ut(e)===r&&(r=r.ownerDocument.body),r}function rl(e,t){const r=Ue(e);if(vn(e))return r;if(!ct(e)){let o=Et(e);for(;o&&!Xt(o);){if(et(o)&&!Zn(o))return o;o=Et(o)}return r}let n=ki(e,t);for(;n&&Ih(n)&&Zn(n);)n=ki(n,t);return n&&Xt(n)&&Zn(n)&&!Go(n)?r:n||Fh(e)||r}const Jh=async function(e){const t=this.getOffsetParent||rl,r=this.getDimensions,n=await r(e.floating);return{reference:Qh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function eg(e){return tt(e).direction==="rtl"}const tg={convertOffsetParentRelativeRectToViewportRelativeRect:Hh,getDocumentElement:ut,getClippingRect:Xh,getOffsetParent:rl,getElementRects:Jh,getClientRects:Uh,getDimensions:Zh,getScale:zt,isElement:et,isRTL:eg};function nl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rg(e,t){let r=null,n;const o=ut(e);function s(){var i;clearTimeout(n),(i=r)==null||i.disconnect(),r=null}function a(i,u){i===void 0&&(i=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:p,top:f,width:m,height:g}=d;if(i||t(),!m||!g)return;const v=Wr(f),h=Wr(o.clientWidth-(p+m)),x=Wr(o.clientHeight-(f+g)),y=Wr(p),S={rootMargin:-v+"px "+-h+"px "+-x+"px "+-y+"px",threshold:We(0,Ct(1,u))||1};let C=!0;function E(_){const R=_[0].intersectionRatio;if(R!==u){if(!C)return a();R?a(!1,R):n=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!nl(d,e.getBoundingClientRect())&&a(),C=!1}try{r=new IntersectionObserver(E,{...S,root:o.ownerDocument})}catch{r=new IntersectionObserver(E,S)}r.observe(e)}return a(!0),s}function ng(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=Yo(e),p=o||s?[...d?wr(d):[],...wr(t)]:[];p.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),s&&y.addEventListener("resize",r)});const f=d&&i?rg(d,r):null;let m=-1,g=null;a&&(g=new ResizeObserver(y=>{let[b]=y;b&&b.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),r()}),d&&!u&&g.observe(d),g.observe(t));let v,h=u?Mt(e):null;u&&x();function x(){const y=Mt(e);h&&!nl(h,y)&&r(),h=y,v=requestAnimationFrame(x)}return r(),()=>{var y;p.forEach(b=>{o&&b.removeEventListener("scroll",r),s&&b.removeEventListener("resize",r)}),f==null||f(),(y=g)==null||y.disconnect(),g=null,u&&cancelAnimationFrame(v)}}const og=_h,sg=Ph,ig=Nh,ag=Th,lg=Rh,Oi=Eh,cg=Ah,ug=(e,t,r)=>{const n=new Map,o={platform:tg,...r},s={...o.platform,_c:n};return Ch(e,t,{...o,platform:s})};var dg=typeof document<"u",fg=function(){},Kr=dg?pe.useLayoutEffect:fg;function en(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!en(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!en(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ol(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $i(e,t){const r=ol(e);return Math.round(t*r)/r}function Qn(e){const t=l.useRef(e);return Kr(()=>{t.current=e}),t}function pg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:u,open:d}=e,[p,f]=l.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=l.useState(n);en(m,n)||g(n);const[v,h]=l.useState(null),[x,y]=l.useState(null),b=l.useCallback(U=>{U!==_.current&&(_.current=U,h(U))},[]),S=l.useCallback(U=>{U!==R.current&&(R.current=U,y(U))},[]),C=s||v,E=a||x,_=l.useRef(null),R=l.useRef(null),k=l.useRef(p),M=u!=null,O=Qn(u),V=Qn(o),P=Qn(d),$=l.useCallback(()=>{if(!_.current||!R.current)return;const U={placement:t,strategy:r,middleware:m};V.current&&(U.platform=V.current),ug(_.current,R.current,U).then(D=>{const re={...D,isPositioned:P.current!==!1};z.current&&!en(k.current,re)&&(k.current=re,Rr.flushSync(()=>{f(re)}))})},[m,t,r,V,P]);Kr(()=>{d===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(U=>({...U,isPositioned:!1})))},[d]);const z=l.useRef(!1);Kr(()=>(z.current=!0,()=>{z.current=!1}),[]),Kr(()=>{if(C&&(_.current=C),E&&(R.current=E),C&&E){if(O.current)return O.current(C,E,$);$()}},[C,E,$,O,M]);const X=l.useMemo(()=>({reference:_,floating:R,setReference:b,setFloating:S}),[b,S]),H=l.useMemo(()=>({reference:C,floating:E}),[C,E]),I=l.useMemo(()=>{const U={position:r,left:0,top:0};if(!H.floating)return U;const D=$i(H.floating,p.x),re=$i(H.floating,p.y);return i?{...U,transform:"translate("+D+"px, "+re+"px)",...ol(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:D,top:re}},[r,i,H.floating,p.x,p.y]);return l.useMemo(()=>({...p,update:$,refs:X,elements:H,floatingStyles:I}),[p,$,X,H,I])}const mg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Oi({element:n.current,padding:o}).fn(r):{}:n?Oi({element:n,padding:o}).fn(r):{}}}},hg=(e,t)=>({...og(e),options:[e,t]}),gg=(e,t)=>({...sg(e),options:[e,t]}),vg=(e,t)=>({...cg(e),options:[e,t]}),xg=(e,t)=>({...ig(e),options:[e,t]}),yg=(e,t)=>({...ag(e),options:[e,t]}),bg=(e,t)=>({...lg(e),options:[e,t]}),wg=(e,t)=>({...mg(e),options:[e,t]});function Sg(e){const t=Cg(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(Ng);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Cg(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=jg(o),i=Rg(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Eg=Symbol("radix.slottable");function Ng(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Eg}function Rg(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function jg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var _g=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pg=_g.reduce((e,t)=>{const r=Sg(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ag="Arrow",sl=l.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return c.jsx(Pg.svg,{...s,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});sl.displayName=Ag;var Tg=sl;function Mg(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a),u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,Dg(o,...t)]}function Dg(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Ig(e){const t=kg(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find($g);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function kg(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=Fg(o),i=Lg(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Og=Symbol("radix.slottable");function $g(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Og}function Lg(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Fg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Vg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],il=Vg.reduce((e,t)=>{const r=Ig(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),qo="Popper",[al,nr]=Mg(qo),[Wg,ll]=al(qo),cl=e=>{const{__scopePopper:t,children:r}=e,[n,o]=l.useState(null);return c.jsx(Wg,{scope:t,anchor:n,onAnchorChange:o,children:r})};cl.displayName=qo;var ul="PopperAnchor",dl=l.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=ll(ul,r),a=l.useRef(null),i=se(t,a),u=l.useRef(null);return l.useEffect(()=>{const d=u.current;u.current=(n==null?void 0:n.current)||a.current,d!==u.current&&s.onAnchorChange(u.current)}),n?null:c.jsx(il.div,{...o,ref:i})});dl.displayName=ul;var Xo="PopperContent",[Bg,Hg]=al(Xo),fl=l.forwardRef((e,t)=>{var T,Q,q,ne,J,B;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:v,...h}=e,x=ll(Xo,r),[y,b]=l.useState(null),S=se(t,ee=>b(ee)),[C,E]=l.useState(null),_=ko(C),R=(_==null?void 0:_.width)??0,k=(_==null?void 0:_.height)??0,M=n+(s!=="center"?"-"+s:""),O=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},V=Array.isArray(d)?d:[d],P=V.length>0,$={padding:O,boundary:V.filter(zg),altBoundary:P},{refs:z,floatingStyles:X,placement:H,isPositioned:I,middlewareData:U}=pg({strategy:"fixed",placement:M,whileElementsMounted:(...ee)=>ng(...ee,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[hg({mainAxis:o+k,alignmentAxis:a}),u&&gg({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?vg():void 0,...$}),u&&xg({...$}),yg({...$,apply:({elements:ee,rects:ye,availableWidth:ve,availableHeight:ke})=>{const{width:Fe,height:Oe}=ye.reference,Ve=ee.floating.style;Ve.setProperty("--radix-popper-available-width",`${ve}px`),Ve.setProperty("--radix-popper-available-height",`${ke}px`),Ve.setProperty("--radix-popper-anchor-width",`${Fe}px`),Ve.setProperty("--radix-popper-anchor-height",`${Oe}px`)}}),C&&wg({element:C,padding:i}),Gg({arrowWidth:R,arrowHeight:k}),m&&bg({strategy:"referenceHidden",...$})]}),[D,re]=hl(H),L=Re(v);Ee(()=>{I&&(L==null||L())},[I,L]);const te=(T=U.arrow)==null?void 0:T.x,le=(Q=U.arrow)==null?void 0:Q.y,ue=((q=U.arrow)==null?void 0:q.centerOffset)!==0,[ge,me]=l.useState();return Ee(()=>{y&&me(window.getComputedStyle(y).zIndex)},[y]),c.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:I?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(ne=U.transformOrigin)==null?void 0:ne.x,(J=U.transformOrigin)==null?void 0:J.y].join(" "),...((B=U.hide)==null?void 0:B.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Bg,{scope:r,placedSide:D,onArrowChange:E,arrowX:te,arrowY:le,shouldHideArrow:ue,children:c.jsx(il.div,{"data-side":D,"data-align":re,...h,ref:S,style:{...h.style,animation:I?void 0:"none"}})})})});fl.displayName=Xo;var pl="PopperArrow",Ug={top:"bottom",right:"left",bottom:"top",left:"right"},ml=l.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Hg(pl,n),a=Ug[s.placedSide];return c.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:c.jsx(Tg,{...o,ref:r,style:{...o.style,display:"block"}})})});ml.displayName=pl;function zg(e){return e!==null}var Gg=e=>({name:"transformOrigin",options:e,fn(t){var x,y,b;const{placement:r,rects:n,middlewareData:o}=t,a=((x=o.arrow)==null?void 0:x.centerOffset)!==0,i=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[d,p]=hl(r),f={start:"0%",center:"50%",end:"100%"}[p],m=(((y=o.arrow)==null?void 0:y.x)??0)+i/2,g=(((b=o.arrow)==null?void 0:b.y)??0)+u/2;let v="",h="";return d==="bottom"?(v=a?f:`${m}px`,h=`${-u}px`):d==="top"?(v=a?f:`${m}px`,h=`${n.floating.height+u}px`):d==="right"?(v=`${-u}px`,h=a?f:`${g}px`):d==="left"&&(v=`${n.floating.width+u}px`,h=a?f:`${g}px`),{data:{x:v,y:h}}}});function hl(e){const[t,r="center"]=e.split("-");return[t,r]}var bn=cl,Zo=dl,Qo=fl,Jo=ml;function Kg(e){const t=Yg(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(Xg);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Yg(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=Qg(o),i=Zg(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qg=Symbol("radix.slottable");function Xg(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qg}function Zg(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Qg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Jg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ev=Jg.reduce((e,t)=>{const r=Kg(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),tv="Portal",wn=l.forwardRef((e,t)=>{var i;const{container:r,...n}=e,[o,s]=l.useState(!1);Ee(()=>s(!0),[]);const a=r||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return a?aa.createPortal(c.jsx(ev.div,{...n,ref:t}),a):null});wn.displayName=tv;function gl(e){const t=rv(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(ov);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function rv(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=iv(o),i=sv(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nv=Symbol("radix.slottable");function ov(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nv}function sv(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function iv(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var av=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ze=av.reduce((e,t)=>{const r=gl(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lv(e){const t=cv(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(dv);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function cv(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=pv(o),i=fv(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uv=Symbol("radix.slottable");function dv(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uv}function fv(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function pv(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var mv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hv=mv.reduce((e,t)=>{const r=lv(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),vl=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"}),gv="VisuallyHidden",xl=l.forwardRef((e,t)=>c.jsx(hv.span,{...e,ref:t,style:{...vl,...e.style}}));xl.displayName=gv;var vv=xl,xv=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lt=new WeakMap,Br=new WeakMap,Hr={},Jn=0,yl=function(e){return e&&(e.host||yl(e.parentNode))},yv=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=yl(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},bv=function(e,t,r,n){var o=yv(t,Array.isArray(e)?e:[e]);Hr[r]||(Hr[r]=new WeakMap);var s=Hr[r],a=[],i=new Set,u=new Set(o),d=function(f){!f||i.has(f)||(i.add(f),d(f.parentNode))};o.forEach(d);var p=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(m){if(i.has(m))p(m);else try{var g=m.getAttribute(n),v=g!==null&&g!=="false",h=(Lt.get(m)||0)+1,x=(s.get(m)||0)+1;Lt.set(m,h),s.set(m,x),a.push(m),h===1&&v&&Br.set(m,!0),x===1&&m.setAttribute(r,"true"),v||m.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return p(t),i.clear(),Jn++,function(){a.forEach(function(f){var m=Lt.get(f)-1,g=s.get(f)-1;Lt.set(f,m),s.set(f,g),m||(Br.has(f)||f.removeAttribute(n),Br.delete(f)),g||f.removeAttribute(r)}),Jn--,Jn||(Lt=new WeakMap,Lt=new WeakMap,Br=new WeakMap,Hr={})}},es=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=xv(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),bv(n,o,r,"aria-hidden")):function(){return null}},st=function(){return st=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},st.apply(this,arguments)};function bl(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function wv(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,s;n<o;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))}var Yr="right-scroll-bar-position",qr="width-before-scroll-bar",Sv="with-scroll-bars-hidden",Cv="--removed-body-scroll-bar-size";function eo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ev(e,t){var r=pe.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Nv=typeof window<"u"?l.useLayoutEffect:l.useEffect,Li=new WeakMap;function Rv(e,t){var r=Ev(null,function(n){return e.forEach(function(o){return eo(o,n)})});return Nv(function(){var n=Li.get(r);if(n){var o=new Set(n),s=new Set(e),a=r.current;o.forEach(function(i){s.has(i)||eo(i,null)}),s.forEach(function(i){o.has(i)||eo(i,a)})}Li.set(r,e)},[e]),r}function jv(e){return e}function _v(e,t){t===void 0&&(t=jv);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var a=t(s,n);return r.push(a),function(){r=r.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(n=!0;r.length;){var a=r;r=[],a.forEach(s)}r={push:function(i){return s(i)},filter:function(){return r}}},assignMedium:function(s){n=!0;var a=[];if(r.length){var i=r;r=[],i.forEach(s),a=r}var u=function(){var p=a;a=[],p.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),r={push:function(p){a.push(p),d()},filter:function(p){return a=a.filter(p),r}}}};return o}function Pv(e){e===void 0&&(e={});var t=_v(null);return t.options=st({async:!0,ssr:!1},e),t}var wl=function(e){var t=e.sideCar,r=bl(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 l.createElement(n,st({},r))};wl.isSideCarExport=!0;function Av(e,t){return e.useMedium(t),wl}var Sl=Pv(),to=function(){},Sn=l.forwardRef(function(e,t){var r=l.useRef(null),n=l.useState({onScrollCapture:to,onWheelCapture:to,onTouchMoveCapture:to}),o=n[0],s=n[1],a=e.forwardProps,i=e.children,u=e.className,d=e.removeScrollBar,p=e.enabled,f=e.shards,m=e.sideCar,g=e.noRelative,v=e.noIsolation,h=e.inert,x=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,S=e.gapMode,C=bl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,_=Rv([r,t]),R=st(st({},C),o);return l.createElement(l.Fragment,null,p&&l.createElement(E,{sideCar:Sl,removeScrollBar:d,shards:f,noRelative:g,noIsolation:v,inert:h,setCallbacks:s,allowPinchZoom:!!x,lockRef:r,gapMode:S}),a?l.cloneElement(l.Children.only(i),st(st({},R),{ref:_})):l.createElement(b,st({},R,{className:u,ref:_}),i))});Sn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Sn.classNames={fullWidth:qr,zeroRight:Yr};var Tv=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Mv(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Tv();return t&&e.setAttribute("nonce",t),e}function Dv(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Iv(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var kv=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Mv())&&(Dv(t,r),Iv(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ov=function(){var e=kv();return function(t,r){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Cl=function(){var e=Ov(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},$v={left:0,top:0,right:0,gap:0},ro=function(e){return parseInt(e||"",10)||0},Lv=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ro(r),ro(n),ro(o)]},Fv=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $v;var t=Lv(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Vv=Cl(),Gt="data-scroll-locked",Wv=function(e,t,r,n){var o=e.left,s=e.top,a=e.right,i=e.gap;return r===void 0&&(r="margin"),`
|
|
177
177
|
.`.concat(Sv,` {
|
|
178
178
|
overflow: hidden `).concat(n,`;
|
|
179
|
-
padding-right: `).concat(
|
|
179
|
+
padding-right: `).concat(i,"px ").concat(n,`;
|
|
180
180
|
}
|
|
181
|
-
body[`).concat(
|
|
181
|
+
body[`).concat(Gt,`] {
|
|
182
182
|
overflow: hidden `).concat(n,`;
|
|
183
183
|
overscroll-behavior: contain;
|
|
184
184
|
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
|
|
185
185
|
padding-left: `.concat(o,`px;
|
|
186
186
|
padding-top: `).concat(s,`px;
|
|
187
|
-
padding-right: `).concat(
|
|
187
|
+
padding-right: `).concat(a,`px;
|
|
188
188
|
margin-left:0;
|
|
189
189
|
margin-top:0;
|
|
190
|
-
margin-right: `).concat(
|
|
191
|
-
`),r==="padding"&&"padding-right: ".concat(
|
|
190
|
+
margin-right: `).concat(i,"px ").concat(n,`;
|
|
191
|
+
`),r==="padding"&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
.`).concat(
|
|
195
|
-
right: `).concat(
|
|
194
|
+
.`).concat(Yr,` {
|
|
195
|
+
right: `).concat(i,"px ").concat(n,`;
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
.`).concat(
|
|
199
|
-
margin-right: `).concat(
|
|
198
|
+
.`).concat(qr,` {
|
|
199
|
+
margin-right: `).concat(i,"px ").concat(n,`;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
.`).concat(
|
|
202
|
+
.`).concat(Yr," .").concat(Yr,` {
|
|
203
203
|
right: 0 `).concat(n,`;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
.`).concat(
|
|
206
|
+
.`).concat(qr," .").concat(qr,` {
|
|
207
207
|
margin-right: 0 `).concat(n,`;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
body[`).concat(
|
|
211
|
-
`).concat(Cv,": ").concat(
|
|
210
|
+
body[`).concat(Gt,`] {
|
|
211
|
+
`).concat(Cv,": ").concat(i,`px;
|
|
212
212
|
}
|
|
213
|
-
`)},
|
|
213
|
+
`)},Fi=function(){var e=parseInt(document.body.getAttribute(Gt)||"0",10);return isFinite(e)?e:0},Bv=function(){l.useEffect(function(){return document.body.setAttribute(Gt,(Fi()+1).toString()),function(){var e=Fi()-1;e<=0?document.body.removeAttribute(Gt):document.body.setAttribute(Gt,e.toString())}},[])},Hv=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;Bv();var s=l.useMemo(function(){return Fv(o)},[o]);return l.createElement(Vv,{styles:Wv(s,!t,o,r?"":"!important")})},go=!1;if(typeof window<"u")try{var Ur=Object.defineProperty({},"passive",{get:function(){return go=!0,!0}});window.addEventListener("test",Ur,Ur),window.removeEventListener("test",Ur,Ur)}catch{go=!1}var Ft=go?{passive:!1}:!1,Uv=function(e){return e.tagName==="TEXTAREA"},El=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Uv(e)&&r[t]==="visible")},zv=function(e){return El(e,"overflowY")},Gv=function(e){return El(e,"overflowX")},Vi=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=Nl(e,n);if(o){var s=Rl(e,n),a=s[1],i=s[2];if(a>i)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Kv=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Yv=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Nl=function(e,t){return e==="v"?zv(t):Gv(t)},Rl=function(e,t){return e==="v"?Kv(t):Yv(t)},qv=function(e,t){return e==="h"&&t==="rtl"?-1:1},Xv=function(e,t,r,n,o){var s=qv(e,window.getComputedStyle(t).direction),a=s*n,i=r.target,u=t.contains(i),d=!1,p=a>0,f=0,m=0;do{if(!i)break;var g=Rl(e,i),v=g[0],h=g[1],x=g[2],y=h-x-s*v;(v||y)&&Nl(e,i)&&(f+=y,m+=v);var b=i.parentNode;i=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!u&&i!==document.body||u&&(t.contains(i)||t===i));return(p&&Math.abs(f)<1||!p&&Math.abs(m)<1)&&(d=!0),d},zr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Wi=function(e){return[e.deltaX,e.deltaY]},Bi=function(e){return e&&"current"in e?e.current:e},Zv=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Qv=function(e){return`
|
|
214
214
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
215
215
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
216
|
-
`)},Jv=0,Ot=[];function ey(e){var t=l.useRef([]),r=l.useRef([0,0]),n=l.useRef(),o=l.useState(Jv++)[0],s=l.useState(wl)[0],i=l.useRef(e);l.useEffect(function(){i.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=wv([e.lockRef.current],(e.shards||[]).map(Li),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=l.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!i.current.allowPinchZoom;var x=Vr(h),b=r.current,w="deltaX"in h?h.deltaX:b[0]-x[0],S="deltaY"in h?h.deltaY:b[1]-x[1],E,j=h.target,_=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in h&&_==="h"&&j.type==="range")return!1;var I=window.getSelection(),D=I&&I.anchorNode,O=D?D===j||D.contains(j):!1;if(O)return!1;var A=Oi(_,j);if(!A)return!0;if(A?E=_:(E=_==="v"?"h":"v",A=Oi(_,j)),!A)return!1;if(!n.current&&"changedTouches"in h&&(w||S)&&(n.current=E),!E)return!0;var R=n.current||E;return Xv(R,y,h,R==="h"?w:S)},[]),c=l.useCallback(function(h){var y=h;if(!(!Ot.length||Ot[Ot.length-1]!==s)){var x="deltaY"in y?$i(y):Vr(y),b=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&Zv(E.delta,x)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var w=(i.current.shards||[]).map(Li).filter(Boolean).filter(function(E){return E.contains(y.target)}),S=w.length>0?a(y,w[0]):!i.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),d=l.useCallback(function(h,y,x,b){var w={name:h,delta:y,target:x,should:b,shadowParent:ty(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),p=l.useCallback(function(h){r.current=Vr(h),n.current=void 0},[]),f=l.useCallback(function(h){d(h.type,$i(h),h.target,a(h,e.lockRef.current))},[]),m=l.useCallback(function(h){d(h.type,Vr(h),h.target,a(h,e.lockRef.current))},[]);l.useEffect(function(){return Ot.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,kt),document.addEventListener("touchmove",c,kt),document.addEventListener("touchstart",p,kt),function(){Ot=Ot.filter(function(h){return h!==s}),document.removeEventListener("wheel",c,kt),document.removeEventListener("touchmove",c,kt),document.removeEventListener("touchstart",p,kt)}},[]);var g=e.removeScrollBar,v=e.inert;return l.createElement(l.Fragment,null,v?l.createElement(s,{styles:Qv(o)}):null,g?l.createElement(Hv,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ty(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ry=Av(bl,ey);var bn=l.forwardRef(function(e,t){return l.createElement(xn,Qe({},e,{ref:t,sideCar:ry}))});bn.classNames=xn.classNames;var ny=[" ","Enter","ArrowUp","ArrowDown"],oy=[" ","Enter"],Pt="Select",[wn,Sn,sy]=Lo(Pt),[Zt]=Am(Pt,[sy,Xt]),Cn=Xt(),[iy,wt]=Zt(Pt),[ay,ly]=Zt(Pt),Nl=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:d,name:p,autoComplete:f,disabled:m,required:g,form:v}=e,h=Cn(t),[y,x]=l.useState(null),[b,w]=l.useState(null),[S,E]=l.useState(!1),j=Cr(d),[_,I]=tt({prop:n,defaultProp:o??!1,onChange:s,caller:Pt}),[D,O]=tt({prop:i,defaultProp:a,onChange:c,caller:Pt}),A=l.useRef(null),R=y?v||!!y.closest("form"):!0,[W,B]=l.useState(new Set),q=Array.from(W).map(H=>H.props.value).join(";");return u.jsx(vn,{...h,children:u.jsxs(iy,{required:g,scope:t,trigger:y,onTriggerChange:x,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:Oe(),value:D,onValueChange:O,open:_,onOpenChange:I,dir:j,triggerPointerDownPosRef:A,disabled:m,children:[u.jsx(wn.Provider,{scope:t,children:u.jsx(ay,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(H=>{B(U=>new Set(U).add(H))},[]),onNativeOptionRemove:l.useCallback(H=>{B(U=>{const $=new Set(U);return $.delete(H),$})},[]),children:r})}),R?u.jsxs(Xl,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:f,value:D,onChange:H=>O(H.target.value),disabled:m,form:v,children:[D===void 0?u.jsx("option",{value:""}):null,Array.from(W)]},q):null]})})};Nl.displayName=Pt;var Rl="SelectTrigger",_l=l.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,s=Cn(r),i=wt(Rl,r),a=i.disabled||n,c=oe(t,i.onTriggerChange),d=Sn(r),p=l.useRef("touch"),[f,m,g]=Ql(h=>{const y=d().filter(w=>!w.disabled),x=y.find(w=>w.value===i.value),b=Jl(y,h,x);b!==void 0&&i.onValueChange(b.value)}),v=h=>{a||(i.onOpenChange(!0),g()),h&&(i.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return u.jsx(Yo,{asChild:!0,...s,children:u.jsx(Le.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Zl(i.value)?"":void 0,...o,ref:c,onClick:z(o.onClick,h=>{h.currentTarget.focus(),p.current!=="mouse"&&v(h)}),onPointerDown:z(o.onPointerDown,h=>{p.current=h.pointerType;const y=h.target;y.hasPointerCapture(h.pointerId)&&y.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(v(h),h.preventDefault())}),onKeyDown:z(o.onKeyDown,h=>{const y=f.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&m(h.key),!(y&&h.key===" ")&&ny.includes(h.key)&&(v(),h.preventDefault())})})})});_l.displayName=Rl;var Pl="SelectValue",jl=l.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:s,placeholder:i="",...a}=e,c=wt(Pl,r),{onValueNodeHasChildrenChange:d}=c,p=s!==void 0,f=oe(t,c.onValueNodeChange);return we(()=>{d(p)},[d,p]),u.jsx(Le.span,{...a,ref:f,style:{pointerEvents:"none"},children:Zl(c.value)?u.jsx(u.Fragment,{children:i}):s})});jl.displayName=Pl;var cy="SelectIcon",Al=l.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return u.jsx(Le.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Al.displayName=cy;var uy="SelectPortal",Tl=e=>u.jsx(yn,{asChild:!0,...e});Tl.displayName=uy;var jt="SelectContent",Ml=l.forwardRef((e,t)=>{const r=wt(jt,e.__scopeSelect),[n,o]=l.useState();if(we(()=>{o(new DocumentFragment)},[]),!r.open){const s=n;return s?vr.createPortal(u.jsx(Dl,{scope:e.__scopeSelect,children:u.jsx(wn.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),s):null}return u.jsx(Il,{...e,ref:t})});Ml.displayName=jt;var He=10,[Dl,St]=Zt(jt),dy="SelectContentImpl",fy=ml("SelectContent.RemoveScroll"),Il=l.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:g,sticky:v,hideWhenDetached:h,avoidCollisions:y,...x}=e,b=wt(jt,r),[w,S]=l.useState(null),[E,j]=l.useState(null),_=oe(t,T=>S(T)),[I,D]=l.useState(null),[O,A]=l.useState(null),R=Sn(r),[W,B]=l.useState(!1),q=l.useRef(!1);l.useEffect(()=>{if(w)return Zo(w)},[w]),Fo();const H=l.useCallback(T=>{const[Z,...K]=R().map(te=>te.ref.current),[J]=K.slice(-1),Q=document.activeElement;for(const te of T)if(te===Q||(te==null||te.scrollIntoView({block:"nearest"}),te===Z&&E&&(E.scrollTop=0),te===J&&E&&(E.scrollTop=E.scrollHeight),te==null||te.focus(),document.activeElement!==Q))return},[R,E]),U=l.useCallback(()=>H([I,w]),[H,I,w]);l.useEffect(()=>{W&&U()},[W,U]);const{onOpenChange:$,triggerPointerDownPosRef:k}=b;l.useEffect(()=>{if(w){let T={x:0,y:0};const Z=J=>{var Q,te;T={x:Math.abs(Math.round(J.pageX)-(((Q=k.current)==null?void 0:Q.x)??0)),y:Math.abs(Math.round(J.pageY)-(((te=k.current)==null?void 0:te.y)??0))}},K=J=>{T.x<=10&&T.y<=10?J.preventDefault():w.contains(J.target)||$(!1),document.removeEventListener("pointermove",Z),k.current=null};return k.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",K,{capture:!0})}}},[w,$,k]),l.useEffect(()=>{const T=()=>$(!1);return window.addEventListener("blur",T),window.addEventListener("resize",T),()=>{window.removeEventListener("blur",T),window.removeEventListener("resize",T)}},[$]);const[ee,F]=Ql(T=>{const Z=R().filter(Q=>!Q.disabled),K=Z.find(Q=>Q.ref.current===document.activeElement),J=Jl(Z,T,K);J&&setTimeout(()=>J.ref.current.focus())}),re=l.useCallback((T,Z,K)=>{const J=!q.current&&!K;(b.value!==void 0&&b.value===Z||J)&&(D(T),J&&(q.current=!0))},[b.value]),ce=l.useCallback(()=>w==null?void 0:w.focus(),[w]),pe=l.useCallback((T,Z,K)=>{const J=!q.current&&!K;(b.value!==void 0&&b.value===Z||J)&&A(T)},[b.value]),he=n==="popper"?mo:kl,ge=he===mo?{side:a,sideOffset:c,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:g,sticky:v,hideWhenDetached:h,avoidCollisions:y}:{};return u.jsx(Dl,{scope:r,content:w,viewport:E,onViewportChange:j,itemRefCallback:re,selectedItem:I,onItemLeave:ce,itemTextRefCallback:pe,focusSelectedItem:U,selectedItemText:O,position:n,isPositioned:W,searchRef:ee,children:u.jsx(bn,{as:fy,allowPinchZoom:!0,children:u.jsx(fn,{asChild:!0,trapped:b.open,onMountAutoFocus:T=>{T.preventDefault()},onUnmountAutoFocus:z(o,T=>{var Z;(Z=b.trigger)==null||Z.focus({preventScroll:!0}),T.preventDefault()}),children:u.jsx(Er,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:T=>T.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:u.jsx(he,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:T=>T.preventDefault(),...x,...ge,onPlaced:()=>B(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:z(x.onKeyDown,T=>{const Z=T.ctrlKey||T.altKey||T.metaKey;if(T.key==="Tab"&&T.preventDefault(),!Z&&T.key.length===1&&F(T.key),["ArrowUp","ArrowDown","Home","End"].includes(T.key)){let J=R().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(T.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(T.key)){const Q=T.target,te=J.indexOf(Q);J=J.slice(te+1)}setTimeout(()=>H(J)),T.preventDefault()}})})})})})})});Il.displayName=dy;var py="SelectItemAlignedPosition",kl=l.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,s=wt(jt,r),i=St(jt,r),[a,c]=l.useState(null),[d,p]=l.useState(null),f=oe(t,_=>p(_)),m=Sn(r),g=l.useRef(!1),v=l.useRef(!0),{viewport:h,selectedItem:y,selectedItemText:x,focusSelectedItem:b}=i,w=l.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&d&&h&&y&&x){const _=s.trigger.getBoundingClientRect(),I=d.getBoundingClientRect(),D=s.valueNode.getBoundingClientRect(),O=x.getBoundingClientRect();if(s.dir!=="rtl"){const Q=O.left-I.left,te=D.left-Q,Re=_.left-te,_e=_.width+Re,Ee=Math.max(_e,I.width),st=window.innerWidth-He,We=ao(te,[He,Math.max(He,st-Ee)]);a.style.minWidth=_e+"px",a.style.left=We+"px"}else{const Q=I.right-O.right,te=window.innerWidth-D.right-Q,Re=window.innerWidth-_.right-te,_e=_.width+Re,Ee=Math.max(_e,I.width),st=window.innerWidth-He,We=ao(te,[He,Math.max(He,st-Ee)]);a.style.minWidth=_e+"px",a.style.right=We+"px"}const A=m(),R=window.innerHeight-He*2,W=h.scrollHeight,B=window.getComputedStyle(d),q=parseInt(B.borderTopWidth,10),H=parseInt(B.paddingTop,10),U=parseInt(B.borderBottomWidth,10),$=parseInt(B.paddingBottom,10),k=q+H+W+$+U,ee=Math.min(y.offsetHeight*5,k),F=window.getComputedStyle(h),re=parseInt(F.paddingTop,10),ce=parseInt(F.paddingBottom,10),pe=_.top+_.height/2-He,he=R-pe,ge=y.offsetHeight/2,T=y.offsetTop+ge,Z=q+H+T,K=k-Z;if(Z<=pe){const Q=A.length>0&&y===A[A.length-1].ref.current;a.style.bottom="0px";const te=d.clientHeight-h.offsetTop-h.offsetHeight,Re=Math.max(he,ge+(Q?ce:0)+te+U),_e=Z+Re;a.style.height=_e+"px"}else{const Q=A.length>0&&y===A[0].ref.current;a.style.top="0px";const Re=Math.max(pe,q+h.offsetTop+(Q?re:0)+ge)+K;a.style.height=Re+"px",h.scrollTop=Z-pe+h.offsetTop}a.style.margin=`${He}px 0`,a.style.minHeight=ee+"px",a.style.maxHeight=R+"px",n==null||n(),requestAnimationFrame(()=>g.current=!0)}},[m,s.trigger,s.valueNode,a,d,h,y,x,s.dir,n]);we(()=>w(),[w]);const[S,E]=l.useState();we(()=>{d&&E(window.getComputedStyle(d).zIndex)},[d]);const j=l.useCallback(_=>{_&&v.current===!0&&(w(),b==null||b(),v.current=!1)},[w,b]);return u.jsx(hy,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:j,children:u.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:u.jsx(Le.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});kl.displayName=py;var my="SelectPopperPosition",mo=l.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=He,...s}=e,i=Cn(r);return u.jsx(qo,{...i,...s,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});mo.displayName=my;var[hy,Qo]=Zt(jt,{}),ho="SelectViewport",Ol=l.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,s=St(ho,r),i=Qo(ho,r),a=oe(t,s.onViewportChange),c=l.useRef(0);return u.jsxs(u.Fragment,{children:[u.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}),u.jsx(wn.Slot,{scope:r,children:u.jsx(Le.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:z(o.onScroll,d=>{const p=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&f){const g=Math.abs(c.current-p.scrollTop);if(g>0){const v=window.innerHeight-He*2,h=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),x=Math.max(h,y);if(x<v){const b=x+g,w=Math.min(v,b),S=b-w;f.style.height=w+"px",f.style.bottom==="0px"&&(p.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=p.scrollTop})})})]})});Ol.displayName=ho;var $l="SelectGroup",[gy,vy]=Zt($l),Ll=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Oe();return u.jsx(gy,{scope:r,id:o,children:u.jsx(Le.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Ll.displayName=$l;var Fl="SelectLabel",Vl=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=vy(Fl,r);return u.jsx(Le.div,{id:o.id,...n,ref:t})});Vl.displayName=Fl;var Zr="SelectItem",[yy,Wl]=Zt(Zr),Bl=l.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:s,...i}=e,a=wt(Zr,r),c=St(Zr,r),d=a.value===n,[p,f]=l.useState(s??""),[m,g]=l.useState(!1),v=oe(t,b=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,b,n,o)}),h=Oe(),y=l.useRef("touch"),x=()=>{o||(a.onValueChange(n),a.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 u.jsx(yy,{scope:r,value:n,disabled:o,textId:h,isSelected:d,onItemTextChange:l.useCallback(b=>{f(w=>w||((b==null?void 0:b.textContent)??"").trim())},[]),children:u.jsx(wn.ItemSlot,{scope:r,value:n,disabled:o,textValue:p,children:u.jsx(Le.div,{role:"option","aria-labelledby":h,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:v,onFocus:z(i.onFocus,()=>g(!0)),onBlur:z(i.onBlur,()=>g(!1)),onClick:z(i.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:z(i.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:z(i.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:z(i.onPointerMove,b=>{var w;y.current=b.pointerType,o?(w=c.onItemLeave)==null||w.call(c):y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:z(i.onPointerLeave,b=>{var w;b.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:z(i.onKeyDown,b=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&b.key===" "||(oy.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});Bl.displayName=Zr;var sr="SelectItemText",Hl=l.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...s}=e,i=wt(sr,r),a=St(sr,r),c=Wl(sr,r),d=ly(sr,r),[p,f]=l.useState(null),m=oe(t,x=>f(x),c.onItemTextChange,x=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,x,c.value,c.disabled)}),g=p==null?void 0:p.textContent,v=l.useMemo(()=>u.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:h,onNativeOptionRemove:y}=d;return we(()=>(h(v),()=>y(v)),[h,y,v]),u.jsxs(u.Fragment,{children:[u.jsx(Le.span,{id:c.textId,...s,ref:m}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?vr.createPortal(s.children,i.valueNode):null]})});Hl.displayName=sr;var Ul="SelectItemIndicator",zl=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Wl(Ul,r).isSelected?u.jsx(Le.span,{"aria-hidden":!0,...n,ref:t}):null});zl.displayName=Ul;var go="SelectScrollUpButton",Gl=l.forwardRef((e,t)=>{const r=St(go,e.__scopeSelect),n=Qo(go,e.__scopeSelect),[o,s]=l.useState(!1),i=oe(t,n.onScrollButtonChange);return we(()=>{if(r.viewport&&r.isPositioned){let a=function(){const d=c.scrollTop>0;s(d)};const c=r.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?u.jsx(Yl,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Gl.displayName=go;var vo="SelectScrollDownButton",Kl=l.forwardRef((e,t)=>{const r=St(vo,e.__scopeSelect),n=Qo(vo,e.__scopeSelect),[o,s]=l.useState(!1),i=oe(t,n.onScrollButtonChange);return we(()=>{if(r.viewport&&r.isPositioned){let a=function(){const d=c.scrollHeight-c.clientHeight,p=Math.ceil(c.scrollTop)<d;s(p)};const c=r.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?u.jsx(Yl,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=r;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Kl.displayName=vo;var Yl=l.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,s=St("SelectScrollButton",r),i=l.useRef(null),a=Sn(r),c=l.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return l.useEffect(()=>()=>c(),[c]),we(()=>{var p;const d=a().find(f=>f.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[a]),u.jsx(Le.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:z(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:z(o.onPointerMove,()=>{var d;(d=s.onItemLeave)==null||d.call(s),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:z(o.onPointerLeave,()=>{c()})})}),xy="SelectSeparator",ql=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return u.jsx(Le.div,{"aria-hidden":!0,...n,ref:t})});ql.displayName=xy;var yo="SelectArrow",by=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Cn(r),s=wt(yo,r),i=St(yo,r);return s.open&&i.position==="popper"?u.jsx(Xo,{...o,...n,ref:t}):null});by.displayName=yo;var wy="SelectBubbleInput",Xl=l.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=l.useRef(null),s=oe(n,o),i=To(t);return l.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&p){const f=new Event("change",{bubbles:!0});p.call(a,t),a.dispatchEvent(f)}},[i,t]),u.jsx(Le.select,{...r,style:{...hl,...r.style},ref:s,defaultValue:t})});Xl.displayName=wy;function Zl(e){return e===""||e===void 0}function Ql(e){const t=Ce(e),r=l.useRef(""),n=l.useRef(0),o=l.useCallback(i=>{const a=r.current+i;t(a),function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),s=l.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function Jl(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=Sy(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==r));const c=i.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function Sy(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Cy=Nl,ec=_l,Ey=jl,Ny=Al,Ry=Tl,tc=Ml,_y=Ol,Py=Ll,rc=Vl,nc=Bl,jy=Hl,Ay=zl,oc=Gl,sc=Kl,ic=ql;const Jo=Cy,Ty=Py,es=Ey,En=l.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(ec,{ref:n,className:M("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,u.jsx(Ny,{asChild:!0,children:u.jsx(Po,{className:"h-4 w-4 opacity-50"})})]}));En.displayName=ec.displayName;const ts=l.forwardRef(({className:e,...t},r)=>u.jsx(oc,{ref:r,className:M("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Ep,{className:"h-4 w-4"})}));ts.displayName=oc.displayName;const rs=l.forwardRef(({className:e,...t},r)=>u.jsx(sc,{ref:r,className:M("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Po,{className:"h-4 w-4"})}));rs.displayName=sc.displayName;const Nn=l.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>u.jsx(Ry,{children:u.jsxs(tc,{ref:o,className:M("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[u.jsx(ts,{}),u.jsx(_y,{className:M("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(rs,{})]})}));Nn.displayName=tc.displayName;const ac=l.forwardRef(({className:e,...t},r)=>u.jsx(rc,{ref:r,className:M("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));ac.displayName=rc.displayName;const Rn=l.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(nc,{ref:n,className:M("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Ay,{children:u.jsx(ur,{className:"h-4 w-4"})})}),u.jsx(jy,{children:t})]}));Rn.displayName=nc.displayName;const lc=l.forwardRef(({className:e,...t},r)=>u.jsx(ic,{ref:r,className:M("-mx-1 my-1 h-px bg-muted",e),...t}));lc.displayName=ic.displayName;function My(e,t){const r=l.createContext(t),n=s=>{const{children:i,...a}=s,c=l.useMemo(()=>a,Object.values(a));return u.jsx(r.Provider,{value:c,children:i})};n.displayName=e+"Provider";function o(s){const i=l.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,o]}function Dy(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,Iy(o,...t)]}function Iy(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function cc(e){const t=ky(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find($y);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function ky(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Fy(o),a=Ly(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oy=Symbol("radix.slottable");function $y(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oy}function Ly(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Fy(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Vy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rr=Vy.reduce((e,t)=>{const r=cc(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),_n="Dialog",[uc]=Dy(_n),[Wy,Ye]=uc(_n),dc=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=l.useRef(null),c=l.useRef(null),[d,p]=tt({prop:n,defaultProp:o??!1,onChange:s,caller:_n});return u.jsx(Wy,{scope:t,triggerRef:a,contentRef:c,contentId:Oe(),titleId:Oe(),descriptionId:Oe(),open:d,onOpenChange:p,onOpenToggle:l.useCallback(()=>p(f=>!f),[p]),modal:i,children:r})};dc.displayName=_n;var fc="DialogTrigger",pc=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ye(fc,r),s=oe(t,o.triggerRef);return u.jsx(Rr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ss(o.open),...n,ref:s,onClick:z(e.onClick,o.onOpenToggle)})});pc.displayName=fc;var ns="DialogPortal",[By,mc]=uc(ns,{forceMount:void 0}),hc=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=Ye(ns,t);return u.jsx(By,{scope:t,forceMount:r,children:l.Children.map(n,i=>u.jsx(Te,{present:r||s.open,children:u.jsx(yn,{asChild:!0,container:o,children:i})}))})};hc.displayName=ns;var Qr="DialogOverlay",gc=l.forwardRef((e,t)=>{const r=mc(Qr,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=Ye(Qr,e.__scopeDialog);return s.modal?u.jsx(Te,{present:n||s.open,children:u.jsx(Uy,{...o,ref:t})}):null});gc.displayName=Qr;var Hy=cc("DialogOverlay.RemoveScroll"),Uy=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ye(Qr,r);return u.jsx(bn,{as:Hy,allowPinchZoom:!0,shards:[o.contentRef],children:u.jsx(Rr.div,{"data-state":ss(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),At="DialogContent",vc=l.forwardRef((e,t)=>{const r=mc(At,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=Ye(At,e.__scopeDialog);return u.jsx(Te,{present:n||s.open,children:s.modal?u.jsx(zy,{...o,ref:t}):u.jsx(Gy,{...o,ref:t})})});vc.displayName=At;var zy=l.forwardRef((e,t)=>{const r=Ye(At,e.__scopeDialog),n=l.useRef(null),o=oe(t,r.contentRef,n);return l.useEffect(()=>{const s=n.current;if(s)return Zo(s)},[]),u.jsx(yc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:z(e.onFocusOutside,s=>s.preventDefault())})}),Gy=l.forwardRef((e,t)=>{const r=Ye(At,e.__scopeDialog),n=l.useRef(!1),o=l.useRef(!1);return u.jsx(yc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((d=r.triggerRef.current)==null?void 0:d.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),yc=l.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Ye(At,r),c=l.useRef(null),d=oe(t,c);return Fo(),u.jsxs(u.Fragment,{children:[u.jsx(fn,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:u.jsx(Er,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ss(a.open),...i,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(Ky,{titleId:a.titleId}),u.jsx(qy,{contentRef:c,descriptionId:a.descriptionId})]})]})}),os="DialogTitle",xc=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ye(os,r);return u.jsx(Rr.h2,{id:o.titleId,...n,ref:t})});xc.displayName=os;var bc="DialogDescription",wc=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ye(bc,r);return u.jsx(Rr.p,{id:o.descriptionId,...n,ref:t})});wc.displayName=bc;var Sc="DialogClose",Cc=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ye(Sc,r);return u.jsx(Rr.button,{type:"button",...n,ref:t,onClick:z(e.onClick,()=>o.onOpenChange(!1))})});Cc.displayName=Sc;function ss(e){return e?"open":"closed"}var Ec="DialogTitleWarning",[XS,Nc]=My(Ec,{contentName:At,titleName:os,docsSlug:"dialog"}),Ky=({titleId:e})=>{const t=Nc(Ec),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
216
|
+
`)},Jv=0,Vt=[];function ex(e){var t=l.useRef([]),r=l.useRef([0,0]),n=l.useRef(),o=l.useState(Jv++)[0],s=l.useState(Cl)[0],a=l.useRef(e);l.useEffect(function(){a.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=wv([e.lockRef.current],(e.shards||[]).map(Bi),!0).filter(Boolean);return h.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=l.useCallback(function(h,x){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var y=zr(h),b=r.current,S="deltaX"in h?h.deltaX:b[0]-y[0],C="deltaY"in h?h.deltaY:b[1]-y[1],E,_=h.target,R=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in h&&R==="h"&&_.type==="range")return!1;var k=window.getSelection(),M=k&&k.anchorNode,O=M?M===_||M.contains(_):!1;if(O)return!1;var V=Vi(R,_);if(!V)return!0;if(V?E=R:(E=R==="v"?"h":"v",V=Vi(R,_)),!V)return!1;if(!n.current&&"changedTouches"in h&&(S||C)&&(n.current=E),!E)return!0;var P=n.current||E;return Xv(P,x,h,P==="h"?S:C)},[]),u=l.useCallback(function(h){var x=h;if(!(!Vt.length||Vt[Vt.length-1]!==s)){var y="deltaY"in x?Wi(x):zr(x),b=t.current.filter(function(E){return E.name===x.type&&(E.target===x.target||x.target===E.shadowParent)&&Zv(E.delta,y)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var S=(a.current.shards||[]).map(Bi).filter(Boolean).filter(function(E){return E.contains(x.target)}),C=S.length>0?i(x,S[0]):!a.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),d=l.useCallback(function(h,x,y,b){var S={name:h,delta:x,target:y,should:b,shadowParent:tx(y)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),p=l.useCallback(function(h){r.current=zr(h),n.current=void 0},[]),f=l.useCallback(function(h){d(h.type,Wi(h),h.target,i(h,e.lockRef.current))},[]),m=l.useCallback(function(h){d(h.type,zr(h),h.target,i(h,e.lockRef.current))},[]);l.useEffect(function(){return Vt.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",u,Ft),document.addEventListener("touchmove",u,Ft),document.addEventListener("touchstart",p,Ft),function(){Vt=Vt.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,Ft),document.removeEventListener("touchmove",u,Ft),document.removeEventListener("touchstart",p,Ft)}},[]);var g=e.removeScrollBar,v=e.inert;return l.createElement(l.Fragment,null,v?l.createElement(s,{styles:Qv(o)}):null,g?l.createElement(Hv,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tx(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rx=Av(Sl,ex);var Cn=l.forwardRef(function(e,t){return l.createElement(Sn,st({},e,{ref:t,sideCar:rx}))});Cn.classNames=Sn.classNames;var nx=[" ","Enter","ArrowUp","ArrowDown"],ox=[" ","Enter"],Dt="Select",[En,Nn,sx]=Wo(Dt),[or]=Am(Dt,[sx,nr]),Rn=nr(),[ix,Nt]=or(Dt),[ax,lx]=or(Dt),jl=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:s,value:a,defaultValue:i,onValueChange:u,dir:d,name:p,autoComplete:f,disabled:m,required:g,form:v}=e,h=Rn(t),[x,y]=l.useState(null),[b,S]=l.useState(null),[C,E]=l.useState(!1),_=Pr(d),[R,k]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:Dt}),[M,O]=lt({prop:a,defaultProp:i,onChange:u,caller:Dt}),V=l.useRef(null),P=x?v||!!x.closest("form"):!0,[$,z]=l.useState(new Set),X=Array.from($).map(H=>H.props.value).join(";");return c.jsx(bn,{...h,children:c.jsxs(ix,{required:g,scope:t,trigger:x,onTriggerChange:y,valueNode:b,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:He(),value:M,onValueChange:O,open:R,onOpenChange:k,dir:_,triggerPointerDownPosRef:V,disabled:m,children:[c.jsx(En.Provider,{scope:t,children:c.jsx(ax,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(H=>{z(I=>new Set(I).add(H))},[]),onNativeOptionRemove:l.useCallback(H=>{z(I=>{const U=new Set(I);return U.delete(H),U})},[]),children:r})}),P?c.jsxs(Ql,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:f,value:M,onChange:H=>O(H.target.value),disabled:m,form:v,children:[M===void 0?c.jsx("option",{value:""}):null,Array.from($)]},X):null]})})};jl.displayName=Dt;var _l="SelectTrigger",Pl=l.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,s=Rn(r),a=Nt(_l,r),i=a.disabled||n,u=se(t,a.onTriggerChange),d=Nn(r),p=l.useRef("touch"),[f,m,g]=ec(h=>{const x=d().filter(S=>!S.disabled),y=x.find(S=>S.value===a.value),b=tc(x,h,y);b!==void 0&&a.onValueChange(b.value)}),v=h=>{i||(a.onOpenChange(!0),g()),h&&(a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return c.jsx(Zo,{asChild:!0,...s,children:c.jsx(ze.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":Jl(a.value)?"":void 0,...o,ref:u,onClick:G(o.onClick,h=>{h.currentTarget.focus(),p.current!=="mouse"&&v(h)}),onPointerDown:G(o.onPointerDown,h=>{p.current=h.pointerType;const x=h.target;x.hasPointerCapture(h.pointerId)&&x.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(v(h),h.preventDefault())}),onKeyDown:G(o.onKeyDown,h=>{const x=f.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&m(h.key),!(x&&h.key===" ")&&nx.includes(h.key)&&(v(),h.preventDefault())})})})});Pl.displayName=_l;var Al="SelectValue",Tl=l.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:s,placeholder:a="",...i}=e,u=Nt(Al,r),{onValueNodeHasChildrenChange:d}=u,p=s!==void 0,f=se(t,u.onValueNodeChange);return Ee(()=>{d(p)},[d,p]),c.jsx(ze.span,{...i,ref:f,style:{pointerEvents:"none"},children:Jl(u.value)?c.jsx(c.Fragment,{children:a}):s})});Tl.displayName=Al;var cx="SelectIcon",Ml=l.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return c.jsx(ze.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Ml.displayName=cx;var ux="SelectPortal",Dl=e=>c.jsx(wn,{asChild:!0,...e});Dl.displayName=ux;var It="SelectContent",Il=l.forwardRef((e,t)=>{const r=Nt(It,e.__scopeSelect),[n,o]=l.useState();if(Ee(()=>{o(new DocumentFragment)},[]),!r.open){const s=n;return s?Rr.createPortal(c.jsx(kl,{scope:e.__scopeSelect,children:c.jsx(En.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(Ol,{...e,ref:t})});Il.displayName=It;var Ze=10,[kl,Rt]=or(It),dx="SelectContentImpl",fx=gl("SelectContent.RemoveScroll"),Ol=l.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:g,sticky:v,hideWhenDetached:h,avoidCollisions:x,...y}=e,b=Nt(It,r),[S,C]=l.useState(null),[E,_]=l.useState(null),R=se(t,T=>C(T)),[k,M]=l.useState(null),[O,V]=l.useState(null),P=Nn(r),[$,z]=l.useState(!1),X=l.useRef(!1);l.useEffect(()=>{if(S)return es(S)},[S]),Bo();const H=l.useCallback(T=>{const[Q,...q]=P().map(B=>B.ref.current),[ne]=q.slice(-1),J=document.activeElement;for(const B of T)if(B===J||(B==null||B.scrollIntoView({block:"nearest"}),B===Q&&E&&(E.scrollTop=0),B===ne&&E&&(E.scrollTop=E.scrollHeight),B==null||B.focus(),document.activeElement!==J))return},[P,E]),I=l.useCallback(()=>H([k,S]),[H,k,S]);l.useEffect(()=>{$&&I()},[$,I]);const{onOpenChange:U,triggerPointerDownPosRef:D}=b;l.useEffect(()=>{if(S){let T={x:0,y:0};const Q=ne=>{var J,B;T={x:Math.abs(Math.round(ne.pageX)-(((J=D.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(ne.pageY)-(((B=D.current)==null?void 0:B.y)??0))}},q=ne=>{T.x<=10&&T.y<=10?ne.preventDefault():S.contains(ne.target)||U(!1),document.removeEventListener("pointermove",Q),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",q,{capture:!0})}}},[S,U,D]),l.useEffect(()=>{const T=()=>U(!1);return window.addEventListener("blur",T),window.addEventListener("resize",T),()=>{window.removeEventListener("blur",T),window.removeEventListener("resize",T)}},[U]);const[re,L]=ec(T=>{const Q=P().filter(J=>!J.disabled),q=Q.find(J=>J.ref.current===document.activeElement),ne=tc(Q,T,q);ne&&setTimeout(()=>ne.ref.current.focus())}),te=l.useCallback((T,Q,q)=>{const ne=!X.current&&!q;(b.value!==void 0&&b.value===Q||ne)&&(M(T),ne&&(X.current=!0))},[b.value]),le=l.useCallback(()=>S==null?void 0:S.focus(),[S]),ue=l.useCallback((T,Q,q)=>{const ne=!X.current&&!q;(b.value!==void 0&&b.value===Q||ne)&&V(T)},[b.value]),ge=n==="popper"?vo:$l,me=ge===vo?{side:i,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:g,sticky:v,hideWhenDetached:h,avoidCollisions:x}:{};return c.jsx(kl,{scope:r,content:S,viewport:E,onViewportChange:_,itemRefCallback:te,selectedItem:k,onItemLeave:le,itemTextRefCallback:ue,focusSelectedItem:I,selectedItemText:O,position:n,isPositioned:$,searchRef:re,children:c.jsx(Cn,{as:fx,allowPinchZoom:!0,children:c.jsx(hn,{asChild:!0,trapped:b.open,onMountAutoFocus:T=>{T.preventDefault()},onUnmountAutoFocus:G(o,T=>{var Q;(Q=b.trigger)==null||Q.focus({preventScroll:!0}),T.preventDefault()}),children:c.jsx(Ar,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:T=>T.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:c.jsx(ge,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:T=>T.preventDefault(),...y,...me,onPlaced:()=>z(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:G(y.onKeyDown,T=>{const Q=T.ctrlKey||T.altKey||T.metaKey;if(T.key==="Tab"&&T.preventDefault(),!Q&&T.key.length===1&&L(T.key),["ArrowUp","ArrowDown","Home","End"].includes(T.key)){let ne=P().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(T.key)&&(ne=ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(T.key)){const J=T.target,B=ne.indexOf(J);ne=ne.slice(B+1)}setTimeout(()=>H(ne)),T.preventDefault()}})})})})})})});Ol.displayName=dx;var px="SelectItemAlignedPosition",$l=l.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,s=Nt(It,r),a=Rt(It,r),[i,u]=l.useState(null),[d,p]=l.useState(null),f=se(t,R=>p(R)),m=Nn(r),g=l.useRef(!1),v=l.useRef(!0),{viewport:h,selectedItem:x,selectedItemText:y,focusSelectedItem:b}=a,S=l.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&d&&h&&x&&y){const R=s.trigger.getBoundingClientRect(),k=d.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),O=y.getBoundingClientRect();if(s.dir!=="rtl"){const J=O.left-k.left,B=M.left-J,ee=R.left-B,ye=R.width+ee,ve=Math.max(ye,k.width),ke=window.innerWidth-Ze,Fe=uo(B,[Ze,Math.max(Ze,ke-ve)]);i.style.minWidth=ye+"px",i.style.left=Fe+"px"}else{const J=k.right-O.right,B=window.innerWidth-M.right-J,ee=window.innerWidth-R.right-B,ye=R.width+ee,ve=Math.max(ye,k.width),ke=window.innerWidth-Ze,Fe=uo(B,[Ze,Math.max(Ze,ke-ve)]);i.style.minWidth=ye+"px",i.style.right=Fe+"px"}const V=m(),P=window.innerHeight-Ze*2,$=h.scrollHeight,z=window.getComputedStyle(d),X=parseInt(z.borderTopWidth,10),H=parseInt(z.paddingTop,10),I=parseInt(z.borderBottomWidth,10),U=parseInt(z.paddingBottom,10),D=X+H+$+U+I,re=Math.min(x.offsetHeight*5,D),L=window.getComputedStyle(h),te=parseInt(L.paddingTop,10),le=parseInt(L.paddingBottom,10),ue=R.top+R.height/2-Ze,ge=P-ue,me=x.offsetHeight/2,T=x.offsetTop+me,Q=X+H+T,q=D-Q;if(Q<=ue){const J=V.length>0&&x===V[V.length-1].ref.current;i.style.bottom="0px";const B=d.clientHeight-h.offsetTop-h.offsetHeight,ee=Math.max(ge,me+(J?le:0)+B+I),ye=Q+ee;i.style.height=ye+"px"}else{const J=V.length>0&&x===V[0].ref.current;i.style.top="0px";const ee=Math.max(ue,X+h.offsetTop+(J?te:0)+me)+q;i.style.height=ee+"px",h.scrollTop=Q-ue+h.offsetTop}i.style.margin=`${Ze}px 0`,i.style.minHeight=re+"px",i.style.maxHeight=P+"px",n==null||n(),requestAnimationFrame(()=>g.current=!0)}},[m,s.trigger,s.valueNode,i,d,h,x,y,s.dir,n]);Ee(()=>S(),[S]);const[C,E]=l.useState();Ee(()=>{d&&E(window.getComputedStyle(d).zIndex)},[d]);const _=l.useCallback(R=>{R&&v.current===!0&&(S(),b==null||b(),v.current=!1)},[S,b]);return c.jsx(hx,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:g,onScrollButtonChange:_,children:c.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(ze.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});$l.displayName=px;var mx="SelectPopperPosition",vo=l.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ze,...s}=e,a=Rn(r);return c.jsx(Qo,{...a,...s,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});vo.displayName=mx;var[hx,ts]=or(It,{}),xo="SelectViewport",Ll=l.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,s=Rt(xo,r),a=ts(xo,r),i=se(t,s.onViewportChange),u=l.useRef(0);return c.jsxs(c.Fragment,{children:[c.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}),c.jsx(En.Slot,{scope:r,children:c.jsx(ze.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:G(o.onScroll,d=>{const p=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&f){const g=Math.abs(u.current-p.scrollTop);if(g>0){const v=window.innerHeight-Ze*2,h=parseFloat(f.style.minHeight),x=parseFloat(f.style.height),y=Math.max(h,x);if(y<v){const b=y+g,S=Math.min(v,b),C=b-S;f.style.height=S+"px",f.style.bottom==="0px"&&(p.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});Ll.displayName=xo;var Fl="SelectGroup",[gx,vx]=or(Fl),Vl=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=He();return c.jsx(gx,{scope:r,id:o,children:c.jsx(ze.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Vl.displayName=Fl;var Wl="SelectLabel",Bl=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=vx(Wl,r);return c.jsx(ze.div,{id:o.id,...n,ref:t})});Bl.displayName=Wl;var tn="SelectItem",[xx,Hl]=or(tn),Ul=l.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:s,...a}=e,i=Nt(tn,r),u=Rt(tn,r),d=i.value===n,[p,f]=l.useState(s??""),[m,g]=l.useState(!1),v=se(t,b=>{var S;return(S=u.itemRefCallback)==null?void 0:S.call(u,b,n,o)}),h=He(),x=l.useRef("touch"),y=()=>{o||(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 c.jsx(xx,{scope:r,value:n,disabled:o,textId:h,isSelected:d,onItemTextChange:l.useCallback(b=>{f(S=>S||((b==null?void 0:b.textContent)??"").trim())},[]),children:c.jsx(En.ItemSlot,{scope:r,value:n,disabled:o,textValue:p,children:c.jsx(ze.div,{role:"option","aria-labelledby":h,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:v,onFocus:G(a.onFocus,()=>g(!0)),onBlur:G(a.onBlur,()=>g(!1)),onClick:G(a.onClick,()=>{x.current!=="mouse"&&y()}),onPointerUp:G(a.onPointerUp,()=>{x.current==="mouse"&&y()}),onPointerDown:G(a.onPointerDown,b=>{x.current=b.pointerType}),onPointerMove:G(a.onPointerMove,b=>{var S;x.current=b.pointerType,o?(S=u.onItemLeave)==null||S.call(u):x.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:G(a.onPointerLeave,b=>{var S;b.currentTarget===document.activeElement&&((S=u.onItemLeave)==null||S.call(u))}),onKeyDown:G(a.onKeyDown,b=>{var C;((C=u.searchRef)==null?void 0:C.current)!==""&&b.key===" "||(ox.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})});Ul.displayName=tn;var dr="SelectItemText",zl=l.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...s}=e,a=Nt(dr,r),i=Rt(dr,r),u=Hl(dr,r),d=lx(dr,r),[p,f]=l.useState(null),m=se(t,y=>f(y),u.onItemTextChange,y=>{var b;return(b=i.itemTextRefCallback)==null?void 0:b.call(i,y,u.value,u.disabled)}),g=p==null?void 0:p.textContent,v=l.useMemo(()=>c.jsx("option",{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:h,onNativeOptionRemove:x}=d;return Ee(()=>(h(v),()=>x(v)),[h,x,v]),c.jsxs(c.Fragment,{children:[c.jsx(ze.span,{id:u.textId,...s,ref:m}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Rr.createPortal(s.children,a.valueNode):null]})});zl.displayName=dr;var Gl="SelectItemIndicator",Kl=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Hl(Gl,r).isSelected?c.jsx(ze.span,{"aria-hidden":!0,...n,ref:t}):null});Kl.displayName=Gl;var yo="SelectScrollUpButton",Yl=l.forwardRef((e,t)=>{const r=Rt(yo,e.__scopeSelect),n=ts(yo,e.__scopeSelect),[o,s]=l.useState(!1),a=se(t,n.onScrollButtonChange);return Ee(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=u.scrollTop>0;s(d)};const u=r.viewport;return i(),u.addEventListener("scroll",i),()=>u.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),o?c.jsx(Xl,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:u}=r;i&&u&&(i.scrollTop=i.scrollTop-u.offsetHeight)}}):null});Yl.displayName=yo;var bo="SelectScrollDownButton",ql=l.forwardRef((e,t)=>{const r=Rt(bo,e.__scopeSelect),n=ts(bo,e.__scopeSelect),[o,s]=l.useState(!1),a=se(t,n.onScrollButtonChange);return Ee(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<d;s(p)};const u=r.viewport;return i(),u.addEventListener("scroll",i),()=>u.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),o?c.jsx(Xl,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:u}=r;i&&u&&(i.scrollTop=i.scrollTop+u.offsetHeight)}}):null});ql.displayName=bo;var Xl=l.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,s=Rt("SelectScrollButton",r),a=l.useRef(null),i=Nn(r),u=l.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return l.useEffect(()=>()=>u(),[u]),Ee(()=>{var p;const d=i().find(f=>f.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[i]),c.jsx(ze.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:G(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:G(o.onPointerMove,()=>{var d;(d=s.onItemLeave)==null||d.call(s),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:G(o.onPointerLeave,()=>{u()})})}),yx="SelectSeparator",Zl=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c.jsx(ze.div,{"aria-hidden":!0,...n,ref:t})});Zl.displayName=yx;var wo="SelectArrow",bx=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Rn(r),s=Nt(wo,r),a=Rt(wo,r);return s.open&&a.position==="popper"?c.jsx(Jo,{...o,...n,ref:t}):null});bx.displayName=wo;var wx="SelectBubbleInput",Ql=l.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=l.useRef(null),s=se(n,o),a=Io(t);return l.useEffect(()=>{const i=o.current;if(!i)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==t&&p){const f=new Event("change",{bubbles:!0});p.call(i,t),i.dispatchEvent(f)}},[a,t]),c.jsx(ze.select,{...r,style:{...vl,...r.style},ref:s,defaultValue:t})});Ql.displayName=wx;function Jl(e){return e===""||e===void 0}function ec(e){const t=Re(e),r=l.useRef(""),n=l.useRef(0),o=l.useCallback(a=>{const i=r.current+a;t(i),function u(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>u(""),1e3))}(i)},[t]),s=l.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function tc(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let a=Sx(e,Math.max(s,0));o.length===1&&(a=a.filter(d=>d!==r));const u=a.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==r?u:void 0}function Sx(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Cx=jl,rc=Pl,Ex=Tl,Nx=Ml,Rx=Dl,nc=Il,jx=Ll,_x=Vl,oc=Bl,sc=Ul,Px=zl,Ax=Kl,ic=Yl,ac=ql,lc=Zl;const rs=Cx,Tx=_x,ns=Ex,jn=l.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(rc,{ref:n,className:A("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,c.jsx(Nx,{asChild:!0,children:c.jsx(To,{className:"h-4 w-4 opacity-50"})})]}));jn.displayName=rc.displayName;const os=l.forwardRef(({className:e,...t},r)=>c.jsx(ic,{ref:r,className:A("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Np,{className:"h-4 w-4"})}));os.displayName=ic.displayName;const ss=l.forwardRef(({className:e,...t},r)=>c.jsx(ac,{ref:r,className:A("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(To,{className:"h-4 w-4"})}));ss.displayName=ac.displayName;const _n=l.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>c.jsx(Rx,{children:c.jsxs(nc,{ref:o,className:A("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[c.jsx(os,{}),c.jsx(jx,{className:A("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(ss,{})]})}));_n.displayName=nc.displayName;const cc=l.forwardRef(({className:e,...t},r)=>c.jsx(oc,{ref:r,className:A("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));cc.displayName=oc.displayName;const Pn=l.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(sc,{ref:n,className:A("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Ax,{children:c.jsx(vr,{className:"h-4 w-4"})})}),c.jsx(Px,{children:t})]}));Pn.displayName=sc.displayName;const uc=l.forwardRef(({className:e,...t},r)=>c.jsx(lc,{ref:r,className:A("-mx-1 my-1 h-px bg-muted",e),...t}));uc.displayName=lc.displayName;function Mx(e,t){const r=l.createContext(t),n=s=>{const{children:a,...i}=s,u=l.useMemo(()=>i,Object.values(i));return c.jsx(r.Provider,{value:u,children:a})};n.displayName=e+"Provider";function o(s){const a=l.useContext(r);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,o]}function Dx(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a),u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,Ix(o,...t)]}function Ix(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function dc(e){const t=kx(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find($x);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function kx(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=Fx(o),i=Lx(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ox=Symbol("radix.slottable");function $x(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ox}function Lx(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Fx(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Vx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Mr=Vx.reduce((e,t)=>{const r=dc(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),An="Dialog",[fc]=Dx(An),[Wx,rt]=fc(An),pc=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,i=l.useRef(null),u=l.useRef(null),[d,p]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:An});return c.jsx(Wx,{scope:t,triggerRef:i,contentRef:u,contentId:He(),titleId:He(),descriptionId:He(),open:d,onOpenChange:p,onOpenToggle:l.useCallback(()=>p(f=>!f),[p]),modal:a,children:r})};pc.displayName=An;var mc="DialogTrigger",hc=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=rt(mc,r),s=se(t,o.triggerRef);return c.jsx(Mr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ls(o.open),...n,ref:s,onClick:G(e.onClick,o.onOpenToggle)})});hc.displayName=mc;var is="DialogPortal",[Bx,gc]=fc(is,{forceMount:void 0}),vc=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=rt(is,t);return c.jsx(Bx,{scope:t,forceMount:r,children:l.Children.map(n,a=>c.jsx(Ie,{present:r||s.open,children:c.jsx(wn,{asChild:!0,container:o,children:a})}))})};vc.displayName=is;var rn="DialogOverlay",xc=l.forwardRef((e,t)=>{const r=gc(rn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=rt(rn,e.__scopeDialog);return s.modal?c.jsx(Ie,{present:n||s.open,children:c.jsx(Ux,{...o,ref:t})}):null});xc.displayName=rn;var Hx=dc("DialogOverlay.RemoveScroll"),Ux=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=rt(rn,r);return c.jsx(Cn,{as:Hx,allowPinchZoom:!0,shards:[o.contentRef],children:c.jsx(Mr.div,{"data-state":ls(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),kt="DialogContent",yc=l.forwardRef((e,t)=>{const r=gc(kt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=rt(kt,e.__scopeDialog);return c.jsx(Ie,{present:n||s.open,children:s.modal?c.jsx(zx,{...o,ref:t}):c.jsx(Gx,{...o,ref:t})})});yc.displayName=kt;var zx=l.forwardRef((e,t)=>{const r=rt(kt,e.__scopeDialog),n=l.useRef(null),o=se(t,r.contentRef,n);return l.useEffect(()=>{const s=n.current;if(s)return es(s)},[]),c.jsx(bc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&s.preventDefault()}),onFocusOutside:G(e.onFocusOutside,s=>s.preventDefault())})}),Gx=l.forwardRef((e,t)=>{const r=rt(kt,e.__scopeDialog),n=l.useRef(!1),o=l.useRef(!1);return c.jsx(bc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),bc=l.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,i=rt(kt,r),u=l.useRef(null),d=se(t,u);return Bo(),c.jsxs(c.Fragment,{children:[c.jsx(hn,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:c.jsx(Ar,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":ls(i.open),...a,ref:d,onDismiss:()=>i.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(Kx,{titleId:i.titleId}),c.jsx(qx,{contentRef:u,descriptionId:i.descriptionId})]})]})}),as="DialogTitle",wc=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=rt(as,r);return c.jsx(Mr.h2,{id:o.titleId,...n,ref:t})});wc.displayName=as;var Sc="DialogDescription",Cc=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=rt(Sc,r);return c.jsx(Mr.p,{id:o.descriptionId,...n,ref:t})});Cc.displayName=Sc;var Ec="DialogClose",Nc=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=rt(Ec,r);return c.jsx(Mr.button,{type:"button",...n,ref:t,onClick:G(e.onClick,()=>o.onOpenChange(!1))})});Nc.displayName=Ec;function ls(e){return e?"open":"closed"}var Rc="DialogTitleWarning",[XS,jc]=Mx(Rc,{contentName:kt,titleName:as,docsSlug:"dialog"}),Kx=({titleId:e})=>{const t=jc(Rc),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
217
217
|
|
|
218
218
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
219
219
|
|
|
220
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Yy="DialogDescriptionWarning",qy=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Nc(Yy).contentName}}.`;return l.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Xy=dc,Zy=pc,Qy=hc,Rc=gc,_c=vc,Pc=xc,jc=wc,Ac=Cc;const Tc=Xy,Jy=Zy,Mc=Qy,ex=Ac,is=l.forwardRef(({className:e,...t},r)=>u.jsx(Rc,{ref:r,className:M("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));is.displayName=Rc.displayName;const as=l.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(Mc,{children:[u.jsx(is,{}),u.jsxs(_c,{ref:n,className:M("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,u.jsxs(Ac,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(ln,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));as.displayName=_c.displayName;const ls=({className:e,...t})=>u.jsx("div",{className:M("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ls.displayName="DialogHeader";const Pn=({className:e,...t})=>u.jsx("div",{className:M("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Pn.displayName="DialogFooter";const cs=l.forwardRef(({className:e,...t},r)=>u.jsx(Pc,{ref:r,className:M("text-lg font-semibold leading-none tracking-tight",e),...t}));cs.displayName=Pc.displayName;const us=l.forwardRef(({className:e,...t},r)=>u.jsx(jc,{ref:r,className:M("text-sm text-muted-foreground",e),...t}));us.displayName=jc.displayName;function tx(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,rx(o,...t)]}function rx(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function nx(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,ox(o,...t)]}function ox(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function sx(e){const t=ix(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(lx);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function ix(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=ux(o),a=cx(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ax=Symbol("radix.slottable");function lx(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ax}function cx(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function ux(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var dx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dc=dx.reduce((e,t)=>{const r=sx(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),ro="rovingFocusGroup.onEntryFocus",fx={bubbles:!1,cancelable:!0},_r="RovingFocusGroup",[xo,Ic,px]=Lo(_r),[mx,jn]=nx(_r,[px]),[hx,gx]=mx(_r),kc=l.forwardRef((e,t)=>u.jsx(xo.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(xo.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(vx,{...e,ref:t})})}));kc.displayName=_r;var vx=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...f}=e,m=l.useRef(null),g=oe(t,m),v=Cr(s),[h,y]=tt({prop:i,defaultProp:a??null,onChange:c,caller:_r}),[x,b]=l.useState(!1),w=Ce(d),S=Ic(r),E=l.useRef(!1),[j,_]=l.useState(0);return l.useEffect(()=>{const I=m.current;if(I)return I.addEventListener(ro,w),()=>I.removeEventListener(ro,w)},[w]),u.jsx(hx,{scope:r,orientation:n,dir:v,loop:o,currentTabStopId:h,onItemFocus:l.useCallback(I=>y(I),[y]),onItemShiftTab:l.useCallback(()=>b(!0),[]),onFocusableItemAdd:l.useCallback(()=>_(I=>I+1),[]),onFocusableItemRemove:l.useCallback(()=>_(I=>I-1),[]),children:u.jsx(Dc.div,{tabIndex:x||j===0?-1:0,"data-orientation":n,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:z(e.onMouseDown,()=>{E.current=!0}),onFocus:z(e.onFocus,I=>{const D=!E.current;if(I.target===I.currentTarget&&D&&!x){const O=new CustomEvent(ro,fx);if(I.currentTarget.dispatchEvent(O),!O.defaultPrevented){const A=S().filter(H=>H.focusable),R=A.find(H=>H.active),W=A.find(H=>H.id===h),q=[R,W,...A].filter(Boolean).map(H=>H.ref.current);Lc(q,p)}}E.current=!1}),onBlur:z(e.onBlur,()=>b(!1))})})}),Oc="RovingFocusGroupItem",$c=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=Oe(),d=s||c,p=gx(Oc,r),f=p.currentTabStopId===d,m=Ic(r),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:h}=p;return l.useEffect(()=>{if(n)return g(),()=>v()},[n,g,v]),u.jsx(xo.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:u.jsx(Dc.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...a,ref:t,onMouseDown:z(e.onMouseDown,y=>{n?p.onItemFocus(d):y.preventDefault()}),onFocus:z(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:z(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){p.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=bx(y,p.orientation,p.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=m().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const S=w.indexOf(y.currentTarget);w=p.loop?wx(w,S+1):w.slice(S+1)}setTimeout(()=>Lc(w))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:h!=null}):i})})});$c.displayName=Oc;var yx={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xx(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function bx(e,t,r){const n=xx(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return yx[n]}function Lc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function wx(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Fc=kc,Vc=$c;function Sx(e){const t=Cx(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(Nx);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Cx(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=_x(o),a=Rx(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ex=Symbol("radix.slottable");function Nx(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ex}function Rx(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function _x(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Px=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],An=Px.reduce((e,t)=>{const r=Sx(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Tn="Tabs",[jx]=tx(Tn,[jn]),Wc=jn(),[Ax,ds]=jx(Tn),Bc=l.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:c="automatic",...d}=e,p=Cr(a),[f,m]=tt({prop:n,onChange:o,defaultProp:s??"",caller:Tn});return u.jsx(Ax,{scope:r,baseId:Oe(),value:f,onValueChange:m,orientation:i,dir:p,activationMode:c,children:u.jsx(An.div,{dir:p,"data-orientation":i,...d,ref:t})})});Bc.displayName=Tn;var Hc="TabsList",Uc=l.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,s=ds(Hc,r),i=Wc(r);return u.jsx(Fc,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:n,children:u.jsx(An.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Uc.displayName=Hc;var zc="TabsTrigger",Gc=l.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...s}=e,i=ds(zc,r),a=Wc(r),c=qc(i.baseId,n),d=Xc(i.baseId,n),p=n===i.value;return u.jsx(Vc,{asChild:!0,...a,focusable:!o,active:p,children:u.jsx(An.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:z(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?i.onValueChange(n):f.preventDefault()}),onKeyDown:z(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(n)}),onFocus:z(e.onFocus,()=>{const f=i.activationMode!=="manual";!p&&!o&&f&&i.onValueChange(n)})})})});Gc.displayName=zc;var Kc="TabsContent",Yc=l.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:s,...i}=e,a=ds(Kc,r),c=qc(a.baseId,n),d=Xc(a.baseId,n),p=n===a.value,f=l.useRef(p);return l.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),u.jsx(Te,{present:o||p,children:({present:m})=>u.jsx(An.div,{"data-state":p?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&s})})});Yc.displayName=Kc;function qc(e,t){return`${e}-trigger-${t}`}function Xc(e,t){return`${e}-content-${t}`}var Tx=Bc,Zc=Uc,Qc=Gc,Jc=Yc;const Mx=Tx,eu=l.forwardRef(({className:e,...t},r)=>u.jsx(Zc,{ref:r,className:M("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));eu.displayName=Zc.displayName;const tu=l.forwardRef(({className:e,...t},r)=>u.jsx(Qc,{ref:r,className:M("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));tu.displayName=Qc.displayName;const ru=l.forwardRef(({className:e,...t},r)=>u.jsx(Jc,{ref:r,className:M("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ru.displayName=Jc.displayName;const nu=({tabs:e,defaultValue:t,value:r,onChange:n,className:o,tabsListClassName:s,tabsTriggerClassName:i,tabsContentClassName:a,...c})=>{var m;const[d,p]=l.useState(r||t||((m=e[0])==null?void 0:m.value));l.useEffect(()=>{r!==void 0&&p(r)},[r]);const f=g=>{p(g),n==null||n(g)};return u.jsxs("div",{className:M("w-full",o),...c,children:[u.jsx("div",{className:M("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),role:"tablist",children:e.map(g=>u.jsxs("button",{role:"tab","aria-selected":d===g.value,"aria-controls":`tabpanel-${g.value}`,onClick:()=>f(g.value),disabled:g.disabled,className:M("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",d===g.value?"bg-background text-foreground shadow-sm":"hover:bg-background/50",i),children:[g.icon&&u.jsx("span",{className:"mr-2",children:g.icon}),g.label,g.badge&&u.jsx("span",{className:"ml-2 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:g.badge})]},g.value))}),e.map(g=>u.jsx("div",{id:`tabpanel-${g.value}`,role:"tabpanel","aria-labelledby":g.value,hidden:d!==g.value,className:M("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),children:d===g.value&&g.content},g.value))]})};nu.displayName="QTabs";function Dx(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i);a.displayName=s+"Context";const c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,Ix(o,...t)]}function Ix(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var bo={exports:{}},no={};/**
|
|
220
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Yx="DialogDescriptionWarning",qx=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jc(Yx).contentName}}.`;return l.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Xx=pc,Zx=hc,Qx=vc,_c=xc,Pc=yc,Ac=wc,Tc=Cc,Mc=Nc;const Dc=Xx,Jx=Zx,Ic=Qx,ey=Mc,cs=l.forwardRef(({className:e,...t},r)=>c.jsx(_c,{ref:r,className:A("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));cs.displayName=_c.displayName;const us=l.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Ic,{children:[c.jsx(cs,{}),c.jsxs(Pc,{ref:n,className:A("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,c.jsxs(Mc,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[c.jsx(xr,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));us.displayName=Pc.displayName;const ds=({className:e,...t})=>c.jsx("div",{className:A("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ds.displayName="DialogHeader";const Tn=({className:e,...t})=>c.jsx("div",{className:A("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Tn.displayName="DialogFooter";const fs=l.forwardRef(({className:e,...t},r)=>c.jsx(Ac,{ref:r,className:A("text-lg font-semibold leading-none tracking-tight",e),...t}));fs.displayName=Ac.displayName;const ps=l.forwardRef(({className:e,...t},r)=>c.jsx(Tc,{ref:r,className:A("text-sm text-muted-foreground",e),...t}));ps.displayName=Tc.displayName;function ty(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a),u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,ry(o,...t)]}function ry(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function ny(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a),u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,oy(o,...t)]}function oy(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function sy(e){const t=iy(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(ly);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function iy(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=uy(o),i=cy(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ay=Symbol("radix.slottable");function ly(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ay}function cy(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function uy(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var dy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kc=dy.reduce((e,t)=>{const r=sy(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),no="rovingFocusGroup.onEntryFocus",fy={bubbles:!1,cancelable:!0},Dr="RovingFocusGroup",[So,Oc,py]=Wo(Dr),[my,Mn]=ny(Dr,[py]),[hy,gy]=my(Dr),$c=l.forwardRef((e,t)=>c.jsx(So.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(So.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(vy,{...e,ref:t})})}));$c.displayName=Dr;var vy=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...f}=e,m=l.useRef(null),g=se(t,m),v=Pr(s),[h,x]=lt({prop:a,defaultProp:i??null,onChange:u,caller:Dr}),[y,b]=l.useState(!1),S=Re(d),C=Oc(r),E=l.useRef(!1),[_,R]=l.useState(0);return l.useEffect(()=>{const k=m.current;if(k)return k.addEventListener(no,S),()=>k.removeEventListener(no,S)},[S]),c.jsx(hy,{scope:r,orientation:n,dir:v,loop:o,currentTabStopId:h,onItemFocus:l.useCallback(k=>x(k),[x]),onItemShiftTab:l.useCallback(()=>b(!0),[]),onFocusableItemAdd:l.useCallback(()=>R(k=>k+1),[]),onFocusableItemRemove:l.useCallback(()=>R(k=>k-1),[]),children:c.jsx(kc.div,{tabIndex:y||_===0?-1:0,"data-orientation":n,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:G(e.onMouseDown,()=>{E.current=!0}),onFocus:G(e.onFocus,k=>{const M=!E.current;if(k.target===k.currentTarget&&M&&!y){const O=new CustomEvent(no,fy);if(k.currentTarget.dispatchEvent(O),!O.defaultPrevented){const V=C().filter(H=>H.focusable),P=V.find(H=>H.active),$=V.find(H=>H.id===h),X=[P,$,...V].filter(Boolean).map(H=>H.ref.current);Vc(X,p)}}E.current=!1}),onBlur:G(e.onBlur,()=>b(!1))})})}),Lc="RovingFocusGroupItem",Fc=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:a,...i}=e,u=He(),d=s||u,p=gy(Lc,r),f=p.currentTabStopId===d,m=Oc(r),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:h}=p;return l.useEffect(()=>{if(n)return g(),()=>v()},[n,g,v]),c.jsx(So.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:c.jsx(kc.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...i,ref:t,onMouseDown:G(e.onMouseDown,x=>{n?p.onItemFocus(d):x.preventDefault()}),onFocus:G(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:G(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){p.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=by(x,p.orientation,p.dir);if(y!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let S=m().filter(C=>C.focusable).map(C=>C.ref.current);if(y==="last")S.reverse();else if(y==="prev"||y==="next"){y==="prev"&&S.reverse();const C=S.indexOf(x.currentTarget);S=p.loop?wy(S,C+1):S.slice(C+1)}setTimeout(()=>Vc(S))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:h!=null}):a})})});Fc.displayName=Lc;var xy={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yy(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function by(e,t,r){const n=yy(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return xy[n]}function Vc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function wy(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Wc=$c,Bc=Fc;function Sy(e){const t=Cy(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(Ny);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Cy(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=jy(o),i=Ry(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ey=Symbol("radix.slottable");function Ny(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ey}function Ry(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function jy(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var _y=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dn=_y.reduce((e,t)=>{const r=Sy(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),In="Tabs",[Py]=ty(In,[Mn]),Hc=Mn(),[Ay,ms]=Py(In),Uc=l.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:s,orientation:a="horizontal",dir:i,activationMode:u="automatic",...d}=e,p=Pr(i),[f,m]=lt({prop:n,onChange:o,defaultProp:s??"",caller:In});return c.jsx(Ay,{scope:r,baseId:He(),value:f,onValueChange:m,orientation:a,dir:p,activationMode:u,children:c.jsx(Dn.div,{dir:p,"data-orientation":a,...d,ref:t})})});Uc.displayName=In;var zc="TabsList",Gc=l.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,s=ms(zc,r),a=Hc(r);return c.jsx(Wc,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:n,children:c.jsx(Dn.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Gc.displayName=zc;var Kc="TabsTrigger",Yc=l.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...s}=e,a=ms(Kc,r),i=Hc(r),u=Zc(a.baseId,n),d=Qc(a.baseId,n),p=n===a.value;return c.jsx(Bc,{asChild:!0,...i,focusable:!o,active:p,children:c.jsx(Dn.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...s,ref:t,onMouseDown:G(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?a.onValueChange(n):f.preventDefault()}),onKeyDown:G(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(n)}),onFocus:G(e.onFocus,()=>{const f=a.activationMode!=="manual";!p&&!o&&f&&a.onValueChange(n)})})})});Yc.displayName=Kc;var qc="TabsContent",Xc=l.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:s,...a}=e,i=ms(qc,r),u=Zc(i.baseId,n),d=Qc(i.baseId,n),p=n===i.value,f=l.useRef(p);return l.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),c.jsx(Ie,{present:o||p,children:({present:m})=>c.jsx(Dn.div,{"data-state":p?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:d,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&s})})});Xc.displayName=qc;function Zc(e,t){return`${e}-trigger-${t}`}function Qc(e,t){return`${e}-content-${t}`}var Ty=Uc,Jc=Gc,eu=Yc,tu=Xc;const My=Ty,ru=l.forwardRef(({className:e,...t},r)=>c.jsx(Jc,{ref:r,className:A("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));ru.displayName=Jc.displayName;const nu=l.forwardRef(({className:e,...t},r)=>c.jsx(eu,{ref:r,className:A("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));nu.displayName=eu.displayName;const ou=l.forwardRef(({className:e,...t},r)=>c.jsx(tu,{ref:r,className:A("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ou.displayName=tu.displayName;const su=({tabs:e,defaultValue:t,value:r,onChange:n,className:o,tabsListClassName:s,tabsTriggerClassName:a,tabsContentClassName:i,...u})=>{var m;const[d,p]=l.useState(r||t||((m=e[0])==null?void 0:m.value));l.useEffect(()=>{r!==void 0&&p(r)},[r]);const f=g=>{p(g),n==null||n(g)};return c.jsxs("div",{className:A("w-full",o),...u,children:[c.jsx("div",{className:A("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),role:"tablist",children:e.map(g=>c.jsxs("button",{role:"tab","aria-selected":d===g.value,"aria-controls":`tabpanel-${g.value}`,onClick:()=>f(g.value),disabled:g.disabled,className:A("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",d===g.value?"bg-background text-foreground shadow-sm":"hover:bg-background/50",a),children:[g.icon&&c.jsx("span",{className:"mr-2",children:g.icon}),g.label,g.badge&&c.jsx("span",{className:"ml-2 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:g.badge})]},g.value))}),e.map(g=>c.jsx("div",{id:`tabpanel-${g.value}`,role:"tabpanel","aria-labelledby":g.value,hidden:d!==g.value,className:A("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",i),children:d===g.value&&g.content},g.value))]})};su.displayName="QTabs";function Dy(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a);i.displayName=s+"Context";const u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,Iy(o,...t)]}function Iy(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}var Co={exports:{}},oo={};/**
|
|
221
221
|
* @license React
|
|
222
222
|
* use-sync-external-store-shim.production.js
|
|
223
223
|
*
|
|
@@ -225,7 +225,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
225
225
|
*
|
|
226
226
|
* This source code is licensed under the MIT license found in the
|
|
227
227
|
* LICENSE file in the root directory of this source tree.
|
|
228
|
-
*/var
|
|
228
|
+
*/var Hi;function ky(){if(Hi)return oo;Hi=1;var e=pe;function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function i(f,m){var g=m(),v=n({inst:{value:g,getSnapshot:m}}),h=v[0].inst,x=v[1];return s(function(){h.value=g,h.getSnapshot=m,u(h)&&x({inst:h})},[f,g,m]),o(function(){return u(h)&&x({inst:h}),f(function(){u(h)&&x({inst:h})})},[f]),a(g),g}function u(f){var m=f.getSnapshot;f=f.value;try{var g=m();return!r(f,g)}catch{return!0}}function d(f,m){return m()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:i;return oo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,oo}var so={};/**
|
|
229
229
|
* @license React
|
|
230
230
|
* use-sync-external-store-shim.development.js
|
|
231
231
|
*
|
|
@@ -233,5 +233,5 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
233
233
|
*
|
|
234
234
|
* This source code is licensed under the MIT license found in the
|
|
235
235
|
* LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/var Vi;function Ox(){return Vi||(Vi=1,process.env.NODE_ENV!=="production"&&function(){function e(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}function t(g,v){p||o.startTransition===void 0||(p=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=v();if(!f){var y=v();s(h,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}y=i({inst:{value:h,getSnapshot:v}});var x=y[0].inst,b=y[1];return c(function(){x.value=h,x.getSnapshot=v,r(x)&&b({inst:x})},[g,h,v]),a(function(){return r(x)&&b({inst:x}),g(function(){r(x)&&b({inst:x})})},[g]),d(h),h}function r(g){var v=g.getSnapshot;g=g.value;try{var h=v();return!s(g,h)}catch{return!0}}function n(g,v){return v()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=le,s=typeof Object.is=="function"?Object.is:e,i=o.useState,a=o.useEffect,c=o.useLayoutEffect,d=o.useDebugValue,p=!1,f=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;oo.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),oo}process.env.NODE_ENV==="production"?bo.exports=kx():bo.exports=Ox();var $x=bo.exports;function Lx(){return $x.useSyncExternalStore(Fx,()=>!0,()=>!1)}function Fx(){return()=>{}}var fs="Avatar",[Vx]=Dx(fs),[Wx,ou]=Vx(fs),su=l.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[o,s]=l.useState("idle");return u.jsx(Wx,{scope:r,imageLoadingStatus:o,onImageLoadingStatusChange:s,children:u.jsx(wr.span,{...n,ref:t})})});su.displayName=fs;var iu="AvatarImage",au=l.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:o=()=>{},...s}=e,i=ou(iu,r),a=Bx(n,s),c=Ce(d=>{o(d),i.onImageLoadingStatusChange(d)});return we(()=>{a!=="idle"&&c(a)},[a,c]),a==="loaded"?u.jsx(wr.img,{...s,ref:t,src:n}):null});au.displayName=iu;var lu="AvatarFallback",cu=l.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...o}=e,s=ou(lu,r),[i,a]=l.useState(n===void 0);return l.useEffect(()=>{if(n!==void 0){const c=window.setTimeout(()=>a(!0),n);return()=>window.clearTimeout(c)}},[n]),i&&s.imageLoadingStatus!=="loaded"?u.jsx(wr.span,{...o,ref:t}):null});cu.displayName=lu;function Wi(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Bx(e,{referrerPolicy:t,crossOrigin:r}){const n=Lx(),o=l.useRef(null),s=n?(o.current||(o.current=new window.Image),o.current):null,[i,a]=l.useState(()=>Wi(s,e));return we(()=>{a(Wi(s,e))},[s,e]),we(()=>{const c=f=>()=>{a(f)};if(!s)return;const d=c("loaded"),p=c("error");return s.addEventListener("load",d),s.addEventListener("error",p),t&&(s.referrerPolicy=t),typeof r=="string"&&(s.crossOrigin=r),()=>{s.removeEventListener("load",d),s.removeEventListener("error",p)}},[s,r,t]),i}var uu=su,du=au,fu=cu;const pu=l.forwardRef(({className:e,...t},r)=>u.jsx(uu,{ref:r,className:M("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));pu.displayName=uu.displayName;const mu=l.forwardRef(({className:e,...t},r)=>u.jsx(du,{ref:r,className:M("aspect-square h-full w-full",e),...t}));mu.displayName=du.displayName;const hu=l.forwardRef(({className:e,...t},r)=>u.jsx(fu,{ref:r,className:M("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));hu.displayName=fu.displayName;function Hx(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,Ux(o,...t)]}function Ux(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function zx(e){const t=Gx(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(Yx);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Gx(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Xx(o),a=qx(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gu=Symbol("radix.slottable");function Kx(e){const t=({children:r})=>u.jsx(u.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=gu,t}function Yx(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gu}function qx(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Xx(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Zx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qx=Zx.reduce((e,t)=>{const r=zx(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),[Mn]=Hx("Tooltip",[Xt]),Dn=Xt(),vu="TooltipProvider",Jx=700,wo="tooltip.open",[eb,ps]=Mn(vu),yu=e=>{const{__scopeTooltip:t,delayDuration:r=Jx,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:s}=e,i=l.useRef(!0),a=l.useRef(!1),c=l.useRef(0);return l.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),u.jsx(eb,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:l.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:l.useCallback(d=>{a.current=d},[]),disableHoverableContent:o,children:s})};yu.displayName=vu;var mr="Tooltip",[tb,In]=Mn(mr),xu=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=ps(mr,e.__scopeTooltip),d=Dn(t),[p,f]=l.useState(null),m=Oe(),g=l.useRef(0),v=i??c.disableHoverableContent,h=a??c.delayDuration,y=l.useRef(!1),[x,b]=tt({prop:n,defaultProp:o??!1,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(wo))):c.onClose(),s==null||s(_)},caller:mr}),w=l.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),S=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,b(!0)},[b]),E=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,b(!1)},[b]),j=l.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,b(!0),g.current=0},h)},[h,b]);return l.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),u.jsx(vn,{...d,children:u.jsx(tb,{scope:t,contentId:m,open:x,stateAttribute:w,trigger:p,onTriggerChange:f,onTriggerEnter:l.useCallback(()=>{c.isOpenDelayedRef.current?j():S()},[c.isOpenDelayedRef,j,S]),onTriggerLeave:l.useCallback(()=>{v?E():(window.clearTimeout(g.current),g.current=0)},[E,v]),onOpen:S,onClose:E,disableHoverableContent:v,children:r})})};xu.displayName=mr;var So="TooltipTrigger",bu=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=In(So,r),s=ps(So,r),i=Dn(r),a=l.useRef(null),c=oe(t,a,o.onTriggerChange),d=l.useRef(!1),p=l.useRef(!1),f=l.useCallback(()=>d.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),u.jsx(Yo,{asChild:!0,...i,children:u.jsx(Qx.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:c,onPointerMove:z(e.onPointerMove,m=>{m.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:z(e.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:z(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:z(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:z(e.onBlur,o.onClose),onClick:z(e.onClick,o.onClose)})})});bu.displayName=So;var rb="TooltipPortal",[ZS,nb]=Mn(rb,{forceMount:void 0}),zt="TooltipContent",wu=l.forwardRef((e,t)=>{const r=nb(zt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...s}=e,i=In(zt,e.__scopeTooltip);return u.jsx(Te,{present:n||i.open,children:i.disableHoverableContent?u.jsx(Su,{side:o,...s,ref:t}):u.jsx(ob,{side:o,...s,ref:t})})}),ob=l.forwardRef((e,t)=>{const r=In(zt,e.__scopeTooltip),n=ps(zt,e.__scopeTooltip),o=l.useRef(null),s=oe(t,o),[i,a]=l.useState(null),{trigger:c,onClose:d}=r,p=o.current,{onPointerInTransitChange:f}=n,m=l.useCallback(()=>{a(null),f(!1)},[f]),g=l.useCallback((v,h)=>{const y=v.currentTarget,x={x:v.clientX,y:v.clientY},b=cb(x,y.getBoundingClientRect()),w=ub(x,b),S=db(h.getBoundingClientRect()),E=pb([...w,...S]);a(E),f(!0)},[f]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(c&&p){const v=y=>g(y,p),h=y=>g(y,c);return c.addEventListener("pointerleave",v),p.addEventListener("pointerleave",h),()=>{c.removeEventListener("pointerleave",v),p.removeEventListener("pointerleave",h)}}},[c,p,g,m]),l.useEffect(()=>{if(i){const v=h=>{const y=h.target,x={x:h.clientX,y:h.clientY},b=(c==null?void 0:c.contains(y))||(p==null?void 0:p.contains(y)),w=!fb(x,i);b?m():w&&(m(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,p,i,d,m]),u.jsx(Su,{...e,ref:s})}),[sb,ib]=Mn(mr,{isInside:!1}),ab=Kx("TooltipContent"),Su=l.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=In(zt,r),d=Dn(r),{onClose:p}=c;return l.useEffect(()=>(document.addEventListener(wo,p),()=>document.removeEventListener(wo,p)),[p]),l.useEffect(()=>{if(c.trigger){const f=m=>{const g=m.target;g!=null&&g.contains(c.trigger)&&p()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,p]),u.jsx(Er,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:p,children:u.jsxs(qo,{"data-state":c.stateAttribute,...d,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(ab,{children:n}),u.jsx(sb,{scope:r,isInside:!0,children:u.jsx(vv,{id:c.contentId,role:"tooltip",children:o||n})})]})})});wu.displayName=zt;var Cu="TooltipArrow",lb=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Dn(r);return ib(Cu,r).isInside?null:u.jsx(Xo,{...o,...n,ref:t})});lb.displayName=Cu;function cb(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,o,s)){case s:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function ub(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function db(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function fb(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],d=a.x,p=a.y,f=c.x,m=c.y;p>n!=m>n&&r<(f-d)*(n-p)/(m-p)+d&&(o=!o)}return o}function pb(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),mb(t)}function mb(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const s=r[r.length-1],i=r[r.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var hb=yu,gb=xu,vb=bu,Eu=wu;const yb=hb,xb=gb,bb=vb,Nu=l.forwardRef(({className:e,sideOffset:t=4,...r},n)=>u.jsx(Eu,{ref:n,sideOffset:t,className:M("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...r}));Nu.displayName=Eu.displayName;function wb(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,Sb(o,...t)]}function Sb(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function Cb(e){const t=Eb(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(Rb);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Eb(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Pb(o),a=_b(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Nb=Symbol("radix.slottable");function Rb(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nb}function _b(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Pb(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var jb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ab=jb.reduce((e,t)=>{const r=Cb(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Tb(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,Mb(o,...t)]}function Mb(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function Ru(e){const t=Db(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(kb);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Db(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=$b(o),a=Ob(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ib=Symbol("radix.slottable");function kb(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ib}function Ob(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function $b(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Lb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pr=Lb.reduce((e,t)=>{const r=Ru(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Fb(e,t){e&&vr.flushSync(()=>e.dispatchEvent(t))}var Co=["Enter"," "],Vb=["ArrowDown","PageUp","Home"],_u=["ArrowUp","PageDown","End"],Wb=[...Vb,..._u],Bb={ltr:[...Co,"ArrowRight"],rtl:[...Co,"ArrowLeft"]},Hb={ltr:["ArrowLeft"],rtl:["ArrowRight"]},jr="Menu",[hr,Ub,zb]=Lo(jr),[Tt,Pu]=Tb(jr,[zb,Xt,jn]),Ar=Xt(),ju=jn(),[Au,Ct]=Tt(jr),[Gb,Tr]=Tt(jr),Tu=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:s,modal:i=!0}=e,a=Ar(t),[c,d]=l.useState(null),p=l.useRef(!1),f=Ce(s),m=Cr(o);return l.useEffect(()=>{const g=()=>{p.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>p.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),u.jsx(vn,{...a,children:u.jsx(Au,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:d,children:u.jsx(Gb,{scope:t,onClose:l.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:m,modal:i,children:n})})})};Tu.displayName=jr;var Kb="MenuAnchor",ms=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=Ar(r);return u.jsx(Yo,{...o,...n,ref:t})});ms.displayName=Kb;var hs="MenuPortal",[Yb,Mu]=Tt(hs,{forceMount:void 0}),Du=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:o}=e,s=Ct(hs,t);return u.jsx(Yb,{scope:t,forceMount:r,children:u.jsx(Te,{present:r||s.open,children:u.jsx(yn,{asChild:!0,container:o,children:n})})})};Du.displayName=hs;var Fe="MenuContent",[qb,gs]=Tt(Fe),Iu=l.forwardRef((e,t)=>{const r=Mu(Fe,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,s=Ct(Fe,e.__scopeMenu),i=Tr(Fe,e.__scopeMenu);return u.jsx(hr.Provider,{scope:e.__scopeMenu,children:u.jsx(Te,{present:n||s.open,children:u.jsx(hr.Slot,{scope:e.__scopeMenu,children:i.modal?u.jsx(Xb,{...o,ref:t}):u.jsx(Zb,{...o,ref:t})})})})}),Xb=l.forwardRef((e,t)=>{const r=Ct(Fe,e.__scopeMenu),n=l.useRef(null),o=oe(t,n);return l.useEffect(()=>{const s=n.current;if(s)return Zo(s)},[]),u.jsx(vs,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),Zb=l.forwardRef((e,t)=>{const r=Ct(Fe,e.__scopeMenu);return u.jsx(vs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Qb=Ru("MenuContent.ScrollLock"),vs=l.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:g,disableOutsideScroll:v,...h}=e,y=Ct(Fe,r),x=Tr(Fe,r),b=Ar(r),w=ju(r),S=Ub(r),[E,j]=l.useState(null),_=l.useRef(null),I=oe(t,_,y.onContentChange),D=l.useRef(0),O=l.useRef(""),A=l.useRef(0),R=l.useRef(null),W=l.useRef("right"),B=l.useRef(0),q=v?bn:l.Fragment,H=v?{as:Qb,allowPinchZoom:!0}:void 0,U=k=>{var T,Z;const ee=O.current+k,F=S().filter(K=>!K.disabled),re=document.activeElement,ce=(T=F.find(K=>K.ref.current===re))==null?void 0:T.textValue,pe=F.map(K=>K.textValue),he=uw(pe,ee,ce),ge=(Z=F.find(K=>K.textValue===he))==null?void 0:Z.ref.current;(function K(J){O.current=J,window.clearTimeout(D.current),J!==""&&(D.current=window.setTimeout(()=>K(""),1e3))})(ee),ge&&setTimeout(()=>ge.focus())};l.useEffect(()=>()=>window.clearTimeout(D.current),[]),Fo();const $=l.useCallback(k=>{var F,re;return W.current===((F=R.current)==null?void 0:F.side)&&fw(k,(re=R.current)==null?void 0:re.area)},[]);return u.jsx(qb,{scope:r,searchRef:O,onItemEnter:l.useCallback(k=>{$(k)&&k.preventDefault()},[$]),onItemLeave:l.useCallback(k=>{var ee;$(k)||((ee=_.current)==null||ee.focus(),j(null))},[$]),onTriggerLeave:l.useCallback(k=>{$(k)&&k.preventDefault()},[$]),pointerGraceTimerRef:A,onPointerGraceIntentChange:l.useCallback(k=>{R.current=k},[]),children:u.jsx(q,{...H,children:u.jsx(fn,{asChild:!0,trapped:o,onMountAutoFocus:z(s,k=>{var ee;k.preventDefault(),(ee=_.current)==null||ee.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:u.jsx(Er,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:g,children:u.jsx(Fc,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:j,onEntryFocus:z(c,k=>{x.isUsingKeyboardRef.current||k.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(qo,{role:"menu","aria-orientation":"vertical","data-state":Zu(y.open),"data-radix-menu-content":"",dir:x.dir,...b,...h,ref:I,style:{outline:"none",...h.style},onKeyDown:z(h.onKeyDown,k=>{const F=k.target.closest("[data-radix-menu-content]")===k.currentTarget,re=k.ctrlKey||k.altKey||k.metaKey,ce=k.key.length===1;F&&(k.key==="Tab"&&k.preventDefault(),!re&&ce&&U(k.key));const pe=_.current;if(k.target!==pe||!Wb.includes(k.key))return;k.preventDefault();const ge=S().filter(T=>!T.disabled).map(T=>T.ref.current);_u.includes(k.key)&&ge.reverse(),lw(ge)}),onBlur:z(e.onBlur,k=>{k.currentTarget.contains(k.target)||(window.clearTimeout(D.current),O.current="")}),onPointerMove:z(e.onPointerMove,gr(k=>{const ee=k.target,F=B.current!==k.clientX;if(k.currentTarget.contains(ee)&&F){const re=k.clientX>B.current?"right":"left";W.current=re,B.current=k.clientX}}))})})})})})})});Iu.displayName=Fe;var Jb="MenuGroup",ys=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return u.jsx(Pr.div,{role:"group",...n,ref:t})});ys.displayName=Jb;var ew="MenuLabel",ku=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return u.jsx(Pr.div,{...n,ref:t})});ku.displayName=ew;var Jr="MenuItem",Bi="menu.itemSelect",kn=l.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...o}=e,s=l.useRef(null),i=Tr(Jr,e.__scopeMenu),a=gs(Jr,e.__scopeMenu),c=oe(t,s),d=l.useRef(!1),p=()=>{const f=s.current;if(!r&&f){const m=new CustomEvent(Bi,{bubbles:!0,cancelable:!0});f.addEventListener(Bi,g=>n==null?void 0:n(g),{once:!0}),Fb(f,m),m.defaultPrevented?d.current=!1:i.onClose()}};return u.jsx(Ou,{...o,ref:c,disabled:r,onClick:z(e.onClick,p),onPointerDown:f=>{var m;(m=e.onPointerDown)==null||m.call(e,f),d.current=!0},onPointerUp:z(e.onPointerUp,f=>{var m;d.current||(m=f.currentTarget)==null||m.click()}),onKeyDown:z(e.onKeyDown,f=>{const m=a.searchRef.current!=="";r||m&&f.key===" "||Co.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});kn.displayName=Jr;var Ou=l.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:o,...s}=e,i=gs(Jr,r),a=ju(r),c=l.useRef(null),d=oe(t,c),[p,f]=l.useState(!1),[m,g]=l.useState("");return l.useEffect(()=>{const v=c.current;v&&g((v.textContent??"").trim())},[s.children]),u.jsx(hr.ItemSlot,{scope:r,disabled:n,textValue:o??m,children:u.jsx(Vc,{asChild:!0,...a,focusable:!n,children:u.jsx(Pr.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:d,onPointerMove:z(e.onPointerMove,gr(v=>{n?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,gr(v=>i.onItemLeave(v))),onFocus:z(e.onFocus,()=>f(!0)),onBlur:z(e.onBlur,()=>f(!1))})})})}),tw="MenuCheckboxItem",$u=l.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...o}=e;return u.jsx(Bu,{scope:e.__scopeMenu,checked:r,children:u.jsx(kn,{role:"menuitemcheckbox","aria-checked":en(r)?"mixed":r,...o,ref:t,"data-state":ws(r),onSelect:z(o.onSelect,()=>n==null?void 0:n(en(r)?!0:!r),{checkForDefaultPrevented:!1})})})});$u.displayName=tw;var Lu="MenuRadioGroup",[rw,nw]=Tt(Lu,{value:void 0,onValueChange:()=>{}}),Fu=l.forwardRef((e,t)=>{const{value:r,onValueChange:n,...o}=e,s=Ce(n);return u.jsx(rw,{scope:e.__scopeMenu,value:r,onValueChange:s,children:u.jsx(ys,{...o,ref:t})})});Fu.displayName=Lu;var Vu="MenuRadioItem",Wu=l.forwardRef((e,t)=>{const{value:r,...n}=e,o=nw(Vu,e.__scopeMenu),s=r===o.value;return u.jsx(Bu,{scope:e.__scopeMenu,checked:s,children:u.jsx(kn,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":ws(s),onSelect:z(n.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,r)},{checkForDefaultPrevented:!1})})})});Wu.displayName=Vu;var xs="MenuItemIndicator",[Bu,ow]=Tt(xs,{checked:!1}),Hu=l.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...o}=e,s=ow(xs,r);return u.jsx(Te,{present:n||en(s.checked)||s.checked===!0,children:u.jsx(Pr.span,{...o,ref:t,"data-state":ws(s.checked)})})});Hu.displayName=xs;var sw="MenuSeparator",Uu=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return u.jsx(Pr.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Uu.displayName=sw;var iw="MenuArrow",zu=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=Ar(r);return u.jsx(Xo,{...o,...n,ref:t})});zu.displayName=iw;var bs="MenuSub",[aw,Gu]=Tt(bs),Ku=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:o}=e,s=Ct(bs,t),i=Ar(t),[a,c]=l.useState(null),[d,p]=l.useState(null),f=Ce(o);return l.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),u.jsx(vn,{...i,children:u.jsx(Au,{scope:t,open:n,onOpenChange:f,content:d,onContentChange:p,children:u.jsx(aw,{scope:t,contentId:Oe(),triggerId:Oe(),trigger:a,onTriggerChange:c,children:r})})})};Ku.displayName=bs;var ir="MenuSubTrigger",Yu=l.forwardRef((e,t)=>{const r=Ct(ir,e.__scopeMenu),n=Tr(ir,e.__scopeMenu),o=Gu(ir,e.__scopeMenu),s=gs(ir,e.__scopeMenu),i=l.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,d={__scopeMenu:e.__scopeMenu},p=l.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return l.useEffect(()=>p,[p]),l.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),c(null)}},[a,c]),u.jsx(ms,{asChild:!0,...d,children:u.jsx(Ou,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":Zu(r.open),...e,ref:ye(t,o.onTriggerChange),onClick:f=>{var m;(m=e.onClick)==null||m.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,gr(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100))})),onPointerLeave:z(e.onPointerLeave,gr(f=>{var g,v;p();const m=(g=r.content)==null?void 0:g.getBoundingClientRect();if(m){const h=(v=r.content)==null?void 0:v.dataset.side,y=h==="right",x=y?-5:5,b=m[y?"left":"right"],w=m[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:b,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:b,y:m.bottom}],side:h}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,f=>{var g;const m=s.searchRef.current!=="";e.disabled||m&&f.key===" "||Bb[n.dir].includes(f.key)&&(r.onOpenChange(!0),(g=r.content)==null||g.focus(),f.preventDefault())})})})});Yu.displayName=ir;var qu="MenuSubContent",Xu=l.forwardRef((e,t)=>{const r=Mu(Fe,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,s=Ct(Fe,e.__scopeMenu),i=Tr(Fe,e.__scopeMenu),a=Gu(qu,e.__scopeMenu),c=l.useRef(null),d=oe(t,c);return u.jsx(hr.Provider,{scope:e.__scopeMenu,children:u.jsx(Te,{present:n||s.open,children:u.jsx(hr.Slot,{scope:e.__scopeMenu,children:u.jsx(vs,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var f;i.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:z(e.onFocusOutside,p=>{p.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,p=>{i.onClose(),p.preventDefault()}),onKeyDown:z(e.onKeyDown,p=>{var g;const f=p.currentTarget.contains(p.target),m=Hb[i.dir].includes(p.key);f&&m&&(s.onOpenChange(!1),(g=a.trigger)==null||g.focus(),p.preventDefault())})})})})})});Xu.displayName=qu;function Zu(e){return e?"open":"closed"}function en(e){return e==="indeterminate"}function ws(e){return en(e)?"indeterminate":e?"checked":"unchecked"}function lw(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function cw(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function uw(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=cw(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==r));const c=i.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function dw(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],d=a.x,p=a.y,f=c.x,m=c.y;p>n!=m>n&&r<(f-d)*(n-p)/(m-p)+d&&(o=!o)}return o}function fw(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return dw(r,t)}function gr(e){return t=>t.pointerType==="mouse"?e(t):void 0}var pw=Tu,mw=ms,hw=Du,gw=Iu,vw=ys,yw=ku,xw=kn,bw=$u,ww=Fu,Sw=Wu,Cw=Hu,Ew=Uu,Nw=zu,Rw=Ku,_w=Yu,Pw=Xu,On="DropdownMenu",[jw]=wb(On,[Pu]),je=Pu(),[Aw,Qu]=jw(On),Ju=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=je(t),d=l.useRef(null),[p,f]=tt({prop:o,defaultProp:s??!1,onChange:i,caller:On});return u.jsx(Aw,{scope:t,triggerId:Oe(),triggerRef:d,contentId:Oe(),open:p,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(m=>!m),[f]),modal:a,children:u.jsx(pw,{...c,open:p,onOpenChange:f,dir:n,modal:a,children:r})})};Ju.displayName=On;var ed="DropdownMenuTrigger",td=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...o}=e,s=Qu(ed,r),i=je(r);return u.jsx(mw,{asChild:!0,...i,children:u.jsx(Ab.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...o,ref:ye(t,s.triggerRef),onPointerDown:z(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:z(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});td.displayName=ed;var Tw="DropdownMenuPortal",rd=e=>{const{__scopeDropdownMenu:t,...r}=e,n=je(t);return u.jsx(hw,{...n,...r})};rd.displayName=Tw;var nd="DropdownMenuContent",od=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Qu(nd,r),s=je(r),i=l.useRef(!1);return u.jsx(gw,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...n,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,a=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:z(e.onInteractOutside,a=>{const c=a.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,p=c.button===2||d;(!o.modal||p)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});od.displayName=nd;var Mw="DropdownMenuGroup",sd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=je(r);return u.jsx(vw,{...o,...n,ref:t})});sd.displayName=Mw;var Dw="DropdownMenuLabel",id=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=je(r);return u.jsx(yw,{...o,...n,ref:t})});id.displayName=Dw;var Iw="DropdownMenuItem",ad=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=je(r);return u.jsx(xw,{...o,...n,ref:t})});ad.displayName=Iw;var kw="DropdownMenuCheckboxItem",ld=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=je(r);return u.jsx(bw,{...o,...n,ref:t})});ld.displayName=kw;var Ow="DropdownMenuRadioGroup",cd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=je(r);return u.jsx(ww,{...o,...n,ref:t})});cd.displayName=Ow;var $w="DropdownMenuRadioItem",ud=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=je(r);return u.jsx(Sw,{...o,...n,ref:t})});ud.displayName=$w;var Lw="DropdownMenuItemIndicator",dd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=je(r);return u.jsx(Cw,{...o,...n,ref:t})});dd.displayName=Lw;var Fw="DropdownMenuSeparator",fd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=je(r);return u.jsx(Ew,{...o,...n,ref:t})});fd.displayName=Fw;var Vw="DropdownMenuArrow",Ww=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=je(r);return u.jsx(Nw,{...o,...n,ref:t})});Ww.displayName=Vw;var Bw=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:o,defaultOpen:s}=e,i=je(t),[a,c]=tt({prop:n,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return u.jsx(Rw,{...i,open:a,onOpenChange:c,children:r})},Hw="DropdownMenuSubTrigger",pd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=je(r);return u.jsx(_w,{...o,...n,ref:t})});pd.displayName=Hw;var Uw="DropdownMenuSubContent",md=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=je(r);return u.jsx(Pw,{...o,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});md.displayName=Uw;var zw=Ju,Gw=td,hd=rd,gd=od,Kw=sd,vd=id,yd=ad,xd=ld,Yw=cd,bd=ud,wd=dd,Sd=fd,qw=Bw,Cd=pd,Ed=md;const Nd=zw,Rd=Gw,Xw=Kw,Zw=hd,Qw=qw,Jw=Yw,_d=l.forwardRef(({className:e,inset:t,children:r,...n},o)=>u.jsxs(Cd,{ref:o,className:M("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,u.jsx(ga,{className:"ml-auto h-4 w-4"})]}));_d.displayName=Cd.displayName;const Pd=l.forwardRef(({className:e,...t},r)=>u.jsx(Ed,{ref:r,className:M("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...t}));Pd.displayName=Ed.displayName;const Ss=l.forwardRef(({className:e,sideOffset:t=4,...r},n)=>u.jsx(hd,{children:u.jsx(gd,{ref:n,sideOffset:t,className:M("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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",e),...r})}));Ss.displayName=gd.displayName;const Cs=l.forwardRef(({className:e,inset:t,...r},n)=>u.jsx(yd,{ref:n,className:M("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));Cs.displayName=yd.displayName;const jd=l.forwardRef(({className:e,children:t,checked:r,...n},o)=>u.jsxs(xd,{ref:o,className:M("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(wd,{children:u.jsx(ur,{className:"h-4 w-4"})})}),t]}));jd.displayName=xd.displayName;const Ad=l.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(bd,{ref:n,className:M("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(wd,{children:u.jsx(Ap,{className:"h-2 w-2 fill-current"})})}),t]}));Ad.displayName=bd.displayName;const Es=l.forwardRef(({className:e,inset:t,...r},n)=>u.jsx(vd,{ref:n,className:M("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Es.displayName=vd.displayName;const Ns=l.forwardRef(({className:e,...t},r)=>u.jsx(Sd,{ref:r,className:M("-mx-1 my-1 h-px bg-muted",e),...t}));Ns.displayName=Sd.displayName;const Td=({className:e,...t})=>u.jsx("span",{className:M("ml-auto text-xs tracking-widest opacity-60",e),...t});Td.displayName="DropdownMenuShortcut";function eS(e){const t=tS(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),c=a.find(nS);if(c){const d=c.props.children,p=a.map(f=>f===c?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return u.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return u.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function tS(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=sS(o),a=oS(s,o.props);return o.type!==l.Fragment&&(a.ref=n?ye(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rS=Symbol("radix.slottable");function nS(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rS}function oS(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function sS(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var iS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Mr=iS.reduce((e,t)=>{const r=eS(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function aS(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),c=r.length;r=[...r,i];const d=f=>{var x;const{scope:m,children:g,...v}=f,h=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=l.useMemo(()=>v,Object.values(v));return u.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[c])||a,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[n,lS(o,...t)]}function lS(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function cS(e,t){return l.useReducer((r,n)=>t[r][n]??r,e)}var Rs="ScrollArea",[Md]=aS(Rs),[uS,Ve]=Md(Rs),Dd=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:s=600,...i}=e,[a,c]=l.useState(null),[d,p]=l.useState(null),[f,m]=l.useState(null),[g,v]=l.useState(null),[h,y]=l.useState(null),[x,b]=l.useState(0),[w,S]=l.useState(0),[E,j]=l.useState(!1),[_,I]=l.useState(!1),D=oe(t,A=>c(A)),O=Cr(o);return u.jsx(uS,{scope:r,type:n,dir:O,scrollHideDelay:s,scrollArea:a,viewport:d,onViewportChange:p,content:f,onContentChange:m,scrollbarX:g,onScrollbarXChange:v,scrollbarXEnabled:E,onScrollbarXEnabledChange:j,scrollbarY:h,onScrollbarYChange:y,scrollbarYEnabled:_,onScrollbarYEnabledChange:I,onCornerWidthChange:b,onCornerHeightChange:S,children:u.jsx(Mr.div,{dir:O,...i,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});Dd.displayName=Rs;var Id="ScrollAreaViewport",kd=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:o,...s}=e,i=Ve(Id,r),a=l.useRef(null),c=oe(t,a,i.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),u.jsx(Mr.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});kd.displayName=Id;var ot="ScrollAreaScrollbar",_s=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ve(ot,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,a=e.orientation==="horizontal";return l.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),o.type==="hover"?u.jsx(dS,{...n,ref:t,forceMount:r}):o.type==="scroll"?u.jsx(fS,{...n,ref:t,forceMount:r}):o.type==="auto"?u.jsx(Od,{...n,ref:t,forceMount:r}):o.type==="always"?u.jsx(Ps,{...n,ref:t}):null});_s.displayName=ot;var dS=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ve(ot,e.__scopeScrollArea),[s,i]=l.useState(!1);return l.useEffect(()=>{const a=o.scrollArea;let c=0;if(a){const d=()=>{window.clearTimeout(c),i(!0)},p=()=>{c=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",d),a.addEventListener("pointerleave",p),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",d),a.removeEventListener("pointerleave",p)}}},[o.scrollArea,o.scrollHideDelay]),u.jsx(Te,{present:r||s,children:u.jsx(Od,{"data-state":s?"visible":"hidden",...n,ref:t})})}),fS=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Ve(ot,e.__scopeScrollArea),s=e.orientation==="horizontal",i=Ln(()=>c("SCROLL_END"),100),[a,c]=cS("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return l.useEffect(()=>{if(a==="idle"){const d=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(d)}},[a,o.scrollHideDelay,c]),l.useEffect(()=>{const d=o.viewport,p=s?"scrollLeft":"scrollTop";if(d){let f=d[p];const m=()=>{const g=d[p];f!==g&&(c("SCROLL"),i()),f=g};return d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[o.viewport,s,c,i]),u.jsx(Te,{present:r||a!=="hidden",children:u.jsx(Ps,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:z(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:z(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Od=l.forwardRef((e,t)=>{const r=Ve(ot,e.__scopeScrollArea),{forceMount:n,...o}=e,[s,i]=l.useState(!1),a=e.orientation==="horizontal",c=Ln(()=>{if(r.viewport){const d=r.viewport.offsetWidth<r.viewport.scrollWidth,p=r.viewport.offsetHeight<r.viewport.scrollHeight;i(a?d:p)}},10);return Gt(r.viewport,c),Gt(r.content,c),u.jsx(Te,{present:n||s,children:u.jsx(Ps,{"data-state":s?"visible":"hidden",...o,ref:t})})}),Ps=l.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=Ve(ot,e.__scopeScrollArea),s=l.useRef(null),i=l.useRef(0),[a,c]=l.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Wd(a.viewport,a.content),p={...n,sizes:a,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:m=>s.current=m,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:m=>i.current=m};function f(m,g){return yS(m,i.current,a,g)}return r==="horizontal"?u.jsx(pS,{...p,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const m=o.viewport.scrollLeft,g=Hi(m,a,o.dir);s.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=f(m,o.dir))}}):r==="vertical"?u.jsx(mS,{...p,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const m=o.viewport.scrollTop,g=Hi(m,a);s.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=f(m))}}):null}),pS=l.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,s=Ve(ot,e.__scopeScrollArea),[i,a]=l.useState(),c=l.useRef(null),d=oe(t,c,s.onScrollbarXChange);return l.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),u.jsx(Ld,{"data-orientation":"horizontal",...o,ref:d,sizes:r,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":$n(r)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,f)=>{if(s.viewport){const m=s.viewport.scrollLeft+p.deltaX;e.onWheelScroll(m),Hd(m,f)&&p.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&n({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:rn(i.paddingLeft),paddingEnd:rn(i.paddingRight)}})}})}),mS=l.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,s=Ve(ot,e.__scopeScrollArea),[i,a]=l.useState(),c=l.useRef(null),d=oe(t,c,s.onScrollbarYChange);return l.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),u.jsx(Ld,{"data-orientation":"vertical",...o,ref:d,sizes:r,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":$n(r)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,f)=>{if(s.viewport){const m=s.viewport.scrollTop+p.deltaY;e.onWheelScroll(m),Hd(m,f)&&p.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&n({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:rn(i.paddingTop),paddingEnd:rn(i.paddingBottom)}})}})}),[hS,$d]=Md(ot),Ld=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:p,onResize:f,...m}=e,g=Ve(ot,r),[v,h]=l.useState(null),y=oe(t,D=>h(D)),x=l.useRef(null),b=l.useRef(""),w=g.viewport,S=n.content-n.viewport,E=Ce(p),j=Ce(c),_=Ln(f,10);function I(D){if(x.current){const O=D.clientX-x.current.left,A=D.clientY-x.current.top;d({x:O,y:A})}}return l.useEffect(()=>{const D=O=>{const A=O.target;(v==null?void 0:v.contains(A))&&E(O,S)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[w,v,S,E]),l.useEffect(j,[n,j]),Gt(v,_),Gt(g.content,_),u.jsx(hS,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:Ce(s),onThumbPointerUp:Ce(i),onThumbPositionChange:j,onThumbPointerDown:Ce(a),children:u.jsx(Mr.div,{...m,ref:y,style:{position:"absolute",...m.style},onPointerDown:z(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),x.current=v.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),I(D))}),onPointerMove:z(e.onPointerMove,I),onPointerUp:z(e.onPointerUp,D=>{const O=D.target;O.hasPointerCapture(D.pointerId)&&O.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=b.current,g.viewport&&(g.viewport.style.scrollBehavior=""),x.current=null})})})}),tn="ScrollAreaThumb",Fd=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=$d(tn,e.__scopeScrollArea);return u.jsx(Te,{present:r||o.hasThumb,children:u.jsx(gS,{ref:t,...n})})}),gS=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,s=Ve(tn,r),i=$d(tn,r),{onThumbPositionChange:a}=i,c=oe(t,f=>i.onThumbChange(f)),d=l.useRef(void 0),p=Ln(()=>{d.current&&(d.current(),d.current=void 0)},100);return l.useEffect(()=>{const f=s.viewport;if(f){const m=()=>{if(p(),!d.current){const g=xS(f,a);d.current=g,a()}};return a(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[s.viewport,p,a]),u.jsx(Mr.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:z(e.onPointerDownCapture,f=>{const g=f.target.getBoundingClientRect(),v=f.clientX-g.left,h=f.clientY-g.top;i.onThumbPointerDown({x:v,y:h})}),onPointerUp:z(e.onPointerUp,i.onThumbPointerUp)})});Fd.displayName=tn;var js="ScrollAreaCorner",Vd=l.forwardRef((e,t)=>{const r=Ve(js,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?u.jsx(vS,{...e,ref:t}):null});Vd.displayName=js;var vS=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=Ve(js,r),[s,i]=l.useState(0),[a,c]=l.useState(0),d=!!(s&&a);return Gt(o.scrollbarX,()=>{var f;const p=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(p),c(p)}),Gt(o.scrollbarY,()=>{var f;const p=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(p),i(p)}),d?u.jsx(Mr.div,{...n,ref:t,style:{width:s,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function rn(e){return e?parseInt(e,10):0}function Wd(e,t){const r=e/t;return isNaN(r)?0:r}function $n(e){const t=Wd(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function yS(e,t,r,n="ltr"){const o=$n(r),s=o/2,i=t||s,a=o-i,c=r.scrollbar.paddingStart+i,d=r.scrollbar.size-r.scrollbar.paddingEnd-a,p=r.content-r.viewport,f=n==="ltr"?[0,p]:[p*-1,0];return Bd([c,d],f)(e)}function Hi(e,t,r="ltr"){const n=$n(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,a=s-n,c=r==="ltr"?[0,i]:[i*-1,0],d=ao(e,c);return Bd([0,i],[0,a])(d)}function Bd(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Hd(e,t){return e>0&&e<t}var xS=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=r.left!==s.left,a=r.top!==s.top;(i||a)&&t(),r=s,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function Ln(e,t){const r=Ce(e),n=l.useRef(0);return l.useEffect(()=>()=>window.clearTimeout(n.current),[]),l.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Gt(e,t){const r=Ce(t);we(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var Ud=Dd,bS=kd,wS=Vd;const zd=l.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(Ud,{ref:n,className:M("relative overflow-hidden",e),...r,children:[u.jsx(bS,{className:"h-full w-full rounded-[inherit]",children:t}),u.jsx(As,{}),u.jsx(wS,{})]}));zd.displayName=Ud.displayName;const As=l.forwardRef(({className:e,orientation:t="vertical",...r},n)=>u.jsx(_s,{ref:n,orientation:t,className:M("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:u.jsx(Fd,{className:"relative flex-1 rounded-full bg-border"})}));As.displayName=_s.displayName;const Gd=an("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-500/50 text-green-700 dark:text-green-400 [&>svg]:text-green-500",warning:"border-yellow-500/50 text-yellow-700 dark:text-yellow-400 [&>svg]:text-yellow-500",info:"border-blue-500/50 text-blue-700 dark:text-blue-400 [&>svg]:text-blue-500"}},defaultVariants:{variant:"default"}}),Ts=l.forwardRef(({className:e,variant:t,...r},n)=>u.jsx("div",{ref:n,role:"alert",className:M(Gd({variant:t}),e),...r}));Ts.displayName="Alert";const Ms=l.forwardRef(({className:e,...t},r)=>u.jsx("h5",{ref:r,className:M("mb-1 font-medium leading-none tracking-tight",e),...t}));Ms.displayName="AlertTitle";const Ds=l.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:M("text-sm [&_p]:leading-relaxed",e),...t}));Ds.displayName="AlertDescription";const Kd=l.forwardRef(({variant:e,title:t,children:r,className:n,...o},s)=>{const i={default:pi,destructive:jp,success:Pp,warning:_p,info:pi},a=i[e]||i.default;return u.jsxs(Ts,{ref:s,variant:e,className:n,...o,children:[u.jsx(a,{className:"h-4 w-4"}),t&&u.jsx(Ms,{children:t}),r&&u.jsx(Ds,{children:r})]})});Kd.displayName="AlertWithIcon";const Is=l.forwardRef(({className:e,...t},r)=>u.jsx("div",{className:"relative w-full overflow-auto",children:u.jsx("table",{ref:r,className:M("w-full caption-bottom text-sm",e),...t})}));Is.displayName="Table";const ks=l.forwardRef(({className:e,...t},r)=>u.jsx("thead",{ref:r,className:M("[&_tr]:border-b",e),...t}));ks.displayName="TableHeader";const Os=l.forwardRef(({className:e,...t},r)=>u.jsx("tbody",{ref:r,className:M("[&_tr:last-child]:border-0",e),...t}));Os.displayName="TableBody";const Yd=l.forwardRef(({className:e,...t},r)=>u.jsx("tfoot",{ref:r,className:M("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Yd.displayName="TableFooter";const Ft=l.forwardRef(({className:e,...t},r)=>u.jsx("tr",{ref:r,className:M("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Ft.displayName="TableRow";const ar=l.forwardRef(({className:e,...t},r)=>u.jsx("th",{ref:r,className:M("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));ar.displayName="TableHead";const Nt=l.forwardRef(({className:e,...t},r)=>u.jsx("td",{ref:r,className:M("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Nt.displayName="TableCell";const qd=l.forwardRef(({className:e,...t},r)=>u.jsx("caption",{ref:r,className:M("mt-4 text-sm text-muted-foreground",e),...t}));qd.displayName="TableCaption";const $s=l.forwardRef(({options:e=[],value:t,onChange:r,onSearch:n,placeholder:o="Select...",searchPlaceholder:s="Search...",loading:i=!1,disabled:a=!1,multiple:c=!1,clearable:d=!0,className:p,renderOption:f,renderValue:m,getOptionLabel:g=S=>(S==null?void 0:S.label)||(S==null?void 0:S.name)||String(S),getOptionValue:v=S=>(S==null?void 0:S.value)||(S==null?void 0:S.id)||S,filterOption:h,noOptionsMessage:y="No options found",loadingMessage:x="Loading...",...b},w)=>{const[S,E]=l.useState(!1),[j,_]=l.useState(""),[I,D]=l.useState(0),O=l.useRef(null),A=l.useRef(null),R=l.useMemo(()=>j?h?e.filter(F=>h(F,j)):e.filter(F=>g(F).toLowerCase().includes(j.toLowerCase())):e,[e,j,h,g]),W=l.useMemo(()=>ma(F=>{n==null||n(F)},300),[n]),B=F=>{const re=F.target.value;_(re),D(0),W(re)},q=F=>{if(c){const re=Array.isArray(t)?t:[],ce=v(F);re.some(he=>v(he)===ce)?r==null||r(re.filter(he=>v(he)!==ce)):r==null||r([...re,F])}else r==null||r(F),E(!1),_("")},H=F=>{F.stopPropagation(),r==null||r(c?[]:null),_("")},U=F=>{if(!S){(F.key==="Enter"||F.key===" "||F.key==="ArrowDown")&&(F.preventDefault(),E(!0));return}switch(F.key){case"ArrowDown":F.preventDefault(),D(re=>Math.min(re+1,R.length-1));break;case"ArrowUp":F.preventDefault(),D(re=>Math.max(re-1,0));break;case"Enter":F.preventDefault(),R[I]&&q(R[I]);break;case"Escape":F.preventDefault(),E(!1),_("");break}};l.useEffect(()=>{const F=re=>{O.current&&!O.current.contains(re.target)&&(E(!1),_(""))};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[]);const $=F=>c?(Array.isArray(t)?t:[]).some(ce=>v(ce)===v(F)):t&&v(t)===v(F),k=c?Array.isArray(t)&&t.length>0:!!t,ee=()=>{if(!k)return u.jsx("span",{className:"text-muted-foreground",children:o});if(m)return m(t);if(c){const F=Array.isArray(t)?t:[];return F.length===1?g(F[0]):`${F.length} selected`}return g(t)};return u.jsxs("div",{ref:O,className:M("relative w-full",p),...b,children:[u.jsxs("button",{ref:w,type:"button",role:"combobox","aria-expanded":S,"aria-haspopup":"listbox",disabled:a,onClick:()=>E(!S),onKeyDown:U,className:M("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",S&&"ring-2 ring-ring ring-offset-2"),children:[u.jsx("span",{className:"flex-1 text-left truncate",children:ee()}),u.jsxs("div",{className:"flex items-center gap-1",children:[d&&k&&!a&&u.jsx(ln,{className:"h-4 w-4 opacity-50 hover:opacity-100 cursor-pointer",onClick:H}),u.jsx(Po,{className:M("h-4 w-4 opacity-50 transition-transform",S&&"rotate-180")})]})]}),S&&u.jsxs("div",{className:"absolute z-50 mt-1 w-full rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",children:[u.jsxs("div",{className:"flex items-center border-b px-3",children:[u.jsx(jo,{className:"h-4 w-4 shrink-0 opacity-50"}),u.jsx("input",{ref:A,type:"text",value:j,onChange:B,placeholder:s,className:"flex h-10 w-full bg-transparent py-3 pl-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",autoFocus:!0}),i&&u.jsx(Ht,{className:"h-4 w-4 animate-spin"})]}),u.jsx("div",{className:"max-h-60 overflow-auto p-1",children:i&&R.length===0?u.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:x}):R.length===0?u.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:y}):R.map((F,re)=>u.jsxs("div",{role:"option","aria-selected":$(F),onClick:()=>q(F),onMouseEnter:()=>D(re),className:M("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",I===re&&"bg-accent text-accent-foreground",$(F)&&"bg-accent/50"),children:[c&&u.jsx("div",{className:M("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",$(F)&&"bg-primary text-primary-foreground"),children:$(F)&&u.jsx(ur,{className:"h-3 w-3"})}),f?f(F):u.jsx("span",{className:"flex-1",children:g(F)}),!c&&$(F)&&u.jsx(ur,{className:"ml-auto h-4 w-4"})]},v(F)))})]})]})});$s.displayName="SearchSelect";const Qt=l.forwardRef(({className:e,label:t,description:r,error:n,required:o,children:s,...i},a)=>{const c=l.useId();return u.jsxs("div",{ref:a,className:M("space-y-2",e),...i,children:[t&&u.jsxs(Sr,{htmlFor:c,className:M(n&&"text-destructive"),children:[t,o&&u.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.Children.map(s,d=>l.isValidElement(d)?l.cloneElement(d,{id:c,"aria-invalid":!!n}):d),r&&!n&&u.jsx("p",{className:"text-sm text-muted-foreground",children:r}),n&&u.jsx("p",{className:"text-sm text-destructive",children:n})]})});Qt.displayName="FormField";const nn=l.forwardRef(({label:e,description:t,error:r,required:n,className:o,inputClassName:s,...i},a)=>u.jsx(Qt,{label:e,description:t,error:r,required:n,className:o,children:u.jsx(cn,{ref:a,className:M(r&&"border-destructive",s),...i})}));nn.displayName="QInput";const Ls=l.forwardRef(({label:e,description:t,error:r,required:n,className:o,textareaClassName:s,...i},a)=>u.jsx(Qt,{label:e,description:t,error:r,required:n,className:o,children:u.jsx(Ao,{ref:a,className:M(r&&"border-destructive",s),...i})}));Ls.displayName="QTextarea";const Fs=l.forwardRef(({label:e,description:t,error:r,required:n,options:o=[],placeholder:s="Select...",className:i,value:a,onChange:c,getOptionLabel:d=g=>(g==null?void 0:g.label)||(g==null?void 0:g.name)||String(g),getOptionValue:p=g=>(g==null?void 0:g.value)||(g==null?void 0:g.id)||g,...f},m)=>u.jsx(Qt,{label:e,description:t,error:r,required:n,className:i,children:u.jsxs(Jo,{value:a,onValueChange:c,...f,children:[u.jsx(En,{ref:m,className:M(r&&"border-destructive"),children:u.jsx(es,{placeholder:s})}),u.jsx(Nn,{children:o.map(g=>u.jsx(Rn,{value:String(p(g)),children:d(g)},p(g)))})]})}));Fs.displayName="QSelect";const Vs=l.forwardRef(({label:e,description:t,error:r,required:n,className:o,...s},i)=>u.jsx(Qt,{label:e,description:t,error:r,required:n,className:o,children:u.jsx($s,{ref:i,...s})}));Vs.displayName="QSearchSelect";const Ws=l.forwardRef(({label:e,description:t,error:r,className:n,checked:o,onCheckedChange:s,...i},a)=>{const c=l.useId();return u.jsxs("div",{className:M("flex items-center justify-between space-x-2",n),children:[u.jsxs("div",{className:"space-y-0.5",children:[e&&u.jsx(Sr,{htmlFor:c,className:"text-base",children:e}),t&&u.jsx("p",{className:"text-sm text-muted-foreground",children:t}),r&&u.jsx("p",{className:"text-sm text-destructive",children:r})]}),u.jsx(Oo,{ref:a,id:c,checked:o,onCheckedChange:s,...i})]})});Ws.displayName="QSwitch";const Bs=l.forwardRef(({label:e,description:t,error:r,className:n,checked:o,onCheckedChange:s,...i},a)=>{const c=l.useId();return u.jsxs("div",{className:M("flex items-start space-x-2",n),children:[u.jsx(dr,{ref:a,id:c,checked:o,onCheckedChange:s,className:"mt-1",...i}),u.jsxs("div",{className:"space-y-1 leading-none",children:[e&&u.jsx(Sr,{htmlFor:c,children:e}),t&&u.jsx("p",{className:"text-sm text-muted-foreground",children:t}),r&&u.jsx("p",{className:"text-sm text-destructive",children:r})]})]})});Bs.displayName="QCheckbox";const Xd=l.forwardRef(({onSubmit:e,className:t,children:r,...n},o)=>{const s=i=>{i.preventDefault(),e==null||e(i)};return u.jsx("form",{ref:o,onSubmit:s,className:M("space-y-4",t),...n,children:r})});Xd.displayName="QForm";const Hs=({currentPage:e=1,totalPages:t=1,totalItems:r=0,pageSize:n=10,pageSizeOptions:o=[10,20,50,100],onPageChange:s,onPageSizeChange:i,showPageSizeSelector:a=!0,showInfo:c=!0,className:d})=>{const p=(e-1)*n+1,f=Math.min(e*n,r),m=e>1,g=e<t,v=()=>{const h=[];if(t<=5)for(let x=1;x<=t;x++)h.push(x);else{h.push(1),e>3&&h.push("...");const x=Math.max(2,e-1),b=Math.min(t-1,e+1);for(let w=x;w<=b;w++)h.push(w);e<t-2&&h.push("..."),t>1&&h.push(t)}return h};return u.jsxs("div",{className:M("flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-4",d),children:[u.jsxs("div",{className:"flex items-center gap-4",children:[a&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm text-muted-foreground",children:"Rows per page"}),u.jsxs(Jo,{value:String(n),onValueChange:h=>i==null?void 0:i(Number(h)),children:[u.jsx(En,{className:"h-8 w-[70px]",children:u.jsx(es,{placeholder:n})}),u.jsx(Nn,{side:"top",children:o.map(h=>u.jsx(Rn,{value:String(h),children:h},h))})]})]}),c&&r>0&&u.jsxs("span",{className:"text-sm text-muted-foreground",children:["Showing ",p," to ",f," of ",r," results"]})]}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(de,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(1),disabled:!m,children:[u.jsx(Np,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"First page"})]}),u.jsxs(de,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(e-1),disabled:!m,children:[u.jsx(Cp,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Previous page"})]}),u.jsx("div",{className:"flex items-center gap-1",children:v().map((h,y)=>h==="..."?u.jsx("span",{className:"px-2 text-muted-foreground",children:"..."},`ellipsis-${y}`):u.jsx(de,{variant:e===h?"default":"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(h),children:h},h))}),u.jsxs(de,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(e+1),disabled:!g,children:[u.jsx(ga,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Next page"})]}),u.jsxs(de,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(t),disabled:!g,children:[u.jsx(Rp,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Last page"})]})]})]})};Hs.displayName="Pagination";const Dr=({variant:e="spinner",size:t="default",text:r,className:n,fullScreen:o=!1,overlay:s=!1})=>{const i={sm:"h-4 w-4",default:"h-8 w-8",lg:"h-12 w-12",xl:"h-16 w-16"},a=M("flex flex-col items-center justify-center gap-3",o&&"fixed inset-0 z-50",s&&"bg-background/80 backdrop-blur-sm",n),c=()=>{switch(e){case"spinner":return u.jsx(Ht,{className:M("animate-spin text-primary",i[t])});case"dots":return u.jsx("div",{className:"flex gap-1",children:[0,1,2].map(d=>u.jsx("div",{className:M("rounded-full bg-primary animate-bounce",t==="sm"&&"h-1.5 w-1.5",t==="default"&&"h-2 w-2",t==="lg"&&"h-3 w-3",t==="xl"&&"h-4 w-4"),style:{animationDelay:`${d*.15}s`}},d))});case"pulse":return u.jsx("div",{className:M("rounded-full bg-primary animate-pulse",i[t])});case"skeleton":return u.jsxs("div",{className:"space-y-3 w-full max-w-sm",children:[u.jsx("div",{className:"h-4 bg-muted rounded animate-pulse"}),u.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-3/4"}),u.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-1/2"})]});default:return u.jsx(Ht,{className:M("animate-spin text-primary",i[t])})}};return u.jsxs("div",{className:a,children:[c(),r&&u.jsx("p",{className:"text-sm text-muted-foreground animate-pulse",children:r})]})};Dr.displayName="Loading";const Zd=({loading:e,children:t,text:r,className:n})=>u.jsxs("div",{className:M("relative",n),children:[t,e&&u.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 backdrop-blur-sm rounded-lg",children:u.jsx(Dr,{text:r})})]});Zd.displayName="LoadingOverlay";const Qd=l.forwardRef(({loading:e,loadingText:t,children:r,disabled:n,className:o,...s},i)=>u.jsx(de,{ref:i,disabled:n||e,className:o,...s,children:e?u.jsxs(u.Fragment,{children:[u.jsx(Ht,{className:"mr-2 h-4 w-4 animate-spin"}),t||"Loading..."]}):r}));Qd.displayName="LoadingButton";const Jt=({icon:e=fi,title:t="No data found",description:r="There are no items to display.",action:n,actionLabel:o,onAction:s,variant:i="default",className:a,children:c})=>{const d={default:{icon:fi,title:"No data found",description:"There are no items to display."},search:{icon:jo,title:"No results found",description:"Try adjusting your search or filters to find what you're looking for."},empty:{icon:va,title:"Get started",description:"Create your first item to get started."},error:{icon:xa,title:"Something went wrong",description:"There was an error loading the data. Please try again."}},p=d[i]||d.default,f=e||p.icon,m=t||p.title,g=r||p.description;return u.jsxs("div",{className:M("flex flex-col items-center justify-center py-12 px-4 text-center",a),children:[u.jsx("div",{className:"rounded-full bg-muted p-4 mb-4",children:u.jsx(f,{className:"h-8 w-8 text-muted-foreground"})}),u.jsx("h3",{className:"text-lg font-semibold mb-2",children:m}),u.jsx("p",{className:"text-sm text-muted-foreground mb-6 max-w-sm",children:g}),c,(n||s)&&u.jsx(de,{onClick:s,children:o||"Take Action"})]})};Jt.displayName="EmptyState";const Us=({searchTerm:e,onClear:t,className:r})=>u.jsx(Jt,{variant:"search",title:`No results for "${e}"`,description:"Try searching with different keywords or check your filters.",className:r,children:t&&u.jsx(de,{variant:"outline",onClick:t,children:"Clear Search"})});Us.displayName="SearchEmptyState";const Jd=({itemName:e="item",onCreate:t,className:r})=>u.jsx(Jt,{variant:"empty",icon:va,title:`No ${e}s yet`,description:`Create your first ${e} to get started.`,onAction:t,actionLabel:`Create ${e}`,className:r});Jd.displayName="CreateEmptyState";const ef=({error:e,onRetry:t,className:r})=>u.jsx(Jt,{variant:"error",title:"Error loading data",description:(e==null?void 0:e.message)||"Something went wrong. Please try again.",onAction:t,actionLabel:"Try Again",className:r});ef.displayName="ErrorState";const Fn=({open:e,onOpenChange:t,title:r,description:n,children:o,footer:s,size:i="default",showClose:a=!0,className:c,...d})=>{const p={sm:"max-w-sm",default:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[95vw]"};return u.jsx(Tc,{open:e,onOpenChange:t,...d,children:u.jsxs(as,{className:M(p[i],c),children:[(r||n)&&u.jsxs(ls,{children:[r&&u.jsx(cs,{children:r}),n&&u.jsx(us,{children:n})]}),o,s&&u.jsx(Pn,{children:s})]})})};Fn.displayName="Modal";const zs=({open:e,onOpenChange:t,onConfirm:r,onCancel:n,title:o="Are you sure?",description:s="This action cannot be undone.",confirmText:i="Confirm",cancelText:a="Cancel",variant:c="default",loading:d=!1,className:p})=>{const f=async()=>{await(r==null?void 0:r())},m=()=>{n==null||n(),t==null||t(!1)};return u.jsx(Fn,{open:e,onOpenChange:t,title:o,description:s,size:"sm",className:p,footer:u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsx(de,{variant:"outline",onClick:m,disabled:d,children:a}),u.jsx(de,{variant:c==="destructive"?"destructive":"default",onClick:f,disabled:d,children:d?"Loading...":i})]})})};zs.displayName="ConfirmModal";const Vn=({open:e,onOpenChange:t,onConfirm:r,itemName:n="item",loading:o=!1})=>u.jsx(zs,{open:e,onOpenChange:t,onConfirm:r,title:`Delete ${n}?`,description:`Are you sure you want to delete this ${n}? This action cannot be undone.`,confirmText:"Delete",variant:"destructive",loading:o});Vn.displayName="DeleteConfirmModal";const tf=({open:e,onOpenChange:t,onSubmit:r,title:n,description:o,children:s,submitText:i="Save",cancelText:a="Cancel",loading:c=!1,size:d="default",className:p})=>{const f=async m=>{m==null||m.preventDefault(),await(r==null?void 0:r())};return u.jsx(Fn,{open:e,onOpenChange:t,title:n,description:o,size:d,className:p,children:u.jsxs("form",{onSubmit:f,children:[u.jsx("div",{className:"py-4",children:s}),u.jsxs(Pn,{children:[u.jsx(de,{type:"button",variant:"outline",onClick:()=>t==null?void 0:t(!1),disabled:c,children:a}),u.jsx(de,{type:"submit",disabled:c,children:c?"Saving...":i})]})]})})};tf.displayName="FormModal";const Gs=({data:e=[],columns:t=[],loading:r=!1,error:n=null,pagination:o=null,currentPage:s=1,pageSize:i=10,totalItems:a=0,totalPages:c=1,onPageChange:d,onPageSizeChange:p,sortable:f=!0,sortColumn:m=null,sortDirection:g=null,onSort:v,searchable:h=!0,searchValue:y="",onSearchChange:x,searchPlaceholder:b="Search...",selectable:w=!1,selectedRows:S=[],onSelectionChange:E,actions:j=[],onRowClick:_,striped:I=!1,hover:D=!0,compact:O=!1,className:A,emptyTitle:R="No data found",emptyDescription:W="There are no items to display.",emptyAction:B,onEmptyAction:q,getRowKey:H=U=>U.id||U._id})=>{const[U,$]=l.useState(y);l.useEffect(()=>{const T=setTimeout(()=>{x&&U!==y&&x(U)},300);return()=>clearTimeout(T)},[U]);const k=T=>{if(!f||!T.sortable)return;const Z=T.sortKey||T.accessor;let K="asc";m===Z&&(K=g==="asc"?"desc":"asc"),v==null||v(Z,K)},ee=T=>{T?E==null||E(e.map(H)):E==null||E([])},F=(T,Z)=>{Z?E==null||E([...S,T]):E==null||E(S.filter(K=>K!==T))},re=e.length>0&&S.length===e.length,ce=S.length>0&&S.length<e.length,pe=(T,Z,K)=>{const J=T.accessor||T.key,Q=J?typeof J=="function"?J(Z):Z[J]:void 0;return T.render?T.render(Q,Z,K):T.format?T.format(Q,Z):Q!==null&&typeof Q=="object"?"-":Q??"-"},he=T=>{if(!f||!T.sortable)return null;const Z=T.sortKey||T.accessor;return m!==Z?u.jsx(wp,{className:"ml-2 h-4 w-4 opacity-50"}):g==="asc"?u.jsx(Sp,{className:"ml-2 h-4 w-4"}):u.jsx(bp,{className:"ml-2 h-4 w-4"})},ge=T=>{if(!j||j.length===0)return null;const Z=j.filter(K=>K.hidden?typeof K.hidden=="function"?!K.hidden(T):!K.hidden:!0);return Z.length===0?null:u.jsxs(Nd,{children:[u.jsx(Rd,{asChild:!0,children:u.jsxs(de,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[u.jsx(Mp,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Open menu"})]})}),u.jsxs(Ss,{align:"end",children:[u.jsx(Es,{children:"Actions"}),u.jsx(Ns,{}),Z.map((K,J)=>u.jsxs(Cs,{onClick:()=>{var Q;return(Q=K.onClick)==null?void 0:Q.call(K,T)},className:M(K.variant==="destructive"&&"text-destructive focus:text-destructive"),disabled:K.disabled,children:[K.icon&&u.jsx(K.icon,{className:"mr-2 h-4 w-4"}),K.label]},K.label||J))]})]})};return u.jsxs("div",{className:M("w-full",A),children:[(h||S.length>0)&&u.jsxs("div",{className:"flex items-center justify-between gap-4 mb-4",children:[h&&u.jsxs("div",{className:"relative max-w-sm",children:[u.jsx(jo,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),u.jsx(cn,{placeholder:b,value:U,onChange:T=>$(T.target.value),className:"pl-9 pr-9"}),U&&u.jsx("button",{onClick:()=>{$(""),x==null||x("")},className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:u.jsx(ln,{className:"h-4 w-4"})})]}),w&&S.length>0&&u.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[S.length," row(s) selected",u.jsx(de,{variant:"ghost",size:"sm",onClick:()=>E==null?void 0:E([]),children:"Clear selection"})]})]}),u.jsx("div",{className:"rounded-md border",children:u.jsxs(Is,{children:[u.jsx(ks,{children:u.jsxs(Ft,{children:[w&&u.jsx(ar,{className:"w-12",children:u.jsx(dr,{checked:re,indeterminate:ce,onCheckedChange:ee})}),t.map((T,Z)=>u.jsx(ar,{className:M(T.headerClassName,f&&T.sortable&&"cursor-pointer select-none"),style:{width:T.width},onClick:()=>k(T),children:u.jsxs("div",{className:"flex items-center",children:[T.header,he(T)]})},T.accessor||Z)),j&&j.length>0&&u.jsx(ar,{className:"w-12",children:"Actions"})]})}),u.jsx(Os,{children:r?u.jsx(Ft,{children:u.jsx(Nt,{colSpan:t.length+(w?1:0)+(j!=null&&j.length?1:0),className:"h-48",children:u.jsx(Dr,{text:"Loading data..."})})}):e.length===0?u.jsx(Ft,{children:u.jsx(Nt,{colSpan:t.length+(w?1:0)+(j!=null&&j.length?1:0),className:"h-48",children:U?u.jsx(Us,{searchTerm:U,onClear:()=>{$(""),x==null||x("")}}):u.jsx(Jt,{title:R,description:W,onAction:q,actionLabel:B})})}):e.map((T,Z)=>{const K=H(T),J=S.includes(K);return u.jsxs(Ft,{"data-state":J?"selected":void 0,className:M(I&&Z%2===1&&"bg-muted/50",D&&"cursor-pointer",_&&"hover:bg-muted"),onClick:()=>_==null?void 0:_(T),children:[w&&u.jsx(Nt,{onClick:Q=>Q.stopPropagation(),children:u.jsx(dr,{checked:J,onCheckedChange:Q=>F(K,Q)})}),t.map((Q,te)=>u.jsx(Nt,{className:M(O&&"py-2",Q.cellClassName),children:pe(Q,T,Z)},Q.accessor||te)),j&&j.length>0&&u.jsx(Nt,{onClick:Q=>Q.stopPropagation(),children:ge(T)})]},K)})})]})}),!r&&e.length>0&&o!==!1&&u.jsx(Hs,{currentPage:s,totalPages:c,totalItems:a,pageSize:i,onPageChange:d,onPageSizeChange:p})]})};Gs.displayName="DataTable";const rf=({store:e,data:t,loading:r=!1,error:n=null,columns:o=[],currentPage:s=1,pageSize:i=10,totalItems:a=0,totalPages:c=1,onPageChange:d,onPageSizeChange:p,sortColumn:f,sortDirection:m,onSort:g,searchValue:v="",onSearchChange:h,searchPlaceholder:y="Search...",selectable:x=!1,selectedRows:b=[],onSelectionChange:w,onCreate:S,onView:E,onEdit:j,onDelete:_,onRefresh:I,onExport:D,createPath:O,detailPath:A,editPath:R,additionalActions:W=[],bulkActions:B=[],title:q,description:H,createLabel:U="Create",refreshLabel:$="Refresh",exportLabel:k="Export",viewLabel:ee="View",editLabel:F="Edit",deleteLabel:re="Delete",itemName:ce="item",getRowKey:pe=Ee=>Ee.id||Ee._id,showHeader:he=!0,showToolbar:ge=!0,compact:T=!1,className:Z,deleteConfirmTitle:K,deleteConfirmDescription:J,getDeleteItemName:Q,filters:te,headerActions:Re,searchable:_e=!0})=>{const Ee=Cf.useNavigate(),[st,We]=l.useState(!1),[Be,qe]=l.useState(null),[C,N]=l.useState(!1),[P,G]=l.useState(""),V=l.useRef(!1),L=l.useRef(P),X=l.useRef(null),ie=l.useRef(null),ue=(e==null?void 0:e.items)??t??[],Pe=(e==null?void 0:e.loading)??r,Mt=(e==null?void 0:e.error)??n,De=(e==null?void 0:e.pagination)??{page:s,pageSize:i,total:a,totalPages:c},it=De.page??s,at=De.pageSize??i,er=De.total??a,Bn=De.totalPages??c,Se=e==null?void 0:e.fetchList,Dt=e==null?void 0:e.delete,Xe=e==null?void 0:e.setPage,Hn=e==null?void 0:e.setPageSize,Et=e==null?void 0:e.setFilters;l.useEffect(()=>{Se&&!V.current&&(V.current=!0,X.current=it,ie.current=at,Se())},[Se]),l.useEffect(()=>{if(!Se||!V.current)return;const se=X.current!==it,zn=ie.current!==at;(se||zn)&&(X.current=it,ie.current=at,Se())},[it,at,Se]),l.useEffect(()=>{if(!Se||!V.current||L.current===P)return;const se=setTimeout(()=>{_e&&(L.current=P,Et==null||Et({search:P}),it!==1?Xe==null||Xe(1):Se())},300);return()=>clearTimeout(se)},[P,_e,it,Et,Xe,Se]);const gf=l.useCallback(se=>{Xe?Xe(se):d==null||d(se)},[Xe,d]),vf=l.useCallback(se=>{Hn?Hn(se):p==null||p(se)},[Hn,p]),yf=l.useCallback(se=>{Et?G(se):h==null||h(se)},[Et,h]),Qs=l.useCallback(()=>{O?Ee(O):S==null||S()},[O,Ee,S]),Js=l.useCallback(se=>{A?Ee(`${A}/${pe(se)}`):E==null||E(se)},[A,Ee,pe,E]),ei=l.useCallback(se=>{R?Ee(`${R}/${pe(se)}/edit`):j==null||j(se)},[R,Ee,pe,j]),xf=l.useCallback(()=>{Se?Se():I==null||I()},[Se,I]),ti=l.useCallback(se=>{qe(se),We(!0)},[]),bf=async()=>{if(Be){N(!0);try{Dt?(await Dt(pe(Be)),Se==null||Se()):_&&await _(Be),We(!1),qe(null)}catch(se){console.error("Delete error:",se)}finally{N(!1)}}},wf=l.useMemo(()=>{const se=[];return(A||E)&&se.push({label:ee,icon:Dp,onClick:Js}),(R||j)&&se.push({label:F,icon:ya,onClick:ei}),(Dt||_)&&se.push({label:re,icon:ba,variant:"destructive",onClick:ti}),[...se,...W]},[A,R,E,j,Dt,_,ee,F,re,Js,ei,ti,W]),Un=O||S,Sf=Se||I,ri=l.useMemo(()=>Be?Q?Q(Be):Be.name||Be.title||ce:ce,[Be,Q,ce]),ni=()=>ge?u.jsxs("div",{className:"flex items-center gap-2",children:[Re,x&&b.length>0&&B.length>0&&u.jsx(u.Fragment,{children:B.map((se,zn)=>u.jsxs(de,{variant:se.variant||"outline",size:"sm",onClick:()=>{var si;return(si=se.onClick)==null?void 0:si.call(se,b)},disabled:se.disabled,children:[se.icon&&u.jsx(se.icon,{className:"mr-2 h-4 w-4"}),se.label]},se.label||zn))}),D&&u.jsxs(de,{variant:"outline",size:"sm",onClick:D,children:[u.jsx(Tp,{className:"mr-2 h-4 w-4"}),k]}),Sf&&u.jsxs(de,{variant:"outline",size:"sm",onClick:xf,disabled:Pe,children:[u.jsx(xa,{className:M("mr-2 h-4 w-4",Pe&&"animate-spin")}),$]}),Un&&u.jsxs(de,{size:"sm",onClick:Qs,children:[u.jsx(kp,{className:"mr-2 h-4 w-4"}),U]})]}):null,oi=u.jsxs(u.Fragment,{children:[te&&u.jsx("div",{className:"mb-4 flex items-center gap-2",children:te}),u.jsx(Gs,{data:ue,columns:o,loading:Pe,error:Mt,currentPage:it,pageSize:at,totalItems:er,totalPages:Bn,onPageChange:gf,onPageSizeChange:vf,sortColumn:f,sortDirection:m,onSort:g,searchable:_e,searchValue:Et?P:v,onSearchChange:yf,searchPlaceholder:y,selectable:x,selectedRows:b,onSelectionChange:w,actions:wf,getRowKey:pe,compact:T,emptyTitle:`No ${ce}s found`,emptyDescription:`Create your first ${ce} to get started.`,emptyAction:Un?`Create ${ce}`:void 0,onEmptyAction:Un?Qs:void 0}),u.jsx(Vn,{open:st,onOpenChange:We,onConfirm:bf,title:K||`Delete ${ce}`,description:J||`Are you sure you want to delete "${ri}"? This action cannot be undone.`,itemName:ri,loading:C})]});return he&&(q||H)?u.jsxs(gt,{className:Z,children:[u.jsxs(yr,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[u.jsxs("div",{children:[q&&u.jsx(xr,{children:q}),H&&u.jsx(br,{children:H})]}),ni()]}),u.jsx(vt,{children:oi})]}):u.jsxs("div",{className:Z,children:[ge&&u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("div",{}),ni()]}),oi]})};rf.displayName="CrudList";var Ir=e=>e.type==="checkbox",Rt=e=>e instanceof Date,Me=e=>e==null;const nf=e=>typeof e=="object";var be=e=>!Me(e)&&!Array.isArray(e)&&nf(e)&&!Rt(e),SS=e=>be(e)&&e.target?Ir(e.target)?e.target.checked:e.target.value:e,CS=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,ES=(e,t)=>e.has(CS(t)),NS=e=>{const t=e.constructor&&e.constructor.prototype;return be(t)&&t.hasOwnProperty("isPrototypeOf")},Ks=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ne(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Ks&&(e instanceof Blob||n))&&(r||be(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!NS(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Ne(e[o]));else return e;return t}var Wn=e=>/^\w*$/.test(e),ve=e=>e===void 0,Ys=e=>Array.isArray(e)?e.filter(Boolean):[],qs=e=>Ys(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Y=(e,t,r)=>{if(!t||!be(e))return r;const n=(Wn(t)?[t]:qs(t)).reduce((o,s)=>Me(o)?o:o[s],e);return ve(n)||n===e?ve(e[t])?r:e[t]:n},Ze=e=>typeof e=="boolean",fe=(e,t,r)=>{let n=-1;const o=Wn(t)?[t]:qs(t),s=o.length,i=s-1;for(;++n<s;){const a=o[n];let c=r;if(n!==i){const d=e[a];c=be(d)||Array.isArray(d)?d:isNaN(+o[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const Ui={BLUR:"blur",FOCUS_OUT:"focusout"},Ue={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ct={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},RS=le.createContext(null);RS.displayName="HookFormContext";var _S=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Ue.all&&(t._proxyFormState[i]=!n||Ue.all),e[i]}});return o};const PS=typeof window<"u"?le.useLayoutEffect:le.useEffect;var ke=e=>typeof e=="string",jS=(e,t,r,n,o)=>ke(e)?(n&&t.watch.add(e),Y(r,e,o)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),Y(r,s))):(n&&(t.watchAll=!0),r),Eo=e=>Me(e)||!nf(e);function ht(e,t,r=new WeakSet){if(Eo(e)||Eo(t))return Object.is(e,t);if(Rt(e)&&Rt(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const s of n){const i=e[s];if(!o.includes(s))return!1;if(s!=="ref"){const a=t[s];if(Rt(i)&&Rt(a)||be(i)&&be(a)||Array.isArray(i)&&Array.isArray(a)?!ht(i,a,r):!Object.is(i,a))return!1}}return!0}var of=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},lr=e=>Array.isArray(e)?e:[e],zi=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function sf(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],s=t[n];if(o&&be(o)&&s){const i=sf(o,s);be(i)&&(r[n]=i)}else e[n]&&(r[n]=s)}return r}var Ae=e=>be(e)&&!Object.keys(e).length,Xs=e=>e.type==="file",ze=e=>typeof e=="function",on=e=>{if(!Ks)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},af=e=>e.type==="select-multiple",Zs=e=>e.type==="radio",AS=e=>Zs(e)||Ir(e),so=e=>on(e)&&e.isConnected;function TS(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=ve(e)?n++:e[t[n++]];return e}function MS(e){for(const t in e)if(e.hasOwnProperty(t)&&!ve(e[t]))return!1;return!0}function xe(e,t){const r=Array.isArray(t)?t:Wn(t)?[t]:qs(t),n=r.length===1?e:TS(e,r),o=r.length-1,s=r[o];return n&&delete n[s],o!==0&&(be(n)&&Ae(n)||Array.isArray(n)&&MS(n))&&xe(e,r.slice(0,-1)),e}var DS=e=>{for(const t in e)if(ze(e[t]))return!0;return!1};function lf(e){return Array.isArray(e)||be(e)&&!DS(e)}function No(e,t={}){for(const r in e){const n=e[r];lf(n)?(t[r]=Array.isArray(n)?[]:{},No(n,t[r])):ve(n)||(t[r]=!0)}return t}function Lt(e,t,r){r||(r=No(t));for(const n in e){const o=e[n];if(lf(o))ve(t)||Eo(r[n])?r[n]=No(o,Array.isArray(o)?[]:{}):Lt(o,Me(t)?{}:t[n],r[n]);else{const s=t[n];r[n]=!ht(o,s)}}return r}const Gi={value:!1,isValid:!1},Ki={value:!0,isValid:!0};var cf=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ve(e[0].attributes.value)?ve(e[0].value)||e[0].value===""?Ki:{value:e[0].value,isValid:!0}:Ki:Gi}return Gi},uf=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>ve(e)?e:t?e===""?NaN:e&&+e:r&&ke(e)?new Date(e):n?n(e):e;const Yi={isValid:!1,value:null};var df=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Yi):Yi;function qi(e){const t=e.ref;return Xs(t)?t.files:Zs(t)?df(e.refs).value:af(t)?[...t.selectedOptions].map(({value:r})=>r):Ir(t)?cf(e.refs).value:uf(ve(t.value)?e.ref.value:t.value,e)}var IS=(e,t,r,n)=>{const o={};for(const s of e){const i=Y(t,s);i&&fe(o,s,i._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},sn=e=>e instanceof RegExp,nr=e=>ve(e)?e:sn(e)?e.source:be(e)?sn(e.value)?e.value.source:e.value:e,Xi=e=>({isOnSubmit:!e||e===Ue.onSubmit,isOnBlur:e===Ue.onBlur,isOnChange:e===Ue.onChange,isOnAll:e===Ue.all,isOnTouch:e===Ue.onTouched});const Zi="AsyncFunction";var kS=e=>!!e&&!!e.validate&&!!(ze(e.validate)&&e.validate.constructor.name===Zi||be(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Zi)),OS=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Qi=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const cr=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const s=Y(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(cr(a,t))break}else if(be(a)&&cr(a,t))break}}};function Ji(e,t,r){const n=Y(e,r);if(n||Wn(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const s=o.join("."),i=Y(t,s),a=Y(e,s);if(i&&!Array.isArray(i)&&r!==s)return{name:r};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};o.pop()}return{name:r}}var $S=(e,t,r,n)=>{r(e);const{name:o,...s}=e;return Ae(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!n||Ue.all))},LS=(e,t,r)=>!e||!t||e===t||lr(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),FS=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,VS=(e,t)=>!Ys(Y(e,t)).length&&xe(e,t),WS=(e,t,r)=>{const n=lr(Y(e,r));return fe(n,"root",t[r]),fe(e,r,n),e};function ea(e,t,r="validate"){if(ke(e)||Array.isArray(e)&&e.every(ke)||Ze(e)&&!e)return{type:r,message:ke(e)?e:"",ref:t}}var $t=e=>be(e)&&!sn(e)?e:{value:e,message:""},ta=async(e,t,r,n,o,s)=>{const{ref:i,refs:a,required:c,maxLength:d,minLength:p,min:f,max:m,pattern:g,validate:v,name:h,valueAsNumber:y,mount:x}=e._f,b=Y(r,h);if(!x||t.has(h))return{};const w=a?a[0]:i,S=R=>{o&&w.reportValidity&&(w.setCustomValidity(Ze(R)?"":R||""),w.reportValidity())},E={},j=Zs(i),_=Ir(i),I=j||_,D=(y||Xs(i))&&ve(i.value)&&ve(b)||on(i)&&i.value===""||b===""||Array.isArray(b)&&!b.length,O=of.bind(null,h,n,E),A=(R,W,B,q=ct.maxLength,H=ct.minLength)=>{const U=R?W:B;E[h]={type:R?q:H,message:U,ref:i,...O(R?q:H,U)}};if(s?!Array.isArray(b)||!b.length:c&&(!I&&(D||Me(b))||Ze(b)&&!b||_&&!cf(a).isValid||j&&!df(a).isValid)){const{value:R,message:W}=ke(c)?{value:!!c,message:c}:$t(c);if(R&&(E[h]={type:ct.required,message:W,ref:w,...O(ct.required,W)},!n))return S(W),E}if(!D&&(!Me(f)||!Me(m))){let R,W;const B=$t(m),q=$t(f);if(!Me(b)&&!isNaN(b)){const H=i.valueAsNumber||b&&+b;Me(B.value)||(R=H>B.value),Me(q.value)||(W=H<q.value)}else{const H=i.valueAsDate||new Date(b),U=ee=>new Date(new Date().toDateString()+" "+ee),$=i.type=="time",k=i.type=="week";ke(B.value)&&b&&(R=$?U(b)>U(B.value):k?b>B.value:H>new Date(B.value)),ke(q.value)&&b&&(W=$?U(b)<U(q.value):k?b<q.value:H<new Date(q.value))}if((R||W)&&(A(!!R,B.message,q.message,ct.max,ct.min),!n))return S(E[h].message),E}if((d||p)&&!D&&(ke(b)||s&&Array.isArray(b))){const R=$t(d),W=$t(p),B=!Me(R.value)&&b.length>+R.value,q=!Me(W.value)&&b.length<+W.value;if((B||q)&&(A(B,R.message,W.message),!n))return S(E[h].message),E}if(g&&!D&&ke(b)){const{value:R,message:W}=$t(g);if(sn(R)&&!b.match(R)&&(E[h]={type:ct.pattern,message:W,ref:i,...O(ct.pattern,W)},!n))return S(W),E}if(v){if(ze(v)){const R=await v(b,r),W=ea(R,w);if(W&&(E[h]={...W,...O(ct.validate,W.message)},!n))return S(W.message),E}else if(be(v)){let R={};for(const W in v){if(!Ae(R)&&!n)break;const B=ea(await v[W](b,r),w,W);B&&(R={...B,...O(W,B.message)},S(B.message),n&&(E[h]=R))}if(!Ae(R)&&(E[h]={ref:w,...R},!n))return E}}return S(!0),E};const BS={mode:Ue.onSubmit,reValidateMode:Ue.onChange,shouldFocusError:!0};function HS(e={}){let t={...BS,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:ze(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},o=be(t.defaultValues)||be(t.values)?Ne(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Ne(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...p};const m={array:zi(),state:zi()},g=t.criteriaMode===Ue.all,v=C=>N=>{clearTimeout(d),d=setTimeout(C,N)},h=async C=>{if(!t.disabled&&(p.isValid||f.isValid||C)){const N=t.resolver?Ae((await _()).errors):await D(n,!0);N!==r.isValid&&m.state.next({isValid:N})}},y=(C,N)=>{!t.disabled&&(p.isValidating||p.validatingFields||f.isValidating||f.validatingFields)&&((C||Array.from(a.mount)).forEach(P=>{P&&(N?fe(r.validatingFields,P,N):xe(r.validatingFields,P))}),m.state.next({validatingFields:r.validatingFields,isValidating:!Ae(r.validatingFields)}))},x=(C,N=[],P,G,V=!0,L=!0)=>{if(G&&P&&!t.disabled){if(i.action=!0,L&&Array.isArray(Y(n,C))){const X=P(Y(n,C),G.argA,G.argB);V&&fe(n,C,X)}if(L&&Array.isArray(Y(r.errors,C))){const X=P(Y(r.errors,C),G.argA,G.argB);V&&fe(r.errors,C,X),VS(r.errors,C)}if((p.touchedFields||f.touchedFields)&&L&&Array.isArray(Y(r.touchedFields,C))){const X=P(Y(r.touchedFields,C),G.argA,G.argB);V&&fe(r.touchedFields,C,X)}(p.dirtyFields||f.dirtyFields)&&(r.dirtyFields=Lt(o,s)),m.state.next({name:C,isDirty:A(C,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else fe(s,C,N)},b=(C,N)=>{fe(r.errors,C,N),m.state.next({errors:r.errors})},w=C=>{r.errors=C,m.state.next({errors:r.errors,isValid:!1})},S=(C,N,P,G)=>{const V=Y(n,C);if(V){const L=Y(s,C,ve(P)?Y(o,C):P);ve(L)||G&&G.defaultChecked||N?fe(s,C,N?L:qi(V._f)):B(C,L),i.mount&&!i.action&&h()}},E=(C,N,P,G,V)=>{let L=!1,X=!1;const ie={name:C};if(!t.disabled){if(!P||G){(p.isDirty||f.isDirty)&&(X=r.isDirty,r.isDirty=ie.isDirty=A(),L=X!==ie.isDirty);const ue=ht(Y(o,C),N);X=!!Y(r.dirtyFields,C),ue?xe(r.dirtyFields,C):fe(r.dirtyFields,C,!0),ie.dirtyFields=r.dirtyFields,L=L||(p.dirtyFields||f.dirtyFields)&&X!==!ue}if(P){const ue=Y(r.touchedFields,C);ue||(fe(r.touchedFields,C,P),ie.touchedFields=r.touchedFields,L=L||(p.touchedFields||f.touchedFields)&&ue!==P)}L&&V&&m.state.next(ie)}return L?ie:{}},j=(C,N,P,G)=>{const V=Y(r.errors,C),L=(p.isValid||f.isValid)&&Ze(N)&&r.isValid!==N;if(t.delayError&&P?(c=v(()=>b(C,P)),c(t.delayError)):(clearTimeout(d),c=null,P?fe(r.errors,C,P):xe(r.errors,C)),(P?!ht(V,P):V)||!Ae(G)||L){const X={...G,...L&&Ze(N)?{isValid:N}:{},errors:r.errors,name:C};r={...r,...X},m.state.next(X)}},_=async C=>{y(C,!0);const N=await t.resolver(s,t.context,IS(C||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return y(C),N},I=async C=>{const{errors:N}=await _(C);if(C)for(const P of C){const G=Y(N,P);G?fe(r.errors,P,G):xe(r.errors,P)}else r.errors=N;return N},D=async(C,N,P={valid:!0})=>{for(const G in C){const V=C[G];if(V){const{_f:L,...X}=V;if(L){const ie=a.array.has(L.name),ue=V._f&&kS(V._f);ue&&p.validatingFields&&y([L.name],!0);const Pe=await ta(V,a.disabled,s,g,t.shouldUseNativeValidation&&!N,ie);if(ue&&p.validatingFields&&y([L.name]),Pe[L.name]&&(P.valid=!1,N))break;!N&&(Y(Pe,L.name)?ie?WS(r.errors,Pe,L.name):fe(r.errors,L.name,Pe[L.name]):xe(r.errors,L.name))}!Ae(X)&&await D(X,N,P)}}return P.valid},O=()=>{for(const C of a.unMount){const N=Y(n,C);N&&(N._f.refs?N._f.refs.every(P=>!so(P)):!so(N._f.ref))&&T(C)}a.unMount=new Set},A=(C,N)=>!t.disabled&&(C&&N&&fe(s,C,N),!ht(ee(),o)),R=(C,N,P)=>jS(C,a,{...i.mount?s:ve(N)?o:ke(C)?{[C]:N}:N},P,N),W=C=>Ys(Y(i.mount?s:o,C,t.shouldUnregister?Y(o,C,[]):[])),B=(C,N,P={})=>{const G=Y(n,C);let V=N;if(G){const L=G._f;L&&(!L.disabled&&fe(s,C,uf(N,L)),V=on(L.ref)&&Me(N)?"":N,af(L.ref)?[...L.ref.options].forEach(X=>X.selected=V.includes(X.value)):L.refs?Ir(L.ref)?L.refs.forEach(X=>{(!X.defaultChecked||!X.disabled)&&(Array.isArray(V)?X.checked=!!V.find(ie=>ie===X.value):X.checked=V===X.value||!!V)}):L.refs.forEach(X=>X.checked=X.value===V):Xs(L.ref)?L.ref.value="":(L.ref.value=V,L.ref.type||m.state.next({name:C,values:Ne(s)})))}(P.shouldDirty||P.shouldTouch)&&E(C,V,P.shouldTouch,P.shouldDirty,!0),P.shouldValidate&&k(C)},q=(C,N,P)=>{for(const G in N){if(!N.hasOwnProperty(G))return;const V=N[G],L=C+"."+G,X=Y(n,L);(a.array.has(C)||be(V)||X&&!X._f)&&!Rt(V)?q(L,V,P):B(L,V,P)}},H=(C,N,P={})=>{const G=Y(n,C),V=a.array.has(C),L=Ne(N);fe(s,C,L),V?(m.array.next({name:C,values:Ne(s)}),(p.isDirty||p.dirtyFields||f.isDirty||f.dirtyFields)&&P.shouldDirty&&m.state.next({name:C,dirtyFields:Lt(o,s),isDirty:A(C,L)})):G&&!G._f&&!Me(L)?q(C,L,P):B(C,L,P),Qi(C,a)&&m.state.next({...r,name:C}),m.state.next({name:i.mount?C:void 0,values:Ne(s)})},U=async C=>{i.mount=!0;const N=C.target;let P=N.name,G=!0;const V=Y(n,P),L=ue=>{G=Number.isNaN(ue)||Rt(ue)&&isNaN(ue.getTime())||ht(ue,Y(s,P,ue))},X=Xi(t.mode),ie=Xi(t.reValidateMode);if(V){let ue,Pe;const Mt=N.type?qi(V._f):SS(C),De=C.type===Ui.BLUR||C.type===Ui.FOCUS_OUT,it=!OS(V._f)&&!t.resolver&&!Y(r.errors,P)&&!V._f.deps||FS(De,Y(r.touchedFields,P),r.isSubmitted,ie,X),at=Qi(P,a,De);fe(s,P,Mt),De?(!N||!N.readOnly)&&(V._f.onBlur&&V._f.onBlur(C),c&&c(0)):V._f.onChange&&V._f.onChange(C);const er=E(P,Mt,De),Bn=!Ae(er)||at;if(!De&&m.state.next({name:P,type:C.type,values:Ne(s)}),it)return(p.isValid||f.isValid)&&(t.mode==="onBlur"?De&&h():De||h()),Bn&&m.state.next({name:P,...at?{}:er});if(!De&&at&&m.state.next({...r}),t.resolver){const{errors:Se}=await _([P]);if(L(Mt),G){const Dt=Ji(r.errors,n,P),Xe=Ji(Se,n,Dt.name||P);ue=Xe.error,P=Xe.name,Pe=Ae(Se)}}else y([P],!0),ue=(await ta(V,a.disabled,s,g,t.shouldUseNativeValidation))[P],y([P]),L(Mt),G&&(ue?Pe=!1:(p.isValid||f.isValid)&&(Pe=await D(n,!0)));G&&(V._f.deps&&(!Array.isArray(V._f.deps)||V._f.deps.length>0)&&k(V._f.deps),j(P,Pe,ue,er))}},$=(C,N)=>{if(Y(r.errors,N)&&C.focus)return C.focus(),1},k=async(C,N={})=>{let P,G;const V=lr(C);if(t.resolver){const L=await I(ve(C)?C:V);P=Ae(L),G=C?!V.some(X=>Y(L,X)):P}else C?(G=(await Promise.all(V.map(async L=>{const X=Y(n,L);return await D(X&&X._f?{[L]:X}:X)}))).every(Boolean),!(!G&&!r.isValid)&&h()):G=P=await D(n);return m.state.next({...!ke(C)||(p.isValid||f.isValid)&&P!==r.isValid?{}:{name:C},...t.resolver||!C?{isValid:P}:{},errors:r.errors}),N.shouldFocus&&!G&&cr(n,$,C?V:a.mount),G},ee=(C,N)=>{let P={...i.mount?s:o};return N&&(P=sf(N.dirtyFields?r.dirtyFields:r.touchedFields,P)),ve(C)?P:ke(C)?Y(P,C):C.map(G=>Y(P,G))},F=(C,N)=>({invalid:!!Y((N||r).errors,C),isDirty:!!Y((N||r).dirtyFields,C),error:Y((N||r).errors,C),isValidating:!!Y(r.validatingFields,C),isTouched:!!Y((N||r).touchedFields,C)}),re=C=>{C&&lr(C).forEach(N=>xe(r.errors,N)),m.state.next({errors:C?r.errors:{}})},ce=(C,N,P)=>{const G=(Y(n,C,{_f:{}})._f||{}).ref,V=Y(r.errors,C)||{},{ref:L,message:X,type:ie,...ue}=V;fe(r.errors,C,{...ue,...N,ref:G}),m.state.next({name:C,errors:r.errors,isValid:!1}),P&&P.shouldFocus&&G&&G.focus&&G.focus()},pe=(C,N)=>ze(C)?m.state.subscribe({next:P=>"values"in P&&C(R(void 0,N),P)}):R(C,N,!0),he=C=>m.state.subscribe({next:N=>{LS(C.name,N.name,C.exact)&&$S(N,C.formState||p,We,C.reRenderRoot)&&C.callback({values:{...s},...r,...N,defaultValues:o})}}).unsubscribe,ge=C=>(i.mount=!0,f={...f,...C.formState},he({...C,formState:f})),T=(C,N={})=>{for(const P of C?lr(C):a.mount)a.mount.delete(P),a.array.delete(P),N.keepValue||(xe(n,P),xe(s,P)),!N.keepError&&xe(r.errors,P),!N.keepDirty&&xe(r.dirtyFields,P),!N.keepTouched&&xe(r.touchedFields,P),!N.keepIsValidating&&xe(r.validatingFields,P),!t.shouldUnregister&&!N.keepDefaultValue&&xe(o,P);m.state.next({values:Ne(s)}),m.state.next({...r,...N.keepDirty?{isDirty:A()}:{}}),!N.keepIsValid&&h()},Z=({disabled:C,name:N})=>{(Ze(C)&&i.mount||C||a.disabled.has(N))&&(C?a.disabled.add(N):a.disabled.delete(N))},K=(C,N={})=>{let P=Y(n,C);const G=Ze(N.disabled)||Ze(t.disabled);return fe(n,C,{...P||{},_f:{...P&&P._f?P._f:{ref:{name:C}},name:C,mount:!0,...N}}),a.mount.add(C),P?Z({disabled:Ze(N.disabled)?N.disabled:t.disabled,name:C}):S(C,!0,N.value),{...G?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:nr(N.min),max:nr(N.max),minLength:nr(N.minLength),maxLength:nr(N.maxLength),pattern:nr(N.pattern)}:{},name:C,onChange:U,onBlur:U,ref:V=>{if(V){K(C,N),P=Y(n,C);const L=ve(V.value)&&V.querySelectorAll&&V.querySelectorAll("input,select,textarea")[0]||V,X=AS(L),ie=P._f.refs||[];if(X?ie.find(ue=>ue===L):L===P._f.ref)return;fe(n,C,{_f:{...P._f,...X?{refs:[...ie.filter(so),L,...Array.isArray(Y(o,C))?[{}]:[]],ref:{type:L.type,name:C}}:{ref:L}}}),S(C,!1,void 0,L)}else P=Y(n,C,{}),P._f&&(P._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(ES(a.array,C)&&i.action)&&a.unMount.add(C)}}},J=()=>t.shouldFocusError&&cr(n,$,a.mount),Q=C=>{Ze(C)&&(m.state.next({disabled:C}),cr(n,(N,P)=>{const G=Y(n,P);G&&(N.disabled=G._f.disabled||C,Array.isArray(G._f.refs)&&G._f.refs.forEach(V=>{V.disabled=G._f.disabled||C}))},0,!1))},te=(C,N)=>async P=>{let G;P&&(P.preventDefault&&P.preventDefault(),P.persist&&P.persist());let V=Ne(s);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:L,values:X}=await _();r.errors=L,V=Ne(X)}else await D(n);if(a.disabled.size)for(const L of a.disabled)xe(V,L);if(xe(r.errors,"root"),Ae(r.errors)){m.state.next({errors:{}});try{await C(V,P)}catch(L){G=L}}else N&&await N({...r.errors},P),J(),setTimeout(J);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ae(r.errors)&&!G,submitCount:r.submitCount+1,errors:r.errors}),G)throw G},Re=(C,N={})=>{Y(n,C)&&(ve(N.defaultValue)?H(C,Ne(Y(o,C))):(H(C,N.defaultValue),fe(o,C,Ne(N.defaultValue))),N.keepTouched||xe(r.touchedFields,C),N.keepDirty||(xe(r.dirtyFields,C),r.isDirty=N.defaultValue?A(C,Ne(Y(o,C))):A()),N.keepError||(xe(r.errors,C),p.isValid&&h()),m.state.next({...r}))},_e=(C,N={})=>{const P=C?Ne(C):o,G=Ne(P),V=Ae(C),L=V?o:G;if(N.keepDefaultValues||(o=P),!N.keepValues){if(N.keepDirtyValues){const X=new Set([...a.mount,...Object.keys(Lt(o,s))]);for(const ie of Array.from(X))Y(r.dirtyFields,ie)?fe(L,ie,Y(s,ie)):H(ie,Y(L,ie))}else{if(Ks&&ve(C))for(const X of a.mount){const ie=Y(n,X);if(ie&&ie._f){const ue=Array.isArray(ie._f.refs)?ie._f.refs[0]:ie._f.ref;if(on(ue)){const Pe=ue.closest("form");if(Pe){Pe.reset();break}}}}if(N.keepFieldsRef)for(const X of a.mount)H(X,Y(L,X));else n={}}s=t.shouldUnregister?N.keepDefaultValues?Ne(o):{}:Ne(L),m.array.next({values:{...L}}),m.state.next({values:{...L}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!p.isValid||!!N.keepIsValid||!!N.keepDirtyValues||!t.shouldUnregister&&!Ae(L),i.watch=!!t.shouldUnregister,i.action=!1,N.keepErrors||(r.errors={}),m.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:V?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!ht(C,o)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:V?{}:N.keepDirtyValues?N.keepDefaultValues&&s?Lt(o,s):r.dirtyFields:N.keepDefaultValues&&C?Lt(o,C):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Ee=(C,N)=>_e(ze(C)?C(s):C,N),st=(C,N={})=>{const P=Y(n,C),G=P&&P._f;if(G){const V=G.refs?G.refs[0]:G.ref;V.focus&&(V.focus(),N.shouldSelect&&ze(V.select)&&V.select())}},We=C=>{r={...r,...C}},qe={control:{register:K,unregister:T,getFieldState:F,handleSubmit:te,setError:ce,_subscribe:he,_runSchema:_,_focusError:J,_getWatch:R,_getDirty:A,_setValid:h,_setFieldArray:x,_setDisabledField:Z,_setErrors:w,_getFieldArray:W,_reset:_e,_resetDefaultValues:()=>ze(t.defaultValues)&&t.defaultValues().then(C=>{Ee(C,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:O,_disableForm:Q,_subjects:m,_proxyFormState:p,get _fields(){return n},get _formValues(){return s},get _state(){return i},set _state(C){i=C},get _defaultValues(){return o},get _names(){return a},set _names(C){a=C},get _formState(){return r},get _options(){return t},set _options(C){t={...t,...C}}},subscribe:ge,trigger:k,register:K,handleSubmit:te,watch:pe,setValue:H,getValues:ee,reset:Ee,resetField:Re,clearErrors:re,unregister:T,setError:ce,setFocus:st,getFieldState:F};return{...qe,formControl:qe}}function US(e={}){const t=le.useRef(void 0),r=le.useRef(void 0),[n,o]=le.useState({isDirty:!1,isValidating:!1,isLoading:ze(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:ze(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!ze(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=HS(e);t.current={...a,formState:n}}const s=t.current.control;return s._options=e,PS(()=>{const i=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(a=>({...a,isReady:!0})),s._formState.isReady=!0,i},[s]),le.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),le.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),le.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),le.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),le.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==n.isDirty&&s._subjects.state.next({isDirty:i})}},[s,n.isDirty]),le.useEffect(()=>{var i;e.values&&!ht(e.values,r.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((i=s._options.resetOptions)===null||i===void 0)&&i.keepIsValid||s._setValid(),r.current=e.values,o(a=>({...a}))):s._resetDefaultValues()},[s,e.values]),le.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=_S(n,s),t.current}const ra=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Y(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},ff=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?ra(n.ref,r,e):n.refs&&n.refs.forEach(o=>ra(o,r,e))}},zS=(e,t)=>{t.shouldUseNativeValidation&&ff(e,t);const r={};for(const n in e){const o=Y(t.fields,n),s=Object.assign(e[n]||{},{ref:o&&o.ref});if(GS(t.names||Object.keys(e),n)){const i=Object.assign({},Y(r,n));fe(i,"root",s),fe(r,n,i)}else fe(r,n,s)}return r},GS=(e,t)=>e.some(r=>r.startsWith(t+"."));var KS=function(e,t){for(var r={};e.length;){var n=e[0],o=n.code,s=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[i]={message:a.message,type:a.code}}else r[i]={message:s,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(p){return p.errors.forEach(function(f){return e.push(f)})}),t){var c=r[i].types,d=c&&c[n.code];r[i]=of(i,t,r,o,d?[].concat(d,n.message):n.message)}e.shift()}return r},YS=function(e,t,r){return r===void 0&&(r={}),function(n,o,s){try{return Promise.resolve(function(i,a){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(d){return s.shouldUseNativeValidation&&ff({},s),{errors:{},values:r.raw?n:d}})}catch(d){return a(d)}return c&&c.then?c.then(void 0,a):c}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:zS(KS(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}}};const pf=({fields:e=[],defaultValues:t={},validationSchema:r,onSubmit:n,onCancel:o,onBack:s,initialData:i=null,loading:a=!1,submitting:c=!1,title:d,description:p,submitLabel:f="Save",cancelLabel:m="Cancel",backLabel:g="Back",columns:v=1,showHeader:h=!0,showFooter:y=!0,showBack:x=!1,className:b,...w})=>{const S=US({defaultValues:i||t,resolver:r?YS(r):void 0,mode:"onBlur"}),{handleSubmit:E,formState:{errors:j,isDirty:_,isValid:I},reset:D,watch:O,setValue:A,control:R}=S;l.useEffect(()=>{i&&D(i)},[i,D]);const W=async U=>{try{await(n==null?void 0:n(U))}catch($){console.error("Form submission error:",$)}},B=U=>{var Q;const{name:$,type:k="text",label:ee,placeholder:F,description:re,required:ce,disabled:pe,options:he=[],className:ge,...T}=U,Z=(Q=j[$])==null?void 0:Q.message,K=O($),J={label:ee,placeholder:F,description:re,error:Z,required:ce,disabled:pe||a||c,className:ge};switch(k){case"text":case"email":case"password":case"number":case"url":case"tel":return u.jsx(nn,{...J,type:k,...S.register($),...T});case"textarea":return u.jsx(Ls,{...J,...S.register($),...T});case"select":return u.jsx(Fs,{...J,options:he,value:K,onChange:te=>A($,te,{shouldValidate:!0}),...T});case"search-select":return u.jsx(Vs,{...J,options:he,value:K,onChange:te=>A($,te,{shouldValidate:!0}),...T});case"switch":return u.jsx(Ws,{...J,checked:K,onCheckedChange:te=>A($,te,{shouldValidate:!0}),...T});case"checkbox":return u.jsx(Bs,{...J,checked:K,onCheckedChange:te=>A($,te,{shouldValidate:!0}),...T});case"custom":return U.render?U.render({form:S,field:U,error:Z,value:K}):null;default:return u.jsx(nn,{...J,type:"text",...S.register($),...T})}},q=M("grid gap-4",v===1&&"grid-cols-1",v===2&&"grid-cols-1 md:grid-cols-2",v===3&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",v===4&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"),H=u.jsxs("form",{onSubmit:E(W),children:[u.jsx("div",{className:q,children:e.map(U=>{if(U.hidden&&(typeof U.hidden=="function"?U.hidden(O()):U.hidden))return null;const $=U.colSpan||1,k=M($===2&&"md:col-span-2",$===3&&"md:col-span-2 lg:col-span-3",$===4&&"md:col-span-2 lg:col-span-4",$==="full"&&"col-span-full");return u.jsx("div",{className:k,children:B(U)},U.name)})}),y&&u.jsxs("div",{className:"flex items-center justify-end gap-2 mt-6 pt-4 border-t",children:[o&&u.jsxs(de,{type:"button",variant:"outline",onClick:o,disabled:c,children:[u.jsx(ln,{className:"mr-2 h-4 w-4"}),m]}),u.jsx(de,{type:"submit",disabled:c||a,children:c?u.jsxs(u.Fragment,{children:[u.jsx(Ht,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):u.jsxs(u.Fragment,{children:[u.jsx(Op,{className:"mr-2 h-4 w-4"}),f]})})]})]});return h&&(d||p||x)?u.jsxs(gt,{className:b,...w,children:[u.jsx(yr,{children:u.jsxs("div",{className:"flex items-center gap-4",children:[x&&s&&u.jsx(de,{variant:"ghost",size:"icon",onClick:s,children:u.jsx(Br,{className:"h-4 w-4"})}),u.jsxs("div",{children:[d&&u.jsx(xr,{children:d}),p&&u.jsx(br,{children:p})]})]})}),u.jsx(vt,{children:H})]}):u.jsx("div",{className:b,...w,children:H})};pf.displayName="CrudForm";const mf=({data:e=null,loading:t=!1,error:r=null,fields:n=[],onBack:o,onEdit:s,onDelete:i,title:a,description:c,editLabel:d="Edit",deleteLabel:p="Delete",backLabel:f="Back",itemName:m="item",showHeader:g=!0,showMeta:v=!0,columns:h=2,className:y,...x})=>{const[b,w]=l.useState(!1),[S,E]=l.useState(!1),j=async()=>{E(!0);try{await(i==null?void 0:i(e)),w(!1)}catch(A){console.error("Delete error:",A)}finally{E(!1)}},_=(A,R)=>{if(A.render)return A.render(R,e);if(R==null)return u.jsx("span",{className:"text-muted-foreground",children:"-"});switch(A.type){case"badge":return u.jsx(or,{variant:A.variant||"default",children:A.format?A.format(R):String(R)});case"status":const W={active:"success",inactive:"secondary",pending:"warning",error:"destructive",...A.statusColors};return u.jsx(or,{variant:W[R==null?void 0:R.toLowerCase()]||"default",children:A.format?A.format(R):String(R)});case"boolean":return u.jsx(or,{variant:R?"success":"secondary",children:R?A.trueLabel||"Yes":A.falseLabel||"No"});case"date":return _o(R);case"datetime":return Wr(R);case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:A.currency||"USD"}).format(R);case"number":return A.format?A.format(R):new Intl.NumberFormat().format(R);case"list":return Array.isArray(R)?u.jsx("div",{className:"flex flex-wrap gap-1",children:R.map((B,q)=>u.jsx(or,{variant:"outline",children:A.getItemLabel?A.getItemLabel(B):String(B)},q))}):String(R);case"link":return u.jsx("a",{href:R,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:A.linkText||R});case"email":return u.jsx("a",{href:`mailto:${R}`,className:"text-primary hover:underline",children:R});case"phone":return u.jsx("a",{href:`tel:${R}`,className:"text-primary hover:underline",children:R});case"image":return u.jsx("img",{src:R,alt:A.label||"Image",className:M("rounded-md object-cover",A.imageClassName||"h-20 w-20")});case"html":return u.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:R}});default:return A.format?A.format(R):String(R)}},I=A=>A.accessor?typeof A.accessor=="function"?A.accessor(e):e[A.accessor]:e[A.name],D=M("grid gap-6",h===1&&"grid-cols-1",h===2&&"grid-cols-1 md:grid-cols-2",h===3&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3");if(t)return u.jsx(gt,{className:y,children:u.jsx(vt,{className:"py-12",children:u.jsx(Dr,{text:`Loading ${m}...`})})});if(r)return u.jsx(gt,{className:y,children:u.jsxs(vt,{className:"py-12 text-center",children:[u.jsx("p",{className:"text-destructive",children:r.message||"An error occurred"}),o&&u.jsxs(de,{variant:"outline",onClick:o,className:"mt-4",children:[u.jsx(Br,{className:"mr-2 h-4 w-4"}),f]})]})});if(!e)return u.jsx(gt,{className:y,children:u.jsxs(vt,{className:"py-12 text-center",children:[u.jsxs("p",{className:"text-muted-foreground",children:["No ",m," found"]}),o&&u.jsxs(de,{variant:"outline",onClick:o,className:"mt-4",children:[u.jsx(Br,{className:"mr-2 h-4 w-4"}),f]})]})});const O=u.jsxs(u.Fragment,{children:[u.jsx("div",{className:D,children:n.map(A=>{if(A.hidden&&(typeof A.hidden=="function"?A.hidden(e):A.hidden))return null;const R=I(A),W=A.colSpan||1,B=M(W===2&&"md:col-span-2",W===3&&"lg:col-span-3",W==="full"&&"col-span-full");return u.jsxs("div",{className:B,children:[u.jsxs("dt",{className:"text-sm font-medium text-muted-foreground mb-1",children:[A.icon&&u.jsx(A.icon,{className:"inline-block mr-2 h-4 w-4"}),A.label]}),u.jsx("dd",{className:"text-sm",children:_(A,R)})]},A.name||A.accessor)})}),v&&(e.created_at||e.updated_at||e.createdAt||e.updatedAt)&&u.jsxs(u.Fragment,{children:[u.jsx($o,{className:"my-6"}),u.jsxs("div",{className:"flex flex-wrap gap-6 text-sm text-muted-foreground",children:[(e.created_at||e.createdAt)&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(di,{className:"h-4 w-4"}),u.jsxs("span",{children:["Created: ",Wr(e.created_at||e.createdAt)]})]}),(e.updated_at||e.updatedAt)&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(di,{className:"h-4 w-4"}),u.jsxs("span",{children:["Updated: ",Wr(e.updated_at||e.updatedAt)]})]}),(e.id||e._id)&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ip,{className:"h-4 w-4"}),u.jsxs("span",{children:["ID: ",e.id||e._id]})]})]})]})]});return u.jsxs(u.Fragment,{children:[u.jsxs(gt,{className:y,...x,children:[g&&u.jsxs(yr,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[o&&u.jsx(de,{variant:"ghost",size:"icon",onClick:o,children:u.jsx(Br,{className:"h-4 w-4"})}),u.jsxs("div",{children:[a&&u.jsx(xr,{children:a}),c&&u.jsx(br,{children:c})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[s&&u.jsxs(de,{variant:"outline",onClick:()=>s(e),children:[u.jsx(ya,{className:"mr-2 h-4 w-4"}),d]}),i&&u.jsxs(de,{variant:"destructive",onClick:()=>w(!0),children:[u.jsx(ba,{className:"mr-2 h-4 w-4"}),p]})]})]}),u.jsx(vt,{children:O})]}),u.jsx(Vn,{open:b,onOpenChange:w,onConfirm:j,itemName:m,loading:S})]})};mf.displayName="CrudDetail";const hf=e=>{const{name:t="crud",apiClient:r,endpoint:n,transformResponse:o=f=>f,transformRequest:s=f=>f,initialState:i={},extraActions:a={},idField:c="id",listKey:d="results",countKey:p="count"}=e;if(!r)throw new Error("createCrudStore: apiClient is required");if(!n)throw new Error("createCrudStore: endpoint is required");return f=>f((m,g)=>({items:[],item:null,loading:!1,submitting:!1,error:null,page:1,pageSize:10,totalItems:0,totalPages:0,sortColumn:null,sortDirection:null,search:"",filters:{},selectedIds:[],...i,setPage:v=>m({page:v}),setPageSize:v=>m({pageSize:v,page:1}),setSearch:v=>m({search:v,page:1}),setFilters:v=>m({filters:v,page:1}),setSort:(v,h)=>m({sortColumn:v,sortDirection:h}),setSelectedIds:v=>m({selectedIds:v}),clearSelection:()=>m({selectedIds:[]}),clearError:()=>m({error:null}),reset:()=>m({items:[],item:null,loading:!1,submitting:!1,error:null,page:1,search:"",filters:{},selectedIds:[]}),fetchList:async(v={})=>{var y,x,b,w;const h=g();m({loading:!0,error:null});try{const S={page:h.page,page_size:h.pageSize,search:h.search||void 0,ordering:h.sortColumn?`${h.sortDirection==="desc"?"-":""}${h.sortColumn}`:void 0,...h.filters,...v};Object.keys(S).forEach(O=>{(S[O]===void 0||S[O]==="")&&delete S[O]});const j=(await r.get(n,{params:S})).data,_=j[d]||j.data||(Array.isArray(j)?j:[]),I=j[p]||j.total||_.length,D=Math.ceil(I/h.pageSize);return m({items:_.map(o),totalItems:I,totalPages:D,loading:!1}),{items:_,totalItems:I,totalPages:D}}catch(S){const E=((x=(y=S.response)==null?void 0:y.data)==null?void 0:x.message)||((w=(b=S.response)==null?void 0:b.data)==null?void 0:w.detail)||S.message||"Failed to fetch items";throw m({error:{message:E,original:S},loading:!1}),S}},fetchOne:async v=>{var h,y,x,b;m({loading:!0,error:null,item:null});try{const w=await r.get(`${n}/${v}/`),S=o(w.data);return m({item:S,loading:!1}),S}catch(w){const S=((y=(h=w.response)==null?void 0:h.data)==null?void 0:y.message)||((b=(x=w.response)==null?void 0:x.data)==null?void 0:b.detail)||w.message||"Failed to fetch item";throw m({error:{message:S,original:w},loading:!1}),w}},create:async v=>{var h,y,x,b,w;m({submitting:!0,error:null});try{const S=s(v),E=await r.post(`${n}/`,S),j=o(E.data);return m(_=>({items:[j,..._.items],totalItems:_.totalItems+1,submitting:!1})),j}catch(S){const E=((y=(h=S.response)==null?void 0:h.data)==null?void 0:y.message)||((b=(x=S.response)==null?void 0:x.data)==null?void 0:b.detail)||S.message||"Failed to create item",j=((w=S.response)==null?void 0:w.data)||{};throw m({error:{message:E,fieldErrors:j,original:S},submitting:!1}),S}},update:async(v,h)=>{var y,x,b,w,S;m({submitting:!0,error:null});try{const E=s(h),j=await r.patch(`${n}/${v}/`,E),_=o(j.data);return m(I=>{var D;return{items:I.items.map(O=>O[c]===v?_:O),item:((D=I.item)==null?void 0:D[c])===v?_:I.item,submitting:!1}}),_}catch(E){const j=((x=(y=E.response)==null?void 0:y.data)==null?void 0:x.message)||((w=(b=E.response)==null?void 0:b.data)==null?void 0:w.detail)||E.message||"Failed to update item",_=((S=E.response)==null?void 0:S.data)||{};throw m({error:{message:j,fieldErrors:_,original:E},submitting:!1}),E}},delete:async v=>{var h,y,x,b;m({submitting:!0,error:null});try{return await r.delete(`${n}/${v}/`),m(w=>{var S;return{items:w.items.filter(E=>E[c]!==v),totalItems:w.totalItems-1,item:((S=w.item)==null?void 0:S[c])===v?null:w.item,selectedIds:w.selectedIds.filter(E=>E!==v),submitting:!1}}),!0}catch(w){const S=((y=(h=w.response)==null?void 0:h.data)==null?void 0:y.message)||((b=(x=w.response)==null?void 0:x.data)==null?void 0:b.detail)||w.message||"Failed to delete item";throw m({error:{message:S,original:w},submitting:!1}),w}},bulkDelete:async v=>{var h,y,x,b;m({submitting:!0,error:null});try{return await Promise.all(v.map(w=>r.delete(`${n}/${w}/`))),m(w=>({items:w.items.filter(S=>!v.includes(S[c])),totalItems:w.totalItems-v.length,selectedIds:[],submitting:!1})),!0}catch(w){const S=((y=(h=w.response)==null?void 0:h.data)==null?void 0:y.message)||((b=(x=w.response)==null?void 0:x.data)==null?void 0:b.detail)||w.message||"Failed to delete items";throw m({error:{message:S,original:w},submitting:!1}),w}},replace:async(v,h)=>{var y,x,b,w,S;m({submitting:!0,error:null});try{const E=s(h),j=await r.put(`${n}/${v}/`,E),_=o(j.data);return m(I=>{var D;return{items:I.items.map(O=>O[c]===v?_:O),item:((D=I.item)==null?void 0:D[c])===v?_:I.item,submitting:!1}}),_}catch(E){const j=((x=(y=E.response)==null?void 0:y.data)==null?void 0:x.message)||((w=(b=E.response)==null?void 0:b.data)==null?void 0:w.detail)||E.message||"Failed to update item",_=((S=E.response)==null?void 0:S.data)||{};throw m({error:{message:j,fieldErrors:_,original:E},submitting:!1}),E}},...a}))},qS=e=>{const{create:t}=require("zustand");return t(hf(e))};exports.Alert=Ts;exports.AlertDescription=Ds;exports.AlertTitle=Ms;exports.AlertWithIcon=Kd;exports.Avatar=pu;exports.AvatarFallback=hu;exports.AvatarImage=mu;exports.Badge=or;exports.Button=de;exports.Card=gt;exports.CardContent=vt;exports.CardDescription=br;exports.CardFooter=Sa;exports.CardHeader=yr;exports.CardTitle=xr;exports.Checkbox=dr;exports.ConfirmModal=zs;exports.CreateEmptyState=Jd;exports.CrudDetail=mf;exports.CrudForm=pf;exports.CrudList=rf;exports.DataTable=Gs;exports.DeleteConfirmModal=Vn;exports.Dialog=Tc;exports.DialogClose=ex;exports.DialogContent=as;exports.DialogDescription=us;exports.DialogFooter=Pn;exports.DialogHeader=ls;exports.DialogOverlay=is;exports.DialogPortal=Mc;exports.DialogTitle=cs;exports.DialogTrigger=Jy;exports.DropdownMenu=Nd;exports.DropdownMenuCheckboxItem=jd;exports.DropdownMenuContent=Ss;exports.DropdownMenuGroup=Xw;exports.DropdownMenuItem=Cs;exports.DropdownMenuLabel=Es;exports.DropdownMenuPortal=Zw;exports.DropdownMenuRadioGroup=Jw;exports.DropdownMenuRadioItem=Ad;exports.DropdownMenuSeparator=Ns;exports.DropdownMenuShortcut=Td;exports.DropdownMenuSub=Qw;exports.DropdownMenuSubContent=Pd;exports.DropdownMenuSubTrigger=_d;exports.DropdownMenuTrigger=Rd;exports.EmptyState=Jt;exports.ErrorState=ef;exports.FormField=Qt;exports.FormModal=tf;exports.Input=cn;exports.Label=Sr;exports.Loading=Dr;exports.LoadingButton=Qd;exports.LoadingOverlay=Zd;exports.Modal=Fn;exports.Pagination=Hs;exports.QCheckbox=Bs;exports.QForm=Xd;exports.QInput=nn;exports.QSearchSelect=Vs;exports.QSelect=Fs;exports.QSwitch=Ws;exports.QTabs=nu;exports.QTextarea=Ls;exports.ScrollArea=zd;exports.ScrollBar=As;exports.SearchEmptyState=Us;exports.SearchSelect=$s;exports.Select=Jo;exports.SelectContent=Nn;exports.SelectGroup=Ty;exports.SelectItem=Rn;exports.SelectLabel=ac;exports.SelectScrollDownButton=rs;exports.SelectScrollUpButton=ts;exports.SelectSeparator=lc;exports.SelectTrigger=En;exports.SelectValue=es;exports.Separator=$o;exports.Skeleton=xm;exports.Switch=Oo;exports.Table=Is;exports.TableBody=Os;exports.TableCaption=qd;exports.TableCell=Nt;exports.TableFooter=Yd;exports.TableHead=ar;exports.TableHeader=ks;exports.TableRow=Ft;exports.Tabs=Mx;exports.TabsContent=ru;exports.TabsList=eu;exports.TabsTrigger=tu;exports.Textarea=Ao;exports.Tooltip=xb;exports.TooltipContent=Nu;exports.TooltipProvider=yb;exports.TooltipTrigger=bb;exports.alertVariants=Gd;exports.badgeVariants=Ca;exports.buttonVariants=wa;exports.cn=M;exports.createCrudStore=hf;exports.createStore=qS;exports.debounce=ma;exports.deepClone=mp;exports.formatCurrency=up;exports.formatDate=_o;exports.formatDateTime=Wr;exports.formatRelativeTime=dp;exports.generateId=pp;exports.getNestedValue=gp;exports.isEmpty=hp;exports.truncate=fp;
|
|
236
|
+
*/var Ui;function Oy(){return Ui||(Ui=1,process.env.NODE_ENV!=="production"&&function(){function e(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}function t(g,v){p||o.startTransition===void 0||(p=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=v();if(!f){var x=v();s(h,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}x=a({inst:{value:h,getSnapshot:v}});var y=x[0].inst,b=x[1];return u(function(){y.value=h,y.getSnapshot=v,r(y)&&b({inst:y})},[g,h,v]),i(function(){return r(y)&&b({inst:y}),g(function(){r(y)&&b({inst:y})})},[g]),d(h),h}function r(g){var v=g.getSnapshot;g=g.value;try{var h=v();return!s(g,h)}catch{return!0}}function n(g,v){return v()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=pe,s=typeof Object.is=="function"?Object.is:e,a=o.useState,i=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,p=!1,f=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;so.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),so}process.env.NODE_ENV==="production"?Co.exports=ky():Co.exports=Oy();var $y=Co.exports;function Ly(){return $y.useSyncExternalStore(Fy,()=>!0,()=>!1)}function Fy(){return()=>{}}var hs="Avatar",[Vy]=Dy(hs),[Wy,iu]=Vy(hs),au=l.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[o,s]=l.useState("idle");return c.jsx(Wy,{scope:r,imageLoadingStatus:o,onImageLoadingStatusChange:s,children:c.jsx(jr.span,{...n,ref:t})})});au.displayName=hs;var lu="AvatarImage",cu=l.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:o=()=>{},...s}=e,a=iu(lu,r),i=By(n,s),u=Re(d=>{o(d),a.onImageLoadingStatusChange(d)});return Ee(()=>{i!=="idle"&&u(i)},[i,u]),i==="loaded"?c.jsx(jr.img,{...s,ref:t,src:n}):null});cu.displayName=lu;var uu="AvatarFallback",du=l.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...o}=e,s=iu(uu,r),[a,i]=l.useState(n===void 0);return l.useEffect(()=>{if(n!==void 0){const u=window.setTimeout(()=>i(!0),n);return()=>window.clearTimeout(u)}},[n]),a&&s.imageLoadingStatus!=="loaded"?c.jsx(jr.span,{...o,ref:t}):null});du.displayName=uu;function zi(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function By(e,{referrerPolicy:t,crossOrigin:r}){const n=Ly(),o=l.useRef(null),s=n?(o.current||(o.current=new window.Image),o.current):null,[a,i]=l.useState(()=>zi(s,e));return Ee(()=>{i(zi(s,e))},[s,e]),Ee(()=>{const u=f=>()=>{i(f)};if(!s)return;const d=u("loaded"),p=u("error");return s.addEventListener("load",d),s.addEventListener("error",p),t&&(s.referrerPolicy=t),typeof r=="string"&&(s.crossOrigin=r),()=>{s.removeEventListener("load",d),s.removeEventListener("error",p)}},[s,r,t]),a}var fu=au,pu=cu,mu=du;const hu=l.forwardRef(({className:e,...t},r)=>c.jsx(fu,{ref:r,className:A("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));hu.displayName=fu.displayName;const gu=l.forwardRef(({className:e,...t},r)=>c.jsx(pu,{ref:r,className:A("aspect-square h-full w-full",e),...t}));gu.displayName=pu.displayName;const vu=l.forwardRef(({className:e,...t},r)=>c.jsx(mu,{ref:r,className:A("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));vu.displayName=mu.displayName;function Hy(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a),u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,Uy(o,...t)]}function Uy(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function zy(e){const t=Gy(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(Yy);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Gy(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=Xy(o),i=qy(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xu=Symbol("radix.slottable");function Ky(e){const t=({children:r})=>c.jsx(c.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=xu,t}function Yy(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xu}function qy(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Xy(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Zy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qy=Zy.reduce((e,t)=>{const r=zy(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),[kn]=Hy("Tooltip",[nr]),On=nr(),yu="TooltipProvider",Jy=700,Eo="tooltip.open",[eb,gs]=kn(yu),bu=e=>{const{__scopeTooltip:t,delayDuration:r=Jy,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:s}=e,a=l.useRef(!0),i=l.useRef(!1),u=l.useRef(0);return l.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),c.jsx(eb,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:l.useCallback(()=>{window.clearTimeout(u.current),a.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:i,onPointerInTransitChange:l.useCallback(d=>{i.current=d},[]),disableHoverableContent:o,children:s})};bu.displayName=yu;var Sr="Tooltip",[tb,$n]=kn(Sr),wu=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:s,disableHoverableContent:a,delayDuration:i}=e,u=gs(Sr,e.__scopeTooltip),d=On(t),[p,f]=l.useState(null),m=He(),g=l.useRef(0),v=a??u.disableHoverableContent,h=i??u.delayDuration,x=l.useRef(!1),[y,b]=lt({prop:n,defaultProp:o??!1,onChange:R=>{R?(u.onOpen(),document.dispatchEvent(new CustomEvent(Eo))):u.onClose(),s==null||s(R)},caller:Sr}),S=l.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),C=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,b(!0)},[b]),E=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,b(!1)},[b]),_=l.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,b(!0),g.current=0},h)},[h,b]);return l.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),c.jsx(bn,{...d,children:c.jsx(tb,{scope:t,contentId:m,open:y,stateAttribute:S,trigger:p,onTriggerChange:f,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayedRef.current?_():C()},[u.isOpenDelayedRef,_,C]),onTriggerLeave:l.useCallback(()=>{v?E():(window.clearTimeout(g.current),g.current=0)},[E,v]),onOpen:C,onClose:E,disableHoverableContent:v,children:r})})};wu.displayName=Sr;var No="TooltipTrigger",Su=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=$n(No,r),s=gs(No,r),a=On(r),i=l.useRef(null),u=se(t,i,o.onTriggerChange),d=l.useRef(!1),p=l.useRef(!1),f=l.useCallback(()=>d.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(Zo,{asChild:!0,...a,children:c.jsx(Qy.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:u,onPointerMove:G(e.onPointerMove,m=>{m.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:G(e.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:G(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:G(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:G(e.onBlur,o.onClose),onClick:G(e.onClick,o.onClose)})})});Su.displayName=No;var rb="TooltipPortal",[ZS,nb]=kn(rb,{forceMount:void 0}),Zt="TooltipContent",Cu=l.forwardRef((e,t)=>{const r=nb(Zt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...s}=e,a=$n(Zt,e.__scopeTooltip);return c.jsx(Ie,{present:n||a.open,children:a.disableHoverableContent?c.jsx(Eu,{side:o,...s,ref:t}):c.jsx(ob,{side:o,...s,ref:t})})}),ob=l.forwardRef((e,t)=>{const r=$n(Zt,e.__scopeTooltip),n=gs(Zt,e.__scopeTooltip),o=l.useRef(null),s=se(t,o),[a,i]=l.useState(null),{trigger:u,onClose:d}=r,p=o.current,{onPointerInTransitChange:f}=n,m=l.useCallback(()=>{i(null),f(!1)},[f]),g=l.useCallback((v,h)=>{const x=v.currentTarget,y={x:v.clientX,y:v.clientY},b=cb(y,x.getBoundingClientRect()),S=ub(y,b),C=db(h.getBoundingClientRect()),E=pb([...S,...C]);i(E),f(!0)},[f]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(u&&p){const v=x=>g(x,p),h=x=>g(x,u);return u.addEventListener("pointerleave",v),p.addEventListener("pointerleave",h),()=>{u.removeEventListener("pointerleave",v),p.removeEventListener("pointerleave",h)}}},[u,p,g,m]),l.useEffect(()=>{if(a){const v=h=>{const x=h.target,y={x:h.clientX,y:h.clientY},b=(u==null?void 0:u.contains(x))||(p==null?void 0:p.contains(x)),S=!fb(y,a);b?m():S&&(m(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,p,a,d,m]),c.jsx(Eu,{...e,ref:s})}),[sb,ib]=kn(Sr,{isInside:!1}),ab=Ky("TooltipContent"),Eu=l.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:a,...i}=e,u=$n(Zt,r),d=On(r),{onClose:p}=u;return l.useEffect(()=>(document.addEventListener(Eo,p),()=>document.removeEventListener(Eo,p)),[p]),l.useEffect(()=>{if(u.trigger){const f=m=>{const g=m.target;g!=null&&g.contains(u.trigger)&&p()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[u.trigger,p]),c.jsx(Ar,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:p,children:c.jsxs(Qo,{"data-state":u.stateAttribute,...d,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(ab,{children:n}),c.jsx(sb,{scope:r,isInside:!0,children:c.jsx(vv,{id:u.contentId,role:"tooltip",children:o||n})})]})})});Cu.displayName=Zt;var Nu="TooltipArrow",lb=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=On(r);return ib(Nu,r).isInside?null:c.jsx(Jo,{...o,...n,ref:t})});lb.displayName=Nu;function cb(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,o,s)){case s:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function ub(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function db(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function fb(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],u=t[a],d=i.x,p=i.y,f=u.x,m=u.y;p>n!=m>n&&r<(f-d)*(n-p)/(m-p)+d&&(o=!o)}return o}function pb(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),mb(t)}function mb(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const s=r[r.length-1],a=r[r.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var hb=bu,gb=wu,vb=Su,Ru=Cu;const xb=hb,yb=gb,bb=vb,ju=l.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(Ru,{ref:n,sideOffset:t,className:A("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...r}));ju.displayName=Ru.displayName;function wb(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a),u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,Sb(o,...t)]}function Sb(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Cb(e){const t=Eb(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(Rb);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Eb(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=_b(o),i=jb(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Nb=Symbol("radix.slottable");function Rb(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nb}function jb(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function _b(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Pb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ab=Pb.reduce((e,t)=>{const r=Cb(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Tb(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a),u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,Mb(o,...t)]}function Mb(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function _u(e){const t=Db(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(kb);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Db(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=$b(o),i=Ob(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ib=Symbol("radix.slottable");function kb(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ib}function Ob(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function $b(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Lb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ir=Lb.reduce((e,t)=>{const r=_u(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Fb(e,t){e&&Rr.flushSync(()=>e.dispatchEvent(t))}var Ro=["Enter"," "],Vb=["ArrowDown","PageUp","Home"],Pu=["ArrowUp","PageDown","End"],Wb=[...Vb,...Pu],Bb={ltr:[...Ro,"ArrowRight"],rtl:[...Ro,"ArrowLeft"]},Hb={ltr:["ArrowLeft"],rtl:["ArrowRight"]},kr="Menu",[Cr,Ub,zb]=Wo(kr),[Ot,Au]=Tb(kr,[zb,nr,Mn]),Or=nr(),Tu=Mn(),[Mu,jt]=Ot(kr),[Gb,$r]=Ot(kr),Du=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:s,modal:a=!0}=e,i=Or(t),[u,d]=l.useState(null),p=l.useRef(!1),f=Re(s),m=Pr(o);return l.useEffect(()=>{const g=()=>{p.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>p.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),c.jsx(bn,{...i,children:c.jsx(Mu,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:c.jsx(Gb,{scope:t,onClose:l.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:m,modal:a,children:n})})})};Du.displayName=kr;var Kb="MenuAnchor",vs=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=Or(r);return c.jsx(Zo,{...o,...n,ref:t})});vs.displayName=Kb;var xs="MenuPortal",[Yb,Iu]=Ot(xs,{forceMount:void 0}),ku=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:o}=e,s=jt(xs,t);return c.jsx(Yb,{scope:t,forceMount:r,children:c.jsx(Ie,{present:r||s.open,children:c.jsx(wn,{asChild:!0,container:o,children:n})})})};ku.displayName=xs;var Ye="MenuContent",[qb,ys]=Ot(Ye),Ou=l.forwardRef((e,t)=>{const r=Iu(Ye,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,s=jt(Ye,e.__scopeMenu),a=$r(Ye,e.__scopeMenu);return c.jsx(Cr.Provider,{scope:e.__scopeMenu,children:c.jsx(Ie,{present:n||s.open,children:c.jsx(Cr.Slot,{scope:e.__scopeMenu,children:a.modal?c.jsx(Xb,{...o,ref:t}):c.jsx(Zb,{...o,ref:t})})})})}),Xb=l.forwardRef((e,t)=>{const r=jt(Ye,e.__scopeMenu),n=l.useRef(null),o=se(t,n);return l.useEffect(()=>{const s=n.current;if(s)return es(s)},[]),c.jsx(bs,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:G(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),Zb=l.forwardRef((e,t)=>{const r=jt(Ye,e.__scopeMenu);return c.jsx(bs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Qb=_u("MenuContent.ScrollLock"),bs=l.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:g,disableOutsideScroll:v,...h}=e,x=jt(Ye,r),y=$r(Ye,r),b=Or(r),S=Tu(r),C=Ub(r),[E,_]=l.useState(null),R=l.useRef(null),k=se(t,R,x.onContentChange),M=l.useRef(0),O=l.useRef(""),V=l.useRef(0),P=l.useRef(null),$=l.useRef("right"),z=l.useRef(0),X=v?Cn:l.Fragment,H=v?{as:Qb,allowPinchZoom:!0}:void 0,I=D=>{var T,Q;const re=O.current+D,L=C().filter(q=>!q.disabled),te=document.activeElement,le=(T=L.find(q=>q.ref.current===te))==null?void 0:T.textValue,ue=L.map(q=>q.textValue),ge=uw(ue,re,le),me=(Q=L.find(q=>q.textValue===ge))==null?void 0:Q.ref.current;(function q(ne){O.current=ne,window.clearTimeout(M.current),ne!==""&&(M.current=window.setTimeout(()=>q(""),1e3))})(re),me&&setTimeout(()=>me.focus())};l.useEffect(()=>()=>window.clearTimeout(M.current),[]),Bo();const U=l.useCallback(D=>{var L,te;return $.current===((L=P.current)==null?void 0:L.side)&&fw(D,(te=P.current)==null?void 0:te.area)},[]);return c.jsx(qb,{scope:r,searchRef:O,onItemEnter:l.useCallback(D=>{U(D)&&D.preventDefault()},[U]),onItemLeave:l.useCallback(D=>{var re;U(D)||((re=R.current)==null||re.focus(),_(null))},[U]),onTriggerLeave:l.useCallback(D=>{U(D)&&D.preventDefault()},[U]),pointerGraceTimerRef:V,onPointerGraceIntentChange:l.useCallback(D=>{P.current=D},[]),children:c.jsx(X,{...H,children:c.jsx(hn,{asChild:!0,trapped:o,onMountAutoFocus:G(s,D=>{var re;D.preventDefault(),(re=R.current)==null||re.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:c.jsx(Ar,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:g,children:c.jsx(Wc,{asChild:!0,...S,dir:y.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:_,onEntryFocus:G(u,D=>{y.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(Qo,{role:"menu","aria-orientation":"vertical","data-state":Ju(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...h,ref:k,style:{outline:"none",...h.style},onKeyDown:G(h.onKeyDown,D=>{const L=D.target.closest("[data-radix-menu-content]")===D.currentTarget,te=D.ctrlKey||D.altKey||D.metaKey,le=D.key.length===1;L&&(D.key==="Tab"&&D.preventDefault(),!te&&le&&I(D.key));const ue=R.current;if(D.target!==ue||!Wb.includes(D.key))return;D.preventDefault();const me=C().filter(T=>!T.disabled).map(T=>T.ref.current);Pu.includes(D.key)&&me.reverse(),lw(me)}),onBlur:G(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(M.current),O.current="")}),onPointerMove:G(e.onPointerMove,Er(D=>{const re=D.target,L=z.current!==D.clientX;if(D.currentTarget.contains(re)&&L){const te=D.clientX>z.current?"right":"left";$.current=te,z.current=D.clientX}}))})})})})})})});Ou.displayName=Ye;var Jb="MenuGroup",ws=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(Ir.div,{role:"group",...n,ref:t})});ws.displayName=Jb;var ew="MenuLabel",$u=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(Ir.div,{...n,ref:t})});$u.displayName=ew;var nn="MenuItem",Gi="menu.itemSelect",Ln=l.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...o}=e,s=l.useRef(null),a=$r(nn,e.__scopeMenu),i=ys(nn,e.__scopeMenu),u=se(t,s),d=l.useRef(!1),p=()=>{const f=s.current;if(!r&&f){const m=new CustomEvent(Gi,{bubbles:!0,cancelable:!0});f.addEventListener(Gi,g=>n==null?void 0:n(g),{once:!0}),Fb(f,m),m.defaultPrevented?d.current=!1:a.onClose()}};return c.jsx(Lu,{...o,ref:u,disabled:r,onClick:G(e.onClick,p),onPointerDown:f=>{var m;(m=e.onPointerDown)==null||m.call(e,f),d.current=!0},onPointerUp:G(e.onPointerUp,f=>{var m;d.current||(m=f.currentTarget)==null||m.click()}),onKeyDown:G(e.onKeyDown,f=>{const m=i.searchRef.current!=="";r||m&&f.key===" "||Ro.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Ln.displayName=nn;var Lu=l.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:o,...s}=e,a=ys(nn,r),i=Tu(r),u=l.useRef(null),d=se(t,u),[p,f]=l.useState(!1),[m,g]=l.useState("");return l.useEffect(()=>{const v=u.current;v&&g((v.textContent??"").trim())},[s.children]),c.jsx(Cr.ItemSlot,{scope:r,disabled:n,textValue:o??m,children:c.jsx(Bc,{asChild:!0,...i,focusable:!n,children:c.jsx(Ir.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:d,onPointerMove:G(e.onPointerMove,Er(v=>{n?a.onItemLeave(v):(a.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:G(e.onPointerLeave,Er(v=>a.onItemLeave(v))),onFocus:G(e.onFocus,()=>f(!0)),onBlur:G(e.onBlur,()=>f(!1))})})})}),tw="MenuCheckboxItem",Fu=l.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...o}=e;return c.jsx(Uu,{scope:e.__scopeMenu,checked:r,children:c.jsx(Ln,{role:"menuitemcheckbox","aria-checked":on(r)?"mixed":r,...o,ref:t,"data-state":Es(r),onSelect:G(o.onSelect,()=>n==null?void 0:n(on(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Fu.displayName=tw;var Vu="MenuRadioGroup",[rw,nw]=Ot(Vu,{value:void 0,onValueChange:()=>{}}),Wu=l.forwardRef((e,t)=>{const{value:r,onValueChange:n,...o}=e,s=Re(n);return c.jsx(rw,{scope:e.__scopeMenu,value:r,onValueChange:s,children:c.jsx(ws,{...o,ref:t})})});Wu.displayName=Vu;var Bu="MenuRadioItem",Hu=l.forwardRef((e,t)=>{const{value:r,...n}=e,o=nw(Bu,e.__scopeMenu),s=r===o.value;return c.jsx(Uu,{scope:e.__scopeMenu,checked:s,children:c.jsx(Ln,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":Es(s),onSelect:G(n.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,r)},{checkForDefaultPrevented:!1})})})});Hu.displayName=Bu;var Ss="MenuItemIndicator",[Uu,ow]=Ot(Ss,{checked:!1}),zu=l.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...o}=e,s=ow(Ss,r);return c.jsx(Ie,{present:n||on(s.checked)||s.checked===!0,children:c.jsx(Ir.span,{...o,ref:t,"data-state":Es(s.checked)})})});zu.displayName=Ss;var sw="MenuSeparator",Gu=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(Ir.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Gu.displayName=sw;var iw="MenuArrow",Ku=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=Or(r);return c.jsx(Jo,{...o,...n,ref:t})});Ku.displayName=iw;var Cs="MenuSub",[aw,Yu]=Ot(Cs),qu=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:o}=e,s=jt(Cs,t),a=Or(t),[i,u]=l.useState(null),[d,p]=l.useState(null),f=Re(o);return l.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),c.jsx(bn,{...a,children:c.jsx(Mu,{scope:t,open:n,onOpenChange:f,content:d,onContentChange:p,children:c.jsx(aw,{scope:t,contentId:He(),triggerId:He(),trigger:i,onTriggerChange:u,children:r})})})};qu.displayName=Cs;var fr="MenuSubTrigger",Xu=l.forwardRef((e,t)=>{const r=jt(fr,e.__scopeMenu),n=$r(fr,e.__scopeMenu),o=Yu(fr,e.__scopeMenu),s=ys(fr,e.__scopeMenu),a=l.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},p=l.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return l.useEffect(()=>p,[p]),l.useEffect(()=>{const f=i.current;return()=>{window.clearTimeout(f),u(null)}},[i,u]),c.jsx(vs,{asChild:!0,...d,children:c.jsx(Lu,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":Ju(r.open),...e,ref:we(t,o.onTriggerChange),onClick:f=>{var m;(m=e.onClick)==null||m.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:G(e.onPointerMove,Er(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100))})),onPointerLeave:G(e.onPointerLeave,Er(f=>{var g,v;p();const m=(g=r.content)==null?void 0:g.getBoundingClientRect();if(m){const h=(v=r.content)==null?void 0:v.dataset.side,x=h==="right",y=x?-5:5,b=m[x?"left":"right"],S=m[x?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x:b,y:m.top},{x:S,y:m.top},{x:S,y:m.bottom},{x:b,y:m.bottom}],side:h}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:G(e.onKeyDown,f=>{var g;const m=s.searchRef.current!=="";e.disabled||m&&f.key===" "||Bb[n.dir].includes(f.key)&&(r.onOpenChange(!0),(g=r.content)==null||g.focus(),f.preventDefault())})})})});Xu.displayName=fr;var Zu="MenuSubContent",Qu=l.forwardRef((e,t)=>{const r=Iu(Ye,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,s=jt(Ye,e.__scopeMenu),a=$r(Ye,e.__scopeMenu),i=Yu(Zu,e.__scopeMenu),u=l.useRef(null),d=se(t,u);return c.jsx(Cr.Provider,{scope:e.__scopeMenu,children:c.jsx(Ie,{present:n||s.open,children:c.jsx(Cr.Slot,{scope:e.__scopeMenu,children:c.jsx(bs,{id:i.contentId,"aria-labelledby":i.triggerId,...o,ref:d,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var f;a.isUsingKeyboardRef.current&&((f=u.current)==null||f.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:G(e.onFocusOutside,p=>{p.target!==i.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:G(e.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:G(e.onKeyDown,p=>{var g;const f=p.currentTarget.contains(p.target),m=Hb[a.dir].includes(p.key);f&&m&&(s.onOpenChange(!1),(g=i.trigger)==null||g.focus(),p.preventDefault())})})})})})});Qu.displayName=Zu;function Ju(e){return e?"open":"closed"}function on(e){return e==="indeterminate"}function Es(e){return on(e)?"indeterminate":e?"checked":"unchecked"}function lw(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function cw(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function uw(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let a=cw(e,Math.max(s,0));o.length===1&&(a=a.filter(d=>d!==r));const u=a.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return u!==r?u:void 0}function dw(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],u=t[a],d=i.x,p=i.y,f=u.x,m=u.y;p>n!=m>n&&r<(f-d)*(n-p)/(m-p)+d&&(o=!o)}return o}function fw(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return dw(r,t)}function Er(e){return t=>t.pointerType==="mouse"?e(t):void 0}var pw=Du,mw=vs,hw=ku,gw=Ou,vw=ws,xw=$u,yw=Ln,bw=Fu,ww=Wu,Sw=Hu,Cw=zu,Ew=Gu,Nw=Ku,Rw=qu,jw=Xu,_w=Qu,Fn="DropdownMenu",[Pw]=wb(Fn,[Au]),Te=Au(),[Aw,ed]=Pw(Fn),td=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:s,onOpenChange:a,modal:i=!0}=e,u=Te(t),d=l.useRef(null),[p,f]=lt({prop:o,defaultProp:s??!1,onChange:a,caller:Fn});return c.jsx(Aw,{scope:t,triggerId:He(),triggerRef:d,contentId:He(),open:p,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(m=>!m),[f]),modal:i,children:c.jsx(pw,{...u,open:p,onOpenChange:f,dir:n,modal:i,children:r})})};td.displayName=Fn;var rd="DropdownMenuTrigger",nd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...o}=e,s=ed(rd,r),a=Te(r);return c.jsx(mw,{asChild:!0,...a,children:c.jsx(Ab.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...o,ref:we(t,s.triggerRef),onPointerDown:G(e.onPointerDown,i=>{!n&&i.button===0&&i.ctrlKey===!1&&(s.onOpenToggle(),s.open||i.preventDefault())}),onKeyDown:G(e.onKeyDown,i=>{n||(["Enter"," "].includes(i.key)&&s.onOpenToggle(),i.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});nd.displayName=rd;var Tw="DropdownMenuPortal",od=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Te(t);return c.jsx(hw,{...n,...r})};od.displayName=Tw;var sd="DropdownMenuContent",id=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=ed(sd,r),s=Te(r),a=l.useRef(!1);return c.jsx(gw,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...n,ref:t,onCloseAutoFocus:G(e.onCloseAutoFocus,i=>{var u;a.current||(u=o.triggerRef.current)==null||u.focus(),a.current=!1,i.preventDefault()}),onInteractOutside:G(e.onInteractOutside,i=>{const u=i.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,p=u.button===2||d;(!o.modal||p)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});id.displayName=sd;var Mw="DropdownMenuGroup",ad=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Te(r);return c.jsx(vw,{...o,...n,ref:t})});ad.displayName=Mw;var Dw="DropdownMenuLabel",ld=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Te(r);return c.jsx(xw,{...o,...n,ref:t})});ld.displayName=Dw;var Iw="DropdownMenuItem",cd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Te(r);return c.jsx(yw,{...o,...n,ref:t})});cd.displayName=Iw;var kw="DropdownMenuCheckboxItem",ud=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Te(r);return c.jsx(bw,{...o,...n,ref:t})});ud.displayName=kw;var Ow="DropdownMenuRadioGroup",dd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Te(r);return c.jsx(ww,{...o,...n,ref:t})});dd.displayName=Ow;var $w="DropdownMenuRadioItem",fd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Te(r);return c.jsx(Sw,{...o,...n,ref:t})});fd.displayName=$w;var Lw="DropdownMenuItemIndicator",pd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Te(r);return c.jsx(Cw,{...o,...n,ref:t})});pd.displayName=Lw;var Fw="DropdownMenuSeparator",md=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Te(r);return c.jsx(Ew,{...o,...n,ref:t})});md.displayName=Fw;var Vw="DropdownMenuArrow",Ww=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Te(r);return c.jsx(Nw,{...o,...n,ref:t})});Ww.displayName=Vw;var Bw=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:o,defaultOpen:s}=e,a=Te(t),[i,u]=lt({prop:n,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return c.jsx(Rw,{...a,open:i,onOpenChange:u,children:r})},Hw="DropdownMenuSubTrigger",hd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Te(r);return c.jsx(jw,{...o,...n,ref:t})});hd.displayName=Hw;var Uw="DropdownMenuSubContent",gd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Te(r);return c.jsx(_w,{...o,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gd.displayName=Uw;var zw=td,Gw=nd,vd=od,xd=id,Kw=ad,yd=ld,bd=cd,wd=ud,Yw=dd,Sd=fd,Cd=pd,Ed=md,qw=Bw,Nd=hd,Rd=gd;const jd=zw,_d=Gw,Xw=Kw,Zw=vd,Qw=qw,Jw=Yw,Pd=l.forwardRef(({className:e,inset:t,children:r,...n},o)=>c.jsxs(Nd,{ref:o,className:A("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,c.jsx(ba,{className:"ml-auto h-4 w-4"})]}));Pd.displayName=Nd.displayName;const Ad=l.forwardRef(({className:e,...t},r)=>c.jsx(Rd,{ref:r,className:A("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...t}));Ad.displayName=Rd.displayName;const Ns=l.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(vd,{children:c.jsx(xd,{ref:n,sideOffset:t,className:A("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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",e),...r})}));Ns.displayName=xd.displayName;const Rs=l.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(bd,{ref:n,className:A("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));Rs.displayName=bd.displayName;const Td=l.forwardRef(({className:e,children:t,checked:r,...n},o)=>c.jsxs(wd,{ref:o,className:A("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Cd,{children:c.jsx(vr,{className:"h-4 w-4"})})}),t]}));Td.displayName=wd.displayName;const Md=l.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Sd,{ref:n,className:A("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Cd,{children:c.jsx(Tp,{className:"h-2 w-2 fill-current"})})}),t]}));Md.displayName=Sd.displayName;const js=l.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(yd,{ref:n,className:A("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));js.displayName=yd.displayName;const _s=l.forwardRef(({className:e,...t},r)=>c.jsx(Ed,{ref:r,className:A("-mx-1 my-1 h-px bg-muted",e),...t}));_s.displayName=Ed.displayName;const Dd=({className:e,...t})=>c.jsx("span",{className:A("ml-auto text-xs tracking-widest opacity-60",e),...t});Dd.displayName="DropdownMenuShortcut";function eS(e){const t=tS(e),r=l.forwardRef((n,o)=>{const{children:s,...a}=n,i=l.Children.toArray(s),u=i.find(nS);if(u){const d=u.props.children,p=i.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...a,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...a,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function tS(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const a=sS(o),i=oS(s,o.props);return o.type!==l.Fragment&&(i.ref=n?we(n,a):a),l.cloneElement(o,i)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rS=Symbol("radix.slottable");function nS(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rS}function oS(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...i)=>{const u=s(...i);return o(...i),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function sS(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var iS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lr=iS.reduce((e,t)=>{const r=eS(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:a,...i}=o,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function aS(e,t=[]){let r=[];function n(s,a){const i=l.createContext(a),u=r.length;r=[...r,a];const d=f=>{var y;const{scope:m,children:g,...v}=f,h=((y=m==null?void 0:m[e])==null?void 0:y[u])||i,x=l.useMemo(()=>v,Object.values(v));return c.jsx(h.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||i,v=l.useContext(g);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(a=>l.createContext(a));return function(i){const u=(i==null?void 0:i[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return o.scopeName=e,[n,lS(o,...t)]}function lS(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=n.reduce((i,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function cS(e,t){return l.useReducer((r,n)=>t[r][n]??r,e)}var Ps="ScrollArea",[Id]=aS(Ps),[uS,qe]=Id(Ps),kd=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:s=600,...a}=e,[i,u]=l.useState(null),[d,p]=l.useState(null),[f,m]=l.useState(null),[g,v]=l.useState(null),[h,x]=l.useState(null),[y,b]=l.useState(0),[S,C]=l.useState(0),[E,_]=l.useState(!1),[R,k]=l.useState(!1),M=se(t,V=>u(V)),O=Pr(o);return c.jsx(uS,{scope:r,type:n,dir:O,scrollHideDelay:s,scrollArea:i,viewport:d,onViewportChange:p,content:f,onContentChange:m,scrollbarX:g,onScrollbarXChange:v,scrollbarXEnabled:E,onScrollbarXEnabledChange:_,scrollbarY:h,onScrollbarYChange:x,scrollbarYEnabled:R,onScrollbarYEnabledChange:k,onCornerWidthChange:b,onCornerHeightChange:C,children:c.jsx(Lr.div,{dir:O,...a,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});kd.displayName=Ps;var Od="ScrollAreaViewport",$d=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:o,...s}=e,a=qe(Od,r),i=l.useRef(null),u=se(t,i,a.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(Lr.div,{"data-radix-scroll-area-viewport":"",...s,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});$d.displayName=Od;var dt="ScrollAreaScrollbar",As=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=qe(dt,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=o,i=e.orientation==="horizontal";return l.useEffect(()=>(i?s(!0):a(!0),()=>{i?s(!1):a(!1)}),[i,s,a]),o.type==="hover"?c.jsx(dS,{...n,ref:t,forceMount:r}):o.type==="scroll"?c.jsx(fS,{...n,ref:t,forceMount:r}):o.type==="auto"?c.jsx(Ld,{...n,ref:t,forceMount:r}):o.type==="always"?c.jsx(Ts,{...n,ref:t}):null});As.displayName=dt;var dS=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=qe(dt,e.__scopeScrollArea),[s,a]=l.useState(!1);return l.useEffect(()=>{const i=o.scrollArea;let u=0;if(i){const d=()=>{window.clearTimeout(u),a(!0)},p=()=>{u=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",d),i.addEventListener("pointerleave",p),()=>{window.clearTimeout(u),i.removeEventListener("pointerenter",d),i.removeEventListener("pointerleave",p)}}},[o.scrollArea,o.scrollHideDelay]),c.jsx(Ie,{present:r||s,children:c.jsx(Ld,{"data-state":s?"visible":"hidden",...n,ref:t})})}),fS=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=qe(dt,e.__scopeScrollArea),s=e.orientation==="horizontal",a=Wn(()=>u("SCROLL_END"),100),[i,u]=cS("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return l.useEffect(()=>{if(i==="idle"){const d=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(d)}},[i,o.scrollHideDelay,u]),l.useEffect(()=>{const d=o.viewport,p=s?"scrollLeft":"scrollTop";if(d){let f=d[p];const m=()=>{const g=d[p];f!==g&&(u("SCROLL"),a()),f=g};return d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[o.viewport,s,u,a]),c.jsx(Ie,{present:r||i!=="hidden",children:c.jsx(Ts,{"data-state":i==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:G(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:G(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),Ld=l.forwardRef((e,t)=>{const r=qe(dt,e.__scopeScrollArea),{forceMount:n,...o}=e,[s,a]=l.useState(!1),i=e.orientation==="horizontal",u=Wn(()=>{if(r.viewport){const d=r.viewport.offsetWidth<r.viewport.scrollWidth,p=r.viewport.offsetHeight<r.viewport.scrollHeight;a(i?d:p)}},10);return Qt(r.viewport,u),Qt(r.content,u),c.jsx(Ie,{present:n||s,children:c.jsx(Ts,{"data-state":s?"visible":"hidden",...o,ref:t})})}),Ts=l.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=qe(dt,e.__scopeScrollArea),s=l.useRef(null),a=l.useRef(0),[i,u]=l.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Hd(i.viewport,i.content),p={...n,sizes:i,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>s.current=m,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:m=>a.current=m};function f(m,g){return xS(m,a.current,i,g)}return r==="horizontal"?c.jsx(pS,{...p,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const m=o.viewport.scrollLeft,g=Ki(m,i,o.dir);s.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=f(m,o.dir))}}):r==="vertical"?c.jsx(mS,{...p,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const m=o.viewport.scrollTop,g=Ki(m,i);s.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=f(m))}}):null}),pS=l.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,s=qe(dt,e.__scopeScrollArea),[a,i]=l.useState(),u=l.useRef(null),d=se(t,u,s.onScrollbarXChange);return l.useEffect(()=>{u.current&&i(getComputedStyle(u.current))},[u]),c.jsx(Vd,{"data-orientation":"horizontal",...o,ref:d,sizes:r,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Vn(r)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,f)=>{if(s.viewport){const m=s.viewport.scrollLeft+p.deltaX;e.onWheelScroll(m),zd(m,f)&&p.preventDefault()}},onResize:()=>{u.current&&s.viewport&&a&&n({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:an(a.paddingLeft),paddingEnd:an(a.paddingRight)}})}})}),mS=l.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,s=qe(dt,e.__scopeScrollArea),[a,i]=l.useState(),u=l.useRef(null),d=se(t,u,s.onScrollbarYChange);return l.useEffect(()=>{u.current&&i(getComputedStyle(u.current))},[u]),c.jsx(Vd,{"data-orientation":"vertical",...o,ref:d,sizes:r,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Vn(r)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,f)=>{if(s.viewport){const m=s.viewport.scrollTop+p.deltaY;e.onWheelScroll(m),zd(m,f)&&p.preventDefault()}},onResize:()=>{u.current&&s.viewport&&a&&n({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:an(a.paddingTop),paddingEnd:an(a.paddingBottom)}})}})}),[hS,Fd]=Id(dt),Vd=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:i,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:f,...m}=e,g=qe(dt,r),[v,h]=l.useState(null),x=se(t,M=>h(M)),y=l.useRef(null),b=l.useRef(""),S=g.viewport,C=n.content-n.viewport,E=Re(p),_=Re(u),R=Wn(f,10);function k(M){if(y.current){const O=M.clientX-y.current.left,V=M.clientY-y.current.top;d({x:O,y:V})}}return l.useEffect(()=>{const M=O=>{const V=O.target;(v==null?void 0:v.contains(V))&&E(O,C)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[S,v,C,E]),l.useEffect(_,[n,_]),Qt(v,R),Qt(g.content,R),c.jsx(hS,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:Re(s),onThumbPointerUp:Re(a),onThumbPositionChange:_,onThumbPointerDown:Re(i),children:c.jsx(Lr.div,{...m,ref:x,style:{position:"absolute",...m.style},onPointerDown:G(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),y.current=v.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),k(M))}),onPointerMove:G(e.onPointerMove,k),onPointerUp:G(e.onPointerUp,M=>{const O=M.target;O.hasPointerCapture(M.pointerId)&&O.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=b.current,g.viewport&&(g.viewport.style.scrollBehavior=""),y.current=null})})})}),sn="ScrollAreaThumb",Wd=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Fd(sn,e.__scopeScrollArea);return c.jsx(Ie,{present:r||o.hasThumb,children:c.jsx(gS,{ref:t,...n})})}),gS=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,s=qe(sn,r),a=Fd(sn,r),{onThumbPositionChange:i}=a,u=se(t,f=>a.onThumbChange(f)),d=l.useRef(void 0),p=Wn(()=>{d.current&&(d.current(),d.current=void 0)},100);return l.useEffect(()=>{const f=s.viewport;if(f){const m=()=>{if(p(),!d.current){const g=yS(f,i);d.current=g,i()}};return i(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[s.viewport,p,i]),c.jsx(Lr.div,{"data-state":a.hasThumb?"visible":"hidden",...o,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:G(e.onPointerDownCapture,f=>{const g=f.target.getBoundingClientRect(),v=f.clientX-g.left,h=f.clientY-g.top;a.onThumbPointerDown({x:v,y:h})}),onPointerUp:G(e.onPointerUp,a.onThumbPointerUp)})});Wd.displayName=sn;var Ms="ScrollAreaCorner",Bd=l.forwardRef((e,t)=>{const r=qe(Ms,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?c.jsx(vS,{...e,ref:t}):null});Bd.displayName=Ms;var vS=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=qe(Ms,r),[s,a]=l.useState(0),[i,u]=l.useState(0),d=!!(s&&i);return Qt(o.scrollbarX,()=>{var f;const p=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(p),u(p)}),Qt(o.scrollbarY,()=>{var f;const p=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(p),a(p)}),d?c.jsx(Lr.div,{...n,ref:t,style:{width:s,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function an(e){return e?parseInt(e,10):0}function Hd(e,t){const r=e/t;return isNaN(r)?0:r}function Vn(e){const t=Hd(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function xS(e,t,r,n="ltr"){const o=Vn(r),s=o/2,a=t||s,i=o-a,u=r.scrollbar.paddingStart+a,d=r.scrollbar.size-r.scrollbar.paddingEnd-i,p=r.content-r.viewport,f=n==="ltr"?[0,p]:[p*-1,0];return Ud([u,d],f)(e)}function Ki(e,t,r="ltr"){const n=Vn(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,a=t.content-t.viewport,i=s-n,u=r==="ltr"?[0,a]:[a*-1,0],d=uo(e,u);return Ud([0,a],[0,i])(d)}function Ud(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function zd(e,t){return e>0&&e<t}var yS=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},a=r.left!==s.left,i=r.top!==s.top;(a||i)&&t(),r=s,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function Wn(e,t){const r=Re(e),n=l.useRef(0);return l.useEffect(()=>()=>window.clearTimeout(n.current),[]),l.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Qt(e,t){const r=Re(t);Ee(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var Gd=kd,bS=$d,wS=Bd;const Kd=l.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Gd,{ref:n,className:A("relative overflow-hidden",e),...r,children:[c.jsx(bS,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(Ds,{}),c.jsx(wS,{})]}));Kd.displayName=Gd.displayName;const Ds=l.forwardRef(({className:e,orientation:t="vertical",...r},n)=>c.jsx(As,{ref:n,orientation:t,className:A("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:c.jsx(Wd,{className:"relative flex-1 rounded-full bg-border"})}));Ds.displayName=As.displayName;const Yd=dn("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-500/50 text-green-700 dark:text-green-400 [&>svg]:text-green-500",warning:"border-yellow-500/50 text-yellow-700 dark:text-yellow-400 [&>svg]:text-yellow-500",info:"border-blue-500/50 text-blue-700 dark:text-blue-400 [&>svg]:text-blue-500"}},defaultVariants:{variant:"default"}}),Is=l.forwardRef(({className:e,variant:t,...r},n)=>c.jsx("div",{ref:n,role:"alert",className:A(Yd({variant:t}),e),...r}));Is.displayName="Alert";const ks=l.forwardRef(({className:e,...t},r)=>c.jsx("h5",{ref:r,className:A("mb-1 font-medium leading-none tracking-tight",e),...t}));ks.displayName="AlertTitle";const Os=l.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:A("text-sm [&_p]:leading-relaxed",e),...t}));Os.displayName="AlertDescription";const qd=l.forwardRef(({variant:e,title:t,children:r,className:n,...o},s)=>{const a={default:gi,destructive:Ap,success:Pp,warning:_p,info:gi},i=a[e]||a.default;return c.jsxs(Is,{ref:s,variant:e,className:n,...o,children:[c.jsx(i,{className:"h-4 w-4"}),t&&c.jsx(ks,{children:t}),r&&c.jsx(Os,{children:r})]})});qd.displayName="AlertWithIcon";const $s=l.forwardRef(({className:e,...t},r)=>c.jsx("div",{className:"relative w-full overflow-auto",children:c.jsx("table",{ref:r,className:A("w-full caption-bottom text-sm",e),...t})}));$s.displayName="Table";const Ls=l.forwardRef(({className:e,...t},r)=>c.jsx("thead",{ref:r,className:A("[&_tr]:border-b",e),...t}));Ls.displayName="TableHeader";const Fs=l.forwardRef(({className:e,...t},r)=>c.jsx("tbody",{ref:r,className:A("[&_tr:last-child]:border-0",e),...t}));Fs.displayName="TableBody";const Xd=l.forwardRef(({className:e,...t},r)=>c.jsx("tfoot",{ref:r,className:A("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Xd.displayName="TableFooter";const Ht=l.forwardRef(({className:e,...t},r)=>c.jsx("tr",{ref:r,className:A("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Ht.displayName="TableRow";const pr=l.forwardRef(({className:e,...t},r)=>c.jsx("th",{ref:r,className:A("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));pr.displayName="TableHead";const Pt=l.forwardRef(({className:e,...t},r)=>c.jsx("td",{ref:r,className:A("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Pt.displayName="TableCell";const Zd=l.forwardRef(({className:e,...t},r)=>c.jsx("caption",{ref:r,className:A("mt-4 text-sm text-muted-foreground",e),...t}));Zd.displayName="TableCaption";const Vs=l.forwardRef(({options:e=[],value:t,onChange:r,onSearch:n,placeholder:o="Select...",searchPlaceholder:s="Search...",loading:a=!1,disabled:i=!1,multiple:u=!1,clearable:d=!0,className:p,renderOption:f,renderValue:m,getOptionLabel:g=C=>(C==null?void 0:C.label)||(C==null?void 0:C.name)||String(C),getOptionValue:v=C=>(C==null?void 0:C.value)||(C==null?void 0:C.id)||C,filterOption:h,noOptionsMessage:x="No options found",loadingMessage:y="Loading...",...b},S)=>{const[C,E]=l.useState(!1),[_,R]=l.useState(""),[k,M]=l.useState(0),O=l.useRef(null),V=l.useRef(null),P=l.useMemo(()=>_?h?e.filter(L=>h(L,_)):e.filter(L=>g(L).toLowerCase().includes(_.toLowerCase())):e,[e,_,h,g]),$=l.useMemo(()=>xa(L=>{n==null||n(L)},300),[n]),z=L=>{const te=L.target.value;R(te),M(0),$(te)},X=L=>{if(u){const te=Array.isArray(t)?t:[],le=v(L);te.some(ge=>v(ge)===le)?r==null||r(te.filter(ge=>v(ge)!==le)):r==null||r([...te,L])}else r==null||r(L),E(!1),R("")},H=L=>{L.stopPropagation(),r==null||r(u?[]:null),R("")},I=L=>{if(!C){(L.key==="Enter"||L.key===" "||L.key==="ArrowDown")&&(L.preventDefault(),E(!0));return}switch(L.key){case"ArrowDown":L.preventDefault(),M(te=>Math.min(te+1,P.length-1));break;case"ArrowUp":L.preventDefault(),M(te=>Math.max(te-1,0));break;case"Enter":L.preventDefault(),P[k]&&X(P[k]);break;case"Escape":L.preventDefault(),E(!1),R("");break}};l.useEffect(()=>{const L=te=>{O.current&&!O.current.contains(te.target)&&(E(!1),R(""))};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);const U=L=>u?(Array.isArray(t)?t:[]).some(le=>v(le)===v(L)):t&&v(t)===v(L),D=u?Array.isArray(t)&&t.length>0:!!t,re=()=>{if(!D)return c.jsx("span",{className:"text-muted-foreground",children:o});if(m)return m(t);if(u){const L=Array.isArray(t)?t:[];return L.length===1?g(L[0]):`${L.length} selected`}return g(t)};return c.jsxs("div",{ref:O,className:A("relative w-full",p),...b,children:[c.jsxs("button",{ref:S,type:"button",role:"combobox","aria-expanded":C,"aria-haspopup":"listbox",disabled:i,onClick:()=>E(!C),onKeyDown:I,className:A("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",C&&"ring-2 ring-ring ring-offset-2"),children:[c.jsx("span",{className:"flex-1 text-left truncate",children:re()}),c.jsxs("div",{className:"flex items-center gap-1",children:[d&&D&&!i&&c.jsx(xr,{className:"h-4 w-4 opacity-50 hover:opacity-100 cursor-pointer",onClick:H}),c.jsx(To,{className:A("h-4 w-4 opacity-50 transition-transform",C&&"rotate-180")})]})]}),C&&c.jsxs("div",{className:"absolute z-50 mt-1 w-full rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",children:[c.jsxs("div",{className:"flex items-center border-b px-3",children:[c.jsx(Mo,{className:"h-4 w-4 shrink-0 opacity-50"}),c.jsx("input",{ref:V,type:"text",value:_,onChange:z,placeholder:s,className:"flex h-10 w-full bg-transparent py-3 pl-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",autoFocus:!0}),a&&c.jsx(Tt,{className:"h-4 w-4 animate-spin"})]}),c.jsx("div",{className:"max-h-60 overflow-auto p-1",children:a&&P.length===0?c.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:y}):P.length===0?c.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:x}):P.map((L,te)=>c.jsxs("div",{role:"option","aria-selected":U(L),onClick:()=>X(L),onMouseEnter:()=>M(te),className:A("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",k===te&&"bg-accent text-accent-foreground",U(L)&&"bg-accent/50"),children:[u&&c.jsx("div",{className:A("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",U(L)&&"bg-primary text-primary-foreground"),children:U(L)&&c.jsx(vr,{className:"h-3 w-3"})}),f?f(L):c.jsx("span",{className:"flex-1",children:g(L)}),!u&&U(L)&&c.jsx(vr,{className:"ml-auto h-4 w-4"})]},v(L)))})]})]})});Vs.displayName="SearchSelect";const sr=l.forwardRef(({className:e,label:t,description:r,error:n,required:o,children:s,...a},i)=>{const u=l.useId();return c.jsxs("div",{ref:i,className:A("space-y-2",e),...a,children:[t&&c.jsxs(_r,{htmlFor:u,className:A(n&&"text-destructive"),children:[t,o&&c.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.Children.map(s,d=>l.isValidElement(d)?l.cloneElement(d,{id:u,"aria-invalid":!!n}):d),r&&!n&&c.jsx("p",{className:"text-sm text-muted-foreground",children:r}),n&&c.jsx("p",{className:"text-sm text-destructive",children:n})]})});sr.displayName="FormField";const ln=l.forwardRef(({label:e,description:t,error:r,required:n,className:o,inputClassName:s,...a},i)=>c.jsx(sr,{label:e,description:t,error:r,required:n,className:o,children:c.jsx(fn,{ref:i,className:A(r&&"border-destructive",s),...a})}));ln.displayName="QInput";const Ws=l.forwardRef(({label:e,description:t,error:r,required:n,className:o,textareaClassName:s,...a},i)=>c.jsx(sr,{label:e,description:t,error:r,required:n,className:o,children:c.jsx(Do,{ref:i,className:A(r&&"border-destructive",s),...a})}));Ws.displayName="QTextarea";const Bs=l.forwardRef(({label:e,description:t,error:r,required:n,options:o=[],placeholder:s="Select...",className:a,value:i,onChange:u,getOptionLabel:d=g=>(g==null?void 0:g.label)||(g==null?void 0:g.name)||String(g),getOptionValue:p=g=>(g==null?void 0:g.value)||(g==null?void 0:g.id)||g,...f},m)=>c.jsx(sr,{label:e,description:t,error:r,required:n,className:a,children:c.jsxs(rs,{value:i,onValueChange:u,...f,children:[c.jsx(jn,{ref:m,className:A(r&&"border-destructive"),children:c.jsx(ns,{placeholder:s})}),c.jsx(_n,{children:o.map(g=>c.jsx(Pn,{value:String(p(g)),children:d(g)},p(g)))})]})}));Bs.displayName="QSelect";const Hs=l.forwardRef(({label:e,description:t,error:r,required:n,className:o,...s},a)=>c.jsx(sr,{label:e,description:t,error:r,required:n,className:o,children:c.jsx(Vs,{ref:a,...s})}));Hs.displayName="QSearchSelect";const Us=l.forwardRef(({label:e,description:t,error:r,className:n,checked:o,onCheckedChange:s,...a},i)=>{const u=l.useId();return c.jsxs("div",{className:A("flex items-center justify-between space-x-2",n),children:[c.jsxs("div",{className:"space-y-0.5",children:[e&&c.jsx(_r,{htmlFor:u,className:"text-base",children:e}),t&&c.jsx("p",{className:"text-sm text-muted-foreground",children:t}),r&&c.jsx("p",{className:"text-sm text-destructive",children:r})]}),c.jsx(Fo,{ref:i,id:u,checked:o,onCheckedChange:s,...a})]})});Us.displayName="QSwitch";const zs=l.forwardRef(({label:e,description:t,error:r,className:n,checked:o,onCheckedChange:s,...a},i)=>{const u=l.useId();return c.jsxs("div",{className:A("flex items-start space-x-2",n),children:[c.jsx(yr,{ref:i,id:u,checked:o,onCheckedChange:s,className:"mt-1",...a}),c.jsxs("div",{className:"space-y-1 leading-none",children:[e&&c.jsx(_r,{htmlFor:u,children:e}),t&&c.jsx("p",{className:"text-sm text-muted-foreground",children:t}),r&&c.jsx("p",{className:"text-sm text-destructive",children:r})]})]})});zs.displayName="QCheckbox";const Qd=l.forwardRef(({onSubmit:e,className:t,children:r,...n},o)=>{const s=a=>{a.preventDefault(),e==null||e(a)};return c.jsx("form",{ref:o,onSubmit:s,className:A("space-y-4",t),...n,children:r})});Qd.displayName="QForm";const Gs=({currentPage:e=1,totalPages:t=1,totalItems:r=0,pageSize:n=10,pageSizeOptions:o=[10,20,50,100],onPageChange:s,onPageSizeChange:a,showPageSizeSelector:i=!0,showInfo:u=!0,className:d})=>{const p=(e-1)*n+1,f=Math.min(e*n,r),m=e>1,g=e<t,v=()=>{const h=[];if(t<=5)for(let y=1;y<=t;y++)h.push(y);else{h.push(1),e>3&&h.push("...");const y=Math.max(2,e-1),b=Math.min(t-1,e+1);for(let S=y;S<=b;S++)h.push(S);e<t-2&&h.push("..."),t>1&&h.push(t)}return h};return c.jsxs("div",{className:A("flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-4",d),children:[c.jsxs("div",{className:"flex items-center gap-4",children:[i&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm text-muted-foreground",children:"Rows per page"}),c.jsxs(rs,{value:String(n),onValueChange:h=>a==null?void 0:a(Number(h)),children:[c.jsx(jn,{className:"h-8 w-[70px]",children:c.jsx(ns,{placeholder:n})}),c.jsx(_n,{side:"top",children:o.map(h=>c.jsx(Pn,{value:String(h),children:h},h))})]})]}),u&&r>0&&c.jsxs("span",{className:"text-sm text-muted-foreground",children:["Showing ",p," to ",f," of ",r," results"]})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs(ae,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(1),disabled:!m,children:[c.jsx(Rp,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"First page"})]}),c.jsxs(ae,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(e-1),disabled:!m,children:[c.jsx(Ep,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Previous page"})]}),c.jsx("div",{className:"flex items-center gap-1",children:v().map((h,x)=>h==="..."?c.jsx("span",{className:"px-2 text-muted-foreground",children:"..."},`ellipsis-${x}`):c.jsx(ae,{variant:e===h?"default":"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(h),children:h},h))}),c.jsxs(ae,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(e+1),disabled:!g,children:[c.jsx(ba,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Next page"})]}),c.jsxs(ae,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(t),disabled:!g,children:[c.jsx(jp,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Last page"})]})]})]})};Gs.displayName="Pagination";const Jt=({variant:e="spinner",size:t="default",text:r,className:n,fullScreen:o=!1,overlay:s=!1})=>{const a={sm:"h-4 w-4",default:"h-8 w-8",lg:"h-12 w-12",xl:"h-16 w-16"},i=A("flex flex-col items-center justify-center gap-3",o&&"fixed inset-0 z-50",s&&"bg-background/80 backdrop-blur-sm",n),u=()=>{switch(e){case"spinner":return c.jsx(Tt,{className:A("animate-spin text-primary",a[t])});case"dots":return c.jsx("div",{className:"flex gap-1",children:[0,1,2].map(d=>c.jsx("div",{className:A("rounded-full bg-primary animate-bounce",t==="sm"&&"h-1.5 w-1.5",t==="default"&&"h-2 w-2",t==="lg"&&"h-3 w-3",t==="xl"&&"h-4 w-4"),style:{animationDelay:`${d*.15}s`}},d))});case"pulse":return c.jsx("div",{className:A("rounded-full bg-primary animate-pulse",a[t])});case"skeleton":return c.jsxs("div",{className:"space-y-3 w-full max-w-sm",children:[c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse"}),c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-3/4"}),c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-1/2"})]});default:return c.jsx(Tt,{className:A("animate-spin text-primary",a[t])})}};return c.jsxs("div",{className:i,children:[u(),r&&c.jsx("p",{className:"text-sm text-muted-foreground animate-pulse",children:r})]})};Jt.displayName="Loading";const Jd=({loading:e,children:t,text:r,className:n})=>c.jsxs("div",{className:A("relative",n),children:[t,e&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 backdrop-blur-sm rounded-lg",children:c.jsx(Jt,{text:r})})]});Jd.displayName="LoadingOverlay";const ef=l.forwardRef(({loading:e,loadingText:t,children:r,disabled:n,className:o,...s},a)=>c.jsx(ae,{ref:a,disabled:n||e,className:o,...s,children:e?c.jsxs(c.Fragment,{children:[c.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin"}),t||"Loading..."]}):r}));ef.displayName="LoadingButton";const ir=({icon:e=hi,title:t="No data found",description:r="There are no items to display.",action:n,actionLabel:o,onAction:s,variant:a="default",className:i,children:u})=>{const d={default:{icon:hi,title:"No data found",description:"There are no items to display."},search:{icon:Mo,title:"No results found",description:"Try adjusting your search or filters to find what you're looking for."},empty:{icon:wa,title:"Get started",description:"Create your first item to get started."},error:{icon:Sa,title:"Something went wrong",description:"There was an error loading the data. Please try again."}},p=d[a]||d.default,f=e||p.icon,m=t||p.title,g=r||p.description;return c.jsxs("div",{className:A("flex flex-col items-center justify-center py-12 px-4 text-center",i),children:[c.jsx("div",{className:"rounded-full bg-muted p-4 mb-4",children:c.jsx(f,{className:"h-8 w-8 text-muted-foreground"})}),c.jsx("h3",{className:"text-lg font-semibold mb-2",children:m}),c.jsx("p",{className:"text-sm text-muted-foreground mb-6 max-w-sm",children:g}),u,(n||s)&&c.jsx(ae,{onClick:s,children:o||"Take Action"})]})};ir.displayName="EmptyState";const Ks=({searchTerm:e,onClear:t,className:r})=>c.jsx(ir,{variant:"search",title:`No results for "${e}"`,description:"Try searching with different keywords or check your filters.",className:r,children:t&&c.jsx(ae,{variant:"outline",onClick:t,children:"Clear Search"})});Ks.displayName="SearchEmptyState";const tf=({itemName:e="item",onCreate:t,className:r})=>c.jsx(ir,{variant:"empty",icon:wa,title:`No ${e}s yet`,description:`Create your first ${e} to get started.`,onAction:t,actionLabel:`Create ${e}`,className:r});tf.displayName="CreateEmptyState";const rf=({error:e,onRetry:t,className:r})=>c.jsx(ir,{variant:"error",title:"Error loading data",description:(e==null?void 0:e.message)||"Something went wrong. Please try again.",onAction:t,actionLabel:"Try Again",className:r});rf.displayName="ErrorState";const Bn=({open:e,onOpenChange:t,title:r,description:n,children:o,footer:s,size:a="default",showClose:i=!0,className:u,...d})=>{const p={sm:"max-w-sm",default:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[95vw]"};return c.jsx(Dc,{open:e,onOpenChange:t,...d,children:c.jsxs(us,{className:A(p[a],u),children:[(r||n)&&c.jsxs(ds,{children:[r&&c.jsx(fs,{children:r}),n&&c.jsx(ps,{children:n})]}),o,s&&c.jsx(Tn,{children:s})]})})};Bn.displayName="Modal";const Ys=({open:e,onOpenChange:t,onConfirm:r,onCancel:n,title:o="Are you sure?",description:s="This action cannot be undone.",confirmText:a="Confirm",cancelText:i="Cancel",variant:u="default",loading:d=!1,className:p})=>{const f=async()=>{await(r==null?void 0:r())},m=()=>{n==null||n(),t==null||t(!1)};return c.jsx(Bn,{open:e,onOpenChange:t,title:o,description:s,size:"sm",className:p,footer:c.jsxs("div",{className:"flex gap-2 justify-end",children:[c.jsx(ae,{variant:"outline",onClick:m,disabled:d,children:i}),c.jsx(ae,{variant:u==="destructive"?"destructive":"default",onClick:f,disabled:d,children:d?"Loading...":a})]})})};Ys.displayName="ConfirmModal";const Nr=({open:e,onOpenChange:t,onConfirm:r,itemName:n="item",loading:o=!1})=>c.jsx(Ys,{open:e,onOpenChange:t,onConfirm:r,title:`Delete ${n}?`,description:`Are you sure you want to delete this ${n}? This action cannot be undone.`,confirmText:"Delete",variant:"destructive",loading:o});Nr.displayName="DeleteConfirmModal";const nf=({open:e,onOpenChange:t,onSubmit:r,title:n,description:o,children:s,submitText:a="Save",cancelText:i="Cancel",loading:u=!1,size:d="default",className:p})=>{const f=async m=>{m==null||m.preventDefault(),await(r==null?void 0:r())};return c.jsx(Bn,{open:e,onOpenChange:t,title:n,description:o,size:d,className:p,children:c.jsxs("form",{onSubmit:f,children:[c.jsx("div",{className:"py-4",children:s}),c.jsxs(Tn,{children:[c.jsx(ae,{type:"button",variant:"outline",onClick:()=>t==null?void 0:t(!1),disabled:u,children:i}),c.jsx(ae,{type:"submit",disabled:u,children:u?"Saving...":a})]})]})})};nf.displayName="FormModal";const qs=({data:e=[],columns:t=[],loading:r=!1,error:n=null,pagination:o=null,currentPage:s=1,pageSize:a=10,totalItems:i=0,totalPages:u=1,onPageChange:d,onPageSizeChange:p,sortable:f=!0,sortColumn:m=null,sortDirection:g=null,onSort:v,searchable:h=!0,searchValue:x="",onSearchChange:y,searchPlaceholder:b="Search...",selectable:S=!1,selectedRows:C=[],onSelectionChange:E,actions:_=[],onRowClick:R,striped:k=!1,hover:M=!0,compact:O=!1,className:V,emptyTitle:P="No data found",emptyDescription:$="There are no items to display.",emptyAction:z,onEmptyAction:X,getRowKey:H=I=>I.id||I._id})=>{const[I,U]=l.useState(x);l.useEffect(()=>{const T=setTimeout(()=>{y&&I!==x&&y(I)},300);return()=>clearTimeout(T)},[I]);const D=T=>{if(!f||!T.sortable)return;const Q=T.sortKey||T.accessor;let q="asc";m===Q&&(q=g==="asc"?"desc":"asc"),v==null||v(Q,q)},re=T=>{T?E==null||E(e.map(H)):E==null||E([])},L=(T,Q)=>{Q?E==null||E([...C,T]):E==null||E(C.filter(q=>q!==T))},te=e.length>0&&C.length===e.length,le=C.length>0&&C.length<e.length,ue=(T,Q,q)=>{const ne=T.accessor||T.key,J=ne?typeof ne=="function"?ne(Q):Q[ne]:void 0;return T.render?T.render(J,Q,q):T.format?T.format(J,Q):J!==null&&typeof J=="object"?"-":J??"-"},ge=T=>{if(!f||!T.sortable)return null;const Q=T.sortKey||T.accessor;return m!==Q?c.jsx(Sp,{className:"ml-2 h-4 w-4 opacity-50"}):g==="asc"?c.jsx(Cp,{className:"ml-2 h-4 w-4"}):c.jsx(wp,{className:"ml-2 h-4 w-4"})},me=T=>{if(!_||_.length===0)return null;const Q=_.filter(q=>q.hidden?typeof q.hidden=="function"?!q.hidden(T):!q.hidden:!0);return Q.length===0?null:c.jsxs(jd,{children:[c.jsx(_d,{asChild:!0,children:c.jsxs(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[c.jsx(Dp,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Open menu"})]})}),c.jsxs(Ns,{align:"end",children:[c.jsx(js,{children:"Actions"}),c.jsx(_s,{}),Q.map((q,ne)=>c.jsxs(Rs,{onClick:()=>{var J;return(J=q.onClick)==null?void 0:J.call(q,T)},className:A(q.variant==="destructive"&&"text-destructive focus:text-destructive"),disabled:q.disabled,children:[q.icon&&c.jsx(q.icon,{className:"mr-2 h-4 w-4"}),q.label]},q.label||ne))]})]})};return c.jsxs("div",{className:A("w-full",V),children:[(h||C.length>0)&&c.jsxs("div",{className:"flex items-center justify-between gap-4 mb-4",children:[h&&c.jsxs("div",{className:"relative max-w-sm",children:[c.jsx(Mo,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(fn,{placeholder:b,value:I,onChange:T=>U(T.target.value),className:"pl-9 pr-9"}),I&&c.jsx("button",{onClick:()=>{U(""),y==null||y("")},className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:c.jsx(xr,{className:"h-4 w-4"})})]}),S&&C.length>0&&c.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[C.length," row(s) selected",c.jsx(ae,{variant:"ghost",size:"sm",onClick:()=>E==null?void 0:E([]),children:"Clear selection"})]})]}),c.jsx("div",{className:"rounded-md border",children:c.jsxs($s,{children:[c.jsx(Ls,{children:c.jsxs(Ht,{children:[S&&c.jsx(pr,{className:"w-12",children:c.jsx(yr,{checked:te,indeterminate:le,onCheckedChange:re})}),t.map((T,Q)=>c.jsx(pr,{className:A(T.headerClassName,f&&T.sortable&&"cursor-pointer select-none"),style:{width:T.width},onClick:()=>D(T),children:c.jsxs("div",{className:"flex items-center",children:[T.header,ge(T)]})},T.accessor||Q)),_&&_.length>0&&c.jsx(pr,{className:"w-12",children:"Actions"})]})}),c.jsx(Fs,{children:r?c.jsx(Ht,{children:c.jsx(Pt,{colSpan:t.length+(S?1:0)+(_!=null&&_.length?1:0),className:"h-48",children:c.jsx(Jt,{text:"Loading data..."})})}):e.length===0?c.jsx(Ht,{children:c.jsx(Pt,{colSpan:t.length+(S?1:0)+(_!=null&&_.length?1:0),className:"h-48",children:I?c.jsx(Ks,{searchTerm:I,onClear:()=>{U(""),y==null||y("")}}):c.jsx(ir,{title:P,description:$,onAction:X,actionLabel:z})})}):e.map((T,Q)=>{const q=H(T),ne=C.includes(q);return c.jsxs(Ht,{"data-state":ne?"selected":void 0,className:A(k&&Q%2===1&&"bg-muted/50",M&&"cursor-pointer",R&&"hover:bg-muted"),onClick:()=>R==null?void 0:R(T),children:[S&&c.jsx(Pt,{onClick:J=>J.stopPropagation(),children:c.jsx(yr,{checked:ne,onCheckedChange:J=>L(q,J)})}),t.map((J,B)=>c.jsx(Pt,{className:A(O&&"py-2",J.cellClassName),children:ue(J,T,Q)},J.accessor||B)),_&&_.length>0&&c.jsx(Pt,{onClick:J=>J.stopPropagation(),children:me(T)})]},q)})})]})}),!r&&e.length>0&&o!==!1&&c.jsx(Gs,{currentPage:s,totalPages:u,totalItems:i,pageSize:a,onPageChange:d,onPageSizeChange:p})]})};qs.displayName="DataTable";const of=({store:e,data:t,loading:r=!1,error:n=null,columns:o=[],currentPage:s=1,pageSize:a=10,totalItems:i=0,totalPages:u=1,onPageChange:d,onPageSizeChange:p,sortColumn:f,sortDirection:m,onSort:g,searchValue:v="",onSearchChange:h,searchPlaceholder:x="Search...",selectable:y=!1,selectedRows:b=[],onSelectionChange:S,onCreate:C,onView:E,onEdit:_,onDelete:R,onRefresh:k,onExport:M,createPath:O,detailPath:V,editPath:P,additionalActions:$=[],bulkActions:z=[],title:X,description:H,createLabel:I="Create",refreshLabel:U="Refresh",exportLabel:D="Export",viewLabel:re="View",editLabel:L="Edit",deleteLabel:te="Delete",itemName:le="item",getRowKey:ue=ve=>ve.id||ve._id,showHeader:ge=!0,showToolbar:me=!0,compact:T=!1,className:Q,deleteConfirmTitle:q,deleteConfirmDescription:ne,getDeleteItemName:J,filters:B,headerActions:ee,searchable:ye=!0})=>{const ve=gr.useNavigate(),[ke,Fe]=l.useState(!1),[Oe,Ve]=l.useState(null),[w,N]=l.useState(!1),[j,K]=l.useState(""),W=l.useRef(!1),F=l.useRef(j),Z=l.useRef(null),ce=l.useRef(null),de=(e==null?void 0:e.items)??t??[],je=(e==null?void 0:e.loading)??r,$e=(e==null?void 0:e.error)??n,Ae=(e==null?void 0:e.pagination)??{page:s,pageSize:a,total:i,totalPages:u},Me=Ae.page??s,Pe=Ae.pageSize??a,vt=Ae.total??i,Xe=Ae.totalPages??u,Ne=e==null?void 0:e.fetchList,$t=e==null?void 0:e.delete,nt=e==null?void 0:e.setPage,Un=e==null?void 0:e.setPageSize,_t=e==null?void 0:e.setFilters;l.useEffect(()=>{Ne&&!W.current&&(W.current=!0,Z.current=Me,ce.current=Pe,Ne())},[Ne]),l.useEffect(()=>{if(!Ne||!W.current)return;const ie=Z.current!==Me,Gn=ce.current!==Pe;(ie||Gn)&&(Z.current=Me,ce.current=Pe,Ne())},[Me,Pe,Ne]),l.useEffect(()=>{if(!Ne||!W.current||F.current===j)return;const ie=setTimeout(()=>{ye&&(F.current=j,_t==null||_t({search:j}),Me!==1?nt==null||nt(1):Ne())},300);return()=>clearTimeout(ie)},[j,ye,Me,_t,nt,Ne]);const xf=l.useCallback(ie=>{nt?nt(ie):d==null||d(ie)},[nt,d]),yf=l.useCallback(ie=>{Un?Un(ie):p==null||p(ie)},[Un,p]),bf=l.useCallback(ie=>{_t?K(ie):h==null||h(ie)},[_t,h]),ti=l.useCallback(()=>{O?ve(O):C==null||C()},[O,ve,C]),ri=l.useCallback(ie=>{V?ve(`${V}/${ue(ie)}`):E==null||E(ie)},[V,ve,ue,E]),ni=l.useCallback(ie=>{P?ve(`${P}/${ue(ie)}/edit`):_==null||_(ie)},[P,ve,ue,_]),wf=l.useCallback(()=>{Ne?Ne():k==null||k()},[Ne,k]),oi=l.useCallback(ie=>{Ve(ie),Fe(!0)},[]),Sf=async()=>{if(Oe){N(!0);try{$t?(await $t(ue(Oe)),Ne==null||Ne()):R&&await R(Oe),Fe(!1),Ve(null)}catch(ie){console.error("Delete error:",ie)}finally{N(!1)}}},Cf=l.useMemo(()=>{const ie=[];return(V||E)&&ie.push({label:re,icon:Ip,onClick:ri}),(P||_)&&ie.push({label:L,icon:lo,onClick:ni}),($t||R)&&ie.push({label:te,icon:co,variant:"destructive",onClick:oi}),[...ie,...$]},[V,P,E,_,$t,R,re,L,te,ri,ni,oi,$]),zn=O||C,Ef=Ne||k,si=l.useMemo(()=>Oe?J?J(Oe):Oe.name||Oe.title||le:le,[Oe,J,le]),ii=()=>me?c.jsxs("div",{className:"flex items-center gap-2",children:[ee,y&&b.length>0&&z.length>0&&c.jsx(c.Fragment,{children:z.map((ie,Gn)=>c.jsxs(ae,{variant:ie.variant||"outline",size:"sm",onClick:()=>{var li;return(li=ie.onClick)==null?void 0:li.call(ie,b)},disabled:ie.disabled,children:[ie.icon&&c.jsx(ie.icon,{className:"mr-2 h-4 w-4"}),ie.label]},ie.label||Gn))}),M&&c.jsxs(ae,{variant:"outline",size:"sm",onClick:M,children:[c.jsx(Mp,{className:"mr-2 h-4 w-4"}),D]}),Ef&&c.jsxs(ae,{variant:"outline",size:"sm",onClick:wf,disabled:je,children:[c.jsx(Sa,{className:A("mr-2 h-4 w-4",je&&"animate-spin")}),U]}),zn&&c.jsxs(ae,{size:"sm",onClick:ti,children:[c.jsx(Op,{className:"mr-2 h-4 w-4"}),I]})]}):null,ai=c.jsxs(c.Fragment,{children:[B&&c.jsx("div",{className:"mb-4 flex items-center gap-2",children:B}),c.jsx(qs,{data:de,columns:o,loading:je,error:$e,currentPage:Me,pageSize:Pe,totalItems:vt,totalPages:Xe,onPageChange:xf,onPageSizeChange:yf,sortColumn:f,sortDirection:m,onSort:g,searchable:ye,searchValue:_t?j:v,onSearchChange:bf,searchPlaceholder:x,selectable:y,selectedRows:b,onSelectionChange:S,actions:Cf,getRowKey:ue,compact:T,emptyTitle:`No ${le}s found`,emptyDescription:`Create your first ${le} to get started.`,emptyAction:zn?`Create ${le}`:void 0,onEmptyAction:zn?ti:void 0}),c.jsx(Nr,{open:ke,onOpenChange:Fe,onConfirm:Sf,title:q||`Delete ${le}`,description:ne||`Are you sure you want to delete "${si}"? This action cannot be undone.`,itemName:si,loading:w})]});return ge&&(X||H)?c.jsxs(Ge,{className:Q,children:[c.jsxs(Kt,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[c.jsxs("div",{children:[X&&c.jsx(Yt,{children:X}),H&&c.jsx(qt,{children:H})]}),ii()]}),c.jsx(Ke,{children:ai})]}):c.jsxs("div",{className:Q,children:[me&&c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("div",{}),ii()]}),ai]})};of.displayName="CrudList";var Fr=e=>e.type==="checkbox",At=e=>e instanceof Date,Le=e=>e==null;const sf=e=>typeof e=="object";var Ce=e=>!Le(e)&&!Array.isArray(e)&&sf(e)&&!At(e),SS=e=>Ce(e)&&e.target?Fr(e.target)?e.target.checked:e.target.value:e,CS=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,ES=(e,t)=>e.has(CS(t)),NS=e=>{const t=e.constructor&&e.constructor.prototype;return Ce(t)&&t.hasOwnProperty("isPrototypeOf")},Xs=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function _e(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Xs&&(e instanceof Blob||n))&&(r||Ce(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!NS(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=_e(e[o]));else return e;return t}var Hn=e=>/^\w*$/.test(e),be=e=>e===void 0,Zs=e=>Array.isArray(e)?e.filter(Boolean):[],Qs=e=>Zs(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Y=(e,t,r)=>{if(!t||!Ce(e))return r;const n=(Hn(t)?[t]:Qs(t)).reduce((o,s)=>Le(o)?o:o[s],e);return be(n)||n===e?be(e[t])?r:e[t]:n},ot=e=>typeof e=="boolean",he=(e,t,r)=>{let n=-1;const o=Hn(t)?[t]:Qs(t),s=o.length,a=s-1;for(;++n<s;){const i=o[n];let u=r;if(n!==a){const d=e[i];u=Ce(d)||Array.isArray(d)?d:isNaN(+o[n+1])?{}:[]}if(i==="__proto__"||i==="constructor"||i==="prototype")return;e[i]=u,e=e[i]}};const Yi={BLUR:"blur",FOCUS_OUT:"focusout"},Qe={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},pt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},RS=pe.createContext(null);RS.displayName="HookFormContext";var jS=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const a=s;return t._proxyFormState[a]!==Qe.all&&(t._proxyFormState[a]=!n||Qe.all),e[a]}});return o};const _S=typeof window<"u"?pe.useLayoutEffect:pe.useEffect;var Be=e=>typeof e=="string",PS=(e,t,r,n,o)=>Be(e)?(n&&t.watch.add(e),Y(r,e,o)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),Y(r,s))):(n&&(t.watchAll=!0),r),jo=e=>Le(e)||!sf(e);function wt(e,t,r=new WeakSet){if(jo(e)||jo(t))return Object.is(e,t);if(At(e)&&At(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const s of n){const a=e[s];if(!o.includes(s))return!1;if(s!=="ref"){const i=t[s];if(At(a)&&At(i)||Ce(a)&&Ce(i)||Array.isArray(a)&&Array.isArray(i)?!wt(a,i,r):!Object.is(a,i))return!1}}return!0}var af=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},mr=e=>Array.isArray(e)?e:[e],qi=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function lf(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],s=t[n];if(o&&Ce(o)&&s){const a=lf(o,s);Ce(a)&&(r[n]=a)}else e[n]&&(r[n]=s)}return r}var De=e=>Ce(e)&&!Object.keys(e).length,Js=e=>e.type==="file",Je=e=>typeof e=="function",cn=e=>{if(!Xs)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},cf=e=>e.type==="select-multiple",ei=e=>e.type==="radio",AS=e=>ei(e)||Fr(e),io=e=>cn(e)&&e.isConnected;function TS(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=be(e)?n++:e[t[n++]];return e}function MS(e){for(const t in e)if(e.hasOwnProperty(t)&&!be(e[t]))return!1;return!0}function Se(e,t){const r=Array.isArray(t)?t:Hn(t)?[t]:Qs(t),n=r.length===1?e:TS(e,r),o=r.length-1,s=r[o];return n&&delete n[s],o!==0&&(Ce(n)&&De(n)||Array.isArray(n)&&MS(n))&&Se(e,r.slice(0,-1)),e}var DS=e=>{for(const t in e)if(Je(e[t]))return!0;return!1};function uf(e){return Array.isArray(e)||Ce(e)&&!DS(e)}function _o(e,t={}){for(const r in e){const n=e[r];uf(n)?(t[r]=Array.isArray(n)?[]:{},_o(n,t[r])):be(n)||(t[r]=!0)}return t}function Bt(e,t,r){r||(r=_o(t));for(const n in e){const o=e[n];if(uf(o))be(t)||jo(r[n])?r[n]=_o(o,Array.isArray(o)?[]:{}):Bt(o,Le(t)?{}:t[n],r[n]);else{const s=t[n];r[n]=!wt(o,s)}}return r}const Xi={value:!1,isValid:!1},Zi={value:!0,isValid:!0};var df=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!be(e[0].attributes.value)?be(e[0].value)||e[0].value===""?Zi:{value:e[0].value,isValid:!0}:Zi:Xi}return Xi},ff=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>be(e)?e:t?e===""?NaN:e&&+e:r&&Be(e)?new Date(e):n?n(e):e;const Qi={isValid:!1,value:null};var pf=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Qi):Qi;function Ji(e){const t=e.ref;return Js(t)?t.files:ei(t)?pf(e.refs).value:cf(t)?[...t.selectedOptions].map(({value:r})=>r):Fr(t)?df(e.refs).value:ff(be(t.value)?e.ref.value:t.value,e)}var IS=(e,t,r,n)=>{const o={};for(const s of e){const a=Y(t,s);a&&he(o,s,a._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},un=e=>e instanceof RegExp,cr=e=>be(e)?e:un(e)?e.source:Ce(e)?un(e.value)?e.value.source:e.value:e,ea=e=>({isOnSubmit:!e||e===Qe.onSubmit,isOnBlur:e===Qe.onBlur,isOnChange:e===Qe.onChange,isOnAll:e===Qe.all,isOnTouch:e===Qe.onTouched});const ta="AsyncFunction";var kS=e=>!!e&&!!e.validate&&!!(Je(e.validate)&&e.validate.constructor.name===ta||Ce(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===ta)),OS=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ra=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const hr=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const s=Y(e,o);if(s){const{_f:a,...i}=s;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(hr(i,t))break}else if(Ce(i)&&hr(i,t))break}}};function na(e,t,r){const n=Y(e,r);if(n||Hn(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const s=o.join("."),a=Y(t,s),i=Y(e,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(i&&i.type)return{name:s,error:i};if(i&&i.root&&i.root.type)return{name:`${s}.root`,error:i.root};o.pop()}return{name:r}}var $S=(e,t,r,n)=>{r(e);const{name:o,...s}=e;return De(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(a=>t[a]===(!n||Qe.all))},LS=(e,t,r)=>!e||!t||e===t||mr(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),FS=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,VS=(e,t)=>!Zs(Y(e,t)).length&&Se(e,t),WS=(e,t,r)=>{const n=mr(Y(e,r));return he(n,"root",t[r]),he(e,r,n),e};function oa(e,t,r="validate"){if(Be(e)||Array.isArray(e)&&e.every(Be)||ot(e)&&!e)return{type:r,message:Be(e)?e:"",ref:t}}var Wt=e=>Ce(e)&&!un(e)?e:{value:e,message:""},sa=async(e,t,r,n,o,s)=>{const{ref:a,refs:i,required:u,maxLength:d,minLength:p,min:f,max:m,pattern:g,validate:v,name:h,valueAsNumber:x,mount:y}=e._f,b=Y(r,h);if(!y||t.has(h))return{};const S=i?i[0]:a,C=P=>{o&&S.reportValidity&&(S.setCustomValidity(ot(P)?"":P||""),S.reportValidity())},E={},_=ei(a),R=Fr(a),k=_||R,M=(x||Js(a))&&be(a.value)&&be(b)||cn(a)&&a.value===""||b===""||Array.isArray(b)&&!b.length,O=af.bind(null,h,n,E),V=(P,$,z,X=pt.maxLength,H=pt.minLength)=>{const I=P?$:z;E[h]={type:P?X:H,message:I,ref:a,...O(P?X:H,I)}};if(s?!Array.isArray(b)||!b.length:u&&(!k&&(M||Le(b))||ot(b)&&!b||R&&!df(i).isValid||_&&!pf(i).isValid)){const{value:P,message:$}=Be(u)?{value:!!u,message:u}:Wt(u);if(P&&(E[h]={type:pt.required,message:$,ref:S,...O(pt.required,$)},!n))return C($),E}if(!M&&(!Le(f)||!Le(m))){let P,$;const z=Wt(m),X=Wt(f);if(!Le(b)&&!isNaN(b)){const H=a.valueAsNumber||b&&+b;Le(z.value)||(P=H>z.value),Le(X.value)||($=H<X.value)}else{const H=a.valueAsDate||new Date(b),I=re=>new Date(new Date().toDateString()+" "+re),U=a.type=="time",D=a.type=="week";Be(z.value)&&b&&(P=U?I(b)>I(z.value):D?b>z.value:H>new Date(z.value)),Be(X.value)&&b&&($=U?I(b)<I(X.value):D?b<X.value:H<new Date(X.value))}if((P||$)&&(V(!!P,z.message,X.message,pt.max,pt.min),!n))return C(E[h].message),E}if((d||p)&&!M&&(Be(b)||s&&Array.isArray(b))){const P=Wt(d),$=Wt(p),z=!Le(P.value)&&b.length>+P.value,X=!Le($.value)&&b.length<+$.value;if((z||X)&&(V(z,P.message,$.message),!n))return C(E[h].message),E}if(g&&!M&&Be(b)){const{value:P,message:$}=Wt(g);if(un(P)&&!b.match(P)&&(E[h]={type:pt.pattern,message:$,ref:a,...O(pt.pattern,$)},!n))return C($),E}if(v){if(Je(v)){const P=await v(b,r),$=oa(P,S);if($&&(E[h]={...$,...O(pt.validate,$.message)},!n))return C($.message),E}else if(Ce(v)){let P={};for(const $ in v){if(!De(P)&&!n)break;const z=oa(await v[$](b,r),S,$);z&&(P={...z,...O($,z.message)},C(z.message),n&&(E[h]=P))}if(!De(P)&&(E[h]={ref:S,...P},!n))return E}}return C(!0),E};const BS={mode:Qe.onSubmit,reValidateMode:Qe.onChange,shouldFocusError:!0};function HS(e={}){let t={...BS,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Je(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},o=Ce(t.defaultValues)||Ce(t.values)?_e(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:_e(o),a={action:!1,mount:!1,watch:!1},i={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,d=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...p};const m={array:qi(),state:qi()},g=t.criteriaMode===Qe.all,v=w=>N=>{clearTimeout(d),d=setTimeout(w,N)},h=async w=>{if(!t.disabled&&(p.isValid||f.isValid||w)){const N=t.resolver?De((await R()).errors):await M(n,!0);N!==r.isValid&&m.state.next({isValid:N})}},x=(w,N)=>{!t.disabled&&(p.isValidating||p.validatingFields||f.isValidating||f.validatingFields)&&((w||Array.from(i.mount)).forEach(j=>{j&&(N?he(r.validatingFields,j,N):Se(r.validatingFields,j))}),m.state.next({validatingFields:r.validatingFields,isValidating:!De(r.validatingFields)}))},y=(w,N=[],j,K,W=!0,F=!0)=>{if(K&&j&&!t.disabled){if(a.action=!0,F&&Array.isArray(Y(n,w))){const Z=j(Y(n,w),K.argA,K.argB);W&&he(n,w,Z)}if(F&&Array.isArray(Y(r.errors,w))){const Z=j(Y(r.errors,w),K.argA,K.argB);W&&he(r.errors,w,Z),VS(r.errors,w)}if((p.touchedFields||f.touchedFields)&&F&&Array.isArray(Y(r.touchedFields,w))){const Z=j(Y(r.touchedFields,w),K.argA,K.argB);W&&he(r.touchedFields,w,Z)}(p.dirtyFields||f.dirtyFields)&&(r.dirtyFields=Bt(o,s)),m.state.next({name:w,isDirty:V(w,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else he(s,w,N)},b=(w,N)=>{he(r.errors,w,N),m.state.next({errors:r.errors})},S=w=>{r.errors=w,m.state.next({errors:r.errors,isValid:!1})},C=(w,N,j,K)=>{const W=Y(n,w);if(W){const F=Y(s,w,be(j)?Y(o,w):j);be(F)||K&&K.defaultChecked||N?he(s,w,N?F:Ji(W._f)):z(w,F),a.mount&&!a.action&&h()}},E=(w,N,j,K,W)=>{let F=!1,Z=!1;const ce={name:w};if(!t.disabled){if(!j||K){(p.isDirty||f.isDirty)&&(Z=r.isDirty,r.isDirty=ce.isDirty=V(),F=Z!==ce.isDirty);const de=wt(Y(o,w),N);Z=!!Y(r.dirtyFields,w),de?Se(r.dirtyFields,w):he(r.dirtyFields,w,!0),ce.dirtyFields=r.dirtyFields,F=F||(p.dirtyFields||f.dirtyFields)&&Z!==!de}if(j){const de=Y(r.touchedFields,w);de||(he(r.touchedFields,w,j),ce.touchedFields=r.touchedFields,F=F||(p.touchedFields||f.touchedFields)&&de!==j)}F&&W&&m.state.next(ce)}return F?ce:{}},_=(w,N,j,K)=>{const W=Y(r.errors,w),F=(p.isValid||f.isValid)&&ot(N)&&r.isValid!==N;if(t.delayError&&j?(u=v(()=>b(w,j)),u(t.delayError)):(clearTimeout(d),u=null,j?he(r.errors,w,j):Se(r.errors,w)),(j?!wt(W,j):W)||!De(K)||F){const Z={...K,...F&&ot(N)?{isValid:N}:{},errors:r.errors,name:w};r={...r,...Z},m.state.next(Z)}},R=async w=>{x(w,!0);const N=await t.resolver(s,t.context,IS(w||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return x(w),N},k=async w=>{const{errors:N}=await R(w);if(w)for(const j of w){const K=Y(N,j);K?he(r.errors,j,K):Se(r.errors,j)}else r.errors=N;return N},M=async(w,N,j={valid:!0})=>{for(const K in w){const W=w[K];if(W){const{_f:F,...Z}=W;if(F){const ce=i.array.has(F.name),de=W._f&&kS(W._f);de&&p.validatingFields&&x([F.name],!0);const je=await sa(W,i.disabled,s,g,t.shouldUseNativeValidation&&!N,ce);if(de&&p.validatingFields&&x([F.name]),je[F.name]&&(j.valid=!1,N))break;!N&&(Y(je,F.name)?ce?WS(r.errors,je,F.name):he(r.errors,F.name,je[F.name]):Se(r.errors,F.name))}!De(Z)&&await M(Z,N,j)}}return j.valid},O=()=>{for(const w of i.unMount){const N=Y(n,w);N&&(N._f.refs?N._f.refs.every(j=>!io(j)):!io(N._f.ref))&&T(w)}i.unMount=new Set},V=(w,N)=>!t.disabled&&(w&&N&&he(s,w,N),!wt(re(),o)),P=(w,N,j)=>PS(w,i,{...a.mount?s:be(N)?o:Be(w)?{[w]:N}:N},j,N),$=w=>Zs(Y(a.mount?s:o,w,t.shouldUnregister?Y(o,w,[]):[])),z=(w,N,j={})=>{const K=Y(n,w);let W=N;if(K){const F=K._f;F&&(!F.disabled&&he(s,w,ff(N,F)),W=cn(F.ref)&&Le(N)?"":N,cf(F.ref)?[...F.ref.options].forEach(Z=>Z.selected=W.includes(Z.value)):F.refs?Fr(F.ref)?F.refs.forEach(Z=>{(!Z.defaultChecked||!Z.disabled)&&(Array.isArray(W)?Z.checked=!!W.find(ce=>ce===Z.value):Z.checked=W===Z.value||!!W)}):F.refs.forEach(Z=>Z.checked=Z.value===W):Js(F.ref)?F.ref.value="":(F.ref.value=W,F.ref.type||m.state.next({name:w,values:_e(s)})))}(j.shouldDirty||j.shouldTouch)&&E(w,W,j.shouldTouch,j.shouldDirty,!0),j.shouldValidate&&D(w)},X=(w,N,j)=>{for(const K in N){if(!N.hasOwnProperty(K))return;const W=N[K],F=w+"."+K,Z=Y(n,F);(i.array.has(w)||Ce(W)||Z&&!Z._f)&&!At(W)?X(F,W,j):z(F,W,j)}},H=(w,N,j={})=>{const K=Y(n,w),W=i.array.has(w),F=_e(N);he(s,w,F),W?(m.array.next({name:w,values:_e(s)}),(p.isDirty||p.dirtyFields||f.isDirty||f.dirtyFields)&&j.shouldDirty&&m.state.next({name:w,dirtyFields:Bt(o,s),isDirty:V(w,F)})):K&&!K._f&&!Le(F)?X(w,F,j):z(w,F,j),ra(w,i)&&m.state.next({...r,name:w}),m.state.next({name:a.mount?w:void 0,values:_e(s)})},I=async w=>{a.mount=!0;const N=w.target;let j=N.name,K=!0;const W=Y(n,j),F=de=>{K=Number.isNaN(de)||At(de)&&isNaN(de.getTime())||wt(de,Y(s,j,de))},Z=ea(t.mode),ce=ea(t.reValidateMode);if(W){let de,je;const $e=N.type?Ji(W._f):SS(w),Ae=w.type===Yi.BLUR||w.type===Yi.FOCUS_OUT,Me=!OS(W._f)&&!t.resolver&&!Y(r.errors,j)&&!W._f.deps||FS(Ae,Y(r.touchedFields,j),r.isSubmitted,ce,Z),Pe=ra(j,i,Ae);he(s,j,$e),Ae?(!N||!N.readOnly)&&(W._f.onBlur&&W._f.onBlur(w),u&&u(0)):W._f.onChange&&W._f.onChange(w);const vt=E(j,$e,Ae),Xe=!De(vt)||Pe;if(!Ae&&m.state.next({name:j,type:w.type,values:_e(s)}),Me)return(p.isValid||f.isValid)&&(t.mode==="onBlur"?Ae&&h():Ae||h()),Xe&&m.state.next({name:j,...Pe?{}:vt});if(!Ae&&Pe&&m.state.next({...r}),t.resolver){const{errors:Ne}=await R([j]);if(F($e),K){const $t=na(r.errors,n,j),nt=na(Ne,n,$t.name||j);de=nt.error,j=nt.name,je=De(Ne)}}else x([j],!0),de=(await sa(W,i.disabled,s,g,t.shouldUseNativeValidation))[j],x([j]),F($e),K&&(de?je=!1:(p.isValid||f.isValid)&&(je=await M(n,!0)));K&&(W._f.deps&&(!Array.isArray(W._f.deps)||W._f.deps.length>0)&&D(W._f.deps),_(j,je,de,vt))}},U=(w,N)=>{if(Y(r.errors,N)&&w.focus)return w.focus(),1},D=async(w,N={})=>{let j,K;const W=mr(w);if(t.resolver){const F=await k(be(w)?w:W);j=De(F),K=w?!W.some(Z=>Y(F,Z)):j}else w?(K=(await Promise.all(W.map(async F=>{const Z=Y(n,F);return await M(Z&&Z._f?{[F]:Z}:Z)}))).every(Boolean),!(!K&&!r.isValid)&&h()):K=j=await M(n);return m.state.next({...!Be(w)||(p.isValid||f.isValid)&&j!==r.isValid?{}:{name:w},...t.resolver||!w?{isValid:j}:{},errors:r.errors}),N.shouldFocus&&!K&&hr(n,U,w?W:i.mount),K},re=(w,N)=>{let j={...a.mount?s:o};return N&&(j=lf(N.dirtyFields?r.dirtyFields:r.touchedFields,j)),be(w)?j:Be(w)?Y(j,w):w.map(K=>Y(j,K))},L=(w,N)=>({invalid:!!Y((N||r).errors,w),isDirty:!!Y((N||r).dirtyFields,w),error:Y((N||r).errors,w),isValidating:!!Y(r.validatingFields,w),isTouched:!!Y((N||r).touchedFields,w)}),te=w=>{w&&mr(w).forEach(N=>Se(r.errors,N)),m.state.next({errors:w?r.errors:{}})},le=(w,N,j)=>{const K=(Y(n,w,{_f:{}})._f||{}).ref,W=Y(r.errors,w)||{},{ref:F,message:Z,type:ce,...de}=W;he(r.errors,w,{...de,...N,ref:K}),m.state.next({name:w,errors:r.errors,isValid:!1}),j&&j.shouldFocus&&K&&K.focus&&K.focus()},ue=(w,N)=>Je(w)?m.state.subscribe({next:j=>"values"in j&&w(P(void 0,N),j)}):P(w,N,!0),ge=w=>m.state.subscribe({next:N=>{LS(w.name,N.name,w.exact)&&$S(N,w.formState||p,Fe,w.reRenderRoot)&&w.callback({values:{...s},...r,...N,defaultValues:o})}}).unsubscribe,me=w=>(a.mount=!0,f={...f,...w.formState},ge({...w,formState:f})),T=(w,N={})=>{for(const j of w?mr(w):i.mount)i.mount.delete(j),i.array.delete(j),N.keepValue||(Se(n,j),Se(s,j)),!N.keepError&&Se(r.errors,j),!N.keepDirty&&Se(r.dirtyFields,j),!N.keepTouched&&Se(r.touchedFields,j),!N.keepIsValidating&&Se(r.validatingFields,j),!t.shouldUnregister&&!N.keepDefaultValue&&Se(o,j);m.state.next({values:_e(s)}),m.state.next({...r,...N.keepDirty?{isDirty:V()}:{}}),!N.keepIsValid&&h()},Q=({disabled:w,name:N})=>{(ot(w)&&a.mount||w||i.disabled.has(N))&&(w?i.disabled.add(N):i.disabled.delete(N))},q=(w,N={})=>{let j=Y(n,w);const K=ot(N.disabled)||ot(t.disabled);return he(n,w,{...j||{},_f:{...j&&j._f?j._f:{ref:{name:w}},name:w,mount:!0,...N}}),i.mount.add(w),j?Q({disabled:ot(N.disabled)?N.disabled:t.disabled,name:w}):C(w,!0,N.value),{...K?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:cr(N.min),max:cr(N.max),minLength:cr(N.minLength),maxLength:cr(N.maxLength),pattern:cr(N.pattern)}:{},name:w,onChange:I,onBlur:I,ref:W=>{if(W){q(w,N),j=Y(n,w);const F=be(W.value)&&W.querySelectorAll&&W.querySelectorAll("input,select,textarea")[0]||W,Z=AS(F),ce=j._f.refs||[];if(Z?ce.find(de=>de===F):F===j._f.ref)return;he(n,w,{_f:{...j._f,...Z?{refs:[...ce.filter(io),F,...Array.isArray(Y(o,w))?[{}]:[]],ref:{type:F.type,name:w}}:{ref:F}}}),C(w,!1,void 0,F)}else j=Y(n,w,{}),j._f&&(j._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(ES(i.array,w)&&a.action)&&i.unMount.add(w)}}},ne=()=>t.shouldFocusError&&hr(n,U,i.mount),J=w=>{ot(w)&&(m.state.next({disabled:w}),hr(n,(N,j)=>{const K=Y(n,j);K&&(N.disabled=K._f.disabled||w,Array.isArray(K._f.refs)&&K._f.refs.forEach(W=>{W.disabled=K._f.disabled||w}))},0,!1))},B=(w,N)=>async j=>{let K;j&&(j.preventDefault&&j.preventDefault(),j.persist&&j.persist());let W=_e(s);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:F,values:Z}=await R();r.errors=F,W=_e(Z)}else await M(n);if(i.disabled.size)for(const F of i.disabled)Se(W,F);if(Se(r.errors,"root"),De(r.errors)){m.state.next({errors:{}});try{await w(W,j)}catch(F){K=F}}else N&&await N({...r.errors},j),ne(),setTimeout(ne);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:De(r.errors)&&!K,submitCount:r.submitCount+1,errors:r.errors}),K)throw K},ee=(w,N={})=>{Y(n,w)&&(be(N.defaultValue)?H(w,_e(Y(o,w))):(H(w,N.defaultValue),he(o,w,_e(N.defaultValue))),N.keepTouched||Se(r.touchedFields,w),N.keepDirty||(Se(r.dirtyFields,w),r.isDirty=N.defaultValue?V(w,_e(Y(o,w))):V()),N.keepError||(Se(r.errors,w),p.isValid&&h()),m.state.next({...r}))},ye=(w,N={})=>{const j=w?_e(w):o,K=_e(j),W=De(w),F=W?o:K;if(N.keepDefaultValues||(o=j),!N.keepValues){if(N.keepDirtyValues){const Z=new Set([...i.mount,...Object.keys(Bt(o,s))]);for(const ce of Array.from(Z))Y(r.dirtyFields,ce)?he(F,ce,Y(s,ce)):H(ce,Y(F,ce))}else{if(Xs&&be(w))for(const Z of i.mount){const ce=Y(n,Z);if(ce&&ce._f){const de=Array.isArray(ce._f.refs)?ce._f.refs[0]:ce._f.ref;if(cn(de)){const je=de.closest("form");if(je){je.reset();break}}}}if(N.keepFieldsRef)for(const Z of i.mount)H(Z,Y(F,Z));else n={}}s=t.shouldUnregister?N.keepDefaultValues?_e(o):{}:_e(F),m.array.next({values:{...F}}),m.state.next({values:{...F}})}i={mount:N.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!p.isValid||!!N.keepIsValid||!!N.keepDirtyValues||!t.shouldUnregister&&!De(F),a.watch=!!t.shouldUnregister,a.action=!1,N.keepErrors||(r.errors={}),m.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:W?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!wt(w,o)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:W?{}:N.keepDirtyValues?N.keepDefaultValues&&s?Bt(o,s):r.dirtyFields:N.keepDefaultValues&&w?Bt(o,w):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},ve=(w,N)=>ye(Je(w)?w(s):w,N),ke=(w,N={})=>{const j=Y(n,w),K=j&&j._f;if(K){const W=K.refs?K.refs[0]:K.ref;W.focus&&(W.focus(),N.shouldSelect&&Je(W.select)&&W.select())}},Fe=w=>{r={...r,...w}},Ve={control:{register:q,unregister:T,getFieldState:L,handleSubmit:B,setError:le,_subscribe:ge,_runSchema:R,_focusError:ne,_getWatch:P,_getDirty:V,_setValid:h,_setFieldArray:y,_setDisabledField:Q,_setErrors:S,_getFieldArray:$,_reset:ye,_resetDefaultValues:()=>Je(t.defaultValues)&&t.defaultValues().then(w=>{ve(w,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:O,_disableForm:J,_subjects:m,_proxyFormState:p,get _fields(){return n},get _formValues(){return s},get _state(){return a},set _state(w){a=w},get _defaultValues(){return o},get _names(){return i},set _names(w){i=w},get _formState(){return r},get _options(){return t},set _options(w){t={...t,...w}}},subscribe:me,trigger:D,register:q,handleSubmit:B,watch:ue,setValue:H,getValues:re,reset:ve,resetField:ee,clearErrors:te,unregister:T,setError:le,setFocus:ke,getFieldState:L};return{...Ve,formControl:Ve}}function US(e={}){const t=pe.useRef(void 0),r=pe.useRef(void 0),[n,o]=pe.useState({isDirty:!1,isValidating:!1,isLoading:Je(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Je(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!Je(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...i}=HS(e);t.current={...i,formState:n}}const s=t.current.control;return s._options=e,_S(()=>{const a=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(i=>({...i,isReady:!0})),s._formState.isReady=!0,a},[s]),pe.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),pe.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),pe.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),pe.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),pe.useEffect(()=>{if(s._proxyFormState.isDirty){const a=s._getDirty();a!==n.isDirty&&s._subjects.state.next({isDirty:a})}},[s,n.isDirty]),pe.useEffect(()=>{var a;e.values&&!wt(e.values,r.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((a=s._options.resetOptions)===null||a===void 0)&&a.keepIsValid||s._setValid(),r.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[s,e.values]),pe.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=jS(n,s),t.current}const ia=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Y(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},mf=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?ia(n.ref,r,e):n.refs&&n.refs.forEach(o=>ia(o,r,e))}},zS=(e,t)=>{t.shouldUseNativeValidation&&mf(e,t);const r={};for(const n in e){const o=Y(t.fields,n),s=Object.assign(e[n]||{},{ref:o&&o.ref});if(GS(t.names||Object.keys(e),n)){const a=Object.assign({},Y(r,n));he(a,"root",s),he(r,n,a)}else he(r,n,s)}return r},GS=(e,t)=>e.some(r=>r.startsWith(t+"."));var KS=function(e,t){for(var r={};e.length;){var n=e[0],o=n.code,s=n.message,a=n.path.join(".");if(!r[a])if("unionErrors"in n){var i=n.unionErrors[0].errors[0];r[a]={message:i.message,type:i.code}}else r[a]={message:s,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(p){return p.errors.forEach(function(f){return e.push(f)})}),t){var u=r[a].types,d=u&&u[n.code];r[a]=af(a,t,r,o,d?[].concat(d,n.message):n.message)}e.shift()}return r},YS=function(e,t,r){return r===void 0&&(r={}),function(n,o,s){try{return Promise.resolve(function(a,i){try{var u=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(d){return s.shouldUseNativeValidation&&mf({},s),{errors:{},values:r.raw?n:d}})}catch(d){return i(d)}return u&&u.then?u.then(void 0,i):u}(0,function(a){if(function(i){return Array.isArray(i==null?void 0:i.errors)}(a))return{values:{},errors:zS(KS(a.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw a}))}catch(a){return Promise.reject(a)}}};const hf=({useStore:e,fields:t=[],defaultValues:r={},validationSchema:n,children:o,onSubmit:s,onCancel:a,onBack:i,onBeforeSubmit:u,initialData:d=null,loading:p=!1,submitting:f=!1,title:m,description:g,submitLabel:v="Save",cancelLabel:h="Cancel",backLabel:x="Back",columns:y=1,showHeader:b=!0,showFooter:S=!0,showBack:C=!0,showCard:E=!0,listPath:_,icon:R,className:k,...M})=>{var Ve;const O=gr.useNavigate(),{id:V}=gr.useParams(),P=!!V,$=e==null?void 0:e(),z=$==null?void 0:$.form,X=($==null?void 0:$.loading)??!1,H=((Ve=$==null?void 0:$.form)==null?void 0:Ve.isSubmitting)??!1,I=$==null?void 0:$.fetchById,U=$==null?void 0:$.create,D=$==null?void 0:$.update,re=$==null?void 0:$.resetForm,L=p||X,te=f||H;l.useEffect(()=>(P&&V&&I&&I(V),()=>{re==null||re()}),[V,P]);const le=()=>{i?i():O(_||-1)},ue=()=>{a?a():le()},ge=async w=>{var N;(N=w==null?void 0:w.preventDefault)==null||N.call(w);try{let j=(z==null?void 0:z.values)||{};u&&(j=u(j)),P?await(D==null?void 0:D(V,j)):await(U==null?void 0:U(j)),le()}catch(j){console.error("Form submission error:",j)}};if(e&&o){const w=P?`Edit ${m}`:`Create ${m}`,N=c.jsxs("form",{onSubmit:ge,children:[o,S&&c.jsxs("div",{className:"flex items-center justify-end gap-2 mt-6 pt-4 border-t",children:[c.jsxs(ae,{type:"button",variant:"outline",onClick:ue,disabled:te,children:[c.jsx(xr,{className:"mr-2 h-4 w-4"}),h]}),c.jsx(ae,{type:"submit",disabled:te||L,children:te?c.jsxs(c.Fragment,{children:[c.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):c.jsxs(c.Fragment,{children:[c.jsx(vi,{className:"mr-2 h-4 w-4"}),v]})})]})]});return E?c.jsxs(Ge,{className:k,...M,children:[c.jsx(Kt,{children:c.jsxs("div",{className:"flex items-center gap-4",children:[C&&c.jsx(ae,{variant:"ghost",size:"icon",onClick:le,children:c.jsx(mt,{className:"h-4 w-4"})}),R&&c.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:c.jsx(R,{className:"h-5 w-5 text-primary"})}),c.jsxs("div",{children:[c.jsx(Yt,{children:w}),g&&c.jsx(qt,{children:g})]})]})}),c.jsx(Ke,{children:N})]}):c.jsxs("div",{className:A("space-y-6",k),...M,children:[c.jsxs("div",{className:"flex items-center gap-4",children:[C&&c.jsx(ae,{variant:"ghost",size:"icon",onClick:le,children:c.jsx(mt,{className:"h-4 w-4"})}),R&&c.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:c.jsx(R,{className:"h-5 w-5 text-primary"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:w}),g&&c.jsx("p",{className:"text-muted-foreground",children:g})]})]}),N]})}const me=US({defaultValues:d||r,resolver:n?YS(n):void 0,mode:"onBlur"}),{handleSubmit:T,formState:{errors:Q,isDirty:q,isValid:ne},reset:J,watch:B,setValue:ee,control:ye}=me;l.useEffect(()=>{d&&J(d)},[d,J]);const ve=async w=>{try{await(s==null?void 0:s(w))}catch(N){console.error("Form submission error:",N)}},ke=w=>{var vt;const{name:N,type:j="text",label:K,placeholder:W,description:F,required:Z,disabled:ce,options:de=[],className:je,...$e}=w,Ae=(vt=Q[N])==null?void 0:vt.message,Me=B(N),Pe={label:K,placeholder:W,description:F,error:Ae,required:Z,disabled:ce||L||te,className:je};switch(j){case"text":case"email":case"password":case"number":case"url":case"tel":return c.jsx(ln,{...Pe,type:j,...me.register(N),...$e});case"textarea":return c.jsx(Ws,{...Pe,...me.register(N),...$e});case"select":return c.jsx(Bs,{...Pe,options:de,value:Me,onChange:Xe=>ee(N,Xe,{shouldValidate:!0}),...$e});case"search-select":return c.jsx(Hs,{...Pe,options:de,value:Me,onChange:Xe=>ee(N,Xe,{shouldValidate:!0}),...$e});case"switch":return c.jsx(Us,{...Pe,checked:Me,onCheckedChange:Xe=>ee(N,Xe,{shouldValidate:!0}),...$e});case"checkbox":return c.jsx(zs,{...Pe,checked:Me,onCheckedChange:Xe=>ee(N,Xe,{shouldValidate:!0}),...$e});case"custom":return w.render?w.render({form:me,field:w,error:Ae,value:Me}):null;default:return c.jsx(ln,{...Pe,type:"text",...me.register(N),...$e})}},Fe=A("grid gap-4",y===1&&"grid-cols-1",y===2&&"grid-cols-1 md:grid-cols-2",y===3&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",y===4&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"),Oe=c.jsxs("form",{onSubmit:T(ve),children:[c.jsx("div",{className:Fe,children:t.map(w=>{if(w.hidden&&(typeof w.hidden=="function"?w.hidden(B()):w.hidden))return null;const N=w.colSpan||1,j=A(N===2&&"md:col-span-2",N===3&&"md:col-span-2 lg:col-span-3",N===4&&"md:col-span-2 lg:col-span-4",N==="full"&&"col-span-full");return c.jsx("div",{className:j,children:ke(w)},w.name)})}),S&&c.jsxs("div",{className:"flex items-center justify-end gap-2 mt-6 pt-4 border-t",children:[a&&c.jsxs(ae,{type:"button",variant:"outline",onClick:a,disabled:te,children:[c.jsx(xr,{className:"mr-2 h-4 w-4"}),h]}),c.jsx(ae,{type:"submit",disabled:te||L,children:te?c.jsxs(c.Fragment,{children:[c.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):c.jsxs(c.Fragment,{children:[c.jsx(vi,{className:"mr-2 h-4 w-4"}),v]})})]})]});return b&&(m||g||C)?c.jsxs(Ge,{className:k,...M,children:[c.jsx(Kt,{children:c.jsxs("div",{className:"flex items-center gap-4",children:[C&&i&&c.jsx(ae,{variant:"ghost",size:"icon",onClick:i,children:c.jsx(mt,{className:"h-4 w-4"})}),c.jsxs("div",{children:[m&&c.jsx(Yt,{children:m}),g&&c.jsx(qt,{children:g})]})]})}),c.jsx(Ke,{children:Oe})]}):c.jsx("div",{className:k,...M,children:Oe})};hf.displayName="CrudForm";const gf=({useStore:e,children:t,data:r=null,loading:n=!1,error:o=null,fields:s=[],onBack:a,onEdit:i,onDelete:u,listPath:d,editPath:p,title:f,description:m,editLabel:g="Edit",deleteLabel:v="Delete",backLabel:h="Back",itemName:x="item",getItemName:y,showHeader:b=!0,showMeta:S=!0,showCard:C=!0,columns:E=2,icon:_,className:R,...k})=>{const M=gr.useNavigate(),{id:O}=gr.useParams(),V=e==null?void 0:e(),P=V==null?void 0:V.currentItem,$=(V==null?void 0:V.loading)??!1,z=V==null?void 0:V.error,X=V==null?void 0:V.fetchById,H=V==null?void 0:V.delete,I=r||P,U=n||$,D=o||z,[re,L]=l.useState(!1),[te,le]=l.useState(!1);l.useEffect(()=>{O&&X&&X(O)},[O]);const ue=()=>{a?a():M(d||-1)},ge=()=>{i?i(I):p&&O&&M(`${p}/${O}/edit`)},me=async()=>{le(!0);try{u?await u(I):H&&O&&(await H(O),ue()),L(!1)}catch(B){console.error("Delete error:",B)}finally{le(!1)}},T=y?y(I):(I==null?void 0:I.name)||(I==null?void 0:I.title)||x,Q=(B,ee)=>{if(B.render)return B.render(ee,I);if(ee==null)return c.jsx("span",{className:"text-muted-foreground",children:"-"});switch(B.type){case"badge":return c.jsx(ur,{variant:B.variant||"default",children:B.format?B.format(ee):String(ee)});case"status":const ye={active:"success",inactive:"secondary",pending:"warning",error:"destructive",...B.statusColors};return c.jsx(ur,{variant:ye[ee==null?void 0:ee.toLowerCase()]||"default",children:B.format?B.format(ee):String(ee)});case"boolean":return c.jsx(ur,{variant:ee?"success":"secondary",children:ee?B.trueLabel||"Yes":B.falseLabel||"No"});case"date":return Ao(ee);case"datetime":return Gr(ee);case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:B.currency||"USD"}).format(ee);case"number":return B.format?B.format(ee):new Intl.NumberFormat().format(ee);case"list":return Array.isArray(ee)?c.jsx("div",{className:"flex flex-wrap gap-1",children:ee.map((ve,ke)=>c.jsx(ur,{variant:"outline",children:B.getItemLabel?B.getItemLabel(ve):String(ve)},ke))}):String(ee);case"link":return c.jsx("a",{href:ee,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:B.linkText||ee});case"email":return c.jsx("a",{href:`mailto:${ee}`,className:"text-primary hover:underline",children:ee});case"phone":return c.jsx("a",{href:`tel:${ee}`,className:"text-primary hover:underline",children:ee});case"image":return c.jsx("img",{src:ee,alt:B.label||"Image",className:A("rounded-md object-cover",B.imageClassName||"h-20 w-20")});case"html":return c.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:ee}});default:return B.format?B.format(ee):String(ee)}},q=B=>B.accessor?typeof B.accessor=="function"?B.accessor(I):I[B.accessor]:I[B.name],ne=A("grid gap-6",E===1&&"grid-cols-1",E===2&&"grid-cols-1 md:grid-cols-2",E===3&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"),J=c.jsxs(c.Fragment,{children:[c.jsx("div",{className:ne,children:s.map(B=>{if(B.hidden&&(typeof B.hidden=="function"?B.hidden(I):B.hidden))return null;const ee=q(B),ye=B.colSpan||1,ve=A(ye===2&&"md:col-span-2",ye===3&&"lg:col-span-3",ye==="full"&&"col-span-full");return c.jsxs("div",{className:ve,children:[c.jsxs("dt",{className:"text-sm font-medium text-muted-foreground mb-1",children:[B.icon&&c.jsx(B.icon,{className:"inline-block mr-2 h-4 w-4"}),B.label]}),c.jsx("dd",{className:"text-sm",children:Q(B,ee)})]},B.name||B.accessor)})}),S&&(I.created_at||I.updated_at||I.createdAt||I.updatedAt)&&c.jsxs(c.Fragment,{children:[c.jsx(Vo,{className:"my-6"}),c.jsxs("div",{className:"flex flex-wrap gap-6 text-sm text-muted-foreground",children:[(I.created_at||I.createdAt)&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(mi,{className:"h-4 w-4"}),c.jsxs("span",{children:["Created: ",Gr(I.created_at||I.createdAt)]})]}),(I.updated_at||I.updatedAt)&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(mi,{className:"h-4 w-4"}),c.jsxs("span",{children:["Updated: ",Gr(I.updated_at||I.updatedAt)]})]}),(I.id||I._id)&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(kp,{className:"h-4 w-4"}),c.jsxs("span",{children:["ID: ",I.id||I._id]})]})]})]})]});return e&&t&&typeof t=="function"?U?c.jsx("div",{className:A("space-y-6",R),children:c.jsx(Ge,{children:c.jsx(Ke,{className:"py-12",children:c.jsx(Jt,{text:`Loading ${x}...`})})})}):D?c.jsx("div",{className:A("space-y-6",R),children:c.jsx(Ge,{children:c.jsxs(Ke,{className:"py-12 text-center",children:[c.jsx("p",{className:"text-destructive",children:(D==null?void 0:D.message)||"An error occurred"}),c.jsxs(ae,{variant:"outline",onClick:ue,className:"mt-4",children:[c.jsx(mt,{className:"mr-2 h-4 w-4"}),h]})]})})}):I?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:A("space-y-6",R),...k,children:[b&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx(ae,{variant:"ghost",size:"icon",onClick:ue,children:c.jsx(mt,{className:"h-4 w-4"})}),_&&c.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:c.jsx(_,{className:"h-5 w-5 text-primary"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:f}),m&&c.jsx("p",{className:"text-muted-foreground",children:m})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[(i||p)&&c.jsxs(ae,{variant:"outline",onClick:ge,children:[c.jsx(lo,{className:"mr-2 h-4 w-4"}),g]}),(u||H)&&c.jsxs(ae,{variant:"destructive",onClick:()=>L(!0),children:[c.jsx(co,{className:"mr-2 h-4 w-4"}),v]})]})]}),t(I)]}),c.jsx(Nr,{open:re,onOpenChange:L,onConfirm:me,itemName:T,loading:te})]}):c.jsx("div",{className:A("space-y-6",R),children:c.jsx(Ge,{children:c.jsxs(Ke,{className:"py-12 text-center",children:[c.jsxs("p",{className:"text-muted-foreground",children:["No ",x," found"]}),c.jsxs(ae,{variant:"outline",onClick:ue,className:"mt-4",children:[c.jsx(mt,{className:"mr-2 h-4 w-4"}),h]})]})})}):U?c.jsx(Ge,{className:R,children:c.jsx(Ke,{className:"py-12",children:c.jsx(Jt,{text:`Loading ${x}...`})})}):D?c.jsx(Ge,{className:R,children:c.jsxs(Ke,{className:"py-12 text-center",children:[c.jsx("p",{className:"text-destructive",children:(D==null?void 0:D.message)||"An error occurred"}),c.jsxs(ae,{variant:"outline",onClick:ue,className:"mt-4",children:[c.jsx(mt,{className:"mr-2 h-4 w-4"}),h]})]})}):I?c.jsxs(c.Fragment,{children:[c.jsxs(Ge,{className:R,...k,children:[b&&c.jsxs(Kt,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx(ae,{variant:"ghost",size:"icon",onClick:ue,children:c.jsx(mt,{className:"h-4 w-4"})}),c.jsxs("div",{children:[f&&c.jsx(Yt,{children:f}),m&&c.jsx(qt,{children:m})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[(i||p)&&c.jsxs(ae,{variant:"outline",onClick:ge,children:[c.jsx(lo,{className:"mr-2 h-4 w-4"}),g]}),(u||H)&&c.jsxs(ae,{variant:"destructive",onClick:()=>L(!0),children:[c.jsx(co,{className:"mr-2 h-4 w-4"}),v]})]})]}),c.jsx(Ke,{children:J})]}),c.jsx(Nr,{open:re,onOpenChange:L,onConfirm:me,itemName:T,loading:te})]}):c.jsx(Ge,{className:R,children:c.jsxs(Ke,{className:"py-12 text-center",children:[c.jsxs("p",{className:"text-muted-foreground",children:["No ",x," found"]}),c.jsxs(ae,{variant:"outline",onClick:ue,className:"mt-4",children:[c.jsx(mt,{className:"mr-2 h-4 w-4"}),h]})]})})};gf.displayName="CrudDetail";const vf=e=>{const{name:t="crud",apiClient:r,endpoint:n,transformResponse:o=f=>f,transformRequest:s=f=>f,initialState:a={},extraActions:i={},idField:u="id",listKey:d="results",countKey:p="count"}=e;if(!r)throw new Error("createCrudStore: apiClient is required");if(!n)throw new Error("createCrudStore: endpoint is required");return f=>f((m,g)=>({items:[],item:null,loading:!1,submitting:!1,error:null,page:1,pageSize:10,totalItems:0,totalPages:0,sortColumn:null,sortDirection:null,search:"",filters:{},selectedIds:[],...a,setPage:v=>m({page:v}),setPageSize:v=>m({pageSize:v,page:1}),setSearch:v=>m({search:v,page:1}),setFilters:v=>m({filters:v,page:1}),setSort:(v,h)=>m({sortColumn:v,sortDirection:h}),setSelectedIds:v=>m({selectedIds:v}),clearSelection:()=>m({selectedIds:[]}),clearError:()=>m({error:null}),reset:()=>m({items:[],item:null,loading:!1,submitting:!1,error:null,page:1,search:"",filters:{},selectedIds:[]}),fetchList:async(v={})=>{var x,y,b,S;const h=g();m({loading:!0,error:null});try{const C={page:h.page,page_size:h.pageSize,search:h.search||void 0,ordering:h.sortColumn?`${h.sortDirection==="desc"?"-":""}${h.sortColumn}`:void 0,...h.filters,...v};Object.keys(C).forEach(O=>{(C[O]===void 0||C[O]==="")&&delete C[O]});const _=(await r.get(n,{params:C})).data,R=_[d]||_.data||(Array.isArray(_)?_:[]),k=_[p]||_.total||R.length,M=Math.ceil(k/h.pageSize);return m({items:R.map(o),totalItems:k,totalPages:M,loading:!1}),{items:R,totalItems:k,totalPages:M}}catch(C){const E=((y=(x=C.response)==null?void 0:x.data)==null?void 0:y.message)||((S=(b=C.response)==null?void 0:b.data)==null?void 0:S.detail)||C.message||"Failed to fetch items";throw m({error:{message:E,original:C},loading:!1}),C}},fetchOne:async v=>{var h,x,y,b;m({loading:!0,error:null,item:null});try{const S=await r.get(`${n}/${v}/`),C=o(S.data);return m({item:C,loading:!1}),C}catch(S){const C=((x=(h=S.response)==null?void 0:h.data)==null?void 0:x.message)||((b=(y=S.response)==null?void 0:y.data)==null?void 0:b.detail)||S.message||"Failed to fetch item";throw m({error:{message:C,original:S},loading:!1}),S}},create:async v=>{var h,x,y,b,S;m({submitting:!0,error:null});try{const C=s(v),E=await r.post(`${n}/`,C),_=o(E.data);return m(R=>({items:[_,...R.items],totalItems:R.totalItems+1,submitting:!1})),_}catch(C){const E=((x=(h=C.response)==null?void 0:h.data)==null?void 0:x.message)||((b=(y=C.response)==null?void 0:y.data)==null?void 0:b.detail)||C.message||"Failed to create item",_=((S=C.response)==null?void 0:S.data)||{};throw m({error:{message:E,fieldErrors:_,original:C},submitting:!1}),C}},update:async(v,h)=>{var x,y,b,S,C;m({submitting:!0,error:null});try{const E=s(h),_=await r.patch(`${n}/${v}/`,E),R=o(_.data);return m(k=>{var M;return{items:k.items.map(O=>O[u]===v?R:O),item:((M=k.item)==null?void 0:M[u])===v?R:k.item,submitting:!1}}),R}catch(E){const _=((y=(x=E.response)==null?void 0:x.data)==null?void 0:y.message)||((S=(b=E.response)==null?void 0:b.data)==null?void 0:S.detail)||E.message||"Failed to update item",R=((C=E.response)==null?void 0:C.data)||{};throw m({error:{message:_,fieldErrors:R,original:E},submitting:!1}),E}},delete:async v=>{var h,x,y,b;m({submitting:!0,error:null});try{return await r.delete(`${n}/${v}/`),m(S=>{var C;return{items:S.items.filter(E=>E[u]!==v),totalItems:S.totalItems-1,item:((C=S.item)==null?void 0:C[u])===v?null:S.item,selectedIds:S.selectedIds.filter(E=>E!==v),submitting:!1}}),!0}catch(S){const C=((x=(h=S.response)==null?void 0:h.data)==null?void 0:x.message)||((b=(y=S.response)==null?void 0:y.data)==null?void 0:b.detail)||S.message||"Failed to delete item";throw m({error:{message:C,original:S},submitting:!1}),S}},bulkDelete:async v=>{var h,x,y,b;m({submitting:!0,error:null});try{return await Promise.all(v.map(S=>r.delete(`${n}/${S}/`))),m(S=>({items:S.items.filter(C=>!v.includes(C[u])),totalItems:S.totalItems-v.length,selectedIds:[],submitting:!1})),!0}catch(S){const C=((x=(h=S.response)==null?void 0:h.data)==null?void 0:x.message)||((b=(y=S.response)==null?void 0:y.data)==null?void 0:b.detail)||S.message||"Failed to delete items";throw m({error:{message:C,original:S},submitting:!1}),S}},replace:async(v,h)=>{var x,y,b,S,C;m({submitting:!0,error:null});try{const E=s(h),_=await r.put(`${n}/${v}/`,E),R=o(_.data);return m(k=>{var M;return{items:k.items.map(O=>O[u]===v?R:O),item:((M=k.item)==null?void 0:M[u])===v?R:k.item,submitting:!1}}),R}catch(E){const _=((y=(x=E.response)==null?void 0:x.data)==null?void 0:y.message)||((S=(b=E.response)==null?void 0:b.data)==null?void 0:S.detail)||E.message||"Failed to update item",R=((C=E.response)==null?void 0:C.data)||{};throw m({error:{message:_,fieldErrors:R,original:E},submitting:!1}),E}},...i}))},qS=e=>{const{create:t}=require("zustand");return t(vf(e))};exports.Alert=Is;exports.AlertDescription=Os;exports.AlertTitle=ks;exports.AlertWithIcon=qd;exports.Avatar=hu;exports.AvatarFallback=vu;exports.AvatarImage=gu;exports.Badge=ur;exports.Button=ae;exports.Card=Ge;exports.CardContent=Ke;exports.CardDescription=qt;exports.CardFooter=Ea;exports.CardHeader=Kt;exports.CardTitle=Yt;exports.Checkbox=yr;exports.ConfirmModal=Ys;exports.CreateEmptyState=tf;exports.CrudDetail=gf;exports.CrudForm=hf;exports.CrudList=of;exports.DataTable=qs;exports.DeleteConfirmModal=Nr;exports.Dialog=Dc;exports.DialogClose=ey;exports.DialogContent=us;exports.DialogDescription=ps;exports.DialogFooter=Tn;exports.DialogHeader=ds;exports.DialogOverlay=cs;exports.DialogPortal=Ic;exports.DialogTitle=fs;exports.DialogTrigger=Jx;exports.DropdownMenu=jd;exports.DropdownMenuCheckboxItem=Td;exports.DropdownMenuContent=Ns;exports.DropdownMenuGroup=Xw;exports.DropdownMenuItem=Rs;exports.DropdownMenuLabel=js;exports.DropdownMenuPortal=Zw;exports.DropdownMenuRadioGroup=Jw;exports.DropdownMenuRadioItem=Md;exports.DropdownMenuSeparator=_s;exports.DropdownMenuShortcut=Dd;exports.DropdownMenuSub=Qw;exports.DropdownMenuSubContent=Ad;exports.DropdownMenuSubTrigger=Pd;exports.DropdownMenuTrigger=_d;exports.EmptyState=ir;exports.ErrorState=rf;exports.FormField=sr;exports.FormModal=nf;exports.Input=fn;exports.Label=_r;exports.Loading=Jt;exports.LoadingButton=ef;exports.LoadingOverlay=Jd;exports.Modal=Bn;exports.Pagination=Gs;exports.QCheckbox=zs;exports.QForm=Qd;exports.QInput=ln;exports.QSearchSelect=Hs;exports.QSelect=Bs;exports.QSwitch=Us;exports.QTabs=su;exports.QTextarea=Ws;exports.ScrollArea=Kd;exports.ScrollBar=Ds;exports.SearchEmptyState=Ks;exports.SearchSelect=Vs;exports.Select=rs;exports.SelectContent=_n;exports.SelectGroup=Tx;exports.SelectItem=Pn;exports.SelectLabel=cc;exports.SelectScrollDownButton=ss;exports.SelectScrollUpButton=os;exports.SelectSeparator=uc;exports.SelectTrigger=jn;exports.SelectValue=ns;exports.Separator=Vo;exports.Skeleton=ym;exports.Switch=Fo;exports.Table=$s;exports.TableBody=Fs;exports.TableCaption=Zd;exports.TableCell=Pt;exports.TableFooter=Xd;exports.TableHead=pr;exports.TableHeader=Ls;exports.TableRow=Ht;exports.Tabs=My;exports.TabsContent=ou;exports.TabsList=ru;exports.TabsTrigger=nu;exports.Textarea=Do;exports.Tooltip=yb;exports.TooltipContent=ju;exports.TooltipProvider=xb;exports.TooltipTrigger=bb;exports.alertVariants=Yd;exports.badgeVariants=Na;exports.buttonVariants=Ca;exports.cn=A;exports.createCrudStore=vf;exports.createStore=qS;exports.debounce=xa;exports.deepClone=hp;exports.formatCurrency=dp;exports.formatDate=Ao;exports.formatDateTime=Gr;exports.formatRelativeTime=fp;exports.generateId=mp;exports.getNestedValue=vp;exports.isEmpty=gp;exports.truncate=pp;
|
|
237
237
|
//# sourceMappingURL=index.cjs.map
|