canny-ui-react 6.7.0 → 7.0.0

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.
Files changed (74) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +7 -0
  2. package/dist/components/Alert/Alert.types.d.ts +5 -0
  3. package/dist/components/Autocomplete/Autocomplete.types.d.ts +7 -1
  4. package/dist/components/Avatar/Avatar.d.ts +3 -1
  5. package/dist/components/Avatar/Avatar.types.d.ts +14 -0
  6. package/dist/components/Avatar/index.d.ts +2 -2
  7. package/dist/components/Breadcrumb/Breadcrumb.d.ts +6 -0
  8. package/dist/components/Charts/BarChart.d.ts +16 -2
  9. package/dist/components/Charts/ChartA11y.d.ts +3 -1
  10. package/dist/components/Charts/ChartParts.d.ts +19 -0
  11. package/dist/components/Charts/DonutChart.d.ts +15 -0
  12. package/dist/components/Charts/FunnelChart.d.ts +16 -0
  13. package/dist/components/Charts/GanttChart.d.ts +75 -0
  14. package/dist/components/Charts/GaugeChart.d.ts +25 -0
  15. package/dist/components/Charts/Heatmap.d.ts +37 -0
  16. package/dist/components/Charts/LineChart.d.ts +15 -1
  17. package/dist/components/Charts/PieChart.d.ts +25 -3
  18. package/dist/components/Charts/RadarChart.d.ts +25 -0
  19. package/dist/components/Charts/ScatterChart.d.ts +33 -0
  20. package/dist/components/Charts/Sparkline.d.ts +17 -0
  21. package/dist/components/Charts/StatCard.d.ts +23 -0
  22. package/dist/components/Charts/cartesian.d.ts +23 -0
  23. package/dist/components/Charts/chartExtra.d.ts +90 -0
  24. package/dist/components/Charts/chartScale.d.ts +94 -0
  25. package/dist/components/Charts/chartUtils.d.ts +6 -0
  26. package/dist/components/Charts/gantt/ganttUtils.d.ts +54 -0
  27. package/dist/components/Charts/index.d.ts +18 -0
  28. package/dist/components/Chip/Chip.d.ts +4 -1
  29. package/dist/components/CommandPalette/CommandPalette.d.ts +1 -1
  30. package/dist/components/CommandPalette/CommandPalette.types.d.ts +18 -1
  31. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +6 -1
  32. package/dist/components/ContextMenu/ContextMenu.d.ts +7 -2
  33. package/dist/components/DataTable/DataTable.d.ts +55 -0
  34. package/dist/components/DatePicker/DatePicker.types.d.ts +10 -0
  35. package/dist/components/DatePicker/dateUtils.d.ts +2 -0
  36. package/dist/components/DatePicker/index.d.ts +1 -1
  37. package/dist/components/Dialog/Dialog.d.ts +6 -0
  38. package/dist/components/Drawer/Drawer.d.ts +8 -0
  39. package/dist/components/FileUploader/FileUploader.d.ts +24 -0
  40. package/dist/components/FileUploader/index.d.ts +1 -1
  41. package/dist/components/FileUploader/useFileDrop.d.ts +1 -0
  42. package/dist/components/Input/Input.types.d.ts +2 -0
  43. package/dist/components/List/List.d.ts +17 -0
  44. package/dist/components/MultiSelect/MultiSelect.d.ts +10 -2
  45. package/dist/components/Navbar/Navbar.types.d.ts +12 -0
  46. package/dist/components/Pagination/Pagination.d.ts +34 -0
  47. package/dist/components/PanelGroup/PanelGroup.d.ts +1 -1
  48. package/dist/components/Popover/Popover.d.ts +11 -2
  49. package/dist/components/Progress/Progress.types.d.ts +5 -0
  50. package/dist/components/Scroll/Scroll.types.d.ts +0 -4
  51. package/dist/components/Scroll/index.d.ts +1 -1
  52. package/dist/components/Scroll/useScrollFocusable.d.ts +10 -0
  53. package/dist/components/Select/Select.d.ts +7 -1
  54. package/dist/components/Sidebar/Sidebar.types.d.ts +10 -0
  55. package/dist/components/Skeleton/Skeleton.types.d.ts +3 -1
  56. package/dist/components/Skeleton/SkeletonLayouts.d.ts +5 -0
  57. package/dist/components/Skeleton/index.d.ts +1 -0
  58. package/dist/components/Slider/Slider.d.ts +2 -0
  59. package/dist/components/Stepper/Stepper.d.ts +5 -1
  60. package/dist/components/Tabs/Tabs.d.ts +7 -0
  61. package/dist/components/Textarea/Textarea.d.ts +2 -0
  62. package/dist/components/Timeline/Timeline.d.ts +9 -0
  63. package/dist/components/Toast/Toast.d.ts +1 -5
  64. package/dist/components/Toast/Toast.types.d.ts +13 -3
  65. package/dist/components/Tooltip/Tooltip.d.ts +3 -11
  66. package/dist/components/TreeView/TreeView.d.ts +34 -0
  67. package/dist/index.cjs +80 -55
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/index.js +15280 -11282
  70. package/dist/index.js.map +1 -1
  71. package/dist/utils/overlayFocus.d.ts +13 -0
  72. package/dist/utils/useCloseGuard.d.ts +17 -0
  73. package/dist/utils/useVirtualWindow.d.ts +29 -0
  74. package/package.json +3 -3
package/dist/index.cjs CHANGED
@@ -1,182 +1,207 @@
1
- "use client";"use strict";var Al=t=>{throw TypeError(t)};var Dl=(t,e,n)=>e.has(t)||Al("Cannot "+n);var Be=(t,e,n)=>(Dl(t,e,"read from private field"),n?n.call(t):e.get(t)),Il=(t,e,n)=>e.has(t)?Al("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Us=(t,e,n,r)=>(Dl(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),S=require("react"),Da=require("react-dom");function Hd(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const p=Hd(S),Or=Hd(Da);var Jy=Object.defineProperty,Ia=(t,e)=>Jy(t,"name",{value:e,configurable:!0});function ji(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Ia(ji,"setRef");function Wd(...t){return e=>{let n=!1;const r=t.map(o=>{const s=ji(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ji(t[o],null)}}}}Ia(Wd,"composeRefs");function ae(...t){return p.useCallback(Wd(...t),t)}Ia(ae,"useComposedRefs");var ev=Object.defineProperty,bt=(t,e)=>ev(t,"name",{value:e,configurable:!0});function yt(t){const e=p.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,a=!1;const c=[];Ai(o)&&typeof lo=="function"&&(o=lo(o._payload)),p.Children.forEach(o,h=>{var m;if(Zd(h)){a=!0;const g=h;let y="child"in g.props?g.props.child:g.props.children;Ai(y)&&typeof lo=="function"&&(y=lo(y._payload)),i=nv(g,y),c.push((m=i==null?void 0:i.props)==null?void 0:m.children)}else c.push(h)}),i?i=p.cloneElement(i,void 0,c):!a&&p.Children.count(o)===1&&p.isValidElement(o)&&(i=o);const u=i?qd(i):void 0,d=ae(r,u);if(!i){if(o||o===0)throw new Error(a?sv(t):ov(t));return o}const f=Xd(s,i.props??{});return i.type!==p.Fragment&&(f.ref=r?d:u),p.cloneElement(i,f)});return e.displayName=`${t}.Slot`,e}bt(yt,"createSlot");var tv=yt("Slot"),Kd=Symbol.for("radix.slottable");function Yd(t){const e=bt(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=Kd,e}bt(Yd,"createSlottable");var nv=bt((t,e)=>{if("child"in t.props){const n=t.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,t.props.children(n.props.children)):null}return p.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function Xd(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}bt(Xd,"mergeProps");function qd(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}bt(qd,"getElementRef");function Zd(t){return p.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Kd}bt(Zd,"isSlottable");var rv=Symbol.for("react.lazy");function Ai(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===rv&&"_payload"in t&&Qd(t._payload)}bt(Ai,"isLazyComponent");function Qd(t){return typeof t=="object"&&t!==null&&"then"in t}bt(Qd,"isPromiseLike");var ov=bt(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),sv=bt(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),lo=p[" use ".trim().toString()];function z(...t){return t.filter(Boolean).join(" ")}const Jd=S.createContext(void 0);function iv({nonce:t,children:e}){return typeof window<"u"&&t&&(globalThis.__webpack_nonce__=t),l.jsx(Jd.Provider,{value:t,children:e})}function ka(){return S.useContext(Jd)}function Na({css:t}){const e=ka();return l.jsx("style",{nonce:e,dangerouslySetInnerHTML:{__html:t}})}const ef={sm:640,md:768,lg:1024,xl:1280},Hs=["base","sm","md","lg","xl"],av=new Set(["animationIterationCount","aspectRatio","columnCount","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","widows","zIndex","zoom","scale"]),cv=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),lv=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^ms-/,"-ms-"),uv=t=>t.replace(/[<>]/g,""),dv=(t,e)=>typeof e=="number"&&e!==0&&!av.has(t)?`${e}px`:uv(String(e)),kl=t=>Object.entries(t).filter(([,e])=>e!==void 0).map(([e,n])=>`${lv(e)}:${dv(e,n)};`).join(""),fv=t=>{let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n)|0;return(e>>>0).toString(36)};function _a(t){const e={},n={base:{},sm:{},md:{},lg:{},xl:{}};let r=!1;for(const[a,c]of Object.entries(t))if(cv(c)){r=!0;for(const u of Hs){const d=c[u];d!==void 0&&(n[u][a]=d)}}else e[a]=c;if(!r)return{style:e};Object.assign(n.base,e);const o=[];for(const a of Hs){const c=kl(n[a]);c&&o.push(`${a}{${c}}`)}const s=`cny-sx-${fv(o.join(""))}`;let i="";for(const a of Hs){const c=kl(n[a]);c&&(i+=a==="base"?`.${s}{${c}}`:`@media (min-width:${ef[a]}px){.${s}{${c}}}`)}return{className:s,css:i}}function oe(t,e,...n){const r=t?_a(t):void 0;return{className:z(...n,r==null?void 0:r.className),style:r!=null&&r.style||e?{...r==null?void 0:r.style,...e}:void 0,styleTag:r!=null&&r.css?l.jsx(Na,{css:r.css}):null}}const Oa=S.createContext({});function $a(t){const e=S.useRef(null);return e.current===null&&(e.current=t()),e.current}const hv=typeof window<"u",tf=hv?S.useLayoutEffect:S.useEffect,os=S.createContext(null);function La(t,e){t.indexOf(e)===-1&&t.push(e)}function Uo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const kt=(t,e,n)=>n>e?e:n<t?t:n;function Di(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let nr=()=>{},Vt=()=>{};var Ud;typeof process<"u"&&((Ud=process.env)==null?void 0:Ud.NODE_ENV)!=="production"&&(nr=(t,e,n)=>{!t&&typeof console<"u"&&console.warn(Di(e,n))},Vt=(t,e,n)=>{if(!t)throw new Error(Di(e,n))});const Jt={},nf=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function rf(t){return typeof t=="object"&&t!==null}const of=t=>/^0[^.\s]+$/u.test(t);function sf(t){let e;return()=>(e===void 0&&(e=t()),e)}const dt=t=>t,pv=(t,e)=>n=>e(t(n)),$r=(...t)=>t.reduce(pv),Pr=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class Fa{constructor(){this.subscriptions=[]}add(e){return La(this.subscriptions,e),()=>Uo(this.subscriptions,e)}notify(e,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](e,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qe=t=>t*1e3,ut=t=>t/1e3;function af(t,e){return e?t*(1e3/e):0}const Nl=new Set;function Va(t,e,n){t||Nl.has(e)||(console.warn(Di(e,n)),Nl.add(e))}const cf=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,mv=1e-7,gv=12;function yv(t,e,n,r,o){let s,i,a=0;do i=e+(n-e)/2,s=cf(i,r,o)-t,s>0?n=i:e=i;while(Math.abs(s)>mv&&++a<gv);return i}function Lr(t,e,n,r){if(t===e&&n===r)return dt;const o=s=>yv(s,0,1,t,n);return s=>s===0||s===1?s:cf(o(s),e,r)}const lf=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,uf=t=>e=>1-t(1-e),df=Lr(.33,1.53,.69,.99),Ba=uf(df),ff=lf(Ba),hf=t=>t>=1?1:(t*=2)<1?.5*Ba(t):.5*(2-Math.pow(2,-10*(t-1))),Ga=t=>1-Math.sin(Math.acos(t)),pf=uf(Ga),mf=lf(Ga),vv=Lr(.42,0,1,1),xv=Lr(0,0,.58,1),gf=Lr(.42,0,.58,1),bv=t=>Array.isArray(t)&&typeof t[0]!="number",yf=t=>Array.isArray(t)&&typeof t[0]=="number",_l={linear:dt,easeIn:vv,easeInOut:gf,easeOut:xv,circIn:Ga,circInOut:mf,circOut:pf,backIn:Ba,backInOut:ff,backOut:df,anticipate:hf},wv=t=>typeof t=="string",Ol=t=>{if(yf(t)){Vt(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,r,o]=t;return Lr(e,n,r,o)}else if(wv(t))return Vt(_l[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),_l[t];return t},uo=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Cv(t,e){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(d){i.has(d)&&(u.schedule(d),t()),d(a)}const u={schedule:(d,f=!1,h=!1)=>{const g=h&&o?n:r;return f&&i.add(d),g.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(a=d,o){s=!0;return}o=!0;const f=n;n=r,r=f,n.forEach(c),n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const Sv=40;function vf(t,e){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=uo.reduce((b,C)=>(b[C]=Cv(s),b),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:m,postRender:g}=i,y=()=>{const b=Jt.useManualTiming,C=b?o.timestamp:performance.now();n=!1,b||(o.delta=r?1e3/60:Math.max(Math.min(C-o.timestamp,Sv),1)),o.timestamp=C,o.isProcessing=!0,a.process(o),c.process(o),u.process(o),d.process(o),f.process(o),h.process(o),m.process(o),g.process(o),o.isProcessing=!1,n&&e&&(r=!1,t(y))},v=()=>{n=!0,r=!0,o.isProcessing||t(y)};return{schedule:uo.reduce((b,C)=>{const P=i[C];return b[C]=(R,M=!1,A=!1)=>(n||v(),P.schedule(R,M,A)),b},{}),cancel:b=>{for(let C=0;C<uo.length;C++)i[uo[C]].cancel(b)},state:o,steps:i}}const{schedule:ye,cancel:en,state:$e,steps:Ws}=vf(typeof requestAnimationFrame<"u"?requestAnimationFrame:dt,!0);let Ao;function Pv(){Ao=void 0}const He={now:()=>(Ao===void 0&&He.set($e.isProcessing||Jt.useManualTiming?$e.timestamp:performance.now()),Ao),set:t=>{Ao=t,queueMicrotask(Pv)}},xf=t=>e=>typeof e=="string"&&e.startsWith(t),bf=xf("--"),Rv=xf("var(--"),za=t=>Rv(t)?Tv.test(t.split("/*")[0].trim()):!1,Tv=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function $l(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const rr={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Rr={...rr,transform:t=>kt(0,1,t)},fo={...rr,default:1},br=t=>Math.round(t*1e5)/1e5,Ua=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Mv(t){return t==null}const Ev=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ha=(t,e)=>n=>!!(typeof n=="string"&&Ev.test(n)&&n.startsWith(t)||e&&!Mv(n)&&Object.prototype.hasOwnProperty.call(n,e)),wf=(t,e,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(Ua);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},jv=t=>kt(0,255,t),Ks={...rr,transform:t=>Math.round(jv(t))},wn={test:Ha("rgb","red"),parse:wf("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Ks.transform(t)+", "+Ks.transform(e)+", "+Ks.transform(n)+", "+br(Rr.transform(r))+")"};function Av(t){let e="",n="",r="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Ii={test:Ha("#"),parse:Av,transform:wn.transform},Fr=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Xt=Fr("deg"),Dt=Fr("%"),te=Fr("px"),Dv=Fr("vh"),Iv=Fr("vw"),Ll={...Dt,parse:t=>Dt.parse(t)/100,transform:t=>Dt.transform(t*100)},zn={test:Ha("hsl","hue"),parse:wf("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Dt.transform(br(e))+", "+Dt.transform(br(n))+", "+br(Rr.transform(r))+")"},Me={test:t=>wn.test(t)||Ii.test(t)||zn.test(t),parse:t=>wn.test(t)?wn.parse(t):zn.test(t)?zn.parse(t):Ii.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?wn.transform(t):zn.transform(t),getAnimatableNone:t=>{const e=Me.parse(t);return e.alpha=0,Me.transform(e)}},kv=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Nv(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Ua))==null?void 0:e.length)||0)+(((n=t.match(kv))==null?void 0:n.length)||0)>0}const Cf="number",Sf="color",_v="var",Ov="var(",Fl="${}",$v=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function qn(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=e.replace($v,c=>(Me.test(c)?(r.color.push(s),o.push(Sf),n.push(Me.parse(c))):c.startsWith(Ov)?(r.var.push(s),o.push(_v),n.push(c)):(r.number.push(s),o.push(Cf),n.push(parseFloat(c))),++s,Fl)).split(Fl);return{values:n,split:a,indexes:r,types:o}}function Lv(t){return qn(t).values}function Pf({split:t,types:e}){const n=t.length;return r=>{let o="";for(let s=0;s<n;s++)if(o+=t[s],r[s]!==void 0){const i=e[s];i===Cf?o+=br(r[s]):i===Sf?o+=Me.transform(r[s]):o+=r[s]}return o}}function Fv(t){return Pf(qn(t))}const Vv=t=>typeof t=="number"?0:Me.test(t)?Me.getAnimatableNone(t):t,Bv=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Vv(t);function Gv(t){const e=qn(t);return Pf(e)(e.values.map((r,o)=>Bv(r,e.split[o])))}const mt={test:Nv,parse:Lv,createTransformer:Fv,getAnimatableNone:Gv};function Ys(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function zv({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let o=0,s=0,i=0;if(!e)o=s=i=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;o=Ys(c,a,t+1/3),s=Ys(c,a,t),i=Ys(c,a,t-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function Ho(t,e){return n=>n>0?e:t}const xe=(t,e,n)=>t+(e-t)*n,Xs=(t,e,n)=>{const r=t*t,o=n*(e*e-r)+r;return o<0?0:Math.sqrt(o)},Uv=[Ii,wn,zn],Hv=t=>Uv.find(e=>e.test(t));function Vl(t){const e=Hv(t);if(nr(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===zn&&(n=zv(n)),n}const Bl=(t,e)=>{const n=Vl(t),r=Vl(e);if(!n||!r)return Ho(t,e);const o={...n};return s=>(o.red=Xs(n.red,r.red,s),o.green=Xs(n.green,r.green,s),o.blue=Xs(n.blue,r.blue,s),o.alpha=xe(n.alpha,r.alpha,s),wn.transform(o))},ki=new Set(["none","hidden"]);function Wv(t,e){return ki.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Kv(t,e){return n=>xe(t,e,n)}function Wa(t){return typeof t=="number"?Kv:typeof t=="string"?za(t)?Ho:Me.test(t)?Bl:qv:Array.isArray(t)?Rf:typeof t=="object"?Me.test(t)?Bl:Yv:Ho}function Rf(t,e){const n=[...t],r=n.length,o=t.map((s,i)=>Wa(s)(s,e[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function Yv(t,e){const n={...t,...e},r={};for(const o in n)t[o]!==void 0&&e[o]!==void 0&&(r[o]=Wa(t[o])(t[o],e[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function Xv(t,e){const n=[],r={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const s=e.types[o],i=t.indexes[s][r[s]],a=t.values[i]??0;n[o]=a,r[s]++}return n}const qv=(t,e)=>{const n=mt.createTransformer(e),r=qn(t),o=qn(e);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?ki.has(t)&&!o.values.length||ki.has(e)&&!r.values.length?Wv(t,e):$r(Rf(Xv(r,o),o.values),n):(nr(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ho(t,e))};function Tf(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?xe(t,e,n):Wa(t)(t,e)}const Zv=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>ye.update(e,n),stop:()=>en(e),now:()=>$e.isProcessing?$e.timestamp:He.now()}},Mf=(t,e,n=10)=>{let r="";const o=Math.max(Math.round(e/n),2);for(let s=0;s<o;s++)r+=Math.round(t(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Wo=2e4;function Ka(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Wo;)e+=n,r=t.next(e);return e>=Wo?1/0:e}function Qv(t,e=100,n){const r=n({...t,keyframes:[0,e]}),o=Math.min(Ka(r),Wo);return{type:"keyframes",ease:s=>r.next(o*s).value/e,duration:ut(o)}}const we={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ni(t,e){return t*Math.sqrt(1-e*e)}const Jv=12;function ex(t,e,n){let r=n;for(let o=1;o<Jv;o++)r=r-t(r)/e(r);return r}const qs=.001;function tx({duration:t=we.duration,bounce:e=we.bounce,velocity:n=we.velocity,mass:r=we.mass}){let o,s;nr(t<=qe(we.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-e;i=kt(we.minDamping,we.maxDamping,i),t=kt(we.minDuration,we.maxDuration,ut(t)),i<1?(o=u=>{const d=u*i,f=d*t,h=d-n,m=Ni(u,i),g=Math.exp(-f);return qs-h/m*g},s=u=>{const f=u*i*t,h=f*n+n,m=Math.pow(i,2)*Math.pow(u,2)*t,g=Math.exp(-f),y=Ni(Math.pow(u,2),i);return(-o(u)+qs>0?-1:1)*((h-m)*g)/y}):(o=u=>{const d=Math.exp(-u*t),f=(u-n)*t+1;return-qs+d*f},s=u=>{const d=Math.exp(-u*t),f=(n-u)*(t*t);return d*f});const a=5/t,c=ex(o,s,a);if(t=qe(t),isNaN(c))return{stiffness:we.stiffness,damping:we.damping,duration:t};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:i*2*Math.sqrt(r*u),duration:t}}}const nx=["duration","bounce"],rx=["stiffness","damping","mass"];function Gl(t,e){return e.some(n=>t[n]!==void 0)}function ox(t){let e={velocity:we.velocity,stiffness:we.stiffness,damping:we.damping,mass:we.mass,isResolvedFromDuration:!1,...t};if(!Gl(t,rx)&&Gl(t,nx))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*kt(.05,1,1-(t.bounce||0))*Math.sqrt(o);e={...e,mass:we.mass,stiffness:o,damping:s}}else{const n=tx({...t,velocity:0});e={...e,...n,mass:we.mass},e.isResolvedFromDuration=!0}return e}function Ko(t=we.visualDuration,e=we.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=ox({...n,velocity:-ut(n.velocity||0)}),g=h||0,y=u/(2*Math.sqrt(c*d)),v=i-s,x=ut(Math.sqrt(c/d)),w=Math.abs(v)<5;r||(r=w?we.restSpeed.granular:we.restSpeed.default),o||(o=w?we.restDelta.granular:we.restDelta.default);let b,C,P,R,M,A;if(y<1)P=Ni(x,y),R=(g+y*x*v)/P,b=E=>{const N=Math.exp(-y*x*E);return i-N*(R*Math.sin(P*E)+v*Math.cos(P*E))},M=y*x*R+v*P,A=y*x*v-R*P,C=E=>Math.exp(-y*x*E)*(M*Math.sin(P*E)+A*Math.cos(P*E));else if(y===1){b=N=>i-Math.exp(-x*N)*(v+(g+x*v)*N);const E=g+x*v;C=N=>Math.exp(-x*N)*(x*E*N-g)}else{const E=x*Math.sqrt(y*y-1);b=V=>{const q=Math.exp(-y*x*V),W=Math.min(E*V,300);return i-q*((g+y*x*v)*Math.sinh(W)+E*v*Math.cosh(W))/E};const N=(g+y*x*v)/E,_=y*x*N-v*E,$=y*x*v-N*E;C=V=>{const q=Math.exp(-y*x*V),W=Math.min(E*V,300);return q*(_*Math.sinh(W)+$*Math.cosh(W))}}const T={calculatedDuration:m&&f||null,velocity:E=>qe(C(E)),next:E=>{if(!m&&y<1){const _=Math.exp(-y*x*E),$=Math.sin(P*E),V=Math.cos(P*E),q=i-_*(R*$+v*V),W=qe(_*(M*$+A*V));return a.done=Math.abs(W)<=r&&Math.abs(i-q)<=o,a.value=a.done?i:q,a}const N=b(E);if(m)a.done=E>=f;else{const _=qe(C(E));a.done=Math.abs(_)<=r&&Math.abs(i-N)<=o}return a.value=a.done?i:N,a},toString:()=>{const E=Math.min(Ka(T),Wo),N=Mf(_=>T.next(E*_).value,E,30);return E+"ms "+N},toTransition:()=>{}};return T}Ko.applyToOptions=t=>{const e=Qv(t,100,Ko);return t.ease=e.ease,t.duration=qe(e.duration),t.type="keyframes",t};const sx=5;function Ef(t,e,n){const r=Math.max(e-sx,0);return af(n-t(r),e-r)}function _i({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:u=.5,restSpeed:d}){const f=t[0],h={done:!1,value:f},m=A=>a!==void 0&&A<a||c!==void 0&&A>c,g=A=>a===void 0?c:c===void 0||Math.abs(a-A)<Math.abs(c-A)?a:c;let y=n*e;const v=f+y,x=i===void 0?v:i(v);x!==v&&(y=x-f);const w=A=>-y*Math.exp(-A/r),b=A=>x+w(A),C=A=>{const T=w(A),E=b(A);h.done=Math.abs(T)<=u,h.value=h.done?x:E};let P,R;const M=A=>{m(h.value)&&(P=A,R=Ko({keyframes:[h.value,g(h.value)],velocity:Ef(b,A,h.value),damping:o,stiffness:s,restDelta:u,restSpeed:d}))};return M(0),{calculatedDuration:null,next:A=>{let T=!1;return!R&&P===void 0&&(T=!0,C(A),M(A)),P!==void 0&&A>=P?R.next(A-P):(!T&&C(A),h)}}}function ix(t,e,n){const r=[],o=n||Jt.mix||Tf,s=t.length-1;for(let i=0;i<s;i++){let a=o(t[i],t[i+1]);if(e){const c=Array.isArray(e)?e[i]||dt:e;a=$r(c,a)}r.push(a)}return r}function ax(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const s=t.length;if(Vt(s===e.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const i=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=ix(e,r,o),c=a.length,u=d=>{if(i&&d<t[0])return e[0];let f=0;if(c>1)for(;f<t.length-2&&!(d<t[f+1]);f++);const h=Pr(t[f],t[f+1],d);return a[f](h)};return n?d=>u(kt(t[0],t[s-1],d)):u}function cx(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const o=Pr(0,e,r);t.push(xe(n,1,o))}}function lx(t){const e=[0];return cx(e,t.length-1),e}function ux(t,e){return t.map(n=>n*e)}function dx(t,e){return t.map(()=>e||gf).splice(0,t.length-1)}function Un({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const o=bv(r)?r.map(Ol):Ol(r),s={done:!1,value:e[0]},i=ux(n&&n.length===e.length?n:lx(e),t),a=ax(i,e,{ease:Array.isArray(o)?o:dx(e,o)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const fx=t=>t!==null;function ss(t,{repeat:e,repeatType:n="loop"},r,o=1){const s=t.filter(fx),a=o<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const hx={decay:_i,inertia:_i,tween:Un,keyframes:Un,spring:Ko};function jf(t){typeof t.type=="string"&&(t.type=hx[t.type])}class Ya{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const px=t=>t/100;class Yo extends Ya{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,o;const{motionValue:n}=this.options;n&&n.updatedAt!==He.now()&&this.tick(He.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;jf(e);const{type:n=Un,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=e;let{keyframes:a}=e;const c=n||Un;process.env.NODE_ENV!=="production"&&c!==Un&&Vt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==Un&&typeof a[0]!="number"&&(this.mixKeyframes=$r(px,Tf(a[0],a[1])),a=[0,100]);const u=c({...e,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=Ka(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:m,type:g,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-o/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const x=this.currentTime-u*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?x<0:x>o;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let b=this.currentTime,C=r;if(f){const A=Math.min(this.currentTime,o)/a;let T=Math.floor(A),E=A%1;!E&&A>=1&&(E=1),E===1&&T--,T=Math.min(T,f+1),!!(T%2)&&(h==="reverse"?(E=1-E,m&&(E-=m/a)):h==="mirror"&&(C=i)),b=kt(0,1,E)*a}let P;w?(this.delayState.value=d[0],P=this.delayState):P=C.next(b),s&&!w&&(P.value=s(P.value));let{done:R}=P;!w&&c!==null&&(R=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return M&&g!==_i&&(P.value=ss(d,this.options,v,this.speed)),y&&y(P.value),M&&this.finish(),P}then(e,n){return this.finished.then(e,n)}get duration(){return ut(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ut(e)}get time(){return ut(this.currentTime)}set time(e){e=qe(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Ef(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(He.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=ut(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:e=Zv,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(He.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function mx(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Cn=t=>t*180/Math.PI,Oi=t=>{const e=Cn(Math.atan2(t[1],t[0]));return $i(e)},gx={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Oi,rotateZ:Oi,skewX:t=>Cn(Math.atan(t[1])),skewY:t=>Cn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},$i=t=>(t=t%360,t<0&&(t+=360),t),zl=Oi,Ul=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Hl=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),yx={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ul,scaleY:Hl,scale:t=>(Ul(t)+Hl(t))/2,rotateX:t=>$i(Cn(Math.atan2(t[6],t[5]))),rotateY:t=>$i(Cn(Math.atan2(-t[2],t[0]))),rotateZ:zl,rotate:zl,skewX:t=>Cn(Math.atan(t[4])),skewY:t=>Cn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Li(t){return t.includes("scale")?1:0}function Fi(t,e){if(!t||t==="none")return Li(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=yx,o=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=gx,o=a}if(!o)return Li(e);const s=r[e],i=o[1].split(",").map(xx);return typeof s=="function"?s(i):i[s]}const vx=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Fi(n,e)};function xx(t){return parseFloat(t.trim())}const or=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],sr=new Set(or),Wl=t=>t===rr||t===te,bx=new Set(["x","y","z"]),wx=or.filter(t=>!bx.has(t));function Cx(t){const e=[];return wx.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Zt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const o=t.max-t.min;return r==="border-box"?o:o-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const o=t.max-t.min;return r==="border-box"?o:o-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Fi(e,"x"),y:(t,{transform:e})=>Fi(e,"y")};Zt.translateX=Zt.x;Zt.translateY=Zt.y;const Sn=new Set;let Vi=!1,Bi=!1,Gi=!1;function Af(){if(Bi){const t=Array.from(Sn).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const o=Cx(r);o.length&&(n.set(r,o),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Bi=!1,Vi=!1,Sn.forEach(t=>t.complete(Gi)),Sn.clear()}function Df(){Sn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Bi=!0)})}function Sx(){Gi=!0,Df(),Af(),Gi=!1}class Xa{constructor(e,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Sn.add(this),Vi||(Vi=!0,ye.read(Df),ye.resolveKeyframes(Af))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:o}=this;if(e[0]===null){const s=o==null?void 0:o.get(),i=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=i),o&&s===void 0&&o.set(e[0])}mx(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Sn.delete(this)}cancel(){this.state==="scheduled"&&(Sn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Px=t=>t.startsWith("--");function If(t,e,n){Px(e)?t.style.setProperty(e,n):t.style[e]=n}const Rx={};function kf(t,e){const n=sf(t);return()=>Rx[e]??n()}const Tx=kf(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Nf=kf(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),vr=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Kl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:vr([0,.65,.55,1]),circOut:vr([.55,0,1,.45]),backIn:vr([.31,.01,.66,-.59]),backOut:vr([.33,1.53,.69,.99])};function _f(t,e){if(t)return typeof t=="function"?Nf()?Mf(t,e):"ease-out":yf(t)?vr(t):Array.isArray(t)?t.map(n=>_f(n,e)||Kl.easeOut):Kl[t]}function Mx(t,e,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[e]:n};c&&(d.offset=c);const f=_f(a,o);Array.isArray(f)&&(d.easing=f);const h={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(d,h)}function Of(t){return typeof t=="function"&&"applyToOptions"in t}function Ex({type:t,...e}){return Of(t)&&Nf()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class $f extends Ya{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=e,Vt(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=Ex(e);this.animation=Mx(n,r,o,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=ss(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),If(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,o;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((o=(r=this.animation).commitStyles)==null||o.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ut(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ut(e)}get time(){return ut(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=qe(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Tx()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),dt):o(this)}}const Lf={anticipate:hf,backInOut:ff,circInOut:mf};function jx(t){return t in Lf}function Ax(t){typeof t.ease=="string"&&jx(t.ease)&&(t.ease=Lf[t.ease])}const Zs=10;class Dx extends $f{constructor(e){Ax(e),jf(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new Yo({...i,autoplay:!1}),c=Math.max(Zs,He.now()-this.startTime),u=kt(0,Zs,c-Zs),d=a.sample(c).value,{name:f}=this.options;s&&f&&If(s,f,d),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,d,u),a.stop()}}const Yl=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(mt.test(t)||t==="0")&&!t.startsWith("url("));function Ix(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function kx(t,e,n,r){const o=t[0];if(o===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],i=Yl(o,e),a=Yl(s,e);return nr(i===a,`You are trying to animate ${e} from "${o}" to "${s}". "${i?s:o}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:Ix(t)||(n==="spring"||Of(n))&&r}function zi(t){t.duration=0,t.type="keyframes"}const Ff=new Set(["opacity","clipPath","filter","transform"]),Nx=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function _x(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Nx.test(t[e]))return!0;return!1}const Ox=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),$x=sf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Lx(t){var f;const{motionValue:e,name:n,repeatDelay:r,repeatType:o,damping:s,type:i,keyframes:a}=t;if(!(((f=e==null?void 0:e.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=e.owner.getProps();return $x()&&n&&(Ff.has(n)||Ox.has(n)&&_x(a))&&(n!=="transform"||!d)&&!u&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const Fx=40;class Vx extends Ya{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:u,element:d,...f}){var g;super(),this.stop=()=>{var y,v;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=He.now();const h={autoplay:e,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:u,element:d,...f},m=(d==null?void 0:d.KeyframeResolver)||Xa;this.keyframeResolver=new m(a,(y,v,x)=>this.onKeyframesResolved(y,v,h,!x),c,u,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(e,n,r,o){var x,w;this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=He.now();let f=!0;kx(e,s,i,a)||(f=!1,(Jt.instantAnimations||!c)&&(d==null||d(ss(e,r,n))),e[0]=e[e.length-1],zi(r),r.repeat=0);const m={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>Fx?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},g=f&&!u&&Lx(m),y=(w=(x=m.motionValue)==null?void 0:x.owner)==null?void 0:w.current;let v;if(g)try{v=new Dx({...m,element:y})}catch{v=new Yo(m)}else v=new Yo(m);v.finished.then(()=>{this.notifyFinished()}).catch(dt),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Sx()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function Vf(t,e,n,r=0,o=1){const s=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),i=t.size,a=(i-1)*r;return typeof n=="function"?n(s,i):o===1?s*r:a-s*r}const Bx=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gx(t){const e=Bx.exec(t);if(!e)return[,];const[,n,r,o]=e;return[`--${n??r}`,o]}const zx=4;function Bf(t,e,n=1){Vt(n<=zx,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=Gx(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const i=s.trim();return nf(i)?parseFloat(i):i}return za(o)?Bf(o,e,n+1):o}const Ux={type:"spring",stiffness:500,damping:25,restSpeed:10},Hx=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Wx={type:"keyframes",duration:.8},Kx={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Yx=(t,{keyframes:e})=>e.length>2?Wx:sr.has(t)?t.startsWith("scale")?Hx(e[1]):Ux:Kx;function Gf(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function qa(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Gf(n,t):n}const Xx=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function qx(t){for(const e in t)if(!Xx.has(e))return!0;return!1}const Za=(t,e,n,r={},o,s)=>i=>{const a=qa(r,t)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-qe(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:o};qx(a)||Object.assign(d,Yx(t,d)),d.duration&&(d.duration=qe(d.duration)),d.repeatDelay&&(d.repeatDelay=qe(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(zi(d),d.delay===0&&(f=!0)),(Jt.instantAnimations||Jt.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(f=!0,zi(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&e.get()!==void 0){const h=ss(d.keyframes,a);if(h!==void 0){ye.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new Yo(d):new Vx(d)};function Xl(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Qa(t,e,n,r){if(typeof e=="function"){const[o,s]=Xl(r);e=e(n!==void 0?n:t.custom,o,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[o,s]=Xl(r);e=e(n!==void 0?n:t.custom,o,s)}return e}function Pn(t,e,n){const r=t.getProps();return Qa(r,e,n!==void 0?n:r.custom,t)}const zf=new Set(["width","height","top","left","right","bottom",...or]),ql=30,Zx=t=>!isNaN(parseFloat(t));class Qx{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=He.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=He.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Zx(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&Va(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Fa);const r=this.events[e].add(n);return e==="change"?()=>{r(),ye.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=He.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ql)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ql);return af(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Zn(t,e){return new Qx(t,e)}const Ui=t=>Array.isArray(t);function Jx(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Zn(n))}function eb(t){return Ui(t)?t[t.length-1]||0:t}function tb(t,e){const n=Pn(t,e);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=eb(s[i]);Jx(t,i,a)}}const Le=t=>!!(t&&t.getVelocity);function nb(t){return!!(Le(t)&&t.add)}function Hi(t,e){const n=t.getValue("willChange");if(nb(n))return n.add(e);if(!n&&Jt.WillChange){const r=new Jt.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Ja(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const rb="framerAppearId",Uf="data-"+Ja(rb);function Hf(t){return t.props[Uf]}function ob({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function Wf(t,e,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s,transitionEnd:i,...a}=e;const c=t.getDefaultTransition();s=s?Gf(s,c):c;const u=s==null?void 0:s.reduceMotion;r&&(s=r);const d=[],f=o&&t.animationState&&t.animationState.getState()[o];for(const h in a){const m=t.getValue(h,t.latestValues[h]??null),g=a[h];if(g===void 0||f&&ob(f,h))continue;const y={delay:n,...qa(s||{},h)},v=m.get();if(v!==void 0&&!m.isAnimating()&&!Array.isArray(g)&&g===v&&!y.velocity){ye.update(()=>m.set(g));continue}let x=!1;if(window.MotionHandoffAnimation){const C=Hf(t);if(C){const P=window.MotionHandoffAnimation(C,h,ye);P!==null&&(y.startTime=P,x=!0)}}Hi(t,h);const w=u??t.shouldReduceMotion;m.start(Za(h,m,g,w&&zf.has(h)?{type:!1}:y,t,x));const b=m.animation;b&&d.push(b)}if(i){const h=()=>ye.update(()=>{i&&tb(t,i)});d.length?Promise.all(d).then(h):h()}return d}function Wi(t,e,n={}){var c;const r=Pn(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(Wf(t,r,n)):()=>Promise.resolve(),i=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=o;return sb(t,e,u,d,f,h,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[u,d]=a==="beforeChildren"?[s,i]:[i,s];return u().then(()=>d())}else return Promise.all([s(),i(n.delay)])}function sb(t,e,n=0,r=0,o=0,s=1,i){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(Wi(c,e,{...i,delay:n+(typeof r=="function"?0:r)+Vf(t.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function ib(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const o=e.map(s=>Wi(t,s,n));r=Promise.all(o)}else if(typeof e=="string")r=Wi(t,e,n);else{const o=typeof e=="function"?Pn(t,e,n.custom):e;r=Promise.all(Wf(t,o,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const ab={test:t=>t==="auto",parse:t=>t},Kf=t=>e=>e.test(t),Yf=[rr,te,Dt,Xt,Iv,Dv,ab],Zl=t=>Yf.find(Kf(t));function cb(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||of(t):!0}const lb=new Set(["brightness","contrast","saturate","opacity"]);function ub(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Ua)||[];if(!r)return t;const o=n.replace(r,"");let s=lb.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+o+")"}const db=/\b([a-z-]*)\(.*?\)/gu,Ki={...mt,getAnimatableNone:t=>{const e=t.match(db);return e?e.map(ub).join(" "):t}},Yi={...mt,getAnimatableNone:t=>{const e=mt.parse(t);return mt.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Ql={...rr,transform:Math.round},fb={rotate:Xt,rotateX:Xt,rotateY:Xt,rotateZ:Xt,scale:fo,scaleX:fo,scaleY:fo,scaleZ:fo,skew:Xt,skewX:Xt,skewY:Xt,distance:te,translateX:te,translateY:te,translateZ:te,x:te,y:te,z:te,perspective:te,transformPerspective:te,opacity:Rr,originX:Ll,originY:Ll,originZ:te},ec={borderWidth:te,borderTopWidth:te,borderRightWidth:te,borderBottomWidth:te,borderLeftWidth:te,borderRadius:te,borderTopLeftRadius:te,borderTopRightRadius:te,borderBottomRightRadius:te,borderBottomLeftRadius:te,width:te,maxWidth:te,height:te,maxHeight:te,top:te,right:te,bottom:te,left:te,inset:te,insetBlock:te,insetBlockStart:te,insetBlockEnd:te,insetInline:te,insetInlineStart:te,insetInlineEnd:te,padding:te,paddingTop:te,paddingRight:te,paddingBottom:te,paddingLeft:te,paddingBlock:te,paddingBlockStart:te,paddingBlockEnd:te,paddingInline:te,paddingInlineStart:te,paddingInlineEnd:te,margin:te,marginTop:te,marginRight:te,marginBottom:te,marginLeft:te,marginBlock:te,marginBlockStart:te,marginBlockEnd:te,marginInline:te,marginInlineStart:te,marginInlineEnd:te,fontSize:te,backgroundPositionX:te,backgroundPositionY:te,...fb,zIndex:Ql,fillOpacity:Rr,strokeOpacity:Rr,numOctaves:Ql},hb={...ec,color:Me,backgroundColor:Me,outlineColor:Me,fill:Me,stroke:Me,borderColor:Me,borderTopColor:Me,borderRightColor:Me,borderBottomColor:Me,borderLeftColor:Me,filter:Ki,WebkitFilter:Ki,mask:Yi,WebkitMask:Yi},Xf=t=>hb[t],pb=new Set([Ki,Yi]);function qf(t,e){let n=Xf(t);return pb.has(n)||(n=mt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const mb=new Set(["auto","none","0"]);function gb(t,e,n){let r=0,o;for(;r<t.length&&!o;){const s=t[r];typeof s=="string"&&!mb.has(s)&&qn(s).values.length&&(o=t[r]),r++}if(o&&n)for(const s of e)t[s]=qf(n,o)}class yb extends Xa{constructor(e,n,r,o,s){super(e,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let f=e[d];if(typeof f=="string"&&(f=f.trim(),za(f))){const h=Bf(f,n.current);h!==void 0&&(e[d]=h),d===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!zf.has(r)||e.length!==2)return;const[o,s]=e,i=Zl(o),a=Zl(s),c=$l(o),u=$l(s);if(c!==u&&Zt[r]){this.needsMeasurement=!0;return}if(i!==a)if(Wl(i)&&Wl(a))for(let d=0;d<e.length;d++){const f=e[d];typeof f=="string"&&(e[d]=parseFloat(f))}else Zt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let o=0;o<e.length;o++)(e[o]===null||cb(e[o]))&&r.push(o);r.length&&gb(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Zt[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&e.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const o=e.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=Zt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{e.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function Zf(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const o=(n==null?void 0:n[t])??r.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t).filter(r=>r!=null)}const Qf=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Do(t){return rf(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:tc}=vf(queueMicrotask,!1),ht={x:!1,y:!1};function Jf(){return ht.x||ht.y}function vb(t){return t==="x"||t==="y"?ht[t]?null:(ht[t]=!0,()=>{ht[t]=!1}):ht.x||ht.y?null:(ht.x=ht.y=!0,()=>{ht.x=ht.y=!1})}function eh(t,e){const n=Zf(t),r=new AbortController,o={passive:!0,...e,signal:r.signal};return[n,o,()=>r.abort()]}function xb(t){return!(t.pointerType==="touch"||Jf())}function bb(t,e,n={}){const[r,o,s]=eh(t,n);return r.forEach(i=>{let a=!1,c=!1,u;const d=()=>{i.removeEventListener("pointerleave",g)},f=v=>{u&&(u(v),u=void 0),d()},h=v=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,f(v))},m=()=>{a=!0,window.addEventListener("pointerup",h,o),window.addEventListener("pointercancel",h,o)},g=v=>{if(v.pointerType!=="touch"){if(a){c=!0;return}f(v)}},y=v=>{if(!xb(v))return;c=!1;const x=e(i,v);typeof x=="function"&&(u=x,i.addEventListener("pointerleave",g,o))};i.addEventListener("pointerenter",y,o),i.addEventListener("pointerdown",m,o)}),s}const th=(t,e)=>e?t===e?!0:th(t,e.parentElement):!1,nc=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,wb=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Cb(t){return wb.has(t.tagName)||t.isContentEditable===!0}const Sb=new Set(["INPUT","SELECT","TEXTAREA"]);function Pb(t){return Sb.has(t.tagName)||t.isContentEditable===!0}const Io=new WeakSet;function Jl(t){return e=>{e.key==="Enter"&&t(e)}}function Qs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Rb=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Jl(()=>{if(Io.has(n))return;Qs(n,"down");const o=Jl(()=>{Qs(n,"up")}),s=()=>Qs(n,"cancel");n.addEventListener("keyup",o,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function eu(t){return nc(t)&&!Jf()}const tu=new WeakSet;function Tb(t,e,n={}){const[r,o,s]=eh(t,n),i=a=>{const c=a.currentTarget;if(!eu(a)||tu.has(a))return;Io.add(c),n.stopPropagation&&tu.add(a);const u=e(c,a),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Io.has(c)&&Io.delete(c),eu(m)&&typeof u=="function"&&u(m,{success:g})},f=m=>{d(m,c===window||c===document||n.useGlobalTarget||th(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",h,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),Do(a)&&(a.addEventListener("focus",u=>Rb(u,o)),!Cb(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function rc(t){return rf(t)&&"ownerSVGElement"in t}const ko=new WeakMap;let qt;const nh=(t,e,n)=>(r,o)=>o&&o[0]?o[0][t+"Size"]:rc(r)&&"getBBox"in r?r.getBBox()[e]:r[n],Mb=nh("inline","width","offsetWidth"),Eb=nh("block","height","offsetHeight");function jb({target:t,borderBoxSize:e}){var n;(n=ko.get(t))==null||n.forEach(r=>{r(t,{get width(){return Mb(t,e)},get height(){return Eb(t,e)}})})}function Ab(t){t.forEach(jb)}function Db(){typeof ResizeObserver>"u"||(qt=new ResizeObserver(Ab))}function Ib(t,e){qt||Db();const n=Zf(t);return n.forEach(r=>{let o=ko.get(r);o||(o=new Set,ko.set(r,o)),o.add(e),qt==null||qt.observe(r)}),()=>{n.forEach(r=>{const o=ko.get(r);o==null||o.delete(e),o!=null&&o.size||qt==null||qt.unobserve(r)})}}const No=new Set;let Hn;function kb(){Hn=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};No.forEach(e=>e(t))},window.addEventListener("resize",Hn)}function Nb(t){return No.add(t),Hn||kb(),()=>{No.delete(t),!No.size&&typeof Hn=="function"&&(window.removeEventListener("resize",Hn),Hn=void 0)}}function nu(t,e){return typeof t=="function"?Nb(t):Ib(t,e)}function _b(t){return rc(t)&&t.tagName==="svg"}const Ob=[...Yf,Me,mt],$b=t=>Ob.find(Kf(t)),ru=()=>({translate:0,scale:1,origin:0,originPoint:0}),Wn=()=>({x:ru(),y:ru()}),ou=()=>({min:0,max:0}),je=()=>({x:ou(),y:ou()}),Lb=new WeakMap;function is(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Tr(t){return typeof t=="string"||Array.isArray(t)}const oc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],sc=["initial",...oc];function as(t){return is(t.animate)||sc.some(e=>Tr(t[e]))}function rh(t){return!!(as(t)||t.variants)}function Fb(t,e,n){for(const r in e){const o=e[r],s=n[r];if(Le(o))t.addValue(r,o);else if(Le(s))t.addValue(r,Zn(o,{owner:t}));else if(s!==o)if(t.hasValue(r)){const i=t.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=t.getStaticValue(r);t.addValue(r,Zn(i!==void 0?i:o,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Xi={current:null},oh={current:!1},Vb=typeof window<"u";function Bb(){if(oh.current=!0,!!Vb)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Xi.current=t.matches;t.addEventListener("change",e),e()}else Xi.current=!1}const su=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Xo={};function sh(t){Xo=t}function Gb(){return Xo}class zb{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:o,skipAnimations:s,blockInitialAnimation:i,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Xa,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=He.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ye.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=c,this.blockInitialAnimation=!!i,this.isControllingVariants=as(n),this.isVariantNode=rh(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const g=h[m];u[m]!==void 0&&Le(g)&&g.set(u[m])}}mount(e){var n,r;if(this.hasBeenMounted)for(const o in this.initialValues)(n=this.values.get(o))==null||n.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=e,Lb.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,s)=>this.bindToMotionValue(s,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(oh.current||Bb(),this.shouldReduceMotion=Xi.current),process.env.NODE_ENV!=="production"&&Va(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),en(this.notifyUpdate),en(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Ff.has(e)&&this.current instanceof HTMLElement){const{factory:i,keyframes:a,times:c,ease:u,duration:d}=n.accelerate,f=new $f({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:qe(d)}),h=i(f);this.valueSubscriptions.set(e,()=>{h(),f.cancel()});return}const r=sr.has(e);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[e]=i,this.props.onUpdate&&ye.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Xo){const n=Xo[e];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[e]&&o&&r(this.props)&&(this.features[e]=new o(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):je()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<su.length;r++){const o=su[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=e[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=Fb(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Zn(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(nf(r)||of(r))?r=parseFloat(r):!$b(r)&&mt.test(n)&&(r=qf(e,n)),this.setBaseTarget(e,Le(r)?r.get():r)),Le(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Qa(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[e])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!Le(o)?o:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Fa),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){tc.render(this.render)}}class ih extends zb{constructor(){super(...arguments),this.KeyframeResolver=yb}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Le(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class cn{constructor(e){this.isMounted=!1,this.node=e}update(){}}function ah({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Ub({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Hb(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Js(t){return t===void 0||t===1}function qi({scale:t,scaleX:e,scaleY:n}){return!Js(t)||!Js(e)||!Js(n)}function bn(t){return qi(t)||ch(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ch(t){return iu(t.x)||iu(t.y)}function iu(t){return t&&t!=="0%"}function qo(t,e,n){const r=t-n,o=e*r;return n+o}function au(t,e,n,r,o){return o!==void 0&&(t=qo(t,o,r)),qo(t,n,r)+e}function Zi(t,e=0,n=1,r,o){t.min=au(t.min,e,n,r,o),t.max=au(t.max,e,n,r,o)}function lh(t,{x:e,y:n}){Zi(t.x,e.translate,e.scale,e.originPoint),Zi(t.y,n.translate,n.scale,n.originPoint)}const cu=.999999999999,lu=1.0000000000001;function Wb(t,e,n,r=!1){var a;const o=n.length;if(!o)return;e.x=e.y=1;let s,i;for(let c=0;c<o;c++){s=n[c],i=s.projectionDelta;const{visualElement:u}=s.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(Et(t.x,-s.scroll.offset.x),Et(t.y,-s.scroll.offset.y)),i&&(e.x*=i.x.scale,e.y*=i.y.scale,lh(t,i)),r&&bn(s.latestValues)&&_o(t,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}e.x<lu&&e.x>cu&&(e.x=1),e.y<lu&&e.y>cu&&(e.y=1)}function Et(t,e){t.min+=e,t.max+=e}function uu(t,e,n,r,o=.5){const s=xe(t.min,t.max,o);Zi(t,e,n,s,r)}function du(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function _o(t,e,n){const r=n??t;uu(t.x,du(e.x,r.x),e.scaleX,e.scale,e.originX),uu(t.y,du(e.y,r.y),e.scaleY,e.scale,e.originY)}function uh(t,e){return ah(Hb(t.getBoundingClientRect(),e))}function Kb(t,e,n){const r=uh(t,n),{scroll:o}=e;return o&&(Et(r.x,o.offset.x),Et(r.y,o.offset.y)),r}const Yb={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Xb=or.length;function qb(t,e,n){let r="",o=!0;for(let s=0;s<Xb;s++){const i=or[s],a=t[i];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(i.startsWith("scale")?1:0);else{const u=parseFloat(a);c=i.startsWith("scale")?u===1:u===0}if(!c||n){const u=Qf(a,ec[i]);if(!c){o=!1;const d=Yb[i]||i;r+=`${d}(${u}) `}n&&(e[i]=u)}}return r=r.trim(),n?r=n(e,o?"":r):o&&(r="none"),r}function ic(t,e,n){const{style:r,vars:o,transformOrigin:s}=t;let i=!1,a=!1;for(const c in e){const u=e[c];if(sr.has(c)){i=!0;continue}else if(bf(c)){o[c]=u;continue}else{const d=Qf(u,ec[c]);c.startsWith("origin")?(a=!0,s[c]=d):r[c]=d}}if(e.transform||(i||n?r.transform=qb(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${c} ${u} ${d}`}}function dh(t,{style:e,vars:n},r,o){const s=t.style;let i;for(i in e)s[i]=e[i];o==null||o.applyProjectionStyles(s,r);for(i in n)s.setProperty(i,n[i])}function fu(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const gr={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(te.test(t))t=parseFloat(t);else return t;const n=fu(t,e.target.x),r=fu(t,e.target.y);return`${n}% ${r}%`}},Zb={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,o=mt.parse(t);if(o.length>5)return r;const s=mt.createTransformer(t),i=typeof o[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;o[0+i]/=a,o[1+i]/=c;const u=xe(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=u),typeof o[3+i]=="number"&&(o[3+i]/=u),s(o)}},Qi={borderRadius:{...gr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gr,borderTopRightRadius:gr,borderBottomLeftRadius:gr,borderBottomRightRadius:gr,boxShadow:Zb};function fh(t,{layout:e,layoutId:n}){return sr.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Qi[t]||t==="opacity")}function ac(t,e,n){var i;const r=t.style,o=e==null?void 0:e.style,s={};if(!r)return s;for(const a in r)(Le(r[a])||o&&Le(o[a])||fh(a,t)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function Qb(t){return window.getComputedStyle(t)}class Jb extends ih{constructor(){super(...arguments),this.type="html",this.renderInstance=dh}readValueFromInstance(e,n){var r;if(sr.has(n))return(r=this.projection)!=null&&r.isProjecting?Li(n):vx(e,n);{const o=Qb(e),s=(bf(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return uh(e,n)}build(e,n,r){ic(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return ac(e,n,r)}}const ew={offset:"stroke-dashoffset",array:"stroke-dasharray"},tw={offset:"strokeDashoffset",array:"strokeDasharray"};function nw(t,e,n=1,r=0,o=!0){t.pathLength=1;const s=o?ew:tw;t[s.offset]=`${-r}`,t[s.array]=`${e} ${n}`}const rw=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function hh(t,{attrX:e,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,u,d){if(ic(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:h}=t;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const m of rw)f[m]!==void 0&&(h[m]=f[m],delete f[m]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&nw(f,o,s,i,!1)}const ph=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),mh=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ow(t,e,n,r){dh(t,e,void 0,r);for(const o in e.attrs)t.setAttribute(ph.has(o)?o:Ja(o),e.attrs[o])}function gh(t,e,n){const r=ac(t,e,n);for(const o in t)if(Le(t[o])||Le(e[o])){const s=or.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=t[o]}return r}class sw extends ih{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=je}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(sr.has(n)){const r=Xf(n);return r&&r.default||0}return n=ph.has(n)?n:Ja(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return gh(e,n,r)}build(e,n,r){hh(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,o){ow(e,n,r,o)}mount(e){this.isSVGTag=mh(e.tagName),super.mount(e)}}const iw=sc.length;function yh(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?yh(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<iw;n++){const r=sc[n],o=t.props[r];(Tr(o)||o===!1)&&(e[r]=o)}return e}function vh(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const aw=[...oc].reverse(),cw=oc.length;function lw(t){return e=>Promise.all(e.map(({animation:n,options:r})=>ib(t,n,r)))}function uw(t){let e=lw(t),n=hu(),r=!0,o=!1;const s=u=>(d,f)=>{var m;const h=Pn(t,f,u==="exit"?(m=t.presenceContext)==null?void 0:m.custom:void 0);if(h){const{transition:g,transitionEnd:y,...v}=h;d={...d,...v,...y}}return d};function i(u){e=u(t)}function a(u){const{props:d}=t,f=yh(t.parent)||{},h=[],m=new Set;let g={},y=1/0;for(let x=0;x<cw;x++){const w=aw[x],b=n[w],C=d[w]!==void 0?d[w]:f[w],P=Tr(C),R=w===u?b.isActive:null;R===!1&&(y=x);let M=C===f[w]&&C!==d[w]&&P;if(M&&(r||o)&&t.manuallyAnimateOnMount&&(M=!1),b.protectedKeys={...g},!b.isActive&&R===null||!C&&!b.prevProp||is(C)||typeof C=="boolean")continue;if(w==="exit"&&b.isActive&&R!==!0){b.prevResolvedValues&&(g={...g,...b.prevResolvedValues});continue}const A=dw(b.prevProp,C);let T=A||w===u&&b.isActive&&!M&&P||x>y&&P,E=!1;const N=Array.isArray(C)?C:[C];let _=N.reduce(s(w),{});R===!1&&(_={});const{prevResolvedValues:$={}}=b,V={...$,..._},q=L=>{T=!0,m.has(L)&&(E=!0,m.delete(L)),b.needsAnimating[L]=!0;const O=t.getValue(L);O&&(O.liveStyle=!1)};for(const L in V){const O=_[L],D=$[L];if(g.hasOwnProperty(L))continue;let Y=!1;Ui(O)&&Ui(D)?Y=!vh(O,D):Y=O!==D,Y?O!=null?q(L):m.add(L):O!==void 0&&m.has(L)?q(L):b.protectedKeys[L]=!0}b.prevProp=C,b.prevResolvedValues=_,b.isActive&&(g={...g,..._}),(r||o)&&t.blockInitialAnimation&&(T=!1);const W=M&&A;T&&(!W||E)&&h.push(...N.map(L=>{const O={type:w};if(typeof L=="string"&&(r||o)&&!W&&t.manuallyAnimateOnMount&&t.parent){const{parent:D}=t,Y=Pn(D,L);if(D.enteringChildren&&Y){const{delayChildren:j}=Y.transition||{};O.delay=Vf(D.enteringChildren,t,j)}}return{animation:L,options:O}}))}if(m.size){const x={};if(typeof d.initial!="boolean"){const w=Pn(t,Array.isArray(d.initial)?d.initial[0]:d.initial);w&&w.transition&&(x.transition=w.transition)}m.forEach(w=>{const b=t.getBaseTarget(w),C=t.getValue(w);C&&(C.liveStyle=!0),x[w]=b??null}),h.push({animation:x})}let v=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(v=!1),r=!1,o=!1,v?e(h):Promise.resolve()}function c(u,d){var h;if(n[u].isActive===d)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(m=>{var g;return(g=m.animationState)==null?void 0:g.setActive(u,d)}),n[u].isActive=d;const f=a(u);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>n,reset:()=>{n=hu(),o=!0}}}function dw(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!vh(e,t):!1}function vn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hu(){return{animate:vn(!0),whileInView:vn(),whileHover:vn(),whileTap:vn(),whileDrag:vn(),whileFocus:vn(),exit:vn()}}function Ji(t,e){t.min=e.min,t.max=e.max}function ft(t,e){Ji(t.x,e.x),Ji(t.y,e.y)}function pu(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const xh=1e-4,fw=1-xh,hw=1+xh,bh=.01,pw=0-bh,mw=0+bh;function We(t){return t.max-t.min}function gw(t,e,n){return Math.abs(t-e)<=n}function mu(t,e,n,r=.5){t.origin=r,t.originPoint=xe(e.min,e.max,t.origin),t.scale=We(n)/We(e),t.translate=xe(n.min,n.max,t.origin)-t.originPoint,(t.scale>=fw&&t.scale<=hw||isNaN(t.scale))&&(t.scale=1),(t.translate>=pw&&t.translate<=mw||isNaN(t.translate))&&(t.translate=0)}function wr(t,e,n,r){mu(t.x,e.x,n.x,r?r.originX:void 0),mu(t.y,e.y,n.y,r?r.originY:void 0)}function gu(t,e,n,r=0){const o=r?xe(n.min,n.max,r):n.min;t.min=o+e.min,t.max=t.min+We(e)}function yw(t,e,n,r){gu(t.x,e.x,n.x,r==null?void 0:r.x),gu(t.y,e.y,n.y,r==null?void 0:r.y)}function yu(t,e,n,r=0){const o=r?xe(n.min,n.max,r):n.min;t.min=e.min-o,t.max=t.min+We(e)}function Zo(t,e,n,r){yu(t.x,e.x,n.x,r==null?void 0:r.x),yu(t.y,e.y,n.y,r==null?void 0:r.y)}function vu(t,e,n,r,o){return t-=e,t=qo(t,1/n,r),o!==void 0&&(t=qo(t,1/o,r)),t}function vw(t,e=0,n=1,r=.5,o,s=t,i=t){if(Dt.test(e)&&(e=parseFloat(e),e=xe(i.min,i.max,e/100)-i.min),typeof e!="number")return;let a=xe(s.min,s.max,r);t===s&&(a-=e),t.min=vu(t.min,e,n,a,o),t.max=vu(t.max,e,n,a,o)}function xu(t,e,[n,r,o],s,i){vw(t,e[n],e[r],e[o],e.scale,s,i)}const xw=["x","scaleX","originX"],bw=["y","scaleY","originY"];function bu(t,e,n,r){xu(t.x,e,xw,n?n.x:void 0,r?r.x:void 0),xu(t.y,e,bw,n?n.y:void 0,r?r.y:void 0)}function wu(t){return t.translate===0&&t.scale===1}function wh(t){return wu(t.x)&&wu(t.y)}function Cu(t,e){return t.min===e.min&&t.max===e.max}function ww(t,e){return Cu(t.x,e.x)&&Cu(t.y,e.y)}function Su(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ch(t,e){return Su(t.x,e.x)&&Su(t.y,e.y)}function Pu(t){return We(t.x)/We(t.y)}function Ru(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Tt(t){return[t("x"),t("y")]}function Cw(t,e,n){let r="";const o=t.x.translate/e.x,s=t.y.translate/e.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const Sh=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Sw=Sh.length,Tu=t=>typeof t=="string"?parseFloat(t):t,Mu=t=>typeof t=="number"||te.test(t);function Pw(t,e,n,r,o,s){o?(t.opacity=xe(0,n.opacity??1,Rw(r)),t.opacityExit=xe(e.opacity??1,0,Tw(r))):s&&(t.opacity=xe(e.opacity??1,n.opacity??1,r));for(let i=0;i<Sw;i++){const a=Sh[i];let c=Eu(e,a),u=Eu(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Mu(c)===Mu(u)?(t[a]=Math.max(xe(Tu(c),Tu(u),r),0),(Dt.test(u)||Dt.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=xe(e.rotate||0,n.rotate||0,r))}function Eu(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Rw=Ph(0,.5,pf),Tw=Ph(.5,.95,dt);function Ph(t,e,n){return r=>r<t?0:r>e?1:n(Pr(t,e,r))}function Mw(t,e,n){const r=Le(t)?t:Zn(t);return r.start(Za("",r,e,n)),r.animation}function Mr(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const Ew=(t,e)=>t.depth-e.depth;class jw{constructor(){this.children=[],this.isDirty=!1}add(e){La(this.children,e),this.isDirty=!0}remove(e){Uo(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ew),this.isDirty=!1,this.children.forEach(e)}}function Aw(t,e){const n=He.now(),r=({timestamp:o})=>{const s=o-n;s>=e&&(en(r),t(s-e))};return ye.setup(r,!0),()=>en(r)}function Oo(t){return Le(t)?t.get():t}class Dw{constructor(){this.members=[]}add(e){La(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(Uo(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Uo(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const o=this.members[r];if(o.isPresent!==!1&&((n=o.instance)==null?void 0:n.isConnected)!==!1)return this.promote(o),!0}return!1}promote(e,n){var o;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:i}=e.options;(s===void 0||s!==i)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(o=e.root)!=null&&o.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,o,s,i;(r=(n=e.options).onExitComplete)==null||r.call(n),(i=(o=e.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||i.call(s)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const $o={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ei=["","X","Y","Z"],Iw=1e3;let kw=0;function ti(t,e,n,r){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),r&&(r[t]=0))}function Rh(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Hf(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ye,!(o||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&Rh(r)}function Th({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=e==null?void 0:e()){this.id=kw++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Ow),this.nodes.forEach(Gw),this.nodes.forEach(zw),this.nodes.forEach($w)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new jw)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Fa),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=rc(i)&&!_b(i),this.instance=i;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;ye.read(()=>{f=window.innerWidth}),t(i,()=>{const m=window.innerWidth;m!==f&&(f=m,this.root.updateBlockedByResize=!0,d&&d(),d=Aw(h,250),$o.hasAnimatedSinceResize&&($o.hasAnimatedSinceResize=!1,this.nodes.forEach(Du)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||Yw,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=u.getProps(),x=!this.targetLayout||!Ch(this.targetLayout,m),w=!f&&h;if(this.options.layoutRoot||this.resumeFrom||w||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...qa(g,"layout"),onPlay:y,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(d,w)}else f||Du(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),en(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Uw),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Rh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Fw),this.nodes.forEach(ju);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Au);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Vw),this.nodes.forEach(Bw),this.nodes.forEach(Nw),this.nodes.forEach(_w)):this.nodes.forEach(Au),this.clearAllSnapshots();const a=He.now();$e.delta=kt(0,1e3/60,a-$e.timestamp),$e.timestamp=a,$e.isProcessing=!0,Ws.update.process($e),Ws.preRender.process($e),Ws.render.process($e),$e.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Lw),this.sharedNodes.forEach(Hw)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ye.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!We(this.snapshot.measuredBox.x)&&!We(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=je()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!wh(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;i&&this.instance&&(a||bn(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),Xw(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:i}=this.options;if(!i)return je();const a=i.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(qw))){const{scroll:d}=this.root;d&&(Et(a.x,d.offset.x),Et(a.y,d.offset.y))}return a}removeElementScroll(i){var c;const a=je();if(ft(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&ft(a,i),Et(a.x,f.offset.x),Et(a.y,f.offset.y))}return a}applyTransform(i,a=!1,c){var d,f;const u=c||je();ft(u,i);for(let h=0;h<this.path.length;h++){const m=this.path[h];!a&&m.options.layoutScroll&&m.scroll&&m!==m.root&&(Et(u.x,-m.scroll.offset.x),Et(u.y,-m.scroll.offset.y)),bn(m.latestValues)&&_o(u,m.latestValues,(d=m.layout)==null?void 0:d.layoutBox)}return bn(this.latestValues)&&_o(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(i){var c;const a=je();ft(a,i);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!bn(d.latestValues))continue;let f;d.instance&&(qi(d.latestValues)&&d.updateSnapshot(),f=je(),ft(f,d.measurePageBox())),bu(a,d.latestValues,(c=d.snapshot)==null?void 0:c.layoutBox,f)}return bn(this.latestValues)&&bu(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==$e.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var m;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=$e.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=je(),this.targetWithTransforms=je()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),yw(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ft(this.target,this.layout.layoutBox),lh(this.target,this.targetDelta)):ft(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||qi(this.parent.latestValues)||ch(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,a,c){this.relativeParent=i,this.linkedParentVersion=i.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=je(),this.relativeTargetOrigin=je(),Zo(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),ft(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var g;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===$e.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;ft(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Wb(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=je());const{target:m}=i;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(pu(this.prevProjectionDelta.x,this.projectionDelta.x),pu(this.prevProjectionDelta.y,this.projectionDelta.y)),wr(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Ru(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ru(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Wn(),this.projectionDelta=Wn(),this.projectionDeltaWithTransform=Wn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=Wn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=je(),m=c?c.source:void 0,g=this.layout?this.layout.source:void 0,y=m!==g,v=this.getStack(),x=!v||v.members.length<=1,w=!!(y&&!x&&this.options.crossfade===!0&&!this.path.some(Kw));this.animationProgress=0;let b;this.mixTargetDelta=C=>{const P=C/1e3;Iu(f.x,i.x,P),Iu(f.y,i.y,P),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zo(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ww(this.relativeTarget,this.relativeTargetOrigin,h,P),b&&ww(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=je()),ft(b,this.relativeTarget)),y&&(this.animationValues=d,Pw(d,u,this.latestValues,P,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(en(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ye.update(()=>{$o.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Zn(0)),this.motionValue.jump(0,!1),this.currentAnimation=Mw(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),i.onUpdate&&i.onUpdate(d)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Iw),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:d}=i;if(!(!a||!c||!u)){if(this!==i&&this.layout&&u&&Mh(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||je();const f=We(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=We(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}ft(a,c),_o(a,d),wr(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Dw),this.sharedNodes.get(i).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&ti("z",i,u,this.animationValues);for(let d=0;d<ei.length;d++)ti(`rotate${ei[d]}`,i,u,this.animationValues),ti(`skew${ei[d]}`,i,u,this.animationValues);i.render();for(const d in u)i.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);i.scheduleRender()}applyProjectionStyles(i,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=Oo(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Oo(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!bn(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Cw(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),i.transform=f;const{x:h,y:m}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,u.animationValues?i.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:i.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const g in Qi){if(d[g]===void 0)continue;const{correct:y,applyTo:v,isCSSVariable:x}=Qi[g],w=f==="none"?d[g]:y(d[g],u);if(v){const b=v.length;for(let C=0;C<b;C++)i[v[C]]=w}else x?this.options.visualElement.renderState.vars[g]=w:i[g]=w}this.options.layoutId&&(i.pointerEvents=u===this?Oo(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(ju),this.root.sharedNodes.clear()}}}function Nw(t){t.updateLayout()}function _w(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=t.layout,{animationType:s}=t.options,i=e.source!==t.layout.source;if(s==="size")Tt(f=>{const h=i?e.measuredBox[f]:e.layoutBox[f],m=We(h);h.min=r[f].min,h.max=h.min+m});else if(s==="x"||s==="y"){const f=s==="x"?"y":"x";Ji(i?e.measuredBox[f]:e.layoutBox[f],r[f])}else Mh(s,e.layoutBox,r)&&Tt(f=>{const h=i?e.measuredBox[f]:e.layoutBox[f],m=We(r[f]);h.max=h.min+m,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+m)});const a=Wn();wr(a,r,e.layoutBox);const c=Wn();i?wr(c,t.applyTransform(o,!0),e.measuredBox):wr(c,r,e.layoutBox);const u=!wh(a);let d=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const g=t.options.layoutAnchor||void 0,y=je();Zo(y,e.layoutBox,h.layoutBox,g);const v=je();Zo(v,r,m.layoutBox,g),Ch(y,v)||(d=!0),f.options.layoutRoot&&(t.relativeTarget=v,t.relativeTargetOrigin=y,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Ow(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function $w(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Lw(t){t.clearSnapshot()}function ju(t){t.clearMeasurements()}function Fw(t){t.isLayoutDirty=!0,t.updateLayout()}function Au(t){t.isLayoutDirty=!1}function Vw(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Bw(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Du(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Gw(t){t.resolveTargetDelta()}function zw(t){t.calcProjection()}function Uw(t){t.resetSkewAndRotation()}function Hw(t){t.removeLeadSnapshot()}function Iu(t,e,n){t.translate=xe(e.translate,0,n),t.scale=xe(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ku(t,e,n,r){t.min=xe(e.min,n.min,r),t.max=xe(e.max,n.max,r)}function Ww(t,e,n,r){ku(t.x,e.x,n.x,r),ku(t.y,e.y,n.y,r)}function Kw(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Yw={duration:.45,ease:[.4,0,.1,1]},Nu=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),_u=Nu("applewebkit/")&&!Nu("chrome/")?Math.round:dt;function Ou(t){t.min=_u(t.min),t.max=_u(t.max)}function Xw(t){Ou(t.x),Ou(t.y)}function Mh(t,e,n){return t==="position"||t==="preserve-aspect"&&!gw(Pu(e),Pu(n),.2)}function qw(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Zw=Th({attachResizeListener:(t,e)=>Mr(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),ni={current:void 0},Eh=Th({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ni.current){const t=new Zw({});t.mount(window),t.setOptions({layoutScroll:!0}),ni.current=t}return ni.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),cc=S.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function $u(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Qw(...t){return e=>{let n=!1;const r=t.map(o=>{const s=$u(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():$u(t[o],null)}}}}function Jw(...t){return p.useCallback(Qw(...t),t)}class e0 extends p.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Do(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,o=Do(r)&&r.offsetWidth||0,s=Do(r)&&r.offsetHeight||0,i=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=o-a.width-a.left,a.bottom=s-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function t0({children:t,isPresent:e,anchorX:n,anchorY:r,root:o,pop:s}){var h;const i=S.useId(),a=S.useRef(null),c=S.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=S.useContext(cc),d=((h=t.props)==null?void 0:h.ref)??(t==null?void 0:t.ref),f=Jw(a,d);return S.useInsertionEffect(()=>{const{width:m,height:g,top:y,left:v,right:x,bottom:w}=c.current;if(e||s===!1||!a.current||!m||!g)return;const b=n==="left"?`left: ${v}`:`right: ${x}`,C=r==="bottom"?`bottom: ${w}`:`top: ${y}`;a.current.dataset.motionPopId=i;const P=document.createElement("style");u&&(P.nonce=u);const R=o??document.head;return R.appendChild(P),P.sheet&&P.sheet.insertRule(`
1
+ "use client";"use strict";var vd=t=>{throw TypeError(t)};var xd=(t,e,n)=>e.has(t)||vd("Cannot "+n);var It=(t,e,n)=>(xd(t,e,"read from private field"),n?n.call(t):e.get(t)),bd=(t,e,n)=>e.has(t)?vd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ja=(t,e,n,r)=>(xd(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),v=require("react"),Sl=require("react-dom");function Jh(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const m=Jh(v),ps=Jh(Sl);var ub=Object.defineProperty,Ml=(t,e)=>ub(t,"name",{value:e,configurable:!0});function wc(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Ml(wc,"setRef");function Qh(...t){return e=>{let n=!1;const r=t.map(o=>{const s=wc(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():wc(t[o],null)}}}}Ml(Qh,"composeRefs");function _e(...t){return m.useCallback(Qh(...t),t)}Ml(_e,"useComposedRefs");var db=Object.defineProperty,wn=(t,e)=>db(t,"name",{value:e,configurable:!0});function vn(t){const e=m.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,c=!1;const l=[];Cc(o)&&typeof Vs=="function"&&(o=Vs(o._payload)),m.Children.forEach(o,h=>{var p;if(op(h)){c=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;Cc(b)&&typeof Vs=="function"&&(b=Vs(b._payload)),i=hb(g,b),l.push((p=i==null?void 0:i.props)==null?void 0:p.children)}else l.push(h)}),i?i=m.cloneElement(i,void 0,l):!c&&m.Children.count(o)===1&&m.isValidElement(o)&&(i=o);const u=i?rp(i):void 0,d=_e(r,u);if(!i){if(o||o===0)throw new Error(c?gb(t):mb(t));return o}const f=np(s,i.props??{});return i.type!==m.Fragment&&(f.ref=r?d:u),m.cloneElement(i,f)});return e.displayName=`${t}.Slot`,e}wn(vn,"createSlot");var fb=vn("Slot"),ep=Symbol.for("radix.slottable");function tp(t){const e=wn(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=ep,e}wn(tp,"createSlottable");var hb=wn((t,e)=>{if("child"in t.props){const n=t.props.child;return m.isValidElement(n)?m.cloneElement(n,void 0,t.props.children(n.props.children)):null}return m.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function np(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const l=s(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}wn(np,"mergeProps");function rp(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}wn(rp,"getElementRef");function op(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===ep}wn(op,"isSlottable");var pb=Symbol.for("react.lazy");function Cc(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===pb&&"_payload"in t&&sp(t._payload)}wn(Cc,"isLazyComponent");function sp(t){return typeof t=="object"&&t!==null&&"then"in t}wn(sp,"isPromiseLike");var mb=wn(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),gb=wn(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Vs=m[" use ".trim().toString()];function ne(...t){return t.filter(Boolean).join(" ")}const ip=v.createContext(void 0);function yb({nonce:t,children:e}){return typeof window<"u"&&t&&(globalThis.__webpack_nonce__=t),a.jsx(ip.Provider,{value:t,children:e})}function Rl(){return v.useContext(ip)}function Tl({css:t}){const e=Rl();return a.jsx("style",{nonce:e,dangerouslySetInnerHTML:{__html:t}})}const ap={sm:640,md:768,lg:1024,xl:1280},Pa=["base","sm","md","lg","xl"],vb=new Set(["animationIterationCount","aspectRatio","columnCount","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","widows","zIndex","zoom","scale"]),xb=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),bb=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^ms-/,"-ms-"),wb=t=>t.replace(/[<>]/g,""),Cb=(t,e)=>typeof e=="number"&&e!==0&&!vb.has(t)?`${e}px`:wb(String(e)),wd=t=>Object.entries(t).filter(([,e])=>e!==void 0).map(([e,n])=>`${bb(e)}:${Cb(e,n)};`).join(""),Sb=t=>{let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n)|0;return(e>>>0).toString(36)};function jl(t){const e={},n={base:{},sm:{},md:{},lg:{},xl:{}};let r=!1;for(const[c,l]of Object.entries(t))if(xb(l)){r=!0;for(const u of Pa){const d=l[u];d!==void 0&&(n[u][c]=d)}}else e[c]=l;if(!r)return{style:e};Object.assign(n.base,e);const o=[];for(const c of Pa){const l=wd(n[c]);l&&o.push(`${c}{${l}}`)}const s=`cny-sx-${Sb(o.join(""))}`;let i="";for(const c of Pa){const l=wd(n[c]);l&&(i+=c==="base"?`.${s}{${l}}`:`@media (min-width:${ap[c]}px){.${s}{${l}}}`)}return{className:s,css:i}}function Ae(t,e,...n){const r=t?jl(t):void 0;return{className:ne(...n,r==null?void 0:r.className),style:r!=null&&r.style||e?{...r==null?void 0:r.style,...e}:void 0,styleTag:r!=null&&r.css?a.jsx(Tl,{css:r.css}):null}}const Pl=v.createContext({});function Nl(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const Mb=typeof window<"u",cp=Mb?v.useLayoutEffect:v.useEffect,Ui=v.createContext(null);function El(t,e){t.indexOf(e)===-1&&t.push(e)}function Mi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Fn=(t,e,n)=>n>e?e:n<t?t:n;function Sc(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let Mo=()=>{},Qn=()=>{};var Zh;typeof process<"u"&&((Zh=process.env)==null?void 0:Zh.NODE_ENV)!=="production"&&(Mo=(t,e,n)=>{!t&&typeof console<"u"&&console.warn(Sc(e,n))},Qn=(t,e,n)=>{if(!t)throw new Error(Sc(e,n))});const pr={},lp=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function up(t){return typeof t=="object"&&t!==null}const dp=t=>/^0[^.\s]+$/u.test(t);function fp(t){let e;return()=>(e===void 0&&(e=t()),e)}const cn=t=>t,Rb=(t,e)=>n=>e(t(n)),ms=(...t)=>t.reduce(Rb),es=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class kl{constructor(){this.subscriptions=[]}add(e){return El(this.subscriptions,e),()=>Mi(this.subscriptions,e)}notify(e,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](e,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Gt=t=>t*1e3,an=t=>t/1e3;function hp(t,e){return e?t*(1e3/e):0}const Cd=new Set;function Al(t,e,n){t||Cd.has(e)||(console.warn(Sc(e,n)),Cd.add(e))}const pp=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Tb=1e-7,jb=12;function Pb(t,e,n,r,o){let s,i,c=0;do i=e+(n-e)/2,s=pp(i,r,o)-t,s>0?n=i:e=i;while(Math.abs(s)>Tb&&++c<jb);return i}function gs(t,e,n,r){if(t===e&&n===r)return cn;const o=s=>Pb(s,0,1,t,n);return s=>s===0||s===1?s:pp(o(s),e,r)}const mp=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,gp=t=>e=>1-t(1-e),yp=gs(.33,1.53,.69,.99),Il=gp(yp),vp=mp(Il),xp=t=>t>=1?1:(t*=2)<1?.5*Il(t):.5*(2-Math.pow(2,-10*(t-1))),Dl=t=>1-Math.sin(Math.acos(t)),bp=gp(Dl),wp=mp(Dl),Nb=gs(.42,0,1,1),Eb=gs(0,0,.58,1),Cp=gs(.42,0,.58,1),kb=t=>Array.isArray(t)&&typeof t[0]!="number",Sp=t=>Array.isArray(t)&&typeof t[0]=="number",Sd={linear:cn,easeIn:Nb,easeInOut:Cp,easeOut:Eb,circIn:Dl,circInOut:wp,circOut:bp,backIn:Il,backInOut:vp,backOut:yp,anticipate:xp},Ab=t=>typeof t=="string",Md=t=>{if(Sp(t)){Qn(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,r,o]=t;return gs(e,n,r,o)}else if(Ab(t))return Qn(Sd[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),Sd[t];return t},Bs=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ib(t,e){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(u.schedule(d),t()),d(c)}const u={schedule:(d,f=!1,h=!1)=>{const g=h&&o?n:r;return f&&i.add(d),g.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(c=d,o){s=!0;return}o=!0;const f=n;n=r,r=f,n.forEach(l),n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const Db=40;function Mp(t,e){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=Bs.reduce((C,S)=>(C[S]=Ib(s),C),{}),{setup:c,read:l,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:p,postRender:g}=i,b=()=>{const C=pr.useManualTiming,S=C?o.timestamp:performance.now();n=!1,C||(o.delta=r?1e3/60:Math.max(Math.min(S-o.timestamp,Db),1)),o.timestamp=S,o.isProcessing=!0,c.process(o),l.process(o),u.process(o),d.process(o),f.process(o),h.process(o),p.process(o),g.process(o),o.isProcessing=!1,n&&e&&(r=!1,t(b))},x=()=>{n=!0,r=!0,o.isProcessing||t(b)};return{schedule:Bs.reduce((C,S)=>{const M=i[S];return C[S]=(R,P=!1,T=!1)=>(n||x(),M.schedule(R,P,T)),C},{}),cancel:C=>{for(let S=0;S<Bs.length;S++)i[Bs[S]].cancel(C)},state:o,steps:i}}const{schedule:tt,cancel:mr,state:Pt,steps:Na}=Mp(typeof requestAnimationFrame<"u"?requestAnimationFrame:cn,!0);let ui;function $b(){ui=void 0}const Lt={now:()=>(ui===void 0&&Lt.set(Pt.isProcessing||pr.useManualTiming?Pt.timestamp:performance.now()),ui),set:t=>{ui=t,queueMicrotask($b)}},Rp=t=>e=>typeof e=="string"&&e.startsWith(t),Tp=Rp("--"),_b=Rp("var(--"),$l=t=>_b(t)?Ob.test(t.split("/*")[0].trim()):!1,Ob=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Rd(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Ro={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ts={...Ro,transform:t=>Fn(0,1,t)},Us={...Ro,default:1},Xo=t=>Math.round(t*1e5)/1e5,_l=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Lb(t){return t==null}const Fb=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ol=(t,e)=>n=>!!(typeof n=="string"&&Fb.test(n)&&n.startsWith(t)||e&&!Lb(n)&&Object.prototype.hasOwnProperty.call(n,e)),jp=(t,e,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,c]=r.match(_l);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(i),alpha:c!==void 0?parseFloat(c):1}},Vb=t=>Fn(0,255,t),Ea={...Ro,transform:t=>Math.round(Vb(t))},Lr={test:Ol("rgb","red"),parse:jp("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Ea.transform(t)+", "+Ea.transform(e)+", "+Ea.transform(n)+", "+Xo(ts.transform(r))+")"};function Bb(t){let e="",n="",r="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Mc={test:Ol("#"),parse:Bb,transform:Lr.transform},ys=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ur=ys("deg"),$n=ys("%"),Pe=ys("px"),Ub=ys("vh"),Hb=ys("vw"),Td={...$n,parse:t=>$n.parse(t)/100,transform:t=>$n.transform(t*100)},uo={test:Ol("hsl","hue"),parse:jp("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+$n.transform(Xo(e))+", "+$n.transform(Xo(n))+", "+Xo(ts.transform(r))+")"},pt={test:t=>Lr.test(t)||Mc.test(t)||uo.test(t),parse:t=>Lr.test(t)?Lr.parse(t):uo.test(t)?uo.parse(t):Mc.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Lr.transform(t):uo.transform(t),getAnimatableNone:t=>{const e=pt.parse(t);return e.alpha=0,pt.transform(e)}},Gb=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function zb(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(_l))==null?void 0:e.length)||0)+(((n=t.match(Gb))==null?void 0:n.length)||0)>0}const Pp="number",Np="color",Wb="var",Kb="var(",jd="${}",Yb=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function vo(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const c=e.replace(Yb,l=>(pt.test(l)?(r.color.push(s),o.push(Np),n.push(pt.parse(l))):l.startsWith(Kb)?(r.var.push(s),o.push(Wb),n.push(l)):(r.number.push(s),o.push(Pp),n.push(parseFloat(l))),++s,jd)).split(jd);return{values:n,split:c,indexes:r,types:o}}function Xb(t){return vo(t).values}function Ep({split:t,types:e}){const n=t.length;return r=>{let o="";for(let s=0;s<n;s++)if(o+=t[s],r[s]!==void 0){const i=e[s];i===Pp?o+=Xo(r[s]):i===Np?o+=pt.transform(r[s]):o+=r[s]}return o}}function qb(t){return Ep(vo(t))}const Zb=t=>typeof t=="number"?0:pt.test(t)?pt.getAnimatableNone(t):t,Jb=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Zb(t);function Qb(t){const e=vo(t);return Ep(e)(e.values.map((r,o)=>Jb(r,e.split[o])))}const gn={test:zb,parse:Xb,createTransformer:qb,getAnimatableNone:Qb};function ka(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function e0({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let o=0,s=0,i=0;if(!e)o=s=i=n;else{const c=n<.5?n*(1+e):n+e-n*e,l=2*n-c;o=ka(l,c,t+1/3),s=ka(l,c,t),i=ka(l,c,t-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function Ri(t,e){return n=>n>0?e:t}const rt=(t,e,n)=>t+(e-t)*n,Aa=(t,e,n)=>{const r=t*t,o=n*(e*e-r)+r;return o<0?0:Math.sqrt(o)},t0=[Mc,Lr,uo],n0=t=>t0.find(e=>e.test(t));function Pd(t){const e=n0(t);if(Mo(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===uo&&(n=e0(n)),n}const Nd=(t,e)=>{const n=Pd(t),r=Pd(e);if(!n||!r)return Ri(t,e);const o={...n};return s=>(o.red=Aa(n.red,r.red,s),o.green=Aa(n.green,r.green,s),o.blue=Aa(n.blue,r.blue,s),o.alpha=rt(n.alpha,r.alpha,s),Lr.transform(o))},Rc=new Set(["none","hidden"]);function r0(t,e){return Rc.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function o0(t,e){return n=>rt(t,e,n)}function Ll(t){return typeof t=="number"?o0:typeof t=="string"?$l(t)?Ri:pt.test(t)?Nd:a0:Array.isArray(t)?kp:typeof t=="object"?pt.test(t)?Nd:s0:Ri}function kp(t,e){const n=[...t],r=n.length,o=t.map((s,i)=>Ll(s)(s,e[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function s0(t,e){const n={...t,...e},r={};for(const o in n)t[o]!==void 0&&e[o]!==void 0&&(r[o]=Ll(t[o])(t[o],e[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function i0(t,e){const n=[],r={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const s=e.types[o],i=t.indexes[s][r[s]],c=t.values[i]??0;n[o]=c,r[s]++}return n}const a0=(t,e)=>{const n=gn.createTransformer(e),r=vo(t),o=vo(e);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Rc.has(t)&&!o.values.length||Rc.has(e)&&!r.values.length?r0(t,e):ms(kp(i0(r,o),o.values),n):(Mo(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ri(t,e))};function Ap(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?rt(t,e,n):Ll(t)(t,e)}const c0=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>tt.update(e,n),stop:()=>mr(e),now:()=>Pt.isProcessing?Pt.timestamp:Lt.now()}},Ip=(t,e,n=10)=>{let r="";const o=Math.max(Math.round(e/n),2);for(let s=0;s<o;s++)r+=Math.round(t(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Ti=2e4;function Fl(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Ti;)e+=n,r=t.next(e);return e>=Ti?1/0:e}function l0(t,e=100,n){const r=n({...t,keyframes:[0,e]}),o=Math.min(Fl(r),Ti);return{type:"keyframes",ease:s=>r.next(o*s).value/e,duration:an(o)}}const at={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Tc(t,e){return t*Math.sqrt(1-e*e)}const u0=12;function d0(t,e,n){let r=n;for(let o=1;o<u0;o++)r=r-t(r)/e(r);return r}const Ia=.001;function f0({duration:t=at.duration,bounce:e=at.bounce,velocity:n=at.velocity,mass:r=at.mass}){let o,s;Mo(t<=Gt(at.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-e;i=Fn(at.minDamping,at.maxDamping,i),t=Fn(at.minDuration,at.maxDuration,an(t)),i<1?(o=u=>{const d=u*i,f=d*t,h=d-n,p=Tc(u,i),g=Math.exp(-f);return Ia-h/p*g},s=u=>{const f=u*i*t,h=f*n+n,p=Math.pow(i,2)*Math.pow(u,2)*t,g=Math.exp(-f),b=Tc(Math.pow(u,2),i);return(-o(u)+Ia>0?-1:1)*((h-p)*g)/b}):(o=u=>{const d=Math.exp(-u*t),f=(u-n)*t+1;return-Ia+d*f},s=u=>{const d=Math.exp(-u*t),f=(n-u)*(t*t);return d*f});const c=5/t,l=d0(o,s,c);if(t=Gt(t),isNaN(l))return{stiffness:at.stiffness,damping:at.damping,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:i*2*Math.sqrt(r*u),duration:t}}}const h0=["duration","bounce"],p0=["stiffness","damping","mass"];function Ed(t,e){return e.some(n=>t[n]!==void 0)}function m0(t){let e={velocity:at.velocity,stiffness:at.stiffness,damping:at.damping,mass:at.mass,isResolvedFromDuration:!1,...t};if(!Ed(t,p0)&&Ed(t,h0))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*Fn(.05,1,1-(t.bounce||0))*Math.sqrt(o);e={...e,mass:at.mass,stiffness:o,damping:s}}else{const n=f0({...t,velocity:0});e={...e,...n,mass:at.mass},e.isResolvedFromDuration=!0}return e}function ji(t=at.visualDuration,e=at.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],c={done:!1,value:s},{stiffness:l,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=m0({...n,velocity:-an(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(l*d)),x=i-s,y=an(Math.sqrt(l/d)),w=Math.abs(x)<5;r||(r=w?at.restSpeed.granular:at.restSpeed.default),o||(o=w?at.restDelta.granular:at.restDelta.default);let C,S,M,R,P,T;if(b<1)M=Tc(y,b),R=(g+b*y*x)/M,C=A=>{const _=Math.exp(-b*y*A);return i-_*(R*Math.sin(M*A)+x*Math.cos(M*A))},P=b*y*R+x*M,T=b*y*x-R*M,S=A=>Math.exp(-b*y*A)*(P*Math.sin(M*A)+T*Math.cos(M*A));else if(b===1){C=_=>i-Math.exp(-y*_)*(x+(g+y*x)*_);const A=g+y*x;S=_=>Math.exp(-y*_)*(y*A*_-g)}else{const A=y*Math.sqrt(b*b-1);C=k=>{const q=Math.exp(-b*y*k),U=Math.min(A*k,300);return i-q*((g+b*y*x)*Math.sinh(U)+A*x*Math.cosh(U))/A};const _=(g+b*y*x)/A,L=b*y*_-x*A,I=b*y*x-_*A;S=k=>{const q=Math.exp(-b*y*k),U=Math.min(A*k,300);return q*(L*Math.sinh(U)+I*Math.cosh(U))}}const j={calculatedDuration:p&&f||null,velocity:A=>Gt(S(A)),next:A=>{if(!p&&b<1){const L=Math.exp(-b*y*A),I=Math.sin(M*A),k=Math.cos(M*A),q=i-L*(R*I+x*k),U=Gt(L*(P*I+T*k));return c.done=Math.abs(U)<=r&&Math.abs(i-q)<=o,c.value=c.done?i:q,c}const _=C(A);if(p)c.done=A>=f;else{const L=Gt(S(A));c.done=Math.abs(L)<=r&&Math.abs(i-_)<=o}return c.value=c.done?i:_,c},toString:()=>{const A=Math.min(Fl(j),Ti),_=Ip(L=>j.next(A*L).value,A,30);return A+"ms "+_},toTransition:()=>{}};return j}ji.applyToOptions=t=>{const e=l0(t,100,ji);return t.ease=e.ease,t.duration=Gt(e.duration),t.type="keyframes",t};const g0=5;function Dp(t,e,n){const r=Math.max(e-g0,0);return hp(n-t(r),e-r)}function jc({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:c,max:l,restDelta:u=.5,restSpeed:d}){const f=t[0],h={done:!1,value:f},p=T=>c!==void 0&&T<c||l!==void 0&&T>l,g=T=>c===void 0?l:l===void 0||Math.abs(c-T)<Math.abs(l-T)?c:l;let b=n*e;const x=f+b,y=i===void 0?x:i(x);y!==x&&(b=y-f);const w=T=>-b*Math.exp(-T/r),C=T=>y+w(T),S=T=>{const j=w(T),A=C(T);h.done=Math.abs(j)<=u,h.value=h.done?y:A};let M,R;const P=T=>{p(h.value)&&(M=T,R=ji({keyframes:[h.value,g(h.value)],velocity:Dp(C,T,h.value),damping:o,stiffness:s,restDelta:u,restSpeed:d}))};return P(0),{calculatedDuration:null,next:T=>{let j=!1;return!R&&M===void 0&&(j=!0,S(T),P(T)),M!==void 0&&T>=M?R.next(T-M):(!j&&S(T),h)}}}function y0(t,e,n){const r=[],o=n||pr.mix||Ap,s=t.length-1;for(let i=0;i<s;i++){let c=o(t[i],t[i+1]);if(e){const l=Array.isArray(e)?e[i]||cn:e;c=ms(l,c)}r.push(c)}return r}function v0(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const s=t.length;if(Qn(s===e.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const i=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=y0(e,r,o),l=c.length,u=d=>{if(i&&d<t[0])return e[0];let f=0;if(l>1)for(;f<t.length-2&&!(d<t[f+1]);f++);const h=es(t[f],t[f+1],d);return c[f](h)};return n?d=>u(Fn(t[0],t[s-1],d)):u}function x0(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const o=es(0,e,r);t.push(rt(n,1,o))}}function b0(t){const e=[0];return x0(e,t.length-1),e}function w0(t,e){return t.map(n=>n*e)}function C0(t,e){return t.map(()=>e||Cp).splice(0,t.length-1)}function fo({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const o=kb(r)?r.map(Md):Md(r),s={done:!1,value:e[0]},i=w0(n&&n.length===e.length?n:b0(e),t),c=v0(i,e,{ease:Array.isArray(o)?o:C0(e,o)});return{calculatedDuration:t,next:l=>(s.value=c(l),s.done=l>=t,s)}}const S0=t=>t!==null;function Hi(t,{repeat:e,repeatType:n="loop"},r,o=1){const s=t.filter(S0),c=o<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!c||r===void 0?s[c]:r}const M0={decay:jc,inertia:jc,tween:fo,keyframes:fo,spring:ji};function $p(t){typeof t.type=="string"&&(t.type=M0[t.type])}class Vl{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const R0=t=>t/100;class Pi extends Vl{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,o;const{motionValue:n}=this.options;n&&n.updatedAt!==Lt.now()&&this.tick(Lt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;$p(e);const{type:n=fo,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=e;let{keyframes:c}=e;const l=n||fo;process.env.NODE_ENV!=="production"&&l!==fo&&Qn(c.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${c}`,"spring-two-frames"),l!==fo&&typeof c[0]!="number"&&(this.mixKeyframes=ms(R0,Ap(c[0],c[1])),c=[0,100]);const u=l({...e,keyframes:c});s==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...c].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=Fl(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:c,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:p,type:g,onUpdate:b,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-o/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?y<0:y>o;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let C=this.currentTime,S=r;if(f){const T=Math.min(this.currentTime,o)/c;let j=Math.floor(T),A=T%1;!A&&T>=1&&(A=1),A===1&&j--,j=Math.min(j,f+1),!!(j%2)&&(h==="reverse"?(A=1-A,p&&(A-=p/c)):h==="mirror"&&(S=i)),C=Fn(0,1,A)*c}let M;w?(this.delayState.value=d[0],M=this.delayState):M=S.next(C),s&&!w&&(M.value=s(M.value));let{done:R}=M;!w&&l!==null&&(R=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return P&&g!==jc&&(M.value=Hi(d,this.options,x,this.speed)),b&&b(M.value),P&&this.finish(),M}then(e,n){return this.finished.then(e,n)}get duration(){return an(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+an(e)}get time(){return an(this.currentTime)}set time(e){e=Gt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Dp(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(Lt.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=an(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:e=c0,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Lt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function T0(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Fr=t=>t*180/Math.PI,Pc=t=>{const e=Fr(Math.atan2(t[1],t[0]));return Nc(e)},j0={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Pc,rotateZ:Pc,skewX:t=>Fr(Math.atan(t[1])),skewY:t=>Fr(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Nc=t=>(t=t%360,t<0&&(t+=360),t),kd=Pc,Ad=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Id=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),P0={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ad,scaleY:Id,scale:t=>(Ad(t)+Id(t))/2,rotateX:t=>Nc(Fr(Math.atan2(t[6],t[5]))),rotateY:t=>Nc(Fr(Math.atan2(-t[2],t[0]))),rotateZ:kd,rotate:kd,skewX:t=>Fr(Math.atan(t[4])),skewY:t=>Fr(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ec(t){return t.includes("scale")?1:0}function kc(t,e){if(!t||t==="none")return Ec(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=P0,o=n;else{const c=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=j0,o=c}if(!o)return Ec(e);const s=r[e],i=o[1].split(",").map(E0);return typeof s=="function"?s(i):i[s]}const N0=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return kc(n,e)};function E0(t){return parseFloat(t.trim())}const To=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],jo=new Set(To),Dd=t=>t===Ro||t===Pe,k0=new Set(["x","y","z"]),A0=To.filter(t=>!k0.has(t));function I0(t){const e=[];return A0.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const hr={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const o=t.max-t.min;return r==="border-box"?o:o-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const o=t.max-t.min;return r==="border-box"?o:o-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>kc(e,"x"),y:(t,{transform:e})=>kc(e,"y")};hr.translateX=hr.x;hr.translateY=hr.y;const Vr=new Set;let Ac=!1,Ic=!1,Dc=!1;function _p(){if(Ic){const t=Array.from(Vr).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const o=I0(r);o.length&&(n.set(r,o),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var c;(c=r.getValue(s))==null||c.set(i)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ic=!1,Ac=!1,Vr.forEach(t=>t.complete(Dc)),Vr.clear()}function Op(){Vr.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ic=!0)})}function D0(){Dc=!0,Op(),_p(),Dc=!1}class Bl{constructor(e,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Vr.add(this),Ac||(Ac=!0,tt.read(Op),tt.resolveKeyframes(_p))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:o}=this;if(e[0]===null){const s=o==null?void 0:o.get(),i=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&n){const c=r.readValue(n,i);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=i),o&&s===void 0&&o.set(e[0])}T0(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Vr.delete(this)}cancel(){this.state==="scheduled"&&(Vr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const $0=t=>t.startsWith("--");function Lp(t,e,n){$0(e)?t.style.setProperty(e,n):t.style[e]=n}const _0={};function Fp(t,e){const n=fp(t);return()=>_0[e]??n()}const O0=Fp(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Vp=Fp(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Wo=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,$d={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wo([0,.65,.55,1]),circOut:Wo([.55,0,1,.45]),backIn:Wo([.31,.01,.66,-.59]),backOut:Wo([.33,1.53,.69,.99])};function Bp(t,e){if(t)return typeof t=="function"?Vp()?Ip(t,e):"ease-out":Sp(t)?Wo(t):Array.isArray(t)?t.map(n=>Bp(n,e)||$d.easeOut):$d[t]}function L0(t,e,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:c="easeOut",times:l}={},u=void 0){const d={[e]:n};l&&(d.offset=l);const f=Bp(c,o);Array.isArray(f)&&(d.easing=f);const h={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(d,h)}function Up(t){return typeof t=="function"&&"applyToOptions"in t}function F0({type:t,...e}){return Up(t)&&Vp()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Hp extends Vl{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:c,onComplete:l}=e;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=e,Qn(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=F0(e);this.animation=L0(n,r,o,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=Hi(o,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(d),Lp(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,o;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((o=(r=this.animation).commitStyles)==null||o.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return an(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+an(e)}get time(){return an(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Gt(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&O0()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),cn):o(this)}}const Gp={anticipate:xp,backInOut:vp,circInOut:wp};function V0(t){return t in Gp}function B0(t){typeof t.ease=="string"&&V0(t.ease)&&(t.ease=Gp[t.ease])}const Da=10;class U0 extends Hp{constructor(e){B0(e),$p(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const c=new Pi({...i,autoplay:!1}),l=Math.max(Da,Lt.now()-this.startTime),u=Fn(0,Da,l-Da),d=c.sample(l).value,{name:f}=this.options;s&&f&&Lp(s,f,d),n.setWithVelocity(c.sample(Math.max(0,l-u)).value,d,u),c.stop()}}const _d=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(gn.test(t)||t==="0")&&!t.startsWith("url("));function H0(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function G0(t,e,n,r){const o=t[0];if(o===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],i=_d(o,e),c=_d(s,e);return Mo(i===c,`You are trying to animate ${e} from "${o}" to "${s}". "${i?s:o}" is not an animatable value.`,"value-not-animatable"),!i||!c?!1:H0(t)||(n==="spring"||Up(n))&&r}function $c(t){t.duration=0,t.type="keyframes"}const zp=new Set(["opacity","clipPath","filter","transform"]),z0=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function W0(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&z0.test(t[e]))return!0;return!1}const K0=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Y0=fp(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function X0(t){var f;const{motionValue:e,name:n,repeatDelay:r,repeatType:o,damping:s,type:i,keyframes:c}=t;if(!(((f=e==null?void 0:e.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=e.owner.getProps();return Y0()&&n&&(zp.has(n)||K0.has(n)&&W0(c))&&(n!=="transform"||!d)&&!u&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const q0=40;class Z0 extends Vl{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:c,name:l,motionValue:u,element:d,...f}){var g;super(),this.stop=()=>{var b,x;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=Lt.now();const h={autoplay:e,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:l,motionValue:u,element:d,...f},p=(d==null?void 0:d.KeyframeResolver)||Bl;this.keyframeResolver=new p(c,(b,x,y)=>this.onKeyframesResolved(b,x,h,!y),l,u,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(e,n,r,o){var y,w;this.keyframeResolver=void 0;const{name:s,type:i,velocity:c,delay:l,isHandoff:u,onUpdate:d}=r;this.resolvedAt=Lt.now();let f=!0;G0(e,s,i,c)||(f=!1,(pr.instantAnimations||!l)&&(d==null||d(Hi(e,r,n))),e[0]=e[e.length-1],$c(r),r.repeat=0);const p={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>q0?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},g=f&&!u&&X0(p),b=(w=(y=p.motionValue)==null?void 0:y.owner)==null?void 0:w.current;let x;if(g)try{x=new U0({...p,element:b})}catch{x=new Pi(p)}else x=new Pi(p);x.finished.then(()=>{this.notifyFinished()}).catch(cn),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),D0()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function Wp(t,e,n,r=0,o=1){const s=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),i=t.size,c=(i-1)*r;return typeof n=="function"?n(s,i):o===1?s*r:c-s*r}const J0=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Q0(t){const e=J0.exec(t);if(!e)return[,];const[,n,r,o]=e;return[`--${n??r}`,o]}const ew=4;function Kp(t,e,n=1){Qn(n<=ew,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=Q0(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const i=s.trim();return lp(i)?parseFloat(i):i}return $l(o)?Kp(o,e,n+1):o}const tw={type:"spring",stiffness:500,damping:25,restSpeed:10},nw=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),rw={type:"keyframes",duration:.8},ow={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sw=(t,{keyframes:e})=>e.length>2?rw:jo.has(t)?t.startsWith("scale")?nw(e[1]):tw:ow;function Yp(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Ul(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Yp(n,t):n}const iw=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function aw(t){for(const e in t)if(!iw.has(e))return!0;return!1}const Hl=(t,e,n,r={},o,s)=>i=>{const c=Ul(r,t)||{},l=c.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Gt(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-u,onUpdate:h=>{e.set(h),c.onUpdate&&c.onUpdate(h)},onComplete:()=>{i(),c.onComplete&&c.onComplete()},name:t,motionValue:e,element:s?void 0:o};aw(c)||Object.assign(d,sw(t,d)),d.duration&&(d.duration=Gt(d.duration)),d.repeatDelay&&(d.repeatDelay=Gt(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&($c(d),d.delay===0&&(f=!0)),(pr.instantAnimations||pr.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(f=!0,$c(d),d.delay=0),d.allowFlatten=!c.type&&!c.ease,f&&!s&&e.get()!==void 0){const h=Hi(d.keyframes,c);if(h!==void 0){tt.update(()=>{d.onUpdate(h),d.onComplete()});return}}return c.isSync?new Pi(d):new Z0(d)};function Od(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Gl(t,e,n,r){if(typeof e=="function"){const[o,s]=Od(r);e=e(n!==void 0?n:t.custom,o,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[o,s]=Od(r);e=e(n!==void 0?n:t.custom,o,s)}return e}function Br(t,e,n){const r=t.getProps();return Gl(r,e,n!==void 0?n:r.custom,t)}const Xp=new Set(["width","height","top","left","right","bottom",...To]),Ld=30,cw=t=>!isNaN(parseFloat(t));class lw{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=Lt.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Lt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=cw(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&Al(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new kl);const r=this.events[e].add(n);return e==="change"?()=>{r(),tt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Lt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ld)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ld);return hp(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xo(t,e){return new lw(t,e)}const _c=t=>Array.isArray(t);function uw(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,xo(n))}function dw(t){return _c(t)?t[t.length-1]||0:t}function fw(t,e){const n=Br(t,e);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const c=dw(s[i]);uw(t,i,c)}}const Nt=t=>!!(t&&t.getVelocity);function hw(t){return!!(Nt(t)&&t.add)}function Oc(t,e){const n=t.getValue("willChange");if(hw(n))return n.add(e);if(!n&&pr.WillChange){const r=new pr.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function zl(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const pw="framerAppearId",qp="data-"+zl(pw);function Zp(t){return t.props[qp]}function mw({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function Jp(t,e,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s,transitionEnd:i,...c}=e;const l=t.getDefaultTransition();s=s?Yp(s,l):l;const u=s==null?void 0:s.reduceMotion;r&&(s=r);const d=[],f=o&&t.animationState&&t.animationState.getState()[o];for(const h in c){const p=t.getValue(h,t.latestValues[h]??null),g=c[h];if(g===void 0||f&&mw(f,h))continue;const b={delay:n,...Ul(s||{},h)},x=p.get();if(x!==void 0&&!p.isAnimating()&&!Array.isArray(g)&&g===x&&!b.velocity){tt.update(()=>p.set(g));continue}let y=!1;if(window.MotionHandoffAnimation){const S=Zp(t);if(S){const M=window.MotionHandoffAnimation(S,h,tt);M!==null&&(b.startTime=M,y=!0)}}Oc(t,h);const w=u??t.shouldReduceMotion;p.start(Hl(h,p,g,w&&Xp.has(h)?{type:!1}:b,t,y));const C=p.animation;C&&d.push(C)}if(i){const h=()=>tt.update(()=>{i&&fw(t,i)});d.length?Promise.all(d).then(h):h()}return d}function Lc(t,e,n={}){var l;const r=Br(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(Jp(t,r,n)):()=>Promise.resolve(),i=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=o;return gw(t,e,u,d,f,h,n)}:()=>Promise.resolve(),{when:c}=o;if(c){const[u,d]=c==="beforeChildren"?[s,i]:[i,s];return u().then(()=>d())}else return Promise.all([s(),i(n.delay)])}function gw(t,e,n=0,r=0,o=0,s=1,i){const c=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),c.push(Lc(l,e,{...i,delay:n+(typeof r=="function"?0:r)+Wp(t.variantChildren,l,r,o,s)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(c)}function yw(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const o=e.map(s=>Lc(t,s,n));r=Promise.all(o)}else if(typeof e=="string")r=Lc(t,e,n);else{const o=typeof e=="function"?Br(t,e,n.custom):e;r=Promise.all(Jp(t,o,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const vw={test:t=>t==="auto",parse:t=>t},Qp=t=>e=>e.test(t),em=[Ro,Pe,$n,ur,Hb,Ub,vw],Fd=t=>em.find(Qp(t));function xw(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||dp(t):!0}const bw=new Set(["brightness","contrast","saturate","opacity"]);function ww(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(_l)||[];if(!r)return t;const o=n.replace(r,"");let s=bw.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+o+")"}const Cw=/\b([a-z-]*)\(.*?\)/gu,Fc={...gn,getAnimatableNone:t=>{const e=t.match(Cw);return e?e.map(ww).join(" "):t}},Vc={...gn,getAnimatableNone:t=>{const e=gn.parse(t);return gn.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Vd={...Ro,transform:Math.round},Sw={rotate:ur,rotateX:ur,rotateY:ur,rotateZ:ur,scale:Us,scaleX:Us,scaleY:Us,scaleZ:Us,skew:ur,skewX:ur,skewY:ur,distance:Pe,translateX:Pe,translateY:Pe,translateZ:Pe,x:Pe,y:Pe,z:Pe,perspective:Pe,transformPerspective:Pe,opacity:ts,originX:Td,originY:Td,originZ:Pe},Wl={borderWidth:Pe,borderTopWidth:Pe,borderRightWidth:Pe,borderBottomWidth:Pe,borderLeftWidth:Pe,borderRadius:Pe,borderTopLeftRadius:Pe,borderTopRightRadius:Pe,borderBottomRightRadius:Pe,borderBottomLeftRadius:Pe,width:Pe,maxWidth:Pe,height:Pe,maxHeight:Pe,top:Pe,right:Pe,bottom:Pe,left:Pe,inset:Pe,insetBlock:Pe,insetBlockStart:Pe,insetBlockEnd:Pe,insetInline:Pe,insetInlineStart:Pe,insetInlineEnd:Pe,padding:Pe,paddingTop:Pe,paddingRight:Pe,paddingBottom:Pe,paddingLeft:Pe,paddingBlock:Pe,paddingBlockStart:Pe,paddingBlockEnd:Pe,paddingInline:Pe,paddingInlineStart:Pe,paddingInlineEnd:Pe,margin:Pe,marginTop:Pe,marginRight:Pe,marginBottom:Pe,marginLeft:Pe,marginBlock:Pe,marginBlockStart:Pe,marginBlockEnd:Pe,marginInline:Pe,marginInlineStart:Pe,marginInlineEnd:Pe,fontSize:Pe,backgroundPositionX:Pe,backgroundPositionY:Pe,...Sw,zIndex:Vd,fillOpacity:ts,strokeOpacity:ts,numOctaves:Vd},Mw={...Wl,color:pt,backgroundColor:pt,outlineColor:pt,fill:pt,stroke:pt,borderColor:pt,borderTopColor:pt,borderRightColor:pt,borderBottomColor:pt,borderLeftColor:pt,filter:Fc,WebkitFilter:Fc,mask:Vc,WebkitMask:Vc},tm=t=>Mw[t],Rw=new Set([Fc,Vc]);function nm(t,e){let n=tm(t);return Rw.has(n)||(n=gn),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Tw=new Set(["auto","none","0"]);function jw(t,e,n){let r=0,o;for(;r<t.length&&!o;){const s=t[r];typeof s=="string"&&!Tw.has(s)&&vo(s).values.length&&(o=t[r]),r++}if(o&&n)for(const s of e)t[s]=nm(n,o)}class Pw extends Bl{constructor(e,n,r,o,s){super(e,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let f=e[d];if(typeof f=="string"&&(f=f.trim(),$l(f))){const h=Kp(f,n.current);h!==void 0&&(e[d]=h),d===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Xp.has(r)||e.length!==2)return;const[o,s]=e,i=Fd(o),c=Fd(s),l=Rd(o),u=Rd(s);if(l!==u&&hr[r]){this.needsMeasurement=!0;return}if(i!==c)if(Dd(i)&&Dd(c))for(let d=0;d<e.length;d++){const f=e[d];typeof f=="string"&&(e[d]=parseFloat(f))}else hr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let o=0;o<e.length;o++)(e[o]===null||xw(e[o]))&&r.push(o);r.length&&jw(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=hr[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&e.getValue(r,o).jump(o,!1)}measureEndState(){var c;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const o=e.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=hr[n](e.measureViewportBox(),window.getComputedStyle(e.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(c=this.removedTransforms)!=null&&c.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function rm(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const o=(n==null?void 0:n[t])??r.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t).filter(r=>r!=null)}const om=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function di(t){return up(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Kl}=Mp(queueMicrotask,!1),hn={x:!1,y:!1};function sm(){return hn.x||hn.y}function Nw(t){return t==="x"||t==="y"?hn[t]?null:(hn[t]=!0,()=>{hn[t]=!1}):hn.x||hn.y?null:(hn.x=hn.y=!0,()=>{hn.x=hn.y=!1})}function im(t,e){const n=rm(t),r=new AbortController,o={passive:!0,...e,signal:r.signal};return[n,o,()=>r.abort()]}function Ew(t){return!(t.pointerType==="touch"||sm())}function kw(t,e,n={}){const[r,o,s]=im(t,n);return r.forEach(i=>{let c=!1,l=!1,u;const d=()=>{i.removeEventListener("pointerleave",g)},f=x=>{u&&(u(x),u=void 0),d()},h=x=>{c=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,f(x))},p=()=>{c=!0,window.addEventListener("pointerup",h,o),window.addEventListener("pointercancel",h,o)},g=x=>{if(x.pointerType!=="touch"){if(c){l=!0;return}f(x)}},b=x=>{if(!Ew(x))return;l=!1;const y=e(i,x);typeof y=="function"&&(u=y,i.addEventListener("pointerleave",g,o))};i.addEventListener("pointerenter",b,o),i.addEventListener("pointerdown",p,o)}),s}const am=(t,e)=>e?t===e?!0:am(t,e.parentElement):!1,Yl=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Aw=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Iw(t){return Aw.has(t.tagName)||t.isContentEditable===!0}const Dw=new Set(["INPUT","SELECT","TEXTAREA"]);function $w(t){return Dw.has(t.tagName)||t.isContentEditable===!0}const fi=new WeakSet;function Bd(t){return e=>{e.key==="Enter"&&t(e)}}function $a(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const _w=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Bd(()=>{if(fi.has(n))return;$a(n,"down");const o=Bd(()=>{$a(n,"up")}),s=()=>$a(n,"cancel");n.addEventListener("keyup",o,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function Ud(t){return Yl(t)&&!sm()}const Hd=new WeakSet;function Ow(t,e,n={}){const[r,o,s]=im(t,n),i=c=>{const l=c.currentTarget;if(!Ud(c)||Hd.has(c))return;fi.add(l),n.stopPropagation&&Hd.add(c);const u=e(l,c),d=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),fi.has(l)&&fi.delete(l),Ud(p)&&typeof u=="function"&&u(p,{success:g})},f=p=>{d(p,l===window||l===document||n.useGlobalTarget||am(l,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",h,o)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",i,o),di(c)&&(c.addEventListener("focus",u=>_w(u,o)),!Iw(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),s}function Xl(t){return up(t)&&"ownerSVGElement"in t}const hi=new WeakMap;let dr;const cm=(t,e,n)=>(r,o)=>o&&o[0]?o[0][t+"Size"]:Xl(r)&&"getBBox"in r?r.getBBox()[e]:r[n],Lw=cm("inline","width","offsetWidth"),Fw=cm("block","height","offsetHeight");function Vw({target:t,borderBoxSize:e}){var n;(n=hi.get(t))==null||n.forEach(r=>{r(t,{get width(){return Lw(t,e)},get height(){return Fw(t,e)}})})}function Bw(t){t.forEach(Vw)}function Uw(){typeof ResizeObserver>"u"||(dr=new ResizeObserver(Bw))}function Hw(t,e){dr||Uw();const n=rm(t);return n.forEach(r=>{let o=hi.get(r);o||(o=new Set,hi.set(r,o)),o.add(e),dr==null||dr.observe(r)}),()=>{n.forEach(r=>{const o=hi.get(r);o==null||o.delete(e),o!=null&&o.size||dr==null||dr.unobserve(r)})}}const pi=new Set;let ho;function Gw(){ho=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};pi.forEach(e=>e(t))},window.addEventListener("resize",ho)}function zw(t){return pi.add(t),ho||Gw(),()=>{pi.delete(t),!pi.size&&typeof ho=="function"&&(window.removeEventListener("resize",ho),ho=void 0)}}function Gd(t,e){return typeof t=="function"?zw(t):Hw(t,e)}function Ww(t){return Xl(t)&&t.tagName==="svg"}const Kw=[...em,pt,gn],Yw=t=>Kw.find(Qp(t)),zd=()=>({translate:0,scale:1,origin:0,originPoint:0}),po=()=>({x:zd(),y:zd()}),Wd=()=>({min:0,max:0}),yt=()=>({x:Wd(),y:Wd()}),Xw=new WeakMap;function Gi(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function ns(t){return typeof t=="string"||Array.isArray(t)}const ql=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Zl=["initial",...ql];function zi(t){return Gi(t.animate)||Zl.some(e=>ns(t[e]))}function lm(t){return!!(zi(t)||t.variants)}function qw(t,e,n){for(const r in e){const o=e[r],s=n[r];if(Nt(o))t.addValue(r,o);else if(Nt(s))t.addValue(r,xo(o,{owner:t}));else if(s!==o)if(t.hasValue(r)){const i=t.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=t.getStaticValue(r);t.addValue(r,xo(i!==void 0?i:o,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Bc={current:null},um={current:!1},Zw=typeof window<"u";function Jw(){if(um.current=!0,!!Zw)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Bc.current=t.matches;t.addEventListener("change",e),e()}else Bc.current=!1}const Kd=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ni={};function dm(t){Ni=t}function Qw(){return Ni}class eC{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:o,skipAnimations:s,blockInitialAnimation:i,visualState:c},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Bl,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Lt.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,tt.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=c;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=zi(n),this.isVariantNode=lm(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const g=h[p];u[p]!==void 0&&Nt(g)&&g.set(u[p])}}mount(e){var n,r;if(this.hasBeenMounted)for(const o in this.initialValues)(n=this.values.get(o))==null||n.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=e,Xw.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,s)=>this.bindToMotionValue(s,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(um.current||Jw(),this.shouldReduceMotion=Bc.current),process.env.NODE_ENV!=="production"&&Al(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),mr(this.notifyUpdate),mr(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&zp.has(e)&&this.current instanceof HTMLElement){const{factory:i,keyframes:c,times:l,ease:u,duration:d}=n.accelerate,f=new Hp({element:this.current,name:e,keyframes:c,times:l,ease:u,duration:Gt(d)}),h=i(f);this.valueSubscriptions.set(e,()=>{h(),f.cancel()});return}const r=jo.has(e);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",i=>{this.latestValues[e]=i,this.props.onUpdate&&tt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Ni){const n=Ni[e];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[e]&&o&&r(this.props)&&(this.features[e]=new o(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):yt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Kd.length;r++){const o=Kd[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=e[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=qw(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=xo(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(lp(r)||dp(r))?r=parseFloat(r):!Yw(r)&&gn.test(n)&&(r=nm(e,n)),this.setBaseTarget(e,Nt(r)?r.get():r)),Nt(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Gl(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[e])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!Nt(o)?o:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new kl),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Kl.render(this.render)}}class fm extends eC{constructor(){super(...arguments),this.KeyframeResolver=Pw}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Nt(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Cr{constructor(e){this.isMounted=!1,this.node=e}update(){}}function hm({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function tC({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function nC(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function _a(t){return t===void 0||t===1}function Uc({scale:t,scaleX:e,scaleY:n}){return!_a(t)||!_a(e)||!_a(n)}function Or(t){return Uc(t)||pm(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function pm(t){return Yd(t.x)||Yd(t.y)}function Yd(t){return t&&t!=="0%"}function Ei(t,e,n){const r=t-n,o=e*r;return n+o}function Xd(t,e,n,r,o){return o!==void 0&&(t=Ei(t,o,r)),Ei(t,n,r)+e}function Hc(t,e=0,n=1,r,o){t.min=Xd(t.min,e,n,r,o),t.max=Xd(t.max,e,n,r,o)}function mm(t,{x:e,y:n}){Hc(t.x,e.translate,e.scale,e.originPoint),Hc(t.y,n.translate,n.scale,n.originPoint)}const qd=.999999999999,Zd=1.0000000000001;function rC(t,e,n,r=!1){var c;const o=n.length;if(!o)return;e.x=e.y=1;let s,i;for(let l=0;l<o;l++){s=n[l],i=s.projectionDelta;const{visualElement:u}=s.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(An(t.x,-s.scroll.offset.x),An(t.y,-s.scroll.offset.y)),i&&(e.x*=i.x.scale,e.y*=i.y.scale,mm(t,i)),r&&Or(s.latestValues)&&mi(t,s.latestValues,(c=s.layout)==null?void 0:c.layoutBox))}e.x<Zd&&e.x>qd&&(e.x=1),e.y<Zd&&e.y>qd&&(e.y=1)}function An(t,e){t.min+=e,t.max+=e}function Jd(t,e,n,r,o=.5){const s=rt(t.min,t.max,o);Hc(t,e,n,s,r)}function Qd(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function mi(t,e,n){const r=n??t;Jd(t.x,Qd(e.x,r.x),e.scaleX,e.scale,e.originX),Jd(t.y,Qd(e.y,r.y),e.scaleY,e.scale,e.originY)}function gm(t,e){return hm(nC(t.getBoundingClientRect(),e))}function oC(t,e,n){const r=gm(t,n),{scroll:o}=e;return o&&(An(r.x,o.offset.x),An(r.y,o.offset.y)),r}const sC={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},iC=To.length;function aC(t,e,n){let r="",o=!0;for(let s=0;s<iC;s++){const i=To[s],c=t[i];if(c===void 0)continue;let l=!0;if(typeof c=="number")l=c===(i.startsWith("scale")?1:0);else{const u=parseFloat(c);l=i.startsWith("scale")?u===1:u===0}if(!l||n){const u=om(c,Wl[i]);if(!l){o=!1;const d=sC[i]||i;r+=`${d}(${u}) `}n&&(e[i]=u)}}return r=r.trim(),n?r=n(e,o?"":r):o&&(r="none"),r}function Jl(t,e,n){const{style:r,vars:o,transformOrigin:s}=t;let i=!1,c=!1;for(const l in e){const u=e[l];if(jo.has(l)){i=!0;continue}else if(Tp(l)){o[l]=u;continue}else{const d=om(u,Wl[l]);l.startsWith("origin")?(c=!0,s[l]=d):r[l]=d}}if(e.transform||(i||n?r.transform=aC(e,t.transform,n):r.transform&&(r.transform="none")),c){const{originX:l="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${u} ${d}`}}function ym(t,{style:e,vars:n},r,o){const s=t.style;let i;for(i in e)s[i]=e[i];o==null||o.applyProjectionStyles(s,r);for(i in n)s.setProperty(i,n[i])}function ef(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Bo={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Pe.test(t))t=parseFloat(t);else return t;const n=ef(t,e.target.x),r=ef(t,e.target.y);return`${n}% ${r}%`}},cC={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,o=gn.parse(t);if(o.length>5)return r;const s=gn.createTransformer(t),i=typeof o[0]!="number"?1:0,c=n.x.scale*e.x,l=n.y.scale*e.y;o[0+i]/=c,o[1+i]/=l;const u=rt(c,l,.5);return typeof o[2+i]=="number"&&(o[2+i]/=u),typeof o[3+i]=="number"&&(o[3+i]/=u),s(o)}},Gc={borderRadius:{...Bo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Bo,borderTopRightRadius:Bo,borderBottomLeftRadius:Bo,borderBottomRightRadius:Bo,boxShadow:cC};function vm(t,{layout:e,layoutId:n}){return jo.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Gc[t]||t==="opacity")}function Ql(t,e,n){var i;const r=t.style,o=e==null?void 0:e.style,s={};if(!r)return s;for(const c in r)(Nt(r[c])||o&&Nt(o[c])||vm(c,t)||((i=n==null?void 0:n.getValue(c))==null?void 0:i.liveStyle)!==void 0)&&(s[c]=r[c]);return s}function lC(t){return window.getComputedStyle(t)}class uC extends fm{constructor(){super(...arguments),this.type="html",this.renderInstance=ym}readValueFromInstance(e,n){var r;if(jo.has(n))return(r=this.projection)!=null&&r.isProjecting?Ec(n):N0(e,n);{const o=lC(e),s=(Tp(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return gm(e,n)}build(e,n,r){Jl(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Ql(e,n,r)}}const dC={offset:"stroke-dashoffset",array:"stroke-dasharray"},fC={offset:"strokeDashoffset",array:"strokeDasharray"};function hC(t,e,n=1,r=0,o=!0){t.pathLength=1;const s=o?dC:fC;t[s.offset]=`${-r}`,t[s.array]=`${e} ${n}`}const pC=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function xm(t,{attrX:e,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...c},l,u,d){if(Jl(t,c,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:h}=t;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const p of pC)f[p]!==void 0&&(h[p]=f[p],delete f[p]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&hC(f,o,s,i,!1)}const bm=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),wm=t=>typeof t=="string"&&t.toLowerCase()==="svg";function mC(t,e,n,r){ym(t,e,void 0,r);for(const o in e.attrs)t.setAttribute(bm.has(o)?o:zl(o),e.attrs[o])}function Cm(t,e,n){const r=Ql(t,e,n);for(const o in t)if(Nt(t[o])||Nt(e[o])){const s=To.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=t[o]}return r}class gC extends fm{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yt}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(jo.has(n)){const r=tm(n);return r&&r.default||0}return n=bm.has(n)?n:zl(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return Cm(e,n,r)}build(e,n,r){xm(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,o){mC(e,n,r,o)}mount(e){this.isSVGTag=wm(e.tagName),super.mount(e)}}const yC=Zl.length;function Sm(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Sm(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<yC;n++){const r=Zl[n],o=t.props[r];(ns(o)||o===!1)&&(e[r]=o)}return e}function Mm(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const vC=[...ql].reverse(),xC=ql.length;function bC(t){return e=>Promise.all(e.map(({animation:n,options:r})=>yw(t,n,r)))}function wC(t){let e=bC(t),n=tf(),r=!0,o=!1;const s=u=>(d,f)=>{var p;const h=Br(t,f,u==="exit"?(p=t.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:g,transitionEnd:b,...x}=h;d={...d,...x,...b}}return d};function i(u){e=u(t)}function c(u){const{props:d}=t,f=Sm(t.parent)||{},h=[],p=new Set;let g={},b=1/0;for(let y=0;y<xC;y++){const w=vC[y],C=n[w],S=d[w]!==void 0?d[w]:f[w],M=ns(S),R=w===u?C.isActive:null;R===!1&&(b=y);let P=S===f[w]&&S!==d[w]&&M;if(P&&(r||o)&&t.manuallyAnimateOnMount&&(P=!1),C.protectedKeys={...g},!C.isActive&&R===null||!S&&!C.prevProp||Gi(S)||typeof S=="boolean")continue;if(w==="exit"&&C.isActive&&R!==!0){C.prevResolvedValues&&(g={...g,...C.prevResolvedValues});continue}const T=CC(C.prevProp,S);let j=T||w===u&&C.isActive&&!P&&M||y>b&&M,A=!1;const _=Array.isArray(S)?S:[S];let L=_.reduce(s(w),{});R===!1&&(L={});const{prevResolvedValues:I={}}=C,k={...I,...L},q=$=>{j=!0,p.has($)&&(A=!0,p.delete($)),C.needsAnimating[$]=!0;const X=t.getValue($);X&&(X.liveStyle=!1)};for(const $ in k){const X=L[$],K=I[$];if(g.hasOwnProperty($))continue;let ue=!1;_c(X)&&_c(K)?ue=!Mm(X,K):ue=X!==K,ue?X!=null?q($):p.add($):X!==void 0&&p.has($)?q($):C.protectedKeys[$]=!0}C.prevProp=S,C.prevResolvedValues=L,C.isActive&&(g={...g,...L}),(r||o)&&t.blockInitialAnimation&&(j=!1);const U=P&&T;j&&(!U||A)&&h.push(..._.map($=>{const X={type:w};if(typeof $=="string"&&(r||o)&&!U&&t.manuallyAnimateOnMount&&t.parent){const{parent:K}=t,ue=Br(K,$);if(K.enteringChildren&&ue){const{delayChildren:D}=ue.transition||{};X.delay=Wp(K.enteringChildren,t,D)}}return{animation:$,options:X}}))}if(p.size){const y={};if(typeof d.initial!="boolean"){const w=Br(t,Array.isArray(d.initial)?d.initial[0]:d.initial);w&&w.transition&&(y.transition=w.transition)}p.forEach(w=>{const C=t.getBaseTarget(w),S=t.getValue(w);S&&(S.liveStyle=!0),y[w]=C??null}),h.push({animation:y})}let x=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(x=!1),r=!1,o=!1,x?e(h):Promise.resolve()}function l(u,d){var h;if(n[u].isActive===d)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(p=>{var g;return(g=p.animationState)==null?void 0:g.setActive(u,d)}),n[u].isActive=d;const f=c(u);for(const p in n)n[p].protectedKeys={};return f}return{animateChanges:c,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=tf(),o=!0}}}function CC(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Mm(e,t):!1}function $r(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tf(){return{animate:$r(!0),whileInView:$r(),whileHover:$r(),whileTap:$r(),whileDrag:$r(),whileFocus:$r(),exit:$r()}}function zc(t,e){t.min=e.min,t.max=e.max}function fn(t,e){zc(t.x,e.x),zc(t.y,e.y)}function nf(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Rm=1e-4,SC=1-Rm,MC=1+Rm,Tm=.01,RC=0-Tm,TC=0+Tm;function Ft(t){return t.max-t.min}function jC(t,e,n){return Math.abs(t-e)<=n}function rf(t,e,n,r=.5){t.origin=r,t.originPoint=rt(e.min,e.max,t.origin),t.scale=Ft(n)/Ft(e),t.translate=rt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=SC&&t.scale<=MC||isNaN(t.scale))&&(t.scale=1),(t.translate>=RC&&t.translate<=TC||isNaN(t.translate))&&(t.translate=0)}function qo(t,e,n,r){rf(t.x,e.x,n.x,r?r.originX:void 0),rf(t.y,e.y,n.y,r?r.originY:void 0)}function of(t,e,n,r=0){const o=r?rt(n.min,n.max,r):n.min;t.min=o+e.min,t.max=t.min+Ft(e)}function PC(t,e,n,r){of(t.x,e.x,n.x,r==null?void 0:r.x),of(t.y,e.y,n.y,r==null?void 0:r.y)}function sf(t,e,n,r=0){const o=r?rt(n.min,n.max,r):n.min;t.min=e.min-o,t.max=t.min+Ft(e)}function ki(t,e,n,r){sf(t.x,e.x,n.x,r==null?void 0:r.x),sf(t.y,e.y,n.y,r==null?void 0:r.y)}function af(t,e,n,r,o){return t-=e,t=Ei(t,1/n,r),o!==void 0&&(t=Ei(t,1/o,r)),t}function NC(t,e=0,n=1,r=.5,o,s=t,i=t){if($n.test(e)&&(e=parseFloat(e),e=rt(i.min,i.max,e/100)-i.min),typeof e!="number")return;let c=rt(s.min,s.max,r);t===s&&(c-=e),t.min=af(t.min,e,n,c,o),t.max=af(t.max,e,n,c,o)}function cf(t,e,[n,r,o],s,i){NC(t,e[n],e[r],e[o],e.scale,s,i)}const EC=["x","scaleX","originX"],kC=["y","scaleY","originY"];function lf(t,e,n,r){cf(t.x,e,EC,n?n.x:void 0,r?r.x:void 0),cf(t.y,e,kC,n?n.y:void 0,r?r.y:void 0)}function uf(t){return t.translate===0&&t.scale===1}function jm(t){return uf(t.x)&&uf(t.y)}function df(t,e){return t.min===e.min&&t.max===e.max}function AC(t,e){return df(t.x,e.x)&&df(t.y,e.y)}function ff(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Pm(t,e){return ff(t.x,e.x)&&ff(t.y,e.y)}function hf(t){return Ft(t.x)/Ft(t.y)}function pf(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function En(t){return[t("x"),t("y")]}function IC(t,e,n){let r="";const o=t.x.translate/e.x,s=t.y.translate/e.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}deg) `)}const c=t.x.scale*e.x,l=t.y.scale*e.y;return(c!==1||l!==1)&&(r+=`scale(${c}, ${l})`),r||"none"}const Nm=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],DC=Nm.length,mf=t=>typeof t=="string"?parseFloat(t):t,gf=t=>typeof t=="number"||Pe.test(t);function $C(t,e,n,r,o,s){o?(t.opacity=rt(0,n.opacity??1,_C(r)),t.opacityExit=rt(e.opacity??1,0,OC(r))):s&&(t.opacity=rt(e.opacity??1,n.opacity??1,r));for(let i=0;i<DC;i++){const c=Nm[i];let l=yf(e,c),u=yf(n,c);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||gf(l)===gf(u)?(t[c]=Math.max(rt(mf(l),mf(u),r),0),($n.test(u)||$n.test(l))&&(t[c]+="%")):t[c]=u}(e.rotate||n.rotate)&&(t.rotate=rt(e.rotate||0,n.rotate||0,r))}function yf(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const _C=Em(0,.5,bp),OC=Em(.5,.95,cn);function Em(t,e,n){return r=>r<t?0:r>e?1:n(es(t,e,r))}function LC(t,e,n){const r=Nt(t)?t:xo(t);return r.start(Hl("",r,e,n)),r.animation}function rs(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const FC=(t,e)=>t.depth-e.depth;class VC{constructor(){this.children=[],this.isDirty=!1}add(e){El(this.children,e),this.isDirty=!0}remove(e){Mi(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(FC),this.isDirty=!1,this.children.forEach(e)}}function BC(t,e){const n=Lt.now(),r=({timestamp:o})=>{const s=o-n;s>=e&&(mr(r),t(s-e))};return tt.setup(r,!0),()=>mr(r)}function gi(t){return Nt(t)?t.get():t}class UC{constructor(){this.members=[]}add(e){El(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(Mi(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Mi(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const o=this.members[r];if(o.isPresent!==!1&&((n=o.instance)==null?void 0:n.isConnected)!==!1)return this.promote(o),!0}return!1}promote(e,n){var o;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:i}=e.options;(s===void 0||s!==i)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(o=e.root)!=null&&o.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,o,s,i;(r=(n=e.options).onExitComplete)==null||r.call(n),(i=(o=e.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||i.call(s)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const yi={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Oa=["","X","Y","Z"],HC=1e3;let GC=0;function La(t,e,n,r){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),r&&(r[t]=0))}function km(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Zp(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",tt,!(o||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&km(r)}function Am({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},c=e==null?void 0:e()){this.id=GC++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(KC),this.nodes.forEach(QC),this.nodes.forEach(eS),this.nodes.forEach(YC)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new VC)}addEventListener(i,c){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new kl),this.eventHandlers.get(i).add(c)}notifyListeners(i,...c){const l=this.eventHandlers.get(i);l&&l.notify(...c)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Xl(i)&&!Ww(i),this.instance=i;const{layoutId:c,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||c)&&(this.isLayoutDirty=!0),t){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;tt.read(()=>{f=window.innerWidth}),t(i,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,d&&d(),d=BC(h,250),yi.hasAnimatedSinceResize&&(yi.hasAnimatedSinceResize=!1,this.nodes.forEach(bf)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||sS,{onLayoutAnimationStart:b,onLayoutAnimationComplete:x}=u.getProps(),y=!this.targetLayout||!Pm(this.targetLayout,p),w=!f&&h;if(this.options.layoutRoot||this.resumeFrom||w||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Ul(g,"layout"),onPlay:b,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(d,w)}else f||bf(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),mr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(tS),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&km(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:c,layout:l}=this.options;if(c===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(qC),this.nodes.forEach(vf);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(xf);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ZC),this.nodes.forEach(JC),this.nodes.forEach(zC),this.nodes.forEach(WC)):this.nodes.forEach(xf),this.clearAllSnapshots();const c=Lt.now();Pt.delta=Fn(0,1e3/60,c-Pt.timestamp),Pt.timestamp=c,Pt.isProcessing=!0,Na.update.process(Pt),Na.preRender.process(Pt),Na.render.process(Pt),Pt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Kl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(XC),this.sharedNodes.forEach(nS)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,tt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){tt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ft(this.snapshot.measuredBox.x)&&!Ft(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=yt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(c=!1),c&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!jm(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;i&&this.instance&&(c||Or(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const c=this.measurePageBox();let l=this.removeElementScroll(c);return i&&(l=this.removeTransform(l)),iS(l),{animationId:this.root.animationId,measuredBox:c,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:i}=this.options;if(!i)return yt();const c=i.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(aS))){const{scroll:d}=this.root;d&&(An(c.x,d.offset.x),An(c.y,d.offset.y))}return c}removeElementScroll(i){var l;const c=yt();if(fn(c,i),(l=this.scroll)!=null&&l.wasRoot)return c;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&fn(c,i),An(c.x,f.offset.x),An(c.y,f.offset.y))}return c}applyTransform(i,c=!1,l){var d,f;const u=l||yt();fn(u,i);for(let h=0;h<this.path.length;h++){const p=this.path[h];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(An(u.x,-p.scroll.offset.x),An(u.y,-p.scroll.offset.y)),Or(p.latestValues)&&mi(u,p.latestValues,(d=p.layout)==null?void 0:d.layoutBox)}return Or(this.latestValues)&&mi(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(i){var l;const c=yt();fn(c,i);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!Or(d.latestValues))continue;let f;d.instance&&(Uc(d.latestValues)&&d.updateSnapshot(),f=yt(),fn(f,d.measurePageBox())),lf(c,d.latestValues,(l=d.snapshot)==null?void 0:l.layoutBox,f)}return Or(this.latestValues)&&lf(c,this.latestValues),c}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Pt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var p;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==c;if(!(i||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=Pt.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=yt(),this.targetWithTransforms=yt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),PC(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):fn(this.target,this.layout.layoutBox),mm(this.target,this.targetDelta)):fn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Uc(this.parent.latestValues)||pm(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,c,l){this.relativeParent=i,this.linkedParentVersion=i.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=yt(),this.relativeTargetOrigin=yt(),ki(this.relativeTargetOrigin,c,l,this.options.layoutAnchor||void 0),fn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var g;const i=this.getLead(),c=!!this.resumingFrom||this!==i;let l=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(l=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Pt.timestamp&&(l=!1),l)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;fn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;rC(this.layoutCorrected,this.treeScale,this.path,c),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=yt());const{target:p}=i;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(nf(this.prevProjectionDelta.x,this.projectionDelta.x),nf(this.prevProjectionDelta.y,this.projectionDelta.y)),qo(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!pf(this.projectionDelta.x,this.prevProjectionDelta.x)||!pf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var c;if((c=this.options.visualElement)==null||c.scheduleRender(),i){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=po(),this.projectionDelta=po(),this.projectionDeltaWithTransform=po()}setAnimationOrigin(i,c=!1){const l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},f=po();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const h=yt(),p=l?l.source:void 0,g=this.layout?this.layout.source:void 0,b=p!==g,x=this.getStack(),y=!x||x.members.length<=1,w=!!(b&&!y&&this.options.crossfade===!0&&!this.path.some(oS));this.animationProgress=0;let C;this.mixTargetDelta=S=>{const M=S/1e3;wf(f.x,i.x,M),wf(f.y,i.y,M),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ki(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),rS(this.relativeTarget,this.relativeTargetOrigin,h,M),C&&AC(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=yt()),fn(C,this.relativeTarget)),b&&(this.animationValues=d,$C(d,u,this.latestValues,M,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var c,l,u;this.notifyListeners("animationStart"),(c=this.currentAnimation)==null||c.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(mr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=tt.update(()=>{yi.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=xo(0)),this.motionValue.jump(0,!1),this.currentAnimation=LC(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),i.onUpdate&&i.onUpdate(d)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(HC),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:c,target:l,layout:u,latestValues:d}=i;if(!(!c||!l||!u)){if(this!==i&&this.layout&&u&&Im(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||yt();const f=Ft(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+f;const h=Ft(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+h}fn(c,l),mi(c,d),qo(this.projectionDeltaWithTransform,this.layoutCorrected,c,d)}}registerSharedNode(i,c){this.sharedNodes.has(i)||this.sharedNodes.set(i,new UC),this.sharedNodes.get(i).add(c);const u=c.options.initialPromotionConfig;c.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(c):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var c;const{layoutId:i}=this.options;return i?((c=this.getStack())==null?void 0:c.lead)||this:this}getPrevLead(){var c;const{layoutId:i}=this.options;return i?(c=this.getStack())==null?void 0:c.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:c,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let c=!1;const{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(c=!0),!c)return;const u={};l.z&&La("z",i,u,this.animationValues);for(let d=0;d<Oa.length;d++)La(`rotate${Oa[d]}`,i,u,this.animationValues),La(`skew${Oa[d]}`,i,u,this.animationValues);i.render();for(const d in u)i.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);i.scheduleRender()}applyProjectionStyles(i,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=gi(c==null?void 0:c.pointerEvents)||"",i.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=gi(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!Or(this.latestValues)&&(i.transform=l?l({},""):"none",this.hasProjected=!1);return}i.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=IC(this.projectionDeltaWithTransform,this.treeScale,d);l&&(f=l(d,f)),i.transform=f;const{x:h,y:p}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,u.animationValues?i.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:i.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const g in Gc){if(d[g]===void 0)continue;const{correct:b,applyTo:x,isCSSVariable:y}=Gc[g],w=f==="none"?d[g]:b(d[g],u);if(x){const C=x.length;for(let S=0;S<C;S++)i[x[S]]=w}else y?this.options.visualElement.renderState.vars[g]=w:i[g]=w}this.options.layoutId&&(i.pointerEvents=u===this?gi(c==null?void 0:c.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var c;return(c=i.currentAnimation)==null?void 0:c.stop()}),this.root.nodes.forEach(vf),this.root.sharedNodes.clear()}}}function zC(t){t.updateLayout()}function WC(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=t.layout,{animationType:s}=t.options,i=e.source!==t.layout.source;if(s==="size")En(f=>{const h=i?e.measuredBox[f]:e.layoutBox[f],p=Ft(h);h.min=r[f].min,h.max=h.min+p});else if(s==="x"||s==="y"){const f=s==="x"?"y":"x";zc(i?e.measuredBox[f]:e.layoutBox[f],r[f])}else Im(s,e.layoutBox,r)&&En(f=>{const h=i?e.measuredBox[f]:e.layoutBox[f],p=Ft(r[f]);h.max=h.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+p)});const c=po();qo(c,r,e.layoutBox);const l=po();i?qo(l,t.applyTransform(o,!0),e.measuredBox):qo(l,r,e.layoutBox);const u=!jm(c);let d=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const g=t.options.layoutAnchor||void 0,b=yt();ki(b,e.layoutBox,h.layoutBox,g);const x=yt();ki(x,r,p.layoutBox,g),Pm(b,x)||(d=!0),f.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=b,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function KC(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function YC(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function XC(t){t.clearSnapshot()}function vf(t){t.clearMeasurements()}function qC(t){t.isLayoutDirty=!0,t.updateLayout()}function xf(t){t.isLayoutDirty=!1}function ZC(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function JC(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function bf(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function QC(t){t.resolveTargetDelta()}function eS(t){t.calcProjection()}function tS(t){t.resetSkewAndRotation()}function nS(t){t.removeLeadSnapshot()}function wf(t,e,n){t.translate=rt(e.translate,0,n),t.scale=rt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Cf(t,e,n,r){t.min=rt(e.min,n.min,r),t.max=rt(e.max,n.max,r)}function rS(t,e,n,r){Cf(t.x,e.x,n.x,r),Cf(t.y,e.y,n.y,r)}function oS(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const sS={duration:.45,ease:[.4,0,.1,1]},Sf=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Mf=Sf("applewebkit/")&&!Sf("chrome/")?Math.round:cn;function Rf(t){t.min=Mf(t.min),t.max=Mf(t.max)}function iS(t){Rf(t.x),Rf(t.y)}function Im(t,e,n){return t==="position"||t==="preserve-aspect"&&!jC(hf(e),hf(n),.2)}function aS(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const cS=Am({attachResizeListener:(t,e)=>rs(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Fa={current:void 0},Dm=Am({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Fa.current){const t=new cS({});t.mount(window),t.setOptions({layoutScroll:!0}),Fa.current=t}return Fa.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),eu=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Tf(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function lS(...t){return e=>{let n=!1;const r=t.map(o=>{const s=Tf(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Tf(t[o],null)}}}}function uS(...t){return m.useCallback(lS(...t),t)}class dS extends m.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(di(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,o=di(r)&&r.offsetWidth||0,s=di(r)&&r.offsetHeight||0,i=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(i.height),c.width=parseFloat(i.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=o-c.width-c.left,c.bottom=s-c.height-c.top}return null}componentDidUpdate(){}render(){return this.props.children}}function fS({children:t,isPresent:e,anchorX:n,anchorY:r,root:o,pop:s}){var h;const i=v.useId(),c=v.useRef(null),l=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=v.useContext(eu),d=((h=t.props)==null?void 0:h.ref)??(t==null?void 0:t.ref),f=uS(c,d);return v.useInsertionEffect(()=>{const{width:p,height:g,top:b,left:x,right:y,bottom:w}=l.current;if(e||s===!1||!c.current||!p||!g)return;const C=n==="left"?`left: ${x}`:`right: ${y}`,S=r==="bottom"?`bottom: ${w}`:`top: ${b}`;c.current.dataset.motionPopId=i;const M=document.createElement("style");u&&(M.nonce=u);const R=o??document.head;return R.appendChild(M),M.sheet&&M.sheet.insertRule(`
2
2
  [data-motion-pop-id="${i}"] {
3
3
  position: absolute !important;
4
- width: ${m}px !important;
4
+ width: ${p}px !important;
5
5
  height: ${g}px !important;
6
- ${b}px !important;
7
6
  ${C}px !important;
7
+ ${S}px !important;
8
8
  }
9
- `),()=>{var M;(M=a.current)==null||M.removeAttribute("data-motion-pop-id"),R.contains(P)&&R.removeChild(P)}},[e]),l.jsx(e0,{isPresent:e,childRef:a,sizeRef:c,pop:s,children:s===!1?t:p.cloneElement(t,{ref:f})})}const n0=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:a,anchorY:c,root:u})=>{const d=$a(r0),f=S.useId();let h=!0,m=S.useMemo(()=>(h=!1,{id:f,initial:e,isPresent:n,custom:o,onExitComplete:g=>{d.set(g,!0);for(const y of d.values())if(!y)return;r&&r()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,r]);return s&&h&&(m={...m}),S.useMemo(()=>{d.forEach((g,y)=>d.set(y,!1))},[n]),p.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),t=l.jsx(t0,{pop:i==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:t}),l.jsx(os.Provider,{value:m,children:t})};function r0(){return new Map}function jh(t=!0){const e=S.useContext(os);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=e,s=S.useId();S.useEffect(()=>{if(t)return o(s)},[t]);const i=S.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,i]:[!0]}const ho=t=>t.key||"";function Lu(t){const e=[];return S.Children.forEach(t,n=>{S.isValidElement(n)&&e.push(n)}),e}const Ah=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[d,f]=jh(i),h=S.useMemo(()=>Lu(t),[t]),m=i&&!d?[]:h.map(ho),g=S.useRef(!0),y=S.useRef(h),v=$a(()=>new Map),x=S.useRef(new Set),[w,b]=S.useState(h),[C,P]=S.useState(h);tf(()=>{g.current=!1,y.current=h;for(let A=0;A<C.length;A++){const T=ho(C[A]);m.includes(T)?(v.delete(T),x.current.delete(T)):v.get(T)!==!0&&v.set(T,!1)}},[C,m.length,m.join("-")]);const R=[];if(h!==w){let A=[...h];for(let T=0;T<C.length;T++){const E=C[T],N=ho(E);m.includes(N)||(A.splice(T,0,E),R.push(E))}return s==="wait"&&R.length&&(A=R),P(Lu(A)),b(h),null}process.env.NODE_ENV!=="production"&&s==="wait"&&C.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:M}=S.useContext(Oa);return l.jsx(l.Fragment,{children:C.map(A=>{const T=ho(A),E=i&&!d?!1:h===C||m.includes(T),N=()=>{if(x.current.has(T))return;if(v.has(T))x.current.add(T),v.set(T,!0);else return;let _=!0;v.forEach($=>{$||(_=!1)}),_&&(M==null||M(),P(y.current),i&&(f==null||f()),r&&r())};return l.jsx(n0,{isPresent:E,initial:!g.current||n?void 0:!1,custom:e,presenceAffectsLayout:o,mode:s,root:u,onExitComplete:E?void 0:N,anchorX:a,anchorY:c,children:A},T)})})},Dh=S.createContext({strict:!1}),Fu={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Vu=!1;function o0(){if(Vu)return;const t={};for(const e in Fu)t[e]={isEnabled:n=>Fu[e].some(r=>!!n[r])};sh(t),Vu=!0}function Ih(){return o0(),Gb()}function s0(t){const e=Ih();for(const n in t)e[n]={...e[n],...t[n]};sh(e)}const i0=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Qo(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||i0.has(t)}let kh=t=>!Qo(t);function a0(t){typeof t=="function"&&(kh=e=>e.startsWith("on")?!Qo(e):t(e))}try{a0(require("@emotion/is-prop-valid").default)}catch{}function c0(t,e,n){const r={};for(const o in t)o==="values"&&typeof t.values=="object"||Le(t[o])||(kh(o)||n===!0&&Qo(o)||!e&&!Qo(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}const cs=S.createContext({});function l0(t,e){if(as(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Tr(n)?n:void 0,animate:Tr(r)?r:void 0}}return t.inherit!==!1?e:{}}function u0(t){const{initial:e,animate:n}=l0(t,S.useContext(cs));return S.useMemo(()=>({initial:e,animate:n}),[Bu(e),Bu(n)])}function Bu(t){return Array.isArray(t)?t.join(" "):t}const lc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Nh(t,e,n){for(const r in e)!Le(e[r])&&!fh(r,n)&&(t[r]=e[r])}function d0({transformTemplate:t},e){return S.useMemo(()=>{const n=lc();return ic(n,e,t),Object.assign({},n.vars,n.style)},[e])}function f0(t,e){const n=t.style||{},r={};return Nh(r,n,t),Object.assign(r,d0(t,e)),r}function h0(t,e){const n={},r=f0(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const _h=()=>({...lc(),attrs:{}});function p0(t,e,n,r){const o=S.useMemo(()=>{const s=_h();return hh(s,e,mh(r),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};Nh(s,t.style,t),o.style={...s,...o.style}}return o}const m0=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function uc(t){return typeof t!="string"||t.includes("-")?!1:!!(m0.indexOf(t)>-1||/[A-Z]/u.test(t))}function g0(t,e,n,{latestValues:r},o,s=!1,i){const c=(i??uc(t)?p0:h0)(e,r,o,t),u=c0(e,typeof t=="string",s),d=t!==S.Fragment?{...u,...c,ref:n}:{},{children:f}=e,h=S.useMemo(()=>Le(f)?f.get():f,[f]);return S.createElement(t,{...d,children:h})}function y0({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,o){return{latestValues:v0(n,r,o,t),renderState:e()}}function v0(t,e,n,r){const o={},s=r(t,{});for(const h in s)o[h]=Oo(s[h]);let{initial:i,animate:a}=t;const c=as(t),u=rh(t);e&&u&&!c&&t.inherit!==!1&&(i===void 0&&(i=e.initial),a===void 0&&(a=e.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const f=d?a:i;if(f&&typeof f!="boolean"&&!is(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const g=Qa(t,h[m]);if(g){const{transitionEnd:y,transition:v,...x}=g;for(const w in x){let b=x[w];if(Array.isArray(b)){const C=d?b.length-1:0;b=b[C]}b!==null&&(o[w]=b)}for(const w in y)o[w]=y[w]}}}return o}const Oh=t=>(e,n)=>{const r=S.useContext(cs),o=S.useContext(os),s=()=>y0(t,e,r,o);return n?s():$a(s)},x0=Oh({scrapeMotionValuesFromProps:ac,createRenderState:lc}),b0=Oh({scrapeMotionValuesFromProps:gh,createRenderState:_h}),w0=Symbol.for("motionComponentSymbol");function C0(t,e,n){const r=S.useRef(n);S.useInsertionEffect(()=>{r.current=n});const o=S.useRef(null);return S.useCallback(s=>{var a;s&&((a=t.onMount)==null||a.call(t,s));const i=r.current;if(typeof i=="function")if(s){const c=i(s);typeof c=="function"&&(o.current=c)}else o.current?(o.current(),o.current=null):i(s);else i&&(i.current=s);e&&(s?e.mount(s):e.unmount())},[e])}const $h=S.createContext({});function Fn(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function S0(t,e,n,r,o,s){var b,C;const{visualElement:i}=S.useContext(cs),a=S.useContext(Dh),c=S.useContext(os),u=S.useContext(cc),d=u.reducedMotion,f=u.skipAnimations,h=S.useRef(null),m=S.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(t,{visualState:e,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:s}),m.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const g=h.current,y=S.useContext($h);g&&!g.projection&&o&&(g.type==="html"||g.type==="svg")&&P0(h.current,n,o,y);const v=S.useRef(!1);S.useInsertionEffect(()=>{g&&v.current&&g.update(n,c)});const x=n[Uf],w=S.useRef(!!x&&typeof window<"u"&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,x))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,x)));return tf(()=>{m.current=!0,g&&(v.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),w.current&&g.animationState&&g.animationState.animateChanges())}),S.useEffect(()=>{g&&(!w.current&&g.animationState&&g.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)==null||P.call(window,x)}),w.current=!1),g.enteringChildren=void 0)}),g}function P0(t,e,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:d,layoutCrossfade:f}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Lh(t.parent)),t.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&Fn(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u,layoutAnchor:d})}function Lh(t){if(t)return t.options.allowProjection!==!1?t.projection:Lh(t.parent)}function ri(t,{forwardMotionProps:e=!1,type:n}={},r,o){r&&s0(r);const s=n?n==="svg":uc(t),i=s?b0:x0;function a(u,d){let f;const h={...S.useContext(cc),...u,layoutId:R0(u)},{isStatic:m}=h,g=u0(u),y=i(u,m);if(!m&&typeof window<"u"){T0(h,r);const v=M0(h);f=v.MeasureLayout,g.visualElement=S0(t,y,h,o,v.ProjectionNode,s)}return l.jsxs(cs.Provider,{value:g,children:[f&&g.visualElement?l.jsx(f,{visualElement:g.visualElement,...h}):null,g0(t,u,C0(y,g.visualElement,d),y,m,e,s)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=S.forwardRef(a);return c[w0]=t,c}function R0({layoutId:t}){const e=S.useContext(Oa).id;return e&&t!==void 0?e+"-"+t:t}function T0(t,e){const n=S.useContext(Dh).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?nr(!1,r,"lazy-strict-mode"):Vt(!1,r,"lazy-strict-mode")}}function M0(t){const e=Ih(),{drag:n,layout:r}=e;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function E0(t,e){if(typeof Proxy>"u")return ri;const n=new Map,r=(s,i)=>ri(s,i,t,e),o=(s,i)=>(process.env.NODE_ENV!=="production"&&Va(!1,"motion() is deprecated. Use motion.create() instead."),r(s,i));return new Proxy(o,{get:(s,i)=>i==="create"?r:(n.has(i)||n.set(i,ri(i,void 0,t,e)),n.get(i))})}const j0=(t,e)=>e.isSVG??uc(t)?new sw(e):new Jb(e,{allowProjection:t!==S.Fragment});class A0 extends cn{constructor(e){super(e),e.animationState||(e.animationState=uw(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();is(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let D0=0;class I0 extends cn{constructor(){super(...arguments),this.id=D0++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:i,custom:a}=this.node.getProps();if(typeof i=="string"){const c=Pn(this.node,i,a);if(c){const{transition:u,transitionEnd:d,...f}=c;for(const h in f)(s=this.node.getValue(h))==null||s.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!e);n&&!e&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const k0={animation:{Feature:A0},exit:{Feature:I0}};function Vr(t){return{point:{x:t.pageX,y:t.pageY}}}const N0=t=>e=>nc(e)&&t(e,Vr(e));function Cr(t,e,n,r){return Mr(t,e,N0(n),r)}const Fh=({current:t})=>t?t.ownerDocument.defaultView:null,Gu=(t,e)=>Math.abs(t-e);function _0(t,e){const n=Gu(t.x,e.x),r=Gu(t.y,e.y);return Math.sqrt(n**2+r**2)}const zu=new Set(["auto","scroll"]);class Vh{constructor(e,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:i=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=po(this.lastRawMoveEventInfo,this.transformPagePoint));const m=oi(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,y=_0(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!y)return;const{point:v}=m,{timestamp:x}=$e;this.history.push({...v,timestamp:x});const{onStart:w,onMove:b}=this.handlers;g||(w&&w(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=po(g,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:y,onSessionEnd:v,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=oi(m.type==="pointercancel"?this.lastMoveEventInfo:po(g,this.transformPagePoint),this.history);this.startEvent&&y&&y(m,w),v&&v(m,w)},!nc(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const c=Vr(e),u=po(c,this.transformPagePoint),{point:d}=u,{timestamp:f}=$e;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(e,oi(u,this.history)),this.removeListeners=$r(Cr(this.contextWindow,"pointermove",this.handlePointerMove),Cr(this.contextWindow,"pointerup",this.handlePointerUp),Cr(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(zu.has(r.overflowX)||zu.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,o),ye.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),en(this.updatePoint)}}function po(t,e){return e?{point:e(t.point)}:t}function Uu(t,e){return{x:t.x-e.x,y:t.y-e.y}}function oi({point:t},e){return{point:t,delta:Uu(t,Bh(e)),offset:Uu(t,O0(e)),velocity:$0(e,.1)}}function O0(t){return t[0]}function Bh(t){return t[t.length-1]}function $0(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const o=Bh(t);for(;n>=0&&(r=t[n],!(o.timestamp-r.timestamp>qe(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&o.timestamp-r.timestamp>qe(e)*2&&(r=t[1]);const s=ut(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function L0(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?xe(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?xe(n,t,r.max):Math.min(t,n)),t}function Hu(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function F0(t,{top:e,left:n,bottom:r,right:o}){return{x:Hu(t.x,n,o),y:Hu(t.y,e,r)}}function Wu(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function V0(t,e){return{x:Wu(t.x,e.x),y:Wu(t.y,e.y)}}function B0(t,e){let n=.5;const r=We(t),o=We(e);return o>r?n=Pr(e.min,e.max-r,t.min):r>o&&(n=Pr(t.min,t.max-o,e.min)),kt(0,1,n)}function G0(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const ea=.35;function z0(t=ea){return t===!1?t=0:t===!0&&(t=ea),{x:Ku(t,"left","right"),y:Ku(t,"top","bottom")}}function Ku(t,e,n){return{min:Yu(t,e),max:Yu(t,n)}}function Yu(t,e){return typeof t=="number"?t:t[e]||0}const U0=new WeakMap;class H0{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=je(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=f=>{n&&this.snapToCursor(Vr(f).point),this.stopAnimation()},i=(f,h)=>{const{drag:m,dragPropagation:g,onDragStart:y}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vb(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tt(x=>{let w=this.getAxisMotionValue(x).get()||0;if(Dt.test(w)){const{projection:b}=this.visualElement;if(b&&b.layout){const C=b.layout.layoutBox[x];C&&(w=We(C)*(parseFloat(w)/100))}}this.originPoint[x]=w}),y&&ye.update(()=>y(f,h),!1,!0),Hi(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:y,onDrag:v}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:x}=h;if(g&&this.currentDirection===null){this.currentDirection=K0(x),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),v&&ye.update(()=>v(f,h),!1,!0)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Vh(e,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Fh(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:i}=o;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&ye.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:o}=this.getProps();if(!r||!mo(e,o,this.currentDirection))return;const s=this.getAxisMotionValue(e);let i=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(i=L0(i,this.constraints[e],this.elastic[e])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;e&&Fn(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=F0(r.layoutBox,e):this.constraints=!1,this.elastic=z0(n),o!==this.constraints&&!Fn(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Tt(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=G0(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Fn(e))return!1;const r=e.current;Vt(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=Kb(r,o.root,this.visualElement.getTransformPagePoint());let i=V0(o.layout.layoutBox,s);if(n){const a=n(Ub(i));this.hasMutatedConstraints=!!a,a&&(i=ah(a))}return i}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=Tt(d=>{if(!mo(d,n,this.currentDirection))return;let f=c&&c[d]||{};(i===!0||i===d)&&(f={min:0,max:0});const h=o?200:1e6,m=o?40:1e7,g={type:"inertia",velocity:r?e[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Hi(this.visualElement,e),r.start(Za(e,r,0,n,this.visualElement,!1))}stopAnimation(){Tt(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Tt(n=>{const{drag:r}=this.getProps();if(!mo(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n],c=s.get()||0;s.set(e[n]-xe(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Fn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Tt(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=B0({min:c,max:c},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Tt(i=>{if(!mo(i,e,null))return;const a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(xe(c,u,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;U0.set(this.visualElement,this);const e=this.visualElement.current,n=Cr(e,"pointerdown",u=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=u.target,m=h!==e&&Pb(h);d&&f&&!m&&this.start(u)});let r;const o=()=>{const{dragConstraints:u}=this.getProps();Fn(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=W0(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ye.read(o);const a=Mr(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Tt(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].translate))}),this.visualElement.render())}));return()=>{a(),n(),i(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=ea,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function Xu(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function W0(t,e,n){const r=nu(t,Xu(n)),o=nu(e,Xu(n));return()=>{r(),o()}}function mo(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function K0(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Y0 extends cn{constructor(e){super(e),this.removeGroupControls=dt,this.removeListeners=dt,this.controls=new H0(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||dt}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const si=t=>(e,n)=>{t&&ye.update(()=>t(e,n),!1,!0)};class X0 extends cn{constructor(){super(...arguments),this.removePointerDownListener=dt}onPointerDown(e){this.session=new Vh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Fh(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:si(e),onStart:si(n),onMove:si(r),onEnd:(s,i)=>{delete this.session,o&&ye.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Cr(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ii=!1;class q0 extends S.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),ii&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),$o.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,e.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),ii=!0,o||e.layoutDependency!==n||n===void 0||e.isPresent!==s?i.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?i.promote():i.relegate()||ye.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),tc.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=e;ii=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Gh(t){const[e,n]=jh(),r=S.useContext(Oa);return l.jsx(q0,{...t,layoutGroup:r,switchLayoutGroup:S.useContext($h),isPresent:e,safeToRemove:n})}const Z0={pan:{Feature:X0},drag:{Feature:Y0,ProjectionNode:Eh,MeasureLayout:Gh}};function qu(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&ye.postRender(()=>s(e,Vr(e)))}class Q0 extends cn{mount(){const{current:e}=this.node;e&&(this.unmount=bb(e,(n,r)=>(qu(this.node,r,"Start"),o=>qu(this.node,o,"End"))))}unmount(){}}class J0 extends cn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=$r(Mr(this.node.current,"focus",()=>this.onFocus()),Mr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Zu(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&ye.postRender(()=>s(e,Vr(e)))}class eC extends cn{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Tb(e,(o,s)=>(Zu(this.node,s,"Start"),(i,{success:a})=>Zu(this.node,i,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const ta=new WeakMap,ai=new WeakMap,tC=t=>{const e=ta.get(t.target);e&&e(t)},nC=t=>{t.forEach(tC)};function rC({root:t,...e}){const n=t||document;ai.has(n)||ai.set(n,{});const r=ai.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(nC,{root:t,...e})),r[o]}function oC(t,e,n){const r=rC(e);return ta.set(t,n),r.observe(t),()=>{ta.delete(t),r.unobserve(t)}}const sC={some:0,all:1};class iC extends cn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=e,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:sC[o]},a=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),m=d?f:h;m&&m(u)};this.stopObserver=oC(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(aC(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function aC({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const cC={inView:{Feature:iC},tap:{Feature:eC},focus:{Feature:J0},hover:{Feature:Q0}},lC={layout:{ProjectionNode:Eh,MeasureLayout:Gh}},uC={...k0,...cC,...Z0,...lC},zh=E0(uC,j0);function Uh(){const[t,e]=S.useState([]),n=S.useRef(0),r=S.useCallback(s=>{const a=s.currentTarget.getBoundingClientRect(),c=Math.max(a.width,a.height)*2.2,u=s.clientX-a.left-c/2,d=s.clientY-a.top-c/2,f=n.current++;e(h=>[...h,{id:f,x:u,y:d,size:c}])},[]),o=S.useCallback(s=>{e(i=>i.filter(a=>a.id!==s))},[]);return{ripples:t,add:r,remove:o}}function Hh({ripples:t,onDone:e}){return l.jsx(Ah,{children:t.map(n=>l.jsx(zh.span,{className:"btn-ripple",style:{left:n.x,top:n.y,width:n.size,height:n.size},initial:{scale:0,opacity:1},animate:{scale:1,opacity:[1,1,0]},transition:{scale:{duration:1,ease:[.4,0,.2,1]},opacity:{duration:1.2,times:[0,.6,1],ease:"easeOut"}},onAnimationComplete:()=>e(n.id)},n.id))})}const dC=()=>l.jsx("span",{className:"btn-spinner","aria-hidden":"true"}),Er=S.forwardRef(function({variant:e="solid",color:n="primary",size:r,shape:o,block:s=!1,loading:i=!1,icon:a,iconPosition:c="start",disableRipple:u=!1,asChild:d=!1,disabled:f,className:h,style:m,sx:g,children:y,onClick:v,...x},w){const{ripples:b,add:C,remove:P}=Uh(),R=f||i,M=V=>{if(R){d&&V.preventDefault();return}!u&&e!=="link"&&C(V),v==null||v(V)},{className:A,style:T,styleTag:E}=oe(g,m,"btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,s&&"block",i&&"loading",h),N=i?l.jsx(dC,{}):c==="start"?a:null,_=!i&&c==="end"?a:null,$=V=>l.jsxs(l.Fragment,{children:[E,l.jsxs("span",{className:"btn-content",children:[N,V,_]}),!u&&e!=="link"&&l.jsx(Hh,{ripples:b,onDone:P})]});if(d){const V=S.Children.only(y);return l.jsx(tv,{ref:w,className:A,style:T,onClick:M,"aria-disabled":R||void 0,"aria-busy":i||void 0,tabIndex:R?-1:void 0,...x,children:S.cloneElement(V,void 0,$(V.props.children))})}return l.jsx("button",{ref:w,className:A,style:T,onClick:M,disabled:R,"aria-busy":i||void 0,...x,children:$(y)})}),fC=S.forwardRef(function({orientation:e="horizontal",layout:n="attached",round:r=!1,className:o,children:s,...i},a){const c=z("btn-group",e==="vertical"&&"vertical",n==="spaced"&&"spaced",r&&"round",o);return l.jsx("div",{ref:a,className:c,role:"group",...i,children:s})}),hC=S.forwardRef(function({variant:e="solid",color:n="primary",size:r,position:o="static",disableRipple:s=!1,icon:i,label:a,open:c=!0,className:u,onClick:d,disabled:f,...h},m){const{ripples:g,add:y,remove:v}=Uh(),x=C=>{f||(s||y(C),d==null||d(C))},w=a!=null,b=z("btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,"fab",w&&"extended",o!=="static"&&`fixed-${o}`,u);return l.jsx(Ah,{children:c&&l.jsxs(zh.button,{ref:m,type:"button",className:b,onClick:x,disabled:f,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:380,damping:26,mass:.9},...h,children:[l.jsxs("span",{className:"btn-content",children:[i,w&&a]}),!s&&l.jsx(Hh,{ripples:g,onDone:v})]})})}),pC=S.forwardRef(function({icon:e,shape:n="circle",variant:r="ghost",...o},s){return l.jsx(Er,{ref:s,shape:n,variant:r,icon:e,...o})});var mC=Object.defineProperty,ir=(t,e)=>mC(t,"name",{value:e,configurable:!0}),Wh=!!(typeof window<"u"&&window.document&&window.document.createElement);function U(t,e,{checkForDefaultPrevented:n=!0}={}){return ir(function(o){if(t==null||t(o),n===!1||!o||!o.defaultPrevented)return e==null?void 0:e(o)},"handleEvent")}ir(U,"composeEventHandlers");function gC(t){var e;if(!Wh)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}ir(gC,"getOwnerWindow");function na(t){if(!Wh)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}ir(na,"getOwnerDocument");function Kh(t,e=!1){const{activeElement:n}=na(t);if(!(n!=null&&n.nodeName))return null;if(Yh(n)&&n.contentDocument)return Kh(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const o=na(n).getElementById(r);if(o)return o}}return n}ir(Kh,"getActiveElement");function Yh(t){return t.tagName==="IFRAME"}ir(Yh,"isFrame");var Ee=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},yC=Object.defineProperty,vC=(t,e)=>yC(t,"name",{value:e,configurable:!0}),Qu=p[" useEffectEvent ".trim().toString()],Ju=p[" useInsertionEffect ".trim().toString()];function Xh(t){if(typeof Qu=="function")return Qu(t);const e=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Ju=="function"?Ju(()=>{e.current=t}):Ee(()=>{e.current=t}),p.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}vC(Xh,"useEffectEvent");var xC=Object.defineProperty,Br=(t,e)=>xC(t,"name",{value:e,configurable:!0}),bC=p[" useInsertionEffect ".trim().toString()]||Ee;function Se({prop:t,defaultProp:e,onChange:n=Br(()=>{},"onChange"),caller:r}){const[o,s,i]=qh({defaultProp:e,onChange:n}),a=t!==void 0,c=a?t:o,u=p.useCallback(d=>{var f;if(a){const h=Zh(d)?d(t):d;h!==t&&((f=i.current)==null||f.call(i,h))}else s(d)},[a,t,s,i]);return[c,u]}Br(Se,"useControllableState");function qh({defaultProp:t,onChange:e}){const[n,r]=p.useState(t),o=p.useRef(n),s=p.useRef(e);return bC(()=>{s.current=e},[e]),p.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}Br(qh,"useUncontrolledState");function Zh(t){return typeof t=="function"}Br(Zh,"isFunction");var ed=Symbol("RADIX:SYNC_STATE");function wC(t,e,n,r){const{prop:o,defaultProp:s,onChange:i,caller:a}=e,c=o!==void 0,u=Xh(i),d=[{...n,state:s}];r&&d.push(r);const[f,h]=p.useReducer((v,x)=>{if(x.type===ed)return{...v,state:x.state};const w=t(v,x);return c&&!Object.is(w.state,v.state)&&u(w.state),w},...d),m=f.state,g=p.useRef(m);p.useEffect(()=>{g.current!==m&&(g.current=m,c||u(m))},[m,g,c]);const y=p.useMemo(()=>o!==void 0?{...f,state:o}:f,[f,o]);return p.useEffect(()=>{c&&!Object.is(o,f.state)&&h({type:ed,state:o})},[o,f.state,c]),[y,h]}Br(wC,"useControllableStateReducer");var CC=Object.defineProperty,SC=(t,e)=>CC(t,"name",{value:e,configurable:!0}),PC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ne=PC.reduce((t,e)=>{const n=yt(`Primitive.${e}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function dc(t,e){t&&Or.flushSync(()=>t.dispatchEvent(e))}SC(dc,"dispatchDiscreteCustomEvent");var RC=Object.defineProperty,TC=(t,e)=>RC(t,"name",{value:e,configurable:!0}),MC="Toggle",Qh=p.forwardRef(TC(function(e,n){const{pressed:r,defaultPressed:o,onPressedChange:s,...i}=e,[a,c]=Se({prop:r,onChange:s,defaultProp:o??!1,caller:MC});return l.jsx(ne.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:n,onClick:U(e.onClick,()=>{e.disabled||c(!a)})})},"Toggle")),EC=Qh;const jC=S.forwardRef(function({variant:e="ghost",color:n="primary",size:r,shape:o,icon:s,className:i,children:a,...c},u){const d=z("btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,i);return l.jsx(EC,{ref:u,className:d,...c,children:l.jsxs("span",{className:"btn-content",children:[s,a]})})});var AC=Object.defineProperty,lt=(t,e)=>AC(t,"name",{value:e,configurable:!0});function DC(t,e){const n=p.createContext(e);n.displayName=t+"Context";const r=lt(s=>{const{children:i,...a}=s,c=p.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})},"Provider");r.displayName=t+"Provider";function o(s,i={}){const{optional:a=!1}=i,c=p.useContext(n);if(c)return c;if(e!==void 0)return e;if(!a)throw new Error(`\`${s}\` must be used within \`${t}\``)}return lt(o,"useContext"),[r,o]}lt(DC,"createContext");function Pe(t,e=[]){let n=[];function r(s,i){const a=p.createContext(i);a.displayName=s+"Context";const c=n.length;n=[...n,i];const u=lt(f=>{var x;const{scope:h,children:m,...g}=f,y=((x=h==null?void 0:h[t])==null?void 0:x[c])||a,v=p.useMemo(()=>g,Object.values(g));return l.jsx(y.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var x;const{optional:g=!1}=m,y=((x=h==null?void 0:h[t])==null?void 0:x[c])||a,v=p.useContext(y);if(v)return v;if(i!==void 0)return i;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return lt(d,"useContext"),[u,d]}lt(r,"createContext");const o=lt(()=>{const s=n.map(i=>p.createContext(i));return lt(function(a){const c=(a==null?void 0:a[t])||s;return p.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])},"useScope")},"createScope");return o.scopeName=t,[r,Jh(o,...e)]}lt(Pe,"createContextScope");function Jh(...t){const e=t[0];if(t.length===1)return e;const n=lt(()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return lt(function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...a,...f}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}lt(Jh,"composeContextScopes");var IC=Object.defineProperty,Ne=(t,e)=>IC(t,"name",{value:e,configurable:!0});function ar(t){const e=t+"CollectionProvider",[n,r]=Pe(e),[o,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),i=Ne(y=>{const{scope:v,children:x}=y,w=p.useRef(null),b=p.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:b,collectionRef:w,children:x})},"CollectionProvider");i.displayName=e;const a=t+"CollectionSlot",c=yt(a),u=p.forwardRef((y,v)=>{const{scope:x,children:w}=y,b=s(a,x),C=ae(v,b.collectionRef);return l.jsx(c,{ref:C,children:w})});u.displayName=a;const d=t+"CollectionItemSlot",f="data-radix-collection-item",h=yt(d),m=p.forwardRef((y,v)=>{const{scope:x,children:w,...b}=y,C=p.useRef(null),P=ae(v,C),R=s(d,x);return p.useEffect(()=>(R.itemMap.set(C,{ref:C,...b}),()=>void R.itemMap.delete(C))),l.jsx(h,{[f]:"",ref:P,children:w})});m.displayName=d;function g(y){const v=s(t+"CollectionConsumer",y);return p.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const b=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((R,M)=>b.indexOf(R.ref.current)-b.indexOf(M.ref.current))},[v.collectionRef,v.itemMap])}return Ne(g,"useCollection"),[{Provider:i,Slot:u,ItemSlot:m},g,r]}Ne(ar,"createCollection");var td=new WeakMap,Te,ot,ci=(ot=class extends Map{constructor(n){super(n);Il(this,Te);Us(this,Te,[...super.keys()]),td.set(this,!0)}set(n,r){return td.get(this)&&(this.has(n)?Be(this,Te)[Be(this,Te).indexOf(n)]=n:Be(this,Te).push(n)),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=Be(this,Te).length,a=fc(n);let c=a>=0?a:i+a;const u=c<0||c>=i?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(r,o),this;const d=this.size+(s?0:1);a<0&&c++;const f=[...Be(this,Te)];let h,m=!1;for(let g=c;g<d;g++)if(c===g){let y=f[g];f[g]===r&&(y=f[g+1]),s&&this.delete(r),h=this.get(y),this.set(r,o)}else{!m&&f[g-1]===r&&(m=!0);const y=f[m?g:g-1],v=h;h=this.get(y),this.delete(y),this.set(y,v)}return this}with(n,r,o){const s=new ot(this);return s.insert(n,r,o),s}before(n){const r=Be(this,Te).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=Be(this,Te).indexOf(n);return s===-1?this:this.insert(s,r,o)}after(n){let r=Be(this,Te).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=Be(this,Te).indexOf(n);return s===-1?this:this.insert(s+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Us(this,Te,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Be(this,Te).splice(Be(this,Te).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Lo(Be(this,Te),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Lo(Be(this,Te),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Be(this,Te).indexOf(n)}keyAt(n){return Lo(Be(this,Te),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new ot(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new ot(o)}reduce(...n){const[r,o]=n;let s=0,i=o??this.at(0);for(const a of this)s===0&&n.length===1?i=a:i=Reflect.apply(r,this,[i,a,s,this]),s++;return i}reduceRight(...n){const[r,o]=n;let s=o??this.at(-1);for(let i=this.size-1;i>=0;i--){const a=this.at(i);i===this.size-1&&n.length===1?s=a:s=Reflect.apply(r,this,[s,a,i,this])}return s}toSorted(n){const r=[...this.entries()].sort(n);return new ot(r)}toReversed(){const n=new ot;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new ot(r)}slice(n,r){const o=new ot;let s=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),r!==void 0&&r>0&&(s=r-1);for(let i=n;i<=s;i++){const a=this.keyAt(i),c=this.get(a);o.set(a,c)}return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},Te=new WeakMap,Ne(ot,"OrderedDict"),ot);function Lo(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=ep(t,e);return n===-1?void 0:t[n]}Ne(Lo,"at");function ep(t,e){const n=t.length,r=fc(e),o=r>=0?r:n+r;return o<0||o>=n?-1:o}Ne(ep,"toSafeIndex");function fc(t){return t!==t||t===0?0:Math.trunc(t)}Ne(fc,"toSafeInteger");function kC(t){const e=t+"CollectionProvider",[n,r]=Pe(e),[o,s]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new ci,setItemMap:Ne(()=>{},"setItemMap")}),i=Ne(({state:b,...C})=>b?l.jsx(c,{...C,state:b}):l.jsx(a,{...C}),"CollectionProvider");i.displayName=e;const a=Ne(b=>{const C=v();return l.jsx(c,{...b,state:C})},"CollectionInit");a.displayName=e+"Init";const c=Ne(b=>{const{scope:C,children:P,state:R}=b,M=p.useRef(null),[A,T]=p.useState(null),E=ae(M,T),[N,_]=R;return p.useEffect(()=>{if(!A)return;const $=rp(()=>{});return $.observe(A,{childList:!0,subtree:!0}),()=>{$.disconnect()}},[A]),l.jsx(o,{scope:C,itemMap:N,setItemMap:_,collectionRef:E,collectionRefObject:M,collectionElement:A,children:P})},"CollectionProviderImpl");c.displayName=e+"Impl";const u=t+"CollectionSlot",d=yt(u),f=p.forwardRef((b,C)=>{const{scope:P,children:R}=b,M=s(u,P),A=ae(C,M.collectionRef);return l.jsx(d,{ref:A,children:R})});f.displayName=u;const h=t+"CollectionItemSlot",m="data-radix-collection-item",g=yt(h),y=p.forwardRef((b,C)=>{const{scope:P,children:R,...M}=b,A=p.useRef(null),[T,E]=p.useState(null),N=ae(C,A,E),_=s(h,P),{setItemMap:$}=_,V=p.useRef(M);tp(V.current,M)||(V.current=M);const q=V.current;return p.useEffect(()=>{const W=q;return $(I=>T?I.has(T)?I.set(T,{...W,element:T}).toSorted(ra):(I.set(T,{...W,element:T}),I.toSorted(ra)):I),()=>{$(I=>!T||!I.has(T)?I:(I.delete(T),new ci(I)))}},[T,q,$]),l.jsx(g,{[m]:"",ref:N,children:R})});y.displayName=h;function v(){return p.useState(new ci)}Ne(v,"useInitCollection");function x(b){const{itemMap:C}=s(t+"CollectionConsumer",b);return C}return Ne(x,"useCollection"),[{Provider:i,Slot:f,ItemSlot:y},{createCollectionScope:r,useCollection:x,useInitCollection:v}]}Ne(kC,"createCollection");function tp(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||t[o]!==e[o])return!1;return!0}Ne(tp,"shallowEqual");function np(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Ne(np,"isElementPreceding");function ra(t,e){return!t[1].element||!e[1].element?0:np(t[1].element,e[1].element)?-1:1}Ne(ra,"sortByDocumentPosition");function rp(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Ne(rp,"getChildListObserver");var NC=Object.defineProperty,_C=(t,e)=>NC(t,"name",{value:e,configurable:!0}),OC=p[" useId ".trim().toString()]||(()=>{}),$C=0;function Fe(t){const[e,n]=p.useState(OC());return Ee(()=>{t||n(r=>r??String($C++))},[t]),t||(e?`radix-${e}`:"")}_C(Fe,"useId");var LC=Object.defineProperty,FC=(t,e)=>LC(t,"name",{value:e,configurable:!0});function Ze(t){const e=p.useRef(t);return p.useEffect(()=>{e.current=t}),p.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}FC(Ze,"useCallbackRef");var VC=Object.defineProperty,BC=(t,e)=>VC(t,"name",{value:e,configurable:!0}),GC=p.createContext(void 0);function Ht(t){const e=p.useContext(GC);return t||e||"ltr"}BC(Ht,"useDirection");var zC=Object.defineProperty,hc=(t,e)=>zC(t,"name",{value:e,configurable:!0}),li=!1;function op(){const[t,e]=p.useState(li);return p.useEffect(()=>{li||(li=!0,e(!0))},[]),t}hc(op,"useIsHydrated");var sp=p[" useSyncExternalStore ".trim().toString()];function ip(){return()=>{}}hc(ip,"subscribe");function ap(){return sp(ip,()=>!0,()=>!1)}hc(ap,"useIsHydratedModern");var UC=typeof sp=="function"?ap:op,HC=Object.defineProperty,jn=(t,e)=>HC(t,"name",{value:e,configurable:!0}),ui="rovingFocusGroup.onEntryFocus",WC={bubbles:!1,cancelable:!0},ls="RovingFocusGroup",[oa,cp,KC]=ar(ls),[YC,ln]=Pe(ls,[KC]),[XC,qC]=YC(ls),ZC=p.forwardRef(jn(function(e,n){return l.jsx(oa.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(oa.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(QC,{...e,ref:n})})})},"RovingFocusGroup")),QC=p.forwardRef(jn(function(e,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=e,m=p.useRef(null),g=ae(n,m),y=Ht(i),[v,x]=Se({prop:a,defaultProp:c??null,onChange:u,caller:ls}),[w,b]=p.useState(!1),C=Ze(d),P=cp(r),R=p.useRef(!1),[M,A]=p.useState(0);return p.useEffect(()=>{const T=m.current;if(T)return T.addEventListener(ui,C),()=>T.removeEventListener(ui,C)},[C]),l.jsx(XC,{scope:r,orientation:o,dir:y,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(T=>x(T),[x]),onItemShiftTab:p.useCallback(()=>b(!0),[]),onFocusableItemAdd:p.useCallback(()=>A(T=>T+1),[]),onFocusableItemRemove:p.useCallback(()=>A(T=>T-1),[]),children:l.jsx(ne.div,{tabIndex:w||M===0?-1:0,"data-orientation":o,...h,ref:g,style:{outline:"none",...e.style},onMouseDown:U(e.onMouseDown,()=>{R.current=!0}),onFocus:U(e.onFocus,T=>{const E=!R.current;if(T.target===T.currentTarget&&E&&!w){const N=new CustomEvent(ui,WC);if(T.currentTarget.dispatchEvent(N),!N.defaultPrevented){const _=P().filter(I=>I.focusable),$=_.find(I=>I.active),V=_.find(I=>I.id===v),W=[$,V,..._].filter(Boolean).map(I=>I.ref.current);pc(W,f)}}R.current=!1}),onBlur:U(e.onBlur,()=>b(!1))})})},"RovingFocusGroupImpl")),JC="RovingFocusGroupItem",eS=p.forwardRef(jn(function(e,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...c}=e,u=Fe(),d=i||u,f=qC(JC,r),h=f.currentTabStopId===d,m=cp(r),{onFocusableItemAdd:g,onFocusableItemRemove:y,currentTabStopId:v}=f,x=UC();return Ee(()=>{if(!(!x||!o))return g(),()=>y()},[x,o,g,y]),p.useEffect(()=>{if(!(x||!o))return g(),()=>y()},[x,o,g,y]),l.jsx(oa.ItemSlot,{scope:r,id:d,focusable:o,active:s,children:l.jsx(ne.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:U(e.onMouseDown,w=>{o?f.onItemFocus(d):w.preventDefault()}),onFocus:U(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:U(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const b=up(w,f.orientation,f.dir);if(b!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let P=m().filter(R=>R.focusable).map(R=>R.ref.current);if(b==="last")P.reverse();else if(b==="prev"||b==="next"){b==="prev"&&P.reverse();const R=P.indexOf(w.currentTarget);P=f.loop?dp(P,R+1):P.slice(R+1)}setTimeout(()=>pc(P))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:v!=null}):a})})},"RovingFocusGroupItem")),tS={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lp(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}jn(lp,"getDirectionAwareKey");function up(t,e,n){const r=lp(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return tS[r]}jn(up,"getFocusIntent");function pc(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}jn(pc,"focusFirst");function dp(t,e){return t.map((n,r)=>t[(e+r)%t.length])}jn(dp,"wrapArray");var us=ZC,ds=eS,nS=Object.defineProperty,tn=(t,e)=>nS(t,"name",{value:e,configurable:!0}),cr="ToggleGroup",[fp,fN]=Pe(cr,[ln]),hp=ln(),rS=p.forwardRef(tn(function(e,n){const{type:r,...o}=e;if(r==="single"){const s=o;return l.jsx(oS,{role:"radiogroup",...s,ref:n})}if(r==="multiple"){const s=o;return l.jsx(sS,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${cr}\``)},"ToggleGroup")),[pp,mp]=fp(cr),oS=p.forwardRef(tn(function(e,n){const{value:r,defaultValue:o,onValueChange:s=tn(()=>{},"onValueChange"),...i}=e,[a,c]=Se({prop:r,defaultProp:o??"",onChange:s,caller:cr});return l.jsx(pp,{scope:e.__scopeToggleGroup,type:"single",value:p.useMemo(()=>a?[a]:[],[a]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:l.jsx(gp,{...i,ref:n})})},"ToggleGroupImplSingle")),sS=p.forwardRef(tn(function(e,n){const{value:r,defaultValue:o,onValueChange:s=tn(()=>{},"onValueChange"),...i}=e,[a,c]=Se({prop:r,defaultProp:o??[],onChange:s,caller:cr}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return l.jsx(pp,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:u,onItemDeactivate:d,children:l.jsx(gp,{...i,ref:n})})},"ToggleGroupImplMultiple")),[iS,aS]=fp(cr),gp=p.forwardRef(tn(function(e,n){const{__scopeToggleGroup:r,disabled:o=!1,rovingFocus:s=!0,orientation:i,dir:a,loop:c=!0,...u}=e,d=hp(r),f=Ht(a),h={dir:f,...u};return l.jsx(iS,{scope:r,rovingFocus:s,disabled:o,children:s?l.jsx(us,{asChild:!0,...d,orientation:i,dir:f,loop:c,children:l.jsx(ne.div,{...h,ref:n})}):l.jsx(ne.div,{...h,ref:n})})},"ToggleGroupImpl")),sa="ToggleGroupItem",cS=p.forwardRef(tn(function(e,n){const r=mp(sa,e.__scopeToggleGroup),o=aS(sa,e.__scopeToggleGroup),s=hp(e.__scopeToggleGroup),i=r.value.includes(e.value),a=o.disabled||e.disabled,c={...e,pressed:i,disabled:a},u=p.useRef(null);return o.rovingFocus?l.jsx(ds,{asChild:!0,...s,focusable:!a,active:i,ref:u,children:l.jsx(nd,{...c,ref:n})}):l.jsx(nd,{...c,ref:n})},"ToggleGroupItem")),nd=p.forwardRef(tn(function(e,n){const{__scopeToggleGroup:r,value:o,...s}=e,i=mp(sa,r),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},c=i.type==="single"?a:void 0;return l.jsx(Qh,{...c,...s,ref:n,onPressedChange:u=>{u?i.onItemActivate(o):i.onItemDeactivate(o)}})},"ToggleGroupItemImpl"));const yp=S.createContext({variant:"outline",color:"primary"}),lS=S.forwardRef(function({variant:e="outline",color:n="primary",size:r,layout:o="attached",round:s=!1,className:i,children:a,...c},u){const d=z("btn-group",o==="spaced"&&"spaced",s&&"round",i);return l.jsx(yp.Provider,{value:{variant:e,color:n,size:r},children:l.jsx(rS,{ref:u,className:d,...c,children:a})})}),uS=S.forwardRef(function({icon:e,shape:n,className:r,children:o,...s},i){const{variant:a,color:c,size:u}=S.useContext(yp),d=z("btn",a,c!=="primary"&&c,u==="sm"||u==="lg"?u:null,n&&n!=="default"&&n,r);return l.jsx(cS,{ref:i,className:d,...s,children:l.jsxs("span",{className:"btn-content",children:[e,o]})})});/**
9
+ `),()=>{var P;(P=c.current)==null||P.removeAttribute("data-motion-pop-id"),R.contains(M)&&R.removeChild(M)}},[e]),a.jsx(dS,{isPresent:e,childRef:c,sizeRef:l,pop:s,children:s===!1?t:m.cloneElement(t,{ref:f})})}const hS=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:c,anchorY:l,root:u})=>{const d=Nl(pS),f=v.useId();let h=!0,p=v.useMemo(()=>(h=!1,{id:f,initial:e,isPresent:n,custom:o,onExitComplete:g=>{d.set(g,!0);for(const b of d.values())if(!b)return;r&&r()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,r]);return s&&h&&(p={...p}),v.useMemo(()=>{d.forEach((g,b)=>d.set(b,!1))},[n]),m.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),t=a.jsx(fS,{pop:i==="popLayout",isPresent:n,anchorX:c,anchorY:l,root:u,children:t}),a.jsx(Ui.Provider,{value:p,children:t})};function pS(){return new Map}function $m(t=!0){const e=v.useContext(Ui);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=e,s=v.useId();v.useEffect(()=>{if(t)return o(s)},[t]);const i=v.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,i]:[!0]}const Hs=t=>t.key||"";function jf(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const _m=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:c="left",anchorY:l="top",root:u})=>{const[d,f]=$m(i),h=v.useMemo(()=>jf(t),[t]),p=i&&!d?[]:h.map(Hs),g=v.useRef(!0),b=v.useRef(h),x=Nl(()=>new Map),y=v.useRef(new Set),[w,C]=v.useState(h),[S,M]=v.useState(h);cp(()=>{g.current=!1,b.current=h;for(let T=0;T<S.length;T++){const j=Hs(S[T]);p.includes(j)?(x.delete(j),y.current.delete(j)):x.get(j)!==!0&&x.set(j,!1)}},[S,p.length,p.join("-")]);const R=[];if(h!==w){let T=[...h];for(let j=0;j<S.length;j++){const A=S[j],_=Hs(A);p.includes(_)||(T.splice(j,0,A),R.push(A))}return s==="wait"&&R.length&&(T=R),M(jf(T)),C(h),null}process.env.NODE_ENV!=="production"&&s==="wait"&&S.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:P}=v.useContext(Pl);return a.jsx(a.Fragment,{children:S.map(T=>{const j=Hs(T),A=i&&!d?!1:h===S||p.includes(j),_=()=>{if(y.current.has(j))return;if(x.has(j))y.current.add(j),x.set(j,!0);else return;let L=!0;x.forEach(I=>{I||(L=!1)}),L&&(P==null||P(),M(b.current),i&&(f==null||f()),r&&r())};return a.jsx(hS,{isPresent:A,initial:!g.current||n?void 0:!1,custom:e,presenceAffectsLayout:o,mode:s,root:u,onExitComplete:A?void 0:_,anchorX:c,anchorY:l,children:T},j)})})},Om=v.createContext({strict:!1}),Pf={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Nf=!1;function mS(){if(Nf)return;const t={};for(const e in Pf)t[e]={isEnabled:n=>Pf[e].some(r=>!!n[r])};dm(t),Nf=!0}function Lm(){return mS(),Qw()}function gS(t){const e=Lm();for(const n in t)e[n]={...e[n],...t[n]};dm(e)}const yS=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Ai(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||yS.has(t)}let Fm=t=>!Ai(t);function vS(t){typeof t=="function"&&(Fm=e=>e.startsWith("on")?!Ai(e):t(e))}try{vS(require("@emotion/is-prop-valid").default)}catch{}function xS(t,e,n){const r={};for(const o in t)o==="values"&&typeof t.values=="object"||Nt(t[o])||(Fm(o)||n===!0&&Ai(o)||!e&&!Ai(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}const Wi=v.createContext({});function bS(t,e){if(zi(t)){const{initial:n,animate:r}=t;return{initial:n===!1||ns(n)?n:void 0,animate:ns(r)?r:void 0}}return t.inherit!==!1?e:{}}function wS(t){const{initial:e,animate:n}=bS(t,v.useContext(Wi));return v.useMemo(()=>({initial:e,animate:n}),[Ef(e),Ef(n)])}function Ef(t){return Array.isArray(t)?t.join(" "):t}const tu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Vm(t,e,n){for(const r in e)!Nt(e[r])&&!vm(r,n)&&(t[r]=e[r])}function CS({transformTemplate:t},e){return v.useMemo(()=>{const n=tu();return Jl(n,e,t),Object.assign({},n.vars,n.style)},[e])}function SS(t,e){const n=t.style||{},r={};return Vm(r,n,t),Object.assign(r,CS(t,e)),r}function MS(t,e){const n={},r=SS(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const Bm=()=>({...tu(),attrs:{}});function RS(t,e,n,r){const o=v.useMemo(()=>{const s=Bm();return xm(s,e,wm(r),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};Vm(s,t.style,t),o.style={...s,...o.style}}return o}const TS=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function nu(t){return typeof t!="string"||t.includes("-")?!1:!!(TS.indexOf(t)>-1||/[A-Z]/u.test(t))}function jS(t,e,n,{latestValues:r},o,s=!1,i){const l=(i??nu(t)?RS:MS)(e,r,o,t),u=xS(e,typeof t=="string",s),d=t!==v.Fragment?{...u,...l,ref:n}:{},{children:f}=e,h=v.useMemo(()=>Nt(f)?f.get():f,[f]);return v.createElement(t,{...d,children:h})}function PS({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,o){return{latestValues:NS(n,r,o,t),renderState:e()}}function NS(t,e,n,r){const o={},s=r(t,{});for(const h in s)o[h]=gi(s[h]);let{initial:i,animate:c}=t;const l=zi(t),u=lm(t);e&&u&&!l&&t.inherit!==!1&&(i===void 0&&(i=e.initial),c===void 0&&(c=e.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const f=d?c:i;if(f&&typeof f!="boolean"&&!Gi(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const g=Gl(t,h[p]);if(g){const{transitionEnd:b,transition:x,...y}=g;for(const w in y){let C=y[w];if(Array.isArray(C)){const S=d?C.length-1:0;C=C[S]}C!==null&&(o[w]=C)}for(const w in b)o[w]=b[w]}}}return o}const Um=t=>(e,n)=>{const r=v.useContext(Wi),o=v.useContext(Ui),s=()=>PS(t,e,r,o);return n?s():Nl(s)},ES=Um({scrapeMotionValuesFromProps:Ql,createRenderState:tu}),kS=Um({scrapeMotionValuesFromProps:Cm,createRenderState:Bm}),AS=Symbol.for("motionComponentSymbol");function IS(t,e,n){const r=v.useRef(n);v.useInsertionEffect(()=>{r.current=n});const o=v.useRef(null);return v.useCallback(s=>{var c;s&&((c=t.onMount)==null||c.call(t,s));const i=r.current;if(typeof i=="function")if(s){const l=i(s);typeof l=="function"&&(o.current=l)}else o.current?(o.current(),o.current=null):i(s);else i&&(i.current=s);e&&(s?e.mount(s):e.unmount())},[e])}const Hm=v.createContext({});function io(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function DS(t,e,n,r,o,s){var C,S;const{visualElement:i}=v.useContext(Wi),c=v.useContext(Om),l=v.useContext(Ui),u=v.useContext(eu),d=u.reducedMotion,f=u.skipAnimations,h=v.useRef(null),p=v.useRef(!1);r=r||c.renderer,!h.current&&r&&(h.current=r(t,{visualState:e,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:s}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const g=h.current,b=v.useContext(Hm);g&&!g.projection&&o&&(g.type==="html"||g.type==="svg")&&$S(h.current,n,o,b);const x=v.useRef(!1);v.useInsertionEffect(()=>{g&&x.current&&g.update(n,l)});const y=n[qp],w=v.useRef(!!y&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,y))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,y)));return cp(()=>{p.current=!0,g&&(x.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),w.current&&g.animationState&&g.animationState.animateChanges())}),v.useEffect(()=>{g&&(!w.current&&g.animationState&&g.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var M;(M=window.MotionHandoffMarkAsComplete)==null||M.call(window,y)}),w.current=!1),g.enteringChildren=void 0)}),g}function $S(t,e,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:c,layoutScroll:l,layoutRoot:u,layoutAnchor:d,layoutCrossfade:f}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Gm(t.parent)),t.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||c&&io(c),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:l,layoutRoot:u,layoutAnchor:d})}function Gm(t){if(t)return t.options.allowProjection!==!1?t.projection:Gm(t.parent)}function Va(t,{forwardMotionProps:e=!1,type:n}={},r,o){r&&gS(r);const s=n?n==="svg":nu(t),i=s?kS:ES;function c(u,d){let f;const h={...v.useContext(eu),...u,layoutId:_S(u)},{isStatic:p}=h,g=wS(u),b=i(u,p);if(!p&&typeof window<"u"){OS(h,r);const x=LS(h);f=x.MeasureLayout,g.visualElement=DS(t,b,h,o,x.ProjectionNode,s)}return a.jsxs(Wi.Provider,{value:g,children:[f&&g.visualElement?a.jsx(f,{visualElement:g.visualElement,...h}):null,jS(t,u,IS(b,g.visualElement,d),b,p,e,s)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=v.forwardRef(c);return l[AS]=t,l}function _S({layoutId:t}){const e=v.useContext(Pl).id;return e&&t!==void 0?e+"-"+t:t}function OS(t,e){const n=v.useContext(Om).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Mo(!1,r,"lazy-strict-mode"):Qn(!1,r,"lazy-strict-mode")}}function LS(t){const e=Lm(),{drag:n,layout:r}=e;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function FS(t,e){if(typeof Proxy>"u")return Va;const n=new Map,r=(s,i)=>Va(s,i,t,e),o=(s,i)=>(process.env.NODE_ENV!=="production"&&Al(!1,"motion() is deprecated. Use motion.create() instead."),r(s,i));return new Proxy(o,{get:(s,i)=>i==="create"?r:(n.has(i)||n.set(i,Va(i,void 0,t,e)),n.get(i))})}const VS=(t,e)=>e.isSVG??nu(t)?new gC(e):new uC(e,{allowProjection:t!==v.Fragment});class BS extends Cr{constructor(e){super(e),e.animationState||(e.animationState=wC(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Gi(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let US=0;class HS extends Cr{constructor(){super(...arguments),this.id=US++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:i,custom:c}=this.node.getProps();if(typeof i=="string"){const l=Br(this.node,i,c);if(l){const{transition:u,transitionEnd:d,...f}=l;for(const h in f)(s=this.node.getValue(h))==null||s.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!e);n&&!e&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const GS={animation:{Feature:BS},exit:{Feature:HS}};function vs(t){return{point:{x:t.pageX,y:t.pageY}}}const zS=t=>e=>Yl(e)&&t(e,vs(e));function Zo(t,e,n,r){return rs(t,e,zS(n),r)}const zm=({current:t})=>t?t.ownerDocument.defaultView:null,kf=(t,e)=>Math.abs(t-e);function WS(t,e){const n=kf(t.x,e.x),r=kf(t.y,e.y);return Math.sqrt(n**2+r**2)}const Af=new Set(["auto","scroll"]);class Wm{constructor(e,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:i=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Gs(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Ba(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,b=WS(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!b)return;const{point:x}=p,{timestamp:y}=Pt;this.history.push({...x,timestamp:y});const{onStart:w,onMove:C}=this.handlers;g||(w&&w(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,p)},this.handlePointerMove=(p,g)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=Gs(g,this.transformPagePoint),tt.update(this.updatePoint,!0)},this.handlePointerUp=(p,g)=>{this.end();const{onEnd:b,onSessionEnd:x,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Ba(p.type==="pointercancel"?this.lastMoveEventInfo:Gs(g,this.transformPagePoint),this.history);this.startEvent&&b&&b(p,w),x&&x(p,w)},!Yl(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const l=vs(e),u=Gs(l,this.transformPagePoint),{point:d}=u,{timestamp:f}=Pt;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(e,Ba(u,this.history)),this.removeListeners=ms(Zo(this.contextWindow,"pointermove",this.handlePointerMove),Zo(this.contextWindow,"pointerup",this.handlePointerUp),Zo(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(Af.has(r.overflowX)||Af.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,o),tt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),mr(this.updatePoint)}}function Gs(t,e){return e?{point:e(t.point)}:t}function If(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ba({point:t},e){return{point:t,delta:If(t,Km(e)),offset:If(t,KS(e)),velocity:YS(e,.1)}}function KS(t){return t[0]}function Km(t){return t[t.length-1]}function YS(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const o=Km(t);for(;n>=0&&(r=t[n],!(o.timestamp-r.timestamp>Gt(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&o.timestamp-r.timestamp>Gt(e)*2&&(r=t[1]);const s=an(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function XS(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?rt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?rt(n,t,r.max):Math.min(t,n)),t}function Df(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function qS(t,{top:e,left:n,bottom:r,right:o}){return{x:Df(t.x,n,o),y:Df(t.y,e,r)}}function $f(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function ZS(t,e){return{x:$f(t.x,e.x),y:$f(t.y,e.y)}}function JS(t,e){let n=.5;const r=Ft(t),o=Ft(e);return o>r?n=es(e.min,e.max-r,t.min):r>o&&(n=es(t.min,t.max-o,e.min)),Fn(0,1,n)}function QS(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Wc=.35;function e1(t=Wc){return t===!1?t=0:t===!0&&(t=Wc),{x:_f(t,"left","right"),y:_f(t,"top","bottom")}}function _f(t,e,n){return{min:Of(t,e),max:Of(t,n)}}function Of(t,e){return typeof t=="number"?t:t[e]||0}const t1=new WeakMap;class n1{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=yt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=f=>{n&&this.snapToCursor(vs(f).point),this.stopAnimation()},i=(f,h)=>{const{drag:p,dragPropagation:g,onDragStart:b}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Nw(p),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),En(y=>{let w=this.getAxisMotionValue(y).get()||0;if($n.test(w)){const{projection:C}=this.visualElement;if(C&&C.layout){const S=C.layout.layoutBox[y];S&&(w=Ft(S)*(parseFloat(w)/100))}}this.originPoint[y]=w}),b&&tt.update(()=>b(f,h),!1,!0),Oc(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:b,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=h;if(g&&this.currentDirection===null){this.currentDirection=o1(y),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),x&&tt.update(()=>x(f,h),!1,!0)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Wm(e,{onSessionStart:s,onStart:i,onMove:c,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:zm(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:i}=o;this.startAnimation(i);const{onDragEnd:c}=this.getProps();c&&tt.postRender(()=>c(r,o))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:o}=this.getProps();if(!r||!zs(e,o,this.currentDirection))return;const s=this.getAxisMotionValue(e);let i=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(i=XS(i,this.constraints[e],this.elastic[e])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;e&&io(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=qS(r.layoutBox,e):this.constraints=!1,this.elastic=e1(n),o!==this.constraints&&!io(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&En(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=QS(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!io(e))return!1;const r=e.current;Qn(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=oC(r,o.root,this.visualElement.getTransformPagePoint());let i=ZS(o.layout.layoutBox,s);if(n){const c=n(tC(i));this.hasMutatedConstraints=!!c,c&&(i=hm(c))}return i}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:c}=this.getProps(),l=this.constraints||{},u=En(d=>{if(!zs(d,n,this.currentDirection))return;let f=l&&l[d]||{};(i===!0||i===d)&&(f={min:0,max:0});const h=o?200:1e6,p=o?40:1e7,g={type:"inertia",velocity:r?e[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(c)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Oc(this.visualElement,e),r.start(Hl(e,r,0,n,this.visualElement,!1))}stopAnimation(){En(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){En(n=>{const{drag:r}=this.getProps();if(!zs(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:c}=o.layout.layoutBox[n],l=s.get()||0;s.set(e[n]-rt(i,c,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!io(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};En(i=>{const c=this.getAxisMotionValue(i);if(c&&this.constraints!==!1){const l=c.get();o[i]=JS({min:l,max:l},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),En(i=>{if(!zs(i,e,null))return;const c=this.getAxisMotionValue(i),{min:l,max:u}=this.constraints[i];c.set(rt(l,u,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;t1.set(this.visualElement,this);const e=this.visualElement.current,n=Zo(e,"pointerdown",u=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=u.target,p=h!==e&&$w(h);d&&f&&!p&&this.start(u)});let r;const o=()=>{const{dragConstraints:u}=this.getProps();io(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=r1(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),tt.read(o);const c=rs(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(En(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].translate))}),this.visualElement.render())}));return()=>{c(),n(),i(),l&&l(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Wc,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:c}}}function Lf(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function r1(t,e,n){const r=Gd(t,Lf(n)),o=Gd(e,Lf(n));return()=>{r(),o()}}function zs(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function o1(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class s1 extends Cr{constructor(e){super(e),this.removeGroupControls=cn,this.removeListeners=cn,this.controls=new n1(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cn}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ua=t=>(e,n)=>{t&&tt.update(()=>t(e,n),!1,!0)};class i1 extends Cr{constructor(){super(...arguments),this.removePointerDownListener=cn}onPointerDown(e){this.session=new Wm(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:zm(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Ua(e),onStart:Ua(n),onMove:Ua(r),onEnd:(s,i)=>{delete this.session,o&&tt.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Zo(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Ha=!1;class a1 extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),Ha&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),yi.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,e.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),Ha=!0,o||e.layoutDependency!==n||n===void 0||e.isPresent!==s?i.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?i.promote():i.relegate()||tt.postRender(()=>{const c=i.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Kl.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=e;Ha=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ym(t){const[e,n]=$m(),r=v.useContext(Pl);return a.jsx(a1,{...t,layoutGroup:r,switchLayoutGroup:v.useContext(Hm),isPresent:e,safeToRemove:n})}const c1={pan:{Feature:i1},drag:{Feature:s1,ProjectionNode:Dm,MeasureLayout:Ym}};function Ff(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&tt.postRender(()=>s(e,vs(e)))}class l1 extends Cr{mount(){const{current:e}=this.node;e&&(this.unmount=kw(e,(n,r)=>(Ff(this.node,r,"Start"),o=>Ff(this.node,o,"End"))))}unmount(){}}class u1 extends Cr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ms(rs(this.node.current,"focus",()=>this.onFocus()),rs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Vf(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&tt.postRender(()=>s(e,vs(e)))}class d1 extends Cr{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Ow(e,(o,s)=>(Vf(this.node,s,"Start"),(i,{success:c})=>Vf(this.node,i,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Kc=new WeakMap,Ga=new WeakMap,f1=t=>{const e=Kc.get(t.target);e&&e(t)},h1=t=>{t.forEach(f1)};function p1({root:t,...e}){const n=t||document;Ga.has(n)||Ga.set(n,{});const r=Ga.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(h1,{root:t,...e})),r[o]}function m1(t,e,n){const r=p1(e);return Kc.set(t,n),r.observe(t),()=>{Kc.delete(t),r.unobserve(t)}}const g1={some:0,all:1};class y1 extends Cr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=e,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:g1[o]},c=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),p=d?f:h;p&&p(u)};this.stopObserver=m1(this.node.current,i,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(v1(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function v1({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const x1={inView:{Feature:y1},tap:{Feature:d1},focus:{Feature:u1},hover:{Feature:l1}},b1={layout:{ProjectionNode:Dm,MeasureLayout:Ym}},w1={...GS,...x1,...c1,...b1},Xm=FS(w1,VS);function qm(){const[t,e]=v.useState([]),n=v.useRef(0),r=v.useCallback(s=>{const c=s.currentTarget.getBoundingClientRect(),l=Math.max(c.width,c.height)*2.2,u=s.clientX-c.left-l/2,d=s.clientY-c.top-l/2,f=n.current++;e(h=>[...h,{id:f,x:u,y:d,size:l}])},[]),o=v.useCallback(s=>{e(i=>i.filter(c=>c.id!==s))},[]);return{ripples:t,add:r,remove:o}}function Zm({ripples:t,onDone:e}){return a.jsx(_m,{children:t.map(n=>a.jsx(Xm.span,{className:"btn-ripple",style:{left:n.x,top:n.y,width:n.size,height:n.size},initial:{scale:0,opacity:1},animate:{scale:1,opacity:[1,1,0]},transition:{scale:{duration:1,ease:[.4,0,.2,1]},opacity:{duration:1.2,times:[0,.6,1],ease:"easeOut"}},onAnimationComplete:()=>e(n.id)},n.id))})}const C1=()=>a.jsx("span",{className:"btn-spinner","aria-hidden":"true"}),Ur=v.forwardRef(function({variant:e="solid",color:n="primary",size:r,shape:o,block:s=!1,loading:i=!1,icon:c,iconPosition:l="start",disableRipple:u=!1,asChild:d=!1,disabled:f,className:h,style:p,sx:g,children:b,onClick:x,...y},w){const{ripples:C,add:S,remove:M}=qm(),R=f||i,P=k=>{if(R){d&&k.preventDefault();return}!u&&e!=="link"&&S(k),x==null||x(k)},{className:T,style:j,styleTag:A}=Ae(g,p,"btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,s&&"block",i&&"loading",h),_=i?a.jsx(C1,{}):l==="start"?c:null,L=!i&&l==="end"?c:null,I=k=>a.jsxs(a.Fragment,{children:[A,a.jsxs("span",{className:"btn-content",children:[_,typeof k=="string"?a.jsx("span",{className:"btn-label",children:k}):k,L]}),!u&&e!=="link"&&a.jsx(Zm,{ripples:C,onDone:M})]});if(d){const k=v.Children.only(b);return a.jsx(fb,{ref:w,className:T,style:j,onClick:P,"aria-disabled":R||void 0,"aria-busy":i||void 0,tabIndex:R?-1:void 0,...y,children:v.cloneElement(k,void 0,I(k.props.children))})}return a.jsx("button",{ref:w,className:T,style:j,onClick:P,disabled:R,"aria-busy":i||void 0,...y,children:I(b)})}),S1=v.forwardRef(function({orientation:e="horizontal",layout:n="attached",round:r=!1,className:o,children:s,...i},c){const l=ne("btn-group",e==="vertical"&&"vertical",n==="spaced"&&"spaced",r&&"round",o);return a.jsx("div",{ref:c,className:l,role:"group",...i,children:s})}),M1=v.forwardRef(function({variant:e="solid",color:n="primary",size:r,position:o="static",disableRipple:s=!1,icon:i,label:c,open:l=!0,className:u,onClick:d,disabled:f,...h},p){const{ripples:g,add:b,remove:x}=qm(),y=S=>{f||(s||b(S),d==null||d(S))},w=c!=null,C=ne("btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,"fab",w&&"extended",o!=="static"&&`fixed-${o}`,u);return a.jsx(_m,{children:l&&a.jsxs(Xm.button,{ref:p,type:"button",className:C,onClick:y,disabled:f,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:380,damping:26,mass:.9},...h,children:[a.jsxs("span",{className:"btn-content",children:[i,w&&c]}),!s&&a.jsx(Zm,{ripples:g,onDone:x})]})})}),R1=v.forwardRef(function({icon:e,shape:n="circle",variant:r="ghost",...o},s){return a.jsx(Ur,{ref:s,shape:n,variant:r,icon:e,...o})});var T1=Object.defineProperty,Po=(t,e)=>T1(t,"name",{value:e,configurable:!0}),Jm=!!(typeof window<"u"&&window.document&&window.document.createElement);function ge(t,e,{checkForDefaultPrevented:n=!0}={}){return Po(function(o){if(t==null||t(o),n===!1||!o||!o.defaultPrevented)return e==null?void 0:e(o)},"handleEvent")}Po(ge,"composeEventHandlers");function j1(t){var e;if(!Jm)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}Po(j1,"getOwnerWindow");function Yc(t){if(!Jm)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}Po(Yc,"getOwnerDocument");function Qm(t,e=!1){const{activeElement:n}=Yc(t);if(!(n!=null&&n.nodeName))return null;if(eg(n)&&n.contentDocument)return Qm(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const o=Yc(n).getElementById(r);if(o)return o}}return n}Po(Qm,"getActiveElement");function eg(t){return t.tagName==="IFRAME"}Po(eg,"isFrame");var mt=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},P1=Object.defineProperty,N1=(t,e)=>P1(t,"name",{value:e,configurable:!0}),Bf=m[" useEffectEvent ".trim().toString()],Uf=m[" useInsertionEffect ".trim().toString()];function tg(t){if(typeof Bf=="function")return Bf(t);const e=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Uf=="function"?Uf(()=>{e.current=t}):mt(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}N1(tg,"useEffectEvent");var E1=Object.defineProperty,xs=(t,e)=>E1(t,"name",{value:e,configurable:!0}),k1=m[" useInsertionEffect ".trim().toString()]||mt;function lt({prop:t,defaultProp:e,onChange:n=xs(()=>{},"onChange"),caller:r}){const[o,s,i]=ng({defaultProp:e,onChange:n}),c=t!==void 0,l=c?t:o,u=m.useCallback(d=>{var f;if(c){const h=rg(d)?d(t):d;h!==t&&((f=i.current)==null||f.call(i,h))}else s(d)},[c,t,s,i]);return[l,u]}xs(lt,"useControllableState");function ng({defaultProp:t,onChange:e}){const[n,r]=m.useState(t),o=m.useRef(n),s=m.useRef(e);return k1(()=>{s.current=e},[e]),m.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}xs(ng,"useUncontrolledState");function rg(t){return typeof t=="function"}xs(rg,"isFunction");var Hf=Symbol("RADIX:SYNC_STATE");function A1(t,e,n,r){const{prop:o,defaultProp:s,onChange:i,caller:c}=e,l=o!==void 0,u=tg(i),d=[{...n,state:s}];r&&d.push(r);const[f,h]=m.useReducer((x,y)=>{if(y.type===Hf)return{...x,state:y.state};const w=t(x,y);return l&&!Object.is(w.state,x.state)&&u(w.state),w},...d),p=f.state,g=m.useRef(p);m.useEffect(()=>{g.current!==p&&(g.current=p,l||u(p))},[p,g,l]);const b=m.useMemo(()=>o!==void 0?{...f,state:o}:f,[f,o]);return m.useEffect(()=>{l&&!Object.is(o,f.state)&&h({type:Hf,state:o})},[o,f.state,l]),[b,h]}xs(A1,"useControllableStateReducer");var I1=Object.defineProperty,D1=(t,e)=>I1(t,"name",{value:e,configurable:!0}),$1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ne=$1.reduce((t,e)=>{const n=vn(`Primitive.${e}`),r=m.forwardRef((o,s)=>{const{asChild:i,...c}=o,l=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(l,{...c,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function ru(t,e){t&&ps.flushSync(()=>t.dispatchEvent(e))}D1(ru,"dispatchDiscreteCustomEvent");var _1=Object.defineProperty,O1=(t,e)=>_1(t,"name",{value:e,configurable:!0}),L1="Toggle",og=m.forwardRef(O1(function(e,n){const{pressed:r,defaultPressed:o,onPressedChange:s,...i}=e,[c,l]=lt({prop:r,onChange:s,defaultProp:o??!1,caller:L1});return a.jsx(Ne.button,{type:"button","aria-pressed":c,"data-state":c?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:n,onClick:ge(e.onClick,()=>{e.disabled||l(!c)})})},"Toggle")),F1=og;const V1=v.forwardRef(function({variant:e="ghost",color:n="primary",size:r,shape:o,icon:s,className:i,children:c,...l},u){const d=ne("btn",e,n!=="primary"&&n,r==="sm"||r==="lg"?r:null,o&&o!=="default"&&o,i);return a.jsx(F1,{ref:u,className:d,...l,children:a.jsxs("span",{className:"btn-content",children:[s,c]})})});var B1=Object.defineProperty,sn=(t,e)=>B1(t,"name",{value:e,configurable:!0});function U1(t,e){const n=m.createContext(e);n.displayName=t+"Context";const r=sn(s=>{const{children:i,...c}=s,l=m.useMemo(()=>c,Object.values(c));return a.jsx(n.Provider,{value:l,children:i})},"Provider");r.displayName=t+"Provider";function o(s,i={}){const{optional:c=!1}=i,l=m.useContext(n);if(l)return l;if(e!==void 0)return e;if(!c)throw new Error(`\`${s}\` must be used within \`${t}\``)}return sn(o,"useContext"),[r,o]}sn(U1,"createContext");function dt(t,e=[]){let n=[];function r(s,i){const c=m.createContext(i);c.displayName=s+"Context";const l=n.length;n=[...n,i];const u=sn(f=>{var y;const{scope:h,children:p,...g}=f,b=((y=h==null?void 0:h[t])==null?void 0:y[l])||c,x=m.useMemo(()=>g,Object.values(g));return a.jsx(b.Provider,{value:x,children:p})},"Provider");u.displayName=s+"Provider";function d(f,h,p={}){var y;const{optional:g=!1}=p,b=((y=h==null?void 0:h[t])==null?void 0:y[l])||c,x=m.useContext(b);if(x)return x;if(i!==void 0)return i;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return sn(d,"useContext"),[u,d]}sn(r,"createContext");const o=sn(()=>{const s=n.map(i=>m.createContext(i));return sn(function(c){const l=(c==null?void 0:c[t])||s;return m.useMemo(()=>({[`__scope${t}`]:{...c,[t]:l}}),[c,l])},"useScope")},"createScope");return o.scopeName=t,[r,sg(o,...e)]}sn(dt,"createContextScope");function sg(...t){const e=t[0];if(t.length===1)return e;const n=sn(()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return sn(function(s){const i=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return m.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}sn(sg,"composeContextScopes");var H1=Object.defineProperty,Tt=(t,e)=>H1(t,"name",{value:e,configurable:!0});function No(t){const e=t+"CollectionProvider",[n,r]=dt(e),[o,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),i=Tt(b=>{const{scope:x,children:y}=b,w=m.useRef(null),C=m.useRef(new Map).current;return a.jsx(o,{scope:x,itemMap:C,collectionRef:w,children:y})},"CollectionProvider");i.displayName=e;const c=t+"CollectionSlot",l=vn(c),u=m.forwardRef((b,x)=>{const{scope:y,children:w}=b,C=s(c,y),S=_e(x,C.collectionRef);return a.jsx(l,{ref:S,children:w})});u.displayName=c;const d=t+"CollectionItemSlot",f="data-radix-collection-item",h=vn(d),p=m.forwardRef((b,x)=>{const{scope:y,children:w,...C}=b,S=m.useRef(null),M=_e(x,S),R=s(d,y);return m.useEffect(()=>(R.itemMap.set(S,{ref:S,...C}),()=>void R.itemMap.delete(S))),a.jsx(h,{[f]:"",ref:M,children:w})});p.displayName=d;function g(b){const x=s(t+"CollectionConsumer",b);return m.useCallback(()=>{const w=x.collectionRef.current;if(!w)return[];const C=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((R,P)=>C.indexOf(R.ref.current)-C.indexOf(P.ref.current))},[x.collectionRef,x.itemMap])}return Tt(g,"useCollection"),[{Provider:i,Slot:u,ItemSlot:p},g,r]}Tt(No,"createCollection");var Gf=new WeakMap,ht,qt,za=(qt=class extends Map{constructor(n){super(n);bd(this,ht);ja(this,ht,[...super.keys()]),Gf.set(this,!0)}set(n,r){return Gf.get(this)&&(this.has(n)?It(this,ht)[It(this,ht).indexOf(n)]=n:It(this,ht).push(n)),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=It(this,ht).length,c=ou(n);let l=c>=0?c:i+c;const u=l<0||l>=i?-1:l;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(r,o),this;const d=this.size+(s?0:1);c<0&&l++;const f=[...It(this,ht)];let h,p=!1;for(let g=l;g<d;g++)if(l===g){let b=f[g];f[g]===r&&(b=f[g+1]),s&&this.delete(r),h=this.get(b),this.set(r,o)}else{!p&&f[g-1]===r&&(p=!0);const b=f[p?g:g-1],x=h;h=this.get(b),this.delete(b),this.set(b,x)}return this}with(n,r,o){const s=new qt(this);return s.insert(n,r,o),s}before(n){const r=It(this,ht).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=It(this,ht).indexOf(n);return s===-1?this:this.insert(s,r,o)}after(n){let r=It(this,ht).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=It(this,ht).indexOf(n);return s===-1?this:this.insert(s+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return ja(this,ht,[]),super.clear()}delete(n){const r=super.delete(n);return r&&It(this,ht).splice(It(this,ht).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=vi(It(this,ht),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=vi(It(this,ht),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return It(this,ht).indexOf(n)}keyAt(n){return vi(It(this,ht),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new qt(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new qt(o)}reduce(...n){const[r,o]=n;let s=0,i=o??this.at(0);for(const c of this)s===0&&n.length===1?i=c:i=Reflect.apply(r,this,[i,c,s,this]),s++;return i}reduceRight(...n){const[r,o]=n;let s=o??this.at(-1);for(let i=this.size-1;i>=0;i--){const c=this.at(i);i===this.size-1&&n.length===1?s=c:s=Reflect.apply(r,this,[s,c,i,this])}return s}toSorted(n){const r=[...this.entries()].sort(n);return new qt(r)}toReversed(){const n=new qt;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new qt(r)}slice(n,r){const o=new qt;let s=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),r!==void 0&&r>0&&(s=r-1);for(let i=n;i<=s;i++){const c=this.keyAt(i),l=this.get(c);o.set(c,l)}return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},ht=new WeakMap,Tt(qt,"OrderedDict"),qt);function vi(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=ig(t,e);return n===-1?void 0:t[n]}Tt(vi,"at");function ig(t,e){const n=t.length,r=ou(e),o=r>=0?r:n+r;return o<0||o>=n?-1:o}Tt(ig,"toSafeIndex");function ou(t){return t!==t||t===0?0:Math.trunc(t)}Tt(ou,"toSafeInteger");function G1(t){const e=t+"CollectionProvider",[n,r]=dt(e),[o,s]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new za,setItemMap:Tt(()=>{},"setItemMap")}),i=Tt(({state:C,...S})=>C?a.jsx(l,{...S,state:C}):a.jsx(c,{...S}),"CollectionProvider");i.displayName=e;const c=Tt(C=>{const S=x();return a.jsx(l,{...C,state:S})},"CollectionInit");c.displayName=e+"Init";const l=Tt(C=>{const{scope:S,children:M,state:R}=C,P=m.useRef(null),[T,j]=m.useState(null),A=_e(P,j),[_,L]=R;return m.useEffect(()=>{if(!T)return;const I=lg(()=>{});return I.observe(T,{childList:!0,subtree:!0}),()=>{I.disconnect()}},[T]),a.jsx(o,{scope:S,itemMap:_,setItemMap:L,collectionRef:A,collectionRefObject:P,collectionElement:T,children:M})},"CollectionProviderImpl");l.displayName=e+"Impl";const u=t+"CollectionSlot",d=vn(u),f=m.forwardRef((C,S)=>{const{scope:M,children:R}=C,P=s(u,M),T=_e(S,P.collectionRef);return a.jsx(d,{ref:T,children:R})});f.displayName=u;const h=t+"CollectionItemSlot",p="data-radix-collection-item",g=vn(h),b=m.forwardRef((C,S)=>{const{scope:M,children:R,...P}=C,T=m.useRef(null),[j,A]=m.useState(null),_=_e(S,T,A),L=s(h,M),{setItemMap:I}=L,k=m.useRef(P);ag(k.current,P)||(k.current=P);const q=k.current;return m.useEffect(()=>{const U=q;return I(E=>j?E.has(j)?E.set(j,{...U,element:j}).toSorted(Xc):(E.set(j,{...U,element:j}),E.toSorted(Xc)):E),()=>{I(E=>!j||!E.has(j)?E:(E.delete(j),new za(E)))}},[j,q,I]),a.jsx(g,{[p]:"",ref:_,children:R})});b.displayName=h;function x(){return m.useState(new za)}Tt(x,"useInitCollection");function y(C){const{itemMap:S}=s(t+"CollectionConsumer",C);return S}return Tt(y,"useCollection"),[{Provider:i,Slot:f,ItemSlot:b},{createCollectionScope:r,useCollection:y,useInitCollection:x}]}Tt(G1,"createCollection");function ag(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||t[o]!==e[o])return!1;return!0}Tt(ag,"shallowEqual");function cg(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Tt(cg,"isElementPreceding");function Xc(t,e){return!t[1].element||!e[1].element?0:cg(t[1].element,e[1].element)?-1:1}Tt(Xc,"sortByDocumentPosition");function lg(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Tt(lg,"getChildListObserver");var z1=Object.defineProperty,W1=(t,e)=>z1(t,"name",{value:e,configurable:!0}),K1=m[" useId ".trim().toString()]||(()=>{}),Y1=0;function Et(t){const[e,n]=m.useState(K1());return mt(()=>{t||n(r=>r??String(Y1++))},[t]),t||(e?`radix-${e}`:"")}W1(Et,"useId");var X1=Object.defineProperty,q1=(t,e)=>X1(t,"name",{value:e,configurable:!0});function zt(t){const e=m.useRef(t);return m.useEffect(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}q1(zt,"useCallbackRef");var Z1=Object.defineProperty,J1=(t,e)=>Z1(t,"name",{value:e,configurable:!0}),Q1=m.createContext(void 0);function or(t){const e=m.useContext(Q1);return t||e||"ltr"}J1(or,"useDirection");var eM=Object.defineProperty,su=(t,e)=>eM(t,"name",{value:e,configurable:!0}),Wa=!1;function ug(){const[t,e]=m.useState(Wa);return m.useEffect(()=>{Wa||(Wa=!0,e(!0))},[]),t}su(ug,"useIsHydrated");var dg=m[" useSyncExternalStore ".trim().toString()];function fg(){return()=>{}}su(fg,"subscribe");function hg(){return dg(fg,()=>!0,()=>!1)}su(hg,"useIsHydratedModern");var tM=typeof dg=="function"?hg:ug,nM=Object.defineProperty,Wr=(t,e)=>nM(t,"name",{value:e,configurable:!0}),Ka="rovingFocusGroup.onEntryFocus",rM={bubbles:!1,cancelable:!0},Ki="RovingFocusGroup",[qc,pg,oM]=No(Ki),[sM,Sr]=dt(Ki,[oM]),[iM,aM]=sM(Ki),cM=m.forwardRef(Wr(function(e,n){return a.jsx(qc.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(qc.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(lM,{...e,ref:n})})})},"RovingFocusGroup")),lM=m.forwardRef(Wr(function(e,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=e,p=m.useRef(null),g=_e(n,p),b=or(i),[x,y]=lt({prop:c,defaultProp:l??null,onChange:u,caller:Ki}),[w,C]=m.useState(!1),S=zt(d),M=pg(r),R=m.useRef(!1),[P,T]=m.useState(0);return m.useEffect(()=>{const j=p.current;if(j)return j.addEventListener(Ka,S),()=>j.removeEventListener(Ka,S)},[S]),a.jsx(iM,{scope:r,orientation:o,dir:b,loop:s,currentTabStopId:x,onItemFocus:m.useCallback(j=>y(j),[y]),onItemShiftTab:m.useCallback(()=>C(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(j=>j+1),[]),onFocusableItemRemove:m.useCallback(()=>T(j=>j-1),[]),children:a.jsx(Ne.div,{tabIndex:w||P===0?-1:0,"data-orientation":o,...h,ref:g,style:{outline:"none",...e.style},onMouseDown:ge(e.onMouseDown,()=>{R.current=!0}),onFocus:ge(e.onFocus,j=>{const A=!R.current;if(j.target===j.currentTarget&&A&&!w){const _=new CustomEvent(Ka,rM);if(j.currentTarget.dispatchEvent(_),!_.defaultPrevented){const L=M().filter(E=>E.focusable),I=L.find(E=>E.active),k=L.find(E=>E.id===x),U=[I,k,...L].filter(Boolean).map(E=>E.ref.current);iu(U,f)}}R.current=!1}),onBlur:ge(e.onBlur,()=>C(!1))})})},"RovingFocusGroupImpl")),uM="RovingFocusGroupItem",dM=m.forwardRef(Wr(function(e,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:c,...l}=e,u=Et(),d=i||u,f=aM(uM,r),h=f.currentTabStopId===d,p=pg(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:x}=f,y=tM();return mt(()=>{if(!(!y||!o))return g(),()=>b()},[y,o,g,b]),m.useEffect(()=>{if(!(y||!o))return g(),()=>b()},[y,o,g,b]),a.jsx(qc.ItemSlot,{scope:r,id:d,focusable:o,active:s,children:a.jsx(Ne.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...l,ref:n,onMouseDown:ge(e.onMouseDown,w=>{o?f.onItemFocus(d):w.preventDefault()}),onFocus:ge(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:ge(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const C=gg(w,f.orientation,f.dir);if(C!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let M=p().filter(R=>R.focusable).map(R=>R.ref.current);if(C==="last")M.reverse();else if(C==="prev"||C==="next"){C==="prev"&&M.reverse();const R=M.indexOf(w.currentTarget);M=f.loop?yg(M,R+1):M.slice(R+1)}setTimeout(()=>iu(M))}}),children:typeof c=="function"?c({isCurrentTabStop:h,hasTabStop:x!=null}):c})})},"RovingFocusGroupItem")),fM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mg(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}Wr(mg,"getDirectionAwareKey");function gg(t,e,n){const r=mg(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return fM[r]}Wr(gg,"getFocusIntent");function iu(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}Wr(iu,"focusFirst");function yg(t,e){return t.map((n,r)=>t[(e+r)%t.length])}Wr(yg,"wrapArray");var Yi=cM,Xi=dM,hM=Object.defineProperty,gr=(t,e)=>hM(t,"name",{value:e,configurable:!0}),Eo="ToggleGroup",[vg,E_]=dt(Eo,[Sr]),xg=Sr(),pM=m.forwardRef(gr(function(e,n){const{type:r,...o}=e;if(r==="single"){const s=o;return a.jsx(mM,{role:"radiogroup",...s,ref:n})}if(r==="multiple"){const s=o;return a.jsx(gM,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${Eo}\``)},"ToggleGroup")),[bg,wg]=vg(Eo),mM=m.forwardRef(gr(function(e,n){const{value:r,defaultValue:o,onValueChange:s=gr(()=>{},"onValueChange"),...i}=e,[c,l]=lt({prop:r,defaultProp:o??"",onChange:s,caller:Eo});return a.jsx(bg,{scope:e.__scopeToggleGroup,type:"single",value:m.useMemo(()=>c?[c]:[],[c]),onItemActivate:l,onItemDeactivate:m.useCallback(()=>l(""),[l]),children:a.jsx(Cg,{...i,ref:n})})},"ToggleGroupImplSingle")),gM=m.forwardRef(gr(function(e,n){const{value:r,defaultValue:o,onValueChange:s=gr(()=>{},"onValueChange"),...i}=e,[c,l]=lt({prop:r,defaultProp:o??[],onChange:s,caller:Eo}),u=m.useCallback(f=>l((h=[])=>[...h,f]),[l]),d=m.useCallback(f=>l((h=[])=>h.filter(p=>p!==f)),[l]);return a.jsx(bg,{scope:e.__scopeToggleGroup,type:"multiple",value:c,onItemActivate:u,onItemDeactivate:d,children:a.jsx(Cg,{...i,ref:n})})},"ToggleGroupImplMultiple")),[yM,vM]=vg(Eo),Cg=m.forwardRef(gr(function(e,n){const{__scopeToggleGroup:r,disabled:o=!1,rovingFocus:s=!0,orientation:i,dir:c,loop:l=!0,...u}=e,d=xg(r),f=or(c),h={dir:f,...u};return a.jsx(yM,{scope:r,rovingFocus:s,disabled:o,children:s?a.jsx(Yi,{asChild:!0,...d,orientation:i,dir:f,loop:l,children:a.jsx(Ne.div,{...h,ref:n})}):a.jsx(Ne.div,{...h,ref:n})})},"ToggleGroupImpl")),Zc="ToggleGroupItem",xM=m.forwardRef(gr(function(e,n){const r=wg(Zc,e.__scopeToggleGroup),o=vM(Zc,e.__scopeToggleGroup),s=xg(e.__scopeToggleGroup),i=r.value.includes(e.value),c=o.disabled||e.disabled,l={...e,pressed:i,disabled:c},u=m.useRef(null);return o.rovingFocus?a.jsx(Xi,{asChild:!0,...s,focusable:!c,active:i,ref:u,children:a.jsx(zf,{...l,ref:n})}):a.jsx(zf,{...l,ref:n})},"ToggleGroupItem")),zf=m.forwardRef(gr(function(e,n){const{__scopeToggleGroup:r,value:o,...s}=e,i=wg(Zc,r),c={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=i.type==="single"?c:void 0;return a.jsx(og,{...l,...s,ref:n,onPressedChange:u=>{u?i.onItemActivate(o):i.onItemDeactivate(o)}})},"ToggleGroupItemImpl"));const Sg=v.createContext({variant:"outline",color:"primary"}),bM=v.forwardRef(function({variant:e="outline",color:n="primary",size:r,layout:o="attached",round:s=!1,className:i,children:c,...l},u){const d=ne("btn-group",o==="spaced"&&"spaced",s&&"round",i);return a.jsx(Sg.Provider,{value:{variant:e,color:n,size:r},children:a.jsx(pM,{ref:u,className:d,...l,children:c})})}),wM=v.forwardRef(function({icon:e,shape:n,className:r,children:o,...s},i){const{variant:c,color:l,size:u}=v.useContext(Sg),d=ne("btn",c,l!=="primary"&&l,u==="sm"||u==="lg"?u:null,n&&n!=="default"&&n,r);return a.jsx(xM,{ref:i,className:d,...s,children:a.jsxs("span",{className:"btn-content",children:[e,o]})})});/**
10
10
  * @license lucide-react v1.8.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
- */const vp=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
14
+ */const Mg=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
15
15
  * @license lucide-react v1.8.0 - ISC
16
16
  *
17
17
  * This source code is licensed under the ISC license.
18
18
  * See the LICENSE file in the root directory of this source tree.
19
- */const dS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
19
+ */const CM=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
20
20
  * @license lucide-react v1.8.0 - ISC
21
21
  *
22
22
  * This source code is licensed under the ISC license.
23
23
  * See the LICENSE file in the root directory of this source tree.
24
- */const fS=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
24
+ */const SM=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
25
25
  * @license lucide-react v1.8.0 - ISC
26
26
  *
27
27
  * This source code is licensed under the ISC license.
28
28
  * See the LICENSE file in the root directory of this source tree.
29
- */const rd=t=>{const e=fS(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
29
+ */const Wf=t=>{const e=SM(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
30
30
  * @license lucide-react v1.8.0 - ISC
31
31
  *
32
32
  * This source code is licensed under the ISC license.
33
33
  * See the LICENSE file in the root directory of this source tree.
34
- */var di={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
34
+ */var Ya={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
35
35
  * @license lucide-react v1.8.0 - ISC
36
36
  *
37
37
  * This source code is licensed under the ISC license.
38
38
  * See the LICENSE file in the root directory of this source tree.
39
- */const hS=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},pS=S.createContext({}),mS=()=>S.useContext(pS),gS=S.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>{const{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:h="currentColor",className:m=""}=mS()??{},g=r??f?Number(n??d)*24/Number(e??u):n??d;return S.createElement("svg",{ref:c,...di,width:e??u??di.width,height:e??u??di.height,stroke:t??h,strokeWidth:g,className:vp("lucide",m,o),...!s&&!hS(a)&&{"aria-hidden":"true"},...a},[...i.map(([y,v])=>S.createElement(y,v)),...Array.isArray(s)?s:[s]])});/**
39
+ */const MM=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},RM=v.createContext({}),TM=()=>v.useContext(RM),jM=v.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...c},l)=>{const{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:h="currentColor",className:p=""}=TM()??{},g=r??f?Number(n??d)*24/Number(e??u):n??d;return v.createElement("svg",{ref:l,...Ya,width:e??u??Ya.width,height:e??u??Ya.height,stroke:t??h,strokeWidth:g,className:Mg("lucide",p,o),...!s&&!MM(c)&&{"aria-hidden":"true"},...c},[...i.map(([b,x])=>v.createElement(b,x)),...Array.isArray(s)?s:[s]])});/**
40
40
  * @license lucide-react v1.8.0 - ISC
41
41
  *
42
42
  * This source code is licensed under the ISC license.
43
43
  * See the LICENSE file in the root directory of this source tree.
44
- */const ve=(t,e)=>{const n=S.forwardRef(({className:r,...o},s)=>S.createElement(gS,{ref:s,iconNode:e,className:vp(`lucide-${dS(rd(t))}`,`lucide-${t}`,r),...o}));return n.displayName=rd(t),n};/**
44
+ */const Je=(t,e)=>{const n=v.forwardRef(({className:r,...o},s)=>v.createElement(jM,{ref:s,iconNode:e,className:Mg(`lucide-${CM(Wf(t))}`,`lucide-${t}`,r),...o}));return n.displayName=Wf(t),n};/**
45
45
  * @license lucide-react v1.8.0 - ISC
46
46
  *
47
47
  * This source code is licensed under the ISC license.
48
48
  * See the LICENSE file in the root directory of this source tree.
49
- */const yS=[["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"}]],vS=ve("calendar",yS);/**
49
+ */const PM=[["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"}]],NM=Je("calendar",PM);/**
50
50
  * @license lucide-react v1.8.0 - ISC
51
51
  *
52
52
  * This source code is licensed under the ISC license.
53
53
  * See the LICENSE file in the root directory of this source tree.
54
- */const xS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],nn=ve("check",xS);/**
54
+ */const EM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],yr=Je("check",EM);/**
55
55
  * @license lucide-react v1.8.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
- */const bS=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Gr=ve("chevron-down",bS);/**
59
+ */const kM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],bs=Je("chevron-down",kM);/**
60
60
  * @license lucide-react v1.8.0 - ISC
61
61
  *
62
62
  * This source code is licensed under the ISC license.
63
63
  * See the LICENSE file in the root directory of this source tree.
64
- */const wS=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Fo=ve("chevron-left",wS);/**
64
+ */const AM=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Jo=Je("chevron-left",AM);/**
65
65
  * @license lucide-react v1.8.0 - ISC
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
- */const CS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Qt=ve("chevron-right",CS);/**
69
+ */const IM=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xn=Je("chevron-right",IM);/**
70
70
  * @license lucide-react v1.8.0 - ISC
71
71
  *
72
72
  * This source code is licensed under the ISC license.
73
73
  * See the LICENSE file in the root directory of this source tree.
74
- */const SS=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],xp=ve("chevron-up",SS);/**
74
+ */const DM=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Rg=Je("chevron-up",DM);/**
75
75
  * @license lucide-react v1.8.0 - ISC
76
76
  *
77
77
  * This source code is licensed under the ISC license.
78
78
  * See the LICENSE file in the root directory of this source tree.
79
- */const PS=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],bp=ve("chevrons-up-down",PS);/**
79
+ */const $M=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],_M=Je("chevrons-left",$M);/**
80
80
  * @license lucide-react v1.8.0 - ISC
81
81
  *
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
- */const RS=[["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"}]],wp=ve("circle-alert",RS);/**
84
+ */const OM=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],LM=Je("chevrons-right",OM);/**
85
85
  * @license lucide-react v1.8.0 - ISC
86
86
  *
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
- */const TS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Cp=ve("circle-check",TS);/**
89
+ */const FM=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Tg=Je("chevrons-up-down",FM);/**
90
90
  * @license lucide-react v1.8.0 - ISC
91
91
  *
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
- */const MS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Sp=ve("circle",MS);/**
94
+ */const VM=[["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"}]],au=Je("circle-alert",VM);/**
95
95
  * @license lucide-react v1.8.0 - ISC
96
96
  *
97
97
  * This source code is licensed under the ISC license.
98
98
  * See the LICENSE file in the root directory of this source tree.
99
- */const ES=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],jS=ve("clock",ES);/**
99
+ */const BM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],jg=Je("circle-check",BM);/**
100
100
  * @license lucide-react v1.8.0 - ISC
101
101
  *
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
- */const AS=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],DS=ve("cloud-upload",AS);/**
104
+ */const UM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Pg=Je("circle",UM);/**
105
105
  * @license lucide-react v1.8.0 - ISC
106
106
  *
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
- */const IS=[["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"}]],kS=ve("ellipsis",IS);/**
109
+ */const HM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],GM=Je("clock",HM);/**
110
110
  * @license lucide-react v1.8.0 - ISC
111
111
  *
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
- */const NS=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],_S=ve("eye-off",NS);/**
114
+ */const zM=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],WM=Je("cloud-upload",zM);/**
115
115
  * @license lucide-react v1.8.0 - ISC
116
116
  *
117
117
  * This source code is licensed under the ISC license.
118
118
  * See the LICENSE file in the root directory of this source tree.
119
- */const OS=[["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"}]],$S=ve("eye",OS);/**
119
+ */const KM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],YM=Je("columns-3",KM);/**
120
120
  * @license lucide-react v1.8.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
- */const LS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],FS=ve("file",LS);/**
124
+ */const XM=[["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"}]],Ng=Je("ellipsis",XM);/**
125
125
  * @license lucide-react v1.8.0 - ISC
126
126
  *
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
- */const VS=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],BS=ve("folder-open",VS);/**
129
+ */const qM=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ZM=Je("eye-off",qM);/**
130
130
  * @license lucide-react v1.8.0 - ISC
131
131
  *
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
- */const GS=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],zS=ve("folder",GS);/**
134
+ */const JM=[["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"}]],QM=Je("eye",JM);/**
135
135
  * @license lucide-react v1.8.0 - ISC
136
136
  *
137
137
  * This source code is licensed under the ISC license.
138
138
  * See the LICENSE file in the root directory of this source tree.
139
- */const US=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Pp=ve("info",US);/**
139
+ */const eR=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Eg=Je("file",eR);/**
140
140
  * @license lucide-react v1.8.0 - ISC
141
141
  *
142
142
  * This source code is licensed under the ISC license.
143
143
  * See the LICENSE file in the root directory of this source tree.
144
- */const HS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Rp=ve("loader-circle",HS);/**
144
+ */const tR=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],nR=Je("folder-open",tR);/**
145
145
  * @license lucide-react v1.8.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
- */const WS=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],KS=ve("menu",WS);/**
149
+ */const rR=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],oR=Je("folder",rR);/**
150
150
  * @license lucide-react v1.8.0 - ISC
151
151
  *
152
152
  * This source code is licensed under the ISC license.
153
153
  * See the LICENSE file in the root directory of this source tree.
154
- */const YS=[["path",{d:"M5 12h14",key:"1ays0h"}]],XS=ve("minus",YS);/**
154
+ */const sR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],kg=Je("info",sR);/**
155
155
  * @license lucide-react v1.8.0 - ISC
156
156
  *
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
- */const qS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],ZS=ve("panel-left",qS);/**
159
+ */const iR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ag=Je("loader-circle",iR);/**
160
160
  * @license lucide-react v1.8.0 - ISC
161
161
  *
162
162
  * This source code is licensed under the ISC license.
163
163
  * See the LICENSE file in the root directory of this source tree.
164
- */const QS=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Tp=ve("search",QS);/**
164
+ */const aR=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Ig=Je("menu",aR);/**
165
165
  * @license lucide-react v1.8.0 - ISC
166
166
  *
167
167
  * This source code is licensed under the ISC license.
168
168
  * See the LICENSE file in the root directory of this source tree.
169
- */const JS=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Mp=ve("triangle-alert",JS);/**
169
+ */const cR=[["path",{d:"M5 12h14",key:"1ays0h"}]],lR=Je("minus",cR);/**
170
170
  * @license lucide-react v1.8.0 - ISC
171
171
  *
172
172
  * This source code is licensed under the ISC license.
173
173
  * See the LICENSE file in the root directory of this source tree.
174
- */const eP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wt=ve("x",eP),tP=S.forwardRef(function({color:e="primary",size:n,prefix:r,suffix:o,clearable:s=!1,onClear:i,showPasswordToggle:a=!1,filled:c=!1,type:u="text",disabled:d,className:f,style:h,sx:m,value:g,defaultValue:y,onChange:v,...x},w){const b=g!==void 0,[C,P]=S.useState(y!=null?String(y):""),R=b?String(g??""):C,M=S.useRef(null);S.useImperativeHandle(w,()=>M.current,[]);const[A,T]=S.useState(!1),E=a&&A&&u==="password"?"text":u,N=s&&!d&&R!=="",_=N||a,$=r!=null||o!=null||_,V=O=>{b||P(O.target.value),v==null||v(O)},q=O=>{var Y;O.preventDefault(),b||P("");const D=M.current;if(D){const j=(Y=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:Y.set;j==null||j.call(D,""),D.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},W=oe($?void 0:m,$?void 0:h,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,c&&"filled",f),I=l.jsx("input",{ref:M,type:E,className:W.className,style:W.style,disabled:d,value:b?g:void 0,defaultValue:b?void 0:y,onChange:V,...x});if(!$)return l.jsxs(l.Fragment,{children:[W.styleTag,I]});const L=oe(m,h,"cny-input-affix",r!=null&&"has-prefix",o!=null&&!_&&"has-suffix",_&&"has-action");return l.jsxs("span",{className:L.className,style:L.style,children:[L.styleTag,r!=null&&l.jsx("span",{className:"cny-input-prefix",children:r}),I,o!=null&&!_&&l.jsx("span",{className:"cny-input-suffix",children:o}),N&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:q,"aria-label":"Clear",tabIndex:-1,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})}),a&&u==="password"&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>T(O=>!O),"aria-label":A?"Hide password":"Show password","aria-pressed":A,children:A?l.jsx(_S,{size:14,"aria-hidden":"true"}):l.jsx($S,{size:14,"aria-hidden":"true"})})]})}),nP=S.forwardRef(function({color:e="default",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=oe(o,r,"card",e!=="default"&&e,n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),rP={info:Pp,success:Cp,warning:Mp,danger:wp};function oP({color:t}){const e=rP[t];return l.jsx(e,{size:16,className:"alert-icon-glyph","aria-hidden":"true"})}const sP=S.forwardRef(function({color:e="info",solid:n=!1,title:r,className:o,style:s,sx:i,children:a,icon:c,action:u,onDismiss:d,dismissLabel:f="Dismiss",...h},m){const g=c!==!1,y=c&&c!==!0?c:l.jsx(oP,{color:e}),{className:v,style:x,styleTag:w}=oe(i,s,"alert",e,n&&"solid",o),b=e==="danger"?"alert":"status";return l.jsxs("div",{ref:m,role:b,className:v,style:x,...h,children:[w,g&&l.jsx("span",{className:"alert-icon","aria-hidden":"true",children:y}),l.jsxs("div",{className:"alert-content",children:[r&&l.jsx("p",{className:"alert-title",children:r}),a&&l.jsx("p",{className:"alert-body",children:a})]}),u&&l.jsx("div",{className:"alert-action",children:u}),d&&l.jsx("button",{type:"button",className:"alert-close",onClick:d,"aria-label":f,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})})]})}),iP=S.forwardRef(function({size:e="md",status:n,src:r,alt:o,className:s,style:i,sx:a,children:c,...u},d){const{className:f,style:h,styleTag:m}=oe(a,i,"avatar",e!=="md"&&e,n,s);return l.jsxs("span",{ref:d,className:f,style:h,...u,children:[m,r?l.jsx("img",{src:r,alt:o??""}):c]})}),aP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:z("avatar-stack",e),...r,children:n})}),cP=S.forwardRef(function({value:e=0,color:n="primary",indeterminate:r=!1,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,e)),d=r?s??{}:{...s??{},"--value":`${u}%`},{className:f,style:h,styleTag:m}=oe(i,d,"progress",r&&"indeterminate",n!=="primary"&&n,o);return l.jsxs("div",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r?void 0:u,className:f,style:h,...a,children:[m,l.jsx("span",{className:"progress-bar"})]})}),lP=S.forwardRef(function({value:e,size:n="md",showLabel:r=!0,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,e)),d={...s??{},"--value":u},{className:f,style:h,styleTag:m}=oe(i,d,"progress-ring",n==="lg"&&"lg",o);return l.jsxs("span",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":u,className:f,style:h,...a,children:[m,r&&l.jsxs("span",{children:[u,"%"]})]})}),uP={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},Ep=S.forwardRef(function({variant:e="default",tone:n="neutral",axis:r="both",maxHeight:o,maxWidth:s,region:i=!1,className:a,style:c,sx:u,children:d,...f},h){const m={...uP[r],maxHeight:o,maxWidth:s,...c??{}},{className:g,style:y,styleTag:v}=oe(u,m,i?"cny-scroll-region":"cny-scroll",e!=="default"&&e,n==="primary"&&"primary",a);return l.jsxs("div",{ref:h,className:g,style:y,...f,children:[v,d]})}),dP=S.forwardRef(function(e,n){return l.jsx(Ep,{ref:n,region:!0,...e})}),ia=S.forwardRef(function({shape:e="text",width:n,height:r,className:o,style:s,sx:i,...a},c){const{className:u,style:d,styleTag:f}=oe(i,{...s??{},width:n,height:r},"skeleton",e,o);return l.jsx("span",{ref:c,"aria-hidden":"true",className:u,style:d,...a,children:f})}),fP=S.forwardRef(function({solid:e=!1,surface:n="base",className:r,style:o,sx:s,children:i,...a},c){const{className:u,style:d,styleTag:f}=oe(s,o,"cny-navbar",e&&"solid",n==="raised"&&"raised",r);return l.jsxs("header",{ref:c,className:u,style:d,...a,children:[f,i]})}),hP=S.forwardRef(function({mark:e=!0,className:n,children:r,...o},s){return l.jsxs("a",{ref:s,className:z("cny-navbar-brand",n),...o,children:[e&&l.jsx("span",{className:"brand-mark","aria-hidden":"true"}),r]})}),pP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("nav",{ref:o,className:z("cny-navbar-nav",e),...r,children:n})}),mP=S.forwardRef(function({active:e=!1,className:n,children:r,...o},s){return l.jsx("a",{ref:s,"aria-current":e?"page":void 0,className:z("cny-navbar-item",e&&"active",n),...o,children:r})}),gP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:z("cny-navbar-actions",e),...r,children:n})}),yP=S.forwardRef(function({open:e=!1,className:n,children:r,"aria-label":o,...s},i){return l.jsx("button",{ref:i,type:"button","aria-expanded":e,"aria-label":o??(e?"Close menu":"Open menu"),className:z("cny-navbar-toggle",n),...s,children:r??l.jsx(KS,{size:20,"aria-hidden":"true"})})}),vP="(max-width: 900px)",xP=S.forwardRef(function({width:e="default",sticky:n=!1,collapsed:r=!1,responsive:o=!1,mobileOpen:s=!1,onMobileOpenChange:i,surface:a="base",className:c,style:u,sx:d,children:f,...h},m){const g=o&&!!i,y=g&&s,v=S.useRef(null);S.useEffect(()=>{var R;if(!y)return;if(typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(vP).matches){const M=((R=v.current)==null?void 0:R.querySelector('[data-cny-sidebar-item][tabindex="0"]'))??v.current;M==null||M.focus()}const P=M=>{M.key==="Escape"&&(i==null||i(!1))};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[y,i]);const{className:x,style:w,styleTag:b}=oe(d,u,"cny-sidebar",e!=="default"&&e,n&&"sticky",r&&!y&&"collapsed",o&&"responsive",a==="raised"&&"raised",g&&"mobile-drawer",y&&"mobile-open",c);return l.jsxs(l.Fragment,{children:[g&&l.jsx("div",{className:z("cny-sidebar-backdrop",y&&"open"),"aria-hidden":"true",onClick:()=>i==null?void 0:i(!1)}),l.jsxs("aside",{ref:C=>{v.current=C,typeof m=="function"?m(C):m&&(m.current=C)},tabIndex:g?-1:void 0,className:x,style:w,...h,children:[b,f]})]})}),bP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:z("cny-sidebar-header",e),...r,children:n})}),wP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:z("cny-sidebar-footer",e),...r,children:n})}),CP=S.forwardRef(function({collapsed:e=!1,onClick:n,className:r,children:o,...s},i){return l.jsx("button",{ref:i,type:"button","aria-expanded":!e,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:z("cny-sidebar-toggle",e&&"collapsed",r),onClick:n,...s,children:o??l.jsx(ZS,{size:16,"aria-hidden":"true"})})});function aa(t){const e=Array.from(t.querySelectorAll("[data-cny-sidebar-item]")),n=[];if(e.forEach(o=>{o.hasAttribute("aria-disabled")?o.setAttribute("tabindex","-1"):n.push(o)}),n.length===0)return;const r=n.find(o=>o.classList.contains("active"))??n[0];n.forEach(o=>o.setAttribute("tabindex",o===r?"0":"-1"))}const SP=S.forwardRef(function({title:e,className:n,children:r,...o},s){const i=S.useRef(null),a=S.useCallback(c=>{const u=i.current;if(!u)return;const f=Array.from(u.querySelectorAll("[data-cny-sidebar-item]")).filter(y=>!y.hasAttribute("aria-disabled"));if(f.length===0)return;const h=f.findIndex(y=>y===document.activeElement);let m=h;switch(c.key){case"ArrowDown":c.preventDefault(),m=h<f.length-1?h+1:0;break;case"ArrowUp":c.preventDefault(),m=h<=0?f.length-1:h-1;break;case"Home":c.preventDefault(),m=0;break;case"End":c.preventDefault(),m=f.length-1;break;default:return}const g=f[m];g&&g!==document.activeElement&&(f.forEach(y=>y.setAttribute("tabindex","-1")),g.setAttribute("tabindex","0"),g.focus())},[]);return S.useLayoutEffect(()=>{const c=i.current;if(!c||(aa(c),typeof MutationObserver>"u"))return;const u=new MutationObserver(()=>aa(c));return u.observe(c,{childList:!0,subtree:!0}),()=>u.disconnect()},[]),l.jsxs("div",{ref:s,className:z("cny-sidebar-section",n),...o,children:[e&&l.jsx("div",{className:"cny-sidebar-title",children:e}),l.jsx("nav",{ref:i,className:"cny-sidebar-nav",onKeyDown:a,children:r})]})}),PP=S.forwardRef(function({active:e=!1,disabled:n=!1,icon:r,badge:o,className:s,children:i,...a},c){const u=S.useRef(null),d=S.useId();S.useLayoutEffect(()=>{const h=u.current;if(!h)return;const m=h.closest('[class*="cny-sidebar-nav"]');m&&aa(m)},[e,n]);const f=typeof i=="string"&&!a["aria-label"]?i:void 0;return l.jsxs("a",{ref:h=>{u.current=h,typeof c=="function"?c(h):c&&(c.current=h)},"data-cny-sidebar-item":d,"aria-current":e?"page":void 0,"aria-disabled":n||void 0,"aria-label":f,className:z("cny-sidebar-item",e&&"active",n&&"disabled",s),...a,children:[r&&l.jsx("span",{className:"cny-sidebar-item-icon","aria-hidden":"true",children:r}),l.jsx("span",{className:"cny-sidebar-item-label",children:i}),o&&l.jsx("span",{className:"cny-sidebar-item-badge",children:o})]})});function RP(t){const e=[];return t.display&&e.push(t.display),t.direction==="row"?e.push("flex-row"):t.direction==="column"?e.push("flex-col"):t.direction==="row-reverse"?e.push("flex-row-reverse"):t.direction==="column-reverse"&&e.push("flex-col-reverse"),t.align&&e.push(`items-${t.align==="start"||t.align==="end",t.align}`),t.justify&&e.push(`justify-${t.justify}`),t.wrap&&e.push("flex-wrap"),t.p!==void 0&&e.push(`p-${t.p}`),t.px!==void 0&&e.push(`px-${t.px}`),t.py!==void 0&&e.push(`py-${t.py}`),t.pt!==void 0&&e.push(`pt-${t.pt}`),t.pr!==void 0&&e.push(`pr-${t.pr}`),t.pb!==void 0&&e.push(`pb-${t.pb}`),t.pl!==void 0&&e.push(`pl-${t.pl}`),t.m!==void 0&&e.push(`m-${t.m}`),t.mx!==void 0&&e.push(`mx-${t.mx}`),t.my!==void 0&&e.push(`my-${t.my}`),t.mt!==void 0&&e.push(`mt-${t.mt}`),t.mr!==void 0&&e.push(`mr-${t.mr}`),t.mb!==void 0&&e.push(`mb-${t.mb}`),t.ml!==void 0&&e.push(`ml-${t.ml}`),t.gap!==void 0&&e.push(`gap-${t.gap}`),t.gapX!==void 0&&e.push(`gap-x-${t.gapX}`),t.gapY!==void 0&&e.push(`gap-y-${t.gapY}`),t.w&&e.push(`w-${t.w}`),t.h&&e.push(`h-${t.h}`),t.grow&&e.push("flex-1"),e}const An=S.forwardRef(function({as:e,className:n,style:r,children:o,...s},i){const a=e??"div",{layoutProps:c,domProps:u}=TP(s),{sx:d,...f}=c,h=d?_a(d):void 0,m=z(...RP(f),h==null?void 0:h.className,n),g=h!=null&&h.style||r?{...h==null?void 0:h.style,...r}:void 0,y=S.createElement(a,{ref:i,className:m||void 0,style:g,...u},o);return h!=null&&h.css?S.createElement(S.Fragment,null,S.createElement(Na,{css:h.css}),y):y});function TP(t){const e=new Set(["p","px","py","pt","pr","pb","pl","m","mx","my","mt","mr","mb","ml","gap","gapX","gapY","display","direction","align","justify","wrap","w","h","grow","sx"]),n={},r={};for(const[o,s]of Object.entries(t))e.has(o)?n[o]=s:r[o]=s;return{layoutProps:n,domProps:r}}const MP=S.forwardRef(function(e,n){return l.jsx(An,{ref:n,display:"flex",direction:"column",...e})}),EP=S.forwardRef(function(e,n){const{align:r="center",...o}=e;return l.jsx(An,{ref:n,display:"flex",direction:"row",align:r,...o})}),od=t=>t.map(e=>`minmax(0,${e}fr)`).join(" "),jP=S.forwardRef(function({cols:e,minColWidth:n,ratio:r,template:o,className:s,sx:i,...a},c){let u;if(o)u=o;else if(r)if(Array.isArray(r))u=od(r);else{const f={};for(const[h,m]of Object.entries(r))m&&(f[h]=od(m));u=f}else n&&(u=`repeat(auto-fit, minmax(${n}, 1fr))`);const d=u?{gridTemplateColumns:u,...i??{}}:i;return l.jsx(An,{ref:c,display:"grid",className:z(!u&&e&&`grid-cols-${e}`,s),sx:d,...a})}),AP=S.forwardRef(function({size:e="lg",className:n,...r},o){return l.jsx(An,{ref:o,className:z("cny-container",e,n),...r})}),DP=S.forwardRef(function({orientation:e="horizontal",className:n,style:r,sx:o,...s},i){const{className:a,style:c,styleTag:u}=oe(o,r,"cny-divider",e,n);return e==="vertical"?l.jsxs(l.Fragment,{children:[u,l.jsx("span",{ref:i,role:"separator","aria-orientation":"vertical",className:a,style:c,...s})]}):l.jsxs(l.Fragment,{children:[u,l.jsx("hr",{ref:i,className:a,style:c,...s})]})}),IP=S.forwardRef(function({className:e,style:n,sx:r,...o},s){const{className:i,style:a,styleTag:c}=oe(r,n,"cny-spacer",e);return l.jsx("span",{ref:s,"aria-hidden":"true",className:i,style:a,...o,children:c})}),kP=S.forwardRef(function({ratio:e=16/9,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=oe(o,{aspectRatio:String(e),...r},"aspect-ratio",n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),NP=S.forwardRef(function(e,n){return l.jsx(An,{ref:n,display:"flex",align:"center",justify:"center",...e})}),_P=S.forwardRef(function(e,n){const{align:r="center",gap:o=2,wrap:s=!0,...i}=e;return l.jsx(An,{ref:n,display:"flex",direction:"row",align:r,gap:o,wrap:s,...i})}),OP={display:"h1",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",small:"small",caption:"span",code:"code",kbd:"kbd"},$P=S.forwardRef(function({as:e,variant:n="body",weight:r,align:o,color:s,truncate:i=!1,className:a,style:c,sx:u,children:d,...f},h){const m=e??OP[n],{className:g,style:y,styleTag:v}=oe(u,c,"cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",a);return S.createElement(m,{ref:h,className:g,style:y,...f},v,d)});function LP({label:t,hint:e,error:n,required:r=!1,optional:o=!1,counter:s,maxLength:i,state:a,className:c,style:u,sx:d,children:f,...h}){const m=S.useId(),g=S.Children.only(f),y=g.props.id??m,v=n!=null&&n!==!1,x=a??(v?"danger":"default"),w=e||n?`${y}-hint`:void 0,b=S.cloneElement(g,{id:y,"aria-invalid":v||g.props["aria-invalid"]||void 0,"aria-describedby":w??g.props["aria-describedby"],className:z(g.props.className,x!=="default"&&x)}),C=i!=null&&s!=null&&s>i?"danger":"default",{className:P,style:R,styleTag:M}=oe(d,u,"cny-field",c);return l.jsxs("div",{className:P,style:R,...h,children:[M,(t!=null||s!=null)&&l.jsxs("div",{className:"cny-field-label-row",children:[t!=null?l.jsxs("label",{htmlFor:y,className:"cny-field-label",children:[t,r&&l.jsx("span",{className:"cny-field-required","aria-hidden":"true",children:"*"}),o&&!r&&l.jsx("span",{className:"cny-field-optional",children:"optional"})]}):l.jsx("span",{}),s!=null&&l.jsx("span",{className:z("cny-field-counter",C==="danger"&&"danger"),"aria-live":"polite",children:i!=null?`${s}/${i}`:s})]}),b,(n||e)&&l.jsx("span",{id:w,className:z("cny-field-hint",x!=="default"&&x),children:n??e})]})}const FP=S.forwardRef(function({color:e="primary",size:n,autoGrow:r=!1,maxRows:o=12,className:s,style:i,sx:a,onChange:c,...u},d){const f=S.useRef(null);S.useImperativeHandle(d,()=>f.current,[]);const h=S.useCallback(()=>{const x=f.current;if(!x||!r)return;x.style.height="auto";const b=parseFloat(getComputedStyle(x).lineHeight||"20")*o;x.style.height=`${Math.min(x.scrollHeight,b)}px`,x.style.overflowY=x.scrollHeight>b?"auto":"hidden"},[r,o]);S.useEffect(()=>{h()},[h,u.value,u.defaultValue]);const m=x=>{c==null||c(x),r&&h()},{className:g,style:y,styleTag:v}=oe(a,i,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",s);return l.jsxs(l.Fragment,{children:[v,l.jsx("textarea",{ref:f,className:g,style:y,onChange:m,...u})]})});var VP=Object.defineProperty,BP=(t,e)=>VP(t,"name",{value:e,configurable:!0});function jr(t,[e,n]){return Math.min(n,Math.max(e,t))}BP(jr,"clamp");var GP=Object.defineProperty,ke=(t,e)=>GP(t,"name",{value:e,configurable:!0}),ca="dismissableLayer.update",zP="dismissableLayer.pointerDownOutside",UP="dismissableLayer.focusOutside",sd,jp=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),zr=p.forwardRef(ke(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...d}=e,f=p.useContext(jp),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=p.useState({}),v=ae(n,m),x=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=w?x.indexOf(w):-1,C=h?x.indexOf(h):-1,P=f.layersWithOutsidePointerEventsDisabled.size>0,R=C>=b,M=p.useRef(!1),A=Dp(_=>{i==null||i(_),c==null||c(_),_.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(_=>{if(!(_ instanceof Node))return!1;const $=[...f.branches].some(V=>V.contains(_));return R&&!$},[f.branches,R])}),T=Ip(_=>{if(o&&M.current)return;const $=_.target;[...f.branches].some(q=>q.contains($))||(a==null||a(_),c==null||c(_),_.defaultPrevented||u==null||u())},g),E=h?C===x.length-1:!1,N=Ze(_=>{_.key==="Escape"&&(s==null||s(_),!_.defaultPrevented&&u&&(_.preventDefault(),u()))});return p.useEffect(()=>{if(E)return g.addEventListener("keydown",N,{capture:!0}),()=>g.removeEventListener("keydown",N,{capture:!0})},[g,E,N]),p.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(sd=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),la(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=sd))}},[h,g,r,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),la())},[h,f]),p.useEffect(()=>{const _=ke(()=>y({}),"handleUpdate");return document.addEventListener(ca,_),()=>document.removeEventListener(ca,_)},[]),l.jsx(ne.div,{...d,ref:v,style:{pointerEvents:P?R?"auto":"none":void 0,...e.style},onFocusCapture:U(e.onFocusCapture,T.onFocusCapture),onBlurCapture:U(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function Ap(){const t=p.useContext(jp),[e,n]=p.useState(null);return p.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}ke(Ap,"useDismissableLayerSurface");var HP=ke(()=>!0,"IS_TRUE");function Dp(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=HP}=e,a=Ze(t),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,o.current=!1,d.current.clear()}ke(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}ke(m,"isOutsideInteractionIntercepted");function g(b){if(!u.current)return;const C=b.target;C instanceof Node&&[...s].some(R=>R.contains(C))||d.current.set(b.type,!0),b.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}ke(g,"handleInteractionCapture");function y(b){u.current&&d.current.set(b.type,!1)}ke(y,"handleInteractionBubble");const v=ke(b=>{if(b.target&&!c.current){let C=function(){n.removeEventListener("click",f.current);const R=m();h(),R||mc(zP,a,P,{discrete:!0})};if(ke(C,"handleAndDispatchPointerDownOutsideEvent"),!i(b.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const P={originalEvent:b};u.current=!0,o.current=r&&b.button===0,d.current.clear(),!r||b.button!==0?C():(n.removeEventListener("click",f.current),f.current=C,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const b of x)n.addEventListener(b,g,!0),n.addEventListener(b,y);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const b of x)n.removeEventListener(b,g,!0),n.removeEventListener(b,y)}},[n,a,r,o,s,i]),{onPointerDownCapture:ke(()=>c.current=!0,"onPointerDownCapture")}}ke(Dp,"usePointerDownOutside");function Ip(t,e=globalThis==null?void 0:globalThis.document){const n=Ze(t),r=p.useRef(!1);return p.useEffect(()=>{const o=ke(s=>{s.target&&!r.current&&mc(UP,n,{originalEvent:s},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:ke(()=>r.current=!0,"onFocusCapture"),onBlurCapture:ke(()=>r.current=!1,"onBlurCapture")}}ke(Ip,"useFocusOutside");function la(){const t=new CustomEvent(ca);document.dispatchEvent(t)}ke(la,"dispatchUpdate");function mc(t,e,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?dc(o,s):o.dispatchEvent(s)}ke(mc,"handleAndDispatchCustomEvent");var WP=Object.defineProperty,gc=(t,e)=>WP(t,"name",{value:e,configurable:!0}),go=0,Pt=null;function KP(t){return lr(),t.children}gc(KP,"FocusGuards");function lr(){p.useEffect(()=>{Pt||(Pt={start:ua(),end:ua()});const{start:t,end:e}=Pt;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),go++,()=>{go===1&&(Pt==null||Pt.start.remove(),Pt==null||Pt.end.remove(),Pt=null),go=Math.max(0,go-1)}},[])}gc(lr,"useFocusGuards");function ua(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}gc(ua,"createFocusGuard");var YP=Object.defineProperty,Ke=(t,e)=>YP(t,"name",{value:e,configurable:!0}),fi="focusScope.autoFocusOnMount",hi="focusScope.autoFocusOnUnmount",id={bubbles:!1,cancelable:!0},fs=p.forwardRef(Ke(function(e,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[c,u]=p.useState(null),d=Ze(s),f=Ze(i),h=p.useRef(null),m=ae(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(o){let v=function(C){if(g.paused||!c)return;const P=C.target;c.contains(P)?h.current=P:$t(h.current,{select:!0})},x=function(C){if(g.paused||!c)return;const P=C.relatedTarget;P!==null&&(c.contains(P)||$t(h.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&$t(c)};Ke(v,"handleFocusIn"),Ke(x,"handleFocusOut"),Ke(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",x);const b=new MutationObserver(w);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),b.disconnect()}}},[o,c,g.paused]),p.useEffect(()=>{if(c){ad.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(fi,id);c.addEventListener(fi,d),c.dispatchEvent(w),w.defaultPrevented||(kp(Lp(yc(c)),{select:!0}),document.activeElement===v&&$t(c))}return()=>{c.removeEventListener(fi,d),setTimeout(()=>{const w=new CustomEvent(hi,id);c.addEventListener(hi,f),c.dispatchEvent(w),w.defaultPrevented||$t(v??document.body,{select:!0}),c.removeEventListener(hi,f),ad.remove(g)},0)}}},[c,d,f,g]);const y=p.useCallback(v=>{if(!r&&!o||g.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(x&&w){const b=v.currentTarget,[C,P]=Np(b);C&&P?!v.shiftKey&&w===P?(v.preventDefault(),r&&$t(C,{select:!0})):v.shiftKey&&w===C&&(v.preventDefault(),r&&$t(P,{select:!0})):w===b&&v.preventDefault()}},[r,o,g.paused]);return l.jsx(ne.div,{tabIndex:-1,...a,ref:m,onKeyDown:y})},"FocusScope"));function kp(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if($t(r,{select:e}),document.activeElement!==n)return}Ke(kp,"focusFirst");function Np(t){const e=yc(t),n=da(e,t),r=da(e.reverse(),t);return[n,r]}Ke(Np,"getTabbableEdges");function yc(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Ke(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}Ke(yc,"getTabbableCandidates");function da(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):_p(r,{upTo:e})))return r}Ke(da,"findVisible");function _p(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}Ke(_p,"isHidden");function Op(t){return t instanceof HTMLInputElement&&"select"in t}Ke(Op,"isSelectableInput");function $t(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Op(t)&&e&&t.select()}}Ke($t,"focus");var ad=$p();function $p(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=fa(t,e),t.unshift(e)},remove(e){var n;t=fa(t,e),(n=t[0])==null||n.resume()}}}Ke($p,"createFocusScopesStack");function fa(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Ke(fa,"arrayRemove");function Lp(t){return t.filter(e=>e.tagName!=="A")}Ke(Lp,"removeLinks");const XP=["top","right","bottom","left"],rn=Math.min,st=Math.max,Jo=Math.round,yo=Math.floor,It=t=>({x:t,y:t}),qP={left:"right",right:"left",bottom:"top",top:"bottom"};function ha(t,e,n){return st(t,rn(e,n))}function Bt(t,e){return typeof t=="function"?t(e):t}function Gt(t){return t.split("-")[0]}function ur(t){return t.split("-")[1]}function vc(t){return t==="x"?"y":"x"}function xc(t){return t==="y"?"height":"width"}function At(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function bc(t){return vc(At(t))}function ZP(t,e,n){n===void 0&&(n=!1);const r=ur(t),o=bc(t),s=xc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=es(i)),[i,es(i)]}function QP(t){const e=es(t);return[pa(t),e,pa(e)]}function pa(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const cd=["left","right"],ld=["right","left"],JP=["top","bottom"],eR=["bottom","top"];function tR(t,e,n){switch(t){case"top":case"bottom":return n?e?ld:cd:e?cd:ld;case"left":case"right":return e?JP:eR;default:return[]}}function nR(t,e,n,r){const o=ur(t);let s=tR(Gt(t),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),e&&(s=s.concat(s.map(pa)))),s}function es(t){const e=Gt(t);return qP[e]+t.slice(e.length)}function rR(t){return{top:0,right:0,bottom:0,left:0,...t}}function Fp(t){return typeof t!="number"?rR(t):{top:t,right:t,bottom:t,left:t}}function ts(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function ud(t,e,n){let{reference:r,floating:o}=t;const s=At(e),i=bc(e),a=xc(i),c=Gt(e),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(ur(e)){case"start":m[i]-=h*(n&&u?-1:1);break;case"end":m[i]+=h*(n&&u?-1:1);break}return m}async function oR(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Bt(e,t),g=Fp(m),v=a[h?f==="floating"?"reference":"floating":f],x=ts(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},P=ts(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:c}):w);return{top:(x.top-P.top+g.top)/C.y,bottom:(P.bottom-x.bottom+g.bottom)/C.y,left:(x.left-P.left+g.left)/C.x,right:(P.right-x.right+g.right)/C.x}}const sR=50,iR=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:oR},c=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:f}=ud(u,r,c),h=r,m=0;const g={};for(let y=0;y<s.length;y++){const v=s[y];if(!v)continue;const{name:x,fn:w}=v,{x:b,y:C,data:P,reset:R}=await w({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:u,platform:a,elements:{reference:t,floating:e}});d=b??d,f=C??f,g[x]={...g[x],...P},R&&m<sR&&(m++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(u=R.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:o}):R.rects),{x:d,y:f}=ud(u,h,c)),y=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:g}},aR=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=e,{element:u,padding:d=0}=Bt(t,e)||{};if(u==null)return{};const f=Fp(d),h={x:n,y:r},m=bc(o),g=xc(m),y=await i.getDimensions(u),v=m==="y",x=v?"top":"left",w=v?"bottom":"right",b=v?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[m]-h[m]-s.floating[g],P=h[m]-s.reference[m],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let M=R?R[b]:0;(!M||!await(i.isElement==null?void 0:i.isElement(R)))&&(M=a.floating[b]||s.floating[g]);const A=C/2-P/2,T=M/2-y[g]/2-1,E=rn(f[x],T),N=rn(f[w],T),_=E,$=M-y[g]-N,V=M/2-y[g]/2+A,q=ha(_,V,$),W=!c.arrow&&ur(o)!=null&&V!==q&&s.reference[g]/2-(V<_?E:N)-y[g]/2<0,I=W?V<_?V-_:V-$:0;return{[m]:h[m]+I,data:{[m]:q,centerOffset:V-q-I,...W&&{alignmentOffset:I}},reset:W}}}),cR=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...v}=Bt(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=Gt(o),w=At(a),b=Gt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),P=h||(b||!y?[es(a)]:QP(a)),R=g!=="none";!h&&R&&P.push(...nR(a,y,g,C));const M=[a,...P],A=await c.detectOverflow(e,v),T=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&T.push(A[x]),f){const V=ZP(o,i,C);T.push(A[V[0]],A[V[1]])}if(E=[...E,{placement:o,overflows:T}],!T.every(V=>V<=0)){var N,_;const V=(((N=s.flip)==null?void 0:N.index)||0)+1,q=M[V];if(q&&(!(f==="alignment"?w!==At(q):!1)||E.every(L=>At(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:V,overflows:E},reset:{placement:q}};let W=(_=E.filter(I=>I.overflows[0]<=0).sort((I,L)=>I.overflows[1]-L.overflows[1])[0])==null?void 0:_.placement;if(!W)switch(m){case"bestFit":{var $;const I=($=E.filter(L=>{if(R){const O=At(L.placement);return O===w||O==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(O=>O>0).reduce((O,D)=>O+D,0)]).sort((L,O)=>L[1]-O[1])[0])==null?void 0:$[0];I&&(W=I);break}case"initialPlacement":W=a;break}if(o!==W)return{reset:{placement:W}}}return{}}}};function dd(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function fd(t){return XP.some(e=>t[e]>=0)}const lR=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...s}=Bt(t,e);switch(o){case"referenceHidden":{const i=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=dd(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:fd(a)}}}case"escaped":{const i=await r.detectOverflow(e,{...s,altBoundary:!0}),a=dd(i,n.floating);return{data:{escapedOffsets:a,escaped:fd(a)}}}default:return{}}}}},Vp=new Set(["left","top"]);async function uR(t,e){const{placement:n,platform:r,elements:o}=t,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Gt(n),a=ur(n),c=At(n)==="y",u=Vp.has(i)?-1:1,d=s&&c?-1:1,f=Bt(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const dR=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=e,c=await uR(e,t);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},fR=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:s}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:w,y:b}=x;return{x:w,y:b}}},...u}=Bt(t,e),d={x:n,y:r},f=await s.detectOverflow(e,u),h=At(Gt(o)),m=vc(h);let g=d[m],y=d[h];if(i){const x=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=g+f[x],C=g-f[w];g=ha(b,g,C)}if(a){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=y+f[x],C=y-f[w];y=ha(b,y,C)}const v=c.fn({...e,[m]:g,[h]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:i,[h]:a}}}}}},hR=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=e,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Bt(t,e),d={x:n,y:r},f=At(o),h=vc(f);let m=d[h],g=d[f];const y=Bt(a,e),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const b=h==="y"?"height":"width",C=s.reference[h]-s.floating[b]+v.mainAxis,P=s.reference[h]+s.reference[b]-v.mainAxis;m<C?m=C:m>P&&(m=P)}if(u){var x,w;const b=h==="y"?"width":"height",C=Vp.has(Gt(o)),P=s.reference[f]-s.floating[b]+(C&&((x=i.offset)==null?void 0:x[f])||0)+(C?0:v.crossAxis),R=s.reference[f]+s.reference[b]+(C?0:((w=i.offset)==null?void 0:w[f])||0)-(C?v.crossAxis:0);g<P?g=P:g>R&&(g=R)}return{[h]:m,[f]:g}}}},pR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:s,platform:i,elements:a}=e,{apply:c=()=>{},...u}=Bt(t,e),d=await i.detectOverflow(e,u),f=Gt(o),h=ur(o),m=At(o)==="y",{width:g,height:y}=s.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,v=h==="end"?"top":"bottom");const w=y-d.top-d.bottom,b=g-d.left-d.right,C=rn(y-d[v],w),P=rn(g-d[x],b),R=!e.middlewareData.shift;let M=C,A=P;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(A=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=w),R&&!h){const E=st(d.left,0),N=st(d.right,0),_=st(d.top,0),$=st(d.bottom,0);m?A=g-2*(E!==0||N!==0?E+N:st(d.left,d.right)):M=y-2*(_!==0||$!==0?_+$:st(d.top,d.bottom))}await c({...e,availableWidth:A,availableHeight:M});const T=await i.getDimensions(a.floating);return g!==T.width||y!==T.height?{reset:{rects:!0}}:{}}}};function hs(){return typeof window<"u"}function dr(t){return Bp(t)?(t.nodeName||"").toLowerCase():"#document"}function it(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Nt(t){var e;return(e=(Bp(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Bp(t){return hs()?t instanceof Node||t instanceof it(t).Node:!1}function vt(t){return hs()?t instanceof Element||t instanceof it(t).Element:!1}function Kt(t){return hs()?t instanceof HTMLElement||t instanceof it(t).HTMLElement:!1}function hd(t){return!hs()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof it(t).ShadowRoot}function Ur(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=xt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function mR(t){return/^(table|td|th)$/.test(dr(t))}function ps(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const gR=/transform|translate|scale|rotate|perspective|filter/,yR=/paint|layout|strict|content/,xn=t=>!!t&&t!=="none";let pi;function wc(t){const e=vt(t)?xt(t):t;return xn(e.transform)||xn(e.translate)||xn(e.scale)||xn(e.rotate)||xn(e.perspective)||!Cc()&&(xn(e.backdropFilter)||xn(e.filter))||gR.test(e.willChange||"")||yR.test(e.contain||"")}function vR(t){let e=on(t);for(;Kt(e)&&!Qn(e);){if(wc(e))return e;if(ps(e))return null;e=on(e)}return null}function Cc(){return pi==null&&(pi=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pi}function Qn(t){return/^(html|body|#document)$/.test(dr(t))}function xt(t){return it(t).getComputedStyle(t)}function ms(t){return vt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function on(t){if(dr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||hd(t)&&t.host||Nt(t);return hd(e)?e.host:e}function Gp(t){const e=on(t);return Qn(e)?t.ownerDocument?t.ownerDocument.body:t.body:Kt(e)&&Ur(e)?e:Gp(e)}function Ar(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=Gp(t),s=o===((r=t.ownerDocument)==null?void 0:r.body),i=it(o);if(s){const a=ma(i);return e.concat(i,i.visualViewport||[],Ur(o)?o:[],a&&n?Ar(a):[])}else return e.concat(o,Ar(o,[],n))}function ma(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function zp(t){const e=xt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Kt(t),s=o?t.offsetWidth:n,i=o?t.offsetHeight:r,a=Jo(n)!==s||Jo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Sc(t){return vt(t)?t:t.contextElement}function Kn(t){const e=Sc(t);if(!Kt(e))return It(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:s}=zp(e);let i=(s?Jo(n.width):n.width)/r,a=(s?Jo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const xR=It(0);function Up(t){const e=it(t);return!Cc()||!e.visualViewport?xR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function bR(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==it(t)?!1:e}function Tn(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=Sc(t);let i=It(1);e&&(r?vt(r)&&(i=Kn(r)):i=Kn(t));const a=bR(s,n,r)?Up(s):It(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const h=it(s),m=r&&vt(r)?it(r):r;let g=h,y=ma(g);for(;y&&r&&m!==g;){const v=Kn(y),x=y.getBoundingClientRect(),w=xt(y),b=x.left+(y.clientLeft+parseFloat(w.paddingLeft))*v.x,C=x.top+(y.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=b,u+=C,g=it(y),y=ma(g)}}return ts({width:d,height:f,x:c,y:u})}function gs(t,e){const n=ms(t).scrollLeft;return e?e.left+n:Tn(Nt(t)).left+n}function Hp(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-gs(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function wR(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const s=o==="fixed",i=Nt(r),a=e?ps(e.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=It(1);const d=It(0),f=Kt(r);if((f||!f&&!s)&&((dr(r)!=="body"||Ur(i))&&(c=ms(r)),f)){const m=Tn(r);u=Kn(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=i&&!f&&!s?Hp(i,c):It(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function CR(t){return Array.from(t.getClientRects())}function SR(t){const e=Nt(t),n=ms(t),r=t.ownerDocument.body,o=st(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=st(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+gs(t);const a=-n.scrollTop;return xt(r).direction==="rtl"&&(i+=st(e.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const pd=25;function PR(t,e){const n=it(t),r=Nt(t),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=Cc();(!d||d&&e==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=gs(r);if(u<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=pd&&(s-=g)}else u<=pd&&(s+=u);return{width:s,height:i,x:a,y:c}}function RR(t,e){const n=Tn(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,s=Kt(t)?Kn(t):It(1),i=t.clientWidth*s.x,a=t.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function md(t,e,n){let r;if(e==="viewport")r=PR(t,n);else if(e==="document")r=SR(Nt(t));else if(vt(e))r=RR(e,n);else{const o=Up(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return ts(r)}function Wp(t,e){const n=on(t);return n===e||!vt(n)||Qn(n)?!1:xt(n).position==="fixed"||Wp(n,e)}function TR(t,e){const n=e.get(t);if(n)return n;let r=Ar(t,[],!1).filter(a=>vt(a)&&dr(a)!=="body"),o=null;const s=xt(t).position==="fixed";let i=s?on(t):t;for(;vt(i)&&!Qn(i);){const a=xt(i),c=wc(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ur(i)&&!c&&Wp(t,i))?r=r.filter(d=>d!==i):o=a,i=on(i)}return e.set(t,r),r}function MR(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[...n==="clippingAncestors"?ps(e)?[]:TR(e,this._c):[].concat(n),r],a=md(e,i[0],o);let c=a.top,u=a.right,d=a.bottom,f=a.left;for(let h=1;h<i.length;h++){const m=md(e,i[h],o);c=st(m.top,c),u=rn(m.right,u),d=rn(m.bottom,d),f=st(m.left,f)}return{width:u-f,height:d-c,x:f,y:c}}function ER(t){const{width:e,height:n}=zp(t);return{width:e,height:n}}function jR(t,e,n){const r=Kt(e),o=Nt(e),s=n==="fixed",i=Tn(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=It(0);function u(){c.x=gs(o)}if(r||!r&&!s)if((dr(e)!=="body"||Ur(o))&&(a=ms(e)),r){const m=Tn(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Hp(o,a):It(0),f=i.left+a.scrollLeft-c.x-d.x,h=i.top+a.scrollTop-c.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function mi(t){return xt(t).position==="static"}function gd(t,e){if(!Kt(t)||xt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Nt(t)===n&&(n=n.ownerDocument.body),n}function Kp(t,e){const n=it(t);if(ps(t))return n;if(!Kt(t)){let o=on(t);for(;o&&!Qn(o);){if(vt(o)&&!mi(o))return o;o=on(o)}return n}let r=gd(t,e);for(;r&&mR(r)&&mi(r);)r=gd(r,e);return r&&Qn(r)&&mi(r)&&!wc(r)?n:r||vR(t)||n}const AR=async function(t){const e=this.getOffsetParent||Kp,n=this.getDimensions,r=await n(t.floating);return{reference:jR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function DR(t){return xt(t).direction==="rtl"}const IR={convertOffsetParentRelativeRectToViewportRelativeRect:wR,getDocumentElement:Nt,getClippingRect:MR,getOffsetParent:Kp,getElementRects:AR,getClientRects:CR,getDimensions:ER,getScale:Kn,isElement:vt,isRTL:DR};function Yp(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function kR(t,e){let n=null,r;const o=Nt(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=t.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=u;if(a||e(),!h||!m)return;const g=yo(f),y=yo(o.clientWidth-(d+h)),v=yo(o.clientHeight-(f+m)),x=yo(d),b={rootMargin:-g+"px "+-y+"px "+-v+"px "+-x+"px",threshold:st(0,rn(1,c))||1};let C=!0;function P(R){const M=R[0].intersectionRatio;if(M!==c){if(!C)return i();M?i(!1,M):r=setTimeout(()=>{i(!1,1e-7)},1e3)}M===1&&!Yp(u,t.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(P,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,b)}n.observe(t)}return i(!0),s}function NR(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Sc(t),d=o||s?[...u?Ar(u):[],...e?Ar(e):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=u&&a?kR(u,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&m&&e&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(e)})),n()}),u&&!c&&m.observe(u),e&&m.observe(e));let g,y=c?Tn(t):null;c&&v();function v(){const x=Tn(t);y&&!Yp(y,x)&&n(),y=x,g=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const _R=dR,OR=fR,$R=cR,LR=pR,FR=lR,yd=aR,VR=hR,BR=(t,e,n)=>{const r=new Map,o={platform:IR,...n},s={...o.platform,_c:r};return iR(t,e,{...o,platform:s})};var GR=typeof document<"u",zR=function(){},Vo=GR?S.useLayoutEffect:zR;function ns(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!ns(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&t.$$typeof)&&!ns(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function Xp(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function vd(t,e){const n=Xp(t);return Math.round(e*n)/n}function gi(t){const e=p.useRef(t);return Vo(()=>{e.current=t}),e}function UR(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=t,[d,f]=p.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);ns(h,r)||m(r);const[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useCallback(L=>{L!==R.current&&(R.current=L,y(L))},[]),b=p.useCallback(L=>{L!==M.current&&(M.current=L,x(L))},[]),C=s||g,P=i||v,R=p.useRef(null),M=p.useRef(null),A=p.useRef(d),T=c!=null,E=gi(c),N=gi(o),_=gi(u),$=p.useCallback(()=>{if(!R.current||!M.current)return;const L={placement:e,strategy:n,middleware:h};N.current&&(L.platform=N.current),BR(R.current,M.current,L).then(O=>{const D={...O,isPositioned:_.current!==!1};V.current&&!ns(A.current,D)&&(A.current=D,Or.flushSync(()=>{f(D)}))})},[h,e,n,N,_]);Vo(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const V=p.useRef(!1);Vo(()=>(V.current=!0,()=>{V.current=!1}),[]),Vo(()=>{if(C&&(R.current=C),P&&(M.current=P),C&&P){if(E.current)return E.current(C,P,$);$()}},[C,P,$,E,T]);const q=p.useMemo(()=>({reference:R,floating:M,setReference:w,setFloating:b}),[w,b]),W=p.useMemo(()=>({reference:C,floating:P}),[C,P]),I=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!W.floating)return L;const O=vd(W.floating,d.x),D=vd(W.floating,d.y);return a?{...L,transform:"translate("+O+"px, "+D+"px)",...Xp(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:D}},[n,a,W.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:$,refs:q,elements:W,floatingStyles:I}),[d,$,q,W,I])}const HR=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?yd({element:r.current,padding:o}).fn(n):{}:r?yd({element:r,padding:o}).fn(n):{}}}},WR=(t,e)=>{const n=_R(t);return{name:n.name,fn:n.fn,options:[t,e]}},KR=(t,e)=>{const n=OR(t);return{name:n.name,fn:n.fn,options:[t,e]}},YR=(t,e)=>({fn:VR(t).fn,options:[t,e]}),XR=(t,e)=>{const n=$R(t);return{name:n.name,fn:n.fn,options:[t,e]}},qR=(t,e)=>{const n=LR(t);return{name:n.name,fn:n.fn,options:[t,e]}},ZR=(t,e)=>{const n=FR(t);return{name:n.name,fn:n.fn,options:[t,e]}},QR=(t,e)=>{const n=HR(t);return{name:n.name,fn:n.fn,options:[t,e]}};var JR=Object.defineProperty,eT=(t,e)=>JR(t,"name",{value:e,configurable:!0}),tT=p.forwardRef(eT(function(e,n){const{children:r,width:o=10,height:s=5,...i}=e;return l.jsx(ne.svg,{...i,ref:n,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),nT=tT,rT=Object.defineProperty,oT=(t,e)=>rT(t,"name",{value:e,configurable:!0});function fr(t){const[e,n]=p.useState(void 0);return Ee(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=t.offsetWidth,a=t.offsetHeight;n({width:i,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}oT(fr,"useSize");var sT=Object.defineProperty,Lt=(t,e)=>sT(t,"name",{value:e,configurable:!0}),qp="Popper",[Zp,un]=Pe(qp),[iT,Qp]=Zp(qp),aT=Lt(t=>{const{__scopePopper:e,children:n}=t,[r,o]=p.useState(null),[s,i]=p.useState(void 0);return l.jsx(iT,{scope:e,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),cT="PopperAnchor",lT=p.forwardRef(Lt(function(e,n){const{__scopePopper:r,virtualRef:o,...s}=e,i=Qp(cT,r),a=p.useRef(null),c=i.onAnchorChange,u=p.useCallback(y=>{a.current=y,y&&c(y)},[c]),d=ae(n,u),f=p.useRef(null);p.useEffect(()=>{if(!o)return;const y=f.current;f.current=o.current,y!==f.current&&c(f.current)});const h=i.placementState&&ys(i.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return o?null:l.jsx(ne.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),Jp="PopperContent",[uT,dT]=Zp(Jp),fT=p.forwardRef(Lt(function(e,n){var K,ee,ue,X,F,G,le;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,x=Qp(Jp,r),[w,b]=p.useState(null),C=ae(n,b),[P,R]=p.useState(null),M=fr(P),A=(M==null?void 0:M.width)??0,T=(M==null?void 0:M.height)??0,E=o+(i!=="center"?"-"+i:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(d)?d:[d],$=_.length>0,V={padding:N,boundary:_.filter(em),altBoundary:$},{refs:q,floatingStyles:W,placement:I,isPositioned:L,middlewareData:O}=UR({strategy:"fixed",placement:E,whileElementsMounted:Lt((...ie)=>NR(...ie,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[WR({mainAxis:s+T,alignmentAxis:a}),u&&KR({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?YR():void 0,...V}),u&&XR({...V}),qR({...V,apply:Lt(({elements:ie,rects:_e,availableWidth:ge,availableHeight:tt})=>{const{width:mn,height:pe}=_e.reference,be=ie.floating.style;be.setProperty("--radix-popper-available-width",`${ge}px`),be.setProperty("--radix-popper-available-height",`${tt}px`),be.setProperty("--radix-popper-anchor-width",`${mn}px`),be.setProperty("--radix-popper-anchor-height",`${pe}px`)},"apply")}),P&&QR({element:P,padding:c}),gT({arrowWidth:A,arrowHeight:T}),m&&ZR({strategy:"referenceHidden",...V,boundary:$?V.boundary:void 0})]}),D=x.setPlacementState;Ee(()=>(D(I),()=>{D(void 0)}),[I,D]);const[Y,j]=ys(I),B=Ze(y);Ee(()=>{L&&(B==null||B())},[L,B]);const Z=(K=O.arrow)==null?void 0:K.x,H=(ee=O.arrow)==null?void 0:ee.y,se=((ue=O.arrow)==null?void 0:ue.centerOffset)!==0,[ce,J]=p.useState();return Ee(()=>{w&&J(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:L?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(X=O.transformOrigin)==null?void 0:X.x,(F=O.transformOrigin)==null?void 0:F.y].join(" "),...((G=O.hide)==null?void 0:G.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(uT,{scope:r,placedSide:Y,placedAlign:j,onArrowChange:R,arrowX:Z,arrowY:H,shouldHideArrow:se,children:l.jsx(ne.div,{"data-side":Y,"data-align":j,...v,ref:C,style:{...v.style,animation:L?(le=v.style)==null?void 0:le.animation:"none"}})})})},"PopperContent")),hT="PopperArrow",pT={top:"bottom",right:"left",bottom:"top",left:"right"},mT=p.forwardRef(Lt(function(e,n){const{__scopePopper:r,...o}=e,s=dT(hT,r),i=pT[s.placedSide];return l.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:l.jsx(nT,{...o,ref:n,style:{...o.style,display:"block"}})})},"PopperArrow"));function em(t){return t!==null}Lt(em,"isNotNull");var gT=Lt(t=>({name:"transformOrigin",options:t,fn(e){var v,x,w;const{placement:n,rects:r,middlewareData:o}=e,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:t.arrowWidth,c=i?0:t.arrowHeight,[u,d]=ys(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,m=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let g="",y="";return u==="bottom"?(g=i?f:`${h}px`,y=`${-c}px`):u==="top"?(g=i?f:`${h}px`,y=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,y=i?f:`${m}px`):u==="left"&&(g=`${r.floating.width+c}px`,y=i?f:`${m}px`),{data:{x:g,y}}}}),"transformOrigin");function ys(t){const[e,n="center"]=t.split("-");return[e,n]}Lt(ys,"getSideAndAlignFromPlacement");var Hr=aT,Wr=lT,vs=fT,tm=mT,yT=Object.defineProperty,vT=(t,e)=>yT(t,"name",{value:e,configurable:!0}),Kr=p.forwardRef(vT(function(e,n){var c;const{container:r,...o}=e,[s,i]=p.useState(!1);Ee(()=>i(!0),[]);const a=r||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Or.createPortal(l.jsx(ne.div,{...o,ref:n}),a):null},"Portal")),xT=Object.defineProperty,zt=(t,e)=>xT(t,"name",{value:e,configurable:!0});function nm(t,e){return p.useReducer((n,r)=>e[n][r]??n,t)}zt(nm,"useStateMachine");var ze=zt(t=>{const{present:e,children:n}=t,r=rm(e),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=om(r.ref,sm(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null},"Presence");function rm(t){const[e,n]=p.useState(),r=p.useRef(null),o=p.useRef(t),s=p.useRef("none"),i=p.useRef(void 0),a=t?"mounted":"unmounted",[c,u]=nm(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=i.current??Vn(r.current),i.current=void 0):s.current="none"},[c]),Ee(()=>{const d=r.current,f=o.current;if(f!==t){const m=s.current,g=Vn(d);t?(i.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,u]),Ee(()=>{if(e){let d;const f=e.ownerDocument.defaultView??window,h=zt(g=>{const v=Vn(r.current).includes(CSS.escape(g.animationName));if(g.target===e&&v&&(u("ANIMATION_END"),!o.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",d=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},"handleAnimationEnd"),m=zt(g=>{g.target===e&&(s.current=Vn(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(d),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);r.current=f,i.current=Vn(f)}else r.current=null;n(d)},[])}}zt(rm,"usePresence");function ga(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}zt(ga,"setRef");function om(...t){const e=p.useRef(t);return e.current=t,p.useCallback(n=>{const r=e.current;let o=!1;const s=r.map(i=>{const a=ga(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():ga(r[i],null)}}},[])}zt(om,"useStableComposedRefs");function Vn(t){return(t==null?void 0:t.animationName)||"none"}zt(Vn,"getAnimationName");function sm(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}zt(sm,"getElementRef");var bT=Object.defineProperty,wT=(t,e)=>bT(t,"name",{value:e,configurable:!0});function Pc(t){const e=p.useRef({value:t,previous:t});return p.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}wT(Pc,"usePrevious");var CT=Object.defineProperty,ST=(t,e)=>CT(t,"name",{value:e,configurable:!0}),im=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"}),am=p.forwardRef(ST(function(e,n){return l.jsx(ne.span,{...e,ref:n,style:{...im,...e.style}})},"VisuallyHidden")),PT=am,RT=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},On=new WeakMap,vo=new WeakMap,xo={},yi=0,cm=function(t){return t&&(t.host||cm(t.parentNode))},TT=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=cm(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},MT=function(t,e,n,r){var o=TT(e,Array.isArray(t)?t:[t]);xo[n]||(xo[n]=new WeakMap);var s=xo[n],i=[],a=new Set,c=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var m=h.getAttribute(r),g=m!==null&&m!=="false",y=(On.get(h)||0)+1,v=(s.get(h)||0)+1;On.set(h,y),s.set(h,v),i.push(h),y===1&&g&&vo.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(e),a.clear(),yi++,function(){i.forEach(function(f){var h=On.get(f)-1,m=s.get(f)-1;On.set(f,h),s.set(f,m),h||(vo.has(f)||f.removeAttribute(r),vo.delete(f)),m||f.removeAttribute(n)}),yi--,yi||(On=new WeakMap,On=new WeakMap,vo=new WeakMap,xo={})}},xs=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=RT(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),MT(r,o,n,"aria-hidden")):function(){return null}},jt=function(){return jt=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},jt.apply(this,arguments)};function lm(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function ET(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,s;r<o;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Bo="right-scroll-bar-position",Go="width-before-scroll-bar",jT="with-scroll-bars-hidden",AT="--removed-body-scroll-bar-size";function vi(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function DT(t,e){var n=S.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var IT=typeof window<"u"?p.useLayoutEffect:p.useEffect,xd=new WeakMap;function kT(t,e){var n=DT(null,function(r){return t.forEach(function(o){return vi(o,r)})});return IT(function(){var r=xd.get(n);if(r){var o=new Set(r),s=new Set(t),i=n.current;o.forEach(function(a){s.has(a)||vi(a,null)}),s.forEach(function(a){o.has(a)||vi(a,i)})}xd.set(n,t)},[t]),n}function NT(t){return t}function _T(t,e){e===void 0&&(e=NT);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var i=e(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function OT(t){t===void 0&&(t={});var e=_T(null);return e.options=jt({async:!0,ssr:!1},t),e}var um=function(t){var e=t.sideCar,n=lm(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,jt({},n))};um.isSideCarExport=!0;function $T(t,e){return t.useMedium(e),um}var dm=OT(),xi=function(){},bs=p.forwardRef(function(t,e){var n=p.useRef(null),r=p.useState({onScrollCapture:xi,onWheelCapture:xi,onTouchMoveCapture:xi}),o=r[0],s=r[1],i=t.forwardProps,a=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,h=t.sideCar,m=t.noRelative,g=t.noIsolation,y=t.inert,v=t.allowPinchZoom,x=t.as,w=x===void 0?"div":x,b=t.gapMode,C=lm(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=h,R=kT([n,e]),M=jt(jt({},C),o);return p.createElement(p.Fragment,null,d&&p.createElement(P,{sideCar:dm,removeScrollBar:u,shards:f,noRelative:m,noIsolation:g,inert:y,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:b}),i?p.cloneElement(p.Children.only(a),jt(jt({},M),{ref:R})):p.createElement(w,jt({},M,{className:c,ref:R}),a))});bs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};bs.classNames={fullWidth:Go,zeroRight:Bo};var LT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function FT(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=LT();return e&&t.setAttribute("nonce",e),t}function VT(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function BT(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var GT=function(){var t=0,e=null;return{add:function(n){t==0&&(e=FT())&&(VT(e,n),BT(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},zT=function(){var t=GT();return function(e,n){p.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},fm=function(){var t=zT(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},UT={left:0,top:0,right:0,gap:0},bi=function(t){return parseInt(t||"",10)||0},HT=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[bi(n),bi(r),bi(o)]},WT=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return UT;var e=HT(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},KT=fm(),Yn="data-scroll-locked",YT=function(t,e,n,r){var o=t.left,s=t.top,i=t.right,a=t.gap;return n===void 0&&(n="margin"),`
175
- .`.concat(jT,` {
174
+ */const uR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],dR=Je("panel-left",uR);/**
175
+ * @license lucide-react v1.8.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const fR=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],hR=Je("rotate-cw",fR);/**
180
+ * @license lucide-react v1.8.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const pR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Dg=Je("search",pR);/**
185
+ * @license lucide-react v1.8.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const mR=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],$g=Je("triangle-alert",mR);/**
190
+ * @license lucide-react v1.8.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const gR=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],yR=Je("user",gR);/**
195
+ * @license lucide-react v1.8.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const vR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],nn=Je("x",vR),_g=v.forwardRef(function({color:e="primary",size:n,prefix:r,suffix:o,clearable:s=!1,onClear:i,showPasswordToggle:c=!1,showCount:l=!1,filled:u=!1,type:d="text",disabled:f,className:h,style:p,sx:g,value:b,defaultValue:x,onChange:y,maxLength:w,...C},S){const M=v.useId(),R=b!==void 0,[P,T]=v.useState(x!=null?String(x):""),j=R?String(b??""):P,A=v.useRef(null);v.useImperativeHandle(S,()=>A.current,[]);const[_,L]=v.useState(!1),I=c&&_&&d==="password"?"text":d,k=s&&!f&&j!=="",q=k||c,U=r!=null||o!=null||q,E=Z=>{R||T(Z.target.value),y==null||y(Z)},$=Z=>{var V;Z.preventDefault(),R||T("");const F=A.current;if(F){const H=(V=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:V.set;H==null||H.call(F,""),F.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},X=Ae(U?void 0:g,U?void 0:p,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,u&&"filled",h),K=a.jsx("input",{ref:A,type:I,className:X.className,style:X.style,disabled:f,value:R?b:void 0,defaultValue:R?void 0:x,onChange:E,maxLength:w,...C,"aria-describedby":l?[C["aria-describedby"],M].filter(Boolean).join(" "):C["aria-describedby"]}),ue=Z=>l?a.jsxs("span",{className:"cny-input-counted",children:[Z,a.jsxs("span",{id:M,className:"cny-input-count",children:[j.length,w!=null?`/${w}`:""]})]}):Z;if(!U)return ue(a.jsxs(a.Fragment,{children:[X.styleTag,K]}));const D=Ae(g,p,"cny-input-affix",r!=null&&"has-prefix",o!=null&&!q&&"has-suffix",q&&"has-action");return ue(a.jsxs("span",{className:D.className,style:D.style,children:[D.styleTag,r!=null&&a.jsx("span",{className:"cny-input-prefix",children:r}),K,o!=null&&!q&&a.jsx("span",{className:"cny-input-suffix",children:o}),k&&a.jsx("button",{type:"button",className:"cny-input-action",onClick:$,"aria-label":"Clear",tabIndex:-1,children:a.jsx(nn,{size:14,"aria-hidden":"true"})}),c&&d==="password"&&a.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>L(Z=>!Z),"aria-label":_?"Hide password":"Show password","aria-pressed":_,children:_?a.jsx(ZM,{size:14,"aria-hidden":"true"}):a.jsx(QM,{size:14,"aria-hidden":"true"})})]}))}),xR=v.forwardRef(function({color:e="default",className:n,style:r,sx:o,children:s,...i},c){const{className:l,style:u,styleTag:d}=Ae(o,r,"card",e!=="default"&&e,n);return a.jsxs("div",{ref:c,className:l,style:u,...i,children:[d,s]})}),bR={info:kg,success:jg,warning:$g,danger:au};function wR({color:t}){const e=bR[t];return a.jsx(e,{size:16,className:"alert-icon-glyph","aria-hidden":"true"})}const CR=160,SR=v.forwardRef(function({color:e="info",solid:n=!1,title:r,className:o,style:s,sx:i,children:c,icon:l,action:u,onDismiss:d,dismissLabel:f="Dismiss",exitAnimation:h=!0,...p},g){const[b,x]=v.useState(!1),y=v.useRef(void 0);v.useEffect(()=>()=>clearTimeout(y.current),[]);const w=()=>{let j=!1;try{j=window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{}if(!h||j||b)return d==null?void 0:d();x(!0),y.current=setTimeout(()=>d==null?void 0:d(),CR)},C=l!==!1,S=l&&l!==!0?l:a.jsx(wR,{color:e}),{className:M,style:R,styleTag:P}=Ae(i,s,"alert",e,n&&"solid",b&&"is-leaving",o),T=e==="danger"?"alert":"status";return a.jsxs("div",{ref:g,role:T,className:M,style:R,...p,children:[P,C&&a.jsx("span",{className:"alert-icon","aria-hidden":"true",children:S}),a.jsxs("div",{className:"alert-content",children:[r&&a.jsx("p",{className:"alert-title",children:r}),c&&a.jsx("p",{className:"alert-body",children:c})]}),u&&a.jsx("div",{className:"alert-action",children:u}),d&&a.jsx("button",{type:"button",className:"alert-close",onClick:w,"aria-label":f,children:a.jsx(nn,{size:14,"aria-hidden":"true"})})]})});function MR(t){const e=t.trim().split(/\s+/).filter(Boolean);if(e.length===0)return"";const n=e[0][0],r=e.length>1?e[e.length-1][0]:"";return(n+r).toUpperCase()}const Og=v.forwardRef(function({size:e="md",status:n,src:r,alt:o,name:s,className:i,style:c,sx:l,children:u,...d},f){const[h,p]=v.useState(!1);v.useEffect(()=>p(!1),[r]);const{className:g,style:b,styleTag:x}=Ae(l,c,"avatar",e!=="md"&&e,n,i);return a.jsxs("span",{ref:f,className:g,style:b,...d,children:[x,r&&!h?a.jsx("img",{src:r,alt:o??"",onError:()=>p(!0)}):u??(MR(s??"")||a.jsx("span",{className:"avatar-fallback","aria-hidden":"true",children:a.jsx(yR,{})}))]})}),RR=v.forwardRef(function({className:e,children:n,...r},o){return a.jsx("div",{ref:o,className:ne("avatar-stack",e),...r,children:n})}),TR=v.forwardRef(function({max:e=5,total:n,size:r,className:o,children:s,...i},c){const l=v.Children.toArray(s),u=n??l.length,d=l.slice(0,Math.max(0,e)),f=u-d.length;return a.jsxs("div",{ref:c,role:"group",className:ne("avatar-stack",o),...i,children:[d,f>0&&a.jsxs(Og,{size:r,className:"avatar-overflow","aria-label":`${f} more`,children:["+",f]})]})}),jR=v.forwardRef(function({value:e=0,color:n="primary",indeterminate:r=!1,shimmer:o=!1,className:s,style:i,sx:c,...l},u){const d=Math.max(0,Math.min(100,e)),f=r?i??{}:{...i??{},"--value":`${d}%`},{className:h,style:p,styleTag:g}=Ae(c,f,"progress",r&&"indeterminate",r&&o&&"shimmer",n!=="primary"&&n,s);return a.jsxs("div",{ref:u,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r?void 0:d,"aria-label":l["aria-label"]||l["aria-labelledby"]?void 0:"Progress",className:h,style:p,...l,children:[g,a.jsx("span",{className:"progress-bar"})]})}),PR=v.forwardRef(function({value:e,size:n="md",showLabel:r=!0,className:o,style:s,sx:i,...c},l){const u=Math.max(0,Math.min(100,e)),d={...s??{},"--value":u},{className:f,style:h,styleTag:p}=Ae(i,d,"progress-ring",n==="lg"&&"lg",o);return a.jsxs("span",{ref:l,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":u,"aria-label":c["aria-label"]||c["aria-labelledby"]?void 0:"Progress",className:f,style:h,...c,children:[p,r&&a.jsxs("span",{children:[u,"%"]})]})});function cu(t=!0){const[e,n]=v.useState(null),[r,o]=v.useState(!1),s=v.useCallback(i=>n(i),[]);return v.useEffect(()=>{if(!e||!t){o(!1);return}const i=()=>{const d=e.scrollHeight>e.clientHeight+1||e.scrollWidth>e.clientWidth+1;o(f=>f===d?f:d)};if(i(),typeof ResizeObserver>"u")return;const c=new ResizeObserver(i),l=()=>{c.disconnect(),c.observe(e),Array.from(e.children).forEach(d=>c.observe(d))};l();const u=typeof MutationObserver>"u"?null:new MutationObserver(()=>{l(),i()});return u==null||u.observe(e,{childList:!0}),()=>{c.disconnect(),u==null||u.disconnect()}},[e,t]),{ref:s,overflowing:r}}const NR={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},Lg=v.forwardRef(function({axis:e="both",maxHeight:n,maxWidth:r,region:o=!1,className:s,style:i,sx:c,children:l,...u},d){const{ref:f,overflowing:h}=cu(),p=C=>{f(C),typeof d=="function"?d(C):d&&(d.current=C)},g=!!(u["aria-label"]||u["aria-labelledby"]),b={...NR[e],maxHeight:n,maxWidth:r,...i??{}},{className:x,style:y,styleTag:w}=Ae(c,b,o?"cny-scroll-region":"cny-scroll",s);return a.jsxs("div",{ref:p,role:g?"region":void 0,tabIndex:h?0:void 0,className:x,style:y,...u,children:[w,l]})}),ER=v.forwardRef(function(e,n){return a.jsx(Lg,{ref:n,region:!0,...e})}),jt=v.forwardRef(function({shape:e="text",width:n,height:r,lines:o,className:s,style:i,sx:c,...l},u){const{className:d,style:f,styleTag:h}=Ae(c,{...i??{},width:n,height:r},"skeleton",e,s);return e==="text"&&o!=null&&o>1?a.jsxs("span",{ref:u,"aria-hidden":"true",className:ne("skeleton-lines",s),style:i,...l,children:[h,Array.from({length:o}).map((p,g)=>a.jsx("span",{className:"skeleton text",style:{width:g===o-1?"60%":n}},g))]}):a.jsx("span",{ref:u,"aria-hidden":"true",className:d,style:f,...l,children:h})}),kR=v.forwardRef(function({className:e,...n},r){return a.jsxs("div",{ref:r,"aria-hidden":"true",className:ne("skeleton-card",e),...n,children:[a.jsx(jt,{shape:"rect",height:120}),a.jsx(jt,{shape:"title"}),a.jsx(jt,{shape:"text",lines:2})]})}),AR=v.forwardRef(function({className:e,...n},r){return a.jsxs("div",{ref:r,"aria-hidden":"true",className:ne("skeleton-list-item",e),...n,children:[a.jsx(jt,{shape:"avatar"}),a.jsxs("div",{className:"skeleton-list-item-body",children:[a.jsx(jt,{width:"40%"}),a.jsx(jt,{width:"70%"})]})]})}),IR=v.forwardRef(function({solid:e=!1,surface:n="base",skipLinkTarget:r,skipLinkLabel:o="Skip to content",className:s,style:i,sx:c,children:l,...u},d){const{className:f,style:h,styleTag:p}=Ae(c,i,"cny-navbar",e&&"solid",n==="raised"&&"raised",s);return a.jsxs(a.Fragment,{children:[r&&a.jsx("a",{className:"cny-skip-link",href:r,children:o}),a.jsxs("header",{ref:d,className:f,style:h,...u,children:[p,l]})]})}),DR=v.forwardRef(function({mark:e=!0,className:n,children:r,...o},s){return a.jsxs("a",{ref:s,className:ne("cny-navbar-brand",n),...o,children:[e&&a.jsx("span",{className:"brand-mark","aria-hidden":"true"}),r]})}),$R=v.forwardRef(function({className:e,children:n,id:r,mobileMenu:o=!0,menuLabel:s="navigation menu",onClick:i,...c},l){const u=v.useId(),d=r??u,[f,h]=v.useState(!1),p=v.useRef(null),g=v.useRef(null);v.useEffect(()=>{if(!f)return;const y=C=>{var S;C.key==="Escape"&&(h(!1),(S=p.current)==null||S.focus())},w=C=>{var M,R;const S=C.target;!((M=g.current)!=null&&M.contains(S))&&!((R=p.current)!=null&&R.contains(S))&&h(!1)};return document.addEventListener("keydown",y),document.addEventListener("pointerdown",w),()=>{document.removeEventListener("keydown",y),document.removeEventListener("pointerdown",w)}},[f]);const b=v.useCallback(y=>{var w,C;i==null||i(y),(C=(w=y.target).closest)!=null&&C.call(w,"a[href]")&&h(!1)},[i]),x=y=>{g.current=y,typeof l=="function"?l(y):l&&(l.current=y)};return a.jsxs(a.Fragment,{children:[o&&a.jsx("button",{ref:p,type:"button",className:"cny-navbar-menu-btn","aria-expanded":f,"aria-controls":d,"aria-label":`${f?"Close":"Open"} ${s}`,onClick:()=>h(y=>!y),children:f?a.jsx(nn,{size:20,"aria-hidden":"true"}):a.jsx(Ig,{size:20,"aria-hidden":"true"})}),a.jsx("nav",{ref:x,id:d,className:ne("cny-navbar-nav",o&&f&&"is-open",e),onClick:b,...c,children:n})]})}),_R=v.forwardRef(function({active:e=!1,className:n,children:r,...o},s){return a.jsx("a",{ref:s,"aria-current":e?"page":void 0,className:ne("cny-navbar-item",e&&"active",n),...o,children:r})}),OR=v.forwardRef(function({className:e,children:n,...r},o){return a.jsx("div",{ref:o,className:ne("cny-navbar-actions",e),...r,children:n})}),LR=v.forwardRef(function({open:e=!1,className:n,children:r,"aria-label":o,...s},i){return a.jsx("button",{ref:i,type:"button","aria-expanded":e,"aria-label":o??(e?"Close menu":"Open menu"),className:ne("cny-navbar-toggle",n),...s,children:r??a.jsx(Ig,{size:20,"aria-hidden":"true"})})});var FR=Object.defineProperty,Rt=(t,e)=>FR(t,"name",{value:e,configurable:!0}),Jc="dismissableLayer.update",VR="dismissableLayer.pointerDownOutside",BR="dismissableLayer.focusOutside",Kf,Fg=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ws=m.forwardRef(Rt(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:c,onInteractOutside:l,onDismiss:u,...d}=e,f=m.useContext(Fg),[h,p]=m.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=m.useState({}),x=_e(n,p),y=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),C=w?y.indexOf(w):-1,S=h?y.indexOf(h):-1,M=f.layersWithOutsidePointerEventsDisabled.size>0,R=S>=C,P=m.useRef(!1),T=Bg(L=>{i==null||i(L),l==null||l(L),L.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:P,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(L=>{if(!(L instanceof Node))return!1;const I=[...f.branches].some(k=>k.contains(L));return R&&!I},[f.branches,R])}),j=Ug(L=>{if(o&&P.current)return;const I=L.target;[...f.branches].some(q=>q.contains(I))||(c==null||c(L),l==null||l(L),L.defaultPrevented||u==null||u())},g),A=h?S===y.length-1:!1,_=zt(L=>{L.key==="Escape"&&(s==null||s(L),!L.defaultPrevented&&u&&(L.preventDefault(),u()))});return m.useEffect(()=>{if(A)return g.addEventListener("keydown",_,{capture:!0}),()=>g.removeEventListener("keydown",_,{capture:!0})},[g,A,_]),m.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Kf=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),Qc(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=Kf))}},[h,g,r,f]),m.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),Qc())},[h,f]),m.useEffect(()=>{const L=Rt(()=>b({}),"handleUpdate");return document.addEventListener(Jc,L),()=>document.removeEventListener(Jc,L)},[]),a.jsx(Ne.div,{...d,ref:x,style:{pointerEvents:M?R?"auto":"none":void 0,...e.style},onFocusCapture:ge(e.onFocusCapture,j.onFocusCapture),onBlurCapture:ge(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:ge(e.onPointerDownCapture,T.onPointerDownCapture)})},"DismissableLayer"));function Vg(){const t=m.useContext(Fg),[e,n]=m.useState(null);return m.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Rt(Vg,"useDismissableLayerSurface");var UR=Rt(()=>!0,"IS_TRUE");function Bg(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=UR}=e,c=zt(t),l=m.useRef(!1),u=m.useRef(!1),d=m.useRef(new Map),f=m.useRef(()=>{});return m.useEffect(()=>{function h(){u.current=!1,o.current=!1,d.current.clear()}Rt(h,"resetOutsideInteraction");function p(){return Array.from(d.current.values()).some(Boolean)}Rt(p,"isOutsideInteractionIntercepted");function g(C){if(!u.current)return;const S=C.target;S instanceof Node&&[...s].some(R=>R.contains(S))||d.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Rt(g,"handleInteractionCapture");function b(C){u.current&&d.current.set(C.type,!1)}Rt(b,"handleInteractionBubble");const x=Rt(C=>{if(C.target&&!l.current){let S=function(){n.removeEventListener("click",f.current);const R=p();h(),R||lu(VR,c,M,{discrete:!0})};if(Rt(S,"handleAndDispatchPointerDownOutsideEvent"),!i(C.target)){n.removeEventListener("click",f.current),h(),l.current=!1;return}const M={originalEvent:C};u.current=!0,o.current=r&&C.button===0,d.current.clear(),!r||C.button!==0?S():(n.removeEventListener("click",f.current),f.current=S,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();l.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of y)n.addEventListener(C,g,!0),n.addEventListener(C,b);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",x)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",x),n.removeEventListener("click",f.current);for(const C of y)n.removeEventListener(C,g,!0),n.removeEventListener(C,b)}},[n,c,r,o,s,i]),{onPointerDownCapture:Rt(()=>l.current=!0,"onPointerDownCapture")}}Rt(Bg,"usePointerDownOutside");function Ug(t,e=globalThis==null?void 0:globalThis.document){const n=zt(t),r=m.useRef(!1);return m.useEffect(()=>{const o=Rt(s=>{s.target&&!r.current&&lu(BR,n,{originalEvent:s},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:Rt(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Rt(()=>r.current=!1,"onBlurCapture")}}Rt(Ug,"useFocusOutside");function Qc(){const t=new CustomEvent(Jc);document.dispatchEvent(t)}Rt(Qc,"dispatchUpdate");function lu(t,e,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?ru(o,s):o.dispatchEvent(s)}Rt(lu,"handleAndDispatchCustomEvent");const HR=["top","right","bottom","left"],vr=Math.min,Zt=Math.max,Ii=Math.round,Ws=Math.floor,_n=t=>({x:t,y:t}),GR={left:"right",right:"left",bottom:"top",top:"bottom"};function el(t,e,n){return Zt(t,vr(e,n))}function er(t,e){return typeof t=="function"?t(e):t}function tr(t){return t.split("-")[0]}function ko(t){return t.split("-")[1]}function uu(t){return t==="x"?"y":"x"}function du(t){return t==="y"?"height":"width"}function Dn(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function fu(t){return uu(Dn(t))}function zR(t,e,n){n===void 0&&(n=!1);const r=ko(t),o=fu(t),s=du(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=Di(i)),[i,Di(i)]}function WR(t){const e=Di(t);return[tl(t),e,tl(e)]}function tl(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Yf=["left","right"],Xf=["right","left"],KR=["top","bottom"],YR=["bottom","top"];function XR(t,e,n){switch(t){case"top":case"bottom":return n?e?Xf:Yf:e?Yf:Xf;case"left":case"right":return e?KR:YR;default:return[]}}function qR(t,e,n,r){const o=ko(t);let s=XR(tr(t),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),e&&(s=s.concat(s.map(tl)))),s}function Di(t){const e=tr(t);return GR[e]+t.slice(e.length)}function ZR(t){return{top:0,right:0,bottom:0,left:0,...t}}function Hg(t){return typeof t!="number"?ZR(t):{top:t,right:t,bottom:t,left:t}}function $i(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function qf(t,e,n){let{reference:r,floating:o}=t;const s=Dn(e),i=fu(e),c=du(i),l=tr(e),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[c]/2-o[c]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(ko(e)){case"start":p[i]-=h*(n&&u?-1:1);break;case"end":p[i]+=h*(n&&u?-1:1);break}return p}async function JR(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=er(e,t),g=Hg(p),x=c[h?f==="floating"?"reference":"floating":f],y=$i(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:u,rootBoundary:d,strategy:l})),w=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),S=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},M=$i(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:C,strategy:l}):w);return{top:(y.top-M.top+g.top)/S.y,bottom:(M.bottom-y.bottom+g.bottom)/S.y,left:(y.left-M.left+g.left)/S.x,right:(M.right-y.right+g.right)/S.x}}const QR=50,eT=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:JR},l=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:f}=qf(u,r,l),h=r,p=0;const g={};for(let b=0;b<s.length;b++){const x=s[b];if(!x)continue;const{name:y,fn:w}=x,{x:C,y:S,data:M,reset:R}=await w({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:u,platform:c,elements:{reference:t,floating:e}});d=C??d,f=S??f,g[y]={...g[y],...M},R&&p<QR&&(p++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(u=R.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:o}):R.rects),{x:d,y:f}=qf(u,h,l)),b=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:g}},tT=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:s,platform:i,elements:c,middlewareData:l}=e,{element:u,padding:d=0}=er(t,e)||{};if(u==null)return{};const f=Hg(d),h={x:n,y:r},p=fu(o),g=du(p),b=await i.getDimensions(u),x=p==="y",y=x?"top":"left",w=x?"bottom":"right",C=x?"clientHeight":"clientWidth",S=s.reference[g]+s.reference[p]-h[p]-s.floating[g],M=h[p]-s.reference[p],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let P=R?R[C]:0;(!P||!await(i.isElement==null?void 0:i.isElement(R)))&&(P=c.floating[C]||s.floating[g]);const T=S/2-M/2,j=P/2-b[g]/2-1,A=vr(f[y],j),_=vr(f[w],j),L=A,I=P-b[g]-_,k=P/2-b[g]/2+T,q=el(L,k,I),U=!l.arrow&&ko(o)!=null&&k!==q&&s.reference[g]/2-(k<L?A:_)-b[g]/2<0,E=U?k<L?k-L:k-I:0;return{[p]:h[p]+E,data:{[p]:q,centerOffset:k-q-E,...U&&{alignmentOffset:E}},reset:U}}}),nT=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...x}=er(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=tr(o),w=Dn(c),C=tr(c)===c,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),M=h||(C||!b?[Di(c)]:WR(c)),R=g!=="none";!h&&R&&M.push(...qR(c,b,g,S));const P=[c,...M],T=await l.detectOverflow(e,x),j=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&j.push(T[y]),f){const k=zR(o,i,S);j.push(T[k[0]],T[k[1]])}if(A=[...A,{placement:o,overflows:j}],!j.every(k=>k<=0)){var _,L;const k=(((_=s.flip)==null?void 0:_.index)||0)+1,q=P[k];if(q&&(!(f==="alignment"?w!==Dn(q):!1)||A.every($=>Dn($.placement)===w?$.overflows[0]>0:!0)))return{data:{index:k,overflows:A},reset:{placement:q}};let U=(L=A.filter(E=>E.overflows[0]<=0).sort((E,$)=>E.overflows[1]-$.overflows[1])[0])==null?void 0:L.placement;if(!U)switch(p){case"bestFit":{var I;const E=(I=A.filter($=>{if(R){const X=Dn($.placement);return X===w||X==="y"}return!0}).map($=>[$.placement,$.overflows.filter(X=>X>0).reduce((X,K)=>X+K,0)]).sort(($,X)=>$[1]-X[1])[0])==null?void 0:I[0];E&&(U=E);break}case"initialPlacement":U=c;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function Zf(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Jf(t){return HR.some(e=>t[e]>=0)}const rT=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...s}=er(t,e);switch(o){case"referenceHidden":{const i=await r.detectOverflow(e,{...s,elementContext:"reference"}),c=Zf(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Jf(c)}}}case"escaped":{const i=await r.detectOverflow(e,{...s,altBoundary:!0}),c=Zf(i,n.floating);return{data:{escapedOffsets:c,escaped:Jf(c)}}}default:return{}}}}},Gg=new Set(["left","top"]);async function oT(t,e){const{placement:n,platform:r,elements:o}=t,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=tr(n),c=ko(n),l=Dn(n)==="y",u=Gg.has(i)?-1:1,d=s&&l?-1:1,f=er(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(p=c==="end"?g*-1:g),l?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const sT=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:s,placement:i,middlewareData:c}=e,l=await oT(e,t);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},iT=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:s}=e,{mainAxis:i=!0,crossAxis:c=!1,limiter:l={fn:y=>{let{x:w,y:C}=y;return{x:w,y:C}}},...u}=er(t,e),d={x:n,y:r},f=await s.detectOverflow(e,u),h=Dn(tr(o)),p=uu(h);let g=d[p],b=d[h];if(i){const y=p==="y"?"top":"left",w=p==="y"?"bottom":"right",C=g+f[y],S=g-f[w];g=el(C,g,S)}if(c){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",C=b+f[y],S=b-f[w];b=el(C,b,S)}const x=l.fn({...e,[p]:g,[h]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:i,[h]:c}}}}}},aT=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=e,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=er(t,e),d={x:n,y:r},f=Dn(o),h=uu(f);let p=d[h],g=d[f];const b=er(c,e),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const C=h==="y"?"height":"width",S=s.reference[h]-s.floating[C]+x.mainAxis,M=s.reference[h]+s.reference[C]-x.mainAxis;p<S?p=S:p>M&&(p=M)}if(u){var y,w;const C=h==="y"?"width":"height",S=Gg.has(tr(o)),M=s.reference[f]-s.floating[C]+(S&&((y=i.offset)==null?void 0:y[f])||0)+(S?0:x.crossAxis),R=s.reference[f]+s.reference[C]+(S?0:((w=i.offset)==null?void 0:w[f])||0)-(S?x.crossAxis:0);g<M?g=M:g>R&&(g=R)}return{[h]:p,[f]:g}}}},cT=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:s,platform:i,elements:c}=e,{apply:l=()=>{},...u}=er(t,e),d=await i.detectOverflow(e,u),f=tr(o),h=ko(o),p=Dn(o)==="y",{width:g,height:b}=s.floating;let x,y;f==="top"||f==="bottom"?(x=f,y=h===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(y=f,x=h==="end"?"top":"bottom");const w=b-d.top-d.bottom,C=g-d.left-d.right,S=vr(b-d[x],w),M=vr(g-d[y],C),R=!e.middlewareData.shift;let P=S,T=M;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(T=C),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(P=w),R&&!h){const A=Zt(d.left,0),_=Zt(d.right,0),L=Zt(d.top,0),I=Zt(d.bottom,0);p?T=g-2*(A!==0||_!==0?A+_:Zt(d.left,d.right)):P=b-2*(L!==0||I!==0?L+I:Zt(d.top,d.bottom))}await l({...e,availableWidth:T,availableHeight:P});const j=await i.getDimensions(c.floating);return g!==j.width||b!==j.height?{reset:{rects:!0}}:{}}}};function qi(){return typeof window<"u"}function Ao(t){return zg(t)?(t.nodeName||"").toLowerCase():"#document"}function Qt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Vn(t){var e;return(e=(zg(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function zg(t){return qi()?t instanceof Node||t instanceof Qt(t).Node:!1}function xn(t){return qi()?t instanceof Element||t instanceof Qt(t).Element:!1}function sr(t){return qi()?t instanceof HTMLElement||t instanceof Qt(t).HTMLElement:!1}function Qf(t){return!qi()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qt(t).ShadowRoot}function Cs(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=bn(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function lT(t){return/^(table|td|th)$/.test(Ao(t))}function Zi(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const uT=/transform|translate|scale|rotate|perspective|filter/,dT=/paint|layout|strict|content/,_r=t=>!!t&&t!=="none";let Xa;function hu(t){const e=xn(t)?bn(t):t;return _r(e.transform)||_r(e.translate)||_r(e.scale)||_r(e.rotate)||_r(e.perspective)||!pu()&&(_r(e.backdropFilter)||_r(e.filter))||uT.test(e.willChange||"")||dT.test(e.contain||"")}function fT(t){let e=xr(t);for(;sr(e)&&!bo(e);){if(hu(e))return e;if(Zi(e))return null;e=xr(e)}return null}function pu(){return Xa==null&&(Xa=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xa}function bo(t){return/^(html|body|#document)$/.test(Ao(t))}function bn(t){return Qt(t).getComputedStyle(t)}function Ji(t){return xn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xr(t){if(Ao(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Qf(t)&&t.host||Vn(t);return Qf(e)?e.host:e}function Wg(t){const e=xr(t);return bo(e)?t.ownerDocument?t.ownerDocument.body:t.body:sr(e)&&Cs(e)?e:Wg(e)}function os(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=Wg(t),s=o===((r=t.ownerDocument)==null?void 0:r.body),i=Qt(o);if(s){const c=nl(i);return e.concat(i,i.visualViewport||[],Cs(o)?o:[],c&&n?os(c):[])}else return e.concat(o,os(o,[],n))}function nl(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Kg(t){const e=bn(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=sr(t),s=o?t.offsetWidth:n,i=o?t.offsetHeight:r,c=Ii(n)!==s||Ii(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function mu(t){return xn(t)?t:t.contextElement}function mo(t){const e=mu(t);if(!sr(e))return _n(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:s}=Kg(e);let i=(s?Ii(n.width):n.width)/r,c=(s?Ii(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const hT=_n(0);function Yg(t){const e=Qt(t);return!pu()||!e.visualViewport?hT:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function pT(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Qt(t)?!1:e}function Hr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=mu(t);let i=_n(1);e&&(r?xn(r)&&(i=mo(r)):i=mo(t));const c=pT(s,n,r)?Yg(s):_n(0);let l=(o.left+c.x)/i.x,u=(o.top+c.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const h=Qt(s),p=r&&xn(r)?Qt(r):r;let g=h,b=nl(g);for(;b&&r&&p!==g;){const x=mo(b),y=b.getBoundingClientRect(),w=bn(b),C=y.left+(b.clientLeft+parseFloat(w.paddingLeft))*x.x,S=y.top+(b.clientTop+parseFloat(w.paddingTop))*x.y;l*=x.x,u*=x.y,d*=x.x,f*=x.y,l+=C,u+=S,g=Qt(b),b=nl(g)}}return $i({width:d,height:f,x:l,y:u})}function Qi(t,e){const n=Ji(t).scrollLeft;return e?e.left+n:Hr(Vn(t)).left+n}function Xg(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Qi(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function mT(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const s=o==="fixed",i=Vn(r),c=e?Zi(e.floating):!1;if(r===i||c&&s)return n;let l={scrollLeft:0,scrollTop:0},u=_n(1);const d=_n(0),f=sr(r);if((f||!f&&!s)&&((Ao(r)!=="body"||Cs(i))&&(l=Ji(r)),f)){const p=Hr(r);u=mo(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=i&&!f&&!s?Xg(i,l):_n(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-l.scrollTop*u.y+d.y+h.y}}function gT(t){return Array.from(t.getClientRects())}function yT(t){const e=Vn(t),n=Ji(t),r=t.ownerDocument.body,o=Zt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Zt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Qi(t);const c=-n.scrollTop;return bn(r).direction==="rtl"&&(i+=Zt(e.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}const eh=25;function vT(t,e){const n=Qt(t),r=Vn(t),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,c=0,l=0;if(o){s=o.width,i=o.height;const d=pu();(!d||d&&e==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}const u=Qi(r);if(u<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-p);g<=eh&&(s-=g)}else u<=eh&&(s+=u);return{width:s,height:i,x:c,y:l}}function xT(t,e){const n=Hr(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,s=sr(t)?mo(t):_n(1),i=t.clientWidth*s.x,c=t.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:c,x:l,y:u}}function th(t,e,n){let r;if(e==="viewport")r=vT(t,n);else if(e==="document")r=yT(Vn(t));else if(xn(e))r=xT(e,n);else{const o=Yg(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return $i(r)}function qg(t,e){const n=xr(t);return n===e||!xn(n)||bo(n)?!1:bn(n).position==="fixed"||qg(n,e)}function bT(t,e){const n=e.get(t);if(n)return n;let r=os(t,[],!1).filter(c=>xn(c)&&Ao(c)!=="body"),o=null;const s=bn(t).position==="fixed";let i=s?xr(t):t;for(;xn(i)&&!bo(i);){const c=bn(i),l=hu(i);!l&&c.position==="fixed"&&(o=null),(s?!l&&!o:!l&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Cs(i)&&!l&&qg(t,i))?r=r.filter(d=>d!==i):o=c,i=xr(i)}return e.set(t,r),r}function wT(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[...n==="clippingAncestors"?Zi(e)?[]:bT(e,this._c):[].concat(n),r],c=th(e,i[0],o);let l=c.top,u=c.right,d=c.bottom,f=c.left;for(let h=1;h<i.length;h++){const p=th(e,i[h],o);l=Zt(p.top,l),u=vr(p.right,u),d=vr(p.bottom,d),f=Zt(p.left,f)}return{width:u-f,height:d-l,x:f,y:l}}function CT(t){const{width:e,height:n}=Kg(t);return{width:e,height:n}}function ST(t,e,n){const r=sr(e),o=Vn(e),s=n==="fixed",i=Hr(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=_n(0);function u(){l.x=Qi(o)}if(r||!r&&!s)if((Ao(e)!=="body"||Cs(o))&&(c=Ji(e)),r){const p=Hr(e,!0,s,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Xg(o,c):_n(0),f=i.left+c.scrollLeft-l.x-d.x,h=i.top+c.scrollTop-l.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function qa(t){return bn(t).position==="static"}function nh(t,e){if(!sr(t)||bn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Vn(t)===n&&(n=n.ownerDocument.body),n}function Zg(t,e){const n=Qt(t);if(Zi(t))return n;if(!sr(t)){let o=xr(t);for(;o&&!bo(o);){if(xn(o)&&!qa(o))return o;o=xr(o)}return n}let r=nh(t,e);for(;r&&lT(r)&&qa(r);)r=nh(r,e);return r&&bo(r)&&qa(r)&&!hu(r)?n:r||fT(t)||n}const MT=async function(t){const e=this.getOffsetParent||Zg,n=this.getDimensions,r=await n(t.floating);return{reference:ST(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function RT(t){return bn(t).direction==="rtl"}const TT={convertOffsetParentRelativeRectToViewportRelativeRect:mT,getDocumentElement:Vn,getClippingRect:wT,getOffsetParent:Zg,getElementRects:MT,getClientRects:gT,getDimensions:CT,getScale:mo,isElement:xn,isRTL:RT};function Jg(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function jT(t,e){let n=null,r;const o=Vn(t);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const u=t.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=u;if(c||e(),!h||!p)return;const g=Ws(f),b=Ws(o.clientWidth-(d+h)),x=Ws(o.clientHeight-(f+p)),y=Ws(d),C={rootMargin:-g+"px "+-b+"px "+-x+"px "+-y+"px",threshold:Zt(0,vr(1,l))||1};let S=!0;function M(R){const P=R[0].intersectionRatio;if(P!==l){if(!S)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}P===1&&!Jg(u,t.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(M,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(M,C)}n.observe(t)}return i(!0),s}function PT(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=mu(t),d=o||s?[...u?os(u):[],...e?os(e):[]]:[];d.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=u&&c?jT(u,n):null;let h=-1,p=null;i&&(p=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&p&&e&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(e)})),n()}),u&&!l&&p.observe(u),e&&p.observe(e));let g,b=l?Hr(t):null;l&&x();function x(){const y=Hr(t);b&&!Jg(b,y)&&n(),b=y,g=requestAnimationFrame(x)}return n(),()=>{var y;d.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const NT=sT,ET=iT,kT=nT,AT=cT,IT=rT,rh=tT,DT=aT,$T=(t,e,n)=>{const r=new Map,o={platform:TT,...n},s={...o.platform,_c:r};return eT(t,e,{...o,platform:s})};var _T=typeof document<"u",OT=function(){},xi=_T?v.useLayoutEffect:OT;function _i(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!_i(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&t.$$typeof)&&!_i(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function Qg(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function oh(t,e){const n=Qg(t);return Math.round(e*n)/n}function Za(t){const e=m.useRef(t);return xi(()=>{e.current=t}),e}function LT(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:u}=t,[d,f]=m.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,p]=m.useState(r);_i(h,r)||p(r);const[g,b]=m.useState(null),[x,y]=m.useState(null),w=m.useCallback($=>{$!==R.current&&(R.current=$,b($))},[]),C=m.useCallback($=>{$!==P.current&&(P.current=$,y($))},[]),S=s||g,M=i||x,R=m.useRef(null),P=m.useRef(null),T=m.useRef(d),j=l!=null,A=Za(l),_=Za(o),L=Za(u),I=m.useCallback(()=>{if(!R.current||!P.current)return;const $={placement:e,strategy:n,middleware:h};_.current&&($.platform=_.current),$T(R.current,P.current,$).then(X=>{const K={...X,isPositioned:L.current!==!1};k.current&&!_i(T.current,K)&&(T.current=K,ps.flushSync(()=>{f(K)}))})},[h,e,n,_,L]);xi(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[u]);const k=m.useRef(!1);xi(()=>(k.current=!0,()=>{k.current=!1}),[]),xi(()=>{if(S&&(R.current=S),M&&(P.current=M),S&&M){if(A.current)return A.current(S,M,I);I()}},[S,M,I,A,j]);const q=m.useMemo(()=>({reference:R,floating:P,setReference:w,setFloating:C}),[w,C]),U=m.useMemo(()=>({reference:S,floating:M}),[S,M]),E=m.useMemo(()=>{const $={position:n,left:0,top:0};if(!U.floating)return $;const X=oh(U.floating,d.x),K=oh(U.floating,d.y);return c?{...$,transform:"translate("+X+"px, "+K+"px)",...Qg(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:K}},[n,c,U.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:I,refs:q,elements:U,floatingStyles:E}),[d,I,q,U,E])}const FT=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?rh({element:r.current,padding:o}).fn(n):{}:r?rh({element:r,padding:o}).fn(n):{}}}},VT=(t,e)=>{const n=NT(t);return{name:n.name,fn:n.fn,options:[t,e]}},BT=(t,e)=>{const n=ET(t);return{name:n.name,fn:n.fn,options:[t,e]}},UT=(t,e)=>({fn:DT(t).fn,options:[t,e]}),HT=(t,e)=>{const n=kT(t);return{name:n.name,fn:n.fn,options:[t,e]}},GT=(t,e)=>{const n=AT(t);return{name:n.name,fn:n.fn,options:[t,e]}},zT=(t,e)=>{const n=IT(t);return{name:n.name,fn:n.fn,options:[t,e]}},WT=(t,e)=>{const n=FT(t);return{name:n.name,fn:n.fn,options:[t,e]}};var KT=Object.defineProperty,YT=(t,e)=>KT(t,"name",{value:e,configurable:!0}),XT=m.forwardRef(YT(function(e,n){const{children:r,width:o=10,height:s=5,...i}=e;return a.jsx(Ne.svg,{...i,ref:n,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),qT=XT,ZT=Object.defineProperty,JT=(t,e)=>ZT(t,"name",{value:e,configurable:!0});function Io(t){const[e,n]=m.useState(void 0);return mt(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,c;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,c=u.blockSize}else i=t.offsetWidth,c=t.offsetHeight;n({width:i,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}JT(Io,"useSize");var QT=Object.defineProperty,qn=(t,e)=>QT(t,"name",{value:e,configurable:!0}),ey="Popper",[ty,Mr]=dt(ey),[ej,ny]=ty(ey),tj=qn(t=>{const{__scopePopper:e,children:n}=t,[r,o]=m.useState(null),[s,i]=m.useState(void 0);return a.jsx(ej,{scope:e,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),nj="PopperAnchor",rj=m.forwardRef(qn(function(e,n){const{__scopePopper:r,virtualRef:o,...s}=e,i=ny(nj,r),c=m.useRef(null),l=i.onAnchorChange,u=m.useCallback(b=>{c.current=b,b&&l(b)},[l]),d=_e(n,u),f=m.useRef(null);m.useEffect(()=>{if(!o)return;const b=f.current;f.current=o.current,b!==f.current&&l(f.current)});const h=i.placementState&&ea(i.placementState),p=h==null?void 0:h[0],g=h==null?void 0:h[1];return o?null:a.jsx(Ne.div,{"data-radix-popper-side":p,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),ry="PopperContent",[oj,sj]=ty(ry),ij=m.forwardRef(qn(function(e,n){var ee,ce,se,te,J,oe,ye;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:b,...x}=e,y=ny(ry,r),[w,C]=m.useState(null),S=_e(n,C),[M,R]=m.useState(null),P=Io(M),T=(P==null?void 0:P.width)??0,j=(P==null?void 0:P.height)??0,A=o+(i!=="center"?"-"+i:""),_=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},L=Array.isArray(d)?d:[d],I=L.length>0,k={padding:_,boundary:L.filter(oy),altBoundary:I},{refs:q,floatingStyles:U,placement:E,isPositioned:$,middlewareData:X}=LT({strategy:"fixed",placement:A,whileElementsMounted:qn((...he)=>PT(...he,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[VT({mainAxis:s+j,alignmentAxis:c}),u&&BT({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?UT():void 0,...k}),u&&HT({...k}),GT({...k,apply:qn(({elements:he,rects:Fe,availableWidth:Ve,availableHeight:ie})=>{const{width:Q,height:me}=Fe.reference,je=he.floating.style;je.setProperty("--radix-popper-available-width",`${Ve}px`),je.setProperty("--radix-popper-available-height",`${ie}px`),je.setProperty("--radix-popper-anchor-width",`${Q}px`),je.setProperty("--radix-popper-anchor-height",`${me}px`)},"apply")}),M&&WT({element:M,padding:l}),uj({arrowWidth:T,arrowHeight:j}),p&&zT({strategy:"referenceHidden",...k,boundary:I?k.boundary:void 0})]}),K=y.setPlacementState;mt(()=>(K(E),()=>{K(void 0)}),[E,K]);const[ue,D]=ea(E),Z=zt(b);mt(()=>{$&&(Z==null||Z())},[$,Z]);const F=(ee=X.arrow)==null?void 0:ee.x,V=(ce=X.arrow)==null?void 0:ce.y,H=((se=X.arrow)==null?void 0:se.centerOffset)!==0,[Y,G]=m.useState();return mt(()=>{w&&G(window.getComputedStyle(w).zIndex)},[w]),a.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:$?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(te=X.transformOrigin)==null?void 0:te.x,(J=X.transformOrigin)==null?void 0:J.y].join(" "),...((oe=X.hide)==null?void 0:oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(oj,{scope:r,placedSide:ue,placedAlign:D,onArrowChange:R,arrowX:F,arrowY:V,shouldHideArrow:H,children:a.jsx(Ne.div,{"data-side":ue,"data-align":D,...x,ref:S,style:{...x.style,animation:$?(ye=x.style)==null?void 0:ye.animation:"none"}})})})},"PopperContent")),aj="PopperArrow",cj={top:"bottom",right:"left",bottom:"top",left:"right"},lj=m.forwardRef(qn(function(e,n){const{__scopePopper:r,...o}=e,s=sj(aj,r),i=cj[s.placedSide];return a.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:a.jsx(qT,{...o,ref:n,style:{...o.style,display:"block"}})})},"PopperArrow"));function oy(t){return t!==null}qn(oy,"isNotNull");var uj=qn(t=>({name:"transformOrigin",options:t,fn(e){var x,y,w;const{placement:n,rects:r,middlewareData:o}=e,i=((x=o.arrow)==null?void 0:x.centerOffset)!==0,c=i?0:t.arrowWidth,l=i?0:t.arrowHeight,[u,d]=ea(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=o.arrow)==null?void 0:y.x)??0)+c/2,p=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let g="",b="";return u==="bottom"?(g=i?f:`${h}px`,b=`${-l}px`):u==="top"?(g=i?f:`${h}px`,b=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,b=i?f:`${p}px`):u==="left"&&(g=`${r.floating.width+l}px`,b=i?f:`${p}px`),{data:{x:g,y:b}}}}),"transformOrigin");function ea(t){const[e,n="center"]=t.split("-");return[e,n]}qn(ea,"getSideAndAlignFromPlacement");var Ss=tj,Ms=rj,ta=ij,sy=lj,dj=Object.defineProperty,fj=(t,e)=>dj(t,"name",{value:e,configurable:!0}),Rs=m.forwardRef(fj(function(e,n){var l;const{container:r,...o}=e,[s,i]=m.useState(!1);mt(()=>i(!0),[]);const c=r||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return c?ps.createPortal(a.jsx(Ne.div,{...o,ref:n}),c):null},"Portal")),hj=Object.defineProperty,nr=(t,e)=>hj(t,"name",{value:e,configurable:!0});function iy(t,e){return m.useReducer((n,r)=>e[n][r]??n,t)}nr(iy,"useStateMachine");var $t=nr(t=>{const{present:e,children:n}=t,r=ay(e),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=cy(r.ref,ly(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:s}):null},"Presence");function ay(t){const[e,n]=m.useState(),r=m.useRef(null),o=m.useRef(t),s=m.useRef("none"),i=m.useRef(void 0),c=t?"mounted":"unmounted",[l,u]=iy(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{l==="mounted"?(s.current=i.current??ao(r.current),i.current=void 0):s.current="none"},[l]),mt(()=>{const d=r.current,f=o.current;if(f!==t){const p=s.current,g=ao(d);t?(i.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,u]),mt(()=>{if(e){let d;const f=e.ownerDocument.defaultView??window,h=nr(g=>{const x=ao(r.current).includes(CSS.escape(g.animationName));if(g.target===e&&x&&(u("ANIMATION_END"),!o.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",d=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},"handleAnimationEnd"),p=nr(g=>{g.target===e&&(s.current=ao(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(d),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(d=>{if(d){const f=getComputedStyle(d);r.current=f,i.current=ao(f)}else r.current=null;n(d)},[])}}nr(ay,"usePresence");function rl(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}nr(rl,"setRef");function cy(...t){const e=m.useRef(t);return e.current=t,m.useCallback(n=>{const r=e.current;let o=!1;const s=r.map(i=>{const c=rl(i,n);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let i=0;i<s.length;i++){const c=s[i];typeof c=="function"?c():rl(r[i],null)}}},[])}nr(cy,"useStableComposedRefs");function ao(t){return(t==null?void 0:t.animationName)||"none"}nr(ao,"getAnimationName");function ly(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}nr(ly,"getElementRef");var pj=Object.defineProperty,mj=(t,e)=>pj(t,"name",{value:e,configurable:!0}),uy=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"}),dy=m.forwardRef(mj(function(e,n){return a.jsx(Ne.span,{...e,ref:n,style:{...uy,...e.style}})},"VisuallyHidden")),gj=dy,yj=Object.defineProperty,vt=(t,e)=>yj(t,"name",{value:e,configurable:!0}),[gu,k_]=dt("Tooltip",[Mr]),na=Mr(),vj="TooltipProvider",xj=700,ol="tooltip.open",[bj,yu]=gu(vj),wj=vt(t=>{const{__scopeTooltip:e,delayDuration:n=xj,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=t,i=m.useRef(!0),c=m.useRef(!1),l=m.useRef(0);return m.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),a.jsx(bj,{scope:e,isOpenDelayedRef:i,delayDuration:n,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(l.current),i.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:c,onPointerInTransitChange:m.useCallback(u=>{c.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),sl="Tooltip",[Cj,Ts]=gu(sl),Sj=vt(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:c}=t,l=yu(sl,t.__scopeTooltip),u=na(e),[d,f]=m.useState(null),[h,p]=m.useState(void 0),g=Et(),b=m.useRef(0),x=i??l.disableHoverableContent,y=c??l.delayDuration,w=m.useRef(!1),[C,S]=lt({prop:r,defaultProp:o??!1,onChange:vt(A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(ol))):l.onClose(),s==null||s(A)},"onChange"),caller:sl}),M=m.useMemo(()=>C?w.current?"delayed-open":"instant-open":"closed",[C]),R=m.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,S(!0)},[S]),P=m.useCallback(()=>{window.clearTimeout(b.current),b.current=0,S(!1)},[S]),T=m.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{w.current=!0,S(!0),b.current=0},y)},[y,S]);m.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const j=h??g;return a.jsx(Ss,{...u,children:a.jsx(Cj,{scope:e,contentId:j,setContentId:p,open:C,stateAttribute:M,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayedRef.current?T():R()},[l.isOpenDelayedRef,T,R]),onTriggerLeave:m.useCallback(()=>{x?P():(window.clearTimeout(b.current),b.current=0)},[P,x]),onOpen:R,onClose:P,disableHoverableContent:x,children:n})})},"Tooltip"),sh="TooltipTrigger",Mj=m.forwardRef(vt(function(e,n){const{__scopeTooltip:r,...o}=e,s=Ts(sh,r),i=yu(sh,r),c=na(r),l=m.useRef(null),u=_e(n,l,s.onTriggerChange),d=m.useRef(!1),f=m.useRef(!1),h=m.useCallback(()=>d.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),a.jsx(Ms,{asChild:!0,...c,children:a.jsx(Ne.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:u,onPointerMove:ge(e.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:ge(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:ge(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ge(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:ge(e.onBlur,s.onClose),onClick:ge(e.onClick,s.onClose)})})},"TooltipTrigger")),fy="TooltipPortal",[Rj,Tj]=gu(fy,{forceMount:void 0}),jj=vt(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,s=Ts(fy,e);return a.jsx(Rj,{scope:e,forceMount:n,children:a.jsx($t,{present:n||s.open,children:a.jsx(Rs,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),ss="TooltipContent",Pj=m.forwardRef(vt(function(e,n){const r=Tj(ss,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=e,c=Ts(ss,e.__scopeTooltip);return a.jsx($t,{present:o||c.open,children:c.disableHoverableContent?a.jsx(hy,{side:s,...i,ref:n}):a.jsx(Nj,{side:s,...i,ref:n})})},"TooltipContent")),Nj=m.forwardRef(vt(function(e,n){const r=Ts(ss,e.__scopeTooltip),o=yu(ss,e.__scopeTooltip),s=m.useRef(null),i=_e(n,s),[c,l]=m.useState(null),{trigger:u,onClose:d}=r,f=s.current,{onPointerInTransitChange:h}=o,p=m.useCallback(()=>{l(null),h(!1)},[h]),g=m.useCallback((b,x)=>{const y=b.currentTarget,w={x:b.clientX,y:b.clientY},C=py(w,y.getBoundingClientRect()),S=my(w,C),M=gy(x.getBoundingClientRect()),R=vy([...S,...M]);l(R),h(!0)},[h]);return m.useEffect(()=>()=>p(),[p]),m.useEffect(()=>{if(u&&f){const b=vt(y=>g(y,f),"handleTriggerLeave"),x=vt(y=>g(y,u),"handleContentLeave");return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",x),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",x)}}},[u,f,g,p]),m.useEffect(()=>{if(c){const b=vt(x=>{const y=x.target,w={x:x.clientX,y:x.clientY},C=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),S=!yy(w,c);C?p():S&&(p(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,c,d,p]),a.jsx(hy,{...e,ref:i})},"TooltipContentHoverable")),Ej=tp("TooltipContent"),hy=m.forwardRef(vt(function(e,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:c,onPointerDownOutside:l,...u}=e,d=Ts(ss,r),f=na(r),{onClose:h}=d;m.useEffect(()=>(document.addEventListener(ol,h),()=>document.removeEventListener(ol,h)),[h]),m.useEffect(()=>{if(d.trigger){const g=vt(b=>{b.target instanceof Node&&b.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:p}=d;return mt(()=>(p(i),()=>{p(void 0)}),[i,p]),a.jsx(ws,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:a.jsxs(ta,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.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:[a.jsx(Ej,{children:o}),s?a.jsx(gj,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),kj=m.forwardRef(vt(function(e,n){const{__scopeTooltip:r,...o}=e,s=na(r);return a.jsx(sy,{...s,...o,ref:n})},"TooltipArrow"));function py(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}vt(py,"getExitSideFromRect");function my(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}vt(my,"getPaddedExitPoints");function gy(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}vt(gy,"getPointsFromRect");function yy(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const c=e[s],l=e[i],u=c.x,d=c.y,f=l.x,h=l.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}vt(yy,"isPointInPolygon");function vy(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),xy(e)}vt(vy,"getHull");function xy(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}vt(xy,"getHullPresorted");var Aj=wj,by=Sj,wy=Mj,Cy=jj,Sy=Pj,Ij=kj;const Dj=300,$j=500,_j=2e3,My=({delayDuration:t=Dj,children:e,...n})=>a.jsx(Aj,{delayDuration:t,...n,children:e}),Ry=v.forwardRef(function({children:e,content:n,side:r="top",align:o="center",sideOffset:s=6,delayDuration:i,open:c,longPress:l=!0,disabled:u,contentClassName:d,contentStyle:f,sx:h},p){const{className:g,style:b,styleTag:x}=Ae(h,f,"cny-tooltip-content",d),[y,w]=v.useState(!1),C=v.useRef(void 0),S=v.useRef(void 0);if(v.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(S.current)},[]),u)return a.jsx(a.Fragment,{children:e});const M=v.isValidElement(e)?e:null,P=!!M&&(M.props.disabled===!0||M.props["aria-disabled"]===!0||M.props["aria-disabled"]==="true")?a.jsx("span",{className:"cny-tooltip-wrap",tabIndex:0,style:{display:"inline-flex"},children:e}):e,T=()=>clearTimeout(C.current),j=l&&c===void 0?{onPointerDown:A=>{A.pointerType==="touch"&&(clearTimeout(S.current),C.current=setTimeout(()=>{w(!0),S.current=setTimeout(()=>w(!1),_j)},$j))},onPointerUp:T,onPointerMove:T,onPointerCancel:T}:void 0;return a.jsxs(by,{delayDuration:i,open:c??(l?y:void 0),onOpenChange:l&&c===void 0?w:void 0,children:[a.jsx(wy,{asChild:!0,...j,children:P}),a.jsx(Cy,{children:a.jsxs(Sy,{ref:p,side:r,align:o,sideOffset:s,className:g,style:b,children:[x,n,a.jsx(Ij,{className:"cny-tooltip-arrow",width:10,height:5})]})})]})}),Oj=by,Lj=wy,Fj=v.forwardRef(function({className:e,...n},r){return a.jsx(Cy,{children:a.jsx(Sy,{ref:r,className:ne("cny-tooltip-content",e),...n})})}),Ty="(max-width: 900px)",Vj="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]",Bj=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(Ty).matches,jy=v.createContext(!1),Uj=v.forwardRef(function({width:e="default",sticky:n=!1,collapsed:r=!1,persistKey:o,onCollapsedChange:s,responsive:i=!1,mobileOpen:c=!1,onMobileOpenChange:l,surface:u="base",className:d,style:f,sx:h,children:p,...g},b){const x=i&&!!l,y=x&&c,w=v.useRef(null),[C,S]=v.useState(null),M=v.useRef(!1);v.useEffect(()=>{if(o)try{const I=window.localStorage.getItem(o);if(I==="true"||I==="false"){const k=I==="true";S(k),k!==r&&(s==null||s(k))}}catch{}},[o]),v.useEffect(()=>{if(!M.current){M.current=!0;return}if(S(null),!!o)try{window.localStorage.setItem(o,String(r))}catch{}},[r]);const R=C??r,[P,T]=v.useState(()=>Bj());v.useEffect(()=>{var q;if(!x||typeof window.matchMedia!="function")return;const I=window.matchMedia(Ty),k=()=>T(I.matches);return k(),(q=I.addEventListener)==null||q.call(I,"change",k),()=>{var U;return(U=I.removeEventListener)==null?void 0:U.call(I,"change",k)}},[x]);const j=y&&P;v.useEffect(()=>{var U;if(!y)return;const I=document.activeElement;let k=null;if(j){const E=((U=w.current)==null?void 0:U.querySelector('[data-cny-sidebar-item][tabindex="0"]'))??w.current;E==null||E.focus(),k=document.body.style.overflow,document.body.style.overflow="hidden"}const q=E=>{if(E.key==="Escape"){l==null||l(!1);return}if(E.key!=="Tab"||!j||!w.current)return;const $=Array.from(w.current.querySelectorAll(Vj)).filter(D=>D.tabIndex>=0&&D.getClientRects().length>0);if($.length===0){E.preventDefault(),w.current.focus();return}const X=$[0],K=$[$.length-1],ue=document.activeElement;!w.current.contains(ue)||ue===w.current?(E.preventDefault(),(E.shiftKey?K:X).focus()):E.shiftKey&&ue===X?(E.preventDefault(),K.focus()):!E.shiftKey&&ue===K&&(E.preventDefault(),X.focus())};return document.addEventListener("keydown",q),()=>{document.removeEventListener("keydown",q),k!==null&&(document.body.style.overflow=k),j&&I&&I!==document.body&&document.contains(I)&&I.focus()}},[y,j,l]);const{className:A,style:_,styleTag:L}=Ae(h,f,"cny-sidebar",e!=="default"&&e,n&&"sticky",R&&!y&&"collapsed",i&&"responsive",u==="raised"&&"raised",x&&"mobile-drawer",y&&"mobile-open",d);return a.jsxs(a.Fragment,{children:[x&&a.jsx("div",{className:ne("cny-sidebar-backdrop",y&&"open"),"aria-hidden":"true",onClick:()=>l==null?void 0:l(!1)}),a.jsxs("aside",{ref:I=>{w.current=I,typeof b=="function"?b(I):b&&(b.current=I)},tabIndex:x?-1:void 0,role:j?"dialog":void 0,"aria-modal":j?!0:void 0,"aria-label":j&&!g["aria-labelledby"]&&!g["aria-label"]?"Menu":void 0,className:A,style:_,...g,children:[L,a.jsx(jy.Provider,{value:R&&!y,children:a.jsx(My,{delayDuration:200,children:p})})]})]})}),Hj=v.forwardRef(function({className:e,children:n,...r},o){return a.jsx("div",{ref:o,className:ne("cny-sidebar-header",e),...r,children:n})}),Gj=v.forwardRef(function({className:e,children:n,...r},o){return a.jsx("div",{ref:o,className:ne("cny-sidebar-footer",e),...r,children:n})}),zj=v.forwardRef(function({collapsed:e=!1,onClick:n,className:r,children:o,...s},i){return a.jsx("button",{ref:i,type:"button","aria-expanded":!e,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:ne("cny-sidebar-toggle",e&&"collapsed",r),onClick:n,...s,children:o??a.jsx(dR,{size:16,"aria-hidden":"true"})})});function il(t){const e=Array.from(t.querySelectorAll("[data-cny-sidebar-item]")),n=[];if(e.forEach(o=>{o.hasAttribute("aria-disabled")?o.setAttribute("tabindex","-1"):n.push(o)}),n.length===0)return;const r=n.find(o=>o.classList.contains("active"))??n[0];n.forEach(o=>o.setAttribute("tabindex",o===r?"0":"-1"))}const Wj=v.forwardRef(function({title:e,className:n,children:r,...o},s){const i=v.useRef(null),c=v.useCallback(l=>{const u=i.current;if(!u)return;const f=Array.from(u.querySelectorAll("[data-cny-sidebar-item]")).filter(b=>!b.hasAttribute("aria-disabled"));if(f.length===0)return;const h=f.findIndex(b=>b===document.activeElement);let p=h;switch(l.key){case"ArrowDown":l.preventDefault(),p=h<f.length-1?h+1:0;break;case"ArrowUp":l.preventDefault(),p=h<=0?f.length-1:h-1;break;case"Home":l.preventDefault(),p=0;break;case"End":l.preventDefault(),p=f.length-1;break;default:return}const g=f[p];g&&g!==document.activeElement&&(f.forEach(b=>b.setAttribute("tabindex","-1")),g.setAttribute("tabindex","0"),g.focus())},[]);return v.useLayoutEffect(()=>{const l=i.current;if(!l||(il(l),typeof MutationObserver>"u"))return;const u=new MutationObserver(()=>il(l));return u.observe(l,{childList:!0,subtree:!0}),()=>u.disconnect()},[]),a.jsxs("div",{ref:s,className:ne("cny-sidebar-section",n),...o,children:[e&&a.jsx("div",{className:"cny-sidebar-title",children:e}),a.jsx("nav",{ref:i,className:"cny-sidebar-nav",onKeyDown:c,children:r})]})}),Kj=v.forwardRef(function({active:e=!1,disabled:n=!1,icon:r,badge:o,tooltip:s,className:i,children:c,...l},u){const d=v.useRef(null),f=v.useId(),h=v.useContext(jy);v.useLayoutEffect(()=>{const x=d.current;if(!x)return;const y=x.closest('[class*="cny-sidebar-nav"]');y&&il(y)},[e,n]);const p=h&&typeof c=="string"&&!l["aria-label"]?typeof o=="string"||typeof o=="number"?`${c} ${o}`:c:void 0,g=s??(typeof c=="string"?c:void 0),b=a.jsxs("a",{ref:x=>{d.current=x,typeof u=="function"?u(x):u&&(u.current=x)},"data-cny-sidebar-item":f,"aria-current":e?"page":void 0,"aria-disabled":n||void 0,"aria-label":p,className:ne("cny-sidebar-item",e&&"active",n&&"disabled",i),...l,onClick:x=>{var y;if(n){x.preventDefault();return}(y=l.onClick)==null||y.call(l,x)},children:[r&&a.jsx("span",{className:"cny-sidebar-item-icon","aria-hidden":"true",children:r}),a.jsx("span",{className:"cny-sidebar-item-label",children:c}),o&&a.jsx("span",{className:"cny-sidebar-item-badge",children:o})]});return h&&g?a.jsx(Ry,{content:g,side:"right",children:b}):b});function Yj(t){const e=[];return t.display&&e.push(t.display),t.direction==="row"?e.push("flex-row"):t.direction==="column"?e.push("flex-col"):t.direction==="row-reverse"?e.push("flex-row-reverse"):t.direction==="column-reverse"&&e.push("flex-col-reverse"),t.align&&e.push(`items-${t.align==="start"||t.align==="end",t.align}`),t.justify&&e.push(`justify-${t.justify}`),t.wrap&&e.push("flex-wrap"),t.p!==void 0&&e.push(`p-${t.p}`),t.px!==void 0&&e.push(`px-${t.px}`),t.py!==void 0&&e.push(`py-${t.py}`),t.pt!==void 0&&e.push(`pt-${t.pt}`),t.pr!==void 0&&e.push(`pr-${t.pr}`),t.pb!==void 0&&e.push(`pb-${t.pb}`),t.pl!==void 0&&e.push(`pl-${t.pl}`),t.m!==void 0&&e.push(`m-${t.m}`),t.mx!==void 0&&e.push(`mx-${t.mx}`),t.my!==void 0&&e.push(`my-${t.my}`),t.mt!==void 0&&e.push(`mt-${t.mt}`),t.mr!==void 0&&e.push(`mr-${t.mr}`),t.mb!==void 0&&e.push(`mb-${t.mb}`),t.ml!==void 0&&e.push(`ml-${t.ml}`),t.gap!==void 0&&e.push(`gap-${t.gap}`),t.gapX!==void 0&&e.push(`gap-x-${t.gapX}`),t.gapY!==void 0&&e.push(`gap-y-${t.gapY}`),t.w&&e.push(`w-${t.w}`),t.h&&e.push(`h-${t.h}`),t.grow&&e.push("flex-1"),e}const Kr=v.forwardRef(function({as:e,className:n,style:r,children:o,...s},i){const c=e??"div",{layoutProps:l,domProps:u}=Xj(s),{sx:d,...f}=l,h=d?jl(d):void 0,p=ne(...Yj(f),h==null?void 0:h.className,n),g=h!=null&&h.style||r?{...h==null?void 0:h.style,...r}:void 0,b=v.createElement(c,{ref:i,className:p||void 0,style:g,...u},o);return h!=null&&h.css?v.createElement(v.Fragment,null,v.createElement(Tl,{css:h.css}),b):b});function Xj(t){const e=new Set(["p","px","py","pt","pr","pb","pl","m","mx","my","mt","mr","mb","ml","gap","gapX","gapY","display","direction","align","justify","wrap","w","h","grow","sx"]),n={},r={};for(const[o,s]of Object.entries(t))e.has(o)?n[o]=s:r[o]=s;return{layoutProps:n,domProps:r}}const qj=v.forwardRef(function(e,n){return a.jsx(Kr,{ref:n,display:"flex",direction:"column",...e})}),Zj=v.forwardRef(function(e,n){const{align:r="center",...o}=e;return a.jsx(Kr,{ref:n,display:"flex",direction:"row",align:r,...o})}),ih=t=>t.map(e=>`minmax(0,${e}fr)`).join(" "),Jj=v.forwardRef(function({cols:e,minColWidth:n,ratio:r,template:o,className:s,sx:i,...c},l){let u;if(o)u=o;else if(r)if(Array.isArray(r))u=ih(r);else{const f={};for(const[h,p]of Object.entries(r))p&&(f[h]=ih(p));u=f}else n&&(u=`repeat(auto-fit, minmax(${n}, 1fr))`);const d=u?{gridTemplateColumns:u,...i??{}}:i;return a.jsx(Kr,{ref:l,display:"grid",className:ne(!u&&e&&`grid-cols-${e}`,s),sx:d,...c})}),Qj=v.forwardRef(function({size:e="lg",className:n,...r},o){return a.jsx(Kr,{ref:o,className:ne("cny-container",e,n),...r})}),eP=v.forwardRef(function({orientation:e="horizontal",className:n,style:r,sx:o,...s},i){const{className:c,style:l,styleTag:u}=Ae(o,r,"cny-divider",e,n);return e==="vertical"?a.jsxs(a.Fragment,{children:[u,a.jsx("span",{ref:i,role:"separator","aria-orientation":"vertical",className:c,style:l,...s})]}):a.jsxs(a.Fragment,{children:[u,a.jsx("hr",{ref:i,className:c,style:l,...s})]})}),tP=v.forwardRef(function({className:e,style:n,sx:r,...o},s){const{className:i,style:c,styleTag:l}=Ae(r,n,"cny-spacer",e);return a.jsx("span",{ref:s,"aria-hidden":"true",className:i,style:c,...o,children:l})}),nP=v.forwardRef(function({ratio:e=16/9,className:n,style:r,sx:o,children:s,...i},c){const{className:l,style:u,styleTag:d}=Ae(o,{aspectRatio:String(e),...r},"aspect-ratio",n);return a.jsxs("div",{ref:c,className:l,style:u,...i,children:[d,s]})}),rP=v.forwardRef(function(e,n){return a.jsx(Kr,{ref:n,display:"flex",align:"center",justify:"center",...e})}),oP=v.forwardRef(function(e,n){const{align:r="center",gap:o=2,wrap:s=!0,...i}=e;return a.jsx(Kr,{ref:n,display:"flex",direction:"row",align:r,gap:o,wrap:s,...i})}),sP={display:"h1",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",small:"small",caption:"span",code:"code",kbd:"kbd"},iP=v.forwardRef(function({as:e,variant:n="body",weight:r,align:o,color:s,truncate:i=!1,className:c,style:l,sx:u,children:d,...f},h){const p=e??sP[n],{className:g,style:b,styleTag:x}=Ae(u,l,"cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",c);return v.createElement(p,{ref:h,className:g,style:b,...f},x,d)});function aP({label:t,hint:e,error:n,required:r=!1,optional:o=!1,counter:s,maxLength:i,state:c,className:l,style:u,sx:d,children:f,...h}){const p=v.useId(),g=v.Children.toArray(f),b=g.find(v.isValidElement);if(!b)throw new Error("<Field> needs a form control as a child.");const x=b.props.id??p,y=n!=null&&n!==!1,w=c??(y?"danger":"default"),C=e||n?`${x}-hint`:void 0,S=t!=null?`${x}-label`:void 0,M=b.props,R=v.cloneElement(b,{id:x,"aria-labelledby":M["aria-labelledby"]??(M["aria-label"]?void 0:S),"aria-invalid":y||b.props["aria-invalid"]||void 0,"aria-describedby":ne(b.props["aria-describedby"],C)||void 0,className:ne(b.props.className,w!=="default"&&w)}),P=i!=null&&s!=null&&s>i?"danger":"default",{className:T,style:j,styleTag:A}=Ae(d,u,"cny-field",l);return a.jsxs("div",{className:T,style:j,...h,children:[A,(t!=null||s!=null)&&a.jsxs("div",{className:"cny-field-label-row",children:[t!=null?a.jsxs("label",{id:S,htmlFor:x,className:"cny-field-label",children:[t,r&&a.jsx("span",{className:"cny-field-required","aria-hidden":"true",children:"*"}),o&&!r&&a.jsx("span",{className:"cny-field-optional",children:"optional"})]}):a.jsx("span",{}),s!=null&&a.jsx("span",{className:ne("cny-field-counter",P==="danger"&&"danger"),"aria-live":"polite",children:i!=null?`${s}/${i}`:s})]}),g.map(_=>_===b?R:_),(n||e)&&a.jsx("span",{id:C,className:ne("cny-field-hint",w!=="default"&&w),role:y?"alert":void 0,children:n??e})]})}const cP=v.forwardRef(function({color:e="primary",size:n,autoGrow:r=!1,maxRows:o=12,showCount:s=!1,maxLength:i,className:c,style:l,sx:u,onChange:d,...f},h){const p=v.useRef(null);v.useImperativeHandle(h,()=>p.current,[]);const g=v.useId(),[b,x]=v.useState(String(f.value??f.defaultValue??"").length);v.useEffect(()=>{f.value!==void 0&&x(String(f.value).length)},[f.value]);const y=v.useCallback(()=>{const P=p.current;if(!P||!r)return;const T=P.style.height;P.style.transition="none",P.style.height="auto";const A=(parseFloat(getComputedStyle(P).lineHeight)||20)*o,_=Math.min(P.scrollHeight,A);P.style.overflowY=P.scrollHeight>A?"auto":"hidden",P.style.height=T||`${_}px`,P.offsetHeight,P.style.transition="",P.style.height=`${_}px`},[r,o]);v.useEffect(()=>{y()},[y,f.value,f.defaultValue]);const w=P=>{x(P.target.value.length),d==null||d(P),r&&y()},{className:C,style:S,styleTag:M}=Ae(u,l,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",c),R=a.jsx("textarea",{ref:p,className:C,style:S,onChange:w,maxLength:i,...f,"aria-describedby":s?[f["aria-describedby"],g].filter(Boolean).join(" "):f["aria-describedby"]});return a.jsxs(a.Fragment,{children:[M,s?a.jsxs("span",{className:"cny-input-counted",children:[R,a.jsxs("span",{id:g,className:"cny-input-count",children:[b,i!=null?`/${i}`:""]})]}):R]})});var lP=Object.defineProperty,uP=(t,e)=>lP(t,"name",{value:e,configurable:!0});function is(t,[e,n]){return Math.min(n,Math.max(e,t))}uP(is,"clamp");var dP=Object.defineProperty,vu=(t,e)=>dP(t,"name",{value:e,configurable:!0}),Ks=0,Nn=null;function fP(t){return Do(),t.children}vu(fP,"FocusGuards");function Do(){m.useEffect(()=>{Nn||(Nn={start:al(),end:al()});const{start:t,end:e}=Nn;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),Ks++,()=>{Ks===1&&(Nn==null||Nn.start.remove(),Nn==null||Nn.end.remove(),Nn=null),Ks=Math.max(0,Ks-1)}},[])}vu(Do,"useFocusGuards");function al(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}vu(al,"createFocusGuard");var hP=Object.defineProperty,Vt=(t,e)=>hP(t,"name",{value:e,configurable:!0}),Ja="focusScope.autoFocusOnMount",Qa="focusScope.autoFocusOnUnmount",ah={bubbles:!1,cancelable:!0},ra=m.forwardRef(Vt(function(e,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...c}=e,[l,u]=m.useState(null),d=zt(s),f=zt(i),h=m.useRef(null),p=_e(n,u),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(o){let x=function(S){if(g.paused||!l)return;const M=S.target;l.contains(M)?h.current=M:Yn(h.current,{select:!0})},y=function(S){if(g.paused||!l)return;const M=S.relatedTarget;M!==null&&(l.contains(M)||Yn(h.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const R of S)R.removedNodes.length>0&&Yn(l)};Vt(x,"handleFocusIn"),Vt(y,"handleFocusOut"),Vt(w,"handleMutations"),document.addEventListener("focusin",x),document.addEventListener("focusout",y);const C=new MutationObserver(w);return l&&C.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",y),C.disconnect()}}},[o,l,g.paused]),m.useEffect(()=>{if(l){ch.add(g);const x=document.activeElement;if(!l.contains(x)){const w=new CustomEvent(Ja,ah);l.addEventListener(Ja,d),l.dispatchEvent(w),w.defaultPrevented||(Py(Iy(xu(l)),{select:!0}),document.activeElement===x&&Yn(l))}return()=>{l.removeEventListener(Ja,d),setTimeout(()=>{const w=new CustomEvent(Qa,ah);l.addEventListener(Qa,f),l.dispatchEvent(w),w.defaultPrevented||Yn(x??document.body,{select:!0}),l.removeEventListener(Qa,f),ch.remove(g)},0)}}},[l,d,f,g]);const b=m.useCallback(x=>{if(!r&&!o||g.paused)return;const y=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,w=document.activeElement;if(y&&w){const C=x.currentTarget,[S,M]=Ny(C);S&&M?!x.shiftKey&&w===M?(x.preventDefault(),r&&Yn(S,{select:!0})):x.shiftKey&&w===S&&(x.preventDefault(),r&&Yn(M,{select:!0})):w===C&&x.preventDefault()}},[r,o,g.paused]);return a.jsx(Ne.div,{tabIndex:-1,...c,ref:p,onKeyDown:b})},"FocusScope"));function Py(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Yn(r,{select:e}),document.activeElement!==n)return}Vt(Py,"focusFirst");function Ny(t){const e=xu(t),n=cl(e,t),r=cl(e.reverse(),t);return[n,r]}Vt(Ny,"getTabbableEdges");function xu(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Vt(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}Vt(xu,"getTabbableCandidates");function cl(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Ey(r,{upTo:e})))return r}Vt(cl,"findVisible");function Ey(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}Vt(Ey,"isHidden");function ky(t){return t instanceof HTMLInputElement&&"select"in t}Vt(ky,"isSelectableInput");function Yn(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&ky(t)&&e&&t.select()}}Vt(Yn,"focus");var ch=Ay();function Ay(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=ll(t,e),t.unshift(e)},remove(e){var n;t=ll(t,e),(n=t[0])==null||n.resume()}}}Vt(Ay,"createFocusScopesStack");function ll(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Vt(ll,"arrayRemove");function Iy(t){return t.filter(e=>e.tagName!=="A")}Vt(Iy,"removeLinks");var pP=Object.defineProperty,mP=(t,e)=>pP(t,"name",{value:e,configurable:!0});function bu(t){const e=m.useRef({value:t,previous:t});return m.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}mP(bu,"usePrevious");var gP=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},no=new WeakMap,Ys=new WeakMap,Xs={},ec=0,Dy=function(t){return t&&(t.host||Dy(t.parentNode))},yP=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Dy(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},vP=function(t,e,n,r){var o=yP(e,Array.isArray(t)?t:[t]);Xs[n]||(Xs[n]=new WeakMap);var s=Xs[n],i=[],c=new Set,l=new Set(o),u=function(f){!f||c.has(f)||(c.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(c.has(h))d(h);else try{var p=h.getAttribute(r),g=p!==null&&p!=="false",b=(no.get(h)||0)+1,x=(s.get(h)||0)+1;no.set(h,b),s.set(h,x),i.push(h),b===1&&g&&Ys.set(h,!0),x===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(e),c.clear(),ec++,function(){i.forEach(function(f){var h=no.get(f)-1,p=s.get(f)-1;no.set(f,h),s.set(f,p),h||(Ys.has(f)||f.removeAttribute(r),Ys.delete(f)),p||f.removeAttribute(n)}),ec--,ec||(no=new WeakMap,no=new WeakMap,Ys=new WeakMap,Xs={})}},oa=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=gP(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),vP(r,o,n,"aria-hidden")):function(){return null}},In=function(){return In=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},In.apply(this,arguments)};function $y(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function xP(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,s;r<o;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var bi="right-scroll-bar-position",wi="width-before-scroll-bar",bP="with-scroll-bars-hidden",wP="--removed-body-scroll-bar-size";function tc(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function CP(t,e){var n=v.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var SP=typeof window<"u"?m.useLayoutEffect:m.useEffect,lh=new WeakMap;function MP(t,e){var n=CP(null,function(r){return t.forEach(function(o){return tc(o,r)})});return SP(function(){var r=lh.get(n);if(r){var o=new Set(r),s=new Set(t),i=n.current;o.forEach(function(c){s.has(c)||tc(c,null)}),s.forEach(function(c){o.has(c)||tc(c,i)})}lh.set(n,t)},[t]),n}function RP(t){return t}function TP(t,e){e===void 0&&(e=RP);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var i=e(s,r);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(s),i=n}var l=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function jP(t){t===void 0&&(t={});var e=TP(null);return e.options=In({async:!0,ssr:!1},t),e}var _y=function(t){var e=t.sideCar,n=$y(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,In({},n))};_y.isSideCarExport=!0;function PP(t,e){return t.useMedium(e),_y}var Oy=jP(),nc=function(){},sa=m.forwardRef(function(t,e){var n=m.useRef(null),r=m.useState({onScrollCapture:nc,onWheelCapture:nc,onTouchMoveCapture:nc}),o=r[0],s=r[1],i=t.forwardProps,c=t.children,l=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,h=t.sideCar,p=t.noRelative,g=t.noIsolation,b=t.inert,x=t.allowPinchZoom,y=t.as,w=y===void 0?"div":y,C=t.gapMode,S=$y(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=h,R=MP([n,e]),P=In(In({},S),o);return m.createElement(m.Fragment,null,d&&m.createElement(M,{sideCar:Oy,removeScrollBar:u,shards:f,noRelative:p,noIsolation:g,inert:b,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:C}),i?m.cloneElement(m.Children.only(c),In(In({},P),{ref:R})):m.createElement(w,In({},P,{className:l,ref:R}),c))});sa.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sa.classNames={fullWidth:wi,zeroRight:bi};var NP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function EP(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=NP();return e&&t.setAttribute("nonce",e),t}function kP(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function AP(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var IP=function(){var t=0,e=null;return{add:function(n){t==0&&(e=EP())&&(kP(e,n),AP(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},DP=function(){var t=IP();return function(e,n){m.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Ly=function(){var t=DP(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},$P={left:0,top:0,right:0,gap:0},rc=function(t){return parseInt(t||"",10)||0},_P=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[rc(n),rc(r),rc(o)]},OP=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return $P;var e=_P(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},LP=Ly(),go="data-scroll-locked",FP=function(t,e,n,r){var o=t.left,s=t.top,i=t.right,c=t.gap;return n===void 0&&(n="margin"),`
200
+ .`.concat(bP,` {
176
201
  overflow: hidden `).concat(r,`;
177
- padding-right: `).concat(a,"px ").concat(r,`;
202
+ padding-right: `).concat(c,"px ").concat(r,`;
178
203
  }
179
- body[`).concat(Yn,`] {
204
+ body[`).concat(go,`] {
180
205
  overflow: hidden `).concat(r,`;
181
206
  overscroll-behavior: contain;
182
207
  `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
@@ -185,41 +210,41 @@
185
210
  padding-right: `).concat(i,`px;
186
211
  margin-left:0;
187
212
  margin-top:0;
188
- margin-right: `).concat(a,"px ").concat(r,`;
189
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
213
+ margin-right: `).concat(c,"px ").concat(r,`;
214
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
190
215
  }
191
216
 
192
- .`).concat(Bo,` {
193
- right: `).concat(a,"px ").concat(r,`;
217
+ .`).concat(bi,` {
218
+ right: `).concat(c,"px ").concat(r,`;
194
219
  }
195
220
 
196
- .`).concat(Go,` {
197
- margin-right: `).concat(a,"px ").concat(r,`;
221
+ .`).concat(wi,` {
222
+ margin-right: `).concat(c,"px ").concat(r,`;
198
223
  }
199
224
 
200
- .`).concat(Bo," .").concat(Bo,` {
225
+ .`).concat(bi," .").concat(bi,` {
201
226
  right: 0 `).concat(r,`;
202
227
  }
203
228
 
204
- .`).concat(Go," .").concat(Go,` {
229
+ .`).concat(wi," .").concat(wi,` {
205
230
  margin-right: 0 `).concat(r,`;
206
231
  }
207
232
 
208
- body[`).concat(Yn,`] {
209
- `).concat(AT,": ").concat(a,`px;
233
+ body[`).concat(go,`] {
234
+ `).concat(wP,": ").concat(c,`px;
210
235
  }
211
- `)},bd=function(){var t=parseInt(document.body.getAttribute(Yn)||"0",10);return isFinite(t)?t:0},XT=function(){p.useEffect(function(){return document.body.setAttribute(Yn,(bd()+1).toString()),function(){var t=bd()-1;t<=0?document.body.removeAttribute(Yn):document.body.setAttribute(Yn,t.toString())}},[])},qT=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;XT();var s=p.useMemo(function(){return WT(o)},[o]);return p.createElement(KT,{styles:YT(s,!e,o,n?"":"!important")})},ya=!1;if(typeof window<"u")try{var bo=Object.defineProperty({},"passive",{get:function(){return ya=!0,!0}});window.addEventListener("test",bo,bo),window.removeEventListener("test",bo,bo)}catch{ya=!1}var $n=ya?{passive:!1}:!1,ZT=function(t){return t.tagName==="TEXTAREA"},hm=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!ZT(t)&&n[e]==="visible")},QT=function(t){return hm(t,"overflowY")},JT=function(t){return hm(t,"overflowX")},wd=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=pm(t,r);if(o){var s=mm(t,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},e1=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},t1=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},pm=function(t,e){return t==="v"?QT(e):JT(e)},mm=function(t,e){return t==="v"?e1(e):t1(e)},n1=function(t,e){return t==="h"&&e==="rtl"?-1:1},r1=function(t,e,n,r,o){var s=n1(t,window.getComputedStyle(e).direction),i=s*r,a=n.target,c=e.contains(a),u=!1,d=i>0,f=0,h=0;do{if(!a)break;var m=mm(t,a),g=m[0],y=m[1],v=m[2],x=y-v-s*g;(g||x)&&pm(t,a)&&(f+=x,h+=g);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},wo=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Cd=function(t){return[t.deltaX,t.deltaY]},Sd=function(t){return t&&"current"in t?t.current:t},o1=function(t,e){return t[0]===e[0]&&t[1]===e[1]},s1=function(t){return`
236
+ `)},uh=function(){var t=parseInt(document.body.getAttribute(go)||"0",10);return isFinite(t)?t:0},VP=function(){m.useEffect(function(){return document.body.setAttribute(go,(uh()+1).toString()),function(){var t=uh()-1;t<=0?document.body.removeAttribute(go):document.body.setAttribute(go,t.toString())}},[])},BP=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;VP();var s=m.useMemo(function(){return OP(o)},[o]);return m.createElement(LP,{styles:FP(s,!e,o,n?"":"!important")})},ul=!1;if(typeof window<"u")try{var qs=Object.defineProperty({},"passive",{get:function(){return ul=!0,!0}});window.addEventListener("test",qs,qs),window.removeEventListener("test",qs,qs)}catch{ul=!1}var ro=ul?{passive:!1}:!1,UP=function(t){return t.tagName==="TEXTAREA"},Fy=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!UP(t)&&n[e]==="visible")},HP=function(t){return Fy(t,"overflowY")},GP=function(t){return Fy(t,"overflowX")},dh=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Vy(t,r);if(o){var s=By(t,r),i=s[1],c=s[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},zP=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},WP=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Vy=function(t,e){return t==="v"?HP(e):GP(e)},By=function(t,e){return t==="v"?zP(e):WP(e)},KP=function(t,e){return t==="h"&&e==="rtl"?-1:1},YP=function(t,e,n,r,o){var s=KP(t,window.getComputedStyle(e).direction),i=s*r,c=n.target,l=e.contains(c),u=!1,d=i>0,f=0,h=0;do{if(!c)break;var p=By(t,c),g=p[0],b=p[1],x=p[2],y=b-x-s*g;(g||y)&&Vy(t,c)&&(f+=y,h+=g);var w=c.parentNode;c=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!l&&c!==document.body||l&&(e.contains(c)||e===c));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},Zs=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},fh=function(t){return[t.deltaX,t.deltaY]},hh=function(t){return t&&"current"in t?t.current:t},XP=function(t,e){return t[0]===e[0]&&t[1]===e[1]},qP=function(t){return`
212
237
  .block-interactivity-`.concat(t,` {pointer-events: none;}
213
238
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
214
- `)},i1=0,Ln=[];function a1(t){var e=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(i1++)[0],s=p.useState(fm)[0],i=p.useRef(t);p.useEffect(function(){i.current=t},[t]),p.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var y=ET([t.lockRef.current],(t.shards||[]).map(Sd),!0).filter(Boolean);return y.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=p.useCallback(function(y,v){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!i.current.allowPinchZoom;var x=wo(y),w=n.current,b="deltaX"in y?y.deltaX:w[0]-x[0],C="deltaY"in y?y.deltaY:w[1]-x[1],P,R=y.target,M=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in y&&M==="h"&&R.type==="range")return!1;var A=window.getSelection(),T=A&&A.anchorNode,E=T?T===R||T.contains(R):!1;if(E)return!1;var N=wd(M,R);if(!N)return!0;if(N?P=M:(P=M==="v"?"h":"v",N=wd(M,R)),!N)return!1;if(!r.current&&"changedTouches"in y&&(b||C)&&(r.current=P),!P)return!0;var _=r.current||P;return r1(_,v,y,_==="h"?b:C)},[]),c=p.useCallback(function(y){var v=y;if(!(!Ln.length||Ln[Ln.length-1]!==s)){var x="deltaY"in v?Cd(v):wo(v),w=e.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&o1(P.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(i.current.shards||[]).map(Sd).filter(Boolean).filter(function(P){return P.contains(v.target)}),C=b.length>0?a(v,b[0]):!i.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(y,v,x,w){var b={name:y,delta:v,target:x,should:w,shadowParent:c1(x)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(C){return C!==b})},1)},[]),d=p.useCallback(function(y){n.current=wo(y),r.current=void 0},[]),f=p.useCallback(function(y){u(y.type,Cd(y),y.target,a(y,t.lockRef.current))},[]),h=p.useCallback(function(y){u(y.type,wo(y),y.target,a(y,t.lockRef.current))},[]);p.useEffect(function(){return Ln.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,$n),document.addEventListener("touchmove",c,$n),document.addEventListener("touchstart",d,$n),function(){Ln=Ln.filter(function(y){return y!==s}),document.removeEventListener("wheel",c,$n),document.removeEventListener("touchmove",c,$n),document.removeEventListener("touchstart",d,$n)}},[]);var m=t.removeScrollBar,g=t.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:s1(o)}):null,m?p.createElement(qT,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function c1(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const l1=$T(dm,a1);var Yr=p.forwardRef(function(t,e){return p.createElement(bs,jt({},t,{ref:e,sideCar:l1}))});Yr.classNames=bs.classNames;var u1=Object.defineProperty,me=(t,e)=>u1(t,"name",{value:e,configurable:!0}),d1=[" ","Enter","ArrowUp","ArrowDown"],f1=[" ","Enter"],Jn="Select",[ws,Rc,h1]=ar(Jn),[Dn,hN]=Pe(Jn,[h1,un]),Tc=un(),[p1,dn]=Dn(Jn),[m1,g1]=Dn(Jn);function gm(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m,form:g,internal_do_not_use_render:y}=t,v=Tc(e),[x,w]=p.useState(null),[b,C]=p.useState(null),[P,R]=p.useState(!1),M=Ht(u),[A,T]=Se({prop:r,defaultProp:o??!1,onChange:s,caller:Jn}),[E,N]=Se({prop:i,defaultProp:a,onChange:c,caller:Jn}),_=p.useRef(null),$=p.useRef(E);p.useEffect(()=>{const j=g?x==null?void 0:x.ownerDocument.getElementById(g):x==null?void 0:x.form;if(j instanceof HTMLFormElement){const B=me(()=>N($.current),"reset");return j.addEventListener("reset",B),()=>j.removeEventListener("reset",B)}},[g,x,N]);const V=x?!!g||!!x.closest("form"):!0,[q,W]=p.useState(new Set),I=Fe(),L=Array.from(q).map(j=>j.props.value).join(";"),O=p.useCallback(j=>{W(B=>new Set(B).add(j))},[]),D=p.useCallback(j=>{W(B=>{const Z=new Set(B);return Z.delete(j),Z})},[]),Y={required:m,trigger:x,onTriggerChange:w,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:P,onValueNodeHasChildrenChange:R,contentId:I,value:E,onValueChange:N,open:A,onOpenChange:T,dir:M,triggerPointerDownPosRef:_,disabled:h,name:d,autoComplete:f,form:g,nativeOptions:q,nativeSelectKey:L,isFormControl:V};return l.jsx(Hr,{...v,children:l.jsx(p1,{scope:e,...Y,children:l.jsx(ws.Provider,{scope:e,children:l.jsx(m1,{scope:e,onNativeOptionAdd:O,onNativeOptionRemove:D,children:xm(y)?y(Y):n})})})})}me(gm,"SelectProvider");var y1=me(t=>{const{__scopeSelect:e,children:n,...r}=t;return l.jsx(gm,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>l.jsxs(l.Fragment,{children:[n,o?l.jsx(Y1,{__scopeSelect:e}):null]})})},"Select"),v1="SelectTrigger",x1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,disabled:o=!1,...s}=e,i=Tc(r),a=dn(v1,r),c=a.disabled||o,u=ae(n,a.onTriggerChange),d=Rc(r),f=p.useRef("touch"),[h,m,g]=Mc(v=>{const x=d().filter(C=>!C.disabled),w=x.find(C=>C.value===a.value),b=Ec(x,v,w);b!==void 0&&a.onValueChange(b.value)}),y=me(v=>{c||(a.onOpenChange(!0),g()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})},"handleOpen");return l.jsx(Wr,{asChild:!0,...i,children:l.jsx(ne.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Xr(a.value)?"":void 0,...s,ref:u,onClick:U(s.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&y(v)}),onPointerDown:U(s.onPointerDown,v=>{f.current=v.pointerType;const x=v.target;x.hasPointerCapture(v.pointerId)&&x.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:U(s.onKeyDown,v=>{const x=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(x&&v.key===" ")&&d1.includes(v.key)&&(y(),v.preventDefault())})})})},"SelectTrigger")),b1="SelectValue",w1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,className:o,style:s,children:i,placeholder:a="",...c}=e,u=dn(b1,r),{onValueNodeHasChildrenChange:d}=u,f=i!==void 0,h=ae(n,u.onValueNodeChange);Ee(()=>{d(f)},[d,f]);const m=Xr(u.value);return l.jsx(ne.span,{...c,asChild:m?!1:c.asChild,ref:h,style:{pointerEvents:"none"},children:l.jsx(p.Fragment,{children:m?a:i},m?"placeholder":"value")})},"SelectValue")),C1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,children:o,...s}=e;return l.jsx(ne.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})},"SelectIcon")),S1="SelectPortal",[P1,R1]=Dn(S1,{forceMount:void 0}),T1=me(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return l.jsx(P1,{scope:t.__scopeSelect,forceMount:n,children:l.jsx(Kr,{asChild:!0,...r})})},"SelectPortal"),Mn="SelectContent",M1=p.forwardRef(me(function(e,n){const r=R1(Mn,e.__scopeSelect),{forceMount:o=r.forceMount,...s}=e,i=dn(Mn,e.__scopeSelect),[a,c]=p.useState();return Ee(()=>{c(new DocumentFragment)},[]),l.jsx(ze,{present:o||i.open,children:({present:u})=>u?l.jsx(A1,{...s,ref:n}):l.jsx(E1,{...s,fragment:a})})},"SelectContent")),E1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,children:o,fragment:s}=e;return s?Or.createPortal(l.jsx(ym,{scope:r,children:l.jsx(ws.Slot,{scope:r,children:l.jsx("div",{ref:n,children:o})})}),s):null},"SelectContentFragment")),pt=10,[ym,Cs]=Dn(Mn),j1=yt("SelectContent.RemoveScroll"),A1=p.forwardRef(me(function(e,n){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:v,avoidCollisions:x,...w}=e,b=dn(Mn,r),[C,P]=p.useState(null),[R,M]=p.useState(null),A=ae(n,P),[T,E]=p.useState(null),[N,_]=p.useState(null),$=Rc(r),[V,q]=p.useState(!1),W=p.useRef(!1);p.useEffect(()=>{if(C)return xs(C)},[C]),lr();const I=p.useCallback(J=>{const[K,...ee]=$().map(F=>F.ref.current),[ue]=ee.slice(-1),X=document.activeElement;for(const F of J)if(F===X||(F==null||F.scrollIntoView({block:"nearest"}),F===K&&R&&(R.scrollTop=0),F===ue&&R&&(R.scrollTop=R.scrollHeight),F==null||F.focus(),document.activeElement!==X))return},[$,R]),L=p.useCallback(()=>I([T,C]),[I,T,C]);p.useEffect(()=>{V&&L()},[V,L]);const{onOpenChange:O,triggerPointerDownPosRef:D}=b;p.useEffect(()=>{if(C){let J={x:0,y:0};const K=me(ue=>{var X,F;J={x:Math.abs(Math.round(ue.pageX)-(((X=D.current)==null?void 0:X.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((F=D.current)==null?void 0:F.y)??0))}},"handlePointerMove"),ee=me(ue=>{J.x<=10&&J.y<=10?ue.preventDefault():ue.composedPath().includes(C)||O(!1),document.removeEventListener("pointermove",K),D.current=null},"handlePointerUp");return D.current!==null&&(document.addEventListener("pointermove",K),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",ee,{capture:!0})}}},[C,O,D]),p.useEffect(()=>{const J=me(()=>O(!1),"close");return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[O]);const[Y,j]=Mc(J=>{const K=$().filter(X=>!X.disabled),ee=K.find(X=>X.ref.current===document.activeElement),ue=Ec(K,J,ee);ue&&setTimeout(()=>{var X;return(X=ue.ref.current)==null?void 0:X.focus()})}),B=p.useCallback((J,K,ee)=>{const ue=!W.current&&!ee;(b.value!==void 0&&b.value===K||ue)&&(E(J),ue&&(W.current=!0))},[b.value]),Z=p.useCallback(()=>C==null?void 0:C.focus(),[C]),H=p.useCallback((J,K,ee)=>{const ue=!W.current&&!ee;(b.value!==void 0&&b.value===K||ue)&&_(J)},[b.value]),se=o==="popper"?Pd:D1,ce=se===Pd?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:v,avoidCollisions:x}:{};return l.jsx(ym,{scope:r,content:C,viewport:R,onViewportChange:M,itemRefCallback:B,selectedItem:T,onItemLeave:Z,itemTextRefCallback:H,focusSelectedItem:L,selectedItemText:N,position:o,isPositioned:V,searchRef:Y,children:l.jsx(Yr,{as:j1,allowPinchZoom:!0,children:l.jsx(fs,{asChild:!0,trapped:b.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:U(s,J=>{var K;(K=b.trigger)==null||K.focus({preventScroll:!0}),J.preventDefault()}),children:l.jsx(zr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(se,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:J=>J.preventDefault(),...w,...ce,onPlaced:()=>q(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:U(w.onKeyDown,J=>{const K=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!K&&J.key.length===1&&j(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let ue=$().filter(X=>!X.disabled).map(X=>X.ref.current);if(["ArrowUp","End"].includes(J.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const X=J.target,F=ue.indexOf(X);ue=ue.slice(F+1)}setTimeout(()=>I(ue)),J.preventDefault()}})})})})})})},"SelectContentImpl")),D1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,onPlaced:o,...s}=e,i=dn(Mn,r),a=Cs(Mn,r),[c,u]=p.useState(null),[d,f]=p.useState(null),h=ae(n,f),m=Rc(r),g=p.useRef(!1),y=p.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:w,focusSelectedItem:b}=a,C=p.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&v&&x&&w){const A=i.trigger.getBoundingClientRect(),T=d.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),N=w.getBoundingClientRect();if(i.dir!=="rtl"){const X=N.left-T.left,F=E.left-X,G=A.left-F,le=A.width+G,ie=Math.max(le,T.width),_e=window.innerWidth-pt,ge=jr(F,[pt,Math.max(pt,_e-ie)]);c.style.minWidth=le+"px",c.style.left=ge+"px"}else{const X=T.right-N.right,F=window.innerWidth-E.right-X,G=window.innerWidth-A.right-F,le=A.width+G,ie=Math.max(le,T.width),_e=window.innerWidth-pt,ge=jr(F,[pt,Math.max(pt,_e-ie)]);c.style.minWidth=le+"px",c.style.right=ge+"px"}const _=m(),$=window.innerHeight-pt*2,V=v.scrollHeight,q=window.getComputedStyle(d),W=parseInt(q.borderTopWidth,10),I=parseInt(q.paddingTop,10),L=parseInt(q.borderBottomWidth,10),O=parseInt(q.paddingBottom,10),D=W+I+V+O+L,Y=Math.min(x.offsetHeight*5,D),j=window.getComputedStyle(v),B=parseInt(j.paddingTop,10),Z=parseInt(j.paddingBottom,10),H=A.top+A.height/2-pt,se=$-H,ce=x.offsetHeight/2,J=x.offsetTop+ce,K=W+I+J,ee=D-K;if(K<=H){const X=_.length>0&&x===_[_.length-1].ref.current;c.style.bottom="0px";const F=d.clientHeight-v.offsetTop-v.offsetHeight,G=Math.max(se,ce+(X?Z:0)+F+L),le=K+G;c.style.height=le+"px"}else{const X=_.length>0&&x===_[0].ref.current;c.style.top="0px";const G=Math.max(H,W+v.offsetTop+(X?B:0)+ce)+ee;c.style.height=G+"px",v.scrollTop=K-H+v.offsetTop}c.style.margin=`${pt}px 0`,c.style.minHeight=Y+"px",c.style.maxHeight=$+"px",o==null||o(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,c,d,v,x,w,i.dir,o]);Ee(()=>C(),[C]);const[P,R]=p.useState();Ee(()=>{d&&R(window.getComputedStyle(d).zIndex)},[d]);const M=p.useCallback(A=>{A&&y.current===!0&&(C(),b==null||b(),y.current=!1)},[C,b]);return l.jsx(I1,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:M,children:l.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:l.jsx(ne.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),Pd=p.forwardRef(me(function(e,n){const{__scopeSelect:r,align:o="start",collisionPadding:s=pt,...i}=e,a=Tc(r);return l.jsx(vs,{...a,...i,ref:n,align:o,collisionPadding:s,style:{boxSizing:"border-box",...i.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)"}})},"SelectPopperPosition")),[I1,k1]=Dn(Mn,{}),Rd="SelectViewport",N1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,nonce:o,...s}=e,i=Cs(Rd,r),a=k1(Rd,r),c=ae(n,i.onViewportChange),u=p.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),l.jsx(ws.Slot,{scope:r,children:l.jsx(ne.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:U(s.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&h){const g=Math.abs(u.current-f.scrollTop);if(g>0){const y=window.innerHeight-pt*2,v=parseFloat(h.style.minHeight),x=parseFloat(h.style.height),w=Math.max(v,x);if(w<y){const b=w+g,C=Math.min(y,b),P=b-C;h.style.height=C+"px",h.style.bottom==="0px"&&(f.scrollTop=P>0?P:0,h.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})},"SelectViewport")),_1="SelectGroup",[O1,$1]=Dn(_1),L1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e,s=Fe();return l.jsx(O1,{scope:r,id:s,children:l.jsx(ne.div,{role:"group","aria-labelledby":s,...o,ref:n})})},"SelectGroup")),F1="SelectLabel",V1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e,s=$1(F1,r);return l.jsx(ne.div,{id:s.id,...o,ref:n})},"SelectLabel")),va="SelectItem",[B1,vm]=Dn(va),G1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,value:o,disabled:s=!1,textValue:i,...a}=e,c=dn(va,r),u=Cs(va,r),d=c.value===o,[f,h]=p.useState(i??""),[m,g]=p.useState(!1),y=Ze(C=>{var P;return(P=u.itemRefCallback)==null?void 0:P.call(u,C,o,s)}),v=ae(n,y),x=Fe(),w=p.useRef("touch"),b=me(()=>{s||(c.onValueChange(o),c.onOpenChange(!1))},"handleSelect");return l.jsx(B1,{scope:r,value:o,disabled:s,textId:x,isSelected:d,onItemTextChange:p.useCallback(C=>{h(P=>P||((C==null?void 0:C.textContent)??"").trim())},[]),children:l.jsx(ws.ItemSlot,{scope:r,value:o,disabled:s,textValue:f,children:l.jsx(ne.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:v,onFocus:U(a.onFocus,()=>g(!0)),onBlur:U(a.onBlur,()=>g(!1)),onClick:U(a.onClick,()=>{w.current!=="mouse"&&b()}),onPointerUp:U(a.onPointerUp,()=>{w.current==="mouse"&&b()}),onPointerDown:U(a.onPointerDown,C=>{w.current=C.pointerType}),onPointerMove:U(a.onPointerMove,C=>{var P;w.current=C.pointerType,s?(P=u.onItemLeave)==null||P.call(u):w.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(a.onPointerLeave,C=>{var P;C.currentTarget===document.activeElement&&((P=u.onItemLeave)==null||P.call(u))}),onKeyDown:U(a.onKeyDown,C=>{var R;s||C.target!==C.currentTarget||((R=u.searchRef)==null?void 0:R.current)!==""&&C.key===" "||(f1.includes(C.key)&&b(),C.key===" "&&C.preventDefault())})})})})},"SelectItem")),Co="SelectItemText",z1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,className:o,style:s,...i}=e,a=dn(Co,r),c=Cs(Co,r),u=vm(Co,r),d=g1(Co,r),[f,h]=p.useState(null),m=Ze(b=>{var C;return(C=c.itemTextRefCallback)==null?void 0:C.call(c,b,u.value,u.disabled)}),g=ae(n,h,u.onItemTextChange,m),y=f==null?void 0:f.textContent,v=p.useMemo(()=>l.jsx("option",{value:u.value,disabled:u.disabled,children:y},u.value),[u.disabled,u.value,y]),{onNativeOptionAdd:x,onNativeOptionRemove:w}=d;return Ee(()=>(x(v),()=>w(v)),[x,w,v]),l.jsxs(l.Fragment,{children:[l.jsx(ne.span,{id:u.textId,...i,ref:g}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!Xr(a.value)?Or.createPortal(i.children,a.valueNode):null]})},"SelectItemText")),U1="SelectItemIndicator",H1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e;return vm(U1,r).isSelected?l.jsx(ne.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),W1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e;return l.jsx(ne.div,{"aria-hidden":!0,...o,ref:n})},"SelectSeparator")),K1="SelectBubbleInput",Y1=p.forwardRef(me(function({__scopeSelect:e,...n},r){const o=dn(K1,e),{value:s,onValueChange:i,required:a,disabled:c,name:u,autoComplete:d,form:f}=o,{nativeOptions:h,nativeSelectKey:m}=o,g=p.useRef(null),y=ae(r,g),v=s??"",x=Pc(v),w=Array.from(h).some(b=>(b.props.value??"")==="");return p.useEffect(()=>{const b=g.current;if(!b)return;const C=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(C,"value").set;if(x!==v&&R){const M=new Event("change",{bubbles:!0});R.call(b,v),b.dispatchEvent(M)}},[x,v]),l.jsxs(ne.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:u,autoComplete:d,disabled:c,form:f,onChange:b=>i(b.target.value),...n,style:{...im,...n.style},ref:y,defaultValue:v,children:[Xr(s)&&!w?l.jsx("option",{value:""}):null,Array.from(h)]},m)},"SelectBubbleInput"));function xm(t){return typeof t=="function"}me(xm,"isFunction");function Xr(t){return t===""||t===void 0}me(Xr,"shouldShowPlaceholder");function Mc(t){const e=Ze(t),n=p.useRef(""),r=p.useRef(0),o=p.useCallback(i=>{const a=n.current+i;e(a),me((function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}),"updateSearch")(a)},[e]),s=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}me(Mc,"useTypeaheadSearch");function Ec(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=bm(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}me(Ec,"findNextItem");function bm(t,e){return t.map((n,r)=>t[(e+r)%t.length])}me(bm,"wrapArray");function X1({placeholder:t,size:e,color:n="primary",triggerIcon:r,triggerClassName:o,contentClassName:s,id:i,className:a,style:c,sx:u,disabled:d,children:f,"aria-invalid":h,"aria-describedby":m,...g}){const{className:y,style:v,styleTag:x}=oe(u,c,"cny-select-trigger",e==="sm"||e==="lg"?e:null,n!=="primary"&&n,a,o),w=ka();return l.jsxs(y1,{disabled:d,...g,children:[l.jsxs(x1,{id:i,"aria-invalid":h,"aria-describedby":m,className:y,style:v,children:[x,r&&l.jsx("span",{style:{display:"inline-flex"},children:r}),l.jsx(w1,{placeholder:t}),l.jsx(C1,{className:"cny-select-chevron",asChild:!0,children:l.jsx(Gr,{size:14,"aria-hidden":"true"})})]}),l.jsx(T1,{children:l.jsx(M1,{position:"popper",sideOffset:4,className:z("cny-select-content",s),children:l.jsx(N1,{className:"cny-select-viewport",nonce:w,children:f})})})]})}const q1=S.forwardRef(function({className:e,children:n,...r},o){return l.jsxs(G1,{ref:o,className:z("cny-select-item",e),...r,children:[l.jsx(z1,{children:n}),l.jsx(H1,{className:"cny-select-indicator",children:l.jsx(nn,{size:14,"aria-hidden":"true"})})]})}),Z1=S.forwardRef(function(e,n){return l.jsx(L1,{ref:n,...e})}),Q1=S.forwardRef(function({className:e,...n},r){return l.jsx(V1,{ref:r,className:z("cny-select-group-label",e),...n})}),J1=S.forwardRef(function({className:e,...n},r){return l.jsx(W1,{ref:r,className:z("cny-select-separator",e),...n})});var eM=Object.defineProperty,wt=(t,e)=>eM(t,"name",{value:e,configurable:!0}),jc="Popover",[wm,pN]=Pe(jc,[un]),qr=un(),[tM,fn]=wm(jc),nM=wt(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=t,a=qr(e),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=Se({prop:r,defaultProp:o??!1,onChange:s,caller:jc});return l.jsx(Hr,{...a,children:l.jsx(tM,{scope:e,contentId:Fe(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:i,children:n})})},"Popover"),rM="PopoverAnchor",oM=p.forwardRef(wt(function(e,n){const{__scopePopover:r,...o}=e,s=fn(rM,r),i=qr(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=s;return p.useEffect(()=>(a(),()=>c()),[a,c]),l.jsx(Wr,{...i,...o,ref:n})},"PopoverAnchor")),sM="PopoverTrigger",iM=p.forwardRef(wt(function(e,n){const{__scopePopover:r,...o}=e,s=fn(sM,r),i=qr(r),a=ae(n,s.triggerRef),c=l.jsx(ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Ac(s.open),...o,ref:a,onClick:U(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:l.jsx(Wr,{asChild:!0,...i,children:c})},"PopoverTrigger")),Cm="PopoverPortal",[aM,cM]=wm(Cm,{forceMount:void 0}),lM=wt(t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,s=fn(Cm,e);return l.jsx(aM,{scope:e,forceMount:n,children:l.jsx(ze,{present:n||s.open,children:l.jsx(Kr,{asChild:!0,container:o,children:r})})})},"PopoverPortal"),Dr="PopoverContent",uM=p.forwardRef(wt(function(e,n){const r=cM(Dr,e.__scopePopover),{forceMount:o=r.forceMount,...s}=e,i=fn(Dr,e.__scopePopover);return l.jsx(ze,{present:o||i.open,children:i.modal?l.jsx(fM,{...s,ref:n}):l.jsx(hM,{...s,ref:n})})},"PopoverContent")),dM=yt("PopoverContent.RemoveScroll"),fM=p.forwardRef(wt(function(e,n){const r=fn(Dr,e.__scopePopover),o=p.useRef(null),s=ae(n,o),i=p.useRef(!1);return p.useEffect(()=>{const a=o.current;if(a)return xs(a)},[]),l.jsx(Yr,{as:dM,allowPinchZoom:!0,children:l.jsx(Sm,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:U(e.onCloseAutoFocus,a=>{var c;a.preventDefault(),i.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:U(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),hM=p.forwardRef(wt(function(e,n){const r=fn(Dr,e.__scopePopover),o=p.useRef(!1),s=p.useRef(!1);return l.jsx(Sm,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"PopoverContentNonModal")),Sm=p.forwardRef(wt(function(e,n){const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=e,m=fn(Dr,r),g=qr(r);return lr(),l.jsx(fs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(zr,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:l.jsx(vs,{"data-state":Ac(m.open),role:"dialog",id:m.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),pM="PopoverClose",mM=p.forwardRef(wt(function(e,n){const{__scopePopover:r,...o}=e,s=fn(pM,r);return l.jsx(ne.button,{type:"button",...o,ref:n,onClick:U(e.onClick,()=>s.onOpenChange(!1))})},"PopoverClose")),gM=p.forwardRef(wt(function(e,n){const{__scopePopover:r,...o}=e,s=qr(r);return l.jsx(tm,{...s,...o,ref:n})},"PopoverArrow"));function Ac(t){return t?"open":"closed"}wt(Ac,"getState");var Ss=nM,Pm=oM,Dc=iM,Ic=lM,Ps=uM,yM=mM,vM=gM,Td=1,xM=.9,bM=.8,wM=.17,wi=.1,Ci=.999,CM=.9999,SM=.99,PM=/[\\\/_+.#"@\[\(\{&]/,RM=/[\\\/_+.#"@\[\(\{&]/g,TM=/[\s-]/,Rm=/[\s-]/g;function xa(t,e,n,r,o,s,i){if(s===e.length)return o===t.length?Td:SM;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var c=r.charAt(s),u=n.indexOf(c,o),d=0,f,h,m,g;u>=0;)f=xa(t,e,n,r,u+1,s+1,i),f>d&&(u===o?f*=Td:PM.test(t.charAt(u-1))?(f*=bM,m=t.slice(o,u-1).match(RM),m&&o>0&&(f*=Math.pow(Ci,m.length))):TM.test(t.charAt(u-1))?(f*=xM,g=t.slice(o,u-1).match(Rm),g&&o>0&&(f*=Math.pow(Ci,g.length))):(f*=wM,o>0&&(f*=Math.pow(Ci,u-o))),t.charAt(u)!==e.charAt(s)&&(f*=CM)),(f<wi&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=xa(t,e,n,r,u+1,s+2,i),h*wi>f&&(f=h*wi)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[a]=d,d}function Md(t){return t.toLowerCase().replace(Rm," ")}function MM(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,xa(t,e,Md(t),Md(e),0,0,{})}var EM=Object.defineProperty,ct=(t,e)=>EM(t,"name",{value:e,configurable:!0}),kc="Dialog",[Tm,mN]=Pe(kc),[jM,Ct]=Tm(kc),Nc=ct(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=t,a=p.useRef(null),c=p.useRef(null),[u,d]=Se({prop:r,defaultProp:o??!1,onChange:s,caller:kc}),[f,h]=p.useState(0),[m,g]=p.useState(0);return l.jsx(jM,{scope:e,triggerRef:a,contentRef:c,contentId:Fe(),titleId:Fe(),descriptionId:Fe(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:h,setDescriptionCount:g,open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(y=>!y),[d]),modal:i,children:n})},"Dialog"),AM="DialogTrigger",Mm=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=Ct(AM,r),i=ae(n,s.triggerRef);return l.jsx(ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Ts(s.open),...o,ref:i,onClick:U(e.onClick,s.onOpenToggle)})},"DialogTrigger")),Em="DialogPortal",[DM,jm]=Tm(Em,{forceMount:void 0}),_c=ct(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,s=Ct(Em,e);return l.jsx(DM,{scope:e,forceMount:n,children:p.Children.map(r,i=>l.jsx(ze,{present:n||s.open,children:l.jsx(Kr,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),ba="DialogOverlay",Oc=p.forwardRef(ct(function(e,n){const r=jm(ba,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=Ct(ba,e.__scopeDialog);return i.modal?l.jsx(ze,{present:o||i.open,children:l.jsx(kM,{...s,ref:n})}):null},"DialogOverlay")),IM=yt("DialogOverlay.RemoveScroll"),kM=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=Ct(ba,r),i=Ap(),a=ae(n,i);return l.jsx(Yr,{as:IM,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(ne.div,{"data-state":Ts(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Ir="DialogContent",$c=p.forwardRef(ct(function(e,n){const r=jm(Ir,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=Ct(Ir,e.__scopeDialog);return l.jsx(ze,{present:o||i.open,children:i.modal?l.jsx(NM,{...s,ref:n}):l.jsx(_M,{...s,ref:n})})},"DialogContent")),NM=p.forwardRef(ct(function(e,n){const r=Ct(Ir,e.__scopeDialog),o=p.useRef(null),s=ae(n,r.contentRef,o);return p.useEffect(()=>{const i=o.current;if(i)return xs(i)},[]),l.jsx(Am,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:U(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:U(e.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),_M=p.forwardRef(ct(function(e,n){const r=Ct(Ir,e.__scopeDialog),o=p.useRef(!1),s=p.useRef(!1);return l.jsx(Am,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Am=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=e,c=Ct(Ir,r);return lr(),l.jsx(l.Fragment,{children:l.jsx(fs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(zr,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Ts(c.open),...a,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),OM="DialogTitle",Lc=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=Ct(OM,r),{setTitleCount:i}=s;return Ee(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),l.jsx(ne.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),$M="DialogDescription",Fc=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=Ct($M,r),{setDescriptionCount:i}=s;return Ee(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),l.jsx(ne.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),LM="DialogClose",Rs=p.forwardRef(ct(function(e,n){const{__scopeDialog:r,...o}=e,s=Ct(LM,r);return l.jsx(ne.button,{type:"button",...o,ref:n,onClick:U(e.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Ts(t){return t?"open":"closed"}ct(Ts,"getState");function Ed(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function er(...t){return e=>{let n=!1;const r=t.map(o=>{const s=Ed(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ed(t[o],null)}}}}function FM(t){const e=VM(t),n=p.forwardRef((r,o)=>{const{children:s,...i}=r,a=p.Children.toArray(s),c=a.find(GM);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return l.jsx(e,{...i,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return l.jsx(e,{...i,ref:o,children:s})});return n.displayName=`${t}.Slot`,n}function VM(t){const e=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const i=UM(o),a=zM(s,o.props);return o.type!==p.Fragment&&(a.ref=r?er(r,i):i),p.cloneElement(o,a)}return p.Children.count(o)>1?p.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var BM=Symbol("radix.slottable");function GM(t){return p.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===BM}function zM(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}function UM(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var HM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hn=HM.reduce((t,e)=>{const n=FM(`Primitive.${e}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),WM=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},KM=p[" useId ".trim().toString()]||(()=>{}),YM=0;function Xn(t){const[e,n]=p.useState(KM());return WM(()=>{n(r=>r??String(YM++))},[t]),e?`radix-${e}`:""}var yr='[cmdk-group=""]',Si='[cmdk-group-items=""]',XM='[cmdk-group-heading=""]',Dm='[cmdk-item=""]',jd=`${Dm}:not([aria-disabled="true"])`,wa="cmdk-item-select",Bn="data-value",qM=(t,e,n)=>MM(t,e,n),Im=p.createContext(void 0),Zr=()=>p.useContext(Im),km=p.createContext(void 0),Vc=()=>p.useContext(km),Nm=p.createContext(void 0),_m=p.forwardRef((t,e)=>{let n=Gn(()=>{var j,B;return{search:"",value:(B=(j=t.value)!=null?j:t.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Gn(()=>new Set),o=Gn(()=>new Map),s=Gn(()=>new Map),i=Gn(()=>new Set),a=Om(t),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:m,loop:g,disablePointerSelection:y=!1,vimBindings:v=!0,...x}=t,w=Xn(),b=Xn(),C=Xn(),P=p.useRef(null),R=aE();En(()=>{if(d!==void 0){let j=d.trim();n.current.value=j,M.emit()}},[d]),En(()=>{R(6,$)},[]);let M=p.useMemo(()=>({subscribe:j=>(i.current.add(j),()=>i.current.delete(j)),snapshot:()=>n.current,setState:(j,B,Z)=>{var H,se,ce,J;if(!Object.is(n.current[j],B)){if(n.current[j]=B,j==="search")_(),E(),R(1,N);else if(j==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let K=document.getElementById(C);K?K.focus():(H=document.getElementById(w))==null||H.focus()}if(R(7,()=>{var K;n.current.selectedItemId=(K=V())==null?void 0:K.id,M.emit()}),Z||R(5,$),((se=a.current)==null?void 0:se.value)!==void 0){let K=B??"";(J=(ce=a.current).onValueChange)==null||J.call(ce,K);return}}M.emit()}},emit:()=>{i.current.forEach(j=>j())}}),[]),A=p.useMemo(()=>({value:(j,B,Z)=>{var H;B!==((H=s.current.get(j))==null?void 0:H.value)&&(s.current.set(j,{value:B,keywords:Z}),n.current.filtered.items.set(j,T(B,Z)),R(2,()=>{E(),M.emit()}))},item:(j,B)=>(r.current.add(j),B&&(o.current.has(B)?o.current.get(B).add(j):o.current.set(B,new Set([j]))),R(3,()=>{_(),E(),n.current.value||N(),M.emit()}),()=>{s.current.delete(j),r.current.delete(j),n.current.filtered.items.delete(j);let Z=V();R(4,()=>{_(),(Z==null?void 0:Z.getAttribute("id"))===j&&N(),M.emit()})}),group:j=>(o.current.has(j)||o.current.set(j,new Set),()=>{s.current.delete(j),o.current.delete(j)}),filter:()=>a.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:C,labelId:b,listInnerRef:P}),[]);function T(j,B){var Z,H;let se=(H=(Z=a.current)==null?void 0:Z.filter)!=null?H:qM;return j?se(j,n.current.search,B):0}function E(){if(!n.current.search||a.current.shouldFilter===!1)return;let j=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(H=>{let se=o.current.get(H),ce=0;se.forEach(J=>{let K=j.get(J);ce=Math.max(K,ce)}),B.push([H,ce])});let Z=P.current;q().sort((H,se)=>{var ce,J;let K=H.getAttribute("id"),ee=se.getAttribute("id");return((ce=j.get(ee))!=null?ce:0)-((J=j.get(K))!=null?J:0)}).forEach(H=>{let se=H.closest(Si);se?se.appendChild(H.parentElement===se?H:H.closest(`${Si} > *`)):Z.appendChild(H.parentElement===Z?H:H.closest(`${Si} > *`))}),B.sort((H,se)=>se[1]-H[1]).forEach(H=>{var se;let ce=(se=P.current)==null?void 0:se.querySelector(`${yr}[${Bn}="${encodeURIComponent(H[0])}"]`);ce==null||ce.parentElement.appendChild(ce)})}function N(){let j=q().find(Z=>Z.getAttribute("aria-disabled")!=="true"),B=j==null?void 0:j.getAttribute(Bn);M.setState("value",B||void 0)}function _(){var j,B,Z,H;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let se=0;for(let ce of r.current){let J=(B=(j=s.current.get(ce))==null?void 0:j.value)!=null?B:"",K=(H=(Z=s.current.get(ce))==null?void 0:Z.keywords)!=null?H:[],ee=T(J,K);n.current.filtered.items.set(ce,ee),ee>0&&se++}for(let[ce,J]of o.current)for(let K of J)if(n.current.filtered.items.get(K)>0){n.current.filtered.groups.add(ce);break}n.current.filtered.count=se}function $(){var j,B,Z;let H=V();H&&(((j=H.parentElement)==null?void 0:j.firstChild)===H&&((Z=(B=H.closest(yr))==null?void 0:B.querySelector(XM))==null||Z.scrollIntoView({block:"nearest"})),H.scrollIntoView({block:"nearest"}))}function V(){var j;return(j=P.current)==null?void 0:j.querySelector(`${Dm}[aria-selected="true"]`)}function q(){var j;return Array.from(((j=P.current)==null?void 0:j.querySelectorAll(jd))||[])}function W(j){let B=q()[j];B&&M.setState("value",B.getAttribute(Bn))}function I(j){var B;let Z=V(),H=q(),se=H.findIndex(J=>J===Z),ce=H[se+j];(B=a.current)!=null&&B.loop&&(ce=se+j<0?H[H.length-1]:se+j===H.length?H[0]:H[se+j]),ce&&M.setState("value",ce.getAttribute(Bn))}function L(j){let B=V(),Z=B==null?void 0:B.closest(yr),H;for(;Z&&!H;)Z=j>0?sE(Z,yr):iE(Z,yr),H=Z==null?void 0:Z.querySelector(jd);H?M.setState("value",H.getAttribute(Bn)):I(j)}let O=()=>W(q().length-1),D=j=>{j.preventDefault(),j.metaKey?O():j.altKey?L(1):I(1)},Y=j=>{j.preventDefault(),j.metaKey?W(0):j.altKey?L(-1):I(-1)};return p.createElement(hn.div,{ref:e,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:j=>{var B;(B=x.onKeyDown)==null||B.call(x,j);let Z=j.nativeEvent.isComposing||j.keyCode===229;if(!(j.defaultPrevented||Z))switch(j.key){case"n":case"j":{v&&j.ctrlKey&&D(j);break}case"ArrowDown":{D(j);break}case"p":case"k":{v&&j.ctrlKey&&Y(j);break}case"ArrowUp":{Y(j);break}case"Home":{j.preventDefault(),W(0);break}case"End":{j.preventDefault(),O();break}case"Enter":{j.preventDefault();let H=V();if(H){let se=new Event(wa);H.dispatchEvent(se)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:lE},c),Ms(t,j=>p.createElement(km.Provider,{value:M},p.createElement(Im.Provider,{value:A},j))))}),ZM=p.forwardRef((t,e)=>{var n,r;let o=Xn(),s=p.useRef(null),i=p.useContext(Nm),a=Zr(),c=Om(t),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;En(()=>{if(!u)return a.item(o,i==null?void 0:i.id)},[u]);let d=$m(o,s,[t.value,t.children,s],t.keywords),f=Vc(),h=sn(R=>R.value&&R.value===d.current),m=sn(R=>u||a.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);p.useEffect(()=>{let R=s.current;if(!(!R||t.disabled))return R.addEventListener(wa,g),()=>R.removeEventListener(wa,g)},[m,t.onSelect,t.disabled]);function g(){var R,M;y(),(M=(R=c.current).onSelect)==null||M.call(R,d.current)}function y(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:v,value:x,onSelect:w,forceMount:b,keywords:C,...P}=t;return p.createElement(hn.div,{ref:er(s,e),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||a.getDisablePointerSelection()?void 0:y,onClick:v?void 0:g},t.children)}),QM=p.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:o,...s}=t,i=Xn(),a=p.useRef(null),c=p.useRef(null),u=Xn(),d=Zr(),f=sn(m=>o||d.filter()===!1?!0:m.search?m.filtered.groups.has(i):!0);En(()=>d.group(i),[]),$m(i,a,[t.value,t.heading,c]);let h=p.useMemo(()=>({id:i,forceMount:o}),[o]);return p.createElement(hn.div,{ref:er(a,e),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Ms(t,m=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},p.createElement(Nm.Provider,{value:h},m))))}),JM=p.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,o=p.useRef(null),s=sn(i=>!i.search);return!n&&!s?null:p.createElement(hn.div,{ref:er(o,e),...r,"cmdk-separator":"",role:"separator"})}),eE=p.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,o=t.value!=null,s=Vc(),i=sn(u=>u.search),a=sn(u=>u.selectedItemId),c=Zr();return p.useEffect(()=>{t.value!=null&&s.setState("search",t.value)},[t.value]),p.createElement(hn.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":a,id:c.inputId,type:"text",value:o?t.value:i,onChange:u=>{o||s.setState("search",u.target.value),n==null||n(u.target.value)}})}),tE=p.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...o}=t,s=p.useRef(null),i=p.useRef(null),a=sn(u=>u.selectedItemId),c=Zr();return p.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),p.createElement(hn.div,{ref:er(s,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},Ms(t,u=>p.createElement("div",{ref:er(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),nE=p.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=t;return p.createElement(Nc,{open:n,onOpenChange:r},p.createElement(_c,{container:i},p.createElement(Oc,{"cmdk-overlay":"",className:o}),p.createElement($c,{"aria-label":t.label,"cmdk-dialog":"",className:s},p.createElement(_m,{ref:e,...a}))))}),rE=p.forwardRef((t,e)=>sn(n=>n.filtered.count===0)?p.createElement(hn.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),oE=p.forwardRef((t,e)=>{let{progress:n,children:r,label:o="Loading...",...s}=t;return p.createElement(hn.div,{ref:e,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Ms(t,i=>p.createElement("div",{"aria-hidden":!0},i)))}),Ae=Object.assign(_m,{List:tE,Item:ZM,Input:eE,Group:QM,Separator:JM,Dialog:nE,Empty:rE,Loading:oE});function sE(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function iE(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function Om(t){let e=p.useRef(t);return En(()=>{e.current=t}),e}var En=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Gn(t){let e=p.useRef();return e.current===void 0&&(e.current=t()),e}function sn(t){let e=Vc(),n=()=>t(e.snapshot());return p.useSyncExternalStore(e.subscribe,n,n)}function $m(t,e,n,r=[]){let o=p.useRef(),s=Zr();return En(()=>{var i;let a=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():o.current}})(),c=r.map(u=>u.trim());s.value(t,a,c),(i=e.current)==null||i.setAttribute(Bn,a),o.current=a}),o}var aE=()=>{let[t,e]=p.useState(),n=Gn(()=>new Map);return En(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,o)=>{n.current.set(r,o),e({})}};function cE(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Ms({asChild:t,children:e},n){return t&&p.isValidElement(e)?p.cloneElement(cE(e),{ref:e.ref},n(e.props.children)):n(e)}var lE={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function uE({options:t,value:e,defaultValue:n,onValueChange:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No matches.",maxItems:a,size:c,color:u="primary",disabled:d=!1,id:f,className:h,style:m,sx:g,"aria-invalid":y,"aria-describedby":v,"aria-label":x}){const[w,b]=S.useState(!1),[C,P]=S.useState(n??[]),[R,M]=S.useState(""),A=S.useRef(null),T=e??C,E=S.useCallback(D=>{e===void 0&&P(D),r==null||r(D)},[e,r]),N=S.useCallback(D=>{T.includes(D)?E(T.filter(Y=>Y!==D)):(a==null||T.length<a)&&E([...T,D])},[T,E,a]),_=S.useCallback(D=>E(T.filter(Y=>Y!==D)),[T,E]),$=S.useMemo(()=>{const D=new Map;for(const Y of t)D.set(Y.value,Y);return D},[t]),V=S.useMemo(()=>{const D=new Map;for(const Y of t){const j=Y.group??"";D.has(j)||D.set(j,[]),D.get(j).push(Y)}return D},[t]),q=D=>{D.key==="Backspace"&&R===""&&T.length>0&&(D.preventDefault(),_(T[T.length-1]))};S.useEffect(()=>{w&&queueMicrotask(()=>{var D;return(D=A.current)==null?void 0:D.focus()})},[w]);const{className:W,style:I,styleTag:L}=oe(g,m,"cny-multiselect-trigger",c==="sm"||c==="lg"?c:null,u!=="primary"&&u,h),O=a!=null&&T.length>=a;return l.jsxs(Ss,{open:w,onOpenChange:D=>!d&&b(D),children:[l.jsx(Dc,{asChild:!0,children:l.jsxs("div",{role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-invalid":y,"aria-describedby":v,"aria-label":x,"data-state":w?"open":"closed","data-disabled":d||void 0,id:f,className:W,style:I,onClick:()=>!d&&b(D=>!D),tabIndex:d?-1:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" "||D.key==="ArrowDown")&&!w&&(D.preventDefault(),b(!0))},children:[L,T.length===0&&l.jsx("span",{className:"cny-multiselect-placeholder",children:o}),T.map(D=>{const Y=$.get(D);return l.jsxs("span",{className:"cny-chip",children:[l.jsx("span",{className:"cny-chip-label",children:(Y==null?void 0:Y.label)??D}),!d&&l.jsx("button",{type:"button",className:"cny-chip-remove","aria-label":`Remove ${(Y==null?void 0:Y.label)??D}`,onClick:j=>{j.stopPropagation(),_(D)},children:l.jsx(Wt,{size:12,"aria-hidden":"true"})})]},D)}),l.jsx(Gr,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),l.jsx(Ic,{children:l.jsx(Ps,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:D=>D.preventDefault(),children:l.jsxs(Ae,{shouldFilter:!0,label:"Options",children:[l.jsx(Ae.Input,{ref:A,placeholder:s,value:R,onValueChange:M,onKeyDown:q}),l.jsxs(Ae.List,{children:[l.jsx(Ae.Empty,{children:i}),Array.from(V.entries()).map(([D,Y])=>l.jsx(Ae.Group,{heading:D||void 0,children:Y.map(j=>{const B=T.includes(j.value),Z=j.disabled||!B&&O;return l.jsxs(Ae.Item,{value:`${j.label} ${j.description??""} ${j.value}`,disabled:Z,onSelect:()=>N(j.value),children:[j.icon&&l.jsx("span",{style:{display:"inline-flex"},children:j.icon}),l.jsx("span",{children:j.label}),j.description&&l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:j.description}),B&&l.jsx("span",{className:"cny-check",children:l.jsx(nn,{size:14,"aria-hidden":"true"})})]},j.value)})},D||"default"))]})]})})})]})}var dE=Object.defineProperty,Ut=(t,e)=>dE(t,"name",{value:e,configurable:!0}),Bc="Checkbox",[fE,gN]=Pe(Bc),[hE,Gc]=fE(Bc);function Lm(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=Se({prop:n,defaultProp:o??!1,onChange:c,caller:Bc}),[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),[b,C]=p.useReducer(M=>M+1,0),P=g?!!i||!!g.closest("form"):!0,R={checked:h,disabled:s,setChecked:m,control:g,setControl:y,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:b,onUserInteraction:C,required:u,defaultChecked:Ft(o)?!1:o,isFormControl:P,bubbleInput:v,setBubbleInput:x};return l.jsx(hE,{scope:e,...R,children:Fm(f)?f(R):r})}Ut(Lm,"CheckboxProvider");var pE="CheckboxTrigger",mE=p.forwardRef(Ut(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...o},s){const{control:i,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:y,bubbleInput:v}=Gc(pE,e),x=ae(s,f),w=p.useRef(u);return p.useEffect(()=>{const b=i==null?void 0:i.form;if(b){const C=Ut(()=>h(w.current),"reset");return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[i,h]),l.jsx(ne.button,{type:"button",role:"checkbox","aria-checked":Ft(u)?"mixed":u,"aria-required":d,"data-state":zc(u),"data-disabled":c?"":void 0,disabled:c,value:a,...o,ref:x,onKeyDown:U(n,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:U(r,b=>{g(),h(C=>Ft(C)?!0:!C),v&&y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})},"CheckboxTrigger")),Ad=p.forwardRef(Ut(function(e,n){const{__scopeCheckbox:r,name:o,checked:s,defaultChecked:i,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...h}=e;return l.jsx(Lm,{__scopeCheckbox:r,checked:s,defaultChecked:i,disabled:c,required:a,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(mE,{...h,ref:n,__scopeCheckbox:r}),m&&l.jsx(xE,{__scopeCheckbox:r})]})})},"Checkbox")),gE="CheckboxIndicator",yE=p.forwardRef(Ut(function(e,n){const{__scopeCheckbox:r,forceMount:o,...s}=e,i=Gc(gE,r);return l.jsx(ze,{present:o||Ft(i.checked)||i.checked===!0,children:l.jsx(ne.span,{"data-state":zc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),vE="CheckboxBubbleInput",xE=p.forwardRef(Ut(function({__scopeCheckbox:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:y,setBubbleInput:v}=Gc(vE,e),x=ae(o,v),w=fr(s),b=p.useRef(!1),C=p.useRef(c),P=p.useRef(a);p.useEffect(()=>{const M=y;if(!M)return;const A=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(A,"checked").set,N=a!==P.current;P.current=a;const _=C.current!==c;C.current=c;const $=!(N&&i.current);if(_&&E){b.current=!N;const V=new Event("click",{bubbles:$});M.indeterminate=Ft(c),E.call(M,Ft(c)?!1:c),M.dispatchEvent(V),b.current=!1}},[y,c,i,a]);const R=p.useRef(Ft(c)?!1:c);return l.jsx(ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:m,form:g,...r,tabIndex:-1,ref:x,onClick:U(n,M=>{b.current&&M.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Fm(t){return typeof t=="function"}Ut(Fm,"isFunction");function Ft(t){return t==="indeterminate"}Ut(Ft,"isIndeterminate");function zc(t){return Ft(t)?"indeterminate":t?"checked":"unchecked"}Ut(zc,"getState");const Ca=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){const a=l.jsx(yE,{children:s.checked==="indeterminate"?l.jsx(XS,{size:12,"aria-hidden":"true"}):l.jsx(nn,{size:12,"aria-hidden":"true"})});if(!o){const{className:f,style:h,styleTag:m}=oe(r,n,"checkbox",e);return l.jsxs(Ad,{ref:i,className:f,style:h,...s,children:[m,a]})}const{className:c,style:u,styleTag:d}=oe(r,n,"control");return l.jsxs("label",{className:c,style:u,children:[d,l.jsx(Ad,{ref:i,className:z("checkbox",e),...s,children:a}),l.jsx("span",{children:o})]})});var bE=Object.defineProperty,Ge=(t,e)=>bE(t,"name",{value:e,configurable:!0}),Vm="Radio",[wE,Bm]=Pe(Vm),[CE,Es]=wE(Vm);function Gm(t){const{__scopeRadio:e,checked:n=!1,children:r,disabled:o,form:s,name:i,onCheck:a,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,h]=p.useState(null),[m,g]=p.useState(null),y=p.useRef(!1),[v,x]=p.useReducer(C=>C+1,0),w=f?!!s||!!f.closest("form"):!0,b={checked:n,disabled:o,required:c,name:i,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:y,userInteractionCount:v,onUserInteraction:x,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:Ge(()=>a==null?void 0:a(),"onCheck")};return l.jsx(CE,{scope:e,...b,children:zm(d)?d(b):r})}Ge(Gm,"RadioProvider");var SE="RadioTrigger",PE=p.forwardRef(Ge(function({__scopeRadio:e,onClick:n,...r},o){const{checked:s,disabled:i,value:a,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=Es(SE,e),g=ae(o,c);return l.jsx(ne.button,{type:"button",role:"radio","aria-checked":s,"data-state":Uc(s),"data-disabled":i?"":void 0,disabled:i,value:a,...r,ref:g,onClick:U(n,y=>{s||(f(),u()),m&&h&&(d.current=y.isPropagationStopped(),d.current||y.stopPropagation())})})},"RadioTrigger")),RE="RadioIndicator",TE=p.forwardRef(Ge(function(e,n){const{__scopeRadio:r,forceMount:o,...s}=e,i=Es(RE,r);return l.jsx(ze,{present:o||i.checked,children:l.jsx(ne.span,{"data-state":Uc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),ME="RadioBubbleInput",EE=p.forwardRef(Ge(function({__scopeRadio:e,onClick:n,...r},o){const{control:s,checked:i,required:a,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:y}=Es(ME,e),v=ae(o,m),x=fr(s),w=p.useRef(!1),b=p.useRef(i),C=p.useRef(y);p.useEffect(()=>{const R=h;if(!R)return;const M=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(M,"checked").set,E=y!==C.current;C.current=y;const N=b.current!==i;b.current=i;const _=!(E&&g.current);if(N&&T){w.current=!E;const $=new Event("click",{bubbles:_});T.call(R,i),R.dispatchEvent($),w.current=!1}},[h,i,g,y]);const P=p.useRef(i);return l.jsx(ne.input,{type:"radio","aria-hidden":!0,defaultChecked:P.current,required:a,disabled:c,name:u,value:d,form:f,...r,tabIndex:-1,ref:v,onClick:U(n,R=>{w.current&&R.stopPropagation()}),style:{...r.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function zm(t){return typeof t=="function"}Ge(zm,"isFunction");function Uc(t){return t?"checked":"unchecked"}Ge(Uc,"getState");var jE=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Hc="RadioGroup",[AE,yN]=Pe(Hc,[ln,Bm]),Um=ln(),js=Bm(),[DE,IE]=AE(Hc),kE=p.forwardRef(Ge(function(e,n){const{__scopeRadioGroup:r,name:o,form:s,defaultValue:i,value:a,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=e,y=Um(r),v=Ht(f),[x,w]=Se({prop:a,defaultProp:i??null,onChange:m,caller:Hc}),[b,C]=p.useState(null),P=ae(n,C),R=p.useRef(x);return p.useEffect(()=>{const M=s?b==null?void 0:b.ownerDocument.getElementById(s):b==null?void 0:b.closest("form");if(M instanceof HTMLFormElement){const A=Ge(()=>w(R.current),"reset");return M.addEventListener("reset",A),()=>M.removeEventListener("reset",A)}},[b,s,w]),l.jsx(DE,{scope:r,name:o,form:s,required:c,disabled:u,value:x,onValueChange:w,children:l.jsx(us,{asChild:!0,...y,orientation:d,dir:v,loop:h,children:l.jsx(ne.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:P})})})},"RadioGroup")),NE="RadioGroupItemProvider",_E="RadioGroupItemTrigger";function Hm(t){const{__scopeRadioGroup:e,value:n,disabled:r,children:o,internal_do_not_use_render:s}=t,i=IE(NE,e),a=js(e),c=i.disabled||r;return l.jsx(Gm,{...a,checked:i.value===n,disabled:c,required:i.required,name:i.name,form:i.form,value:n,onCheck:()=>i.onValueChange(n),internal_do_not_use_render:s,children:o})}Ge(Hm,"RadioGroupItemProvider");var OE=p.forwardRef(Ge(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Um(r),i=js(r),{checked:a,disabled:c}=Es(_E,i.__scopeRadio),u=p.useRef(null),d=ae(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=Ge(g=>{jE.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=Ge(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),l.jsx(ds,{asChild:!0,...s,focusable:!c,active:a,children:l.jsx(PE,{...i,...o,ref:d,onKeyDown:U(o.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:U(o.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),Dd=p.forwardRef(Ge(function(e,n){const{__scopeRadioGroup:r,value:o,disabled:s,...i}=e;return l.jsx(Hm,{__scopeRadioGroup:r,value:o,disabled:s,internal_do_not_use_render:({isFormControl:a})=>l.jsxs(l.Fragment,{children:[l.jsx(OE,{...i,ref:n,__scopeRadioGroup:r}),a&&l.jsx($E,{__scopeRadioGroup:r})]})})},"RadioGroupItem")),$E=p.forwardRef(Ge(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=js(r);return l.jsx(EE,{...s,...o,ref:n})},"RadioGroupItemBubbleInput")),Id=p.forwardRef(Ge(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=js(r);return l.jsx(TE,{...s,...o,ref:n})},"RadioGroupIndicator"));const LE=S.forwardRef(function({orientation:e="vertical",className:n,style:r,...o},s){return l.jsx(kE,{ref:s,className:z("cny-radio-group",e==="horizontal"&&"cny-radio-group-horizontal",n),style:r,...o})}),FE=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=oe(r,n,"radio",e);return l.jsxs(Dd,{ref:i,className:d,style:f,...s,children:[h,l.jsx(Id,{})]})}const{className:a,style:c,styleTag:u}=oe(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Dd,{ref:i,className:z("radio",e),...s,children:l.jsx(Id,{})}),l.jsx("span",{children:o})]})});var VE=Object.defineProperty,an=(t,e)=>VE(t,"name",{value:e,configurable:!0}),Wc="Switch",[BE,vN]=Pe(Wc),[GE,Kc]=BE(Wc);function Wm(t){const{__scopeSwitch:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=Se({prop:n,defaultProp:o??!1,onChange:c,caller:Wc}),[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),[b,C]=p.useReducer(M=>M+1,0),P=g?!!i||!!g.closest("form"):!0,R={checked:h,setChecked:m,disabled:s,control:g,setControl:y,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:b,onUserInteraction:C,required:u,defaultChecked:o,isFormControl:P,bubbleInput:v,setBubbleInput:x};return l.jsx(GE,{scope:e,...R,children:Km(f)?f(R):r})}an(Wm,"SwitchProvider");var zE="SwitchTrigger",UE=p.forwardRef(an(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,form:i,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:y,bubbleInput:v}=Kc(zE,e),x=ae(o,f),w=p.useRef(u);return p.useEffect(()=>{const b=i?s==null?void 0:s.ownerDocument.getElementById(i):s==null?void 0:s.form;if(b instanceof HTMLFormElement){const C=an(()=>h(w.current),"reset");return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[s,i,h]),l.jsx(ne.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":Yc(u),"data-disabled":c?"":void 0,disabled:c,value:a,...r,ref:x,onClick:U(n,b=>{g(),h(C=>!C),v&&y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})},"SwitchTrigger")),kd=p.forwardRef(an(function(e,n){const{__scopeSwitch:r,name:o,checked:s,defaultChecked:i,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...h}=e;return l.jsx(Wm,{__scopeSwitch:r,checked:s,defaultChecked:i,disabled:c,required:a,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(UE,{...h,ref:n,__scopeSwitch:r}),m&&l.jsx(KE,{__scopeSwitch:r})]})})},"Switch")),HE="SwitchThumb",Nd=p.forwardRef(an(function(e,n){const{__scopeSwitch:r,...o}=e,s=Kc(HE,r);return l.jsx(ne.span,{"data-state":Yc(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:n})},"SwitchThumb")),WE="SwitchBubbleInput",KE=p.forwardRef(an(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:y,setBubbleInput:v}=Kc(WE,e),x=ae(o,v),w=fr(s),b=p.useRef(!1),C=p.useRef(c),P=p.useRef(a);p.useEffect(()=>{const M=y;if(!M)return;const A=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(A,"checked").set,N=a!==P.current;P.current=a;const _=C.current!==c;C.current=c;const $=!(N&&i.current);if(_&&E){b.current=!N;const V=new Event("click",{bubbles:$});E.call(M,c),M.dispatchEvent(V),b.current=!1}},[y,c,i,a]);const R=p.useRef(c);return l.jsx(ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:m,form:g,...r,tabIndex:-1,ref:x,onClick:U(n,M=>{b.current&&M.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Km(t){return typeof t=="function"}an(Km,"isFunction");function Yc(t){return t?"checked":"unchecked"}an(Yc,"getState");const YE=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=oe(r,n,"switch",e);return l.jsxs(kd,{ref:i,className:d,style:f,...s,children:[h,l.jsx(Nd,{className:"switch-thumb"})]})}const{className:a,style:c,styleTag:u}=oe(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(kd,{ref:i,className:z("switch",e),...s,children:l.jsx(Nd,{className:"switch-thumb"})}),l.jsx("span",{children:o})]})});function zo(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function _d(t){const e=new Date(t);return e.setHours(23,59,59,999),e}function So(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Pi(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}function XE(t,e){return t.getFullYear()===e.getFullYear()}function Mt(t){return new Date(t.getFullYear(),t.getMonth(),1)}function qE(t){return new Date(t.getFullYear(),0,1)}function Od(t){return new Date(Math.floor(t.getFullYear()/10)*10,0,1)}function Po(t,e){const n=new Date(t);return n.setDate(1),n.setMonth(n.getMonth()+e),n}function rs(t,e){const n=new Date(t);return n.setDate(n.getDate()+e),n}function Rt(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e),n}function Ri(t,e,n,r=0){const o=new Date(t);return o.setHours(e,n,r,0),o}function Ue(t,e,n){return e&&t.getTime()<e.getTime()?new Date(e):n&&t.getTime()>n.getTime()?new Date(n):t}function ZE(t,e){const n=Mt(t),r=(n.getDay()-e+7)%7,o=rs(n,-r);return Array.from({length:42},(s,i)=>rs(o,i))}function QE(t,e){const n=new Intl.DateTimeFormat(t,{weekday:"short"}),r=new Date(2024,0,7);return Array.from({length:7},(o,s)=>{const i=rs(r,(s+e)%7);return n.format(i)})}function JE(t,e="short"){const n=new Intl.DateTimeFormat(t,{month:e});return Array.from({length:12},(r,o)=>n.format(new Date(2024,o,1)))}function $d(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function ej(t,e){return new Intl.DateTimeFormat(e,{year:"numeric"}).format(t)}function tj(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function Ym(t,e){return new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"}).format(t)}function Xm(t,e,n,r){return new Intl.DateTimeFormat(e,{hour:"2-digit",minute:"2-digit",second:r?"2-digit":void 0,hour12:n}).format(t)}function nj(t,e,n,r){return`${Ym(t,e)} · ${Xm(t,e,n,r)}`}function Ro(t){if(t==null||t==="")return null;if(t instanceof Date)return Number.isNaN(t.getTime())?null:new Date(t);const e=new Date(t);return Number.isNaN(e.getTime())?null:e}function To(t,e){return t.getTime()<e.getTime()}function Mo(t,e){return t.getTime()>e.getTime()}function Eo(t){return t<10?`0${t}`:String(t)}function rj(t){return t||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function oj(t){try{return new Intl.DateTimeFormat(t,{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}function sj(t,e,n,r,o){switch(e){case"year":return ej(t,n);case"month":return tj(t,n);case"time":return Xm(t,n,r,o);case"datetime":return nj(t,n,r,o);case"date":default:return Ym(t,n)}}function ij(t,e){switch(e){case"year":return qE(t);case"month":return Mt(t);case"date":return zo(t);default:return new Date(t)}}const aj=S.forwardRef(function({mode:e="date",value:n,defaultValue:r,onChange:o,min:s,max:i,allow:a="any",disabledDate:c,disabledTime:u,placeholder:d,size:f,color:h="primary",disabled:m=!1,clearable:g=!0,locale:y,weekStartsOn:v=0,hour12:x,showSeconds:w=!1,minuteStep:b=1,secondStep:C=1,format:P,icon:R,required:M=!1,validate:A,error:T,onValidate:E,id:N,className:_,style:$,sx:V,"aria-invalid":q,"aria-describedby":W,dialogLabel:I,name:L,open:O,onOpenChange:D,...Y},j){const B=rj(y),Z=x??oj(B),H=S.useId(),se=N??`cny-dp-${H}`,ce=`${se}-dialog`,J=`${se}-hint`,K=S.useMemo(()=>{const k=Ro(s),Q=a==="future"||a==="current"?zo(new Date):null;return k&&Q?k.getTime()>Q.getTime()?k:Q:k??Q},[s,a]),ee=S.useMemo(()=>{const k=Ro(i),Q=a==="past"||a==="current"?_d(new Date):null;return k&&Q?k.getTime()<Q.getTime()?k:Q:k??Q},[i,a]),ue=n!==void 0,[X,F]=S.useState(()=>Ro(r)),G=ue?Ro(n):X,le=O!==void 0,[ie,_e]=S.useState(!1),ge=le?O:ie,tt=S.useCallback(k=>{le||_e(k),D==null||D(k)},[le,D]),mn=S.useMemo(()=>G??Ue(new Date,K,ee),[G,K,ee]),[pe,be]=S.useState(()=>Mt(mn)),[Ce,Ie]=S.useState(()=>mn),Fs=e==="month"?"month":e==="year"?"year":"date",[nt,gn]=S.useState(Fs),Vs=S.useRef(null);S.useImperativeHandle(j,()=>Vs.current,[]);const ro=S.useRef(null),vl=S.useRef(null),Bs=S.useRef(null),[Sy,Py]=S.useState(!1);S.useEffect(()=>Py(!0),[]);const kn=S.useCallback(k=>K&&To(k,K)||ee&&Mo(k,ee)?!0:c?c(k):!1,[K,ee,c]),oo=S.useCallback(k=>u?u(k):!1,[u]),Nn=S.useMemo(()=>{if(T)return typeof T=="string"?T:"Invalid";if(M&&!G)return"Required";if(G){const Q=zo(new Date);if(a==="future"&&To(G,Q))return"Must be today or later";if(a==="past"&&Mo(G,_d(new Date)))return"Must be today or earlier";if(a==="current"&&!So(G,Q))return"Must be today";if(K&&To(G,K))return"Too early";if(ee&&Mo(G,ee))return"Too late";if(c&&c(G))return"Unavailable date";if(u&&u(G))return"Unavailable time"}const k=A==null?void 0:A(G);return k||null},[T,M,G,a,K,ee,c,u,A]),xl=S.useRef(null);S.useEffect(()=>{xl.current!==Nn&&(xl.current=Nn,E==null||E(Nn))},[Nn,E]);const so=Nn!==null,bl=so?"danger":h,Ry=G?P?P(G,e):sj(G,e,B,Z,w):"",Ty=d??{date:"Select date",month:"Select month",year:"Select year",time:"Select time",datetime:"Select date & time"}[e],My=I??{date:"Choose date",month:"Choose month",year:"Choose year",time:"Choose time",datetime:"Choose date and time"}[e],Yt=S.useCallback(k=>{ue||F(k),o==null||o(k)},[ue,o]),io=S.useCallback(()=>{var k;tt(!1),(k=ro.current)==null||k.focus()},[tt]),Ey=S.useCallback(k=>{var Q;k.stopPropagation(),Yt(null),(Q=ro.current)==null||Q.focus()},[Yt]),wl=S.useCallback(()=>{if(m)return;const k=G??Ue(new Date,K,ee);be(Mt(k)),Ie(k),gn(Fs),tt(!0)},[m,G,K,ee,tt,Fs]),Gs=S.useCallback(()=>{var k,Q;nt==="date"&&(e==="date"||e==="datetime")?(k=vl.current)==null||k.focus({preventScroll:!0}):(nt==="month"||nt==="year")&&((Q=Bs.current)==null||Q.focus({preventScroll:!0}))},[e,nt]),Cl=S.useRef(!1);S.useEffect(()=>{const k=ge&&!Cl.current;Cl.current=ge,!(!ge||k)&&Gs()},[ge,Ce,Gs]);const Sl=S.useCallback(()=>{var k;nt==="year"&&e!=="year"?gn("month"):nt==="month"&&e!=="month"?gn("date"):(tt(!1),(k=ro.current)==null||k.focus())},[nt,e,tt]),ao=S.useCallback(k=>{const Q=Ue(k,K,ee);Ie(Q),be(fe=>Pi(fe,Q)?fe:Mt(Q))},[K,ee]),pr=S.useCallback((k,Q)=>{const fe=ij(k,e);if(e!=="time"&&kn(fe))return;const Re=e==="time"||e==="datetime"?Ri(fe,(G??k).getHours(),(G??k).getMinutes(),w?(G??k).getSeconds():0):fe;Yt(Re),Ie(Re),((Q==null?void 0:Q.close)??(e!=="datetime"&&e!=="time"))&&io()},[e,kn,Yt,G,w,io]),co=S.useCallback((k,Q)=>{const fe=G??Ue(new Date,K,ee),Re=k==="hour"?Q:fe.getHours(),re=k==="minute"?Q:fe.getMinutes(),St=k==="second"?Q:w?fe.getSeconds():0,Ye=Ri(fe,Re,re,St);oo(Ye)||(Yt(Ye),Ie(Ye))},[G,K,ee,w,oo,Yt]),_n=S.useCallback(k=>ao(rs(Ce,k)),[ao,Ce]),jy=k=>{switch(k.key){case"ArrowLeft":k.preventDefault(),_n(-1);break;case"ArrowRight":k.preventDefault(),_n(1);break;case"ArrowUp":k.preventDefault(),_n(-7);break;case"ArrowDown":k.preventDefault(),_n(7);break;case"Home":{k.preventDefault();const Q=(Ce.getDay()-v+7)%7;_n(-Q);break}case"End":{k.preventDefault();const Q=(Ce.getDay()-v+7)%7;_n(6-Q);break}case"PageUp":k.preventDefault(),ao(k.shiftKey?Rt(Ce,-1):Po(Ce,-1));break;case"PageDown":k.preventDefault(),ao(k.shiftKey?Rt(Ce,1):Po(Ce,1));break;case"Enter":case" ":k.preventDefault(),pr(Ce);break;case"Escape":k.preventDefault(),Sl();break}},Ay=S.useMemo(()=>ZE(pe,v),[pe,v]),Dy=S.useMemo(()=>QE(B,v),[B,v]),Iy=S.useMemo(()=>JE(B,"short"),[B]),zs=S.useMemo(()=>zo(new Date),[]),ky=!K||!To(Mt(pe),Mt(K)),Ny=!ee||!Mo(Mt(pe),Mt(ee)),_y=!K||pe.getFullYear()-1>=K.getFullYear(),Oy=!ee||pe.getFullYear()+1<=ee.getFullYear(),yn=Od(pe).getFullYear(),$y=!K||yn-10+9>=K.getFullYear(),Ly=!ee||yn+10<=ee.getFullYear(),Fy=e==="time"?!oo(new Date):!kn(zs),Vy=()=>{if(e==="time"){const k=new Date;if(oo(k))return;const fe=Ri(G??k,k.getHours(),k.getMinutes(),w?k.getSeconds():0);Yt(fe),Ie(fe);return}pr(zs,{close:e!=="datetime"})},By=z("cny-datepicker-trigger","input",bl!=="primary"&&bl,f==="sm"||f==="lg"?f:null,G&&"has-value",ge&&"is-open"),Gy=R??(e==="time"?l.jsx(jS,{size:15}):l.jsx(vS,{size:15})),Pl=(k,Q)=>{let Re=!0;switch(k.key){case"ArrowLeft":Ie(Q==="month"?re=>Ue(new Date(pe.getFullYear(),(re.getMonth()+11)%12,Math.min(re.getDate(),28)),K,ee):re=>Ue(new Date(re.getFullYear()-1,re.getMonth(),Math.min(re.getDate(),28)),K,ee));break;case"ArrowRight":Ie(Q==="month"?re=>Ue(new Date(pe.getFullYear(),(re.getMonth()+1)%12,Math.min(re.getDate(),28)),K,ee):re=>Ue(new Date(re.getFullYear()+1,re.getMonth(),Math.min(re.getDate(),28)),K,ee));break;case"ArrowUp":Ie(Q==="month"?re=>Ue(new Date(pe.getFullYear(),(re.getMonth()-3+12)%12,Math.min(re.getDate(),28)),K,ee):re=>Ue(new Date(re.getFullYear()-3,re.getMonth(),Math.min(re.getDate(),28)),K,ee));break;case"ArrowDown":Ie(Q==="month"?re=>Ue(new Date(pe.getFullYear(),(re.getMonth()+3)%12,Math.min(re.getDate(),28)),K,ee):re=>Ue(new Date(re.getFullYear()+3,re.getMonth(),Math.min(re.getDate(),28)),K,ee));break;case"PageUp":be(Q==="month"?re=>Rt(re,k.shiftKey?-10:-1):re=>Rt(re,k.shiftKey?-100:-10));break;case"PageDown":be(Q==="month"?re=>Rt(re,k.shiftKey?10:1):re=>Rt(re,k.shiftKey?100:10));break;case"Enter":case" ":Q==="month"?Rl(new Date(pe.getFullYear(),Ce.getMonth(),1)):Tl(Ce.getFullYear());break;case"Escape":Sl();break;default:Re=!1}Re&&k.preventDefault()};S.useEffect(()=>{if(ge&&nt==="year"){const k=Od(pe).getFullYear(),Q=Ce.getFullYear();(Q<k-1||Q>k+10)&&be(new Date(Q,0,1))}},[ge,nt,Ce,pe]);const Rl=k=>{e==="month"?pr(k):(be(Mt(k)),Ie(Ue(k,K,ee)),gn("date"))},Tl=k=>{if(e==="year")pr(new Date(k,0,1));else{const Q=new Date(k,pe.getMonth(),1);be(Q),Ie(Ue(new Date(k,Ce.getMonth(),Math.min(Ce.getDate(),28)),K,ee)),gn("month")}},zy=()=>{const k=Ce.getMonth();return Iy.map((Q,fe)=>{const Re=new Date(pe.getFullYear(),fe,1),re=!!G&&Pi(Re,G)&&XE(Re,G),St=Re.getMonth()===pe.getMonth()&&e!=="month",Ye=fe===k,Ot=kn(Re);return l.jsx("button",{ref:Ye?Bs:void 0,type:"button",tabIndex:Ye?0:-1,className:z("cny-datepicker-chip",re&&"is-selected",St&&!re&&"is-current"),disabled:Ot,onClick:()=>Rl(Re),onFocus:()=>Ie(new Date(pe.getFullYear(),fe,Math.min(Ce.getDate(),28))),children:Q},fe)})},Uy=()=>{const k=yn-1,Q=Ce.getFullYear();return Array.from({length:12},(fe,Re)=>{const re=k+Re,St=new Date(re,0,1),Ye=!!G&&G.getFullYear()===re,Ot=re===pe.getFullYear()&&e!=="year",Xe=re===Q,mr=kn(St),Qy=re<yn||re>=yn+10;return l.jsx("button",{ref:Xe?Bs:void 0,type:"button",tabIndex:Xe?0:-1,className:z("cny-datepicker-chip",Ye&&"is-selected",Ot&&!Ye&&"is-current",Qy&&"is-outside"),disabled:mr,onClick:()=>Tl(re),onFocus:()=>Ie(new Date(re,Ce.getMonth(),Math.min(Ce.getDate(),28))),children:re},re)})},Hy=S.useRef(null),Ml=S.useRef(null),El=S.useRef(null),jl=()=>{const k=G??Ue(new Date,K,ee),Q=k.getHours(),fe=k.getMinutes(),Re=k.getSeconds(),re=Q>=12,St=Z?Q%12===0?12:Q%12:Q,Ye=Xe=>{const mr=Z?re?Xe===12?12:Xe+12:Xe===12?0:Xe:Xe;co("hour",mr)},Ot=Xe=>{const mr=Xe?Q<12?Q+12:Q:Q>=12?Q-12:Q;co("hour",mr)};return l.jsx("div",{className:"cny-dp-time",children:l.jsxs("div",{className:"cny-dp-time-row",children:[l.jsx(Ti,{ref:Hy,ariaLabel:"Hour",value:St,min:Z?1:0,max:Z?12:23,step:1,nextRef:Ml,onChange:Ye}),l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Ti,{ref:Ml,ariaLabel:"Minute",value:fe-fe%Math.max(1,b),min:0,max:59,step:Math.max(1,b),nextRef:w?El:void 0,onChange:Xe=>co("minute",Xe)}),w&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Ti,{ref:El,ariaLabel:"Second",value:Re-Re%Math.max(1,C),min:0,max:59,step:Math.max(1,C),onChange:Xe=>co("second",Xe)})]}),Z&&l.jsxs("div",{className:"cny-dp-ampm",role:"radiogroup","aria-label":"AM or PM",children:[l.jsx("button",{type:"button",role:"radio","aria-checked":!re,className:z("cny-dp-ampm-btn",!re&&"is-active"),onClick:()=>Ot(!1),children:"AM"}),l.jsx("button",{type:"button",role:"radio","aria-checked":re,className:z("cny-dp-ampm-btn",re&&"is-active"),onClick:()=>Ot(!0),children:"PM"})]})]})})},Wy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous month",disabled:!ky,onClick:()=>be(k=>Po(k,-1)),children:l.jsx(Fo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to month picker (currently ${$d(pe,B)})`,onClick:()=>gn("month"),children:$d(pe,B)}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next month",disabled:!Ny,onClick:()=>be(k=>Po(k,1)),children:l.jsx(Qt,{size:16,"aria-hidden":"true"})})]}),l.jsxs("div",{role:"grid",className:"cny-datepicker-grid",onKeyDown:jy,children:[l.jsx("div",{role:"row",className:"cny-datepicker-weekdays",children:Dy.map((k,Q)=>l.jsx("span",{role:"columnheader","aria-label":k,className:"cny-datepicker-weekday",children:k.slice(0,2)},Q))}),Array.from({length:6},(k,Q)=>l.jsx("div",{role:"row",className:"cny-datepicker-row",children:Ay.slice(Q*7,Q*7+7).map(fe=>{const Re=!Pi(fe,pe),re=So(fe,G),St=So(fe,zs),Ye=So(fe,Ce),Ot=kn(fe);return l.jsx("button",{ref:Ye?vl:void 0,type:"button",role:"gridcell",tabIndex:Ye?0:-1,"aria-selected":re,"aria-current":St?"date":void 0,"aria-disabled":Ot||void 0,disabled:Ot,className:z("cny-datepicker-cell",Re&&"is-outside",re&&"is-selected",St&&"is-today"),onClick:()=>pr(fe),onFocus:()=>Ie(fe),children:fe.getDate()},fe.toISOString())})},Q))]})]}),Ky=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous year",disabled:!_y,onClick:()=>be(k=>Rt(k,-1)),children:l.jsx(Fo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to year picker (currently ${pe.getFullYear()})`,onClick:()=>gn("year"),children:pe.getFullYear()}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next year",disabled:!Oy,onClick:()=>be(k=>Rt(k,1)),children:l.jsx(Qt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Month picker",className:"cny-datepicker-chip-grid",onKeyDown:k=>Pl(k,"month"),children:zy()})]}),Yy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous decade",disabled:!$y,onClick:()=>be(k=>Rt(k,-10)),children:l.jsx(Fo,{size:16,"aria-hidden":"true"})}),l.jsx("span",{className:"cny-datepicker-title",children:`${yn} – ${yn+9}`}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next decade",disabled:!Ly,onClick:()=>be(k=>Rt(k,10)),children:l.jsx(Qt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Year picker",className:"cny-datepicker-chip-grid",onKeyDown:k=>Pl(k,"year"),children:Uy()})]}),{className:Xy,style:qy,styleTag:Zy}=oe(V,$,"cny-datepicker",`mode-${e}`,m&&"is-disabled",_);return l.jsx(Ss,{open:ge,onOpenChange:k=>{k||tt(!1)},children:l.jsxs("div",{ref:Vs,className:Xy,style:qy,...Y,children:[Zy,L&&l.jsx("input",{type:"hidden",name:L,value:G?G.toISOString():"",readOnly:!0}),l.jsx(Pm,{asChild:!0,children:l.jsxs("button",{ref:ro,type:"button",id:se,className:By,"aria-haspopup":"dialog","aria-expanded":ge,"aria-controls":ge?ce:void 0,"aria-invalid":q||so,"aria-describedby":z(W,so?J:void 0)||void 0,"aria-required":M||void 0,disabled:m,onClick:wl,onKeyDown:k=>{k.key==="ArrowDown"||k.key==="Enter"||k.key===" "?(k.preventDefault(),wl()):k.key==="Escape"&&ge&&(k.preventDefault(),tt(!1))},children:[l.jsx("span",{className:"cny-datepicker-icon","aria-hidden":"true",children:Gy}),l.jsx("span",{className:z("cny-datepicker-value",!G&&"is-placeholder"),children:Ry||Ty}),g&&G&&!m&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-datepicker-clear","aria-label":"Clear",onClick:Ey,onPointerDown:k=>k.stopPropagation(),children:l.jsx(Wt,{size:13,"aria-hidden":"true"})})]})}),so&&T!==!1&&l.jsx("span",{id:J,className:"cny-datepicker-error",role:"alert",children:typeof T=="string"?T:T??Nn}),ge&&Sy&&Da.createPortal(l.jsxs(Ps,{id:ce,role:"dialog","aria-modal":"false","aria-label":My,className:z("cny-datepicker-panel",`is-${e}`),side:"bottom",align:"start",sideOffset:4,collisionPadding:8,onOpenAutoFocus:k=>{k.preventDefault(),Gs()},onCloseAutoFocus:k=>k.preventDefault(),onEscapeKeyDown:k=>k.preventDefault(),onInteractOutside:k=>{var Q;(Q=Vs.current)!=null&&Q.contains(k.target)&&k.preventDefault()},children:[l.jsxs("div",{className:"cny-datepicker-body",children:[(e==="date"||e==="datetime")&&nt==="date"&&Wy(),(e==="date"||e==="datetime"||e==="month")&&nt==="month"&&Ky(),(e==="date"||e==="datetime"||e==="month"||e==="year")&&nt==="year"&&Yy(),e==="time"&&jl(),e==="datetime"&&nt==="date"&&jl()]}),l.jsxs("div",{className:"cny-datepicker-footer",children:[l.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:!Fy,onClick:Vy,children:e==="time"?"Now":e==="year"?"This year":e==="month"?"This month":"Today"}),l.jsx("div",{className:"cny-datepicker-footer-spacer"}),g&&G&&l.jsx("button",{type:"button",className:"cny-datepicker-action",onClick:()=>{Yt(null),io()},children:"Clear"}),(e==="datetime"||e==="time")&&l.jsx("button",{type:"button",className:"cny-datepicker-action is-primary",onClick:io,children:"Done"})]})]}),document.body)]})})}),Ti=S.forwardRef(function({value:e,min:n,max:r,step:o,ariaLabel:s,nextRef:i,onChange:a},c){const u=S.useRef(null);S.useImperativeHandle(c,()=>u.current,[]);const[d,f]=S.useState(()=>Eo(e)),h=S.useRef(!1);S.useEffect(()=>{h.current||f(Eo(e))},[e]);const m=S.useCallback(x=>{if(!Number.isFinite(x))return;let w=Math.max(n,Math.min(r,x));w=Math.round(w/o)*o,w>r&&(w=Math.floor(r/o)*o),a(w),f(Eo(w))},[n,r,o,a]),g=()=>{const x=e+o;m(x>r?n:x)},y=()=>{const x=e-o;m(x<n?Math.floor(r/o)*o:x)},v=x=>{switch(x.key){case"ArrowUp":x.preventDefault(),g();break;case"ArrowDown":x.preventDefault(),y();break;case"PageUp":x.preventDefault(),m(e+o*5);break;case"PageDown":x.preventDefault(),m(e-o*5);break;case"Home":x.preventDefault(),m(n);break;case"End":x.preventDefault(),m(r);break;case"Enter":x.preventDefault(),m(parseInt(d,10));break}};return l.jsxs("div",{className:"cny-dp-timefield",onWheel:x=>{document.activeElement===u.current&&(x.preventDefault(),x.deltaY<0?g():x.deltaY>0&&y())},children:[l.jsx("input",{ref:u,type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:2,className:"cny-dp-timefield-input",value:d,"aria-label":s,"aria-valuenow":e,"aria-valuemin":n,"aria-valuemax":r,onFocus:x=>{h.current=!0,x.target.select()},onChange:x=>{var b;const w=x.target.value.replace(/[^0-9]/g,"").slice(0,2);if(f(w),w.length===2){const C=parseInt(w,10);Number.isFinite(C)&&C>=n&&C<=r&&(m(C),(b=i==null?void 0:i.current)==null||b.focus())}},onBlur:()=>{h.current=!1;const x=parseInt(d,10);Number.isFinite(x)?m(x):f(Eo(e))},onKeyDown:v}),l.jsxs("div",{className:"cny-dp-timefield-controls",children:[l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Increment ${s.toLowerCase()}`,tabIndex:-1,onClick:g,onMouseDown:x=>x.preventDefault(),children:l.jsx(xp,{size:10,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Decrement ${s.toLowerCase()}`,tabIndex:-1,onClick:y,onMouseDown:x=>x.preventDefault(),children:l.jsx(Gr,{size:10,"aria-hidden":"true"})})]})]})});function cj({hotkey:t=!0}={}){const[e,n]=S.useState(!1);return S.useEffect(()=>{if(!t)return;const r=o=>{o.key==="k"&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),n(s=>!s))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t]),{open:e,setOpen:n,toggle:()=>n(r=>!r)}}function lj({open:t,onOpenChange:e,sections:n,placeholder:r="Search…",title:o="Command palette",description:s="Search and navigate. Use arrow keys to move, Enter to open, Escape to dismiss.",emptyText:i="No matches found.",footer:a,onItemSelect:c,contentClassName:u}){const d=f=>{var h;f.disabled||((h=f.onSelect)==null||h.call(f),c==null||c(f),e(!1))};return l.jsxs(Ae.Dialog,{open:t,onOpenChange:e,label:o,contentClassName:z("cny-cmdk-content",u),children:[l.jsxs(am,{children:[l.jsx(Lc,{children:o}),l.jsx(Fc,{children:s})]}),l.jsxs("div",{className:"cny-cmdk-header",children:[l.jsx(Tp,{size:16,"aria-hidden":"true"}),l.jsx(Ae.Input,{placeholder:r}),l.jsx("kbd",{className:"cny-cmdk-esc",children:"Esc"})]}),l.jsxs(Ae.List,{className:"cny-cmdk-list",children:[l.jsx(Ae.Empty,{className:"cny-cmdk-empty",children:i}),n.map(f=>l.jsx(Ae.Group,{heading:f.title,className:"cny-cmdk-group",children:f.items.map(h=>{var m;return l.jsxs(Ae.Item,{value:`${f.title} ${h.label} ${((m=h.keywords)==null?void 0:m.join(" "))??""}`,disabled:h.disabled,onSelect:()=>d(h),className:"cny-cmdk-item",children:[h.icon&&l.jsx("span",{className:"cny-cmdk-item-icon",children:h.icon}),l.jsx("span",{className:"cny-cmdk-item-label",children:h.label}),h.badge&&l.jsx("span",{className:"cny-cmdk-item-badge",children:h.badge}),h.hint&&l.jsx("span",{className:"cny-cmdk-item-hint",children:h.hint})]},h.id)})},f.title))]}),a!==!1&&l.jsx("div",{className:"cny-cmdk-footer",children:a??l.jsxs(l.Fragment,{children:[l.jsx("kbd",{children:"↑↓"})," navigate",l.jsx("kbd",{children:"↵"})," open",l.jsx("kbd",{children:"Esc"})," dismiss"]})})]})}function uj({onClick:t,label:e="Search…",shortcut:n="⌘K",className:r}){return l.jsxs("button",{type:"button",onClick:t,className:z("cny-cmdk-trigger",r),"aria-label":"Open command palette",children:[l.jsx(Tp,{size:14,"aria-hidden":"true"}),l.jsx("span",{className:"cny-cmdk-trigger-label",children:e}),l.jsx("kbd",{className:"cny-cmdk-trigger-kbd",children:n})]})}let dj=0;const fj=()=>`cny-toast-${Date.now().toString(36)}-${++dj}`,qm=S.createContext(null),hj={default:null,success:l.jsx(Cp,{size:16,"aria-hidden":"true"}),info:l.jsx(Pp,{size:16,"aria-hidden":"true"}),warning:l.jsx(Mp,{size:16,"aria-hidden":"true"}),danger:l.jsx(wp,{size:16,"aria-hidden":"true"}),loading:l.jsx(Rp,{size:16,"aria-hidden":"true",className:"cny-toast-spin"})};function pj({children:t,position:e="bottom-right",defaultDuration:n=5e3,maxToasts:r=5,offset:o="1rem"}){const[s,i]=S.useState([]),[a,c]=S.useState(!1);S.useEffect(()=>c(!0),[]);const u=S.useCallback(y=>{i(v=>v.map(x=>y==null||x.id===y?{...x,exiting:!0}:x)),window.setTimeout(()=>{i(v=>v.filter(x=>y==null?!1:x.id!==y||!x.exiting)),i(v=>(v.filter(x=>x.exiting&&(y==null||x.id===y)).forEach(x=>{var w;return(w=x.onDismiss)==null?void 0:w.call(x)}),v.filter(x=>!x.exiting||y!=null&&x.id!==y)))},200)},[]),d=S.useCallback(y=>{const v=y.id??fj(),x={id:v,title:y.title,description:y.description,action:y.action,icon:y.icon,variant:y.variant??"default",duration:y.duration??n,dismissible:y.dismissible??!0,onDismiss:y.onDismiss,sx:y.sx};return i(w=>{const C=[...w.filter(P=>P.id!==v),x];return C.length>r?C.slice(C.length-r):C}),v},[n,r]),f=S.useCallback((y,v)=>{i(x=>x.map(w=>w.id===y?{...w,...v,variant:v.variant??w.variant,duration:v.duration??w.duration,dismissible:v.dismissible??w.dismissible}:w))},[]),h=S.useMemo(()=>{const y=(v=>d(typeof v=="string"?{title:v}:v));return y.success=(v,x)=>d({...x,title:v,variant:"success"}),y.info=(v,x)=>d({...x,title:v,variant:"info"}),y.warning=(v,x)=>d({...x,title:v,variant:"warning"}),y.error=(v,x)=>d({...x,title:v,variant:"danger"}),y.loading=(v,x)=>d({...x,title:v,variant:"loading",duration:(x==null?void 0:x.duration)??1/0}),y},[d]),m=S.useMemo(()=>({toast:h,dismiss:u,update:f}),[h,u,f]),g=e.startsWith("top-");return l.jsxs(qm.Provider,{value:m,children:[t,a&&Da.createPortal(l.jsx("ol",{className:z("cny-toast-viewport",`pos-${e}`),style:{"--cny-toast-offset":o},"aria-live":"polite","aria-relevant":"additions",tabIndex:-1,children:(g?[...s].reverse():s).map(y=>l.jsx(mj,{toast:y,onDismiss:()=>u(y.id)},y.id))}),document.body)]})}function mj({toast:t,onDismiss:e}){const{variant:n,title:r,description:o,action:s,icon:i,duration:a,dismissible:c,sx:u}=t,[d,f]=S.useState(!1),h=S.useRef(null);S.useEffect(()=>{if(!t.exiting&&!(!Number.isFinite(a)||a<0)&&!d)return h.current=setTimeout(e,a),()=>{h.current&&clearTimeout(h.current)}},[d,a,e,t.exiting]);const m=n==="danger"||n==="warning"?"alert":"status",g=i!==!1,y=i!==void 0&&i!==!1?i:hj[n],{className:v,style:x,styleTag:w}=oe(u,void 0,"cny-toast",n,t.exiting&&"is-exiting");return l.jsxs("li",{role:m,"aria-atomic":"true",className:v,style:x,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),children:[w,g&&y&&l.jsx("span",{className:"cny-toast-icon","aria-hidden":"true",children:y}),l.jsxs("div",{className:"cny-toast-body",children:[r!=null&&l.jsx("p",{className:"cny-toast-title",children:r}),o!=null&&l.jsx("p",{className:"cny-toast-description",children:o})]}),s!=null&&l.jsx("div",{className:"cny-toast-action",children:s}),c&&l.jsx("button",{type:"button",className:"cny-toast-close","aria-label":"Dismiss",onClick:e,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})})]})}function gj(){const t=S.useContext(qm);if(!t)throw new Error("useToast() must be called inside a <ToastProvider>. Wrap your app at the root.");return t}const Zm=S.forwardRef(function({title:e,description:n,children:r,footer:o,size:s="md",hideClose:i,className:a,style:c,sx:u,...d},f){const{className:h,style:m,styleTag:g}=oe(u,c,"cny-dialog-content",`size-${s}`,a);return l.jsx(Nc,{...d,children:l.jsxs(_c,{children:[l.jsx(Oc,{className:"cny-dialog-overlay"}),l.jsxs($c,{ref:f,className:h,style:m,children:[g,l.jsxs("header",{className:"cny-dialog-header",children:[l.jsxs("div",{className:"cny-dialog-titles",children:[l.jsx(Lc,{className:"cny-dialog-title",children:e}),n&&l.jsx(Fc,{className:"cny-dialog-description",children:n})]}),!i&&l.jsx(Rs,{className:"cny-dialog-close","aria-label":"Close dialog",children:l.jsx(Wt,{size:16,"aria-hidden":"true"})})]}),r!=null&&l.jsx("div",{className:"cny-dialog-body",children:r}),o!=null&&l.jsx("footer",{className:"cny-dialog-footer",children:o})]})]})})}),yj=Mm,vj=Rs;function Qm({open:t,onOpenChange:e,title:n,message:r,children:o,confirmLabel:s="Confirm",cancelLabel:i="Cancel",danger:a=!1,loading:c=!1,onConfirm:u,onCancel:d,className:f,style:h,sx:m}){const g=()=>{d==null||d(),e(!1)};return l.jsx(Zm,{open:t,onOpenChange:e,size:"sm",title:n,className:z("cny-confirm",f),style:h,sx:m,footer:l.jsxs(l.Fragment,{children:[l.jsx(Er,{variant:"ghost",color:"primary",onClick:g,disabled:c,children:i}),l.jsx(Er,{variant:"solid",color:a?"danger":"primary",loading:c,onClick:u,children:s})]}),children:o??l.jsx("p",{className:"cny-confirm-message",children:r})})}function xj(){const[t,e]=S.useState(null),n=S.useCallback(i=>new Promise(a=>{e({...i,resolve:a})}),[]),r=S.useCallback(i=>{i||e(a=>(a==null||a.resolve(!1),null))},[]),o=S.useCallback(()=>{e(i=>(i==null||i.resolve(!0),null))},[]),s=t?l.jsx(Qm,{open:!0,onOpenChange:r,title:t.title,message:t.message,confirmLabel:t.confirmLabel,cancelLabel:t.cancelLabel,danger:t.danger,onConfirm:o}):null;return{confirm:n,confirmDialog:s}}const bj=S.forwardRef(function({title:e,description:n,children:r,footer:o,side:s="right",size:i="md",hideClose:a,className:c,style:u,sx:d,...f},h){const{className:m,style:g,styleTag:y}=oe(d,u,"cny-drawer-content",`side-${s}`,`size-${i}`,c);return l.jsx(Nc,{...f,children:l.jsxs(_c,{children:[l.jsx(Oc,{className:"cny-drawer-overlay"}),l.jsxs($c,{ref:h,className:m,style:g,children:[y,l.jsxs("header",{className:"cny-drawer-header",children:[l.jsxs("div",{className:"cny-drawer-titles",children:[l.jsx(Lc,{className:"cny-drawer-title",children:e}),n&&l.jsx(Fc,{className:"cny-drawer-description",children:n})]}),!a&&l.jsx(Rs,{className:"cny-drawer-close","aria-label":"Close drawer",children:l.jsx(Wt,{size:16,"aria-hidden":"true"})})]}),r!=null&&l.jsx("div",{className:"cny-drawer-body",children:r}),o!=null&&l.jsx("footer",{className:"cny-drawer-footer",children:o})]})]})})}),wj=Mm,Cj=Rs;var Sj=Object.defineProperty,de=(t,e)=>Sj(t,"name",{value:e,configurable:!0}),Sa=["Enter"," "],Pj=["ArrowDown","PageUp","Home"],Jm=["ArrowUp","PageDown","End"],Rj=[...Pj,...Jm],Tj={ltr:[...Sa,"ArrowRight"],rtl:[...Sa,"ArrowLeft"]},Mj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},As="Menu",[kr,Ej,jj]=ar(As),[In,Ds]=Pe(As,[jj,un,ln]),Is=un(),eg=ln(),[tg,pn]=In(As),[Aj,Qr]=In(As),Dj=de(t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=t,a=Is(e),[c,u]=p.useState(null),d=p.useRef(!1),f=Ze(s),h=Ht(o);return p.useEffect(()=>{const m=de(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=de(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=de(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),l.jsx(Hr,{...a,children:l.jsx(tg,{scope:e,open:n,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(Aj,{scope:e,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})},"Menu"),ng=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e,s=Is(r);return l.jsx(Wr,{...s,...o,ref:n})},"MenuAnchor")),rg="MenuPortal",[Ij,og]=In(rg,{forceMount:void 0}),kj=de(t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=pn(rg,e);return l.jsx(Ij,{scope:e,forceMount:n,children:l.jsx(ze,{present:n||s.open,children:l.jsx(Kr,{asChild:!0,container:o,children:r})})})},"MenuPortal"),gt="MenuContent",[Nj,Xc]=In(gt),_j=p.forwardRef(de(function(e,n){const r=og(gt,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,i=pn(gt,e.__scopeMenu),a=Qr(gt,e.__scopeMenu);return l.jsx(kr.Provider,{scope:e.__scopeMenu,children:l.jsx(ze,{present:o||i.open,children:l.jsx(kr.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(Oj,{...s,ref:n}):l.jsx($j,{...s,ref:n})})})})},"MenuContent")),Oj=p.forwardRef(de(function(e,n){const r=pn(gt,e.__scopeMenu),o=p.useRef(null),s=ae(n,o);return p.useEffect(()=>{const i=o.current;if(i)return xs(i)},[]),l.jsx(qc,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:U(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),$j=p.forwardRef(de(function(e,n){const r=pn(gt,e.__scopeMenu);return l.jsx(qc,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Lj=yt("MenuContent.ScrollLock"),qc=p.forwardRef(de(function(e,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:y,...v}=e,x=pn(gt,r),w=Qr(gt,r),b=Is(r),C=eg(r),P=Ej(r),[R,M]=p.useState(null),A=p.useRef(null),T=ae(n,A,x.onContentChange),E=p.useRef(0),N=p.useRef(""),_=p.useRef(0),$=p.useRef(null),V=p.useRef("right"),q=p.useRef(0),W=y?Yr:p.Fragment,I=y?{as:Lj,allowPinchZoom:!0}:void 0,L=de(D=>{var J,K;const Y=N.current+D,j=P().filter(ee=>!ee.disabled),B=document.activeElement,Z=(J=j.find(ee=>ee.ref.current===B))==null?void 0:J.textValue,H=j.map(ee=>ee.textValue),se=fg(H,Y,Z),ce=(K=j.find(ee=>ee.textValue===se))==null?void 0:K.ref.current;de((function ee(ue){N.current=ue,window.clearTimeout(E.current),ue!==""&&(E.current=window.setTimeout(()=>ee(""),1e3))}),"updateSearch")(Y),ce&&setTimeout(()=>ce.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(E.current),[]),lr();const O=p.useCallback(D=>{var j,B;return V.current===((j=$.current)==null?void 0:j.side)&&pg(D,(B=$.current)==null?void 0:B.area)},[]);return l.jsx(Nj,{scope:r,searchRef:N,onItemEnter:p.useCallback(D=>{O(D)&&D.preventDefault()},[O]),onItemLeave:p.useCallback(D=>{var Y;O(D)||((Y=A.current)==null||Y.focus(),M(null))},[O]),onTriggerLeave:p.useCallback(D=>{O(D)&&D.preventDefault()},[O]),pointerGraceTimerRef:_,onPointerGraceIntentChange:p.useCallback(D=>{$.current=D},[]),children:l.jsx(W,{...I,children:l.jsx(fs,{asChild:!0,trapped:s,onMountAutoFocus:U(i,D=>{var Y;D.preventDefault(),(Y=A.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(zr,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:l.jsx(us,{asChild:!0,...C,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:M,onEntryFocus:U(u,D=>{w.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(vs,{role:"menu","aria-orientation":"vertical","data-state":Qc(x.open),"data-radix-menu-content":"",dir:w.dir,...b,...v,ref:T,style:{outline:"none",...v.style},onKeyDown:U(v.onKeyDown,D=>{const j=D.target.closest("[data-radix-menu-content]")===D.currentTarget,B=D.ctrlKey||D.altKey||D.metaKey,Z=D.key.length===1;j&&(D.key==="Tab"&&D.preventDefault(),!B&&Z&&L(D.key));const H=A.current;if(D.target!==H||!Rj.includes(D.key))return;D.preventDefault();const ce=P().filter(J=>!J.disabled).map(J=>J.ref.current);Jm.includes(D.key)&&ce.reverse(),ug(ce)}),onBlur:U(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(E.current),N.current="")}),onPointerMove:U(e.onPointerMove,tr(D=>{const Y=D.target,j=q.current!==D.clientX;if(D.currentTarget.contains(Y)&&j){const B=D.clientX>q.current?"right":"left";V.current=B,q.current=D.clientX}}))})})})})})})},"MenuContentImpl")),Fj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(ne.div,{role:"group",...o,ref:n})},"MenuGroup")),Vj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(ne.div,{...o,ref:n})},"MenuLabel")),Pa="MenuItem",Ld="menu.itemSelect",Zc=p.forwardRef(de(function(e,n){const{disabled:r=!1,onSelect:o,...s}=e,i=p.useRef(null),a=Qr(Pa,e.__scopeMenu),c=Xc(Pa,e.__scopeMenu),u=ae(n,i),d=p.useRef(!1),f=de(()=>{const h=i.current;if(!r&&h){const m=new CustomEvent(Ld,{bubbles:!0,cancelable:!0});h.addEventListener(Ld,g=>o==null?void 0:o(g),{once:!0}),dc(h,m),m.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return l.jsx(sg,{...s,ref:u,disabled:r,onClick:U(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),d.current=!0},onPointerUp:U(e.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:U(e.onKeyDown,h=>{r||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||Sa.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),sg=p.forwardRef(de(function(e,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=e,a=Xc(Pa,r),c=eg(r),u=p.useRef(null),d=ae(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const y=u.current;y&&g((y.textContent??"").trim())},[i.children]),l.jsx(kr.ItemSlot,{scope:r,disabled:o,textValue:s??m,children:l.jsx(ds,{asChild:!0,...c,focusable:!o,children:l.jsx(ne.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:U(e.onPointerMove,tr(y=>{o?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:U(e.onPointerLeave,tr(y=>a.onItemLeave(y))),onFocus:U(e.onFocus,()=>h(!0)),onBlur:U(e.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Bj=p.forwardRef(de(function(e,n){const{checked:r=!1,onCheckedChange:o,...s}=e;return l.jsx(ag,{scope:e.__scopeMenu,checked:r,children:l.jsx(Zc,{role:"menuitemcheckbox","aria-checked":Nr(r)?"mixed":r,...s,ref:n,"data-state":ks(r),onSelect:U(s.onSelect,()=>o==null?void 0:o(Nr(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Gj="MenuRadioGroup",[zj,Uj]=In(Gj,{value:void 0,onValueChange:de(()=>{},"onValueChange")}),Hj=p.forwardRef(de(function(e,n){const{value:r,onValueChange:o,...s}=e,i=Ze(o);return l.jsx(zj,{scope:e.__scopeMenu,value:r,onValueChange:i,children:l.jsx(Fj,{...s,ref:n})})},"MenuRadioGroup")),Wj="MenuRadioItem",Kj=p.forwardRef(de(function(e,n){const{value:r,...o}=e,s=Uj(Wj,e.__scopeMenu),i=r===s.value;return l.jsx(ag,{scope:e.__scopeMenu,checked:i,children:l.jsx(Zc,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":ks(i),onSelect:U(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),ig="MenuItemIndicator",[ag,Yj]=In(ig,{checked:!1}),Xj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,forceMount:o,...s}=e,i=Yj(ig,r);return l.jsx(ze,{present:o||Nr(i.checked)||i.checked===!0,children:l.jsx(ne.span,{...s,ref:n,"data-state":ks(i.checked)})})},"MenuItemIndicator")),qj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(ne.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),cg="MenuSub",[Zj,lg]=In(cg),Qj=de(t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,s=pn(cg,e),i=Is(e),[a,c]=p.useState(null),[u,d]=p.useState(null),f=Ze(o);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),l.jsx(Hr,{...i,children:l.jsx(tg,{scope:e,open:r,onOpenChange:f,content:u,onContentChange:d,children:l.jsx(Zj,{scope:e,contentId:Fe(),triggerId:Fe(),trigger:a,onTriggerChange:c,children:n})})})},"MenuSub"),jo="MenuSubTrigger",Jj=p.forwardRef(de(function(e,n){const r=pn(jo,e.__scopeMenu),o=Qr(jo,e.__scopeMenu),s=lg(jo,e.__scopeMenu),i=Xc(jo,e.__scopeMenu),a=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},f=p.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=ae(n,s.onTriggerChange);return l.jsx(ng,{asChild:!0,...d,children:l.jsx(sg,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":Qc(r.open),...e,ref:h,onClick:m=>{var g;(g=e.onClick)==null||g.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:U(e.onPointerMove,tr(m=>{i.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:U(e.onPointerLeave,tr(m=>{var y,v;f();const g=(y=r.content)==null?void 0:y.getBoundingClientRect();if(g){const x=(v=r.content)==null?void 0:v.dataset.side,w=x==="right",b=w?-5:5,C=g[w?"left":"right"],P=g[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+b,y:m.clientY},{x:C,y:g.top},{x:P,y:g.top},{x:P,y:g.bottom},{x:C,y:g.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:U(e.onKeyDown,m=>{var y;e.disabled||m.target!==m.currentTarget||i.searchRef.current!==""&&m.key===" "||Tj[o.dir].includes(m.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),m.preventDefault())})})})},"MenuSubTrigger")),eA="MenuSubContent",tA=p.forwardRef(de(function(e,n){const r=og(gt,e.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=e,a=pn(gt,e.__scopeMenu),c=Qr(gt,e.__scopeMenu),u=lg(eA,e.__scopeMenu),d=p.useRef(null),f=ae(n,d);return l.jsx(kr.Provider,{scope:e.__scopeMenu,children:l.jsx(ze,{present:o||a.open,children:l.jsx(kr.Slot,{scope:e.__scopeMenu,children:l.jsx(qc,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:U(e.onFocusOutside,h=>{h.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:U(e.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:U(e.onKeyDown,h=>{var y;const m=h.currentTarget.contains(h.target),g=Mj[c.dir].includes(h.key);m&&g&&(a.onOpenChange(!1),(y=u.trigger)==null||y.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function Qc(t){return t?"open":"closed"}de(Qc,"getOpenState");function Nr(t){return t==="indeterminate"}de(Nr,"isIndeterminate");function ks(t){return Nr(t)?"indeterminate":t?"checked":"unchecked"}de(ks,"getCheckedState");function ug(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}de(ug,"focusFirst");function dg(t,e){return t.map((n,r)=>t[(e+r)%t.length])}de(dg,"wrapArray");function fg(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=dg(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}de(fg,"getNextMatch");function hg(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],c=e[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}de(hg,"isPointInPolygon");function pg(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return hg(n,e)}de(pg,"isPointerInGraceArea");function tr(t){return e=>e.pointerType==="mouse"?t(e):void 0}de(tr,"whenMouse");var mg=Dj,gg=ng,yg=kj,vg=_j,xg=Vj,bg=Zc,wg=Bj,Cg=Hj,Sg=Kj,Pg=Xj,Rg=qj,Tg=Qj,Mg=Jj,Eg=tA,nA=Object.defineProperty,Qe=(t,e)=>nA(t,"name",{value:e,configurable:!0}),Jc="DropdownMenu",[rA,xN]=Pe(Jc,[Ds]),Je=Ds(),[oA,jg]=rA(Jc),sA=Qe(t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,c=Je(e),u=p.useRef(null),[d,f]=Se({prop:o,defaultProp:s??!1,onChange:i,caller:Jc});return l.jsx(oA,{scope:e,triggerId:Fe(),triggerRef:u,contentId:Fe(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:a,children:l.jsx(mg,{...c,open:d,onOpenChange:f,dir:r,modal:a,children:n})})},"DropdownMenu"),iA="DropdownMenuTrigger",aA=p.forwardRef(Qe(function(e,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,i=jg(iA,r),a=Je(r),c=ae(n,i.triggerRef);return l.jsx(gg,{asChild:!0,...a,children:l.jsx(ne.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:c,onPointerDown:U(e.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:U(e.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),cA=Qe(t=>{const{__scopeDropdownMenu:e,...n}=t,r=Je(e);return l.jsx(yg,{...r,...n})},"DropdownMenuPortal"),lA="DropdownMenuContent",uA=p.forwardRef(Qe(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=jg(lA,r),i=Je(r),a=p.useRef(!1);return l.jsx(vg,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:U(e.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:U(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(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)"}})},"DropdownMenuContent")),dA=p.forwardRef(Qe(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Je(r);return l.jsx(xg,{...s,...o,ref:n})},"DropdownMenuLabel")),fA=p.forwardRef(Qe(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Je(r);return l.jsx(bg,{...s,...o,ref:n})},"DropdownMenuItem")),hA=p.forwardRef(Qe(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Je(r);return l.jsx(wg,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),pA=p.forwardRef(Qe(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Je(r);return l.jsx(Cg,{...s,...o,ref:n})},"DropdownMenuRadioGroup")),mA=p.forwardRef(Qe(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Je(r);return l.jsx(Sg,{...s,...o,ref:n})},"DropdownMenuRadioItem")),gA=p.forwardRef(Qe(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Je(r);return l.jsx(Pg,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),yA=p.forwardRef(Qe(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Je(r);return l.jsx(Rg,{...s,...o,ref:n})},"DropdownMenuSeparator")),vA=Qe(t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:s}=t,i=Je(e),[a,c]=Se({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return l.jsx(Tg,{...i,open:a,onOpenChange:c,children:n})},"DropdownMenuSub"),xA=p.forwardRef(Qe(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Je(r);return l.jsx(Mg,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),bA=p.forwardRef(Qe(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Je(r);return l.jsx(Eg,{...s,...o,ref:n,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)"}})},"DropdownMenuSubContent")),wA=sA,CA=aA,Ag=cA,SA=uA,PA=dA,RA=fA,TA=hA,MA=pA,EA=mA,Dg=gA,jA=yA,AA=vA,DA=xA,IA=bA;const kA=wA,NA=CA,_A=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",sideOffset:s=6,children:i,...a},c){const{className:u,style:d,styleTag:f}=oe(r,n,"cny-menu-content",`size-${o}`,e);return l.jsx(Ag,{children:l.jsxs(SA,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i]})})}),OA=S.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(RA,{ref:a,className:z("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),$A=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(TA,{ref:s,className:z("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Dg,{children:l.jsx(nn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),LA=MA,FA=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(EA,{ref:s,className:z("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Dg,{children:l.jsx(Sp,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),VA=S.forwardRef(function({className:e,...n},r){return l.jsx(PA,{ref:r,className:z("cny-menu-label",e),...n})}),BA=S.forwardRef(function({className:e,...n},r){return l.jsx(jA,{ref:r,className:z("cny-menu-separator",e),...n})}),GA=AA,zA=S.forwardRef(function({icon:e,className:n,children:r,...o},s){return l.jsxs(DA,{ref:s,className:z("cny-menu-item is-sub",n),...o,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(Qt,{size:13,"aria-hidden":"true"})})]})}),UA=S.forwardRef(function({className:e,...n},r){return l.jsx(Ag,{children:l.jsx(IA,{ref:r,className:z("cny-menu-content",e),...n})})});var HA=Object.defineProperty,Ve=(t,e)=>HA(t,"name",{value:e,configurable:!0}),el="ContextMenu",[WA,bN]=Pe(el,[Ds]),et=Ds(),[KA,Ig]=WA(el),YA=Ve(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,dir:s,modal:i=!0}=t,a=p.useRef(!1),[c,u]=Se({prop:o,defaultProp:!1,onChange:r,caller:el}),d=et(e);return l.jsx(KA,{scope:e,open:c,onOpenChange:u,modal:i,hasInteractedRef:a,children:l.jsx(mg,{...d,dir:s,open:c,onOpenChange:u,modal:i,children:n})})},"ContextMenu"),XA="ContextMenuTrigger",qA=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,disabled:o=!1,...s}=e,i=Ig(XA,r),a=et(r),[c,u]=p.useState({x:0,y:0}),d=p.useMemo(()=>({current:{getBoundingClientRect:Ve(()=>DOMRect.fromRect({width:0,height:0,...c}),"getBoundingClientRect")}}),[c]),f=p.useRef(0),h=p.useCallback(()=>window.clearTimeout(f.current),[]),m=Ve(g=>{i.hasInteractedRef.current=!0,u({x:g.clientX,y:g.clientY}),i.onOpenChange(!0)},"handleOpen");return p.useEffect(()=>h,[h]),p.useEffect(()=>void(o&&h()),[o,h]),l.jsxs(l.Fragment,{children:[l.jsx(gg,{...a,virtualRef:d}),l.jsx(ne.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...s,ref:n,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:o?e.onContextMenu:U(e.onContextMenu,g=>{h(),m(g),g.preventDefault()}),onPointerDown:o?e.onPointerDown:U(e.onPointerDown,xr(g=>{h(),i.open&&i.onOpenChange(!1),f.current=window.setTimeout(()=>m(g),700)})),onPointerMove:o?e.onPointerMove:U(e.onPointerMove,xr(h)),onPointerCancel:o?e.onPointerCancel:U(e.onPointerCancel,xr(h)),onPointerUp:o?e.onPointerUp:U(e.onPointerUp,xr(h))})]})},"ContextMenuTrigger")),ZA=Ve(t=>{const{__scopeContextMenu:e,...n}=t,r=et(e);return l.jsx(yg,{...r,...n})},"ContextMenuPortal"),QA="ContextMenuContent",JA=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Ig(QA,r),i=et(r),a=p.useRef(!1);return l.jsx(vg,{...i,...o,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var u;(u=e.onCloseAutoFocus)==null||u.call(e,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var u;(u=e.onInteractOutside)==null||u.call(e,c),!c.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),eD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=et(r);return l.jsx(xg,{...s,...o,ref:n})},"ContextMenuLabel")),tD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=et(r);return l.jsx(bg,{...s,...o,ref:n})},"ContextMenuItem")),nD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=et(r);return l.jsx(wg,{...s,...o,ref:n})},"ContextMenuCheckboxItem")),rD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=et(r);return l.jsx(Cg,{...s,...o,ref:n})},"ContextMenuRadioGroup")),oD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=et(r);return l.jsx(Sg,{...s,...o,ref:n})},"ContextMenuRadioItem")),sD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=et(r);return l.jsx(Pg,{...s,...o,ref:n})},"ContextMenuItemIndicator")),iD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=et(r);return l.jsx(Rg,{...s,...o,ref:n})},"ContextMenuSeparator")),aD="ContextMenuSub",cD=Ve(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,defaultOpen:s}=t,i=et(e),[a,c]=Se({prop:o,defaultProp:s??!1,onChange:r,caller:aD});return l.jsx(Tg,{...i,open:a,onOpenChange:c,children:n})},"ContextMenuSub"),lD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=et(r);return l.jsx(Mg,{...s,...o,ref:n})},"ContextMenuSubTrigger")),uD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=et(r);return l.jsx(Eg,{...s,...o,ref:n,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function xr(t){return e=>e.pointerType!=="mouse"?t(e):void 0}Ve(xr,"whenTouchOrPen");var dD=YA,fD=qA,kg=ZA,hD=JA,pD=eD,mD=tD,gD=nD,yD=rD,vD=oD,Ng=sD,xD=iD,bD=cD,wD=lD,CD=uD;const SD=dD,PD=fD,RD=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",alignOffset:s=-4,children:i,...a},c){const{className:u,style:d,styleTag:f}=oe(r,n,"cny-menu-content",`size-${o}`,e);return l.jsx(kg,{children:l.jsxs(hD,{ref:c,className:u,style:d,alignOffset:s,...a,children:[f,i]})})}),TD=S.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(mD,{ref:a,className:z("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),MD=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(gD,{ref:s,className:z("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Ng,{children:l.jsx(nn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),ED=yD,jD=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(vD,{ref:s,className:z("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Ng,{children:l.jsx(Sp,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),AD=S.forwardRef(function({className:e,...n},r){return l.jsx(pD,{ref:r,className:z("cny-menu-label",e),...n})}),DD=S.forwardRef(function({className:e,...n},r){return l.jsx(xD,{ref:r,className:z("cny-menu-separator",e),...n})}),ID=bD,kD=S.forwardRef(function({icon:e,className:n,children:r,...o},s){return l.jsxs(wD,{ref:s,className:z("cny-menu-item is-sub",n),...o,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(Qt,{size:13,"aria-hidden":"true"})})]})}),ND=S.forwardRef(function({className:e,...n},r){return l.jsx(kg,{children:l.jsx(CD,{ref:r,className:z("cny-menu-content",e),...n})})});var _D=Object.defineProperty,De=(t,e)=>_D(t,"name",{value:e,configurable:!0}),[tl,wN]=Pe("Tooltip",[un]),Ns=un(),OD="TooltipProvider",$D=700,Ra="tooltip.open",[LD,nl]=tl(OD),FD=De(t=>{const{__scopeTooltip:e,delayDuration:n=$D,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=t,i=p.useRef(!0),a=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(LD,{scope:e,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{r<=0||(window.clearTimeout(c.current),i.current=!1)},[r]),onClose:p.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),Ta="Tooltip",[VD,Jr]=tl(Ta),BD=De(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=t,c=nl(Ta,t.__scopeTooltip),u=Ns(e),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=Fe(),y=p.useRef(0),v=i??c.disableHoverableContent,x=a??c.delayDuration,w=p.useRef(!1),[b,C]=Se({prop:r,defaultProp:o??!1,onChange:De(E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Ra))):c.onClose(),s==null||s(E)},"onChange"),caller:Ta}),P=p.useMemo(()=>b?w.current?"delayed-open":"instant-open":"closed",[b]),R=p.useCallback(()=>{window.clearTimeout(y.current),y.current=0,w.current=!1,C(!0)},[C]),M=p.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C(!1)},[C]),A=p.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{w.current=!0,C(!0),y.current=0},x)},[x,C]);p.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const T=h??g;return l.jsx(Hr,{...u,children:l.jsx(VD,{scope:e,contentId:T,setContentId:m,open:b,stateAttribute:P,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?A():R()},[c.isOpenDelayedRef,A,R]),onTriggerLeave:p.useCallback(()=>{v?M():(window.clearTimeout(y.current),y.current=0)},[M,v]),onOpen:R,onClose:M,disableHoverableContent:v,children:n})})},"Tooltip"),Fd="TooltipTrigger",GD=p.forwardRef(De(function(e,n){const{__scopeTooltip:r,...o}=e,s=Jr(Fd,r),i=nl(Fd,r),a=Ns(r),c=p.useRef(null),u=ae(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(Wr,{asChild:!0,...a,children:l.jsx(ne.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:u,onPointerMove:U(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:U(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:U(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:U(e.onBlur,s.onClose),onClick:U(e.onClick,s.onClose)})})},"TooltipTrigger")),_g="TooltipPortal",[zD,UD]=tl(_g,{forceMount:void 0}),HD=De(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,s=Jr(_g,e);return l.jsx(zD,{scope:e,forceMount:n,children:l.jsx(ze,{present:n||s.open,children:l.jsx(Kr,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),_r="TooltipContent",WD=p.forwardRef(De(function(e,n){const r=UD(_r,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=e,a=Jr(_r,e.__scopeTooltip);return l.jsx(ze,{present:o||a.open,children:a.disableHoverableContent?l.jsx(Og,{side:s,...i,ref:n}):l.jsx(KD,{side:s,...i,ref:n})})},"TooltipContent")),KD=p.forwardRef(De(function(e,n){const r=Jr(_r,e.__scopeTooltip),o=nl(_r,e.__scopeTooltip),s=p.useRef(null),i=ae(n,s),[a,c]=p.useState(null),{trigger:u,onClose:d}=r,f=s.current,{onPointerInTransitChange:h}=o,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((y,v)=>{const x=y.currentTarget,w={x:y.clientX,y:y.clientY},b=$g(w,x.getBoundingClientRect()),C=Lg(w,b),P=Fg(v.getBoundingClientRect()),R=Bg([...C,...P]);c(R),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const y=De(x=>g(x,f),"handleTriggerLeave"),v=De(x=>g(x,u),"handleContentLeave");return u.addEventListener("pointerleave",y),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(a){const y=De(v=>{const x=v.target,w={x:v.clientX,y:v.clientY},b=(u==null?void 0:u.contains(x))||(f==null?void 0:f.contains(x)),C=!Vg(w,a);b?m():C&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,f,a,d,m]),l.jsx(Og,{...e,ref:i})},"TooltipContentHoverable")),YD=Yd("TooltipContent"),Og=p.forwardRef(De(function(e,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=e,d=Jr(_r,r),f=Ns(r),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(Ra,h),()=>document.removeEventListener(Ra,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=De(y=>{y.target instanceof Node&&y.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return Ee(()=>(m(i),()=>{m(void 0)}),[i,m]),l.jsx(zr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:l.jsxs(vs,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.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:[l.jsx(YD,{children:o}),s?l.jsx(PT,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),XD=p.forwardRef(De(function(e,n){const{__scopeTooltip:r,...o}=e,s=Ns(r);return l.jsx(tm,{...s,...o,ref:n})},"TooltipArrow"));function $g(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}De($g,"getExitSideFromRect");function Lg(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}De(Lg,"getPaddedExitPoints");function Fg(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}De(Fg,"getPointsFromRect");function Vg(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],c=e[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}De(Vg,"isPointInPolygon");function Bg(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Gg(e)}De(Bg,"getHull");function Gg(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}De(Gg,"getHullPresorted");var qD=FD,zg=BD,Ug=GD,Hg=HD,Wg=WD,ZD=XD;const QD=qD,JD=S.forwardRef(function({children:e,content:n,side:r="top",align:o="center",sideOffset:s=6,delayDuration:i,open:a,disabled:c,contentClassName:u,contentStyle:d,sx:f},h){const{className:m,style:g,styleTag:y}=oe(f,d,"cny-tooltip-content",u);return c?l.jsx(l.Fragment,{children:e}):l.jsxs(zg,{delayDuration:i,open:a,children:[l.jsx(Ug,{asChild:!0,children:e}),l.jsx(Hg,{children:l.jsxs(Wg,{ref:h,side:r,align:o,sideOffset:s,className:m,style:g,children:[y,n,l.jsx(ZD,{className:"cny-tooltip-arrow",width:10,height:5})]})})]})}),eI=zg,tI=Ug,nI=S.forwardRef(function({className:e,...n},r){return l.jsx(Hg,{children:l.jsx(Wg,{ref:r,className:z("cny-tooltip-content",e),...n})})}),rI=Ss,oI=Dc,sI=Pm,iI=yM,aI=S.forwardRef(function({className:e,style:n,sx:r,withArrow:o=!1,sideOffset:s=8,children:i,...a},c){const{className:u,style:d,styleTag:f}=oe(r,n,"cny-popover-content",e);return l.jsx(Ic,{children:l.jsxs(Ps,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i,o&&l.jsx(vM,{className:"cny-popover-arrow",width:12,height:6})]})})}),cI=S.forwardRef(function({color:e="default",variant:n="soft",size:r="md",icon:o,avatar:s,onDelete:i,deleteLabel:a="Remove",onClick:c,disabled:u,className:d,style:f,sx:h,children:m,...g},y){const v=!u&&c!=null,{className:x,style:w,styleTag:b}=oe(h,f,"cny-chip",e,n,r==="sm"&&"sm",v&&"is-interactive",u&&"is-disabled",d);return l.jsxs("span",{ref:y,role:v?"button":void 0,tabIndex:v?0:void 0,"aria-disabled":u||void 0,onClick:u?void 0:c,onKeyDown:v?C=>{C.target===C.currentTarget&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),c==null||c(C))}:void 0,className:x,style:w,...g,children:[b,s&&l.jsx("span",{className:"cny-chip-avatar",children:s}),o&&l.jsx("span",{className:"cny-chip-icon",children:o}),l.jsx("span",{className:"cny-chip-label",children:m}),i&&!u&&l.jsx("button",{type:"button",className:"cny-chip-delete","aria-label":a,onClick:C=>{C.stopPropagation(),i(C)},children:l.jsx(Wt,{size:r==="sm"?11:13,"aria-hidden":"true"})})]})}),lI=S.forwardRef(function({count:e,dot:n=!1,max:r=99,showZero:o=!1,color:s="danger",placement:i="top-right",standalone:a=!1,children:c,className:u,style:d,sx:f,...h},m){const g=typeof e=="number",y=g&&e>r?`${r}+`:e,x=!n&&(!g||e===0&&!o)?null:l.jsx("span",{className:z("cny-badge-indicator",`cny-badge-${s}`,n&&"cny-badge-dot",!a&&`cny-badge-${i}`),children:n?null:y});if(a){const{className:P,style:R,styleTag:M}=oe(f,d,"cny-badge-standalone",u);return l.jsxs("span",{ref:m,className:P,style:R,...h,children:[M,x]})}const{className:w,style:b,styleTag:C}=oe(f,d,"cny-badge-anchor",u);return l.jsxs("span",{ref:m,className:w,style:b,...h,children:[C,c,x]})}),uI=S.forwardRef(function({position:e="right",orientation:n="vertical",size:r="md",className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=oe(i,s,"cny-timeline",n==="horizontal"?"cny-timeline-horizontal":`cny-timeline-${e}`,r!=="md"&&`cny-timeline-${r}`,o);return l.jsxs("ol",{ref:u,className:d,style:f,...c,children:[h,a]})}),dI=S.forwardRef(function({className:e,...n},r){return l.jsx("li",{ref:r,className:z("cny-timeline-item",e),...n})}),fI=S.forwardRef(function({className:e,...n},r){return l.jsx("div",{ref:r,className:z("cny-timeline-separator",e),...n})}),hI=S.forwardRef(function({color:e="neutral",variant:n="filled",icon:r,active:o=!1,className:s,children:i,...a},c){const u=r??i;return l.jsx("span",{ref:c,className:z("cny-timeline-dot",`cny-timeline-dot-${e}`,`cny-timeline-dot-${n}`,u!=null&&u!==!1&&"cny-timeline-dot-icon",o&&"cny-timeline-dot-active",s),...a,children:u})}),pI=S.forwardRef(function({color:e,lineStyle:n="solid",className:r,...o},s){return l.jsx("span",{ref:s,className:z("cny-timeline-connector",e&&`cny-timeline-connector-${e}`,n!=="solid"&&`cny-timeline-connector-${n}`,r),"aria-hidden":"true",...o})}),mI=S.forwardRef(function({variant:e="plain",accentColor:n,className:r,...o},s){const i=e==="card"||e==="elevated";return l.jsx("div",{ref:s,className:z("cny-timeline-content",i&&"cny-timeline-content-card",e==="elevated"&&"cny-timeline-content-elevated",n&&"cny-timeline-content-accent",n&&`cny-timeline-content-accent-${n}`,r),...o})}),gI=S.forwardRef(function({className:e,...n},r){return l.jsx("div",{ref:r,className:z("cny-timeline-opposite-content",e),...n})}),Kg=S.createContext(null);function yI(){const t=S.useContext(Kg);if(!t)throw new Error("TreeItem must be used within a <TreeView>.");return t}const Yg=S.forwardRef(function({expandedIds:e,defaultExpandedIds:n,onExpandedChange:r,selectedId:o,defaultSelectedId:s=null,onSelectedChange:i,onItemExpandToggle:a,defaultIcons:c=!0,className:u,style:d,sx:f,children:h,...m},g){const[y,v]=S.useState(n??[]),[x,w]=S.useState(s),[b,C]=S.useState(null),P=e??y,R=o!==void 0?o:x,M=S.useMemo(()=>new Set(P),[P]),A=S.useCallback(I=>M.has(I),[M]),T=S.useCallback(I=>{const L=!M.has(I),O=L?[...P,I]:P.filter(D=>D!==I);e===void 0&&v(O),r==null||r(O),a==null||a(I,L)},[P,M,e,r,a]),E=S.useCallback(I=>{o===void 0&&w(I),i==null||i(I)},[o,i]),N=S.useMemo(()=>({isExpanded:A,toggle:T,selectedId:R,select:E,activeId:b,setActive:C,defaultIcons:c}),[A,T,R,E,b,c]),_=S.useRef(null),$=S.useCallback(I=>{_.current=I,typeof g=="function"?g(I):g&&(g.current=I)},[g]);S.useEffect(()=>{var O;if(b!==null)return;const I=(O=_.current)==null?void 0:O.querySelector('[role="treeitem"]'),L=I==null?void 0:I.dataset.treeId;L&&C(L)},[b]);const{className:V,style:q,styleTag:W}=oe(f,d,"cny-tree",u);return l.jsx(Kg.Provider,{value:N,children:l.jsxs("ul",{ref:$,role:"tree",className:V,style:q,...m,children:[W,h]})})});function vI(t){return t?Array.from(t.querySelectorAll('[role="treeitem"]')):[]}const Xg=S.forwardRef(function({itemId:e,label:n,icon:r,children:o,className:s,...i},a){const{isExpanded:c,toggle:u,selectedId:d,select:f,activeId:h,setActive:m,defaultIcons:g}=yI(),y=!!o,v=y&&c(e),x=d===e,w=h===e,b=r??(g?y?v?l.jsx(BS,{size:16}):l.jsx(zS,{size:16}):l.jsx(FS,{size:16}):null),C=()=>{m(e),f(e),y&&u(e)},P=M=>{M.preventDefault(),M.stopPropagation(),m(e),u(e)},R=M=>{var T;const A=M.currentTarget.closest('[role="tree"]');switch(M.key){case"ArrowRight":if(M.preventDefault(),y&&!v)u(e);else if(v){const E=M.currentTarget.querySelector('[role="treeitem"]');E==null||E.focus()}break;case"ArrowLeft":if(M.preventDefault(),y&&v)u(e);else{const E=(T=M.currentTarget.parentElement)==null?void 0:T.closest('[role="treeitem"]');E==null||E.focus()}break;case"ArrowDown":case"ArrowUp":{M.preventDefault();const E=vI(A),N=E.indexOf(M.currentTarget),_=E[N+(M.key==="ArrowDown"?1:-1)];_==null||_.focus();break}case"Enter":case" ":M.preventDefault(),f(e),y&&u(e);break}};return l.jsxs("li",{ref:a,role:"treeitem","data-tree-id":e,"aria-expanded":y?v:void 0,"aria-selected":x,tabIndex:w?0:-1,className:z("cny-tree-item",s),onKeyDown:R,onFocus:M=>{M.target===M.currentTarget&&m(e)},...i,children:[l.jsxs("div",{className:z("cny-tree-row",x&&"is-selected"),onClick:C,children:[y?l.jsx("button",{type:"button",tabIndex:-1,className:z("cny-tree-toggle",v&&"is-open"),"aria-label":`Toggle ${typeof n=="string"?n:e}`,onClick:P,children:l.jsx(Qt,{size:16,"aria-hidden":"true"})}):l.jsx("span",{className:"cny-tree-toggle-spacer","aria-hidden":"true"}),b!=null&&l.jsx("span",{className:"cny-tree-icon",children:b}),l.jsx("span",{className:"cny-tree-label",children:n})]}),v&&l.jsx("ul",{role:"group",className:"cny-tree-group",children:o})]})}),xI=S.forwardRef(function({items:e,getItemId:n=c=>String(c.id),getItemLabel:r=c=>c.label,getItemChildren:o=c=>c.children,getItemIcon:s,...i},a){const c=u=>u.map(d=>{const f=n(d),h=o(d);return l.jsx(Xg,{itemId:f,label:r(d),icon:s==null?void 0:s(d),children:h&&h.length>0?c(h):null},f)});return l.jsx(Yg,{ref:a,...i,children:c(e)})});function bI(t){if(!t)return[];if(typeof t=="string")return t.split(",").map(n=>n.trim()).filter(Boolean);if(Array.isArray(t))return t.map(n=>n.trim()).filter(Boolean);const e=[];for(const[n,r]of Object.entries(t)){e.push(n);for(const o of r)e.push(o)}return e}function wI(t,e){if(e.length===0)return!0;const n=t.name.toLowerCase(),r=(t.type||"").toLowerCase();return e.some(o=>{const s=o.toLowerCase();return s==="*"||s==="*/*"?!0:s.startsWith(".")?n.endsWith(s):s.endsWith("/*")?r.startsWith(s.slice(0,-1)):r===s})}function qg(t={}){const{accept:e,maxSize:n,minSize:r,multiple:o=!1,maxFiles:s,disabled:i=!1,onDrop:a,onDropAccepted:c,onDropRejected:u}=t,[d,f]=S.useState(!1),h=S.useRef(null),m=S.useRef(0),g=S.useMemo(()=>bI(e),[e]),y=g.join(",")||void 0,v=S.useCallback(P=>{const R=[];return wI(P,g)||R.push({code:"file-invalid-type",message:"File type is not allowed."}),typeof n=="number"&&P.size>n&&R.push({code:"file-too-large",message:`File is larger than ${n} bytes.`}),typeof r=="number"&&P.size<r&&R.push({code:"file-too-small",message:`File is smaller than ${r} bytes.`}),R},[g,n,r]),x=S.useCallback(P=>{if(i||P.length===0)return;const R=[],M=[];if(!o&&P.length>1||typeof s=="number"&&P.length>s)for(const T of P)M.push({file:T,errors:[{code:"too-many-files",message:"Too many files."}]});else for(const T of P){const E=v(T);E.length?M.push({file:T,errors:E}):R.push(T)}a==null||a(R,M),R.length&&(c==null||c(R)),M.length&&(u==null||u(M))},[i,o,s,v,a,c,u]),w=S.useCallback(()=>{var P;i||(P=h.current)==null||P.click()},[i]),b=S.useCallback((P={})=>{const{onClick:R,onKeyDown:M,onDragOver:A,onDragEnter:T,onDragLeave:E,onDrop:N,..._}=P;return{..._,role:"button",tabIndex:i?-1:0,"aria-disabled":i||void 0,onClick:$=>{R==null||R($),i||w()},onKeyDown:$=>{M==null||M($),($.key==="Enter"||$.key===" ")&&($.preventDefault(),w())},onDragOver:$=>{A==null||A($),$.preventDefault(),i||f(!0)},onDragEnter:$=>{T==null||T($),$.preventDefault(),!i&&(m.current+=1,f(!0))},onDragLeave:$=>{E==null||E($),m.current=Math.max(0,m.current-1),m.current===0&&f(!1)},onDrop:$=>{var V;N==null||N($),$.preventDefault(),m.current=0,f(!1),!i&&x(Array.from(((V=$.dataTransfer)==null?void 0:V.files)??[]))}}},[i,w,x]),C=S.useCallback((P={})=>{const{onChange:R,...M}=P;return{...M,ref:h,type:"file",accept:y,multiple:o,style:{display:"none"},onChange:A=>{R==null||R(A),x(Array.from(A.target.files??[])),A.target.value=""}}},[y,o,x]);return{getRootProps:b,getInputProps:C,open:w,isDragActive:d,inputRef:h}}const CI=S.forwardRef(function({onDrop:e,label:n="Drop files here or click to upload",hint:r,icon:o,children:s,buttonLabel:i="Browse files",size:a="md",accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,className:g,style:y,sx:v},x){const{getRootProps:w,getInputProps:b,isDragActive:C,open:P}=qg({accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,onDrop:e}),{className:R,style:M,styleTag:A}=oe(v,y,"cny-uploader",`cny-uploader-${a}`,C&&"is-dragging",m&&"is-disabled",g);return l.jsxs("div",{...w(),ref:x,"aria-label":typeof n=="string"?n:"Upload files",className:R,style:M,children:[A,l.jsx("input",{...b()}),s??l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-uploader-icon","aria-hidden":"true",children:o??l.jsx(DS,{})}),l.jsxs("span",{className:"cny-uploader-text",children:[l.jsx("span",{className:"cny-uploader-label",children:n}),r!=null&&l.jsx("span",{className:"cny-uploader-hint",children:r})]}),i!==!1&&l.jsx(Er,{type:"button",variant:"outline",size:a==="sm"?"sm":"md",disabled:m,tabIndex:-1,onClick:T=>{T.stopPropagation(),P()},children:i})]})]})}),SI=5;function Vd(t){if(t.length===0)return[];const n=t.reduce((a,c)=>a+(c.def??0),0),r=t.filter(a=>a.def==null).length,o=r?Math.max(0,100-n)/r:0,s=t.map(a=>a.def==null?o:a.def),i=s.reduce((a,c)=>a+c,0)||1;return s.map(a=>a/i*100)}function Bd(t,e,n,r){if(e<0||e+1>=t.length)return t;const o=t[e]+t[e+1];let s=Math.max(r[e].min,Math.min(r[e].max,t[e]+n));const i=Math.max(r[e+1].min,Math.min(r[e+1].max,o-s));s=Math.max(r[e].min,Math.min(r[e].max,o-i));const a=[...t];return a[e]=s,a[e+1]=i,a}const Ma=S.forwardRef(function({defaultSize:e,minSize:n,maxSize:r,className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=oe(i,s,"cny-panel",o);return l.jsxs("div",{ref:u,className:d,style:f,...c,children:[h,a]})}),Zg=S.forwardRef(function({disabled:e,className:n,__internal:r,...o},s){const i=(r==null?void 0:r.direction)!=="vertical",a=c=>{if(!r||e)return;const u=i?"ArrowRight":"ArrowDown",d=i?"ArrowLeft":"ArrowUp";c.key===u?(c.preventDefault(),r.onKeyResize(1)):c.key===d&&(c.preventDefault(),r.onKeyResize(-1))};return l.jsx("div",{ref:s,role:"separator",tabIndex:e?-1:0,"aria-orientation":i?"vertical":"horizontal","aria-valuenow":r==null?void 0:r.valueNow,"aria-valuemin":r==null?void 0:r.valueMin,"aria-valuemax":r==null?void 0:r.valueMax,"aria-disabled":e||void 0,className:z("cny-panel-handle",i?"cny-panel-handle-h":"cny-panel-handle-v",n),onPointerDown:c=>{e||(c.preventDefault(),r==null||r.onResizeStart(c))},onKeyDown:a,...o})}),PI=S.forwardRef(function({direction:e="horizontal",className:n,style:r,sx:o,children:s,...i},a){const c=S.useRef(null),u=S.Children.toArray(s).filter(S.isValidElement),d=u.filter(A=>A.type===Ma).map(A=>{const T=A.props;return{min:T.minSize??10,max:T.maxSize??90,def:T.defaultSize??null}}),[f,h]=S.useState(()=>Vd(d)),m=f.length===d.length?f:Vd(d),g=S.useRef(null),y=(A,T)=>{const E=e==="horizontal"?T.clientX:T.clientY;g.current={g:A,start:E,startSizes:m};const N=$=>{var O;const V=g.current,q=(O=c.current)==null?void 0:O.getBoundingClientRect();if(!V||!q)return;const W=e==="horizontal"?q.width:q.height;if(!W)return;const L=((e==="horizontal"?$.clientX:$.clientY)-V.start)/W*100;h(Bd(V.startSizes,V.g,L,d))},_=()=>{g.current=null,window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",_)};window.addEventListener("pointermove",N),window.addEventListener("pointerup",_)},v=(A,T)=>{h(Bd(m,A,T*SI,d))},x=A=>{c.current=A,typeof a=="function"?a(A):a&&(a.current=A)};let w=-1,b=-1;const C=u.map(A=>{var T,E;if(A.type===Ma){w+=1;const N=w,_={...A.props.style,flexBasis:`${m[N]??0}%`,flexGrow:0,flexShrink:0};return S.cloneElement(A,{key:A.key??`panel-${N}`,style:_})}if(A.type===Zg){b+=1;const N=b,_={direction:e,valueNow:Math.round(m[N]??0),valueMin:((T=d[N])==null?void 0:T.min)??0,valueMax:((E=d[N])==null?void 0:E.max)??100,onResizeStart:$=>y(N,$),onKeyResize:$=>v(N,$)};return S.cloneElement(A,{key:A.key??`handle-${N}`,__internal:_})}return A}),{className:P,style:R,styleTag:M}=oe(o,r,"cny-panel-group",e==="vertical"&&"is-vertical",n);return l.jsxs("div",{ref:x,className:P,style:R,...i,children:[M,C]})});function RI(){}function TI(t,e,n,r){if(e<1)return[];if(e===1)return[{type:"page",page:1}];const o=e,s=Math.max(1,t-n),i=Math.min(o,t+n),a=[],c=r&&s>1,u=r&&i<o,d=c&&s>2,f=u&&i<o-1;c&&a.push({type:"page",page:1}),d&&a.push({type:"ellipsis",key:"l"});for(let h=s;h<=i;h++)a.push({type:"page",page:h});return f&&a.push({type:"ellipsis",key:"r"}),u&&a.push({type:"page",page:o}),a.filter((h,m,g)=>h.type!=="page"?!0:g.findIndex(y=>y.type==="page"&&y.page===h.page)===m)}const Qg=S.forwardRef(function({page:e,pageCount:n,onPageChange:r,siblingCount:o=1,showEdges:s=!0,hideControls:i=!1,size:a="md",className:c,style:u,sx:d,"aria-label":f="Pagination"},h){const m=S.useMemo(()=>TI(e,n,o,s),[e,n,o,s]),g=w=>{w<1||w>n||w===e||r(w)},{className:y,style:v,styleTag:x}=oe(d,u,"cny-pagination",`cny-pagination-${a}`,c);return l.jsxs("nav",{ref:h,role:"navigation","aria-label":f,className:y,style:v,children:[x,!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>g(e-1),disabled:e<=1,"aria-label":"Previous page",children:l.jsx(Fo,{size:14,"aria-hidden":"true"})}),m.map(w=>w.type==="ellipsis"?l.jsx("span",{className:"cny-pagination-ellipsis","aria-hidden":"true",children:l.jsx(kS,{size:14})},`e-${w.key}`):l.jsx("button",{type:"button",className:z("cny-pagination-btn",w.page===e&&"is-active"),"aria-current":w.page===e?"page":void 0,onClick:()=>g(w.page),children:w.page},w.page)),!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>g(e+1),disabled:e>=n,"aria-label":"Next page",children:l.jsx(Qt,{size:14,"aria-hidden":"true"})})]})}),Mi={left:"cny-dt-left",center:"cny-dt-center",right:"cny-dt-right"};function MI(t){return t.id}function EI(t,e){return!t||t.field!==e?{field:e,sort:"asc"}:t.sort==="asc"?{field:e,sort:"desc"}:null}const jI=S.forwardRef(function({columns:e,rows:n,getRowId:r=MI,loading:o=!1,rowCount:s,paginationModel:i,onPaginationModelChange:a,checkboxSelection:c=!1,rowSelectionModel:u,onRowSelectionModelChange:d,sortModel:f,onSortModelChange:h,onRowClick:m,noRowsLabel:g="No rows",disableColumnResize:y=!1,density:v="standard",checkboxColumnWidth:x=44,stickyHeader:w=!1,tableLayout:b="auto",getRowClassName:C,className:P,style:R,sx:M},A){const T=e.length+(c?1:0),E=S.useRef(null),[N,_]=S.useState(null),$=(F,G)=>{var mn;G.preventDefault(),G.stopPropagation();const le={};(mn=E.current)==null||mn.querySelectorAll("thead th[data-field]").forEach(pe=>{const be=pe.dataset.field;be&&(le[be]=pe.getBoundingClientRect().width)});const ie=G.clientX,_e=le[F]??0;_(le);const ge=pe=>{_({...le,[F]:Math.max(60,_e+(pe.clientX-ie))})},tt=()=>{window.removeEventListener("pointermove",ge),window.removeEventListener("pointerup",tt)};window.addEventListener("pointermove",ge),window.addEventListener("pointerup",tt)},V=F=>!y&&F.resizable!==!1,q=u??[],W=new Set(q),I=n.map(F=>r(F)),L=I.length>0&&I.every(F=>W.has(F)),O=I.some(F=>W.has(F)),D=L?!0:O?"indeterminate":!1,Y=()=>{if(d)if(L)d(q.filter(F=>!I.includes(F)));else{const F=new Set(q);I.forEach(G=>F.add(G)),d([...F])}},j=F=>{d&&(W.has(F)?d(q.filter(G=>G!==F)):d([...q,F]))},B=F=>{!F.sortable||!h||h(EI(f,F.field))},Z=b==="fixed",H=e.reduce((F,G)=>G.width!=null?F:F+(G.flex??1),0),se=(c?x:0)+e.reduce((F,G)=>typeof G.width=="number"?F+G.width:F,0),ce=F=>{if(F.width!=null)return F.width;if(H<=0)return;const G=(F.flex??1)/H;return se>0?`calc((100% - ${se}px) * ${G.toFixed(6)})`:`${(G*100).toFixed(4)}%`},J=F=>F.width!=null?{width:F.width,minWidth:F.width}:{flex:F.flex??1},K=()=>{if(!i||s==null)return null;const{page:F,pageSize:G}=i,le=Math.max(1,Math.ceil(s/G)),ie=s===0?0:F*G+1,_e=Math.min(s,(F+1)*G);return l.jsxs("div",{className:"cny-dt-footer",children:[l.jsxs("span",{className:"cny-dt-count",children:[ie,"–",_e," of ",s]}),l.jsx(Qg,{page:F+1,pageCount:le,size:"sm",onPageChange:ge=>a==null?void 0:a({page:ge-1,pageSize:G})})]})},{className:ee,style:ue,styleTag:X}=oe(M,R,"cny-dt",v==="compact"&&"cny-dt-compact",w&&"cny-dt-sticky",P);return l.jsxs("div",{ref:A,className:ee,style:ue,children:[X,l.jsx("div",{className:"cny-dt-scroll",children:l.jsxs("table",{ref:E,className:"cny-dt-table",style:N?{tableLayout:"fixed",width:"max-content",minWidth:"100%"}:Z?{tableLayout:"fixed",width:"100%"}:void 0,children:[(N||Z)&&l.jsxs("colgroup",{children:[c&&l.jsx("col",{style:{width:x}}),e.map(F=>l.jsx("col",{style:{width:N?N[F.field]:ce(F)}},F.field))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[c&&l.jsx("th",{className:"cny-dt-checkbox-cell",scope:"col",children:l.jsx(Ca,{checked:D,onCheckedChange:Y,"aria-label":"Select all rows"})}),e.map(F=>{const G=(f==null?void 0:f.field)===F.field,le=F.headerAlign??F.align;return l.jsxs("th",{scope:"col","data-field":F.field,style:N?void 0:J(F),"aria-sort":G?f.sort==="asc"?"ascending":"descending":void 0,className:z(le&&Mi[le],F.sortable&&"cny-dt-sortable",G&&"is-sorted"),children:[F.sortable?l.jsx("button",{type:"button",className:"cny-dt-sortbtn",onClick:()=>B(F),children:l.jsxs("span",{className:"cny-dt-th-inner",children:[F.headerName??F.field,l.jsx("span",{className:"cny-dt-sort-icon","aria-hidden":"true",children:G?f.sort==="desc"?l.jsx(Gr,{size:14}):l.jsx(xp,{size:14}):l.jsx(bp,{size:14})})]})}):l.jsx("span",{className:"cny-dt-th-inner",children:F.headerName??F.field}),V(F)&&l.jsx("span",{className:"cny-dt-resizer","aria-hidden":"true",onClick:ie=>ie.stopPropagation(),onPointerDown:ie=>$(F.field,ie)})]},F.field)})]})}),l.jsx("tbody",{children:o?Array.from({length:(i==null?void 0:i.pageSize)??Math.max(n.length,5)}).map((F,G)=>l.jsxs("tr",{className:"cny-dt-row",children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",children:l.jsx(ia,{shape:"avatar",width:16,height:16})}),e.map(le=>l.jsx("td",{className:le.align&&Mi[le.align],children:l.jsx(ia,{width:"70%"})},le.field))]},`sk-${G}`)):n.length===0?l.jsx("tr",{children:l.jsx("td",{className:"cny-dt-empty",colSpan:T,children:g})}):n.map(F=>{const G=r(F),le=W.has(G);return l.jsxs("tr",{className:z("cny-dt-row",le&&"is-selected",m&&"is-clickable",C==null?void 0:C(F)),onClick:()=>m==null?void 0:m(F),tabIndex:m?0:void 0,onKeyDown:m?ie=>{ie.target===ie.currentTarget&&(ie.key==="Enter"||ie.key===" ")&&(ie.preventDefault(),m(F))}:void 0,children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",onClick:ie=>ie.stopPropagation(),children:l.jsx(Ca,{checked:le,onCheckedChange:()=>j(G),"aria-label":`Select row ${String(G)}`})}),e.map(ie=>{const _e=ie.valueGetter?ie.valueGetter({row:F,field:ie.field}):F[ie.field];return l.jsx("td",{className:ie.align&&Mi[ie.align],children:ie.renderCell?ie.renderCell({row:F,value:_e,field:ie.field}):_e},ie.field)})]},String(G))})})]})}),K()]})}),Ea=["var(--color-primary)","var(--color-success)","var(--color-warning)","var(--color-danger)","var(--color-info)","var(--color-neutral)"];function Rn(t,e){return e??Ea[t%Ea.length]}function rl(t=600){const e=S.useRef(null),[n,r]=S.useState(t);return S.useLayoutEffect(()=>{const o=e.current;if(!o||typeof ResizeObserver>"u")return;const s=new ResizeObserver(i=>{var c;const a=Math.round(((c=i[0])==null?void 0:c.contentRect.width)??0);a>0&&r(u=>u===a?u:a)});return s.observe(o),()=>s.disconnect()},[]),[e,n]}function Jg(t,e=4){if(t<=0)return{max:1,ticks:[0,1]};const n=t/e,r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r,s=(o<=1?1:o<=2?2:o<=5?5:10)*r,i=Math.ceil(t/s)*s,a=[];for(let c=0;c<=i+1e-9;c+=s)a.push(Number(c.toFixed(6)));return{max:i,ticks:a}}function AI(t,e,n,r,o,s){const i=(v,x)=>[t+v*Math.sin(x),e-v*Math.cos(x)],a=s-o>Math.PI?1:0,[c,u]=i(n,o),[d,f]=i(n,s);if(r<=0)return`M ${t} ${e} L ${c} ${u} A ${n} ${n} 0 ${a} 1 ${d} ${f} Z`;const[h,m]=i(r,s),[g,y]=i(r,o);return[`M ${c} ${u}`,`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,`L ${h} ${m}`,`A ${r} ${r} 0 ${a} 0 ${g} ${y}`,"Z"].join(" ")}function ol({caption:t,head:e,rows:n}){return l.jsxs("table",{className:"cny-sr-only",children:[l.jsx("caption",{children:t}),l.jsx("thead",{children:l.jsx("tr",{children:e.map((r,o)=>l.jsx("th",{scope:"col",children:r},o))})}),l.jsx("tbody",{children:n.map((r,o)=>l.jsx("tr",{children:r.map((s,i)=>l.jsx("td",{children:s},i))},o))})]})}const Oe={top:12,right:14,bottom:28,left:40};function DI({data:t,xKey:e,series:n,height:r=260,label:o="Bar chart",stacked:s=!1,grid:i=!0,legend:a=!0,yTickFormatter:c=g=>String(g),xTickFormatter:u=g=>g,renderTooltip:d,className:f,style:h,sx:m}){const[g,y]=rl(),[v,x]=S.useState(null),w=Math.max(0,y-Oe.left-Oe.right),b=Math.max(0,r-Oe.top-Oe.bottom),C=(I,L)=>Number(I[L]??0),P=t.length?Math.max(0,...t.map(I=>s?n.reduce((L,O)=>L+C(I,O.key),0):Math.max(...n.map(L=>C(I,L.key))))):0,{max:R,ticks:M}=Jg(P),A=I=>Oe.top+b*(1-I/R),T=t.length,E=T?w/T:0,N=E*.68,_=I=>Oe.left+I*E+(E-N)/2,$=s?N:N/Math.max(1,n.length),{className:V,style:q,styleTag:W}=oe(m,{position:"relative",...h},"cny-chart",f);return l.jsxs("div",{ref:g,className:V,style:q,children:[W,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${y} ${r}`,role:"img","aria-label":o,children:[i&&M.map(I=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:Oe.left,x2:y-Oe.right,y1:A(I),y2:A(I)}),l.jsx("text",{className:"cny-chart-axis",x:Oe.left-6,y:A(I),dy:"0.32em",textAnchor:"end",children:c(I)})]},I)),t.map((I,L)=>{let O=0;return l.jsx("g",{children:n.map((D,Y)=>{const j=C(I,D.key),B=j/R*b;let Z,H;return s?(Z=_(L),H=A(O+j),O+=j):(Z=_(L)+Y*$,H=A(j)),l.jsx("rect",{className:"cny-chart-bar",x:Z,y:H,width:Math.max(0,$-(s?0:2)),height:Math.max(0,B),rx:2,fill:Rn(Y,D.color)},D.key)})},L)}),t.map((I,L)=>{const O=u(String(I[e]??"")),D=`${O}: ${n.map(Y=>`${Y.label??Y.key} ${C(I,Y.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:Oe.left+L*E+E/2,y:r-Oe.bottom+16,textAnchor:"middle",children:O}),l.jsx("rect",{className:"cny-chart-hit",x:Oe.left+L*E,y:Oe.top,width:E,height:b,fill:"transparent",tabIndex:0,"aria-label":D,onMouseEnter:()=>x({index:L,x:Oe.left+L*E+E/2,y:Oe.top}),onMouseLeave:()=>x(null),onFocus:()=>x({index:L,x:Oe.left+L*E+E/2,y:Oe.top}),onBlur:()=>x(null)})]},`x-${L}`)})]}),l.jsx(ol,{caption:o,head:[String(e),...n.map(I=>I.label??I.key)],rows:t.map(I=>[u(String(I[e]??"")),...n.map(L=>C(I,L.key))])}),v&&t[v.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${v.x/y*100}%`,top:v.y},children:d?d({label:String(t[v.index][e]),datum:t[v.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(t[v.index][e])}),n.map((I,L)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Rn(L,I.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:I.label??I.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:C(t[v.index],I.key)})]},I.key))]})}),a&&l.jsx("div",{className:"cny-chart-legend",children:n.map((I,L)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Rn(L,I.color)}}),I.label??I.key]},I.key))})]})}const rt={top:12,right:14,bottom:28,left:40};function ey({data:t,xKey:e,series:n,height:r=260,label:o="Line chart",area:s=!1,stacked:i=!1,dots:a=!0,grid:c=!0,legend:u=!0,yTickFormatter:d=v=>String(v),xTickFormatter:f=v=>v,renderTooltip:h,className:m,style:g,sx:y}){const[v,x]=rl(),[w,b]=S.useState(null),C=Math.max(0,x-rt.left-rt.right),P=Math.max(0,r-rt.top-rt.bottom),R=(O,D)=>Number(O[D]??0),M=t.length?Math.max(0,...t.map(O=>i?n.reduce((D,Y)=>D+R(O,Y.key),0):Math.max(...n.map(D=>R(O,D.key))))):0,{max:A,ticks:T}=Jg(M),E=O=>rt.top+P*(1-O/A),N=t.length,_=N?C/N:0,$=O=>rt.left+O*_+_/2,V=E(0),q=t.map(()=>0),{className:W,style:I,styleTag:L}=oe(y,{position:"relative",...g},"cny-chart",m);return l.jsxs("div",{ref:v,className:W,style:I,children:[L,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${x} ${r}`,role:"img","aria-label":o,children:[c&&T.map(O=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:rt.left,x2:x-rt.right,y1:E(O),y2:E(O)}),l.jsx("text",{className:"cny-chart-axis",x:rt.left-6,y:E(O),dy:"0.32em",textAnchor:"end",children:d(O)})]},O)),n.map((O,D)=>{const Y=Rn(D,O.color),j=t.map((H,se)=>{const ce=R(H,O.key),J=i?q[se]:0,K=J+ce;return i&&(q[se]=K),{x:$(se),y:E(K),yBase:E(J)}});if(j.length===0)return null;const B=j.map(H=>`${H.x},${H.y}`).join(" "),Z=`M ${j[0].x} ${i?j[0].yBase:V} `+j.map(H=>`L ${H.x} ${H.y}`).join(" ")+` L ${j[j.length-1].x} ${i?j[j.length-1].yBase:V} Z`;return l.jsxs("g",{children:[s&&l.jsx("path",{className:"cny-chart-area",d:Z,fill:Y}),l.jsx("polyline",{className:"cny-chart-line",points:B,fill:"none",stroke:Y}),a&&j.map((H,se)=>l.jsx("circle",{className:"cny-chart-dot",cx:H.x,cy:H.y,r:3,fill:Y},se))]},O.key)}),t.map((O,D)=>{const Y=f(String(O[e]??"")),j=`${Y}: ${n.map(B=>`${B.label??B.key} ${R(O,B.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:$(D),y:r-rt.bottom+16,textAnchor:"middle",children:Y}),l.jsx("rect",{className:"cny-chart-hit",x:rt.left+D*_,y:rt.top,width:_,height:P,fill:"transparent",tabIndex:0,"aria-label":j,onMouseEnter:()=>b({index:D,x:$(D)}),onMouseLeave:()=>b(null),onFocus:()=>b({index:D,x:$(D)}),onBlur:()=>b(null)})]},`x-${D}`)})]}),l.jsx(ol,{caption:o,head:[String(e),...n.map(O=>O.label??O.key)],rows:t.map(O=>[f(String(O[e]??"")),...n.map(D=>R(O,D.key))])}),w&&t[w.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${w.x/x*100}%`,top:rt.top},children:h?h({label:String(t[w.index][e]),datum:t[w.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(t[w.index][e])}),n.map((O,D)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Rn(D,O.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:O.label??O.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:R(t[w.index],O.key)})]},O.key))]})}),u&&l.jsx("div",{className:"cny-chart-legend",children:n.map((O,D)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Rn(D,O.color)}}),O.label??O.key]},O.key))})]})}function II(t){return l.jsx(ey,{...t,area:!1})}function kI(t){return l.jsx(ey,{...t,area:!0})}function NI({data:t,height:e=260,label:n="Pie chart",innerRadius:r=0,legend:o=!0,renderTooltip:s,centerLabel:i,className:a,style:c,sx:u}){const[d,f]=rl(360),[h,m]=S.useState(null),g=t.reduce((T,E)=>T+Math.max(0,E.value),0),y=Math.min(f,e),v=f/2,x=e/2,w=y/2*.86,b=r>0?w*r:0;let C=0;const P=t.map((T,E)=>{const N=g>0?Math.max(0,T.value)/g:0,_=C,$=C+N*Math.PI*2;return C=$,{d:T,i:E,start:_,end:$,frac:N,color:Rn(E,T.color)}}),{className:R,style:M,styleTag:A}=oe(u,{position:"relative",...c},"cny-chart",a);return l.jsxs("div",{ref:d,className:R,style:M,children:[A,l.jsxs("svg",{width:"100%",height:e,viewBox:`0 0 ${f} ${e}`,role:"img","aria-label":n,children:[P.map(T=>T.frac>=.9999?l.jsx("circle",{className:z("cny-chart-slice",h===T.i&&"is-active"),cx:v,cy:x,r:b>0?(w+b)/2:w,fill:b>0?"none":T.color,stroke:b>0?T.color:void 0,strokeWidth:b>0?w-b:void 0,tabIndex:0,"aria-label":`${T.d.label}: ${T.d.value} (${Math.round(T.frac*100)}%)`,onMouseEnter:()=>m(T.i),onMouseLeave:()=>m(null),onFocus:()=>m(T.i),onBlur:()=>m(null)},T.i):l.jsx("path",{className:z("cny-chart-slice",h===T.i&&"is-active"),d:AI(v,x,w,b,T.start,T.end),fill:T.color,tabIndex:0,"aria-label":`${T.d.label}: ${T.d.value} (${Math.round(T.frac*100)}%)`,onMouseEnter:()=>m(T.i),onMouseLeave:()=>m(null),onFocus:()=>m(T.i),onBlur:()=>m(null)},T.i)),i!=null&&b>0&&l.jsx("foreignObject",{x:v-b,y:x-b,width:b*2,height:b*2,children:l.jsx("div",{className:"cny-chart-center",children:i})})]}),l.jsx(ol,{caption:n,head:["Slice","Value","Share"],rows:P.map(T=>[T.d.label,T.d.value,`${Math.round(T.frac*100)}%`])}),h!=null&&P[h]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:"50%",top:8,transform:"translateX(-50%)"},children:s?s({datum:P[h].d,percent:P[h].frac}):l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:P[h].color}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:P[h].d.label}),l.jsxs("span",{className:"cny-chart-tooltip-value",children:[P[h].d.value," (",Math.round(P[h].frac*100),"%)"]})]})}),o&&l.jsx("div",{className:"cny-chart-legend",children:P.map(T=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:T.color}}),T.d.label]},T.i))})]})}function _I({height:t=300,children:e,className:n,style:r,sx:o}){const s=S.Children.only(e),{className:i,style:a,styleTag:c}=oe(o,{width:"100%",height:t,...r},"cny-chart-responsive",n);return l.jsxs("div",{className:i,style:a,children:[c,S.isValidElement(s)?S.cloneElement(s,{height:t}):s]})}const OI=S.forwardRef(function({variant:e="dividers",size:n="md",dense:r,className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=oe(i,s,"cny-list",e,`size-${n}`,r&&"is-dense",o);return l.jsxs("ul",{ref:u,className:d,style:f,...c,children:[h,a]})}),$I=S.forwardRef(function({leading:e,trailing:n,primary:r,secondary:o,onClick:s,href:i,disabled:a,active:c,as:u,children:d,className:f,...h},m){const g=u??(i?"a":s?"button":"li"),y=!a&&(i!=null||s!=null),v=d??l.jsxs(l.Fragment,{children:[e&&l.jsx("span",{className:"cny-list-item-leading",children:e}),l.jsxs("span",{className:"cny-list-item-body",children:[r!=null&&l.jsx("span",{className:"cny-list-item-primary",children:r}),o!=null&&l.jsx("span",{className:"cny-list-item-secondary",children:o})]}),n&&l.jsx("span",{className:"cny-list-item-trailing",children:n})]}),x=l.jsx(g,{ref:m,href:i,onClick:a?void 0:s,"aria-disabled":a||void 0,"aria-current":c?"page":void 0,tabIndex:y&&g==="div"?0:void 0,className:z("cny-list-item",c&&"is-active",a&&"is-disabled",y&&"is-interactive",f),...h,children:v});return g==="li"?x:l.jsx("li",{className:"cny-list-item-wrap",children:x})}),LI=S.forwardRef(function({className:e,...n},r){return l.jsx("li",{ref:r,role:"separator",className:z("cny-list-separator",e),...n})}),FI=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("li",{ref:o,className:z("cny-list-subheader",e),...r,children:n})});var VI=Object.defineProperty,hr=(t,e)=>VI(t,"name",{value:e,configurable:!0}),sl="Tabs",[BI,CN]=Pe(sl,[ln]),ty=ln(),[GI,il]=BI(sl),zI=p.forwardRef(hr(function(e,n){const{__scopeTabs:r,value:o,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:c,activationMode:u="automatic",...d}=e,f=Ht(c),[h,m]=Se({prop:o,onChange:s,defaultProp:i??"",caller:sl});return l.jsx(GI,{scope:r,baseId:Fe(),value:h,onValueChange:m,orientation:a,dir:f,activationMode:u,children:l.jsx(ne.div,{dir:f,"data-orientation":a,...d,ref:n})})},"Tabs")),UI="TabsList",HI=p.forwardRef(hr(function(e,n){const{__scopeTabs:r,loop:o=!0,...s}=e,i=il(UI,r),a=ty(r);return l.jsx(us,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:o,children:l.jsx(ne.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:n})})},"TabsList")),WI="TabsTrigger",KI=p.forwardRef(hr(function(e,n){const{__scopeTabs:r,value:o,disabled:s=!1,...i}=e,a=il(WI,r),c=ty(r),u=al(a.baseId,o),d=cl(a.baseId,o),f=o===a.value;return l.jsx(ds,{asChild:!0,...c,focusable:!s,active:f,children:l.jsx(ne.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...i,ref:n,onMouseDown:U(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?a.onValueChange(o):h.preventDefault()}),onKeyDown:U(e.onKeyDown,h=>{s||h.target!==h.currentTarget||[" ","Enter"].includes(h.key)&&a.onValueChange(o)}),onFocus:U(e.onFocus,()=>{const h=a.activationMode!=="manual";!f&&!s&&h&&a.onValueChange(o)})})})},"TabsTrigger")),YI="TabsContent",XI=p.forwardRef(hr(function(e,n){const{__scopeTabs:r,value:o,forceMount:s,children:i,...a}=e,c=il(YI,r),u=al(c.baseId,o),d=cl(c.baseId,o),f=o===c.value,h=p.useRef(f);return p.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(ze,{present:s||f,children:({present:m})=>l.jsx(ne.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:d,tabIndex:0,...a,ref:n,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&i})})},"TabsContent"));function al(t,e){return`${t}-trigger-${e}`}hr(al,"makeTriggerId");function cl(t,e){return`${t}-content-${e}`}hr(cl,"makeContentId");var qI=zI,ZI=HI,QI=KI,JI=XI;const ek=S.forwardRef(function({variant:e="line",size:n="md",className:r,style:o,sx:s,children:i,...a},c){const{className:u,style:d,styleTag:f}=oe(s,o,"cny-tabs",`variant-${e}`,`size-${n}`,r);return l.jsxs(qI,{ref:c,className:u,style:d,...a,children:[f,i]})}),tk=S.forwardRef(function({className:e,...n},r){return l.jsx(ZI,{ref:r,className:z("cny-tabs-list",e),...n})}),nk=S.forwardRef(function({icon:e,badge:n,className:r,children:o,...s},i){return l.jsxs(QI,{ref:i,className:z("cny-tabs-trigger",r),...s,children:[e&&l.jsx("span",{className:"cny-tabs-trigger-icon",children:e}),l.jsx("span",{className:"cny-tabs-trigger-label",children:o}),n&&l.jsx("span",{className:"cny-tabs-trigger-badge",children:n})]})}),rk=S.forwardRef(function({className:e,...n},r){return l.jsx(JI,{ref:r,className:z("cny-tabs-content",e),...n})});function ok(t){return t.multiple===!0}const sk=S.forwardRef(function(e,n){const{options:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No results.",loading:a=!1,loadingText:c="Loading…",size:u,color:d="primary",disabled:f=!1,clearable:h=!0,id:m,"aria-invalid":g,"aria-describedby":y,"aria-label":v,className:x,style:w,sx:b,open:C,defaultOpen:P=!1,onOpenChange:R}=e,M=S.useId(),A=m??`cny-ac-${M}`,T=C!==void 0,[E,N]=S.useState(P),_=T?C:E,$=S.useCallback(X=>{T||N(X),R==null||R(X)},[T,R]),[V,q]=S.useState(""),W=S.useRef(null),I=ok(e),[L,O]=S.useState(!I&&e.defaultValue!==void 0?e.defaultValue??null:null),[D,Y]=S.useState(I&&e.defaultValue!==void 0?e.defaultValue??[]:[]),j=I?e.value!==void 0?e.value:D:(()=>{const X=e.value!==void 0?e.value:L;return X==null?[]:[X]})(),B=S.useCallback(X=>{var F,G;if(I)e.value===void 0&&Y(X),(F=e.onValueChange)==null||F.call(e,X);else{const le=X[0]??null;e.value===void 0&&O(le),(G=e.onValueChange)==null||G.call(e,le)}},[I,e]),Z=S.useCallback(X=>{if(!X.disabled)if(I){const F=e.maxItems,G=j.includes(X.value);let le;if(G)le=j.filter(ie=>ie!==X.value);else{if(F!=null&&j.length>=F)return;le=[...j,X.value]}B(le)}else B([X.value]),$(!1)},[B,I,j,e,$]),H=S.useCallback(X=>{var F;X.stopPropagation(),B([]),(F=W.current)==null||F.focus()},[B]),se=S.useMemo(()=>{const X=new Map;for(const F of r){const G=F.group??"";X.has(G)||X.set(G,[]),X.get(G).push(F)}return Array.from(X.entries())},[r]),ce=X=>{var F;return((F=r.find(G=>G.value===X))==null?void 0:F.label)??X},J=j.length===0?o:I?j.length===1?ce(j[0]):`${ce(j[0])} +${j.length-1}`:ce(j[0]),{className:K,style:ee,styleTag:ue}=oe(b,w,"cny-ac-trigger","input",d!=="primary"&&d,u==="sm"||u==="lg"?u:null,j.length>0&&"has-value",_&&"is-open",x);return l.jsxs(Ss,{open:_,onOpenChange:$,children:[l.jsx(Dc,{asChild:!0,children:l.jsxs("button",{ref:X=>{W.current=X,typeof n=="function"?n(X):n&&(n.current=X)},type:"button",id:A,className:K,style:ee,disabled:f,"aria-label":v,"aria-invalid":g,"aria-describedby":y,"aria-haspopup":"listbox","aria-expanded":_,children:[ue,l.jsx("span",{className:z("cny-ac-value",j.length===0&&"is-placeholder"),children:J}),h&&j.length>0&&!f&&l.jsx("span",{role:"button",tabIndex:0,className:"cny-ac-clear","aria-label":"Clear",onClick:H,onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),H(X))},onPointerDown:X=>X.stopPropagation(),children:l.jsx(Wt,{size:13,"aria-hidden":"true"})}),l.jsx(bp,{size:14,className:"cny-ac-chevron","aria-hidden":"true"})]})}),l.jsx(Ic,{children:l.jsx(Ps,{className:"cny-ac-content",align:"start",sideOffset:4,style:{width:"var(--radix-popover-trigger-width)"},children:l.jsxs(Ae,{className:"cny-ac-cmdk",shouldFilter:!a,children:[l.jsx("div",{className:"cny-ac-search",children:l.jsx(Ae.Input,{value:V,onValueChange:q,placeholder:s})}),l.jsx(Ae.List,{className:"cny-ac-list",children:a?l.jsxs("div",{className:"cny-ac-loading",children:[l.jsx(Rp,{size:14,className:"cny-ac-loading-spinner","aria-hidden":"true"}),l.jsx("span",{children:c})]}):l.jsxs(l.Fragment,{children:[l.jsx(Ae.Empty,{className:"cny-ac-empty",children:i},"empty"),se.map(([X,F],G)=>{const le=F.map((ie,_e)=>{const ge=j.includes(ie.value);return l.jsxs(Ae.Item,{value:`${X} ${ie.label} ${ie.value}`,disabled:ie.disabled,onSelect:()=>Z(ie),className:z("cny-ac-item",ge&&"is-checked"),children:[I?l.jsx("span",{className:z("cny-ac-checkbox",ge&&"is-checked"),children:ge&&l.jsx(nn,{size:12,"aria-hidden":"true"})}):l.jsxs("span",{className:"cny-ac-icon",children:[ie.icon??null,!ie.icon&&ge&&l.jsx(nn,{size:14,"aria-hidden":"true"})]}),l.jsx("span",{className:"cny-ac-item-label",children:ie.label}),ie.hint&&l.jsx("span",{className:"cny-ac-item-hint",children:ie.hint})]},ie.value||`opt-${G}-${_e}`)});return X===""?l.jsx(Ae.Group,{children:le},`__ungrouped_${G}`):l.jsx(Ae.Group,{heading:X,children:le},X||`group_${G}`)})]})})]})})})]})}),ik=S.forwardRef(function({items:e,separator:n,size:r="md",className:o,style:s,sx:i,...a},c){const u=n??l.jsx(Qt,{size:12,"aria-hidden":"true"}),{className:d,style:f,styleTag:h}=oe(i,s,"cny-breadcrumb",`cny-breadcrumb-${r}`,o);return l.jsxs("nav",{ref:c,"aria-label":"Breadcrumb",className:d,style:f,...a,children:[h,l.jsx("ol",{className:"cny-breadcrumb-list",children:e.map((m,g)=>{const y=g===e.length-1,v=l.jsx("span",{className:z("cny-breadcrumb-label",y&&"is-current"),children:m.label}),x=m.render?m.render(v):m.href&&!y?l.jsx("a",{href:m.href,className:"cny-breadcrumb-link",children:v}):v;return l.jsxs("li",{className:"cny-breadcrumb-item",children:[y?l.jsx("span",{"aria-current":"page",children:v}):x,!y&&l.jsx("span",{className:"cny-breadcrumb-sep","aria-hidden":"true",children:u})]},g)})})]})});var ak=Object.defineProperty,eo=(t,e)=>ak(t,"name",{value:e,configurable:!0}),ll="Collapsible",[ck,ny]=Pe(ll),[lk,ul]=ck(ll),uk=p.forwardRef(eo(function(e,n){const{__scopeCollapsible:r,open:o,defaultOpen:s,disabled:i,onOpenChange:a,...c}=e,[u,d]=Se({prop:o,defaultProp:s??!1,onChange:a,caller:ll});return l.jsx(lk,{scope:r,disabled:i,contentId:Fe(),open:u,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),children:l.jsx(ne.div,{"data-state":_s(u),"data-disabled":i?"":void 0,...c,ref:n})})},"Collapsible")),dk="CollapsibleTrigger",fk=p.forwardRef(eo(function(e,n){const{__scopeCollapsible:r,...o}=e,s=ul(dk,r);return l.jsx(ne.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":_s(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...o,ref:n,onClick:U(e.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),ry="CollapsibleContent",hk=p.forwardRef(eo(function(e,n){const{forceMount:r,...o}=e,s=ul(ry,e.__scopeCollapsible);return l.jsx(ze,{present:r||s.open,children:({present:i})=>l.jsx(pk,{...o,ref:n,present:i})})},"CollapsibleContent")),pk=p.forwardRef(eo(function(e,n){const{__scopeCollapsible:r,present:o,children:s,...i}=e,a=ul(ry,r),[c,u]=p.useState(o),d=p.useRef(null),f=ae(n,d),h=p.useRef(0),m=h.current,g=p.useRef(0),y=g.current,v=a.open||c,x=p.useRef(v),w=p.useRef(void 0);return p.useEffect(()=>{const b=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(b)},[]),Ee(()=>{const b=d.current;if(b){w.current=w.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const C=b.getBoundingClientRect();h.current=C.height,g.current=C.width,x.current||(b.style.transitionDuration=w.current.transitionDuration,b.style.animationName=w.current.animationName),u(o)}},[a.open,o]),l.jsx(ne.div,{"data-state":_s(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...i,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:v&&s})},"CollapsibleContentImpl"));function _s(t){return t?"open":"closed"}eo(_s,"getState");var mk=uk,gk=fk,yk=hk,vk=Object.defineProperty,at=(t,e)=>vk(t,"name",{value:e,configurable:!0}),_t="Accordion",xk=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[dl,bk,wk]=ar(_t),[Os,SN]=Pe(_t,[wk,ny]),fl=ny(),Ck=p.forwardRef(at(function(e,n){const{type:r,...o}=e,s=o,i=o;return l.jsx(dl.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?l.jsx(Tk,{...i,ref:n}):l.jsx(Rk,{...s,ref:n})})},"Accordion")),[oy,Sk]=Os(_t),[sy,Pk]=Os(_t,{collapsible:!1}),Rk=p.forwardRef(at(function(e,n){const{value:r,defaultValue:o,onValueChange:s=at(()=>{},"onValueChange"),collapsible:i=!1,...a}=e,[c,u]=Se({prop:r,defaultProp:o??"",onChange:s,caller:_t});return l.jsx(oy,{scope:e.__scopeAccordion,value:p.useMemo(()=>c?[c]:[],[c]),onItemOpen:u,onItemClose:p.useCallback(()=>i&&u(""),[i,u]),children:l.jsx(sy,{scope:e.__scopeAccordion,collapsible:i,children:l.jsx(iy,{...a,ref:n})})})},"AccordionImplSingle")),Tk=p.forwardRef(at(function(e,n){const{value:r,defaultValue:o,onValueChange:s=at(()=>{},"onValueChange"),...i}=e,[a,c]=Se({prop:r,defaultProp:o??[],onChange:s,caller:_t}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return l.jsx(oy,{scope:e.__scopeAccordion,value:a,onItemOpen:u,onItemClose:d,children:l.jsx(sy,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(iy,{...i,ref:n})})})},"AccordionImplMultiple")),[Mk,$s]=Os(_t),iy=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,disabled:o,dir:s,orientation:i="vertical",...a}=e,c=p.useRef(null),u=ae(c,n),d=bk(r),h=Ht(s)==="ltr",m=U(e.onKeyDown,g=>{var T;if(!xk.includes(g.key))return;const y=g.target,v=d().filter(E=>{var N;return!((N=E.ref.current)!=null&&N.disabled)}),x=v.findIndex(E=>E.ref.current===y),w=v.length;if(x===-1)return;g.preventDefault();let b=x;const C=0,P=w-1,R=at(()=>{b=x+1,b>P&&(b=C)},"moveNext"),M=at(()=>{b=x-1,b<C&&(b=P)},"movePrev");switch(g.key){case"Home":b=C;break;case"End":b=P;break;case"ArrowRight":i==="horizontal"&&(h?R():M());break;case"ArrowDown":i==="vertical"&&R();break;case"ArrowLeft":i==="horizontal"&&(h?M():R());break;case"ArrowUp":i==="vertical"&&M();break}const A=b%w;(T=v[A].ref.current)==null||T.focus()});return l.jsx(Mk,{scope:r,disabled:o,direction:s,orientation:i,children:l.jsx(dl.Slot,{scope:r,children:l.jsx(ne.div,{...a,"data-orientation":i,ref:u,onKeyDown:o?void 0:m})})})},"AccordionImpl")),ja="AccordionItem",[Ek,hl]=Os(ja),jk=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,value:o,...s}=e,i=$s(ja,r),a=Sk(ja,r),c=fl(r),u=Fe(),d=o&&a.value.includes(o)||!1,f=i.disabled||e.disabled;return l.jsx(Ek,{scope:r,open:d,disabled:f,triggerId:u,children:l.jsx(mk,{"data-orientation":i.orientation,"data-state":pl(d),...c,...s,ref:n,disabled:f,open:d,onOpenChange:h=>{h?a.onItemOpen(o):a.onItemClose(o)}})})},"AccordionItem")),Ak="AccordionHeader",Dk=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,...o}=e,s=$s(_t,r),i=hl(Ak,r);return l.jsx(ne.h3,{"data-orientation":s.orientation,"data-state":pl(i.open),"data-disabled":i.disabled?"":void 0,...o,ref:n})},"AccordionHeader")),Gd="AccordionTrigger",Ik=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,...o}=e,s=$s(_t,r),i=hl(Gd,r),a=Pk(Gd,r),c=fl(r);return l.jsx(dl.ItemSlot,{scope:r,children:l.jsx(gk,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...c,...o,ref:n})})},"AccordionTrigger")),kk="AccordionContent",Nk=p.forwardRef(at(function(e,n){const{__scopeAccordion:r,...o}=e,s=$s(_t,r),i=hl(kk,r),a=fl(r);return l.jsx(yk,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...o,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function pl(t){return t?"open":"closed"}at(pl,"getState");var _k=Ck,Ok=jk,$k=Dk,Lk=Ik,Fk=Nk;const Vk=S.forwardRef(function({variant:e="plain",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=oe(o,r,"cny-accordion",`cny-accordion-${e}`,n);return l.jsxs(_k,{ref:a,className:c,style:u,...i,children:[d,s]})}),Bk=S.forwardRef(function({className:e,...n},r){return l.jsx(Ok,{ref:r,className:z("cny-accordion-item",e),...n})}),Gk=S.forwardRef(function({children:e,className:n,icon:r,hideIndicator:o,...s},i){return l.jsx($k,{className:"cny-accordion-header",children:l.jsxs(Lk,{ref:i,className:z("cny-accordion-trigger",n),...s,children:[r&&l.jsx("span",{className:"cny-accordion-trigger-icon",children:r}),l.jsx("span",{className:"cny-accordion-trigger-label",children:e}),!o&&l.jsx(Gr,{size:14,"aria-hidden":"true",className:"cny-accordion-trigger-chevron"})]})})}),zk=S.forwardRef(function({children:e,className:n,...r},o){return l.jsx(Fk,{ref:o,className:z("cny-accordion-content",n),...r,children:l.jsx("div",{className:"cny-accordion-content-inner",children:e})})});var Uk=Object.defineProperty,he=(t,e)=>Uk(t,"name",{value:e,configurable:!0}),ay=["PageUp","PageDown"],cy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ly={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},to="Slider",[Aa,Hk,Wk]=ar(to),[ml,PN]=Pe(to,[Wk]),[Kk,no]=ml(to),Yk=p.forwardRef(he(function(e,n){const{name:r,min:o=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[o],value:f,onValueChange:h=he(()=>{},"onValueChange"),onValueCommit:m=he(()=>{},"onValueCommit"),inverted:g=!1,form:y,...v}=e,x=p.useRef(new Set),w=p.useRef(0),b=p.useRef(!1),P=a==="horizontal"?Xk:qk,[R,M]=p.useState(null),A=ae(n,M),[T=[],E]=Se({prop:f,defaultProp:d,onChange:he(I=>{var O;(O=[...x.current][w.current])==null||O.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,h(I)},"onChange")}),N=p.useRef(T),_=p.useRef(T);p.useEffect(()=>{const I=y?R==null?void 0:R.ownerDocument.getElementById(y):R==null?void 0:R.closest("form");if(I instanceof HTMLFormElement){const L=he(()=>E(_.current),"reset");return I.addEventListener("reset",L),()=>I.removeEventListener("reset",L)}},[R,y,E]);function $(I){const L=yy(T,I);W(I,L)}he($,"handleSlideStart");function V(I){W(I,w.current)}he(V,"handleSlideMove");function q(){String(T)!==String(N.current)&&m(T)}he(q,"handleSlideEnd");function W(I,L,{commit:O}={commit:!1}){const D=yl(i),Y=Sr(Math.round((I-o)/i)*i+o,D),j=jr(Y,[o,s]);E((B=[])=>{const Z=my(B,j,L);if(by(Z,u*i)){w.current=Z.indexOf(j);const H=String(Z)!==String(B);return H&&O&&m(Z),H?Z:B}else return B})}return he(W,"updateValues"),l.jsx(Kk,{scope:e.__scopeSlider,name:r,disabled:c,min:o,max:s,valueIndexToChangeRef:w,thumbs:x.current,values:T,orientation:a,form:y,children:l.jsx(Aa.Provider,{scope:e.__scopeSlider,children:l.jsx(Aa.Slot,{scope:e.__scopeSlider,children:l.jsx(P,{"aria-disabled":c,"data-disabled":c?"":void 0,...v,ref:A,onPointerDown:U(v.onPointerDown,()=>{c||(N.current=T,b.current=!1)}),min:o,max:s,inverted:g,onSlideStart:c?void 0:$,onSlideMove:c?void 0:V,onSlideEnd:c?void 0:q,onHomeKeyDown:()=>{c||(b.current=!0,W(o,0,{commit:!0}))},onEndKeyDown:()=>{c||(b.current=!0,W(s,T.length-1,{commit:!0}))},onStepKeyDown:({event:I,direction:L})=>{if(!c){b.current=!0;const Y=ay.includes(I.key)||I.shiftKey&&cy.includes(I.key)?10:1,j=w.current,B=T[j],Z=wy(B,{min:o,step:i,direction:L,multiplier:Y});W(Z,j,{commit:!0})}}})})})})},"Slider")),[uy,dy]=ml(to,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Xk=p.forwardRef(he(function(e,n){const{min:r,max:o,dir:s,inverted:i,onSlideStart:a,onSlideMove:c,onSlideEnd:u,onStepKeyDown:d,...f}=e,[h,m]=p.useState(null),g=ae(n,m),y=p.useRef(void 0),v=Ht(s),x=v==="ltr",w=x&&!i||!x&&i;function b(C){const P=y.current||h.getBoundingClientRect(),R=[0,P.width],A=Ls(R,w?[r,o]:[o,r]);return y.current=P,A(C-P.left)}return he(b,"getValueFromPointer"),l.jsx(uy,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:l.jsx(fy,{dir:v,"data-orientation":"horizontal",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const P=b(C.clientX);a==null||a(P)},onSlideMove:C=>{const P=b(C.clientX);c==null||c(P)},onSlideEnd:()=>{y.current=void 0,u==null||u()},onStepKeyDown:C=>{const R=ly[w?"from-left":"from-right"].includes(C.key);d==null||d({event:C,direction:R?-1:1})}})})},"SliderHorizontal")),qk=p.forwardRef(he(function(e,n){const{min:r,max:o,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:c,onStepKeyDown:u,...d}=e,f=p.useRef(null),h=ae(n,f),m=p.useRef(void 0),g=!s;function y(v){const x=m.current||f.current.getBoundingClientRect(),w=[0,x.height],C=Ls(w,g?[o,r]:[r,o]);return m.current=x,C(v-x.top)}return he(y,"getValueFromPointer"),l.jsx(uy,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:l.jsx(fy,{"data-orientation":"vertical",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const x=y(v.clientY);i==null||i(x)},onSlideMove:v=>{const x=y(v.clientY);a==null||a(x)},onSlideEnd:()=>{m.current=void 0,c==null||c()},onStepKeyDown:v=>{const w=ly[g?"from-bottom":"from-top"].includes(v.key);u==null||u({event:v,direction:w?-1:1})}})})},"SliderVertical")),fy=p.forwardRef(he(function(e,n){const{__scopeSlider:r,onSlideStart:o,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:c,onStepKeyDown:u,...d}=e,f=no(to,r);return l.jsx(ne.span,{...d,ref:n,onKeyDown:U(e.onKeyDown,h=>{h.key==="Home"?(a(h),h.preventDefault()):h.key==="End"?(c(h),h.preventDefault()):ay.concat(cy).includes(h.key)&&(u(h),h.preventDefault())}),onPointerDown:U(e.onPointerDown,h=>{const m=h.target;m.setPointerCapture(h.pointerId),h.preventDefault(),f.thumbs.has(m)?m.focus({preventScroll:!0,focusVisible:!1}):o(h)}),onPointerMove:U(e.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&s(h)}),onPointerUp:U(e.onPointerUp,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&(m.releasePointerCapture(h.pointerId),i(h))})})},"SliderImpl")),Zk="SliderTrack",Qk=p.forwardRef(he(function(e,n){const{__scopeSlider:r,...o}=e,s=no(Zk,r);return l.jsx(ne.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...o,ref:n})},"SliderTrack")),zd="SliderRange",Jk=p.forwardRef(he(function(e,n){const{__scopeSlider:r,...o}=e,s=no(zd,r),i=dy(zd,r),a=p.useRef(null),c=ae(n,a),u=s.values.length,d=s.values.map(m=>gl(m,s.min,s.max)),f=u>1?Math.min(...d):0,h=100-Math.max(...d);return l.jsx(ne.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...o,ref:c,style:{...e.style,[i.startEdge]:f+"%",[i.endEdge]:h+"%"}})},"SliderRange")),eN="SliderThumb",[tN,hy]=ml(eN),nN="SliderThumbProvider";function py(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:o}=t,s=no(nN,e),i=Hk(e),[a,c]=p.useState(null),u=p.useMemo(()=>a?i().findIndex(v=>v.ref.current===a):-1,[i,a]),d=fr(a),f=a?!!s.form||!!a.closest("form"):!0,h=s.values[u],m=n??(s.name?s.name+(s.values.length>1?"[]":""):void 0),g=h===void 0?0:gl(h,s.min,s.max);p.useEffect(()=>{if(a)return s.thumbs.add(a),()=>{s.thumbs.delete(a)}},[a,s.thumbs]);const y={value:h,name:m,form:s.form,isFormControl:f,index:u,thumb:a,onThumbChange:c,percent:g,size:d};return l.jsx(tN,{scope:e,...y,children:Cy(o)?o(y):r})}he(py,"SliderThumbProvider");var Ei="SliderThumbTrigger",rN=p.forwardRef(he(function(e,n){const{__scopeSlider:r,...o}=e,s=no(Ei,r),i=dy(Ei,r),{index:a,value:c,percent:u,size:d,onThumbChange:f}=hy(Ei,r),h=ae(n,f),m=gy(a,s.values.length),g=d==null?void 0:d[i.size],y=g?vy(g,u,i.direction):0;return l.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${u}% + ${y}px)`},children:l.jsx(Aa.ItemSlot,{scope:r,children:l.jsx(ne.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":s.min,"aria-valuenow":c,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...o,ref:h,style:c===void 0?{display:"none"}:e.style,onFocus:U(e.onFocus,()=>{s.valueIndexToChangeRef.current=a})})})})},"SliderThumbTrigger")),oN=p.forwardRef(he(function(e,n){const{__scopeSlider:r,name:o,...s}=e;return l.jsx(py,{__scopeSlider:r,name:o,internal_do_not_use_render:({index:i,isFormControl:a})=>l.jsxs(l.Fragment,{children:[l.jsx(rN,{...s,ref:n,__scopeSlider:r}),a?l.jsx(iN,{__scopeSlider:r},i):null]})})},"SliderThumb")),sN="SliderBubbleInput",iN=p.forwardRef(he(function({__scopeSlider:e,...n},r){const{value:o,name:s,form:i}=hy(sN,e),a=p.useRef(null),c=ae(a,r),u=Pc(o);return p.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(u!==o&&m){const g=new Event("input",{bubbles:!0});m.call(d,o),d.dispatchEvent(g)}},[u,o]),l.jsx(ne.input,{style:{display:"none"},name:s,form:i,...n,ref:c,defaultValue:o})},"SliderBubbleInput"));function my(t=[],e,n){const r=[...t];return r[n]=e,r.sort((o,s)=>o-s)}he(my,"getNextSortedValues");function gl(t,e,n){const s=100/(n-e)*(t-e);return jr(s,[0,100])}he(gl,"convertValueToPercentage");function gy(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}he(gy,"getLabel");function yy(t,e){if(t.length===1)return 0;const n=t.map(o=>Math.abs(o-e)),r=Math.min(...n);return n.indexOf(r)}he(yy,"getClosestValueIndex");function vy(t,e,n){const r=t/2,s=Ls([0,50],[0,r]);return(r-s(e)*n)*n}he(vy,"getThumbInBoundsOffset");function xy(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}he(xy,"getStepsBetweenValues");function by(t,e){if(e>0){const n=xy(t);return Math.min(...n)>=e}return!0}he(by,"hasMinStepsBetweenValues");function Ls(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}he(Ls,"linearScale");function yl(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,o]=e.split("e"),s=r.split(".")[1]||"",i=Number(o);return Math.max(0,s.length-i)}const n=e.split(".")[1];return n?n.length:0}he(yl,"getDecimalCount");function Sr(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}he(Sr,"roundValue");function wy(t,{min:e,step:n,direction:r,multiplier:o}){const s=yl(n),i=(t-e)/n,a=Math.round(i),c=Sr(a*n+e,s)===Sr(t,s);let u;return c?u=a+o*r:r>0?u=Math.ceil(i):u=Math.floor(i),Sr(u*n+e,s)}he(wy,"getNextStepValue");function Cy(t){return typeof t=="function"}he(Cy,"isFunction");const aN=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",color:s="primary",showValue:i=!1,formatValue:a,value:c,defaultValue:u,...d},f){const h=c??u??[0],m=a??(x=>x),{className:g,style:y,styleTag:v}=oe(r,n,"cny-slider",`cny-slider-${o}`,`cny-slider-${s}`,e);return l.jsxs(Yk,{ref:f,className:g,style:y,value:c,defaultValue:u,...d,children:[v,l.jsx(Qk,{className:"cny-slider-track",children:l.jsx(Jk,{className:"cny-slider-range"})}),h.map((x,w)=>l.jsx(oN,{className:"cny-slider-thumb","aria-label":`Value ${w+1}`,children:i&&l.jsx("span",{className:"cny-slider-bubble",children:m(x)})},w))]})}),cN=S.forwardRef(function({steps:e,active:n,orientation:r="horizontal",size:o="md",onStepClick:s,className:i,style:a,sx:c,...u},d){const{className:f,style:h,styleTag:m}=oe(c,a,"cny-stepper",`cny-stepper-${r}`,`cny-stepper-${o}`,i);return l.jsxs("ol",{ref:d,className:f,style:h,"aria-label":"Progress",...u,children:[m,e.map((g,y)=>{const v=y<n?"complete":y===n?"active":"upcoming",x=v==="complete"&&!!s;return l.jsxs("li",{className:z("cny-stepper-step",`is-${v}`),children:[l.jsxs("button",{type:"button",className:"cny-stepper-step-row",onClick:x?()=>s==null?void 0:s(y):void 0,disabled:!x,"aria-current":v==="active"?"step":void 0,children:[l.jsx("span",{className:"cny-stepper-marker","aria-hidden":"true",children:v==="complete"?l.jsx(nn,{size:14}):g.icon??y+1}),l.jsxs("span",{className:"cny-stepper-text",children:[l.jsx("span",{className:"cny-stepper-label",children:g.label}),g.description&&l.jsx("span",{className:"cny-stepper-desc",children:g.description})]})]}),y<e.length-1&&l.jsx("span",{className:"cny-stepper-connector","aria-hidden":"true"})]},y)})]})}),lN=S.forwardRef(function({size:e=80,color:n="var(--color-primary, #3A73B3)",className:r,style:o,...s},i){const a=S.useId().replace(/[^a-zA-Z0-9_-]/g,""),c=`cny-loader-fade-reveal-${a}`,u=`cny-loader-${a}`;return l.jsxs("div",{ref:i,className:z("cny-loader",u,r),style:{width:e,height:e*(24/21.635),color:n,...o},...s,children:[l.jsx(Na,{css:`
215
- @keyframes ${c} {
239
+ `)},ZP=0,oo=[];function JP(t){var e=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(ZP++)[0],s=m.useState(Ly)[0],i=m.useRef(t);m.useEffect(function(){i.current=t},[t]),m.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var b=xP([t.lockRef.current],(t.shards||[]).map(hh),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var c=m.useCallback(function(b,x){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!i.current.allowPinchZoom;var y=Zs(b),w=n.current,C="deltaX"in b?b.deltaX:w[0]-y[0],S="deltaY"in b?b.deltaY:w[1]-y[1],M,R=b.target,P=Math.abs(C)>Math.abs(S)?"h":"v";if("touches"in b&&P==="h"&&R.type==="range")return!1;var T=window.getSelection(),j=T&&T.anchorNode,A=j?j===R||j.contains(R):!1;if(A)return!1;var _=dh(P,R);if(!_)return!0;if(_?M=P:(M=P==="v"?"h":"v",_=dh(P,R)),!_)return!1;if(!r.current&&"changedTouches"in b&&(C||S)&&(r.current=M),!M)return!0;var L=r.current||M;return YP(L,x,b,L==="h"?C:S)},[]),l=m.useCallback(function(b){var x=b;if(!(!oo.length||oo[oo.length-1]!==s)){var y="deltaY"in x?fh(x):Zs(x),w=e.current.filter(function(M){return M.name===x.type&&(M.target===x.target||x.target===M.shadowParent)&&XP(M.delta,y)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var C=(i.current.shards||[]).map(hh).filter(Boolean).filter(function(M){return M.contains(x.target)}),S=C.length>0?c(x,C[0]):!i.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),u=m.useCallback(function(b,x,y,w){var C={name:b,delta:x,target:y,should:w,shadowParent:QP(y)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(S){return S!==C})},1)},[]),d=m.useCallback(function(b){n.current=Zs(b),r.current=void 0},[]),f=m.useCallback(function(b){u(b.type,fh(b),b.target,c(b,t.lockRef.current))},[]),h=m.useCallback(function(b){u(b.type,Zs(b),b.target,c(b,t.lockRef.current))},[]);m.useEffect(function(){return oo.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ro),document.addEventListener("touchmove",l,ro),document.addEventListener("touchstart",d,ro),function(){oo=oo.filter(function(b){return b!==s}),document.removeEventListener("wheel",l,ro),document.removeEventListener("touchmove",l,ro),document.removeEventListener("touchstart",d,ro)}},[]);var p=t.removeScrollBar,g=t.inert;return m.createElement(m.Fragment,null,g?m.createElement(s,{styles:qP(o)}):null,p?m.createElement(BP,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function QP(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const eN=PP(Oy,JP);var js=m.forwardRef(function(t,e){return m.createElement(sa,In({},t,{ref:e,sideCar:eN}))});js.classNames=sa.classNames;var tN=Object.defineProperty,Ze=(t,e)=>tN(t,"name",{value:e,configurable:!0}),nN=[" ","Enter","ArrowUp","ArrowDown"],rN=[" ","Enter"],wo="Select",[ia,wu,oN]=No(wo),[Yr,A_]=dt(wo,[oN,Mr]),Cu=Mr(),[sN,Rr]=Yr(wo),[iN,aN]=Yr(wo);function Uy(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:h,required:p,form:g,internal_do_not_use_render:b}=t,x=Cu(e),[y,w]=m.useState(null),[C,S]=m.useState(null),[M,R]=m.useState(!1),P=or(u),[T,j]=lt({prop:r,defaultProp:o??!1,onChange:s,caller:wo}),[A,_]=lt({prop:i,defaultProp:c,onChange:l,caller:wo}),L=m.useRef(null),I=m.useRef(A);m.useEffect(()=>{const D=g?y==null?void 0:y.ownerDocument.getElementById(g):y==null?void 0:y.form;if(D instanceof HTMLFormElement){const Z=Ze(()=>_(I.current),"reset");return D.addEventListener("reset",Z),()=>D.removeEventListener("reset",Z)}},[g,y,_]);const k=y?!!g||!!y.closest("form"):!0,[q,U]=m.useState(new Set),E=Et(),$=Array.from(q).map(D=>D.props.value).join(";"),X=m.useCallback(D=>{U(Z=>new Set(Z).add(D))},[]),K=m.useCallback(D=>{U(Z=>{const F=new Set(Z);return F.delete(D),F})},[]),ue={required:p,trigger:y,onTriggerChange:w,valueNode:C,onValueNodeChange:S,valueNodeHasChildren:M,onValueNodeHasChildrenChange:R,contentId:E,value:A,onValueChange:_,open:T,onOpenChange:j,dir:P,triggerPointerDownPosRef:L,disabled:h,name:d,autoComplete:f,form:g,nativeOptions:q,nativeSelectKey:$,isFormControl:k};return a.jsx(Ss,{...x,children:a.jsx(sN,{scope:e,...ue,children:a.jsx(ia.Provider,{scope:e,children:a.jsx(iN,{scope:e,onNativeOptionAdd:X,onNativeOptionRemove:K,children:zy(b)?b(ue):n})})})})}Ze(Uy,"SelectProvider");var cN=Ze(t=>{const{__scopeSelect:e,children:n,...r}=t;return a.jsx(Uy,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>a.jsxs(a.Fragment,{children:[n,o?a.jsx(FN,{__scopeSelect:e}):null]})})},"Select"),lN="SelectTrigger",uN=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,disabled:o=!1,...s}=e,i=Cu(r),c=Rr(lN,r),l=c.disabled||o,u=_e(n,c.onTriggerChange),d=wu(r),f=m.useRef("touch"),[h,p,g]=Su(x=>{const y=d().filter(S=>!S.disabled),w=y.find(S=>S.value===c.value),C=Mu(y,x,w);C!==void 0&&c.onValueChange(C.value)}),b=Ze(x=>{l||(c.onOpenChange(!0),g()),x&&(c.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})},"handleOpen");return a.jsx(Ms,{asChild:!0,...i,children:a.jsx(Ne.button,{type:"button",role:"combobox","aria-controls":c.open?c.contentId:void 0,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Ps(c.value)?"":void 0,...s,ref:u,onClick:ge(s.onClick,x=>{x.currentTarget.focus(),f.current!=="mouse"&&b(x)}),onPointerDown:ge(s.onPointerDown,x=>{f.current=x.pointerType;const y=x.target;y.hasPointerCapture(x.pointerId)&&y.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(b(x),x.preventDefault())}),onKeyDown:ge(s.onKeyDown,x=>{const y=h.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&p(x.key),!(y&&x.key===" ")&&nN.includes(x.key)&&(b(),x.preventDefault())})})})},"SelectTrigger")),dN="SelectValue",fN=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,className:o,style:s,children:i,placeholder:c="",...l}=e,u=Rr(dN,r),{onValueNodeHasChildrenChange:d}=u,f=i!==void 0,h=_e(n,u.onValueNodeChange);mt(()=>{d(f)},[d,f]);const p=Ps(u.value);return a.jsx(Ne.span,{...l,asChild:p?!1:l.asChild,ref:h,style:{pointerEvents:"none"},children:a.jsx(m.Fragment,{children:p?c:i},p?"placeholder":"value")})},"SelectValue")),hN=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,children:o,...s}=e;return a.jsx(Ne.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})},"SelectIcon")),pN="SelectPortal",[mN,gN]=Yr(pN,{forceMount:void 0}),yN=Ze(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return a.jsx(mN,{scope:t.__scopeSelect,forceMount:n,children:a.jsx(Rs,{asChild:!0,...r})})},"SelectPortal"),Gr="SelectContent",vN=m.forwardRef(Ze(function(e,n){const r=gN(Gr,e.__scopeSelect),{forceMount:o=r.forceMount,...s}=e,i=Rr(Gr,e.__scopeSelect),[c,l]=m.useState();return mt(()=>{l(new DocumentFragment)},[]),a.jsx($t,{present:o||i.open,children:({present:u})=>u?a.jsx(wN,{...s,ref:n}):a.jsx(xN,{...s,fragment:c})})},"SelectContent")),xN=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,children:o,fragment:s}=e;return s?ps.createPortal(a.jsx(Hy,{scope:r,children:a.jsx(ia.Slot,{scope:r,children:a.jsx("div",{ref:n,children:o})})}),s):null},"SelectContentFragment")),pn=10,[Hy,aa]=Yr(Gr),bN=vn("SelectContent.RemoveScroll"),wN=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:c,side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:p,collisionPadding:g,sticky:b,hideWhenDetached:x,avoidCollisions:y,...w}=e,C=Rr(Gr,r),[S,M]=m.useState(null),[R,P]=m.useState(null),T=_e(n,M),[j,A]=m.useState(null),[_,L]=m.useState(null),I=wu(r),[k,q]=m.useState(!1),U=m.useRef(!1);m.useEffect(()=>{if(S)return oa(S)},[S]),Do();const E=m.useCallback(G=>{const[ee,...ce]=I().map(J=>J.ref.current),[se]=ce.slice(-1),te=document.activeElement;for(const J of G)if(J===te||(J==null||J.scrollIntoView({block:"nearest"}),J===ee&&R&&(R.scrollTop=0),J===se&&R&&(R.scrollTop=R.scrollHeight),J==null||J.focus(),document.activeElement!==te))return},[I,R]),$=m.useCallback(()=>E([j,S]),[E,j,S]);m.useEffect(()=>{k&&$()},[k,$]);const{onOpenChange:X,triggerPointerDownPosRef:K}=C;m.useEffect(()=>{if(S){let G={x:0,y:0};const ee=Ze(se=>{var te,J;G={x:Math.abs(Math.round(se.pageX)-(((te=K.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(se.pageY)-(((J=K.current)==null?void 0:J.y)??0))}},"handlePointerMove"),ce=Ze(se=>{G.x<=10&&G.y<=10?se.preventDefault():se.composedPath().includes(S)||X(!1),document.removeEventListener("pointermove",ee),K.current=null},"handlePointerUp");return K.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",ce,{capture:!0})}}},[S,X,K]),m.useEffect(()=>{const G=Ze(()=>X(!1),"close");return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[X]);const[ue,D]=Su(G=>{const ee=I().filter(te=>!te.disabled),ce=ee.find(te=>te.ref.current===document.activeElement),se=Mu(ee,G,ce);se&&setTimeout(()=>{var te;return(te=se.ref.current)==null?void 0:te.focus()})}),Z=m.useCallback((G,ee,ce)=>{const se=!U.current&&!ce;(C.value!==void 0&&C.value===ee||se)&&(A(G),se&&(U.current=!0))},[C.value]),F=m.useCallback(()=>S==null?void 0:S.focus(),[S]),V=m.useCallback((G,ee,ce)=>{const se=!U.current&&!ce;(C.value!==void 0&&C.value===ee||se)&&L(G)},[C.value]),H=o==="popper"?ph:CN,Y=H===ph?{side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:p,collisionPadding:g,sticky:b,hideWhenDetached:x,avoidCollisions:y}:{};return a.jsx(Hy,{scope:r,content:S,viewport:R,onViewportChange:P,itemRefCallback:Z,selectedItem:j,onItemLeave:F,itemTextRefCallback:V,focusSelectedItem:$,selectedItemText:_,position:o,isPositioned:k,searchRef:ue,children:a.jsx(js,{as:bN,allowPinchZoom:!0,children:a.jsx(ra,{asChild:!0,trapped:C.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:ge(s,G=>{var ee;(ee=C.trigger)==null||ee.focus({preventScroll:!0}),G.preventDefault()}),children:a.jsx(ws,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:a.jsx(H,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:G=>G.preventDefault(),...w,...Y,onPlaced:()=>q(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:ge(w.onKeyDown,G=>{const ee=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!ee&&G.key.length===1&&D(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let se=I().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(G.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const te=G.target,J=se.indexOf(te);se=se.slice(J+1)}setTimeout(()=>E(se)),G.preventDefault()}})})})})})})},"SelectContentImpl")),CN=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,onPlaced:o,...s}=e,i=Rr(Gr,r),c=aa(Gr,r),[l,u]=m.useState(null),[d,f]=m.useState(null),h=_e(n,f),p=wu(r),g=m.useRef(!1),b=m.useRef(!0),{viewport:x,selectedItem:y,selectedItemText:w,focusSelectedItem:C}=c,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&x&&y&&w){const T=i.trigger.getBoundingClientRect(),j=d.getBoundingClientRect(),A=i.valueNode.getBoundingClientRect(),_=w.getBoundingClientRect();if(i.dir!=="rtl"){const te=_.left-j.left,J=A.left-te,oe=T.left-J,ye=T.width+oe,he=Math.max(ye,j.width),Fe=window.innerWidth-pn,Ve=is(J,[pn,Math.max(pn,Fe-he)]);l.style.minWidth=ye+"px",l.style.left=Ve+"px"}else{const te=j.right-_.right,J=window.innerWidth-A.right-te,oe=window.innerWidth-T.right-J,ye=T.width+oe,he=Math.max(ye,j.width),Fe=window.innerWidth-pn,Ve=is(J,[pn,Math.max(pn,Fe-he)]);l.style.minWidth=ye+"px",l.style.right=Ve+"px"}const L=p(),I=window.innerHeight-pn*2,k=x.scrollHeight,q=window.getComputedStyle(d),U=parseInt(q.borderTopWidth,10),E=parseInt(q.paddingTop,10),$=parseInt(q.borderBottomWidth,10),X=parseInt(q.paddingBottom,10),K=U+E+k+X+$,ue=Math.min(y.offsetHeight*5,K),D=window.getComputedStyle(x),Z=parseInt(D.paddingTop,10),F=parseInt(D.paddingBottom,10),V=T.top+T.height/2-pn,H=I-V,Y=y.offsetHeight/2,G=y.offsetTop+Y,ee=U+E+G,ce=K-ee;if(ee<=V){const te=L.length>0&&y===L[L.length-1].ref.current;l.style.bottom="0px";const J=d.clientHeight-x.offsetTop-x.offsetHeight,oe=Math.max(H,Y+(te?F:0)+J+$),ye=ee+oe;l.style.height=ye+"px"}else{const te=L.length>0&&y===L[0].ref.current;l.style.top="0px";const oe=Math.max(V,U+x.offsetTop+(te?Z:0)+Y)+ce;l.style.height=oe+"px",x.scrollTop=ee-V+x.offsetTop}l.style.margin=`${pn}px 0`,l.style.minHeight=ue+"px",l.style.maxHeight=I+"px",o==null||o(),requestAnimationFrame(()=>g.current=!0)}},[p,i.trigger,i.valueNode,l,d,x,y,w,i.dir,o]);mt(()=>S(),[S]);const[M,R]=m.useState();mt(()=>{d&&R(window.getComputedStyle(d).zIndex)},[d]);const P=m.useCallback(T=>{T&&b.current===!0&&(S(),C==null||C(),b.current=!1)},[S,C]);return a.jsx(SN,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:P,children:a.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:a.jsx(Ne.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),ph=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,align:o="start",collisionPadding:s=pn,...i}=e,c=Cu(r);return a.jsx(ta,{...c,...i,ref:n,align:o,collisionPadding:s,style:{boxSizing:"border-box",...i.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)"}})},"SelectPopperPosition")),[SN,MN]=Yr(Gr,{}),mh="SelectViewport",RN=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,nonce:o,...s}=e,i=aa(mh,r),c=MN(mh,r),l=_e(n,i.onViewportChange),u=m.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),a.jsx(ia.Slot,{scope:r,children:a.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ge(s.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=c;if(p!=null&&p.current&&h){const g=Math.abs(u.current-f.scrollTop);if(g>0){const b=window.innerHeight-pn*2,x=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),w=Math.max(x,y);if(w<b){const C=w+g,S=Math.min(b,C),M=C-S;h.style.height=S+"px",h.style.bottom==="0px"&&(f.scrollTop=M>0?M:0,h.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})},"SelectViewport")),TN="SelectGroup",[jN,PN]=Yr(TN),NN=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,...o}=e,s=Et();return a.jsx(jN,{scope:r,id:s,children:a.jsx(Ne.div,{role:"group","aria-labelledby":s,...o,ref:n})})},"SelectGroup")),EN="SelectLabel",kN=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,...o}=e,s=PN(EN,r);return a.jsx(Ne.div,{id:s.id,...o,ref:n})},"SelectLabel")),dl="SelectItem",[AN,Gy]=Yr(dl),IN=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,value:o,disabled:s=!1,textValue:i,...c}=e,l=Rr(dl,r),u=aa(dl,r),d=l.value===o,[f,h]=m.useState(i??""),[p,g]=m.useState(!1),b=zt(S=>{var M;return(M=u.itemRefCallback)==null?void 0:M.call(u,S,o,s)}),x=_e(n,b),y=Et(),w=m.useRef("touch"),C=Ze(()=>{s||(l.onValueChange(o),l.onOpenChange(!1))},"handleSelect");return a.jsx(AN,{scope:r,value:o,disabled:s,textId:y,isSelected:d,onItemTextChange:m.useCallback(S=>{h(M=>M||((S==null?void 0:S.textContent)??"").trim())},[]),children:a.jsx(ia.ItemSlot,{scope:r,value:o,disabled:s,textValue:f,children:a.jsx(Ne.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:x,onFocus:ge(c.onFocus,()=>g(!0)),onBlur:ge(c.onBlur,()=>g(!1)),onClick:ge(c.onClick,()=>{w.current!=="mouse"&&C()}),onPointerUp:ge(c.onPointerUp,()=>{w.current==="mouse"&&C()}),onPointerDown:ge(c.onPointerDown,S=>{w.current=S.pointerType}),onPointerMove:ge(c.onPointerMove,S=>{var M;w.current=S.pointerType,s?(M=u.onItemLeave)==null||M.call(u):w.current==="mouse"&&S.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ge(c.onPointerLeave,S=>{var M;S.currentTarget===document.activeElement&&((M=u.onItemLeave)==null||M.call(u))}),onKeyDown:ge(c.onKeyDown,S=>{var R;s||S.target!==S.currentTarget||((R=u.searchRef)==null?void 0:R.current)!==""&&S.key===" "||(rN.includes(S.key)&&C(),S.key===" "&&S.preventDefault())})})})})},"SelectItem")),Js="SelectItemText",DN=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,className:o,style:s,...i}=e,c=Rr(Js,r),l=aa(Js,r),u=Gy(Js,r),d=aN(Js,r),[f,h]=m.useState(null),p=zt(C=>{var S;return(S=l.itemTextRefCallback)==null?void 0:S.call(l,C,u.value,u.disabled)}),g=_e(n,h,u.onItemTextChange,p),b=f==null?void 0:f.textContent,x=m.useMemo(()=>a.jsx("option",{value:u.value,disabled:u.disabled,children:b},u.value),[u.disabled,u.value,b]),{onNativeOptionAdd:y,onNativeOptionRemove:w}=d;return mt(()=>(y(x),()=>w(x)),[y,w,x]),a.jsxs(a.Fragment,{children:[a.jsx(Ne.span,{id:u.textId,...i,ref:g}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!Ps(c.value)?ps.createPortal(i.children,c.valueNode):null]})},"SelectItemText")),$N="SelectItemIndicator",_N=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,...o}=e;return Gy($N,r).isSelected?a.jsx(Ne.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),ON=m.forwardRef(Ze(function(e,n){const{__scopeSelect:r,...o}=e;return a.jsx(Ne.div,{"aria-hidden":!0,...o,ref:n})},"SelectSeparator")),LN="SelectBubbleInput",FN=m.forwardRef(Ze(function({__scopeSelect:e,...n},r){const o=Rr(LN,e),{value:s,onValueChange:i,required:c,disabled:l,name:u,autoComplete:d,form:f}=o,{nativeOptions:h,nativeSelectKey:p}=o,g=m.useRef(null),b=_e(r,g),x=s??"",y=bu(x),w=Array.from(h).some(C=>(C.props.value??"")==="");return m.useEffect(()=>{const C=g.current;if(!C)return;const S=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(S,"value").set;if(y!==x&&R){const P=new Event("change",{bubbles:!0});R.call(C,x),C.dispatchEvent(P)}},[y,x]),a.jsxs(Ne.select,{"aria-hidden":!0,required:c,tabIndex:-1,name:u,autoComplete:d,disabled:l,form:f,onChange:C=>i(C.target.value),...n,style:{...uy,...n.style},ref:b,defaultValue:x,children:[Ps(s)&&!w?a.jsx("option",{value:""}):null,Array.from(h)]},p)},"SelectBubbleInput"));function zy(t){return typeof t=="function"}Ze(zy,"isFunction");function Ps(t){return t===""||t===void 0}Ze(Ps,"shouldShowPlaceholder");function Su(t){const e=zt(t),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(i=>{const c=n.current+i;e(c),Ze((function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}),"updateSearch")(c)},[e]),s=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}Ze(Su,"useTypeaheadSearch");function Mu(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=Wy(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}Ze(Mu,"findNextItem");function Wy(t,e){return t.map((n,r)=>t[(e+r)%t.length])}Ze(Wy,"wrapArray");function VN({placeholder:t,size:e,color:n="primary",clearable:r=!1,triggerIcon:o,triggerClassName:s,contentClassName:i,id:c,className:l,style:u,sx:d,disabled:f,children:h,"aria-invalid":p,"aria-describedby":g,"aria-label":b,"aria-labelledby":x,...y}){const{className:w,style:C,styleTag:S}=Ae(d,u,"cny-select-trigger",e==="sm"||e==="lg"?e:null,n!=="primary"&&n,l,s),M=Rl(),{value:R,defaultValue:P,onValueChange:T,onOpenChange:j,...A}=y,[_,L]=v.useState(P??""),I=R!==void 0?R:_,k=D=>{R===void 0&&L(D),T==null||T(D)},q=r?{value:I,onValueChange:k}:{value:R,defaultValue:P,onValueChange:T},U=v.useRef(null),E=D=>{D&&requestAnimationFrame(()=>{var Z,F,V;(V=(F=(Z=U.current)==null?void 0:Z.querySelector('[data-state="checked"]'))==null?void 0:F.scrollIntoView)==null||V.call(F,{block:"nearest"})}),j==null||j(D)},$=r&&!f&&I!=="",X=v.useRef(null),[K,ue]=v.useState();return v.useLayoutEffect(()=>{var F;const D=X.current,Z=!!(b||x||(F=D==null?void 0:D.labels)!=null&&F.length||D!=null&&D.getAttribute("aria-labelledby"));ue(Z?void 0:t||"Select")}),a.jsxs(cN,{disabled:f,onOpenChange:E,...q,...A,children:[a.jsxs(uN,{ref:X,id:c,"aria-label":b??K,"aria-labelledby":x,"aria-invalid":p,"aria-describedby":g,className:w,style:C,onKeyDown:$?D=>{(D.key==="Backspace"||D.key==="Delete")&&k("")}:void 0,children:[S,o&&a.jsx("span",{style:{display:"inline-flex"},children:o}),a.jsx(fN,{placeholder:t}),$&&a.jsx("span",{role:"button","aria-label":"Clear",className:"cny-select-clear",onPointerDown:D=>{D.preventDefault(),D.stopPropagation()},onClick:D=>{D.preventDefault(),D.stopPropagation(),k("")},children:a.jsx(nn,{size:14,"aria-hidden":"true"})}),a.jsx(hN,{className:"cny-select-chevron",asChild:!0,children:a.jsx(bs,{size:14,"aria-hidden":"true"})})]}),a.jsx(yN,{children:a.jsx(vN,{position:"popper",sideOffset:4,className:ne("cny-select-content",i),children:a.jsx(RN,{ref:U,className:"cny-select-viewport",nonce:M,children:h})})})]})}const BN=v.forwardRef(function({className:e,children:n,...r},o){return a.jsxs(IN,{ref:o,className:ne("cny-select-item",e),...r,children:[a.jsx(DN,{children:n}),a.jsx(_N,{className:"cny-select-indicator",children:a.jsx(yr,{size:14,"aria-hidden":"true"})})]})}),UN=v.forwardRef(function(e,n){return a.jsx(NN,{ref:n,...e})}),HN=v.forwardRef(function({className:e,...n},r){return a.jsx(kN,{ref:r,className:ne("cny-select-group-label",e),...n})}),GN=v.forwardRef(function({className:e,...n},r){return a.jsx(ON,{ref:r,className:ne("cny-select-separator",e),...n})});var zN=Object.defineProperty,Cn=(t,e)=>zN(t,"name",{value:e,configurable:!0}),Ru="Popover",[Ky,I_]=dt(Ru,[Mr]),Ns=Mr(),[WN,Tr]=Ky(Ru),KN=Cn(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=t,c=Ns(e),l=m.useRef(null),[u,d]=m.useState(!1),[f,h]=lt({prop:r,defaultProp:o??!1,onChange:s,caller:Ru});return a.jsx(Ss,{...c,children:a.jsx(WN,{scope:e,contentId:Et(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:i,children:n})})},"Popover"),YN="PopoverAnchor",XN=m.forwardRef(Cn(function(e,n){const{__scopePopover:r,...o}=e,s=Tr(YN,r),i=Ns(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=s;return m.useEffect(()=>(c(),()=>l()),[c,l]),a.jsx(Ms,{...i,...o,ref:n})},"PopoverAnchor")),qN="PopoverTrigger",ZN=m.forwardRef(Cn(function(e,n){const{__scopePopover:r,...o}=e,s=Tr(qN,r),i=Ns(r),c=_e(n,s.triggerRef),l=a.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Tu(s.open),...o,ref:c,onClick:ge(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:a.jsx(Ms,{asChild:!0,...i,children:l})},"PopoverTrigger")),Yy="PopoverPortal",[JN,QN]=Ky(Yy,{forceMount:void 0}),eE=Cn(t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,s=Tr(Yy,e);return a.jsx(JN,{scope:e,forceMount:n,children:a.jsx($t,{present:n||s.open,children:a.jsx(Rs,{asChild:!0,container:o,children:r})})})},"PopoverPortal"),as="PopoverContent",tE=m.forwardRef(Cn(function(e,n){const r=QN(as,e.__scopePopover),{forceMount:o=r.forceMount,...s}=e,i=Tr(as,e.__scopePopover);return a.jsx($t,{present:o||i.open,children:i.modal?a.jsx(rE,{...s,ref:n}):a.jsx(oE,{...s,ref:n})})},"PopoverContent")),nE=vn("PopoverContent.RemoveScroll"),rE=m.forwardRef(Cn(function(e,n){const r=Tr(as,e.__scopePopover),o=m.useRef(null),s=_e(n,o),i=m.useRef(!1);return m.useEffect(()=>{const c=o.current;if(c)return oa(c)},[]),a.jsx(js,{as:nE,allowPinchZoom:!0,children:a.jsx(Xy,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ge(e.onCloseAutoFocus,c=>{var l;c.preventDefault(),i.current||(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ge(e.onPointerDownOutside,c=>{const l=c.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:ge(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),oE=m.forwardRef(Cn(function(e,n){const r=Tr(as,e.__scopePopover),o=m.useRef(!1),s=m.useRef(!1);return a.jsx(Xy,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var c,l;(c=e.onCloseAutoFocus)==null||c.call(e,i),i.defaultPrevented||(o.current||(l=r.triggerRef.current)==null||l.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"PopoverContentNonModal")),Xy=m.forwardRef(Cn(function(e,n){const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=e,p=Tr(as,r),g=Ns(r);return Do(),a.jsx(ra,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(ws,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:a.jsx(ta,{"data-state":Tu(p.open),role:"dialog",id:p.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),sE="PopoverClose",iE=m.forwardRef(Cn(function(e,n){const{__scopePopover:r,...o}=e,s=Tr(sE,r);return a.jsx(Ne.button,{type:"button",...o,ref:n,onClick:ge(e.onClick,()=>s.onOpenChange(!1))})},"PopoverClose")),aE=m.forwardRef(Cn(function(e,n){const{__scopePopover:r,...o}=e,s=Ns(r);return a.jsx(sy,{...s,...o,ref:n})},"PopoverArrow"));function Tu(t){return t?"open":"closed"}Cn(Tu,"getState");var ca=KN,qy=XN,Oi=ZN,ju=eE,la=tE,cE=iE,lE=aE,gh=1,uE=.9,dE=.8,fE=.17,oc=.1,sc=.999,hE=.9999,pE=.99,mE=/[\\\/_+.#"@\[\(\{&]/,gE=/[\\\/_+.#"@\[\(\{&]/g,yE=/[\s-]/,Zy=/[\s-]/g;function fl(t,e,n,r,o,s,i){if(s===e.length)return o===t.length?gh:pE;var c=`${o},${s}`;if(i[c]!==void 0)return i[c];for(var l=r.charAt(s),u=n.indexOf(l,o),d=0,f,h,p,g;u>=0;)f=fl(t,e,n,r,u+1,s+1,i),f>d&&(u===o?f*=gh:mE.test(t.charAt(u-1))?(f*=dE,p=t.slice(o,u-1).match(gE),p&&o>0&&(f*=Math.pow(sc,p.length))):yE.test(t.charAt(u-1))?(f*=uE,g=t.slice(o,u-1).match(Zy),g&&o>0&&(f*=Math.pow(sc,g.length))):(f*=fE,o>0&&(f*=Math.pow(sc,u-o))),t.charAt(u)!==e.charAt(s)&&(f*=hE)),(f<oc&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=fl(t,e,n,r,u+1,s+2,i),h*oc>f&&(f=h*oc)),f>d&&(d=f),u=n.indexOf(l,u+1);return i[c]=d,d}function yh(t){return t.toLowerCase().replace(Zy," ")}function vE(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,fl(t,e,yh(t),yh(e),0,0,{})}var xE=Object.defineProperty,rn=(t,e)=>xE(t,"name",{value:e,configurable:!0}),Pu="Dialog",[Jy,D_]=dt(Pu),[bE,Sn]=Jy(Pu),Nu=rn(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=t,c=m.useRef(null),l=m.useRef(null),[u,d]=lt({prop:r,defaultProp:o??!1,onChange:s,caller:Pu}),[f,h]=m.useState(0),[p,g]=m.useState(0);return a.jsx(bE,{scope:e,triggerRef:c,contentRef:l,contentId:Et(),titleId:Et(),descriptionId:Et(),titlePresent:f>0,descriptionPresent:p>0,setTitleCount:h,setDescriptionCount:g,open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(b=>!b),[d]),modal:i,children:n})},"Dialog"),wE="DialogTrigger",Qy=m.forwardRef(rn(function(e,n){const{__scopeDialog:r,...o}=e,s=Sn(wE,r),i=_e(n,s.triggerRef);return a.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":da(s.open),...o,ref:i,onClick:ge(e.onClick,s.onOpenToggle)})},"DialogTrigger")),ev="DialogPortal",[CE,tv]=Jy(ev,{forceMount:void 0}),Eu=rn(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,s=Sn(ev,e);return a.jsx(CE,{scope:e,forceMount:n,children:m.Children.map(r,i=>a.jsx($t,{present:n||s.open,children:a.jsx(Rs,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),hl="DialogOverlay",ku=m.forwardRef(rn(function(e,n){const r=tv(hl,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=Sn(hl,e.__scopeDialog);return i.modal?a.jsx($t,{present:o||i.open,children:a.jsx(ME,{...s,ref:n})}):null},"DialogOverlay")),SE=vn("DialogOverlay.RemoveScroll"),ME=m.forwardRef(rn(function(e,n){const{__scopeDialog:r,...o}=e,s=Sn(hl,r),i=Vg(),c=_e(n,i);return a.jsx(js,{as:SE,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Ne.div,{"data-state":da(s.open),...o,ref:c,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),cs="DialogContent",Au=m.forwardRef(rn(function(e,n){const r=tv(cs,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=Sn(cs,e.__scopeDialog);return a.jsx($t,{present:o||i.open,children:i.modal?a.jsx(RE,{...s,ref:n}):a.jsx(TE,{...s,ref:n})})},"DialogContent")),RE=m.forwardRef(rn(function(e,n){const r=Sn(cs,e.__scopeDialog),o=m.useRef(null),s=_e(n,r.contentRef,o);return m.useEffect(()=>{const i=o.current;if(i)return oa(i)},[]),a.jsx(nv,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ge(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:ge(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&i.preventDefault()}),onFocusOutside:ge(e.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),TE=m.forwardRef(rn(function(e,n){const r=Sn(cs,e.__scopeDialog),o=m.useRef(!1),s=m.useRef(!1);return a.jsx(nv,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var c,l;(c=e.onCloseAutoFocus)==null||c.call(e,i),i.defaultPrevented||(o.current||(l=r.triggerRef.current)==null||l.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),nv=m.forwardRef(rn(function(e,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...c}=e,l=Sn(cs,r);return Do(),a.jsx(a.Fragment,{children:a.jsx(ra,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(ws,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":da(l.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),jE="DialogTitle",Iu=m.forwardRef(rn(function(e,n){const{__scopeDialog:r,...o}=e,s=Sn(jE,r),{setTitleCount:i}=s;return mt(()=>(i(c=>c+1),()=>i(c=>c-1)),[i]),a.jsx(Ne.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),PE="DialogDescription",Du=m.forwardRef(rn(function(e,n){const{__scopeDialog:r,...o}=e,s=Sn(PE,r),{setDescriptionCount:i}=s;return mt(()=>(i(c=>c+1),()=>i(c=>c-1)),[i]),a.jsx(Ne.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),NE="DialogClose",ua=m.forwardRef(rn(function(e,n){const{__scopeDialog:r,...o}=e,s=Sn(NE,r);return a.jsx(Ne.button,{type:"button",...o,ref:n,onClick:ge(e.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function da(t){return t?"open":"closed"}rn(da,"getState");function vh(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Co(...t){return e=>{let n=!1;const r=t.map(o=>{const s=vh(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():vh(t[o],null)}}}}function EE(t){const e=kE(t),n=m.forwardRef((r,o)=>{const{children:s,...i}=r,c=m.Children.toArray(s),l=c.find(IE);if(l){const u=l.props.children,d=c.map(f=>f===l?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:f);return a.jsx(e,{...i,ref:o,children:m.isValidElement(u)?m.cloneElement(u,void 0,d):null})}return a.jsx(e,{...i,ref:o,children:s})});return n.displayName=`${t}.Slot`,n}function kE(t){const e=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const i=$E(o),c=DE(s,o.props);return o.type!==m.Fragment&&(c.ref=r?Co(r,i):i),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var AE=Symbol("radix.slottable");function IE(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===AE}function DE(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const l=s(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}function $E(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var _E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],jr=_E.reduce((t,e)=>{const n=EE(`Primitive.${e}`),r=m.forwardRef((o,s)=>{const{asChild:i,...c}=o,l=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(l,{...c,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),OE=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},LE=m[" useId ".trim().toString()]||(()=>{}),FE=0;function yo(t){const[e,n]=m.useState(LE());return OE(()=>{n(r=>r??String(FE++))},[t]),e?`radix-${e}`:""}var Uo='[cmdk-group=""]',ic='[cmdk-group-items=""]',VE='[cmdk-group-heading=""]',rv='[cmdk-item=""]',xh=`${rv}:not([aria-disabled="true"])`,pl="cmdk-item-select",co="data-value",BE=(t,e,n)=>vE(t,e,n),ov=m.createContext(void 0),Es=()=>m.useContext(ov),sv=m.createContext(void 0),$u=()=>m.useContext(sv),iv=m.createContext(void 0),av=m.forwardRef((t,e)=>{let n=lo(()=>{var D,Z;return{search:"",value:(Z=(D=t.value)!=null?D:t.defaultValue)!=null?Z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=lo(()=>new Set),o=lo(()=>new Map),s=lo(()=>new Map),i=lo(()=>new Set),c=cv(t),{label:l,children:u,value:d,onValueChange:f,filter:h,shouldFilter:p,loop:g,disablePointerSelection:b=!1,vimBindings:x=!0,...y}=t,w=yo(),C=yo(),S=yo(),M=m.useRef(null),R=JE();zr(()=>{if(d!==void 0){let D=d.trim();n.current.value=D,P.emit()}},[d]),zr(()=>{R(6,I)},[]);let P=m.useMemo(()=>({subscribe:D=>(i.current.add(D),()=>i.current.delete(D)),snapshot:()=>n.current,setState:(D,Z,F)=>{var V,H,Y,G;if(!Object.is(n.current[D],Z)){if(n.current[D]=Z,D==="search")L(),A(),R(1,_);else if(D==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ee=document.getElementById(S);ee?ee.focus():(V=document.getElementById(w))==null||V.focus()}if(R(7,()=>{var ee;n.current.selectedItemId=(ee=k())==null?void 0:ee.id,P.emit()}),F||R(5,I),((H=c.current)==null?void 0:H.value)!==void 0){let ee=Z??"";(G=(Y=c.current).onValueChange)==null||G.call(Y,ee);return}}P.emit()}},emit:()=>{i.current.forEach(D=>D())}}),[]),T=m.useMemo(()=>({value:(D,Z,F)=>{var V;Z!==((V=s.current.get(D))==null?void 0:V.value)&&(s.current.set(D,{value:Z,keywords:F}),n.current.filtered.items.set(D,j(Z,F)),R(2,()=>{A(),P.emit()}))},item:(D,Z)=>(r.current.add(D),Z&&(o.current.has(Z)?o.current.get(Z).add(D):o.current.set(Z,new Set([D]))),R(3,()=>{L(),A(),n.current.value||_(),P.emit()}),()=>{s.current.delete(D),r.current.delete(D),n.current.filtered.items.delete(D);let F=k();R(4,()=>{L(),(F==null?void 0:F.getAttribute("id"))===D&&_(),P.emit()})}),group:D=>(o.current.has(D)||o.current.set(D,new Set),()=>{s.current.delete(D),o.current.delete(D)}),filter:()=>c.current.shouldFilter,label:l||t["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:w,inputId:S,labelId:C,listInnerRef:M}),[]);function j(D,Z){var F,V;let H=(V=(F=c.current)==null?void 0:F.filter)!=null?V:BE;return D?H(D,n.current.search,Z):0}function A(){if(!n.current.search||c.current.shouldFilter===!1)return;let D=n.current.filtered.items,Z=[];n.current.filtered.groups.forEach(V=>{let H=o.current.get(V),Y=0;H.forEach(G=>{let ee=D.get(G);Y=Math.max(ee,Y)}),Z.push([V,Y])});let F=M.current;q().sort((V,H)=>{var Y,G;let ee=V.getAttribute("id"),ce=H.getAttribute("id");return((Y=D.get(ce))!=null?Y:0)-((G=D.get(ee))!=null?G:0)}).forEach(V=>{let H=V.closest(ic);H?H.appendChild(V.parentElement===H?V:V.closest(`${ic} > *`)):F.appendChild(V.parentElement===F?V:V.closest(`${ic} > *`))}),Z.sort((V,H)=>H[1]-V[1]).forEach(V=>{var H;let Y=(H=M.current)==null?void 0:H.querySelector(`${Uo}[${co}="${encodeURIComponent(V[0])}"]`);Y==null||Y.parentElement.appendChild(Y)})}function _(){let D=q().find(F=>F.getAttribute("aria-disabled")!=="true"),Z=D==null?void 0:D.getAttribute(co);P.setState("value",Z||void 0)}function L(){var D,Z,F,V;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let H=0;for(let Y of r.current){let G=(Z=(D=s.current.get(Y))==null?void 0:D.value)!=null?Z:"",ee=(V=(F=s.current.get(Y))==null?void 0:F.keywords)!=null?V:[],ce=j(G,ee);n.current.filtered.items.set(Y,ce),ce>0&&H++}for(let[Y,G]of o.current)for(let ee of G)if(n.current.filtered.items.get(ee)>0){n.current.filtered.groups.add(Y);break}n.current.filtered.count=H}function I(){var D,Z,F;let V=k();V&&(((D=V.parentElement)==null?void 0:D.firstChild)===V&&((F=(Z=V.closest(Uo))==null?void 0:Z.querySelector(VE))==null||F.scrollIntoView({block:"nearest"})),V.scrollIntoView({block:"nearest"}))}function k(){var D;return(D=M.current)==null?void 0:D.querySelector(`${rv}[aria-selected="true"]`)}function q(){var D;return Array.from(((D=M.current)==null?void 0:D.querySelectorAll(xh))||[])}function U(D){let Z=q()[D];Z&&P.setState("value",Z.getAttribute(co))}function E(D){var Z;let F=k(),V=q(),H=V.findIndex(G=>G===F),Y=V[H+D];(Z=c.current)!=null&&Z.loop&&(Y=H+D<0?V[V.length-1]:H+D===V.length?V[0]:V[H+D]),Y&&P.setState("value",Y.getAttribute(co))}function $(D){let Z=k(),F=Z==null?void 0:Z.closest(Uo),V;for(;F&&!V;)F=D>0?qE(F,Uo):ZE(F,Uo),V=F==null?void 0:F.querySelector(xh);V?P.setState("value",V.getAttribute(co)):E(D)}let X=()=>U(q().length-1),K=D=>{D.preventDefault(),D.metaKey?X():D.altKey?$(1):E(1)},ue=D=>{D.preventDefault(),D.metaKey?U(0):D.altKey?$(-1):E(-1)};return m.createElement(jr.div,{ref:e,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:D=>{var Z;(Z=y.onKeyDown)==null||Z.call(y,D);let F=D.nativeEvent.isComposing||D.keyCode===229;if(!(D.defaultPrevented||F))switch(D.key){case"n":case"j":{x&&D.ctrlKey&&K(D);break}case"ArrowDown":{K(D);break}case"p":case"k":{x&&D.ctrlKey&&ue(D);break}case"ArrowUp":{ue(D);break}case"Home":{D.preventDefault(),U(0);break}case"End":{D.preventDefault(),X();break}case"Enter":{D.preventDefault();let V=k();if(V){let H=new Event(pl);V.dispatchEvent(H)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:ek},l),fa(t,D=>m.createElement(sv.Provider,{value:P},m.createElement(ov.Provider,{value:T},D))))}),UE=m.forwardRef((t,e)=>{var n,r;let o=yo(),s=m.useRef(null),i=m.useContext(iv),c=Es(),l=cv(t),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;zr(()=>{if(!u)return c.item(o,i==null?void 0:i.id)},[u]);let d=lv(o,s,[t.value,t.children,s],t.keywords),f=$u(),h=br(R=>R.value&&R.value===d.current),p=br(R=>u||c.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);m.useEffect(()=>{let R=s.current;if(!(!R||t.disabled))return R.addEventListener(pl,g),()=>R.removeEventListener(pl,g)},[p,t.onSelect,t.disabled]);function g(){var R,P;b(),(P=(R=l.current).onSelect)==null||P.call(R,d.current)}function b(){f.setState("value",d.current,!0)}if(!p)return null;let{disabled:x,value:y,onSelect:w,forceMount:C,keywords:S,...M}=t;return m.createElement(jr.div,{ref:Co(s,e),...M,id:o,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!h,"data-disabled":!!x,"data-selected":!!h,onPointerMove:x||c.getDisablePointerSelection()?void 0:b,onClick:x?void 0:g},t.children)}),HE=m.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:o,...s}=t,i=yo(),c=m.useRef(null),l=m.useRef(null),u=yo(),d=Es(),f=br(p=>o||d.filter()===!1?!0:p.search?p.filtered.groups.has(i):!0);zr(()=>d.group(i),[]),lv(i,c,[t.value,t.heading,l]);let h=m.useMemo(()=>({id:i,forceMount:o}),[o]);return m.createElement(jr.div,{ref:Co(c,e),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&m.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),fa(t,p=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},m.createElement(iv.Provider,{value:h},p))))}),GE=m.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,o=m.useRef(null),s=br(i=>!i.search);return!n&&!s?null:m.createElement(jr.div,{ref:Co(o,e),...r,"cmdk-separator":"",role:"separator"})}),zE=m.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,o=t.value!=null,s=$u(),i=br(u=>u.search),c=br(u=>u.selectedItemId),l=Es();return m.useEffect(()=>{t.value!=null&&s.setState("search",t.value)},[t.value]),m.createElement(jr.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:o?t.value:i,onChange:u=>{o||s.setState("search",u.target.value),n==null||n(u.target.value)}})}),WE=m.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...o}=t,s=m.useRef(null),i=m.useRef(null),c=br(u=>u.selectedItemId),l=Es();return m.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let p=u.offsetHeight;d.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),m.createElement(jr.div,{ref:Co(s,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},fa(t,u=>m.createElement("div",{ref:Co(i,l.listInnerRef),"cmdk-list-sizer":""},u)))}),KE=m.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...c}=t;return m.createElement(Nu,{open:n,onOpenChange:r},m.createElement(Eu,{container:i},m.createElement(ku,{"cmdk-overlay":"",className:o}),m.createElement(Au,{"aria-label":t.label,"cmdk-dialog":"",className:s},m.createElement(av,{ref:e,...c}))))}),YE=m.forwardRef((t,e)=>br(n=>n.filtered.count===0)?m.createElement(jr.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),XE=m.forwardRef((t,e)=>{let{progress:n,children:r,label:o="Loading...",...s}=t;return m.createElement(jr.div,{ref:e,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},fa(t,i=>m.createElement("div",{"aria-hidden":!0},i)))}),ut=Object.assign(av,{List:WE,Item:UE,Input:zE,Group:HE,Separator:GE,Dialog:KE,Empty:YE,Loading:XE});function qE(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function ZE(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function cv(t){let e=m.useRef(t);return zr(()=>{e.current=t}),e}var zr=typeof window>"u"?m.useEffect:m.useLayoutEffect;function lo(t){let e=m.useRef();return e.current===void 0&&(e.current=t()),e}function br(t){let e=$u(),n=()=>t(e.snapshot());return m.useSyncExternalStore(e.subscribe,n,n)}function lv(t,e,n,r=[]){let o=m.useRef(),s=Es();return zr(()=>{var i;let c=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():o.current}})(),l=r.map(u=>u.trim());s.value(t,c,l),(i=e.current)==null||i.setAttribute(co,c),o.current=c}),o}var JE=()=>{let[t,e]=m.useState(),n=lo(()=>new Map);return zr(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,o)=>{n.current.set(r,o),e({})}};function QE(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function fa({asChild:t,children:e},n){return t&&m.isValidElement(e)?m.cloneElement(QE(e),{ref:e.ref},n(e.props.children)):n(e)}var ek={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function tk({options:t,value:e,defaultValue:n,onValueChange:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No matches.",maxItems:c,clearable:l=!1,maxVisibleChips:u,showSelectAll:d=!1,size:f,color:h="primary",disabled:p=!1,id:g,className:b,style:x,sx:y,"aria-invalid":w,"aria-describedby":C,"aria-label":S,"aria-labelledby":M}){const[R,P]=v.useState(!1),[T,j]=v.useState(n??[]),[A,_]=v.useState(""),L=v.useRef(null),I=e??T,k=v.useCallback(H=>{e===void 0&&j(H),r==null||r(H)},[e,r]),q=v.useCallback(H=>{I.includes(H)?k(I.filter(Y=>Y!==H)):(c==null||I.length<c)&&k([...I,H])},[I,k,c]),U=v.useCallback(H=>k(I.filter(Y=>Y!==H)),[I,k]),E=v.useMemo(()=>{const H=new Map;for(const Y of t)H.set(Y.value,Y);return H},[t]),$=v.useMemo(()=>{const H=new Map;for(const Y of t){const G=Y.group??"";H.has(G)||H.set(G,[]),H.get(G).push(Y)}return H},[t]),X=H=>{H.key==="Backspace"&&A===""&&I.length>0&&(H.preventDefault(),U(I[I.length-1]))},K=v.useRef(null);v.useEffect(()=>{if(!R)return;queueMicrotask(()=>{var Y;return(Y=L.current)==null?void 0:Y.focus()});const H=requestAnimationFrame(()=>{var Y,G,ee;(ee=(G=(Y=K.current)==null?void 0:Y.querySelector('[data-checked="true"]'))==null?void 0:G.scrollIntoView)==null||ee.call(G,{block:"nearest"})});return()=>cancelAnimationFrame(H)},[R]);const ue=()=>{const H=[...I];for(const Y of t)if(!(Y.disabled||H.includes(Y.value))){if(c!=null&&H.length>=c)break;H.push(Y.value)}k(H)},{className:D,style:Z,styleTag:F}=Ae(y,x,"cny-multiselect-trigger",f==="sm"||f==="lg"?f:null,h!=="primary"&&h,l&&"has-clear",b),V=c!=null&&I.length>=c;return a.jsxs(ca,{open:R,onOpenChange:H=>!p&&P(H),children:[a.jsx(Oi,{asChild:!0,children:a.jsxs("div",{role:"combobox","aria-expanded":R,"aria-haspopup":"listbox","aria-invalid":w,"aria-describedby":C,"aria-label":S??(M?void 0:o),"aria-labelledby":M,"data-state":R?"open":"closed","data-disabled":p||void 0,id:g,className:D,style:Z,onClick:()=>!p&&P(H=>!H),tabIndex:p?-1:0,onKeyDown:H=>{(H.key==="Enter"||H.key===" "||H.key==="ArrowDown")&&!R?(H.preventDefault(),P(!0)):(H.key==="Backspace"||H.key==="Delete")&&!R&&!p&&I.length>0&&H.target===H.currentTarget&&(H.preventDefault(),U(I[I.length-1]))},children:[F,I.length===0&&a.jsx("span",{className:"cny-multiselect-placeholder",children:o}),(u!=null&&I.length>u?I.slice(0,u):I).map(H=>{const Y=E.get(H);return a.jsxs("span",{className:"cny-chip",children:[a.jsx("span",{className:"cny-chip-label",title:(Y==null?void 0:Y.label)??H,children:(Y==null?void 0:Y.label)??H}),!p&&a.jsx("button",{type:"button",className:"cny-chip-remove",tabIndex:-1,"aria-label":`Remove ${(Y==null?void 0:Y.label)??H}`,onClick:G=>{G.stopPropagation(),U(H)},children:a.jsx(nn,{size:12,"aria-hidden":"true"})})]},H)}),u!=null&&I.length>u&&a.jsxs("span",{className:"cny-chip cny-chip-more",title:I.slice(u).map(H=>{var Y;return((Y=E.get(H))==null?void 0:Y.label)??H}).join(", "),children:["+",I.length-u]}),l&&!p&&I.length>0&&a.jsx("button",{type:"button",className:"cny-multiselect-clear","aria-label":"Clear all",tabIndex:-1,onClick:H=>{H.stopPropagation(),k([])},children:a.jsx(nn,{size:14,"aria-hidden":"true"})}),a.jsx(bs,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),a.jsx(ju,{children:a.jsx(la,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:H=>H.preventDefault(),children:a.jsxs(ut,{shouldFilter:!0,label:"Options",children:[a.jsx(ut.Input,{ref:L,placeholder:s,value:A,onValueChange:_,onKeyDown:X}),d&&a.jsxs("div",{className:"cny-multiselect-actions",children:[a.jsx("button",{type:"button",onMouseDown:H=>H.preventDefault(),onClick:ue,disabled:V,children:"Select all"}),a.jsx("button",{type:"button",onMouseDown:H=>H.preventDefault(),onClick:()=>k([]),disabled:I.length===0,children:"Clear"})]}),a.jsxs(ut.List,{ref:K,children:[a.jsx(ut.Empty,{children:i}),Array.from($.entries()).map(([H,Y])=>a.jsx(ut.Group,{heading:H||void 0,children:Y.map(G=>{const ee=I.includes(G.value),ce=G.disabled||!ee&&V;return a.jsxs(ut.Item,{value:`${G.label} ${G.description??""} ${G.value}`,disabled:ce,"data-checked":ee||void 0,onSelect:()=>q(G.value),children:[G.icon&&a.jsx("span",{style:{display:"inline-flex"},children:G.icon}),a.jsx("span",{children:G.label}),G.description&&a.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:G.description}),ee&&a.jsx("span",{className:"cny-check",children:a.jsx(yr,{size:14,"aria-hidden":"true"})})]},G.value)})},H||"default"))]})]})})})]})}var nk=Object.defineProperty,rr=(t,e)=>nk(t,"name",{value:e,configurable:!0}),_u="Checkbox",[rk,$_]=dt(_u),[ok,Ou]=rk(_u);function uv(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:c,onCheckedChange:l,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,p]=lt({prop:n,defaultProp:o??!1,onChange:l,caller:_u}),[g,b]=m.useState(null),[x,y]=m.useState(null),w=m.useRef(!1),[C,S]=m.useReducer(P=>P+1,0),M=g?!!i||!!g.closest("form"):!0,R={checked:h,disabled:s,setChecked:p,control:g,setControl:b,name:c,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:C,onUserInteraction:S,required:u,defaultChecked:Zn(o)?!1:o,isFormControl:M,bubbleInput:x,setBubbleInput:y};return a.jsx(ok,{scope:e,...R,children:dv(f)?f(R):r})}rr(uv,"CheckboxProvider");var sk="CheckboxTrigger",ik=m.forwardRef(rr(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...o},s){const{control:i,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:p,onUserInteraction:g,isFormControl:b,bubbleInput:x}=Ou(sk,e),y=_e(s,f),w=m.useRef(u);return m.useEffect(()=>{const C=i==null?void 0:i.form;if(C){const S=rr(()=>h(w.current),"reset");return C.addEventListener("reset",S),()=>C.removeEventListener("reset",S)}},[i,h]),a.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":Zn(u)?"mixed":u,"aria-required":d,"data-state":Lu(u),"data-disabled":l?"":void 0,disabled:l,value:c,...o,ref:y,onKeyDown:ge(n,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:ge(r,C=>{g(),h(S=>Zn(S)?!0:!S),x&&b&&(p.current=C.isPropagationStopped(),p.current||C.stopPropagation())})})},"CheckboxTrigger")),bh=m.forwardRef(rr(function(e,n){const{__scopeCheckbox:r,name:o,checked:s,defaultChecked:i,required:c,disabled:l,value:u,onCheckedChange:d,form:f,...h}=e;return a.jsx(uv,{__scopeCheckbox:r,checked:s,defaultChecked:i,disabled:l,required:c,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:p})=>a.jsxs(a.Fragment,{children:[a.jsx(ik,{...h,ref:n,__scopeCheckbox:r}),p&&a.jsx(uk,{__scopeCheckbox:r})]})})},"Checkbox")),ak="CheckboxIndicator",ck=m.forwardRef(rr(function(e,n){const{__scopeCheckbox:r,forceMount:o,...s}=e,i=Ou(ak,r);return a.jsx($t,{present:o||Zn(i.checked)||i.checked===!0,children:a.jsx(Ne.span,{"data-state":Lu(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),lk="CheckboxBubbleInput",uk=m.forwardRef(rr(function({__scopeCheckbox:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:h,value:p,form:g,bubbleInput:b,setBubbleInput:x}=Ou(lk,e),y=_e(o,x),w=Io(s),C=m.useRef(!1),S=m.useRef(l),M=m.useRef(c);m.useEffect(()=>{const P=b;if(!P)return;const T=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(T,"checked").set,_=c!==M.current;M.current=c;const L=S.current!==l;S.current=l;const I=!(_&&i.current);if(L&&A){C.current=!_;const k=new Event("click",{bubbles:I});P.indeterminate=Zn(l),A.call(P,Zn(l)?!1:l),P.dispatchEvent(k),C.current=!1}},[b,l,i,c]);const R=m.useRef(Zn(l)?!1:l);return a.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:p,form:g,...r,tabIndex:-1,ref:y,onClick:ge(n,P=>{C.current&&P.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function dv(t){return typeof t=="function"}rr(dv,"isFunction");function Zn(t){return t==="indeterminate"}rr(Zn,"isIndeterminate");function Lu(t){return Zn(t)?"indeterminate":t?"checked":"unchecked"}rr(Lu,"getState");const Li=v.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){const c=a.jsxs(ck,{children:[a.jsx(yr,{size:12,"aria-hidden":"true",className:"cny-checkbox-check"}),a.jsx(lR,{size:12,"aria-hidden":"true",className:"cny-checkbox-minus"})]});if(!o){const{className:f,style:h,styleTag:p}=Ae(r,n,"checkbox",e);return a.jsxs(bh,{ref:i,className:f,style:h,...s,children:[p,c]})}const{className:l,style:u,styleTag:d}=Ae(r,n,"control");return a.jsxs("label",{className:l,style:u,children:[d,a.jsx(bh,{ref:i,className:ne("checkbox",e),...s,children:c}),a.jsx("span",{children:o})]})});var dk=Object.defineProperty,Dt=(t,e)=>dk(t,"name",{value:e,configurable:!0}),fv="Radio",[fk,hv]=dt(fv),[hk,ha]=fk(fv);function pv(t){const{__scopeRadio:e,checked:n=!1,children:r,disabled:o,form:s,name:i,onCheck:c,required:l,value:u="on",internal_do_not_use_render:d}=t,[f,h]=m.useState(null),[p,g]=m.useState(null),b=m.useRef(!1),[x,y]=m.useReducer(S=>S+1,0),w=f?!!s||!!f.closest("form"):!0,C={checked:n,disabled:o,required:l,name:i,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:y,isFormControl:w,bubbleInput:p,setBubbleInput:g,onCheck:Dt(()=>c==null?void 0:c(),"onCheck")};return a.jsx(hk,{scope:e,...C,children:mv(d)?d(C):r})}Dt(pv,"RadioProvider");var pk="RadioTrigger",mk=m.forwardRef(Dt(function({__scopeRadio:e,onClick:n,...r},o){const{checked:s,disabled:i,value:c,setControl:l,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:p}=ha(pk,e),g=_e(o,l);return a.jsx(Ne.button,{type:"button",role:"radio","aria-checked":s,"data-state":Fu(s),"data-disabled":i?"":void 0,disabled:i,value:c,...r,ref:g,onClick:ge(n,b=>{s||(f(),u()),p&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),gk="RadioIndicator",yk=m.forwardRef(Dt(function(e,n){const{__scopeRadio:r,forceMount:o,...s}=e,i=ha(gk,r);return a.jsx($t,{present:o||i.checked,children:a.jsx(Ne.span,{"data-state":Fu(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),vk="RadioBubbleInput",xk=m.forwardRef(Dt(function({__scopeRadio:e,onClick:n,...r},o){const{control:s,checked:i,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:p,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=ha(vk,e),x=_e(o,p),y=Io(s),w=m.useRef(!1),C=m.useRef(i),S=m.useRef(b);m.useEffect(()=>{const R=h;if(!R)return;const P=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(P,"checked").set,A=b!==S.current;S.current=b;const _=C.current!==i;C.current=i;const L=!(A&&g.current);if(_&&j){w.current=!A;const I=new Event("click",{bubbles:L});j.call(R,i),R.dispatchEvent(I),w.current=!1}},[h,i,g,b]);const M=m.useRef(i);return a.jsx(Ne.input,{type:"radio","aria-hidden":!0,defaultChecked:M.current,required:c,disabled:l,name:u,value:d,form:f,...r,tabIndex:-1,ref:x,onClick:ge(n,R=>{w.current&&R.stopPropagation()}),style:{...r.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function mv(t){return typeof t=="function"}Dt(mv,"isFunction");function Fu(t){return t?"checked":"unchecked"}Dt(Fu,"getState");var bk=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Vu="RadioGroup",[wk,__]=dt(Vu,[Sr,hv]),gv=Sr(),pa=hv(),[Ck,Sk]=wk(Vu),Mk=m.forwardRef(Dt(function(e,n){const{__scopeRadioGroup:r,name:o,form:s,defaultValue:i,value:c,required:l=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:p,...g}=e,b=gv(r),x=or(f),[y,w]=lt({prop:c,defaultProp:i??null,onChange:p,caller:Vu}),[C,S]=m.useState(null),M=_e(n,S),R=m.useRef(y);return m.useEffect(()=>{const P=s?C==null?void 0:C.ownerDocument.getElementById(s):C==null?void 0:C.closest("form");if(P instanceof HTMLFormElement){const T=Dt(()=>w(R.current),"reset");return P.addEventListener("reset",T),()=>P.removeEventListener("reset",T)}},[C,s,w]),a.jsx(Ck,{scope:r,name:o,form:s,required:l,disabled:u,value:y,onValueChange:w,children:a.jsx(Yi,{asChild:!0,...b,orientation:d,dir:x,loop:h,children:a.jsx(Ne.div,{role:"radiogroup","aria-required":l,"aria-orientation":d,"data-disabled":u?"":void 0,dir:x,...g,ref:M})})})},"RadioGroup")),Rk="RadioGroupItemProvider",Tk="RadioGroupItemTrigger";function yv(t){const{__scopeRadioGroup:e,value:n,disabled:r,children:o,internal_do_not_use_render:s}=t,i=Sk(Rk,e),c=pa(e),l=i.disabled||r;return a.jsx(pv,{...c,checked:i.value===n,disabled:l,required:i.required,name:i.name,form:i.form,value:n,onCheck:()=>i.onValueChange(n),internal_do_not_use_render:s,children:o})}Dt(yv,"RadioGroupItemProvider");var jk=m.forwardRef(Dt(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=gv(r),i=pa(r),{checked:c,disabled:l}=ha(Tk,i.__scopeRadio),u=m.useRef(null),d=_e(n,u),f=m.useRef(!1);return m.useEffect(()=>{const h=Dt(g=>{bk.includes(g.key)&&(f.current=!0)},"handleKeyDown"),p=Dt(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),a.jsx(Xi,{asChild:!0,...s,focusable:!l,active:c,children:a.jsx(mk,{...i,...o,ref:d,onKeyDown:ge(o.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:ge(o.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),wh=m.forwardRef(Dt(function(e,n){const{__scopeRadioGroup:r,value:o,disabled:s,...i}=e;return a.jsx(yv,{__scopeRadioGroup:r,value:o,disabled:s,internal_do_not_use_render:({isFormControl:c})=>a.jsxs(a.Fragment,{children:[a.jsx(jk,{...i,ref:n,__scopeRadioGroup:r}),c&&a.jsx(Pk,{__scopeRadioGroup:r})]})})},"RadioGroupItem")),Pk=m.forwardRef(Dt(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=pa(r);return a.jsx(xk,{...s,...o,ref:n})},"RadioGroupItemBubbleInput")),Ch=m.forwardRef(Dt(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=pa(r);return a.jsx(yk,{...s,...o,ref:n})},"RadioGroupIndicator"));const Nk=v.forwardRef(function({orientation:e="vertical",className:n,style:r,...o},s){return a.jsx(Mk,{ref:s,className:ne("cny-radio-group",e==="horizontal"&&"cny-radio-group-horizontal",n),style:r,...o})}),Ek=v.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=Ae(r,n,"radio",e);return a.jsxs(wh,{ref:i,className:d,style:f,...s,children:[h,a.jsx(Ch,{})]})}const{className:c,style:l,styleTag:u}=Ae(r,n,"control");return a.jsxs("label",{className:c,style:l,children:[u,a.jsx(wh,{ref:i,className:ne("radio",e),...s,children:a.jsx(Ch,{})}),a.jsx("span",{children:o})]})});var kk=Object.defineProperty,wr=(t,e)=>kk(t,"name",{value:e,configurable:!0}),Bu="Switch",[Ak,O_]=dt(Bu),[Ik,Uu]=Ak(Bu);function vv(t){const{__scopeSwitch:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:c,onCheckedChange:l,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,p]=lt({prop:n,defaultProp:o??!1,onChange:l,caller:Bu}),[g,b]=m.useState(null),[x,y]=m.useState(null),w=m.useRef(!1),[C,S]=m.useReducer(P=>P+1,0),M=g?!!i||!!g.closest("form"):!0,R={checked:h,setChecked:p,disabled:s,control:g,setControl:b,name:c,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:C,onUserInteraction:S,required:u,defaultChecked:o,isFormControl:M,bubbleInput:x,setBubbleInput:y};return a.jsx(Ik,{scope:e,...R,children:xv(f)?f(R):r})}wr(vv,"SwitchProvider");var Dk="SwitchTrigger",$k=m.forwardRef(wr(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,form:i,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:p,onUserInteraction:g,isFormControl:b,bubbleInput:x}=Uu(Dk,e),y=_e(o,f),w=m.useRef(u);return m.useEffect(()=>{const C=i?s==null?void 0:s.ownerDocument.getElementById(i):s==null?void 0:s.form;if(C instanceof HTMLFormElement){const S=wr(()=>h(w.current),"reset");return C.addEventListener("reset",S),()=>C.removeEventListener("reset",S)}},[s,i,h]),a.jsx(Ne.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":Hu(u),"data-disabled":l?"":void 0,disabled:l,value:c,...r,ref:y,onClick:ge(n,C=>{g(),h(S=>!S),x&&b&&(p.current=C.isPropagationStopped(),p.current||C.stopPropagation())})})},"SwitchTrigger")),Sh=m.forwardRef(wr(function(e,n){const{__scopeSwitch:r,name:o,checked:s,defaultChecked:i,required:c,disabled:l,value:u,onCheckedChange:d,form:f,...h}=e;return a.jsx(vv,{__scopeSwitch:r,checked:s,defaultChecked:i,disabled:l,required:c,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:p})=>a.jsxs(a.Fragment,{children:[a.jsx($k,{...h,ref:n,__scopeSwitch:r}),p&&a.jsx(Lk,{__scopeSwitch:r})]})})},"Switch")),_k="SwitchThumb",Mh=m.forwardRef(wr(function(e,n){const{__scopeSwitch:r,...o}=e,s=Uu(_k,r);return a.jsx(Ne.span,{"data-state":Hu(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:n})},"SwitchThumb")),Ok="SwitchBubbleInput",Lk=m.forwardRef(wr(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:h,value:p,form:g,bubbleInput:b,setBubbleInput:x}=Uu(Ok,e),y=_e(o,x),w=Io(s),C=m.useRef(!1),S=m.useRef(l),M=m.useRef(c);m.useEffect(()=>{const P=b;if(!P)return;const T=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(T,"checked").set,_=c!==M.current;M.current=c;const L=S.current!==l;S.current=l;const I=!(_&&i.current);if(L&&A){C.current=!_;const k=new Event("click",{bubbles:I});A.call(P,l),P.dispatchEvent(k),C.current=!1}},[b,l,i,c]);const R=m.useRef(l);return a.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:p,form:g,...r,tabIndex:-1,ref:y,onClick:ge(n,P=>{C.current&&P.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function xv(t){return typeof t=="function"}wr(xv,"isFunction");function Hu(t){return t?"checked":"unchecked"}wr(Hu,"getState");const Fk=v.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=Ae(r,n,"switch",e);return a.jsxs(Sh,{ref:i,className:d,style:f,...s,children:[h,a.jsx(Mh,{className:"switch-thumb"})]})}const{className:c,style:l,styleTag:u}=Ae(r,n,"control");return a.jsxs("label",{className:c,style:l,children:[u,a.jsx(Sh,{ref:i,className:ne("switch",e),...s,children:a.jsx(Mh,{className:"switch-thumb"})}),a.jsx("span",{children:o})]})});function Ko(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Rh(t){const e=new Date(t);return e.setHours(23,59,59,999),e}function Qs(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function ac(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}function Vk(t,e){return t.getFullYear()===e.getFullYear()}function on(t){return new Date(t.getFullYear(),t.getMonth(),1)}function Bk(t){return new Date(t.getFullYear(),0,1)}function Th(t){return new Date(Math.floor(t.getFullYear()/10)*10,0,1)}function jh(t,e){const n=new Date(t);return n.setDate(1),n.setMonth(n.getMonth()+e),n}function Ph(t,e){const n=new Date(t.getFullYear(),t.getMonth()+e,1),r=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(t.getDate(),r)),n}function Fi(t,e){const n=new Date(t);return n.setDate(n.getDate()+e),n}function lr(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e),n}function cc(t,e,n,r=0){const o=new Date(t);return o.setHours(e,n,r,0),o}function Ot(t,e,n){return e&&t.getTime()<e.getTime()?new Date(e):n&&t.getTime()>n.getTime()?new Date(n):t}function Uk(t,e){const n=on(t),r=(n.getDay()-e+7)%7,o=Fi(n,-r);return Array.from({length:42},(s,i)=>Fi(o,i))}function Hk(t,e){const n=new Intl.DateTimeFormat(t,{weekday:"short"}),r=new Date(2024,0,7);return Array.from({length:7},(o,s)=>{const i=Fi(r,(s+e)%7);return n.format(i)})}function Gk(t,e="short"){const n=new Intl.DateTimeFormat(t,{month:e});return Array.from({length:12},(r,o)=>n.format(new Date(2024,o,1)))}function Nh(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function zk(t,e){return new Intl.DateTimeFormat(e,{year:"numeric"}).format(t)}function Wk(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function bv(t,e){return new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"}).format(t)}function wv(t,e,n,r){return new Intl.DateTimeFormat(e,{hour:"2-digit",minute:"2-digit",second:r?"2-digit":void 0,hour12:n}).format(t)}function Kk(t,e,n,r){return`${bv(t,e)} · ${wv(t,e,n,r)}`}function so(t){if(t==null||t==="")return null;if(t instanceof Date)return Number.isNaN(t.getTime())?null:new Date(t);const e=new Date(t);return Number.isNaN(e.getTime())?null:e}function ei(t,e){return t.getTime()<e.getTime()}function ti(t,e){return t.getTime()>e.getTime()}function ni(t){return t<10?`0${t}`:String(t)}function Yk(t){return t||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function Xk(t){try{return new Intl.DateTimeFormat(t,{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}function qk(t,e,n,r,o){switch(e){case"year":return zk(t,n);case"month":return Wk(t,n);case"time":return wv(t,n,r,o);case"datetime":return Kk(t,n,r,o);case"date":default:return bv(t,n)}}function Eh(t,e){switch(e){case"year":return Bk(t);case"month":return on(t);case"date":return Ko(t);default:return new Date(t)}}const Zk=v.forwardRef(function({mode:e="date",value:n,defaultValue:r,onChange:o,min:s,max:i,allow:c="any",presets:l,typeable:u=!1,disabledDate:d,disabledTime:f,placeholder:h,size:p,color:g="primary",disabled:b=!1,clearable:x=!0,locale:y,weekStartsOn:w=0,hour12:C,showSeconds:S=!1,minuteStep:M=1,secondStep:R=1,format:P,icon:T,required:j=!1,validate:A,error:_,onValidate:L,id:I,className:k,style:q,sx:U,"aria-invalid":E,"aria-describedby":$,dialogLabel:X,name:K,open:ue,onOpenChange:D,...Z},F){const V=Yk(y),H=C??Xk(V),Y=v.useId(),G=I??`cny-dp-${Y}`,ee=`${G}-dialog`,ce=`${G}-hint`,se=v.useMemo(()=>{const z=so(s),xe=c==="future"||c==="current"?Ko(new Date):null;return z&&xe?z.getTime()>xe.getTime()?z:xe:z??xe},[s,c]),te=v.useMemo(()=>{const z=so(i),xe=c==="past"||c==="current"?Rh(new Date):null;return z&&xe?z.getTime()<xe.getTime()?z:xe:z??xe},[i,c]),J=n!==void 0,[oe,ye]=v.useState(()=>so(r)),he=J?so(n):oe,Fe=ue!==void 0,[Ve,ie]=v.useState(!1),Q=Fe?ue:Ve,me=v.useCallback(z=>{Fe||ie(z),D==null||D(z)},[Fe,D]),je=v.useMemo(()=>he??Ot(new Date,se,te),[he,se,te]),[Me,be]=v.useState(()=>on(je)),[ke,re]=v.useState(()=>je),we=e==="month"?"month":e==="year"?"year":"date",[Se,He]=v.useState(we),Oe=v.useRef(null);v.useImperativeHandle(F,()=>Oe.current,[]);const pe=v.useRef(null),O=v.useRef(null),ae=v.useRef(null),[Ce,Le]=v.useState(!1);v.useEffect(()=>Le(!0),[]);const le=v.useCallback(z=>se&&ei(z,se)||te&&ti(z,te)?!0:d?d(z):!1,[se,te,d]),de=v.useCallback(z=>f?f(z):!1,[f]),Re=v.useMemo(()=>{if(_)return typeof _=="string"?_:"Invalid";if(j&&!he)return"Required";if(he){const xe=Ko(new Date);if(c==="future"&&ei(he,xe))return"Must be today or later";if(c==="past"&&ti(he,Rh(new Date)))return"Must be today or earlier";if(c==="current"&&!Qs(he,xe))return"Must be today";if(se&&ei(he,se))return"Too early";if(te&&ti(he,te))return"Too late";if(d&&d(he))return"Unavailable date";if(f&&f(he))return"Unavailable time"}const z=A==null?void 0:A(he);return z||null},[_,j,he,c,se,te,d,f,A]),ve=v.useRef(null);v.useEffect(()=>{ve.current!==Re&&(ve.current=Re,L==null||L(Re))},[Re,L]);const Ie=Re!==null,qe=Ie?"danger":g,Ye=he?P?P(he,e):qk(he,e,V,H,S):"",Be=h??{date:"Select date",month:"Select month",year:"Select year",time:"Select time",datetime:"Select date & time"}[e],ze=X??{date:"Choose date",month:"Choose month",year:"Choose year",time:"Choose time",datetime:"Choose date and time"}[e],We=v.useCallback(z=>{J||ye(z),o==null||o(z)},[J,o]),Qe=v.useCallback(()=>{var z;me(!1),(z=pe.current)==null||z.focus()},[me]),De=v.useCallback(z=>{var xe;z.stopPropagation(),We(null),(xe=pe.current)==null||xe.focus()},[We]),et=v.useCallback(()=>{if(b)return;const z=he??Ot(new Date,se,te);be(on(z)),re(z),He(we),me(!0)},[b,he,se,te,me,we]),At=v.useCallback(()=>{var z,xe;Se==="date"&&(e==="date"||e==="datetime")?(z=O.current)==null||z.focus({preventScroll:!0}):(Se==="month"||Se==="year")&&((xe=ae.current)==null||xe.focus({preventScroll:!0}))},[e,Se]),it=v.useRef(!1);v.useEffect(()=>{const z=Q&&!it.current;it.current=Q,!(!Q||z)&&At()},[Q,ke,At]);const xt=v.useCallback(()=>{var z;Se==="year"&&e!=="year"?He("month"):Se==="month"&&e!=="month"?He("date"):(me(!1),(z=pe.current)==null||z.focus())},[Se,e,me]),st=v.useCallback(z=>{const xe=Ot(z,se,te);re(xe),be(Ge=>ac(Ge,xe)?Ge:on(xe))},[se,te]),ct=v.useCallback((z,xe)=>{const Ge=Eh(z,e);if(e!=="time"&&le(Ge))return;const ft=e==="time"||e==="datetime"?cc(Ge,(he??z).getHours(),(he??z).getMinutes(),S?(he??z).getSeconds():0):Ge;We(ft),re(ft),((xe==null?void 0:xe.close)??(e!=="datetime"&&e!=="time"))&&Qe()},[e,le,We,he,S,Qe]),bt=v.useCallback((z,xe)=>{const Ge=he??Ot(new Date,se,te),ft=z==="hour"?xe:Ge.getHours(),Ee=z==="minute"?xe:Ge.getMinutes(),Pn=z==="second"?xe:S?Ge.getSeconds():0,Bt=cc(Ge,ft,Ee,Pn);de(Bt)||(We(Bt),re(Bt))},[he,se,te,S,de,We]),Rn=v.useCallback(z=>st(Fi(ke,z)),[st,ke]),wt=z=>{switch(z.key){case"ArrowLeft":z.preventDefault(),Rn(-1);break;case"ArrowRight":z.preventDefault(),Rn(1);break;case"ArrowUp":z.preventDefault(),Rn(-7);break;case"ArrowDown":z.preventDefault(),Rn(7);break;case"Home":{z.preventDefault();const xe=(ke.getDay()-w+7)%7;Rn(-xe);break}case"End":{z.preventDefault();const xe=(ke.getDay()-w+7)%7;Rn(6-xe);break}case"PageUp":z.preventDefault(),st(Ph(ke,z.shiftKey?-12:-1));break;case"PageDown":z.preventDefault(),st(Ph(ke,z.shiftKey?12:1));break;case"Enter":case" ":z.preventDefault(),ct(ke);break;case"Escape":z.preventDefault(),xt();break}},Jr=v.useMemo(()=>Uk(Me,w),[Me,w]),_o=v.useMemo(()=>Hk(V,w),[V,w]),Ct=v.useMemo(()=>Gk(V,"short"),[V]),Tn=v.useMemo(()=>Ko(new Date),[]),Qr=!se||!ei(on(Me),on(se)),eo=!te||!ti(on(Me),on(te)),kr=!se||Me.getFullYear()-1>=se.getFullYear(),ir=!te||Me.getFullYear()+1<=te.getFullYear(),_t=Th(Me).getFullYear(),jn=!se||_t-10+9>=se.getFullYear(),dn=!te||_t+10<=te.getFullYear(),Gn=e==="time"?!de(new Date):!le(Tn),[zn,Oo]=v.useState(""),[Lo,Ar]=v.useState(!1),ar=()=>{const z=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(zn.trim()),xe=z?new Date(Number(z[1]),Number(z[2])-1,Number(z[3])):null,Ge=!!xe&&!!z&&xe.getMonth()===Number(z[2])-1&&xe.getDate()===Number(z[3])&&!le(Ko(xe));Ar(!Ge),!(!Ge||!xe)&&(Oo(""),be(on(xe)),ct(xe,{close:e!=="datetime"}))},to=z=>{const xe=typeof z.value=="function"?z.value():z.value,Ge=so(xe);Ge&&(be(on(Ge)),ct(Ge,{close:e!=="datetime"}))},Ir=z=>{const xe=so(typeof z.value=="function"?z.value():z.value);return!xe||le(Eh(xe,e))},Fo=()=>{if(e==="time"){const z=new Date;if(de(z))return;const Ge=cc(he??z,z.getHours(),z.getMinutes(),S?z.getSeconds():0);We(Ge),re(Ge);return}ct(Tn,{close:e!=="datetime"})},Dr=ne("cny-datepicker-trigger","input",qe!=="primary"&&qe,p==="sm"||p==="lg"?p:null,he&&"has-value",Q&&"is-open"),W=T??(e==="time"?a.jsx(GM,{size:15}):a.jsx(NM,{size:15})),N=(z,xe)=>{let ft=!0;switch(z.key){case"ArrowLeft":re(xe==="month"?Ee=>Ot(new Date(Me.getFullYear(),(Ee.getMonth()+11)%12,Math.min(Ee.getDate(),28)),se,te):Ee=>Ot(new Date(Ee.getFullYear()-1,Ee.getMonth(),Math.min(Ee.getDate(),28)),se,te));break;case"ArrowRight":re(xe==="month"?Ee=>Ot(new Date(Me.getFullYear(),(Ee.getMonth()+1)%12,Math.min(Ee.getDate(),28)),se,te):Ee=>Ot(new Date(Ee.getFullYear()+1,Ee.getMonth(),Math.min(Ee.getDate(),28)),se,te));break;case"ArrowUp":re(xe==="month"?Ee=>Ot(new Date(Me.getFullYear(),(Ee.getMonth()-3+12)%12,Math.min(Ee.getDate(),28)),se,te):Ee=>Ot(new Date(Ee.getFullYear()-3,Ee.getMonth(),Math.min(Ee.getDate(),28)),se,te));break;case"ArrowDown":re(xe==="month"?Ee=>Ot(new Date(Me.getFullYear(),(Ee.getMonth()+3)%12,Math.min(Ee.getDate(),28)),se,te):Ee=>Ot(new Date(Ee.getFullYear()+3,Ee.getMonth(),Math.min(Ee.getDate(),28)),se,te));break;case"PageUp":be(xe==="month"?Ee=>lr(Ee,z.shiftKey?-10:-1):Ee=>lr(Ee,z.shiftKey?-100:-10));break;case"PageDown":be(xe==="month"?Ee=>lr(Ee,z.shiftKey?10:1):Ee=>lr(Ee,z.shiftKey?100:10));break;case"Enter":case" ":xe==="month"?B(new Date(Me.getFullYear(),ke.getMonth(),1)):fe(ke.getFullYear());break;case"Escape":xt();break;default:ft=!1}ft&&z.preventDefault()};v.useEffect(()=>{if(Q&&Se==="year"){const z=Th(Me).getFullYear(),xe=ke.getFullYear();(xe<z-1||xe>z+10)&&be(new Date(xe,0,1))}},[Q,Se,ke,Me]);const B=z=>{e==="month"?ct(z):(be(on(z)),re(Ot(z,se,te)),He("date"))},fe=z=>{if(e==="year")ct(new Date(z,0,1));else{const xe=new Date(z,Me.getMonth(),1);be(xe),re(Ot(new Date(z,ke.getMonth(),Math.min(ke.getDate(),28)),se,te)),He("month")}},Te=()=>{const z=ke.getMonth();return Ct.map((xe,Ge)=>{const ft=new Date(Me.getFullYear(),Ge,1),Ee=!!he&&ac(ft,he)&&Vk(ft,he),Pn=ft.getMonth()===Me.getMonth()&&e!=="month",Bt=Ge===z,Wn=le(ft);return a.jsx("button",{ref:Bt?ae:void 0,type:"button",tabIndex:Bt?0:-1,className:ne("cny-datepicker-chip",Ee&&"is-selected",Pn&&!Ee&&"is-current"),disabled:Wn,onClick:()=>B(ft),onFocus:()=>re(new Date(Me.getFullYear(),Ge,Math.min(ke.getDate(),28))),children:xe},Ge)})},$e=()=>{const z=_t-1,xe=ke.getFullYear();return Array.from({length:12},(Ge,ft)=>{const Ee=z+ft,Pn=new Date(Ee,0,1),Bt=!!he&&he.getFullYear()===Ee,Wn=Ee===Me.getFullYear()&&e!=="year",Ut=Ee===xe,Vo=le(Pn),lb=Ee<_t||Ee>=_t+10;return a.jsx("button",{ref:Ut?ae:void 0,type:"button",tabIndex:Ut?0:-1,className:ne("cny-datepicker-chip",Bt&&"is-selected",Wn&&!Bt&&"is-current",lb&&"is-outside"),disabled:Vo,onClick:()=>fe(Ee),onFocus:()=>re(new Date(Ee,ke.getMonth(),Math.min(ke.getDate(),28))),children:Ee},Ee)})},Ue=v.useRef(null),nt=v.useRef(null),gt=v.useRef(null),St=()=>{const z=he??Ot(new Date,se,te),xe=z.getHours(),Ge=z.getMinutes(),ft=z.getSeconds(),Ee=xe>=12,Pn=H?xe%12===0?12:xe%12:xe,Bt=Ut=>{const Vo=H?Ee?Ut===12?12:Ut+12:Ut===12?0:Ut:Ut;bt("hour",Vo)},Wn=Ut=>{const Vo=Ut?xe<12?xe+12:xe:xe>=12?xe-12:xe;bt("hour",Vo)};return a.jsx("div",{className:"cny-dp-time",children:a.jsxs("div",{className:"cny-dp-time-row",children:[a.jsx(lc,{ref:Ue,ariaLabel:"Hour",value:Pn,min:H?1:0,max:H?12:23,step:1,nextRef:nt,onChange:Bt}),a.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),a.jsx(lc,{ref:nt,ariaLabel:"Minute",value:Ge-Ge%Math.max(1,M),min:0,max:59,step:Math.max(1,M),nextRef:S?gt:void 0,onChange:Ut=>bt("minute",Ut)}),S&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),a.jsx(lc,{ref:gt,ariaLabel:"Second",value:ft-ft%Math.max(1,R),min:0,max:59,step:Math.max(1,R),onChange:Ut=>bt("second",Ut)})]}),H&&a.jsxs("div",{className:"cny-dp-ampm",role:"radiogroup","aria-label":"AM or PM",children:[a.jsx("button",{type:"button",role:"radio","aria-checked":!Ee,className:ne("cny-dp-ampm-btn",!Ee&&"is-active"),onClick:()=>Wn(!1),children:"AM"}),a.jsx("button",{type:"button",role:"radio","aria-checked":Ee,className:ne("cny-dp-ampm-btn",Ee&&"is-active"),onClick:()=>Wn(!0),children:"PM"})]})]})})},Mt=()=>a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cny-datepicker-header",children:[a.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous month",disabled:!Qr,onClick:()=>be(z=>jh(z,-1)),children:a.jsx(Jo,{size:16,"aria-hidden":"true"})}),a.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to month picker (currently ${Nh(Me,V)})`,onClick:()=>He("month"),children:Nh(Me,V)}),a.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next month",disabled:!eo,onClick:()=>be(z=>jh(z,1)),children:a.jsx(Xn,{size:16,"aria-hidden":"true"})})]}),a.jsxs("div",{role:"grid",className:"cny-datepicker-grid",onKeyDown:wt,children:[a.jsx("div",{role:"row",className:"cny-datepicker-weekdays",children:_o.map((z,xe)=>a.jsx("span",{role:"columnheader","aria-label":z,className:"cny-datepicker-weekday",children:z.slice(0,2)},xe))}),Array.from({length:6},(z,xe)=>a.jsx("div",{role:"row",className:"cny-datepicker-row",children:Jr.slice(xe*7,xe*7+7).map(Ge=>{const ft=!ac(Ge,Me),Ee=Qs(Ge,he),Pn=Qs(Ge,Tn),Bt=Qs(Ge,ke),Wn=le(Ge);return a.jsx("button",{ref:Bt?O:void 0,type:"button",role:"gridcell",tabIndex:Bt?0:-1,"aria-selected":Ee,"aria-current":Pn?"date":void 0,"aria-disabled":Wn||void 0,disabled:Wn,className:ne("cny-datepicker-cell",ft&&"is-outside",Ee&&"is-selected",Pn&&"is-today"),onClick:()=>ct(Ge),onFocus:()=>re(Ge),children:Ge.getDate()},Ge.toISOString())})},xe))]})]}),cr=()=>a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cny-datepicker-header",children:[a.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous year",disabled:!kr,onClick:()=>be(z=>lr(z,-1)),children:a.jsx(Jo,{size:16,"aria-hidden":"true"})}),a.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to year picker (currently ${Me.getFullYear()})`,onClick:()=>He("year"),children:Me.getFullYear()}),a.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next year",disabled:!ir,onClick:()=>be(z=>lr(z,1)),children:a.jsx(Xn,{size:16,"aria-hidden":"true"})})]}),a.jsx("div",{role:"grid","aria-label":"Month picker",className:"cny-datepicker-chip-grid",onKeyDown:z=>N(z,"month"),children:Te()})]}),sb=()=>a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cny-datepicker-header",children:[a.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous decade",disabled:!jn,onClick:()=>be(z=>lr(z,-10)),children:a.jsx(Jo,{size:16,"aria-hidden":"true"})}),a.jsx("span",{className:"cny-datepicker-title",children:`${_t} – ${_t+9}`}),a.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next decade",disabled:!dn,onClick:()=>be(z=>lr(z,10)),children:a.jsx(Xn,{size:16,"aria-hidden":"true"})})]}),a.jsx("div",{role:"grid","aria-label":"Year picker",className:"cny-datepicker-chip-grid",onKeyDown:z=>N(z,"year"),children:$e()})]}),{className:ib,style:ab,styleTag:cb}=Ae(U,q,"cny-datepicker",`mode-${e}`,b&&"is-disabled",k);return a.jsx(ca,{open:Q,onOpenChange:z=>{z||me(!1)},children:a.jsxs("div",{ref:Oe,className:ib,style:ab,...Z,children:[cb,K&&a.jsx("input",{type:"hidden",name:K,value:he?he.toISOString():"",readOnly:!0}),a.jsx(qy,{asChild:!0,children:a.jsxs("button",{ref:pe,type:"button",id:G,className:Dr,"aria-haspopup":"dialog","aria-expanded":Q,"aria-controls":Q?ee:void 0,"aria-invalid":E||Ie,"aria-describedby":ne($,Ie?ce:void 0)||void 0,"aria-required":j||void 0,disabled:b,onClick:et,onKeyDown:z=>{z.key==="ArrowDown"||z.key==="Enter"||z.key===" "?(z.preventDefault(),et()):z.key==="Escape"&&Q&&(z.preventDefault(),me(!1))},children:[a.jsx("span",{className:"cny-datepicker-icon","aria-hidden":"true",children:W}),a.jsx("span",{className:ne("cny-datepicker-value",!he&&"is-placeholder"),children:Ye||Be}),x&&he&&!b&&a.jsx("span",{role:"button",tabIndex:-1,className:"cny-datepicker-clear","aria-label":"Clear",onClick:De,onPointerDown:z=>z.stopPropagation(),children:a.jsx(nn,{size:13,"aria-hidden":"true"})})]})}),Ie&&_!==!1&&a.jsx("span",{id:ce,className:"cny-datepicker-error",role:"alert",children:typeof _=="string"?_:_??Re}),Q&&Ce&&Sl.createPortal(a.jsxs(la,{id:ee,role:"dialog","aria-modal":"false","aria-label":ze,className:ne("cny-datepicker-panel",`is-${e}`),side:"bottom",align:"start",sideOffset:4,collisionPadding:8,onOpenAutoFocus:z=>{z.preventDefault(),At()},onCloseAutoFocus:z=>z.preventDefault(),onEscapeKeyDown:z=>z.preventDefault(),onInteractOutside:z=>{var xe;(xe=Oe.current)!=null&&xe.contains(z.target)&&z.preventDefault()},children:[e!=="time"&&l&&l.length>0&&a.jsx("div",{className:"cny-datepicker-presets",children:l.map(z=>a.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:Ir(z),onClick:()=>to(z),children:z.label},z.label))}),u&&(e==="date"||e==="datetime")&&a.jsx("input",{type:"text",className:"cny-datepicker-typed",value:zn,placeholder:"yyyy-mm-dd","aria-label":"Type a date (yyyy-mm-dd)","aria-invalid":Lo||void 0,inputMode:"numeric",onChange:z=>{Oo(z.target.value),Ar(!1)},onKeyDown:z=>{z.key==="Enter"?(z.preventDefault(),ar()):z.key==="Escape"&&(z.preventDefault(),Qe())}}),a.jsxs("div",{className:"cny-datepicker-body",children:[(e==="date"||e==="datetime")&&Se==="date"&&Mt(),(e==="date"||e==="datetime"||e==="month")&&Se==="month"&&cr(),(e==="date"||e==="datetime"||e==="month"||e==="year")&&Se==="year"&&sb(),e==="time"&&St(),e==="datetime"&&Se==="date"&&St()]}),a.jsxs("div",{className:"cny-datepicker-footer",children:[a.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:!Gn,onClick:Fo,children:e==="time"?"Now":e==="year"?"This year":e==="month"?"This month":"Today"}),a.jsx("div",{className:"cny-datepicker-footer-spacer"}),x&&he&&a.jsx("button",{type:"button",className:"cny-datepicker-action",onClick:()=>{We(null),Qe()},children:"Clear"}),(e==="datetime"||e==="time")&&a.jsx("button",{type:"button",className:"cny-datepicker-action is-primary",onClick:Qe,children:"Done"})]})]}),document.body)]})})}),lc=v.forwardRef(function({value:e,min:n,max:r,step:o,ariaLabel:s,nextRef:i,onChange:c},l){const u=v.useRef(null);v.useImperativeHandle(l,()=>u.current,[]);const[d,f]=v.useState(()=>ni(e)),h=v.useRef(!1);v.useEffect(()=>{h.current||f(ni(e))},[e]);const p=v.useCallback(y=>{if(!Number.isFinite(y))return;let w=Math.max(n,Math.min(r,y));w=Math.round(w/o)*o,w>r&&(w=Math.floor(r/o)*o),c(w),f(ni(w))},[n,r,o,c]),g=()=>{const y=e+o;p(y>r?n:y)},b=()=>{const y=e-o;p(y<n?Math.floor(r/o)*o:y)},x=y=>{switch(y.key){case"ArrowUp":y.preventDefault(),g();break;case"ArrowDown":y.preventDefault(),b();break;case"PageUp":y.preventDefault(),p(e+o*5);break;case"PageDown":y.preventDefault(),p(e-o*5);break;case"Home":y.preventDefault(),p(n);break;case"End":y.preventDefault(),p(r);break;case"Enter":y.preventDefault(),p(parseInt(d,10));break}};return a.jsxs("div",{className:"cny-dp-timefield",onWheel:y=>{document.activeElement===u.current&&(y.preventDefault(),y.deltaY<0?g():y.deltaY>0&&b())},children:[a.jsx("input",{ref:u,type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:2,className:"cny-dp-timefield-input",value:d,"aria-label":s,"aria-valuenow":e,"aria-valuemin":n,"aria-valuemax":r,onFocus:y=>{h.current=!0,y.target.select()},onChange:y=>{var C;const w=y.target.value.replace(/[^0-9]/g,"").slice(0,2);if(f(w),w.length===2){const S=parseInt(w,10);Number.isFinite(S)&&S>=n&&S<=r&&(p(S),(C=i==null?void 0:i.current)==null||C.focus())}},onBlur:()=>{h.current=!1;const y=parseInt(d,10);Number.isFinite(y)?p(y):f(ni(e))},onKeyDown:x}),a.jsxs("div",{className:"cny-dp-timefield-controls",children:[a.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Increment ${s.toLowerCase()}`,tabIndex:-1,onClick:g,onMouseDown:y=>y.preventDefault(),children:a.jsx(Rg,{size:10,"aria-hidden":"true"})}),a.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Decrement ${s.toLowerCase()}`,tabIndex:-1,onClick:b,onMouseDown:y=>y.preventDefault(),children:a.jsx(bs,{size:10,"aria-hidden":"true"})})]})]})});function ma(){return v.useLayoutEffect(()=>{const t=document.activeElement,e=t instanceof HTMLElement&&t!==document.body?t:null;return()=>{e&&e.isConnected&&e.focus({preventScroll:!0})}},[]),null}const Jk='input:not([type="hidden"]):not(:disabled),select:not(:disabled),textarea:not(:disabled),[role="combobox"]:not([aria-disabled="true"]):not([data-disabled])',Qk='a[href],button:not(:disabled),[tabindex]:not([tabindex="-1"])';function Cv(t,e){if(t.defaultPrevented)return;const n=t.target,r=n==null?void 0:n.querySelector(e),o=(r==null?void 0:r.querySelector(Jk))??(r==null?void 0:r.querySelector(Qk));o&&(t.preventDefault(),o.focus())}function eA({hotkey:t=!0}={}){const[e,n]=v.useState(!1);return v.useEffect(()=>{if(!t)return;const r=o=>{o.key==="k"&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),n(s=>!s))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t]),{open:e,setOpen:n,toggle:()=>n(r=>!r)}}function tA(t){if(!t)return[];try{const e=JSON.parse(window.localStorage.getItem(t)??"[]");return Array.isArray(e)?e.filter(n=>typeof n=="string"):[]}catch{return[]}}function nA({open:t,onOpenChange:e,sections:n,placeholder:r="Search…",title:o="Command palette",description:s="Search and navigate. Use arrow keys to move, Enter to open, Escape to dismiss.",emptyText:i="No matches found.",footer:c,onItemSelect:l,contentClassName:u,recent:d,onRecentChange:f,persistRecentKey:h,recentLimit:p=5,recentTitle:g="Recent"}){const[b,x]=v.useState(""),[y,w]=v.useState(()=>tA(h)),C=d??y;v.useEffect(()=>{t||x("")},[t]);const S=v.useMemo(()=>[...n.filter(j=>j.pinned),...n.filter(j=>!j.pinned)],[n]),M=v.useMemo(()=>{const j=n.flatMap(A=>A.items);return C.map(A=>j.find(_=>_.id===A)).filter(A=>!!A&&!A.disabled).slice(0,p)},[n,C,p]),R=j=>{const A=[j,...C.filter(_=>_!==j)].slice(0,p);if(d===void 0&&(w(A),h))try{window.localStorage.setItem(h,JSON.stringify(A))}catch{}f==null||f(A)},P=j=>{var A;j.disabled||(R(j.id),(A=j.onSelect)==null||A.call(j),l==null||l(j),e(!1))},T=(j,A,_="")=>{var L;return a.jsxs(ut.Item,{value:`${A} ${j.label} ${((L=j.keywords)==null?void 0:L.join(" "))??""}`,disabled:j.disabled,onSelect:()=>P(j),className:ne("cny-cmdk-item",j.shortcut!=null&&"has-shortcut"),children:[j.icon&&a.jsx("span",{className:"cny-cmdk-item-icon",children:j.icon}),a.jsx("span",{className:"cny-cmdk-item-label",children:j.label}),j.badge&&a.jsx("span",{className:"cny-cmdk-item-badge",children:j.badge}),j.hint&&a.jsx("span",{className:"cny-cmdk-item-hint",children:j.hint}),j.shortcut!=null&&a.jsx("kbd",{className:"cny-cmdk-item-shortcut",children:j.shortcut})]},_+j.id)};return a.jsxs(ut.Dialog,{open:t,onOpenChange:e,label:o,contentClassName:ne("cny-cmdk-content",u),children:[a.jsx(ma,{}),a.jsxs(dy,{children:[a.jsx(Iu,{children:o}),a.jsx(Du,{children:s})]}),a.jsxs("div",{className:"cny-cmdk-header",children:[a.jsx(Dg,{size:16,"aria-hidden":"true"}),a.jsx(ut.Input,{placeholder:r,value:b,onValueChange:x}),a.jsx("kbd",{className:"cny-cmdk-esc",children:"Esc"})]}),a.jsxs(ut.List,{className:"cny-cmdk-list",children:[a.jsx(ut.Empty,{className:"cny-cmdk-empty",children:a.jsx("div",{role:"status",children:i})}),b===""&&M.length>0&&a.jsx(ut.Group,{heading:g,className:"cny-cmdk-group is-recent",children:M.map(j=>T(j,g,"recent-"))}),S.map(j=>a.jsx(ut.Group,{heading:j.title,className:ne("cny-cmdk-group",j.pinned&&"is-pinned"),children:j.items.map(A=>T(A,j.title))},j.title))]}),c!==!1&&a.jsx("div",{className:"cny-cmdk-footer",children:c??a.jsxs(a.Fragment,{children:[a.jsx("kbd",{children:"↑↓"})," navigate",a.jsx("kbd",{children:"↵"})," open",a.jsx("kbd",{children:"Esc"})," dismiss"]})})]})}function rA({onClick:t,label:e="Search…",shortcut:n="⌘K",className:r}){return a.jsxs("button",{type:"button",onClick:t,className:ne("cny-cmdk-trigger",r),"aria-label":"Open command palette",children:[a.jsx(Dg,{size:14,"aria-hidden":"true"}),a.jsx("span",{className:"cny-cmdk-trigger-label",children:e}),a.jsx("kbd",{className:"cny-cmdk-trigger-kbd",children:n})]})}let oA=0;const sA=()=>`cny-toast-${Date.now().toString(36)}-${++oA}`,Sv=v.createContext(null),iA={default:null,success:a.jsx(jg,{size:16,"aria-hidden":"true"}),info:a.jsx(kg,{size:16,"aria-hidden":"true"}),warning:a.jsx($g,{size:16,"aria-hidden":"true"}),danger:a.jsx(au,{size:16,"aria-hidden":"true"}),loading:a.jsx(Ag,{size:16,"aria-hidden":"true",className:"cny-toast-spin"})},aA=80,cA=t=>typeof t=="object"&&t!==null&&!v.isValidElement(t)&&"onClick"in t&&"label"in t;function lA({children:t,position:e="bottom-right",defaultDuration:n=5e3,maxToasts:r=5,limit:o,offset:s="1rem"}){const i=o??r,[c,l]=v.useState([]),[u,d]=v.useState(!1);v.useEffect(()=>d(!0),[]);const f=v.useCallback(y=>{l(w=>w.map(C=>y==null||C.id===y?{...C,exiting:!0}:C)),window.setTimeout(()=>{l(w=>w.filter(C=>y==null?!1:C.id!==y||!C.exiting)),l(w=>(w.filter(C=>C.exiting&&(y==null||C.id===y)).forEach(C=>{var S;return(S=C.onDismiss)==null?void 0:S.call(C)}),w.filter(C=>!C.exiting||y!=null&&C.id!==y)))},200)},[]),h=v.useCallback(y=>{const w=y.id??sA(),C={id:w,title:y.title,description:y.description,action:y.action,icon:y.icon,variant:y.variant??"default",duration:y.duration??n,dismissible:y.dismissible??!0,onDismiss:y.onDismiss,sx:y.sx};return l(S=>{const R=[...S.filter(P=>P.id!==w),C];return R.length>i?R.slice(R.length-i):R}),w},[n,i]),p=v.useCallback((y,w)=>{l(C=>C.map(S=>S.id===y?{...S,...w,variant:w.variant??S.variant,duration:w.duration??S.duration,dismissible:w.dismissible??S.dismissible}:S))},[]),g=v.useMemo(()=>{const y=(w=>h(typeof w=="string"?{title:w}:w));return y.success=(w,C)=>h({...C,title:w,variant:"success"}),y.info=(w,C)=>h({...C,title:w,variant:"info"}),y.warning=(w,C)=>h({...C,title:w,variant:"warning"}),y.error=(w,C)=>h({...C,title:w,variant:"danger"}),y.loading=(w,C)=>h({...C,title:w,variant:"loading",duration:(C==null?void 0:C.duration)??1/0}),y},[h]),b=v.useMemo(()=>({toast:g,dismiss:f,update:p}),[g,f,p]),x=e.startsWith("top-");return a.jsxs(Sv.Provider,{value:b,children:[t,u&&Sl.createPortal(a.jsx("div",{role:"region","aria-label":"Notifications",className:ne("cny-toast-viewport",`pos-${e}`),style:{"--cny-toast-offset":s},"aria-live":"polite","aria-relevant":"additions",tabIndex:-1,children:(x?[...c].reverse():c).map(y=>a.jsx(uA,{toast:y,onDismiss:()=>f(y.id)},y.id))}),document.body)]})}function uA({toast:t,onDismiss:e}){const{variant:n,title:r,description:o,action:s,icon:i,duration:c,dismissible:l,sx:u}=t,[d,f]=v.useState(!1),h=v.useRef(null),p=v.useRef(null),g=(M,R)=>{M.style.transform=R?`translateX(${R}px)`:"",M.style.opacity=R?String(Math.max(.3,1-Math.abs(R)/200)):"",M.style.transition=R?"none":""};v.useEffect(()=>{if(!t.exiting&&!(!Number.isFinite(c)||c<0)&&!d)return h.current=setTimeout(e,c),()=>{h.current&&clearTimeout(h.current)}},[d,c,e,t.exiting]);const b=n==="danger"||n==="warning"?"alert":"status",x=i!==!1,y=i!==void 0&&i!==!1?i:iA[n],{className:w,style:C,styleTag:S}=Ae(u,void 0,"cny-toast",n,t.exiting&&"is-exiting");return a.jsxs("div",{role:b,"aria-atomic":"true",className:w,style:C,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),onPointerDown:M=>{M.pointerType==="touch"&&l&&(p.current={x:M.clientX,id:M.pointerId},f(!0))},onPointerMove:M=>{p.current&&p.current.id===M.pointerId&&g(M.currentTarget,M.clientX-p.current.x)},onPointerUp:M=>{if(!p.current||p.current.id!==M.pointerId)return;const R=M.clientX-p.current.x;p.current=null,f(!1),Math.abs(R)>aA?e():g(M.currentTarget,0)},onPointerCancel:M=>{p.current=null,f(!1),g(M.currentTarget,0)},children:[S,x&&y&&a.jsx("span",{className:"cny-toast-icon","aria-hidden":"true",children:y}),a.jsxs("div",{className:"cny-toast-body",children:[r!=null&&a.jsx("p",{className:"cny-toast-title",children:r}),o!=null&&a.jsx("p",{className:"cny-toast-description",children:o})]}),s!=null&&a.jsx("div",{className:"cny-toast-action",children:cA(s)?a.jsx("button",{type:"button",className:"cny-toast-action-btn",onClick:()=>{s.onClick(),e()},children:s.label}):s}),l&&a.jsx("button",{type:"button",className:"cny-toast-close","aria-label":typeof r=="string"?`Dismiss ${r}`:"Dismiss",onClick:e,children:a.jsx(nn,{size:14,"aria-hidden":"true"})})]})}function dA(){const t=v.useContext(Sv);if(!t)throw new Error("useToast() must be called inside a <ToastProvider>. Wrap your app at the root.");return t}function Mv({open:t,defaultOpen:e,onOpenChange:n,dirty:r,onBeforeClose:o}){const[s,i]=v.useState(!!e),c=t!==void 0,l=c?t:s,u=r===!0||r===void 0&&!!o,d=v.useCallback(h=>{c||i(h),n==null||n(h)},[c,n]),f=v.useCallback(h=>{if(h||!u)return d(h);if(!o)return;const p=o();p instanceof Promise?p.then(g=>{g!==!1&&d(!1)}):p!==!1&&d(!1)},[u,o,d]);return{open:l,onOpenChange:f}}const Rv=v.forwardRef(function({title:e,description:n,children:r,footer:o,size:s="md",hideClose:i,className:c,style:l,sx:u,dirty:d,onBeforeClose:f,onOpenAutoFocus:h,open:p,defaultOpen:g,onOpenChange:b,...x},y){const{className:w,style:C,styleTag:S}=Ae(u,l,"cny-dialog-content",`size-${s}`,c),M=Mv({open:p,defaultOpen:g,onOpenChange:b,dirty:d,onBeforeClose:f});return a.jsx(Nu,{...x,open:M.open,onOpenChange:M.onOpenChange,children:a.jsxs(Eu,{children:[a.jsx(ku,{className:"cny-dialog-overlay"}),a.jsxs(Au,{ref:y,className:w,style:C,onOpenAutoFocus:R=>{h==null||h(R),Cv(R,".cny-dialog-body")},children:[a.jsx(ma,{}),S,a.jsxs("header",{className:"cny-dialog-header",children:[a.jsxs("div",{className:"cny-dialog-titles",children:[a.jsx(Iu,{className:"cny-dialog-title",children:e}),n&&a.jsx(Du,{className:"cny-dialog-description",children:n})]}),!i&&a.jsx(ua,{className:"cny-dialog-close","aria-label":"Close dialog",children:a.jsx(nn,{size:16,"aria-hidden":"true"})})]}),r!=null&&a.jsx("div",{className:"cny-dialog-body",children:r}),o!=null&&a.jsx("footer",{className:"cny-dialog-footer",children:o})]})]})})}),fA=Qy,hA=ua;function Tv({open:t,onOpenChange:e,title:n,message:r,children:o,confirmLabel:s="Confirm",cancelLabel:i="Cancel",danger:c=!1,loading:l=!1,requireText:u,onConfirm:d,onCancel:f,className:h,style:p,sx:g}){const b=v.useRef(null),x=v.useRef(null),y=v.useId(),[w,C]=v.useState("");v.useEffect(()=>{t||C("")},[t]);const S=u!=null&&w!==u;v.useLayoutEffect(()=>{var P;const R=x.current;l&&R&&!R.contains(document.activeElement)?R.focus({preventScroll:!0}):l&&R&&((P=document.activeElement)!=null&&P.matches(":disabled"))&&R.focus({preventScroll:!0})},[l]);const M=()=>{f==null||f(),e(!1)};return a.jsxs(Rv,{ref:x,open:t,onOpenChange:e,size:"sm",title:n,className:ne("cny-confirm",h),style:p,sx:g,onOpenAutoFocus:c||u!=null?R=>{var P;R.preventDefault(),(P=b.current)==null||P.focus()}:void 0,footer:a.jsxs(a.Fragment,{children:[a.jsx(Ur,{ref:b,variant:"ghost",color:"primary",onClick:M,disabled:l,children:i}),a.jsx(Ur,{variant:"solid",color:c?"danger":"primary",loading:l,disabled:S,onClick:d,children:s})]}),children:[o??a.jsx("p",{className:"cny-confirm-message",children:r}),u!=null&&a.jsxs("div",{className:"cny-confirm-require",children:[a.jsxs("label",{htmlFor:y,className:"cny-confirm-require-label",children:["Type ",a.jsx("strong",{children:u})," to confirm"]}),a.jsx(_g,{id:y,value:w,onChange:R=>C(R.target.value),autoComplete:"off",disabled:l})]})]})}function pA(){const[t,e]=v.useState(null),n=v.useCallback(i=>new Promise(c=>{e({...i,resolve:c})}),[]),r=v.useCallback(i=>{i||e(c=>(c==null||c.resolve(!1),null))},[]),o=v.useCallback(()=>{e(i=>(i==null||i.resolve(!0),null))},[]),s=t?a.jsx(Tv,{open:!0,onOpenChange:r,title:t.title,message:t.message,confirmLabel:t.confirmLabel,cancelLabel:t.cancelLabel,danger:t.danger,onConfirm:o}):null;return{confirm:n,confirmDialog:s}}const mA=v.forwardRef(function({title:e,description:n,children:r,footer:o,side:s="right",size:i="md",hideClose:c,className:l,style:u,sx:d,dirty:f,onBeforeClose:h,onOpenAutoFocus:p,swipeToClose:g,open:b,defaultOpen:x,onOpenChange:y,...w},C){const{className:S,style:M,styleTag:R}=Ae(d,u,"cny-drawer-content",`side-${s}`,`size-${i}`,l),P=Mv({open:b,defaultOpen:x,onOpenChange:y,dirty:f,onBeforeClose:h}),T=v.useRef(null),j=s==="left"||s==="right"?"x":"y",A=s==="right"||s==="bottom"?1:-1,_=k=>A*(j==="x"?k.clientX-T.current.x:k.clientY-T.current.y),L=(k,q)=>{k.style.transform=q?`translate${j.toUpperCase()}(${A*q}px)`:"",k.style.transition=q?"none":""},I=g?{onPointerDown:k=>{if(k.pointerType!=="touch")return;const q=k.target.closest(".cny-drawer-body");q&&j==="y"&&q.scrollTop>0||(T.current={x:k.clientX,y:k.clientY,id:k.pointerId})},onPointerMove:k=>{!T.current||T.current.id!==k.pointerId||L(k.currentTarget,Math.max(0,_(k)))},onPointerUp:k=>{if(!T.current||T.current.id!==k.pointerId)return;const q=j==="x"?k.currentTarget.offsetWidth:k.currentTarget.offsetHeight,U=_(k);T.current=null,L(k.currentTarget,0),U>Math.min(80,q*.3)&&P.onOpenChange(!1)},onPointerCancel:k=>{T.current=null,L(k.currentTarget,0)}}:void 0;return a.jsx(Nu,{...w,open:P.open,onOpenChange:P.onOpenChange,children:a.jsxs(Eu,{children:[a.jsx(ku,{className:"cny-drawer-overlay"}),a.jsxs(Au,{ref:C,className:S,style:M,onOpenAutoFocus:k=>{p==null||p(k),Cv(k,".cny-drawer-body")},...I,children:[a.jsx(ma,{}),R,a.jsxs("header",{className:"cny-drawer-header",children:[a.jsxs("div",{className:"cny-drawer-titles",children:[a.jsx(Iu,{className:"cny-drawer-title",children:e}),n&&a.jsx(Du,{className:"cny-drawer-description",children:n})]}),!c&&a.jsx(ua,{className:"cny-drawer-close","aria-label":"Close drawer",children:a.jsx(nn,{size:16,"aria-hidden":"true"})})]}),r!=null&&a.jsx("div",{className:"cny-drawer-body",children:r}),o!=null&&a.jsx("footer",{className:"cny-drawer-footer",children:o})]})]})})}),gA=Qy,yA=ua;var vA=Object.defineProperty,Ke=(t,e)=>vA(t,"name",{value:e,configurable:!0}),ml=["Enter"," "],xA=["ArrowDown","PageUp","Home"],jv=["ArrowUp","PageDown","End"],bA=[...xA,...jv],wA={ltr:[...ml,"ArrowRight"],rtl:[...ml,"ArrowLeft"]},CA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ga="Menu",[ls,SA,MA]=No(ga),[Xr,ya]=dt(ga,[MA,Mr,Sr]),va=Mr(),Pv=Sr(),[Nv,Pr]=Xr(ga),[RA,ks]=Xr(ga),TA=Ke(t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=t,c=va(e),[l,u]=m.useState(null),d=m.useRef(!1),f=zt(s),h=or(o);return m.useEffect(()=>{const p=Ke(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=Ke(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),m.useEffect(()=>{if(!n)return;const p=Ke(()=>f(!1),"handleBlur");return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[n,f]),a.jsx(Ss,{...c,children:a.jsx(Nv,{scope:e,open:n,onOpenChange:f,content:l,onContentChange:u,children:a.jsx(RA,{scope:e,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})},"Menu"),Ev=m.forwardRef(Ke(function(e,n){const{__scopeMenu:r,...o}=e,s=va(r);return a.jsx(Ms,{...s,...o,ref:n})},"MenuAnchor")),kv="MenuPortal",[jA,Av]=Xr(kv,{forceMount:void 0}),PA=Ke(t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=Pr(kv,e);return a.jsx(jA,{scope:e,forceMount:n,children:a.jsx($t,{present:n||s.open,children:a.jsx(Rs,{asChild:!0,container:o,children:r})})})},"MenuPortal"),yn="MenuContent",[NA,Gu]=Xr(yn),EA=m.forwardRef(Ke(function(e,n){const r=Av(yn,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,i=Pr(yn,e.__scopeMenu),c=ks(yn,e.__scopeMenu);return a.jsx(ls.Provider,{scope:e.__scopeMenu,children:a.jsx($t,{present:o||i.open,children:a.jsx(ls.Slot,{scope:e.__scopeMenu,children:c.modal?a.jsx(kA,{...s,ref:n}):a.jsx(AA,{...s,ref:n})})})})},"MenuContent")),kA=m.forwardRef(Ke(function(e,n){const r=Pr(yn,e.__scopeMenu),o=m.useRef(null),s=_e(n,o);return m.useEffect(()=>{const i=o.current;if(i)return oa(i)},[]),a.jsx(zu,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ge(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),AA=m.forwardRef(Ke(function(e,n){const r=Pr(yn,e.__scopeMenu);return a.jsx(zu,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),IA=vn("MenuContent.ScrollLock"),zu=m.forwardRef(Ke(function(e,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:g,disableOutsideScroll:b,...x}=e,y=Pr(yn,r),w=ks(yn,r),C=va(r),S=Pv(r),M=SA(r),[R,P]=m.useState(null),T=m.useRef(null),j=_e(n,T,y.onContentChange),A=m.useRef(0),_=m.useRef(""),L=m.useRef(0),I=m.useRef(null),k=m.useRef("right"),q=m.useRef(0),U=b?js:m.Fragment,E=b?{as:IA,allowPinchZoom:!0}:void 0,$=Ke(K=>{var G,ee;const ue=_.current+K,D=M().filter(ce=>!ce.disabled),Z=document.activeElement,F=(G=D.find(ce=>ce.ref.current===Z))==null?void 0:G.textValue,V=D.map(ce=>ce.textValue),H=Vv(V,ue,F),Y=(ee=D.find(ce=>ce.textValue===H))==null?void 0:ee.ref.current;Ke((function ce(se){_.current=se,window.clearTimeout(A.current),se!==""&&(A.current=window.setTimeout(()=>ce(""),1e3))}),"updateSearch")(ue),Y&&setTimeout(()=>Y.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(A.current),[]),Do();const X=m.useCallback(K=>{var D,Z;return k.current===((D=I.current)==null?void 0:D.side)&&Uv(K,(Z=I.current)==null?void 0:Z.area)},[]);return a.jsx(NA,{scope:r,searchRef:_,onItemEnter:m.useCallback(K=>{X(K)&&K.preventDefault()},[X]),onItemLeave:m.useCallback(K=>{var ue;X(K)||((ue=T.current)==null||ue.focus(),P(null))},[X]),onTriggerLeave:m.useCallback(K=>{X(K)&&K.preventDefault()},[X]),pointerGraceTimerRef:L,onPointerGraceIntentChange:m.useCallback(K=>{I.current=K},[]),children:a.jsx(U,{...E,children:a.jsx(ra,{asChild:!0,trapped:s,onMountAutoFocus:ge(i,K=>{var ue;K.preventDefault(),(ue=T.current)==null||ue.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:a.jsx(ws,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:g,children:a.jsx(Yi,{asChild:!0,...S,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:P,onEntryFocus:ge(u,K=>{w.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(ta,{role:"menu","aria-orientation":"vertical","data-state":Ku(y.open),"data-radix-menu-content":"",dir:w.dir,...C,...x,ref:j,style:{outline:"none",...x.style},onKeyDown:ge(x.onKeyDown,K=>{const D=K.target.closest("[data-radix-menu-content]")===K.currentTarget,Z=K.ctrlKey||K.altKey||K.metaKey,F=K.key.length===1;D&&(K.key==="Tab"&&K.preventDefault(),!Z&&F&&$(K.key));const V=T.current;if(K.target!==V||!bA.includes(K.key))return;K.preventDefault();const Y=M().filter(G=>!G.disabled).map(G=>G.ref.current);jv.includes(K.key)&&Y.reverse(),Lv(Y)}),onBlur:ge(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(A.current),_.current="")}),onPointerMove:ge(e.onPointerMove,So(K=>{const ue=K.target,D=q.current!==K.clientX;if(K.currentTarget.contains(ue)&&D){const Z=K.clientX>q.current?"right":"left";k.current=Z,q.current=K.clientX}}))})})})})})})},"MenuContentImpl")),DA=m.forwardRef(Ke(function(e,n){const{__scopeMenu:r,...o}=e;return a.jsx(Ne.div,{role:"group",...o,ref:n})},"MenuGroup")),$A=m.forwardRef(Ke(function(e,n){const{__scopeMenu:r,...o}=e;return a.jsx(Ne.div,{...o,ref:n})},"MenuLabel")),gl="MenuItem",kh="menu.itemSelect",Wu=m.forwardRef(Ke(function(e,n){const{disabled:r=!1,onSelect:o,...s}=e,i=m.useRef(null),c=ks(gl,e.__scopeMenu),l=Gu(gl,e.__scopeMenu),u=_e(n,i),d=m.useRef(!1),f=Ke(()=>{const h=i.current;if(!r&&h){const p=new CustomEvent(kh,{bubbles:!0,cancelable:!0});h.addEventListener(kh,g=>o==null?void 0:o(g),{once:!0}),ru(h,p),p.defaultPrevented?d.current=!1:c.onClose()}},"handleSelect");return a.jsx(Iv,{...s,ref:u,disabled:r,onClick:ge(e.onClick,f),onPointerDown:h=>{var p;(p=e.onPointerDown)==null||p.call(e,h),d.current=!0},onPointerUp:ge(e.onPointerUp,h=>{var p;d.current||(p=h.currentTarget)==null||p.click()}),onKeyDown:ge(e.onKeyDown,h=>{r||h.target!==h.currentTarget||l.searchRef.current!==""&&h.key===" "||ml.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),Iv=m.forwardRef(Ke(function(e,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=e,c=Gu(gl,r),l=Pv(r),u=m.useRef(null),d=_e(n,u),[f,h]=m.useState(!1),[p,g]=m.useState("");return m.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[i.children]),a.jsx(ls.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:a.jsx(Xi,{asChild:!0,...l,focusable:!o,children:a.jsx(Ne.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:ge(e.onPointerMove,So(b=>{o?c.onItemLeave(b):(c.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ge(e.onPointerLeave,So(b=>c.onItemLeave(b))),onFocus:ge(e.onFocus,()=>h(!0)),onBlur:ge(e.onBlur,()=>h(!1))})})})},"MenuItemImpl")),_A=m.forwardRef(Ke(function(e,n){const{checked:r=!1,onCheckedChange:o,...s}=e;return a.jsx($v,{scope:e.__scopeMenu,checked:r,children:a.jsx(Wu,{role:"menuitemcheckbox","aria-checked":us(r)?"mixed":r,...s,ref:n,"data-state":xa(r),onSelect:ge(s.onSelect,()=>o==null?void 0:o(us(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),OA="MenuRadioGroup",[LA,FA]=Xr(OA,{value:void 0,onValueChange:Ke(()=>{},"onValueChange")}),VA=m.forwardRef(Ke(function(e,n){const{value:r,onValueChange:o,...s}=e,i=zt(o);return a.jsx(LA,{scope:e.__scopeMenu,value:r,onValueChange:i,children:a.jsx(DA,{...s,ref:n})})},"MenuRadioGroup")),BA="MenuRadioItem",UA=m.forwardRef(Ke(function(e,n){const{value:r,...o}=e,s=FA(BA,e.__scopeMenu),i=r===s.value;return a.jsx($v,{scope:e.__scopeMenu,checked:i,children:a.jsx(Wu,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":xa(i),onSelect:ge(o.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Dv="MenuItemIndicator",[$v,HA]=Xr(Dv,{checked:!1}),GA=m.forwardRef(Ke(function(e,n){const{__scopeMenu:r,forceMount:o,...s}=e,i=HA(Dv,r);return a.jsx($t,{present:o||us(i.checked)||i.checked===!0,children:a.jsx(Ne.span,{...s,ref:n,"data-state":xa(i.checked)})})},"MenuItemIndicator")),zA=m.forwardRef(Ke(function(e,n){const{__scopeMenu:r,...o}=e;return a.jsx(Ne.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),_v="MenuSub",[WA,Ov]=Xr(_v),KA=Ke(t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,s=Pr(_v,e),i=va(e),[c,l]=m.useState(null),[u,d]=m.useState(null),f=zt(o);return m.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),a.jsx(Ss,{...i,children:a.jsx(Nv,{scope:e,open:r,onOpenChange:f,content:u,onContentChange:d,children:a.jsx(WA,{scope:e,contentId:Et(),triggerId:Et(),trigger:c,onTriggerChange:l,children:n})})})},"MenuSub"),ri="MenuSubTrigger",YA=m.forwardRef(Ke(function(e,n){const r=Pr(ri,e.__scopeMenu),o=ks(ri,e.__scopeMenu),s=Ov(ri,e.__scopeMenu),i=Gu(ri,e.__scopeMenu),c=m.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},f=m.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);m.useEffect(()=>f,[f]),m.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),u(null)}},[l,u]);const h=_e(n,s.onTriggerChange);return a.jsx(Ev,{asChild:!0,...d,children:a.jsx(Iv,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":Ku(r.open),...e,ref:h,onClick:p=>{var g;(g=e.onClick)==null||g.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ge(e.onPointerMove,So(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!r.open&&!c.current&&(i.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:ge(e.onPointerLeave,So(p=>{var b,x;f();const g=(b=r.content)==null?void 0:b.getBoundingClientRect();if(g){const y=(x=r.content)==null?void 0:x.dataset.side,w=y==="right",C=w?-5:5,S=g[w?"left":"right"],M=g[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+C,y:p.clientY},{x:S,y:g.top},{x:M,y:g.top},{x:M,y:g.bottom},{x:S,y:g.bottom}],side:y}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ge(e.onKeyDown,p=>{var b;e.disabled||p.target!==p.currentTarget||i.searchRef.current!==""&&p.key===" "||wA[o.dir].includes(p.key)&&(r.onOpenChange(!0),(b=r.content)==null||b.focus(),p.preventDefault())})})})},"MenuSubTrigger")),XA="MenuSubContent",qA=m.forwardRef(Ke(function(e,n){const r=Av(yn,e.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=e,c=Pr(yn,e.__scopeMenu),l=ks(yn,e.__scopeMenu),u=Ov(XA,e.__scopeMenu),d=m.useRef(null),f=_e(n,d);return a.jsx(ls.Provider,{scope:e.__scopeMenu,children:a.jsx($t,{present:o||c.open,children:a.jsx(ls.Slot,{scope:e.__scopeMenu,children:a.jsx(zu,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:f,align:s,side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var p;l.isUsingKeyboardRef.current&&((p=d.current)==null||p.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:ge(e.onFocusOutside,h=>{h.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:ge(e.onEscapeKeyDown,h=>{l.onClose(),h.preventDefault()}),onKeyDown:ge(e.onKeyDown,h=>{var b;const p=h.currentTarget.contains(h.target),g=CA[l.dir].includes(h.key);p&&g&&(c.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function Ku(t){return t?"open":"closed"}Ke(Ku,"getOpenState");function us(t){return t==="indeterminate"}Ke(us,"isIndeterminate");function xa(t){return us(t)?"indeterminate":t?"checked":"unchecked"}Ke(xa,"getCheckedState");function Lv(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}Ke(Lv,"focusFirst");function Fv(t,e){return t.map((n,r)=>t[(e+r)%t.length])}Ke(Fv,"wrapArray");function Vv(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=Fv(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}Ke(Vv,"getNextMatch");function Bv(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const c=e[s],l=e[i],u=c.x,d=c.y,f=l.x,h=l.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}Ke(Bv,"isPointInPolygon");function Uv(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Bv(n,e)}Ke(Uv,"isPointerInGraceArea");function So(t){return e=>e.pointerType==="mouse"?t(e):void 0}Ke(So,"whenMouse");var Hv=TA,Gv=Ev,zv=PA,Wv=EA,Kv=$A,Yv=Wu,Xv=_A,qv=VA,Zv=UA,Jv=GA,Qv=zA,ex=KA,tx=YA,nx=qA,ZA=Object.defineProperty,Wt=(t,e)=>ZA(t,"name",{value:e,configurable:!0}),Yu="DropdownMenu",[JA,L_]=dt(Yu,[ya]),Kt=ya(),[QA,rx]=JA(Yu),eI=Wt(t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:c=!0}=t,l=Kt(e),u=m.useRef(null),[d,f]=lt({prop:o,defaultProp:s??!1,onChange:i,caller:Yu});return a.jsx(QA,{scope:e,triggerId:Et(),triggerRef:u,contentId:Et(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:c,children:a.jsx(Hv,{...l,open:d,onOpenChange:f,dir:r,modal:c,children:n})})},"DropdownMenu"),tI="DropdownMenuTrigger",nI=m.forwardRef(Wt(function(e,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,i=rx(tI,r),c=Kt(r),l=_e(n,i.triggerRef);return a.jsx(Gv,{asChild:!0,...c,children:a.jsx(Ne.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:l,onPointerDown:ge(e.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:ge(e.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),rI=Wt(t=>{const{__scopeDropdownMenu:e,...n}=t,r=Kt(e);return a.jsx(zv,{...r,...n})},"DropdownMenuPortal"),oI="DropdownMenuContent",sI=m.forwardRef(Wt(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=rx(oI,r),i=Kt(r),c=m.useRef(!1);return a.jsx(Wv,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:ge(e.onCloseAutoFocus,l=>{var u;c.current||(u=s.triggerRef.current)==null||u.focus(),c.current=!1,l.preventDefault()}),onInteractOutside:ge(e.onInteractOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(c.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)"}})},"DropdownMenuContent")),iI=m.forwardRef(Wt(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Kt(r);return a.jsx(Kv,{...s,...o,ref:n})},"DropdownMenuLabel")),aI=m.forwardRef(Wt(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Kt(r);return a.jsx(Yv,{...s,...o,ref:n})},"DropdownMenuItem")),cI=m.forwardRef(Wt(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Kt(r);return a.jsx(Xv,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),lI=m.forwardRef(Wt(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Kt(r);return a.jsx(qv,{...s,...o,ref:n})},"DropdownMenuRadioGroup")),uI=m.forwardRef(Wt(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Kt(r);return a.jsx(Zv,{...s,...o,ref:n})},"DropdownMenuRadioItem")),dI=m.forwardRef(Wt(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Kt(r);return a.jsx(Jv,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),fI=m.forwardRef(Wt(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Kt(r);return a.jsx(Qv,{...s,...o,ref:n})},"DropdownMenuSeparator")),hI=Wt(t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:s}=t,i=Kt(e),[c,l]=lt({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return a.jsx(ex,{...i,open:c,onOpenChange:l,children:n})},"DropdownMenuSub"),pI=m.forwardRef(Wt(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Kt(r);return a.jsx(tx,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),mI=m.forwardRef(Wt(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=Kt(r);return a.jsx(nx,{...s,...o,ref:n,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)"}})},"DropdownMenuSubContent")),gI=eI,yI=nI,ox=rI,vI=sI,xI=iI,bI=aI,wI=cI,CI=lI,SI=uI,sx=dI,MI=fI,RI=hI,TI=pI,jI=mI;const ix=gI,ax=yI,cx=v.forwardRef(function({className:e,style:n,sx:r,size:o="md",sideOffset:s=6,children:i,...c},l){const{className:u,style:d,styleTag:f}=Ae(r,n,"cny-menu-content",`size-${o}`,e);return a.jsx(ox,{children:a.jsxs(vI,{ref:l,sideOffset:s,className:u,style:d,...c,children:[f,i]})})}),lx=v.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},c){return a.jsxs(bI,{ref:c,className:ne("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&a.jsx("span",{className:"cny-menu-item-icon",children:e}),a.jsx("span",{className:"cny-menu-item-label",children:s}),n&&a.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),PI=v.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return a.jsxs(wI,{ref:s,className:ne("cny-menu-item is-check",n),...o,children:[a.jsx("span",{className:"cny-menu-item-icon",children:a.jsx(sx,{children:a.jsx(yr,{size:13,"aria-hidden":"true"})})}),a.jsx("span",{className:"cny-menu-item-label",children:r}),e&&a.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),NI=CI,EI=v.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return a.jsxs(SI,{ref:s,className:ne("cny-menu-item is-radio",n),...o,children:[a.jsx("span",{className:"cny-menu-item-icon",children:a.jsx(sx,{children:a.jsx(Pg,{size:6,fill:"currentColor","aria-hidden":"true"})})}),a.jsx("span",{className:"cny-menu-item-label",children:r}),e&&a.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),kI=v.forwardRef(function({className:e,...n},r){return a.jsx(xI,{ref:r,className:ne("cny-menu-label",e),...n})}),AI=v.forwardRef(function({className:e,...n},r){return a.jsx(MI,{ref:r,className:ne("cny-menu-separator",e),...n})}),II=RI,DI=v.forwardRef(function({icon:e,className:n,children:r,...o},s){return a.jsxs(TI,{ref:s,className:ne("cny-menu-item is-sub",n),...o,children:[e&&a.jsx("span",{className:"cny-menu-item-icon",children:e}),a.jsx("span",{className:"cny-menu-item-label",children:r}),a.jsx("span",{className:"cny-menu-item-chevron",children:a.jsx(Xn,{size:13,"aria-hidden":"true"})})]})}),$I=v.forwardRef(function({className:e,...n},r){return a.jsx(ox,{children:a.jsx(jI,{ref:r,className:ne("cny-menu-content",e),...n})})});var _I=Object.defineProperty,kt=(t,e)=>_I(t,"name",{value:e,configurable:!0}),Xu="ContextMenu",[OI,F_]=dt(Xu,[ya]),Yt=ya(),[LI,ux]=OI(Xu),FI=kt(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,dir:s,modal:i=!0}=t,c=m.useRef(!1),[l,u]=lt({prop:o,defaultProp:!1,onChange:r,caller:Xu}),d=Yt(e);return a.jsx(LI,{scope:e,open:l,onOpenChange:u,modal:i,hasInteractedRef:c,children:a.jsx(Hv,{...d,dir:s,open:l,onOpenChange:u,modal:i,children:n})})},"ContextMenu"),VI="ContextMenuTrigger",BI=m.forwardRef(kt(function(e,n){const{__scopeContextMenu:r,disabled:o=!1,...s}=e,i=ux(VI,r),c=Yt(r),[l,u]=m.useState({x:0,y:0}),d=m.useMemo(()=>({current:{getBoundingClientRect:kt(()=>DOMRect.fromRect({width:0,height:0,...l}),"getBoundingClientRect")}}),[l]),f=m.useRef(0),h=m.useCallback(()=>window.clearTimeout(f.current),[]),p=kt(g=>{i.hasInteractedRef.current=!0,u({x:g.clientX,y:g.clientY}),i.onOpenChange(!0)},"handleOpen");return m.useEffect(()=>h,[h]),m.useEffect(()=>void(o&&h()),[o,h]),a.jsxs(a.Fragment,{children:[a.jsx(Gv,{...c,virtualRef:d}),a.jsx(Ne.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...s,ref:n,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:o?e.onContextMenu:ge(e.onContextMenu,g=>{h(),p(g),g.preventDefault()}),onPointerDown:o?e.onPointerDown:ge(e.onPointerDown,Yo(g=>{h(),i.open&&i.onOpenChange(!1),f.current=window.setTimeout(()=>p(g),700)})),onPointerMove:o?e.onPointerMove:ge(e.onPointerMove,Yo(h)),onPointerCancel:o?e.onPointerCancel:ge(e.onPointerCancel,Yo(h)),onPointerUp:o?e.onPointerUp:ge(e.onPointerUp,Yo(h))})]})},"ContextMenuTrigger")),UI=kt(t=>{const{__scopeContextMenu:e,...n}=t,r=Yt(e);return a.jsx(zv,{...r,...n})},"ContextMenuPortal"),HI="ContextMenuContent",GI=m.forwardRef(kt(function(e,n){const{__scopeContextMenu:r,...o}=e,s=ux(HI,r),i=Yt(r),c=m.useRef(!1);return a.jsx(Wv,{...i,...o,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{var u;(u=e.onCloseAutoFocus)==null||u.call(e,l),!l.defaultPrevented&&c.current&&l.preventDefault(),c.current=!1},onInteractOutside:l=>{var u;(u=e.onInteractOutside)==null||u.call(e,l),!l.defaultPrevented&&!s.modal&&(c.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),zI=m.forwardRef(kt(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Yt(r);return a.jsx(Kv,{...s,...o,ref:n})},"ContextMenuLabel")),WI=m.forwardRef(kt(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Yt(r);return a.jsx(Yv,{...s,...o,ref:n})},"ContextMenuItem")),KI=m.forwardRef(kt(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Yt(r);return a.jsx(Xv,{...s,...o,ref:n})},"ContextMenuCheckboxItem")),YI=m.forwardRef(kt(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Yt(r);return a.jsx(qv,{...s,...o,ref:n})},"ContextMenuRadioGroup")),XI=m.forwardRef(kt(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Yt(r);return a.jsx(Zv,{...s,...o,ref:n})},"ContextMenuRadioItem")),qI=m.forwardRef(kt(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Yt(r);return a.jsx(Jv,{...s,...o,ref:n})},"ContextMenuItemIndicator")),ZI=m.forwardRef(kt(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Yt(r);return a.jsx(Qv,{...s,...o,ref:n})},"ContextMenuSeparator")),JI="ContextMenuSub",QI=kt(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,defaultOpen:s}=t,i=Yt(e),[c,l]=lt({prop:o,defaultProp:s??!1,onChange:r,caller:JI});return a.jsx(ex,{...i,open:c,onOpenChange:l,children:n})},"ContextMenuSub"),eD=m.forwardRef(kt(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Yt(r);return a.jsx(tx,{...s,...o,ref:n})},"ContextMenuSubTrigger")),tD=m.forwardRef(kt(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Yt(r);return a.jsx(nx,{...s,...o,ref:n,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function Yo(t){return e=>e.pointerType!=="mouse"?t(e):void 0}kt(Yo,"whenTouchOrPen");var nD=FI,rD=BI,dx=UI,oD=GI,sD=zI,iD=WI,aD=KI,cD=YI,lD=XI,fx=qI,uD=ZI,dD=QI,fD=eD,hD=tD;const pD=nD,mD=v.forwardRef(function({onKeyDown:e,tabIndex:n=0,...r},o){const s=rD;return a.jsx(s,{ref:o,tabIndex:n,onKeyDown:i=>{if(e==null||e(i),!i.defaultPrevented&&(i.key==="ContextMenu"||i.key==="F10"&&i.shiftKey)){i.preventDefault();const c=i.currentTarget,l=c.getBoundingClientRect();c.dispatchEvent(new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,button:2,clientX:l.left+Math.min(l.width/2,24),clientY:l.top+Math.min(l.height/2,24)}))}},...r})}),gD=v.forwardRef(function({className:e,style:n,sx:r,size:o="md",alignOffset:s=-4,children:i,...c},l){const{className:u,style:d,styleTag:f}=Ae(r,n,"cny-menu-content",`size-${o}`,e);return a.jsx(dx,{children:a.jsxs(oD,{ref:l,className:u,style:d,alignOffset:s,...c,children:[a.jsx(ma,{}),f,i]})})}),yD=v.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},c){return a.jsxs(iD,{ref:c,className:ne("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&a.jsx("span",{className:"cny-menu-item-icon",children:e}),a.jsx("span",{className:"cny-menu-item-label",children:s}),n&&a.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),vD=v.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return a.jsxs(aD,{ref:s,className:ne("cny-menu-item is-check",n),...o,children:[a.jsx("span",{className:"cny-menu-item-icon",children:a.jsx(fx,{children:a.jsx(yr,{size:13,"aria-hidden":"true"})})}),a.jsx("span",{className:"cny-menu-item-label",children:r}),e&&a.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),xD=cD,bD=v.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return a.jsxs(lD,{ref:s,className:ne("cny-menu-item is-radio",n),...o,children:[a.jsx("span",{className:"cny-menu-item-icon",children:a.jsx(fx,{children:a.jsx(Pg,{size:6,fill:"currentColor","aria-hidden":"true"})})}),a.jsx("span",{className:"cny-menu-item-label",children:r}),e&&a.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),wD=v.forwardRef(function({className:e,...n},r){return a.jsx(sD,{ref:r,className:ne("cny-menu-label",e),...n})}),CD=v.forwardRef(function({className:e,...n},r){return a.jsx(uD,{ref:r,className:ne("cny-menu-separator",e),...n})}),SD=dD,MD=v.forwardRef(function({icon:e,className:n,children:r,...o},s){return a.jsxs(fD,{ref:s,className:ne("cny-menu-item is-sub",n),...o,children:[e&&a.jsx("span",{className:"cny-menu-item-icon",children:e}),a.jsx("span",{className:"cny-menu-item-label",children:r}),a.jsx("span",{className:"cny-menu-item-chevron",children:a.jsx(Xn,{size:13,"aria-hidden":"true"})})]})}),RD=v.forwardRef(function({className:e,...n},r){return a.jsx(dx,{children:a.jsx(hD,{ref:r,className:ne("cny-menu-content",e),...n})})}),qu=v.createContext(null),hx=({openOnHover:t,openDelay:e=300,closeDelay:n=150,open:r,defaultOpen:o,onOpenChange:s,children:i,...c})=>{const[l,u]=v.useState(!!o),d=v.useRef(void 0),f=r??l,h=v.useCallback(b=>{u(b),s==null||s(b)},[s]),p=v.useCallback((b,x,y)=>{clearTimeout(d.current),y||x<=0?h(b):d.current=setTimeout(()=>h(b),x)},[h]);v.useEffect(()=>()=>clearTimeout(d.current),[]);const g=a.jsx(ca,{...c,open:f,onOpenChange:h,children:i});return t?a.jsx(qu.Provider,{value:{schedule:p,openDelay:e,closeDelay:n},children:g}):g},px=v.forwardRef(function({onPointerEnter:e,onPointerLeave:n,onFocus:r,...o},s){const i=v.useContext(qu);return i?a.jsx(Oi,{ref:s,...o,onPointerEnter:c=>{e==null||e(c),c.pointerType==="mouse"&&i.schedule(!0,i.openDelay)},onPointerLeave:c=>{n==null||n(c),c.pointerType==="mouse"&&i.schedule(!1,i.closeDelay)},onFocus:c=>{r==null||r(c);let l=!1;try{l=c.currentTarget.matches(":focus-visible")}catch{}l&&i.schedule(!0,0,!0)}}):a.jsx(Oi,{ref:s,onPointerEnter:e,onPointerLeave:n,onFocus:r,...o})}),TD=qy,jD=cE,mx=v.forwardRef(function({className:e,style:n,sx:r,withArrow:o=!1,sideOffset:s=8,children:i,onPointerEnter:c,onPointerLeave:l,onOpenAutoFocus:u,...d},f){const h=v.useContext(qu),{className:p,style:g,styleTag:b}=Ae(r,n,"cny-popover-content",e);return a.jsx(ju,{children:a.jsxs(la,{ref:f,sideOffset:s,className:p,style:g,...d,onOpenAutoFocus:h?x=>x.preventDefault():u,onPointerEnter:x=>{c==null||c(x),h&&x.pointerType==="mouse"&&h.schedule(!0,0,!0)},onPointerLeave:x=>{l==null||l(x),h&&x.pointerType==="mouse"&&h.schedule(!1,h.closeDelay)},children:[b,i,o&&a.jsx(lE,{className:"cny-popover-arrow",width:12,height:6})]})})}),PD=v.forwardRef(function({color:e="default",variant:n="soft",size:r="md",icon:o,avatar:s,onDelete:i,deleteLabel:c="Remove",onClick:l,disabled:u,className:d,style:f,sx:h,children:p,...g},b){const x=!u&&l!=null,y=!u&&i!=null,{className:w,style:C,styleTag:S}=Ae(h,f,"cny-chip",e,n,r==="sm"&&"sm",x&&"is-interactive",u&&"is-disabled",d);return a.jsxs("span",{ref:b,role:x?"button":void 0,tabIndex:x||y?0:void 0,"aria-disabled":u||void 0,onClick:u?void 0:l,onKeyDown:x||y?M=>{M.target===M.currentTarget&&(y&&(M.key==="Delete"||M.key==="Backspace")?(M.preventDefault(),i==null||i(M)):x&&(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),l==null||l(M)))}:void 0,className:w,style:C,...g,children:[S,s&&a.jsx("span",{className:"cny-chip-avatar",children:s}),o&&a.jsx("span",{className:"cny-chip-icon",children:o}),a.jsx("span",{className:"cny-chip-label",children:p}),i&&!u&&a.jsx("button",{type:"button",className:"cny-chip-delete","aria-label":c,tabIndex:-1,onClick:M=>{M.stopPropagation(),i(M)},children:a.jsx(nn,{size:r==="sm"?11:13,"aria-hidden":"true"})})]})}),ND=v.forwardRef(function({count:e,dot:n=!1,max:r=99,showZero:o=!1,color:s="danger",placement:i="top-right",standalone:c=!1,children:l,className:u,style:d,sx:f,...h},p){const g=typeof e=="number",b=g&&e>r?`${r}+`:e,y=!n&&(!g||e===0&&!o)?null:a.jsx("span",{className:ne("cny-badge-indicator",`cny-badge-${s}`,n&&"cny-badge-dot",!c&&`cny-badge-${i}`),children:n?null:b});if(c){const{className:M,style:R,styleTag:P}=Ae(f,d,"cny-badge-standalone",u);return a.jsxs("span",{ref:p,className:M,style:R,...h,children:[P,y]})}const{className:w,style:C,styleTag:S}=Ae(f,d,"cny-badge-anchor",u);return a.jsxs("span",{ref:p,className:w,style:C,...h,children:[S,l,y]})}),ED=v.forwardRef(function({position:e="right",orientation:n="vertical",size:r="md",navigable:o=!1,loading:s=!1,empty:i,className:c,style:l,sx:u,children:d,onKeyDown:f,...h},p){const g=v.useRef(null),b=n==="horizontal",{ref:x,overflowing:y}=cu(b&&!o),w=T=>{g.current=T,x(T),typeof p=="function"?p(T):p&&(p.current=T)},C=n==="horizontal";v.useEffect(()=>{if(!o||!g.current)return;const T=Array.from(g.current.querySelectorAll(":scope > .cny-timeline-item")),j=T.find(A=>A.tabIndex===0)??T[0];T.forEach(A=>A.setAttribute("tabindex",A===j?"0":"-1"))});const S=T=>{if(f==null||f(T),!o||T.defaultPrevented)return;const j=Array.from(T.currentTarget.querySelectorAll(":scope > .cny-timeline-item")),A=j.indexOf(T.target);if(A<0)return;const _=C?"ArrowLeft":"ArrowUp",L=C?"ArrowRight":"ArrowDown";let I=-1;if(T.key===_?I=A-1:T.key===L?I=A+1:T.key==="Home"?I=0:T.key==="End"&&(I=j.length-1),I<0)return;T.preventDefault();const k=j[Math.min(j.length-1,I)];j.forEach(q=>q.setAttribute("tabindex",q===k?"0":"-1")),k.focus()},{className:M,style:R,styleTag:P}=Ae(u,l,"cny-timeline",n==="horizontal"?"cny-timeline-horizontal":`cny-timeline-${e}`,r!=="md"&&`cny-timeline-${r}`,c);return a.jsxs("ol",{ref:w,className:M,style:R,"aria-busy":s||void 0,tabIndex:y?0:void 0,onKeyDown:S,...h,children:[P,s?[0,1,2].map(T=>a.jsxs("li",{className:"cny-timeline-item cny-timeline-skeleton",children:[a.jsxs("div",{className:"cny-timeline-separator",children:[a.jsx(jt,{shape:"avatar",width:12,height:12}),T<2&&a.jsx("span",{className:"cny-timeline-connector","aria-hidden":"true"})]}),a.jsxs("div",{className:"cny-timeline-content",children:[a.jsx(jt,{width:"40%"}),a.jsx(jt,{width:"70%"})]})]},T)):i!=null&&v.Children.count(d)===0?a.jsx("li",{className:"cny-timeline-empty",children:i}):d]})}),kD=v.forwardRef(function({className:e,...n},r){return a.jsx("li",{ref:r,className:ne("cny-timeline-item",e),...n})}),AD=v.forwardRef(function({className:e,...n},r){return a.jsx("div",{ref:r,className:ne("cny-timeline-separator",e),...n})}),ID=v.forwardRef(function({color:e="neutral",variant:n="filled",icon:r,active:o=!1,className:s,children:i,...c},l){const u=r??i;return a.jsx("span",{ref:l,className:ne("cny-timeline-dot",`cny-timeline-dot-${e}`,`cny-timeline-dot-${n}`,u!=null&&u!==!1&&"cny-timeline-dot-icon",o&&"cny-timeline-dot-active",s),...c,children:u})}),DD=v.forwardRef(function({color:e,lineStyle:n="solid",className:r,...o},s){return a.jsx("span",{ref:s,className:ne("cny-timeline-connector",e&&`cny-timeline-connector-${e}`,n!=="solid"&&`cny-timeline-connector-${n}`,r),"aria-hidden":"true",...o})}),$D=v.forwardRef(function({variant:e="plain",accentColor:n,className:r,...o},s){const i=e==="card"||e==="elevated";return a.jsx("div",{ref:s,className:ne("cny-timeline-content",i&&"cny-timeline-content-card",e==="elevated"&&"cny-timeline-content-elevated",n&&"cny-timeline-content-accent",n&&`cny-timeline-content-accent-${n}`,r),...o})}),_D=v.forwardRef(function({className:e,...n},r){return a.jsx("div",{ref:r,className:ne("cny-timeline-opposite-content",e),...n})}),OD=typeof window>"u"?v.useEffect:v.useLayoutEffect;function Zu({count:t,itemSize:e,enabled:n,scrollRef:r,offset:o=0,origin:s=o,overscan:i=6}){const[c,l]=v.useState(0),[u,d]=v.useState(0),f=v.useRef({itemSize:e,offset:o,origin:s});f.current={itemSize:e,offset:o,origin:s};const h=v.useCallback(()=>{const y=r.current;if(!y)return;const w=f.current;l(Math.max(0,Math.floor((y.scrollTop+w.offset-w.origin)/w.itemSize))),d(y.clientHeight)},[r]);OD(()=>{const y=r.current;if(!n||!y)return;h();let w=0;const C=()=>{w||(w=requestAnimationFrame(()=>{w=0,h()}))};y.addEventListener("scroll",C,{passive:!0});const S=typeof ResizeObserver<"u"?new ResizeObserver(h):null;return S==null||S.observe(y),()=>{y.removeEventListener("scroll",C),S==null||S.disconnect(),w&&cancelAnimationFrame(w)}},[n,r,h]);const p=Math.ceil((u||600)/e),g=n?Math.max(0,Math.min(c,Math.max(0,t-1))-i):0,b=n?Math.min(t,c+p+i):t,x=v.useCallback(y=>{const w=r.current;if(!w)return;const{itemSize:C,offset:S,origin:M}=f.current,R=M+y*C,P=R+C;R-S<w.scrollTop?w.scrollTop=R-S:P>w.scrollTop+w.clientHeight&&(w.scrollTop=P-w.clientHeight)},[r]);return{start:g,end:b,total:t*e,viewport:u,scrollToIndex:x}}const LD=200,FD=16;function gx(t,e,n=1,r=null,o=[]){const s=v.Children.toArray(t);for(let i=0;i<s.length;i++){const c=s[i];if(!v.isValidElement(c)||c.type!==ba)return null;const l=c,u=!!l.props.children,d=l.props.itemId;if(o.push({el:l,id:d,level:n,size:s.length,pos:i+1,hasChildren:u,parentId:r}),u&&e(d)&&gx(l.props.children,e,n+1,d,o)===null)return null}return o}function yx(t,e=[]){for(const n of v.Children.toArray(t)){if(!v.isValidElement(n))continue;const r=n;r.props.children&&(e.push(r.props.itemId),yx(r.props.children,e))}return e}function vx(t,e){const n=v.Children.toArray(t);return n.map((r,o)=>v.isValidElement(r)&&r.type===ba?v.cloneElement(r,{_meta:{level:e,size:n.length,pos:o+1}}):r)}function VD(t){for(let e=t;e&&e!==document.body;e=e.parentElement)if(/(auto|scroll|overlay)/.test(getComputedStyle(e).overflowY))return e;return null}const xx=v.createContext(null);function BD(){const t=v.useContext(xx);if(!t)throw new Error("TreeItem must be used within a <TreeView>.");return t}const bx=v.forwardRef(function({expandedIds:e,defaultExpandedIds:n,onExpandedChange:r,selectedId:o,defaultSelectedId:s=null,onSelectedChange:i,onItemExpandToggle:c,defaultIcons:l=!0,expandControls:u=!1,persistKey:d,virtualize:f="auto",itemHeight:h=30,loading:p=!1,empty:g,className:b,style:x,sx:y,children:w,...C},S){var pe;const[M,R]=v.useState(n??[]),[P,T]=v.useState(s),[j,A]=v.useState(null),_=v.useRef(new Set),L=v.useCallback(O=>(_.current.add(O),()=>{_.current.delete(O)}),[]),I=v.useRef(!1),k=d?`cny-tree:${d}`:null,q=v.useRef(!1);v.useEffect(()=>{if(!(!k||e!==void 0)){try{const O=window.localStorage.getItem(k),ae=O?JSON.parse(O):null;Array.isArray(ae)&&R(ae.filter(Ce=>typeof Ce=="string"))}catch{}q.current=!0}},[k]),v.useEffect(()=>{if(!(!k||!q.current||e!==void 0))try{window.localStorage.setItem(k,JSON.stringify(M))}catch{}},[k,M,e]);const U=e??M,E=o!==void 0?o:P,$=v.useMemo(()=>new Set(U),[U]),X=v.useCallback(O=>$.has(O),[$]),K=v.useCallback(O=>{const ae=!$.has(O),Ce=ae?[...U,O]:U.filter(Le=>Le!==O);e===void 0&&R(Ce),r==null||r(Ce),c==null||c(O,ae)},[U,$,e,r,c]),ue=v.useCallback(O=>{e===void 0&&R(O),r==null||r(O)},[e,r]),D=v.useRef(!1),Z=v.useRef(null);Z.current=w;const F=()=>{if(D.current){ue(yx(Z.current));return}I.current=!0,ue([..._.current])},V=()=>{I.current=!1,ue([])};v.useEffect(()=>{if(!I.current)return;const O=[..._.current].filter(ae=>!$.has(ae));O.length===0?I.current=!1:ue([...U,...O])});const H=v.useCallback(O=>{o===void 0&&T(O),i==null||i(O)},[o,i]),Y=v.useRef(null),G=!p&&!(g!=null&&v.Children.count(w)===0),ee=v.useMemo(()=>f===!1||!G?null:gx(w,X),[w,X,f,G]),ce=ee!=null&&(f===!0||ee.length>LD),[se,te]=v.useState(!1),J=ce&&!se;D.current=J;const oe=v.useRef(null),[ye,he]=v.useState(0),Fe=(ee==null?void 0:ee.length)??0;v.useLayoutEffect(()=>{const O=Y.current;if(!ce||!O){se&&te(!1);return}const ae=VD(O);oe.current=ae??O;const Ce=ae?O.getBoundingClientRect().top-ae.getBoundingClientRect().top+ae.scrollTop:0;Ce!==ye&&he(Ce),f==="auto"&&!se&&(!ae||ae.clientHeight>=Fe*h+Ce-1)&&te(!0)},[ce,f,se,Fe,h,ye]);const Ve=Zu({count:Fe,itemSize:h,enabled:J,scrollRef:oe,origin:ye}),ie=v.useMemo(()=>J&&ee?ee:[],[J,ee]),Q=v.useMemo(()=>{const O=new Map;return ie.forEach((ae,Ce)=>O.set(ae.id,Ce)),O},[ie]),me=v.useCallback(O=>Q.get(O)??-1,[Q]),je=v.useRef(null),Me=v.useCallback(O=>{A(O),je.current=O;const ae=Q.get(O);ae!=null&&Ve.scrollToIndex(ae)},[Q,Ve.scrollToIndex]);v.useEffect(()=>{var Ce;const O=je.current;if(O==null)return;const ae=Array.from(((Ce=Y.current)==null?void 0:Ce.querySelectorAll('[role="treeitem"]'))??[]).find(Le=>Le.dataset.treeId===O);ae&&(je.current=null,ae.focus())});const be=J?ie.slice(Ve.start,Ve.end):[],ke=J&&j!=null&&be.some(O=>O.id===j)?j:J?((pe=be[0])==null?void 0:pe.id)??null:j,re=v.useMemo(()=>({isExpanded:X,toggle:K,selectedId:E,select:H,activeId:ke,setActive:A,defaultIcons:l,registerBranch:L,virtual:J,focusItem:Me,nodes:ie,indexOf:me}),[X,K,E,H,ke,l,L,J,Me,ie,me]),we=v.useCallback(O=>{Y.current=O,typeof S=="function"?S(O):S&&(S.current=O)},[S]);v.useEffect(()=>{var Ce;if(j!==null)return;const O=(Ce=Y.current)==null?void 0:Ce.querySelector('[role="treeitem"]'),ae=O==null?void 0:O.dataset.treeId;ae&&A(ae)},[j]);const{className:Se,style:He,styleTag:Oe}=Ae(y,x,"cny-tree",J&&"cny-tree-virtual",b);return a.jsxs(xx.Provider,{value:re,children:[u&&a.jsxs("div",{className:"cny-tree-toolbar",children:[a.jsx("button",{type:"button",className:"cny-tree-toolbar-btn",onClick:F,children:"Expand all"}),a.jsx("button",{type:"button",className:"cny-tree-toolbar-btn",onClick:V,children:"Collapse all"})]}),a.jsxs("ul",{ref:we,role:"tree",className:Se,style:J?{...He,"--cny-tree-row-h":`${h}px`}:He,"aria-busy":p||void 0,...C,children:[Oe,p?[0,1,2].map(O=>a.jsx("li",{role:"none",className:"cny-tree-skeleton",children:a.jsx(jt,{width:`${70-O*12}%`})},O)):g!=null&&v.Children.count(w)===0?a.jsx("li",{role:"none",className:"cny-tree-empty",children:g}):J?a.jsxs(a.Fragment,{children:[Ve.start>0&&a.jsx("li",{role:"none","aria-hidden":"true",className:"cny-tree-spacer",style:{height:Ve.start*h}}),be.map(O=>v.cloneElement(O.el,{key:O.id,_meta:{level:O.level,size:O.size,pos:O.pos,flat:!0,hasChildren:O.hasChildren,parentId:O.parentId}})),Ve.end<Fe&&a.jsx("li",{role:"none","aria-hidden":"true",className:"cny-tree-spacer",style:{height:(Fe-Ve.end)*h}})]}):vx(w,1)]})]})});function Ah(t){return t?Array.from(t.querySelectorAll('[role="treeitem"]')):[]}const ba=v.forwardRef(function({itemId:e,label:n,icon:r,children:o,className:s,_meta:i,style:c,...l},u){const{isExpanded:d,toggle:f,selectedId:h,select:p,activeId:g,setActive:b,defaultIcons:x,registerBranch:y,virtual:w,focusItem:C,nodes:S,indexOf:M}=BD(),R=!!(i!=null&&i.flat),P=R?!!(i!=null&&i.hasChildren):!!o;v.useEffect(()=>P&&!R?y(e):void 0,[P,R,e,y]);const T=P&&d(e),j=h===e,A=g===e,_=r??(x?P?T?a.jsx(nR,{size:16}):a.jsx(oR,{size:16}):a.jsx(Eg,{size:16}):null),L=()=>{b(e),p(e),P&&f(e)},I=U=>{U.preventDefault(),U.stopPropagation(),b(e),f(e)},k=U=>{var $,X;if(U.target!==U.currentTarget)return;if(w&&R){q(U);return}const E=U.currentTarget.closest('[role="tree"]');switch(U.key){case"ArrowRight":if(U.preventDefault(),P&&!T)f(e);else if(T){const K=U.currentTarget.querySelector('[role="treeitem"]');K==null||K.focus()}break;case"ArrowLeft":if(U.preventDefault(),P&&T)f(e);else{const K=($=U.currentTarget.parentElement)==null?void 0:$.closest('[role="treeitem"]');K==null||K.focus()}break;case"ArrowDown":case"ArrowUp":{U.preventDefault();const K=Ah(E),ue=K.indexOf(U.currentTarget),D=K[ue+(U.key==="ArrowDown"?1:-1)];D==null||D.focus();break}case"Home":case"End":{U.preventDefault();const K=Ah(E);(X=U.key==="Home"?K[0]:K[K.length-1])==null||X.focus();break}case"Enter":case" ":U.preventDefault(),p(e),P&&f(e);break}},q=U=>{var X;const E=M(e);if(E<0)return;const $=K=>{const ue=S[Math.max(0,Math.min(S.length-1,K))];ue&&C(ue.id)};switch(U.key){case"ArrowDown":U.preventDefault(),$(E+1);break;case"ArrowUp":U.preventDefault(),$(E-1);break;case"Home":U.preventDefault(),$(0);break;case"End":U.preventDefault(),$(S.length-1);break;case"ArrowRight":U.preventDefault(),P&&!T?f(e):T&&((X=S[E+1])==null?void 0:X.parentId)===e&&$(E+1);break;case"ArrowLeft":U.preventDefault(),P&&T?f(e):i!=null&&i.parentId&&C(i.parentId);break;case"Enter":case" ":U.preventDefault(),p(e),P&&f(e);break}};return a.jsxs("li",{ref:u,role:"treeitem","data-tree-id":e,"aria-expanded":P?T:void 0,"aria-selected":j,"aria-level":i==null?void 0:i.level,"aria-setsize":i==null?void 0:i.size,"aria-posinset":i==null?void 0:i.pos,tabIndex:A?0:-1,className:ne("cny-tree-item",s),style:R?{...c,paddingInlineStart:(((i==null?void 0:i.level)??1)-1)*FD}:c,onKeyDown:k,onFocus:U=>{U.target===U.currentTarget&&b(e)},...l,children:[a.jsxs("div",{className:ne("cny-tree-row",j&&"is-selected"),onClick:L,children:[P?a.jsx("button",{type:"button",tabIndex:-1,className:ne("cny-tree-toggle",T&&"is-open"),"aria-label":`Toggle ${typeof n=="string"?n:e}`,onClick:I,children:a.jsx(Xn,{size:16,"aria-hidden":"true"})}):a.jsx("span",{className:"cny-tree-toggle-spacer","aria-hidden":"true"}),_!=null&&a.jsx("span",{className:"cny-tree-icon",children:_}),a.jsx("span",{className:"cny-tree-label",children:n})]}),T&&!R&&a.jsx("ul",{role:"group",className:"cny-tree-group",children:vx(o,((i==null?void 0:i.level)??1)+1)})]})}),UD=v.forwardRef(function({items:e,getItemId:n=l=>String(l.id),getItemLabel:r=l=>l.label,getItemChildren:o=l=>l.children,getItemIcon:s,...i},c){const l=u=>u.map(d=>{const f=n(d),h=o(d);return a.jsx(ba,{itemId:f,label:r(d),icon:s==null?void 0:s(d),children:h&&h.length>0?l(h):null},f)});return a.jsx(bx,{ref:c,...i,children:l(e)})});function HD(t){if(!t)return[];if(typeof t=="string")return t.split(",").map(n=>n.trim()).filter(Boolean);if(Array.isArray(t))return t.map(n=>n.trim()).filter(Boolean);const e=[];for(const[n,r]of Object.entries(t)){e.push(n);for(const o of r)e.push(o)}return e}function GD(t,e){if(e.length===0)return!0;const n=t.name.toLowerCase(),r=(t.type||"").toLowerCase();return e.some(o=>{const s=o.toLowerCase();return s==="*"||s==="*/*"?!0:s.startsWith(".")?n.endsWith(s):s.endsWith("/*")?r.startsWith(s.slice(0,-1)):r===s})}function wx(t={}){const{accept:e,maxSize:n,minSize:r,multiple:o=!1,maxFiles:s,disabled:i=!1,onDrop:c,onDropAccepted:l,onDropRejected:u}=t,[d,f]=v.useState(!1),h=v.useRef(null),p=v.useRef(0),g=v.useMemo(()=>HD(e),[e]),b=g.join(",")||void 0,x=v.useCallback(M=>{const R=[];return GD(M,g)||R.push({code:"file-invalid-type",message:"File type is not allowed."}),typeof n=="number"&&M.size>n&&R.push({code:"file-too-large",message:`File is larger than ${n} bytes.`}),typeof r=="number"&&M.size<r&&R.push({code:"file-too-small",message:`File is smaller than ${r} bytes.`}),R},[g,n,r]),y=v.useCallback(M=>{if(i||M.length===0)return;const R=[],P=[];if(!o&&M.length>1||typeof s=="number"&&M.length>s)for(const j of M)P.push({file:j,errors:[{code:"too-many-files",message:"Too many files."}]});else for(const j of M){const A=x(j);A.length?P.push({file:j,errors:A}):R.push(j)}c==null||c(R,P),R.length&&(l==null||l(R)),P.length&&(u==null||u(P))},[i,o,s,x,c,l,u]),w=v.useCallback(()=>{var M;i||(M=h.current)==null||M.click()},[i]),C=v.useCallback((M={})=>{const{onClick:R,onKeyDown:P,onDragOver:T,onDragEnter:j,onDragLeave:A,onDrop:_,...L}=M;return{...L,role:"button",tabIndex:i?-1:0,"aria-disabled":i||void 0,onClick:I=>{R==null||R(I),i||w()},onKeyDown:I=>{P==null||P(I),(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),w())},onDragOver:I=>{T==null||T(I),I.preventDefault(),i||f(!0)},onDragEnter:I=>{j==null||j(I),I.preventDefault(),!i&&(p.current+=1,f(!0))},onDragLeave:I=>{A==null||A(I),p.current=Math.max(0,p.current-1),p.current===0&&f(!1)},onDrop:I=>{var k;_==null||_(I),I.preventDefault(),p.current=0,f(!1),!i&&y(Array.from(((k=I.dataTransfer)==null?void 0:k.files)??[]))}}},[i,w,y]),S=v.useCallback((M={})=>{const{onChange:R,...P}=M;return{...P,ref:h,type:"file",accept:b,multiple:o,style:{display:"none"},onChange:T=>{R==null||R(T),y(Array.from(T.target.files??[])),T.target.value=""}}},[b,o,y]);return{getRootProps:C,getInputProps:S,open:w,isDragActive:d,inputRef:h,processFiles:y}}function zD({file:t}){const[e,n]=v.useState(null);return v.useEffect(()=>{if(!t.type.startsWith("image/")||typeof URL.createObjectURL!="function")return;const r=URL.createObjectURL(t);return n(r),()=>{var o;return(o=URL.revokeObjectURL)==null?void 0:o.call(URL,r)}},[t]),e?a.jsx("img",{className:"cny-uploader-thumb",src:e,alt:""}):a.jsx("span",{className:"cny-uploader-thumb is-generic","aria-hidden":"true",children:a.jsx(Eg,{size:16})})}const WD=v.forwardRef(function({onDrop:e,label:n="Drop files here or click to upload",hint:r,icon:o,children:s,buttonLabel:i="Browse files",files:c,onRetry:l,onRemove:u,showPreviews:d=!1,allowPaste:f=!1,size:h="md",accept:p,maxSize:g,minSize:b,multiple:x,maxFiles:y,disabled:w,className:C,style:S,sx:M},R){const{getRootProps:P,getInputProps:T,isDragActive:j,open:A,processFiles:_}=wx({accept:p,maxSize:g,minSize:b,multiple:x,maxFiles:y,disabled:w,onDrop:e}),{className:L,style:I,styleTag:k}=Ae(M,S,"cny-uploader",`cny-uploader-${h}`,j&&"is-dragging",w&&"is-disabled",C),q=E=>{var X;const $=Array.from(((X=E.clipboardData)==null?void 0:X.files)??[]);$.length!==0&&(E.preventDefault(),_($))},U=a.jsxs("div",{...P(f?{onPaste:q}:{}),ref:R,"aria-label":typeof n=="string"?n:"Upload files",className:L,style:I,children:[k,a.jsx("input",{...T()}),s??a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"cny-uploader-icon","aria-hidden":"true",children:o??a.jsx(WM,{})}),a.jsxs("span",{className:"cny-uploader-text",children:[a.jsx("span",{className:"cny-uploader-label",children:n}),r!=null&&a.jsx("span",{className:"cny-uploader-hint",children:r})]}),i!==!1&&a.jsx(Ur,{type:"button",variant:"outline",size:h==="sm"?"sm":"md",disabled:w,tabIndex:-1,onClick:E=>{E.stopPropagation(),A()},children:i})]})]});return!c||c.length===0?U:a.jsxs(a.Fragment,{children:[U,a.jsx("ul",{className:"cny-uploader-files","aria-label":"Files",children:c.map(E=>{const $=E.status??((E.progress??0)<100&&E.progress!=null?"uploading":"done");return a.jsxs("li",{className:`cny-uploader-file is-${$}`,children:[d&&a.jsx(zD,{file:E.file}),a.jsxs("span",{className:"cny-uploader-file-body",children:[a.jsx("span",{className:"cny-uploader-file-name",children:E.file.name}),$==="error"?a.jsx("span",{className:"cny-uploader-file-error",role:"alert",children:E.error??"Upload failed"}):E.progress!=null?a.jsx("span",{className:"cny-uploader-progress",role:"progressbar","aria-label":`Uploading ${E.file.name}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(E.progress),children:a.jsx("span",{style:{width:`${Math.max(0,Math.min(100,E.progress))}%`}})}):null]}),$==="error"&&l&&a.jsx("button",{type:"button",className:"cny-uploader-file-action","aria-label":`Retry ${E.file.name}`,onClick:()=>l(E),children:a.jsx(hR,{size:14,"aria-hidden":"true"})}),u&&a.jsx("button",{type:"button",className:"cny-uploader-file-action","aria-label":`Remove ${E.file.name}`,onClick:()=>u(E),children:a.jsx(nn,{size:14,"aria-hidden":"true"})})]},E.id)})})]})}),KD=5;function Ih(t){if(t.length===0)return[];const n=t.reduce((c,l)=>c+(l.def??0),0),r=t.filter(c=>c.def==null).length,o=r?Math.max(0,100-n)/r:0,s=t.map(c=>c.def==null?o:c.def),i=s.reduce((c,l)=>c+l,0)||1;return s.map(c=>c/i*100)}function Dh(t,e,n,r){if(e<0||e+1>=t.length)return t;const o=t[e]+t[e+1];let s=Math.max(r[e].min,Math.min(r[e].max,t[e]+n));const i=Math.max(r[e+1].min,Math.min(r[e+1].max,o-s));s=Math.max(r[e].min,Math.min(r[e].max,o-i));const c=[...t];return c[e]=s,c[e+1]=i,c}const yl=v.forwardRef(function({defaultSize:e,minSize:n,maxSize:r,className:o,style:s,sx:i,children:c,...l},u){const{className:d,style:f,styleTag:h}=Ae(i,s,"cny-panel",o);return a.jsxs("div",{ref:u,className:d,style:f,...l,children:[h,c]})}),Cx=v.forwardRef(function({disabled:e,className:n,__internal:r,...o},s){const i=(r==null?void 0:r.direction)!=="vertical",c=l=>{if(!r||e)return;const u=i?"ArrowRight":"ArrowDown",d=i?"ArrowLeft":"ArrowUp";l.key===u?(l.preventDefault(),r.onKeyResize(1)):l.key===d?(l.preventDefault(),r.onKeyResize(-1)):l.key==="Home"?(l.preventDefault(),r.onKeyResize(-1,!0)):l.key==="End"&&(l.preventDefault(),r.onKeyResize(1,!0))};return a.jsx("div",{ref:s,role:"separator",tabIndex:e?-1:0,"aria-orientation":i?"vertical":"horizontal","aria-valuenow":r==null?void 0:r.valueNow,"aria-valuemin":r==null?void 0:r.valueMin,"aria-valuemax":r==null?void 0:r.valueMax,"aria-disabled":e||void 0,className:ne("cny-panel-handle",i?"cny-panel-handle-h":"cny-panel-handle-v",n),onPointerDown:l=>{e||(l.preventDefault(),r==null||r.onResizeStart(l))},onKeyDown:c,...o})}),YD=v.forwardRef(function({direction:e="horizontal",className:n,style:r,sx:o,children:s,...i},c){const l=v.useRef(null),u=v.Children.toArray(s).filter(v.isValidElement),d=u.filter(T=>T.type===yl).map(T=>{const j=T.props;return{min:j.minSize??10,max:j.maxSize??90,def:j.defaultSize??null}}),[f,h]=v.useState(()=>Ih(d)),p=f.length===d.length?f:Ih(d),g=v.useRef(null),b=(T,j)=>{const A=e==="horizontal"?j.clientX:j.clientY;g.current={g:T,start:A,startSizes:p};const _=I=>{var X;const k=g.current,q=(X=l.current)==null?void 0:X.getBoundingClientRect();if(!k||!q)return;const U=e==="horizontal"?q.width:q.height;if(!U)return;const $=((e==="horizontal"?I.clientX:I.clientY)-k.start)/U*100;h(Dh(k.startSizes,k.g,$,d))},L=()=>{g.current=null,window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",L)};window.addEventListener("pointermove",_),window.addEventListener("pointerup",L)},x=(T,j,A=!1)=>{h(Dh(p,T,j*(A?100:KD),d))},y=T=>{l.current=T,typeof c=="function"?c(T):c&&(c.current=T)};let w=-1,C=-1;const S=u.map(T=>{var j,A;if(T.type===yl){w+=1;const _=w,L={...T.props.style,flexBasis:`${p[_]??0}%`,flexGrow:0,flexShrink:0};return v.cloneElement(T,{key:T.key??`panel-${_}`,style:L})}if(T.type===Cx){C+=1;const _=C,L={direction:e,valueNow:Math.round(p[_]??0),valueMin:((j=d[_])==null?void 0:j.min)??0,valueMax:((A=d[_])==null?void 0:A.max)??100,onResizeStart:I=>b(_,I),onKeyResize:(I,k)=>x(_,I,k)};return v.cloneElement(T,{key:T.key??`handle-${_}`,__internal:L})}return T}),{className:M,style:R,styleTag:P}=Ae(o,r,"cny-panel-group",e==="vertical"&&"is-vertical",n);return a.jsxs("div",{ref:y,className:M,style:R,...i,children:[P,S]})});function XD(){}const uc=t=>t.toLocaleString(),oi=(t,e)=>Array.from({length:Math.max(0,e-t+1)},(n,r)=>({type:"page",page:t+r}));function qD(t,e,n=1){if(e<1)return[];const r=n*2+5;if(e<=r)return oi(1,e);const o=Math.max(t-n,2),s=Math.min(t+n,e-1),i=o>3,c=s<e-2,l=n*2+3;return!i&&c?[...oi(1,l),{type:"ellipsis",key:"r"},{type:"page",page:e}]:i&&!c?[{type:"page",page:1},{type:"ellipsis",key:"l"},...oi(e-l+1,e)]:[{type:"page",page:1},{type:"ellipsis",key:"l"},...oi(o,s),{type:"ellipsis",key:"r"},{type:"page",page:e}]}function ZD(t,e,n,r){if(e<1)return[];if(e===1)return[{type:"page",page:1}];if(r)return qD(t,e,n);const o=e,s=Math.max(1,t-n),i=Math.min(o,t+n),c=[],l=r&&s>1,u=r&&i<o,d=l&&s>2,f=u&&i<o-1;l&&c.push({type:"page",page:1}),d&&c.push({type:"ellipsis",key:"l"});for(let h=s;h<=i;h++)c.push({type:"page",page:h});return f&&c.push({type:"ellipsis",key:"r"}),u&&c.push({type:"page",page:o}),c.filter((h,p,g)=>h.type!=="page"?!0:g.findIndex(b=>b.type==="page"&&b.page===h.page)===p)}const Sx=v.forwardRef(function({page:e,pageCount:n,onPageChange:r,siblingCount:o=1,showEdges:s=!0,hideControls:i=!1,size:c="md",showPageInput:l=!1,pageSize:u,pageSizeOptions:d=[10,25,50,100],onPageSizeChange:f,compact:h="auto",showFirstLast:p=!1,totalCount:g,className:b,style:x,sx:y,"aria-label":w="Pagination"},C){const S=v.useMemo(()=>ZD(e,n,o,s),[e,n,o,s]),[M,R]=v.useState(""),P=()=>{const L=Math.round(Number(M));R(""),!(M.trim()===""||!Number.isFinite(L))&&T(Math.min(n,Math.max(1,L)))},T=L=>{L<1||L>n||L===e||r(L)},{className:j,style:A,styleTag:_}=Ae(y,x,"cny-pagination",`cny-pagination-${c}`,h===!0&&"cny-pagination-compact",h==="auto"&&"cny-pagination-auto",b);return a.jsxs("nav",{ref:C,role:"navigation","aria-label":w,className:j,style:A,children:[_,f&&u!=null&&a.jsxs("label",{className:"cny-pagination-field",children:[a.jsx("span",{className:"cny-pagination-field-label",children:"Rows per page"}),a.jsx("select",{"aria-label":"Rows per page",className:"cny-pagination-select",value:u,onChange:L=>f(Number(L.target.value)),children:(d.includes(u)?d:[...d,u].sort((L,I)=>L-I)).map(L=>a.jsx("option",{value:L,children:L},L))})]}),g!=null&&u!=null&&a.jsx("span",{className:"cny-pagination-range","aria-live":"polite",children:g===0?"0 of 0":`${uc((Math.max(1,e)-1)*u+1)}–${uc(Math.min(g,e*u))} of ${uc(g)}`}),!i&&p&&a.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control cny-pagination-edge",onClick:()=>T(1),disabled:e<=1,"aria-label":"First page",children:a.jsx(_M,{size:14,"aria-hidden":"true"})}),!i&&a.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>T(e-1),disabled:e<=1,"aria-label":"Previous page",children:a.jsx(Jo,{size:14,"aria-hidden":"true"})}),S.map(L=>L.type==="ellipsis"?a.jsx("span",{className:"cny-pagination-ellipsis","aria-hidden":"true",children:a.jsx(Ng,{size:14})},`e-${L.key}`):a.jsx("button",{type:"button",className:ne("cny-pagination-btn",L.page===e&&"is-active"),"aria-current":L.page===e?"page":void 0,onClick:()=>T(L.page),children:L.page},L.page)),a.jsxs("span",{className:"cny-pagination-summary","aria-hidden":h===!1?!0:void 0,children:["Page ",e," of ",Math.max(1,n)]}),!i&&a.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>T(e+1),disabled:e>=n,"aria-label":"Next page",children:a.jsx(Xn,{size:14,"aria-hidden":"true"})}),!i&&p&&a.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control cny-pagination-edge",onClick:()=>T(n),disabled:e>=n,"aria-label":"Last page",children:a.jsx(LM,{size:14,"aria-hidden":"true"})}),l&&a.jsxs("label",{className:"cny-pagination-field cny-pagination-goto",children:[a.jsx("span",{className:"cny-pagination-field-label",children:"Go to page"}),a.jsx("input",{"aria-label":"Go to page",placeholder:"Page",type:"number",className:"cny-pagination-input",min:1,max:n,value:M,onChange:L=>R(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),P())},onBlur:()=>R("")})]})]})}),dc={left:"cny-dt-left",center:"cny-dt-center",right:"cny-dt-right"};function JD(t){return t.id}function fc(t){const e=t.headerName??t.field;return typeof e=="string"||typeof e=="number"?String(e):void 0}function QD(t,e){return!t||t.field!==e?{field:e,sort:"asc"}:t.sort==="asc"?{field:e,sort:"desc"}:null}const si=60,e2=[],t2=200,n2=v.memo(function({row:e,id:n,index:r,selected:o,tabbable:s,alt:i,extraClass:c,cells:l,checkboxSelection:u,cbClass:d,cbStyle:f,clickable:h,keyNav:p,titles:g,ariaRowIndex:b,actions:x}){return a.jsxs("tr",{"data-row-index":r,"aria-rowindex":b,className:ne("cny-dt-row",o&&"is-selected",i&&"is-alt",h&&"is-clickable",c),onClick:h?()=>{var y,w;return(w=(y=x.current).onRowClick)==null?void 0:w.call(y,e)}:void 0,tabIndex:p?s?0:-1:void 0,onFocus:p?()=>x.current.setActive(r):void 0,onKeyDown:p?y=>{y.target===y.currentTarget&&x.current.rowKey(y,r,e,n)}:void 0,children:[u&&a.jsx("td",{className:ne("cny-dt-checkbox-cell",d),style:f,onClick:y=>y.stopPropagation(),children:a.jsx(Li,{checked:o,onCheckedChange:()=>x.current.toggleRow(n),tabIndex:p&&!s?-1:void 0,"aria-label":`Select row ${String(n)}`})}),l.map(({col:y,className:w,style:C})=>{const S=y.valueGetter?y.valueGetter({row:e,field:y.field}):e[y.field],M=!y.renderCell&&(typeof S=="string"||typeof S=="number");return a.jsx("td",{className:w,style:C,title:g&&M?String(S):void 0,children:y.renderCell?y.renderCell({row:e,value:S,field:y.field}):S},y.field)})]})}),r2=v.forwardRef(function({columns:e,rows:n,getRowId:r=JD,loading:o=!1,rowCount:s,paginationModel:i,onPaginationModelChange:c,paginationMode:l="server",pageSizeOptions:u=[10,25,50,100],showGoToPage:d=!1,checkboxSelection:f=!1,rowSelectionModel:h,onRowSelectionModelChange:p,sortModel:g,onSortModelChange:b,onRowClick:x,noRowsLabel:y="No rows",emptyState:w,onClearFilters:C,columnVisibility:S,onColumnVisibilityChange:M,columnsMenu:R=!1,onSelectAllRows:P,allRowsSelected:T=!1,disableColumnResize:j=!1,density:A="standard",checkboxColumnWidth:_=44,stickyHeader:L=!1,tableLayout:I="auto",getRowClassName:k,striped:q=!1,virtualize:U="auto",rowHeight:E,toolbar:$,className:X,style:K,sx:ue},D){const Z=l==="client"&&i!=null,F=v.useMemo(()=>Z?n.slice(i.page*i.pageSize,(i.page+1)*i.pageSize):n,[n,Z,i==null?void 0:i.page,i==null?void 0:i.pageSize]),V=Z?n.length:s,[H,Y]=v.useState({}),G=S??H,ee=v.useMemo(()=>{const N=e.filter(B=>G[B.field]!==!1);return[...N.filter(B=>B.pinned==="left"),...N.filter(B=>!B.pinned),...N.filter(B=>B.pinned==="right")]},[e,G]),ce=ee.some(N=>N.pinned==="left"),se=(N,B)=>{const fe={...G,[N]:B};S===void 0&&Y(fe),M==null||M(fe)},te=v.useId(),J=ee.length+(f?1:0),oe=v.useRef(null),ye=v.useRef(null),[he,Fe]=v.useState(null),[Ve,ie]=v.useState(null),[Q,me]=v.useState({}),je=ee.map(N=>`${N.field}:${N.pinned??""}:${N.width??""}`).join("|");v.useLayoutEffect(()=>{var B;const N={};(B=oe.current)==null||B.querySelectorAll("thead th[data-pinned]").forEach(fe=>{const Te=fe.dataset.field;Te&&(N[Te]=fe.getBoundingClientRect().width)}),me(fe=>{const Te=Object.keys(N);return Te.length===Object.keys(fe).length&&Te.every($e=>fe[$e]===N[$e])?fe:N})},[je,Ve]);const Me=v.useRef(null),be=o||F.length===0;v.useLayoutEffect(()=>{var B;if(be)return;const N={};(B=oe.current)==null||B.querySelectorAll("thead th[data-field]").forEach(fe=>{const Te=fe.dataset.field;Te&&(N[Te]=fe.getBoundingClientRect().width)}),Me.current=N},[be,je,Ve]);const ke=()=>{var B;const N={};return(B=oe.current)==null||B.querySelectorAll("thead th[data-field]").forEach(fe=>{const Te=fe.dataset.field;Te&&(N[Te]=fe.getBoundingClientRect().width)}),N},re=(N,B)=>{B.preventDefault(),B.stopPropagation();const fe=Ve??ke(),Te=B.clientX,$e=fe[N]??0;ie(fe),Fe(N);const Ue=gt=>{ie({...fe,[N]:Math.max(si,$e+(gt.clientX-Te))})},nt=()=>{Fe(null),window.removeEventListener("pointermove",Ue),window.removeEventListener("pointerup",nt)};window.addEventListener("pointermove",Ue),window.addEventListener("pointerup",nt)},we=(N,B)=>{if(B.key!=="ArrowLeft"&&B.key!=="ArrowRight")return;B.preventDefault(),B.stopPropagation();const fe=Ve??ke(),Te=(B.shiftKey?40:10)*(B.key==="ArrowRight"?1:-1);ie({...fe,[N]:Math.max(si,Math.round((fe[N]??0)+Te))})},Se=N=>{const B=oe.current;if(!B)return;const fe=Ve??ke(),Te=ee.findIndex(Ue=>Ue.field===N)+(f?1:0);let $e=0;B.querySelectorAll("tr").forEach(Ue=>{const nt=Ue.children[Te];if(!nt)return;const gt=document.createRange();gt.selectNodeContents(nt);const St=getComputedStyle(nt),Mt=parseFloat(St.paddingLeft)+parseFloat(St.paddingRight),cr=nt.tagName==="TH"?12:0;$e=Math.max($e,gt.getBoundingClientRect().width+Mt+cr)}),ie({...fe,[N]:Math.min(640,Math.max(si,Math.ceil($e)))})},He=N=>!j&&N.resizable!==!1,Oe=h??e2,pe=v.useMemo(()=>new Set(Oe),[Oe]),O=v.useMemo(()=>F.map(N=>r(N)),[F,r]),{allSelected:ae,someSelected:Ce}=v.useMemo(()=>{let N=0;for(const B of O)pe.has(B)&&N++;return{allSelected:O.length>0&&N===O.length,someSelected:N>0}},[O,pe]),Le=ae?!0:Ce?"indeterminate":!1,le=()=>{if(p)if(ae){const N=new Set(O);p(Oe.filter(B=>!N.has(B)))}else{const N=new Set(Oe);O.forEach(B=>N.add(B)),p([...N])}},de=N=>{p&&(pe.has(N)?p(Oe.filter(B=>B!==N)):p([...Oe,N]))},Re=N=>{!N.sortable||!b||b(QD(g,N.field))},ve=E??(A==="compact"?37:45),Ie=U===!0||U==="auto"&&F.length>t2,[qe,Ye]=v.useState(!1),Be=Ie&&!qe&&!o&&F.length>0,[ze,We]=v.useState(40);v.useLayoutEffect(()=>{var fe;if(!Ie){qe&&Ye(!1);return}const N=ye.current,B=(fe=oe.current)==null?void 0:fe.tHead;B&&B.offsetHeight!==ze&&We(B.offsetHeight),!(U!=="auto"||qe||!N||!B)&&N.clientHeight>=F.length*ve+B.offsetHeight-1&&Ye(!0)},[Ie,U,qe,F.length,ve,ze]);const Qe=Zu({count:F.length,itemSize:ve,enabled:Be,scrollRef:ye,offset:ze}),De=Be?Qe.start:0,et=Be?Qe.end:F.length,At=x!=null||f,[it,xt]=v.useState(0),st=Math.max(0,Math.min(it,F.length-1)),ct=st>=De&&st<et?st:De,bt=v.useRef(null),Rn=N=>{xt(N),bt.current=N,Be&&Qe.scrollToIndex(N)},wt=Math.max(1,Math.floor(((Qe.viewport||400)-ze)/ve)-1),Jr=v.useRef(null);Jr.current={onRowClick:x,toggleRow:de,setActive:xt,rowKey:(N,B,fe,Te)=>{const $e=F.length-1;let Ue;switch(N.key){case"ArrowDown":Ue=Math.min($e,B+1);break;case"ArrowUp":Ue=Math.max(0,B-1);break;case"PageDown":Ue=Math.min($e,B+wt);break;case"PageUp":Ue=Math.max(0,B-wt);break;case"Home":Ue=0;break;case"End":Ue=$e;break;case"Enter":case" ":x?(N.preventDefault(),x(fe)):N.key===" "&&f&&(N.preventDefault(),de(Te));return;default:return}N.preventDefault(),Rn(Ue)}},v.useEffect(()=>{var fe;const N=bt.current;if(N==null)return;const B=(fe=oe.current)==null?void 0:fe.querySelector(`tbody tr[data-row-index="${N}"]`);B&&(bt.current=null,B.focus())});const _o=I==="fixed",Ct=Ve??(be&&Me.current?Me.current:null),Tn=_o||Be||Ct!=null,Qr=ee.reduce((N,B)=>B.width!=null?N:N+(B.flex??1),0),eo=(f?_:0)+ee.reduce((N,B)=>typeof B.width=="number"?N+B.width:N,0),kr=N=>{if(N.width!=null)return N.width;if(Qr<=0)return;const B=(N.flex??1)/Qr;return eo>0?`calc((100% - ${eo}px) * ${B.toFixed(6)})`:`${(B*100).toFixed(4)}%`},ir=N=>Q[N.field]??N.width??0,_t=N=>{if(!N.pinned)return;if(N.pinned==="left"){let fe=f?_:0;for(const Te of ee){if(Te===N)break;Te.pinned==="left"&&(fe+=ir(Te))}return{position:"sticky",left:fe}}let B=0;for(let fe=ee.length-1;ee[fe]!==N;fe--)B+=ir(ee[fe]);return{position:"sticky",right:B}},jn=N=>{if(!N.pinned)return;const B=ee.filter(Te=>Te.pinned===N.pinned),fe=N.pinned==="left"?B[B.length-1]:B[0];return ne("cny-dt-pinned",`cny-dt-pin-${N.pinned}`,fe===N&&"is-pin-edge")},dn=v.useMemo(()=>ee.map(N=>({col:N,className:ne(N.align&&dc[N.align],he===N.field&&"is-resizing",jn(N))||void 0,style:_t(N)})),[ee,Q,f,_,he]),Gn=ce?"cny-dt-pinned cny-dt-pin-left":void 0,zn=v.useMemo(()=>({width:_,minWidth:_,maxWidth:_}),[_]),Lo=f&&ae&&!o&&(T||P!=null&&V!=null&&V>F.length),Ar=N=>N.width!=null?{width:N.width,minWidth:N.width}:{flex:N.flex??1},ar=()=>{if(!i||V==null)return null;const{page:N,pageSize:B}=i,fe=Math.max(1,Math.ceil(V/B));return a.jsx("div",{className:"cny-dt-footer",children:a.jsx(Sx,{className:"cny-dt-pager",page:Math.min(N,fe-1)+1,pageCount:fe,siblingCount:2,showFirstLast:!0,showPageInput:d,pageSize:B,pageSizeOptions:u,totalCount:V,"aria-label":"Table pagination",onPageSizeChange:Te=>c==null?void 0:c({page:0,pageSize:Te}),onPageChange:Te=>c==null?void 0:c({page:Te-1,pageSize:B})})})},{className:to,style:Ir,styleTag:Fo}=Ae(ue,K,"cny-dt",A==="compact"&&"cny-dt-compact",L&&"cny-dt-sticky",q&&"cny-dt-striped",Be&&"cny-dt-virtual",X),Dr=Ct?ee.reduce((N,B)=>N+(Ct[B.field]??0),f?_:0):void 0,W=[];if(!o&&F.length>0){Be&&De>0&&W.push(a.jsx("tr",{"aria-hidden":"true",className:"cny-dt-spacer",style:{height:De*ve},children:a.jsx("td",{colSpan:J})},"sp-top"));for(let N=De;N<et;N++){const B=F[N],fe=r(B);W.push(a.jsx(n2,{row:B,id:fe,index:N,selected:pe.has(fe),tabbable:N===ct,alt:N%2===1,extraClass:k==null?void 0:k(B),cells:dn,checkboxSelection:f,cbClass:Gn,cbStyle:zn,clickable:x!=null,keyNav:At,titles:Tn,ariaRowIndex:Be?N+2:void 0,actions:Jr},String(fe)))}Be&&et<F.length&&W.push(a.jsx("tr",{"aria-hidden":"true",className:"cny-dt-spacer",style:{height:(F.length-et)*ve},children:a.jsx("td",{colSpan:J})},"sp-bot"))}return a.jsxs("div",{ref:D,className:to,style:Be?{...Ir,"--cny-dt-row-h":`${ve}px`}:Ir,children:[Fo,(R||$!=null)&&a.jsxs("div",{className:"cny-dt-toolbar",children:[$!=null&&a.jsx("div",{className:"cny-dt-toolbar-slot",children:$}),R&&a.jsxs(hx,{children:[a.jsx(px,{asChild:!0,children:a.jsx(Ur,{variant:"outline",size:"sm",icon:a.jsx(YM,{size:14,"aria-hidden":"true"}),children:"Columns"})}),a.jsx(mx,{align:"end",className:"cny-dt-colmenu",children:e.map(N=>a.jsx(Li,{checked:G[N.field]!==!1,onCheckedChange:B=>se(N.field,B===!0),children:N.headerName??N.field},N.field))})]})]}),f&&a.jsxs("div",{className:ne("cny-dt-selbar",Oe.length===0&&"is-empty"),"aria-live":"polite",children:[a.jsx("span",{className:"cny-dt-selbar-count",children:Oe.length>0?`${Oe.length.toLocaleString()} selected`:"No rows selected"}),a.jsx("button",{type:"button",className:"cny-dt-banner-btn",hidden:Oe.length===0,onClick:()=>p==null?void 0:p([]),children:"Clear"})]}),Lo&&a.jsx("div",{className:"cny-dt-banner",role:"status",children:T?a.jsxs(a.Fragment,{children:["All ",s??Oe.length," rows are selected.",a.jsx("button",{type:"button",className:"cny-dt-banner-btn",onClick:()=>p==null?void 0:p([]),children:"Clear selection"})]}):a.jsxs(a.Fragment,{children:["All ",F.length," rows on this page are selected.",a.jsxs("button",{type:"button",className:"cny-dt-banner-btn",onClick:P,children:["Select all ",s," rows"]})]})}),a.jsx("div",{className:"cny-dt-scroll",ref:ye,children:a.jsxs("table",{ref:oe,className:ne("cny-dt-table",Tn&&"is-fixed"),"aria-rowcount":Be?F.length+1:void 0,style:Ct?{tableLayout:"fixed",width:Dr}:Tn?{tableLayout:"fixed",width:"100%"}:void 0,children:[Tn&&a.jsxs("colgroup",{children:[f&&a.jsx("col",{style:{width:_}}),ee.map(N=>a.jsx("col",{style:{width:Ct?Ct[N.field]:kr(N)}},N.field))]}),a.jsx("thead",{children:a.jsxs("tr",{"aria-rowindex":Be?1:void 0,children:[f&&a.jsx("th",{className:ne("cny-dt-checkbox-cell",Gn),style:zn,scope:"col",children:a.jsx(Li,{checked:Le,onCheckedChange:le,"aria-label":"Select all rows"})}),ee.map((N,B)=>{const fe=(g==null?void 0:g.field)===N.field,Te=`${te}-h${B}`,$e=N.headerAlign??N.align;return a.jsxs("th",{scope:"col","data-field":N.field,style:{...Ct?void 0:Ar(N),..._t(N)},"data-pinned":N.pinned,"aria-labelledby":He(N)?Te:void 0,"aria-sort":fe?g.sort==="asc"?"ascending":"descending":N.sortable?"none":void 0,className:ne($e&&dc[$e],N.sortable&&"cny-dt-sortable",fe&&"is-sorted",he===N.field&&"is-resizing",jn(N)),children:[N.sortable?a.jsx("button",{type:"button",className:"cny-dt-sortbtn",onClick:()=>Re(N),children:a.jsxs("span",{className:"cny-dt-th-inner",children:[a.jsx("span",{id:Te,className:"cny-dt-th-label",title:fc(N),children:N.headerName??N.field}),a.jsx("span",{className:"cny-dt-sort-icon","aria-hidden":"true",children:fe?g.sort==="desc"?a.jsx(bs,{size:14}):a.jsx(Rg,{size:14}):a.jsx(Tg,{size:14})})]})}):a.jsx("span",{className:"cny-dt-th-inner",children:a.jsx("span",{id:Te,className:"cny-dt-th-label",title:fc(N),children:N.headerName??N.field})}),He(N)&&a.jsx("span",{className:"cny-dt-resizer",role:"separator","aria-orientation":"vertical","aria-label":`Resize ${fc(N)??N.field} column`,"aria-valuenow":(Ct==null?void 0:Ct[N.field])!=null?Math.round(Ct[N.field]):N.width,"aria-valuemin":si,tabIndex:0,onClick:Ue=>Ue.stopPropagation(),onPointerDown:Ue=>re(N.field,Ue),onKeyDown:Ue=>we(N.field,Ue),onDoubleClick:()=>Se(N.field)})]},N.field)})]})}),a.jsx("tbody",{children:o?Array.from({length:(i==null?void 0:i.pageSize)??Math.max(F.length,5)}).map((N,B)=>a.jsxs("tr",{className:"cny-dt-row",children:[f&&a.jsx("td",{className:ne("cny-dt-checkbox-cell",Gn),style:zn,children:a.jsx(jt,{shape:"avatar",width:16,height:16})}),ee.map(fe=>a.jsx("td",{className:ne(fe.align&&dc[fe.align],jn(fe)),style:_t(fe),children:a.jsx(jt,{width:"70%"})},fe.field))]},`sk-${B}`)):F.length===0?a.jsx("tr",{children:a.jsx("td",{className:"cny-dt-empty",colSpan:J,children:w??(C?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"cny-dt-empty-title",children:"No results match your filters"}),a.jsx(Ur,{variant:"outline",size:"sm",onClick:C,children:"Clear filters"})]}):y)})}):W})]})}),ar()]})}),vl=["var(--color-primary)","var(--color-success)","var(--color-warning)","var(--color-danger)","var(--color-info)","var(--color-neutral)"];function ln(t,e){return e??vl[t%vl.length]}const o2=/^var\(--color-(primary|success|warning|danger|info|neutral)\)$/;function Mx(t){if(!t)return;const e=o2.exec(t.trim());if(e)return`var(--color-${e[1]}-on)`;let n=null;const r=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t.trim());if(r){const l=r[1].length===3?r[1].replace(/./g,u=>u+u):r[1];n=[0,2,4].map(u=>parseInt(l.slice(u,u+2),16))}else{const l=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/i.exec(t.trim());l&&(n=[+l[1],+l[2],+l[3]])}if(!n)return;const[o,s,i]=n.map(l=>{const u=l/255;return u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4)});return .2126*o+.7152*s+.0722*i>.18?"#09090b":"#ffffff"}function qr(t=600){const e=v.useRef(null),[n,r]=v.useState(t);return v.useLayoutEffect(()=>{const o=e.current;if(!o||typeof ResizeObserver>"u")return;const s=new ResizeObserver(i=>{var l;const c=Math.round(((l=i[0])==null?void 0:l.contentRect.width)??0);c>0&&r(u=>u===c?u:c)});return s.observe(o),()=>s.disconnect()},[]),[e,n]}function s2(t,e,n,r,o,s){const i=(x,y)=>[t+x*Math.sin(y),e-x*Math.cos(y)],c=s-o>Math.PI?1:0,[l,u]=i(n,o),[d,f]=i(n,s);if(r<=0)return`M ${t} ${e} L ${l} ${u} A ${n} ${n} 0 ${c} 1 ${d} ${f} Z`;const[h,p]=i(r,s),[g,b]=i(r,o);return[`M ${l} ${u}`,`A ${n} ${n} 0 ${c} 1 ${d} ${f}`,`L ${h} ${p}`,`A ${r} ${r} 0 ${c} 0 ${g} ${b}`,"Z"].join(" ")}const On=t=>typeof t=="number"&&Number.isFinite(t);function ot(t){if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"){const e=t.trim();if(e==="")return null;const n=Number(e);return Number.isFinite(n)?n:null}return null}function Jn(t,e=0){const n=ot(t);return n===null?e:n}function Rx(t){if(!t)return null;let e=1/0,n=-1/0;for(let r=0;r<t.length;r++){const o=ot(t[r]);o!==null&&(o<e&&(e=o),o>n&&(n=o))}return e===1/0?null:[e,n]}function Vi(t){const e=[];let n=!1;for(let r=0;r<t.length;r++){const o=t[r];if(!o||!On(o.x)||!On(o.y)){n=!1;continue}e.push(`${n?"L":"M"}${$h(o.x)} ${$h(o.y)}`),n=!0}return e.join("")}const $h=t=>Math.round(t*100)/100;function i2(t,e){const n=t.length;if(e>=n)return t;if(e<3)return e===2?[t[0],t[n-1]]:[t[0]];const r=[t[0]],o=(n-2)/(e-2);let s=0;for(let i=0;i<e-2;i++){const c=Math.floor((i+1)*o)+1,l=Math.min(Math.floor((i+2)*o)+1,n);let u=0,d=0;const f=Math.max(1,l-c);for(let w=c;w<l;w++)u+=t[w].x,d+=t[w].y;u/=f,d/=f;const h=Math.floor(i*o)+1,p=Math.min(Math.floor((i+1)*o)+1,n-1),g=t[s].x,b=t[s].y;let x=-1,y=h;for(let w=h;w<p;w++){const C=Math.abs((g-u)*(t[w].y-b)-(g-t[w].x)*(d-b));C>x&&(x=C,y=w)}r.push(t[y]),s=y}return r.push(t[n-1]),r}function Tx(t,e){if(!t||t.length===0)return[];const n=Number.isFinite(e)?Math.max(1,Math.floor(e)):t.length;if(t.length<=n)return t;if(n<2)return[t[0]];const r=[];let o=[],s=0;for(let u=0;u<t.length;u++){const d=t[u];d&&On(d.x)&&On(d.y)?(o.push(d),s++):o.length?(r.push({pts:o,gap:d??null}),o=[]):r.length&&r[r.length-1].gap==null&&(r[r.length-1].gap=d??null)}if(o.length&&r.push({pts:o,gap:null}),s===0)return[];const i=[],c=r.filter(u=>u.gap).length,l=Math.max(r.length,n-c);for(const u of r){const d=Math.max(Math.min(2,u.pts.length),Math.round(l*u.pts.length/s)),f=i2(u.pts,d);for(let h=0;h<f.length;h++)i.push(f[h]);u.gap&&i.push(u.gap)}for(;i.length&&!On(i[i.length-1].y);)i.pop();return i}function Ju(t,e,n="sum"){if(!t||t.length===0)return[];const r=t.length,o=Number.isFinite(e)?Math.max(1,Math.floor(e)):r;if(r<=o){const i=new Array(r);for(let c=0;c<r;c++){const l=ot(t[c]);i[c]=l===null?NaN:l}return i}const s=new Array(o);for(let i=0;i<o;i++){const c=Math.floor(i*r/o),l=Math.floor((i+1)*r/o);let u=0,d=0,f=1/0,h=-1/0;for(let p=c;p<l;p++){const g=ot(t[p]);g!==null&&(u+=g,d++,g<f&&(f=g),g>h&&(h=g))}s[i]=d===0?NaN:n==="sum"?u:n==="mean"?u/d:n==="min"?f:h}return s}function a2(t,e,n=4){if(!On(t)||!On(e))return{lo:0,hi:1,step:1,ticks:[0,1]};t>e&&([t,e]=[e,t]);const r=Math.min(50,Math.max(1,Math.floor(On(n)?n:4)));if(t===e)if(t===0)t=0,e=1;else{const p=Math.abs(t)/2;t-=p,e+=p}const o=(e-t)/r,s=Math.pow(10,Math.floor(Math.log10(o))),i=o/s,c=(i<=1?1:i<=2?2:i<=5?5:10)*s,l=Math.min(100,Math.max(0,1-Math.floor(Math.log10(c)))),u=p=>Number(p.toFixed(l)),d=Math.floor(t/c+1e-9),f=Math.ceil(e/c-1e-9),h=[];for(let p=d;p<=f&&h.length<200;p++)h.push(u(p*c));return{lo:h[0],hi:h[h.length-1],step:c,ticks:h}}const hc=new Map;function c2(t){if(hc.has(t))return hc.get(t);let e=null;try{e=new Intl.NumberFormat(t,{notation:"compact",maximumFractionDigits:1})}catch{e=null}return hc.set(t,e),e}function Nr(t,e="en-US"){if(!On(t))return"–";const n=Math.abs(t);if(n===0)return"0";if(n<1e3){if(n<1)try{return new Intl.NumberFormat(e,{maximumSignificantDigits:3,maximumFractionDigits:20}).format(t)}catch{return String(Number(t.toPrecision(3)))}return String(Number(t.toFixed(1)))}if(n>=1e15)return t.toExponential(2).replace(/\.?0+e/,"e").replace("e+","e");const r=c2(e);if(r)return r.format(t);const o=[[1e12,"T"],[1e9,"B"],[1e6,"M"],[1e3,"K"]];for(const[s,i]of o)if(n>=s)return`${Number((t/s).toFixed(1))}${i}`;return String(t)}function en(t,e){const n=t==null?"":String(t),r=Number.isFinite(e)?Math.max(1,Math.floor(e)):n.length;if(n.length<=r)return n;const o=Array.from(n);return o.length<=r?n:r===1?"…":o.slice(0,r-1).join("").trimEnd()+"…"}function ds(t,e,n=7,r={}){const o=t.length;if(o===0)return{indices:[],step:1,rotate:!1};const{allowRotate:s=!0,gap:i=6,lineHeight:c=14}=r,l=On(e)&&e>0?e:0;let u=0;for(let b=0;b<o;b++){const x=t[b]==null?0:String(t[b]).length;x>u&&(u=x)}const d=l/o,f=u*n+i;let h=1,p=!1;if(d<f){const b=Math.max(d,1e-4),x=Math.ceil(f/b),y=Math.ceil(c/b);s&&y<=x?(p=!0,h=y):h=x}h=Math.min(h,o);const g=[];for(let b=0;b<o;b+=h)g.push(b);return{indices:g,step:h,rotate:p}}function jx(t,e,n,r,o,s,i=8){const c=f=>Number.isFinite(f)?f:0;t=c(t),e=c(e),n=Math.max(0,c(n)),r=Math.max(0,c(r)),o=Math.max(0,c(o)),s=Math.max(0,c(s));let l="top",u=e-r-i;u<0&&(l="bottom",u=e+i);let d=t-n/2;return d=Math.max(0,Math.min(d,o-n)),u=Math.max(0,Math.min(u,s-r)),{left:d,top:u,placement:l}}function As(){const[t,e]=v.useState(()=>new Set),n=v.useCallback(r=>{e(o=>{const s=new Set(o);return s.has(r)?s.delete(r):s.add(r),s})},[]);return[t,n]}const l2=8;function Is({entries:t,hidden:e,onToggle:n,interactive:r=!0}){return a.jsx("div",{className:ne("cny-chart-legend",t.length>l2&&"cny-chart-legend--scroll cny-scroll"),children:t.map(o=>{const s=e.has(o.key),i=a.jsx("span",{className:"cny-chart-swatch",style:{background:o.color}});return r?a.jsxs("button",{type:"button",className:ne("cny-chart-legend-item","is-toggle",s&&"is-off"),"aria-pressed":!s,title:o.label,onClick:()=>n(o.key),children:[i,a.jsx("span",{className:"cny-chart-legend-label",children:o.label})]},o.key):a.jsxs("span",{className:"cny-chart-legend-item",title:o.label,children:[i,a.jsx("span",{className:"cny-chart-legend-label",children:o.label})]},o.key)})})}function Ds({children:t}){return a.jsx("div",{className:"cny-chart-empty",role:"status",children:t})}function Qu(t=90){const[e,n]=v.useState(null),r=v.useRef(null);v.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const o=v.useCallback(s=>{r.current&&clearTimeout(r.current),s==null?r.current=setTimeout(()=>n(null),t):n(s)},[t]);return[e,o]}const Px="(prefers-reduced-motion: reduce)";function u2(){return typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Px).matches:!1}function d2(){const[t,e]=v.useState(!1);return v.useEffect(()=>{var o;if(e(u2()),typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia(Px),r=()=>e(n.matches);return(o=n.addEventListener)==null||o.call(n,"change",r),()=>{var s;return(s=n.removeEventListener)==null?void 0:s.call(n,"change",r)}},[]),t}function Mn(t=!0){const e=d2();return t&&!e}function ed(t,e,n=900){const[r,o]=v.useState(e?0:t);return v.useEffect(()=>{if(!e||typeof requestAnimationFrame>"u"){o(t);return}let s=0,i=null;const c=l=>{i==null&&(i=l);const u=Math.min(1,(l-i)/n);o(t*(1-Math.pow(1-u,3))),u<1&&(s=requestAnimationFrame(c))};return s=requestAnimationFrame(c),()=>cancelAnimationFrame(s)},[t,e,n]),r}function Er({rootRef:t,animate:e,loading:n,isEmpty:r,empty:o,height:s,className:i,style:c,sx:l,children:u}){const{className:d,style:f,styleTag:h}=Ae(l,{position:"relative",...c},"cny-chart","cny-chart-emph",e&&"cny-chart-anim",i);return a.jsxs("div",{ref:t,className:d,style:f,"aria-busy":n||void 0,children:[h,n?a.jsx("div",{className:"cny-chart-loading",style:{height:s},role:"status","aria-label":"Loading"}):a.jsxs(a.Fragment,{children:[r&&a.jsx(Ds,{children:o??"No data"}),u]})]})}function Zr({x:t,y:e,children:n}){const r=v.useRef(null),[o,s]=v.useState(null);return v.useLayoutEffect(()=>{const i=r.current,c=i==null?void 0:i.offsetParent;if(!i||!c||!c.clientWidth||!i.offsetWidth){s(null);return}const{left:l,top:u}=jx(t,e,i.offsetWidth,i.offsetHeight,c.clientWidth,c.clientHeight);s(d=>d&&d.left===l&&d.top===u?d:{left:l,top:u})},[t,e,n]),a.jsx("div",{ref:r,className:"cny-chart-tooltip",style:o?{left:o.left,top:o.top,transform:"none"}:{left:t,top:e},children:n})}const un=(t,e)=>({"--i":t,...e?{"--d":`${e}ms`}:null});function kn(t,e,n,r){return[t+n*Math.sin(r),e-n*Math.cos(r)]}function pc(t,e,n,r,o){const[s,i]=kn(t,e,n,r),[c,l]=kn(t,e,n,o);return`M ${s} ${i} A ${n} ${n} 0 ${o-r>Math.PI?1:0} 1 ${c} ${l}`}const td=(t,e)=>t===e?e:Number(t.toFixed(Number.isInteger(e)?0:2)),$s=t=>Number.isInteger(t)?t.toLocaleString("en-US"):t.toLocaleString("en-US",{maximumFractionDigits:2});function Bn(t,e=300){return Number.isFinite(t)&&t<=e}function _s(t,e=90){const[n,r]=Qu(e),o=v.useRef(t);o.current=t;const s=v.useRef(0),i=v.useRef(null);v.useEffect(()=>()=>{s.current&&typeof cancelAnimationFrame<"u"&&cancelAnimationFrame(s.current)},[]);const c=v.useCallback(()=>{s.current=0;const d=i.current;i.current=null,d&&r(o.current(d.x,d.y,d.rect))},[r]),l=v.useCallback(d=>{const f=d.currentTarget.getBoundingClientRect();i.current={x:d.clientX-f.left,y:d.clientY-f.top,rect:f},typeof requestAnimationFrame>"u"?c():s.current||(s.current=requestAnimationFrame(c))},[c]),u=v.useCallback(()=>{i.current=null,r(null)},[r]);return{hover:n,setHover:r,handlers:{onPointerMove:l,onPointerLeave:u}}}function fs(t){if(!Number.isFinite(t))return"–";const e=Math.abs(t);return e>0&&e<.001?Number(t.toPrecision(2)).toExponential().replace("e-","e−").replace("e+","e"):Nr(t)}function mn(t){return t==null||!Number.isFinite(t)?"no data":Math.abs(t)>=1e9||t!==0&&Math.abs(t)<.001?fs(t):Number.isInteger(t)?t.toLocaleString("en-US"):t.toLocaleString("en-US",{maximumFractionDigits:3})}function nd(t,e,n=40){let r=0;for(const i of t)i.length>r&&(r=i.length);const o=Math.ceil(r*6.4)+14,s=Math.max(n,Math.floor(e*.4));return Math.max(n,Math.min(o,s))}const hs=(t,e=14)=>en(t,e);function wa(t,e,n=200){if(t<=n){const s=[];for(let i=0;i<t;i++)s.push(e(i));return s}const r=[],o=n-1;for(let s=0;s<o;s++)r.push(e(Math.round(s*(t-1)/(o-1))));return r.push([`…${t-o} more rows`]),r}function rd(t,e,n,r=1){return o=>{if(t<=0)return;const s=e??-1;let i=null;if(o.key==="ArrowRight"||o.key==="ArrowDown")i=Math.min(t-1,s+r);else if(o.key==="ArrowLeft"||o.key==="ArrowUp")i=Math.max(0,s<0?0:s-r);else if(o.key==="Home")i=0;else if(o.key==="End")i=t-1;else if(o.key==="Escape"){n(null);return}i!=null&&(o.preventDefault(),n(i))}}const od=60;function Bi(t,e,n=4){const r=a2(t,e,n);return!Number.isFinite(r.lo)||!Number.isFinite(r.hi)||!(r.hi>r.lo)||!r.ticks.length||r.ticks.some(o=>!Number.isFinite(o))?{lo:0,hi:1,ticks:[0,1]}:{lo:r.lo,hi:r.hi,ticks:r.ticks}}const Jt=t=>t&&typeof t=="object"?t:{};function Un({caption:t,head:e,rows:n,maxRows:r=200}){const o=Math.max(1,Math.floor(r));let s=n,i=0;if(n.length>o){i=n.length-o,s=[];for(let c=0;c<o;c++)s.push(n[o===1?0:Math.round(c*(n.length-1)/(o-1))])}return a.jsxs("table",{className:"cny-sr-only",children:[a.jsx("caption",{children:t}),a.jsx("thead",{children:a.jsx("tr",{children:e.map((c,l)=>a.jsx("th",{scope:"col",children:c},l))})}),a.jsxs("tbody",{children:[s.map((c,l)=>a.jsx("tr",{children:c.map((u,d)=>a.jsx("td",{children:u},d))},l)),i>0&&a.jsx("tr",{children:a.jsxs("td",{colSpan:Math.max(1,e.length),children:["…",i," more rows"]})})]})]})}const Xt={top:12,right:14,bottom:28,left:40},f2=6;function h2({data:t,xKey:e,series:n,height:r=260,label:o="Bar chart",stacked:s=!1,grid:i=!0,legend:c=!0,legendToggle:l=!0,empty:u,maxBars:d,aggregate:f="sum",animate:h=!0,yTickFormatter:p=fs,xTickFormatter:g=C=>C,renderTooltip:b,className:x,style:y,sx:w}){const C=Array.isArray(t)?t:[],[S,M]=qr(),[R,P]=As(),T=n.map((pe,O)=>({...pe,color:ln(O,pe.color)})).filter(pe=>!R.has(pe.key)),[j,A]=v.useState(null),_=C.length,L=Math.max(0,M-Xt.left-Xt.right),I=Math.max(1,Math.floor(d&&d>0?d:Math.max(1,L/f2))),k=Math.min(_,I),q=T.map(pe=>pe.key).join("\0"),U=v.useMemo(()=>T.map(pe=>Ju(C.map(O=>Jt(O)[pe.key]),k,f)),[C,q,k,f]),E=v.useMemo(()=>{const pe=ae=>String(Jt(C[ae])[e]??""),O=[];for(let ae=0;ae<k;ae++){const Ce=Math.floor(ae*_/k),Le=Math.max(Ce,Math.floor((ae+1)*_/k)-1);O.push(_>k&&Le>Ce?`${pe(Ce)} – ${pe(Le)}`:pe(Ce))}return O},[C,e,k,_]);let $=0,X=0;for(let pe=0;pe<k;pe++){let O=0,ae=0;for(let Ce=0;Ce<U.length;Ce++){const Le=U[Ce][pe];Number.isFinite(Le)&&(s?Le>=0?O+=Le:ae+=Le:(Le>X&&(X=Le),Le<$&&($=Le)))}s&&(O>X&&(X=O),ae<$&&($=ae))}const{lo:K,hi:ue,ticks:D}=Bi($,X),Z=D.map(pe=>p(pe)),F=nd(Z,M,Xt.left),V=Math.max(0,M-F-Xt.right),H=E.map(pe=>hs(g(pe))),Y=ds(H,V,6.2);let G=0;for(const pe of Y.indices)H[pe].length>G&&(G=H[pe].length);const ee=Y.rotate?22+Math.min(70,Math.round(G*6.2*.72)):Xt.bottom,ce=Math.max(0,r-Xt.top-ee),se=ue-K,te=pe=>Xt.top+ce*(1-(pe-K)/se),J=k?V/k:0,oe=J*.68,ye=pe=>F+pe*J+(J-oe)/2,he=s?oe:oe/Math.max(1,T.length),Fe=s?0:Math.min(2,he*.25),Ve=_s((pe,O)=>k===0||J<=0||pe<F||pe>F+V||O<Xt.top||O>Xt.top+ce?null:Math.max(0,Math.min(k-1,Math.floor((pe-F)/J)))),ie=Ve.hover??j,Q=ie!=null&&ie<k?ie:null,me=Mn(h)&&Bn(k*T.length),{className:je,style:Me,styleTag:be}=Ae(w,{position:"relative",...y},"cny-chart",me&&"cny-chart-anim",x),ke=_===0,re=k<=od,we=(pe,O)=>{var Ce;const ae=(Ce=U[pe])==null?void 0:Ce[O];return ae==null||!Number.isFinite(ae)?null:ae},Se=pe=>`${E[pe]}: ${T.map((O,ae)=>`${O.label??O.key} ${mn(we(ae,pe))}`).join(", ")}`;let He=Xt.top+ce;if(Q!=null){let pe=0,O=0;for(let ae=0;ae<T.length;ae++){const Ce=we(ae,Q);if(Ce==null)continue;let Le;s?Ce>=0?(pe+=Ce,Le=pe):(O+=Ce,Le=O):Le=Ce,He=Math.min(He,te(Math.max(Le,0)))}}const Oe=v.useMemo(()=>a.jsx(a.Fragment,{children:Array.from({length:k},(pe,O)=>{let ae=0,Ce=0;return a.jsx("g",{children:T.map((Le,le)=>{const de=we(le,O);if(de==null)return null;let Re,ve,Ie;s?(Ie=ye(O),de>=0?(Re=ae,ae+=de,ve=ae):(Re=Ce,Ce+=de,ve=Ce)):(Ie=ye(O)+le*he,Re=0,ve=de);const qe=te(Re),Ye=te(ve);return a.jsx("rect",{className:me?"cny-chart-bar cny-x-grow-y":"cny-chart-bar",style:me?{...un(O,Math.min(45,600/k)),...ve<Re?{transformOrigin:"50% 0%"}:null}:void 0,x:Ie,y:Math.min(qe,Ye),width:Math.max(0,he-Fe),height:Math.max(0,Math.abs(Ye-qe)),rx:he>6?2:0,fill:Le.color},le)})},O)})}),[U,k,q,T.map(pe=>pe.color).join("|"),s,F,ce,V,K,ue,r,ee,me]);return a.jsxs("div",{ref:S,className:je,style:Me,children:[be,ke&&a.jsx(Ds,{children:u??"No data"}),a.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${M} ${r}`,role:"img","aria-label":Q!=null&&!re?`${o}: ${Se(Q)}`:o,tabIndex:re?void 0:0,className:re?void 0:"cny-chart-focusable",onKeyDown:re?void 0:rd(k,j,A),onBlur:re?void 0:()=>A(null),...Ve.handlers,children:[D.map((pe,O)=>a.jsxs("g",{children:[i&&a.jsx("line",{className:"cny-chart-grid",x1:F,x2:M-Xt.right,y1:te(pe),y2:te(pe)}),a.jsx("text",{className:"cny-chart-axis",x:F-6,y:te(pe),dy:"0.32em",textAnchor:"end",children:Z[O]})]},O)),Q!=null&&a.jsx("rect",{className:"cny-chart-band",x:F+Q*J,y:Xt.top,width:J,height:ce}),Oe,Y.indices.map(pe=>{const O=F+pe*J+J/2,ae=r-ee+16;return a.jsx("text",{className:"cny-chart-axis",x:O,y:Y.rotate?ae-6:ae,textAnchor:Y.rotate?"end":"middle",transform:Y.rotate?`rotate(-45 ${O} ${ae-6})`:void 0,children:H[pe]},`x-${pe}`)}),re&&E.map((pe,O)=>a.jsx("rect",{className:"cny-chart-hit",x:F+O*J,y:Xt.top,width:J,height:ce,fill:"transparent",tabIndex:0,"aria-label":Se(O),onMouseEnter:()=>Ve.setHover(O),onMouseLeave:()=>Ve.setHover(null),onFocus:()=>A(O),onBlur:()=>A(null)},`h-${O}`))]}),a.jsx(Un,{caption:o,head:[String(e),...T.map(pe=>pe.label??pe.key)],rows:wa(_,pe=>[g(String(Jt(C[pe])[e]??"")),...T.map(O=>{const ae=ot(Jt(C[pe])[O.key]);return ae??"no data"})])}),Q!=null&&a.jsx(Zr,{x:F+Q*J+J/2,y:He,children:b?b({label:E[Q],datum:C[Math.floor(Q*_/k)]??{}}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"cny-chart-tooltip-title",children:E[Q]}),T.map((pe,O)=>a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-swatch",style:{background:pe.color}}),a.jsx("span",{className:"cny-chart-tooltip-label",children:pe.label??pe.key}),a.jsx("span",{className:"cny-chart-tooltip-value",children:mn(we(O,Q))})]},O))]})}),c&&a.jsx(Is,{entries:n.map((pe,O)=>({key:pe.key,label:pe.label??pe.key,color:ln(O,pe.color)})),hidden:R,onToggle:P,interactive:l})]})}const Ht={top:12,right:14,bottom:28,left:40},p2=100;function Nx({data:t,xKey:e,series:n,height:r=260,label:o="Line chart",area:s=!1,stacked:i=!1,dots:c=!0,maxPoints:l,animate:u=!0,grid:d=!0,legend:f=!0,legendToggle:h=!0,crosshair:p=!0,empty:g,yTickFormatter:b=fs,xTickFormatter:x=M=>M,renderTooltip:y,className:w,style:C,sx:S}){const M=Array.isArray(t)?t:[],[R,P]=qr(),[T,j]=As(),A=n.map((re,we)=>({...re,color:ln(we,re.color)})).filter(re=>!T.has(re.key)),[_,L]=v.useState(null),I=M.length,k=Math.max(0,P-Ht.left-Ht.right),q=Math.max(2,Math.floor(l&&l>0?l:k*2)),U=A.map(re=>re.key).join("\0"),E=v.useMemo(()=>{const re=A.map(de=>{const Re=new Array(I);for(let ve=0;ve<I;ve++){const Ie=ot(Jt(M[ve])[de.key]);Re[ve]=Ie===null?NaN:Ie}return Re}),we=i&&I>q,Se=we?q:I,He=we?re.map(de=>Ju(de,Se,"mean")):re,Oe=de=>we?(de+.5)*I/Se-.5:de,pe=new Array(Se).fill(0),O=He.map(de=>{const Re=[];for(let ve=0;ve<Se;ve++){const Ie=de[ve];if(i){const qe=pe[ve];pe[ve]=qe+(Number.isFinite(Ie)?Ie:0),Re.push({x:Oe(ve),y:pe[ve],b:qe})}else Re.push({x:Oe(ve),y:Ie,b:0})}return i?Re:Tx(Re,q)});let ae=0,Ce=0;for(const de of O)for(let Re=0;Re<de.length;Re++){const ve=de[Re].y;Number.isFinite(ve)&&(ve<ae&&(ae=ve),ve>Ce&&(Ce=ve))}if(!i)for(const de of re)for(let Re=0;Re<de.length;Re++){const ve=de[Re];ve<ae?ae=ve:ve>Ce&&(Ce=ve)}const Le=new Array(I),le=new Array(I);for(let de=0;de<I;de++)Le[de]=String(Jt(M[de])[e]??""),le[de]=hs(Le[de]);return{pts:O,lo:ae,hi:Ce,labels:Le,short:le}},[M,U,i,q,e,I]),{lo:$,hi:X,ticks:K}=Bi(E.lo,E.hi),ue=K.map(re=>b(re)),D=nd(ue,P,Ht.left),Z=Math.max(0,P-D-Ht.right),F=ds(E.short,Z,6.2);let V=0;for(const re of F.indices)E.short[re].length>V&&(V=E.short[re].length);const H=F.rotate?22+Math.min(70,Math.round(V*6.2*.72)):Ht.bottom,Y=Math.max(0,r-Ht.top-H),G=re=>Ht.top+Y*(1-(re-$)/(X-$)),ee=I?Z/I:0,ce=re=>D+re*ee+ee/2,se=G(0),te=_s((re,we)=>I===0||ee<=0||re<D-ee||re>D+Z+ee||we<Ht.top||we>Ht.top+Y?null:Math.max(0,Math.min(I-1,Math.floor((re-D)/ee)))),J=te.hover??_,oe=J!=null&&J<I?J:null;let ye=0;for(const re of E.pts)ye=Math.max(ye,re.length);const he=Mn(u)&&Bn(ye),{className:Fe,style:Ve,styleTag:ie}=Ae(S,{position:"relative",...C},"cny-chart",he&&"cny-chart-anim",w),Q=I===0,me=I<=od,je=(re,we)=>ot(Jt(M[we])[A[re].key]),Me=re=>`${x(E.labels[re])}: ${A.map((we,Se)=>`${we.label??we.key} ${mn(je(Se,re))}`).join(", ")}`,be=[];if(oe!=null){let re=0;for(let we=0;we<A.length;we++){const Se=je(we,oe);i?(re+=Se??0,be.push(G(re))):be.push(Se==null?null:G(Se))}}let ke=Ht.top+Y;for(const re of be)re!=null&&re<ke&&(ke=re);return a.jsxs("div",{ref:R,className:Fe,style:Ve,children:[ie,Q&&a.jsx(Ds,{children:g??"No data"}),a.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${P} ${r}`,role:"img","aria-label":oe!=null&&!me?`${o}: ${Me(oe)}`:o,tabIndex:me?void 0:0,className:me?void 0:"cny-chart-focusable",onKeyDown:me?void 0:rd(I,_,L,Math.max(1,Math.floor(I/q))),onBlur:me?void 0:()=>L(null),...te.handlers,children:[K.map((re,we)=>a.jsxs("g",{children:[d&&a.jsx("line",{className:"cny-chart-grid",x1:D,x2:P-Ht.right,y1:G(re),y2:G(re)}),a.jsx("text",{className:"cny-chart-axis",x:D-6,y:G(re),dy:"0.32em",textAnchor:"end",children:ue[we]})]},we)),p&&oe!=null&&a.jsx("line",{className:"cny-chart-crosshair",x1:ce(oe),x2:ce(oe),y1:Ht.top,y2:Ht.top+Y}),A.map((re,we)=>{const Se=re.color,He=E.pts[we];if(!He||He.length===0)return null;const Oe=He.map(de=>({x:ce(de.x),y:Number.isFinite(de.y)?G(de.y):NaN,b:i?G(de.b):se,i:de.x})),pe=Oe.filter(de=>Number.isFinite(de.y));if(pe.length===0)return null;const O=c&&pe.length<=p2,ae=[];let Ce=[];for(const de of Oe)Number.isFinite(de.y)?Ce.push(de):Ce.length&&(ae.push(Ce),Ce=[]);Ce.length&&ae.push(Ce);const Le=de=>Math.round(de*100)/100,le=s?ae.map(de=>Vi(de)+[...de].reverse().map(Re=>`L${Le(Re.x)} ${Le(Re.b)}`).join("")+"Z").join(""):"";return a.jsxs("g",{children:[s&&le&&a.jsx("path",{className:he?"cny-chart-area cny-x-fade":"cny-chart-area",d:le,fill:Se,style:he?un(we):void 0}),a.jsx("path",{className:he?"cny-chart-line cny-x-draw":"cny-chart-line",d:Vi(Oe),fill:"none",stroke:Se,pathLength:he?1:void 0,style:he?un(we):void 0}),O?pe.map((de,Re)=>a.jsx("circle",{className:he?"cny-chart-dot cny-x-pop cny-x-late":"cny-chart-dot",cx:de.x,cy:de.y,r:p&&oe===de.i?4.5:3,fill:Se},Re)):ae.filter(de=>de.length===1).map((de,Re)=>a.jsx("circle",{className:"cny-chart-dot",cx:de[0].x,cy:de[0].y,r:3,fill:Se},`s${Re}`)),!O&&p&&oe!=null&&be[we]!=null&&a.jsx("circle",{className:"cny-chart-dot",cx:ce(oe),cy:be[we],r:4.5,fill:Se})]},we)}),F.indices.map(re=>{const we=ce(re),Se=r-H+16;return a.jsx("text",{className:"cny-chart-axis",x:we,y:F.rotate?Se-6:Se,textAnchor:F.rotate?"end":"middle",transform:F.rotate?`rotate(-45 ${we} ${Se-6})`:void 0,children:hs(x(E.labels[re]))},`x-${re}`)}),me&&E.labels.map((re,we)=>a.jsx("rect",{className:"cny-chart-hit",x:D+we*ee,y:Ht.top,width:ee,height:Y,fill:"transparent",tabIndex:0,"aria-label":Me(we),onMouseEnter:()=>te.setHover(we),onMouseLeave:()=>te.setHover(null),onFocus:()=>L(we),onBlur:()=>L(null)},`h-${we}`))]}),a.jsx(Un,{caption:o,head:[String(e),...A.map(re=>re.label??re.key)],rows:wa(I,re=>[x(E.labels[re]),...A.map((we,Se)=>{const He=je(Se,re);return He??"no data"})])}),oe!=null&&a.jsx(Zr,{x:ce(oe),y:ke,children:y?y({label:E.labels[oe],datum:M[oe]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"cny-chart-tooltip-title",children:E.labels[oe]}),A.map((re,we)=>a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-swatch",style:{background:re.color}}),a.jsx("span",{className:"cny-chart-tooltip-label",children:re.label??re.key}),a.jsx("span",{className:"cny-chart-tooltip-value",children:mn(je(we,oe))})]},we))]})}),f&&a.jsx(Is,{entries:n.map((re,we)=>({key:re.key,label:re.label??re.key,color:ln(we,re.color)})),hidden:T,onToggle:j,interactive:h})]})}function m2(t){return a.jsx(Nx,{...t,area:!1})}function g2(t){return a.jsx(Nx,{...t,area:!0})}const y2="__other",v2=t=>Number.isFinite(t)?Math.abs(t)>=1e9?Nr(t):Number.isInteger(t)?t.toLocaleString("en-US"):t.toLocaleString("en-US",{maximumFractionDigits:2}):"–";function mc(t){if(!Number.isFinite(t)||t<=0)return"0%";const e=t*100;return e<.1?"<0.1%":e<10&&Math.abs(e-Math.round(e))>.05?`${e.toFixed(1)}%`:`${Math.round(e)}%`}function Ex({data:t,height:e=260,label:n="Pie chart",innerRadius:r=0,legend:o=!0,legendToggle:s=!0,empty:i,renderTooltip:c,centerLabel:l,maxSlices:u=10,otherLabel:d="Other",valueFormatter:f=v2,animate:h=!0,className:p,style:g,sx:b}){const[x,y]=qr(360),[w,C]=Qu(),[S,M]=v.useState(!1),[R,P]=As(),T=[];let j=0;(Array.isArray(t)?t:[]).forEach((J,oe)=>{const ye=ot(J==null?void 0:J.value);if(ye===null||ye<0){j++;return}T.push({key:`k${oe}`,label:String((J==null?void 0:J.label)??""),value:ye,color:ln(oe,J==null?void 0:J.color)})});const A=Number.isFinite(u)&&u>=2?Math.floor(u):1/0,_=!S&&T.length>A;let L=T;if(_){const J=new Set([...T].sort((ye,he)=>he.value-ye.value).slice(0,A-1).map(ye=>ye.key)),oe=T.filter(ye=>!J.has(ye.key));L=T.filter(ye=>J.has(ye.key)),L.push({key:y2,label:`${d} (${oe.length})`,value:oe.reduce((ye,he)=>ye+he.value,0),color:"var(--text-muted)",members:[...oe].sort((ye,he)=>he.value-ye.value).map(ye=>({label:ye.label,value:ye.value}))})}const I=L.reduce((J,oe)=>R.has(oe.key)?J:J+oe.value,0),k=Math.max(40,Math.min(y,e)),q=y/2,U=e/2,E=k/2*.86,$=r>0?E*Math.min(r,.95):0;let X=0;const K=L.map((J,oe)=>{const ye=I>0&&!R.has(J.key)?J.value/I:0,he=X,Fe=X+ye*Math.PI*2;return X=Fe,{d:J,i:oe,start:he,end:Fe,frac:ye,color:J.color}}),ue=K.filter(J=>!R.has(J.d.key)&&J.frac>0),D=ue.length<=30?0:-1,Z=Mn(h)&&Bn(ue.length),{className:F,style:V,styleTag:H}=Ae(b,{position:"relative",...g},"cny-chart",Z&&"cny-chart-anim",p),Y=J=>Z?{...un(J,Math.min(45,500/Math.max(1,ue.length))),transformBox:"view-box",transformOrigin:`${q}px ${U}px`}:void 0,G=T.length===0||T.every(J=>!(J.value>0)),ee=J=>`${J.d.label}: ${f(J.d.value)} (${mc(J.frac)})`,ce=w!=null?K[w]:void 0,se=ce?kn(q,U,(E+$)/2,(ce.start+ce.end)/2):null,te=typeof l=="function"?l({diameter:$*2}):l;return a.jsxs("div",{ref:x,className:F,style:V,children:[H,G&&a.jsx(Ds,{children:i??"No data"}),a.jsxs("svg",{width:"100%",height:e,viewBox:`0 0 ${y} ${e}`,role:"img","aria-label":n,children:[ue.map((J,oe)=>J.frac>=.9999?a.jsx("circle",{className:ne("cny-chart-slice",Z&&"cny-x-scale",w===J.i&&"is-active"),cx:q,cy:U,r:$>0?(E+$)/2:E,fill:$>0?"none":J.color,style:{...$>0?{stroke:J.color,strokeWidth:E-$}:null,...Y(oe)},tabIndex:D,"aria-label":ee(J),onMouseEnter:()=>C(J.i),onMouseLeave:()=>C(null),onFocus:()=>C(J.i),onBlur:()=>C(null)},J.d.key):a.jsx("path",{className:ne("cny-chart-slice",Z&&"cny-x-scale",w===J.i&&"is-active"),style:Y(oe),d:s2(q,U,E,$,J.start,J.end),fill:J.color,tabIndex:D,"aria-label":ee(J),onMouseEnter:()=>C(J.i),onMouseLeave:()=>C(null),onFocus:()=>C(J.i),onBlur:()=>C(null)},J.d.key)),te!=null&&$>0&&a.jsx("foreignObject",{x:q-$,y:U-$,width:$*2,height:$*2,style:{pointerEvents:"none"},children:a.jsx("div",{className:"cny-chart-center",children:te})})]}),a.jsx(Un,{caption:n,head:["Slice","Value","Share"],rows:K.map(J=>[J.d.label,J.d.value,mc(J.frac)])}),ce&&se&&a.jsx(Zr,{x:se[0],y:se[1],children:c?c({datum:{label:ce.d.label,value:ce.d.value,color:ce.color},percent:ce.frac}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-swatch",style:{background:ce.color}}),a.jsx("span",{className:"cny-chart-tooltip-label",title:ce.d.label,children:en(ce.d.label,40)}),a.jsxs("span",{className:"cny-chart-tooltip-value",children:[f(ce.d.value)," (",mc(ce.frac),")"]})]}),ce.d.members&&a.jsxs("div",{className:"cny-chart-tooltip-more",children:[ce.d.members.slice(0,5).map((J,oe)=>a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-tooltip-label",title:J.label,children:en(J.label,28)}),a.jsx("span",{className:"cny-chart-tooltip-value",children:f(J.value)})]},oe)),ce.d.members.length>5&&a.jsxs("div",{className:"cny-chart-tooltip-label",children:["+",ce.d.members.length-5," more"]})]})]})}),o&&a.jsx(Is,{entries:K.map(J=>({key:J.d.key,label:J.d.label,color:J.color})),hidden:R,onToggle:P,interactive:s}),(_||S&&T.length>A)&&a.jsx("button",{type:"button",className:"cny-chart-more","aria-expanded":S,onClick:()=>{M(J=>!J),C(null)},children:S?"Group small slices":`Show all ${T.length} slices`}),j>0&&a.jsxs("div",{className:"cny-chart-note",role:"note",children:[j," negative or invalid ",j===1?"value":"values"," ignored"]})]})}function x2({height:t=300,children:e,className:n,style:r,sx:o}){const s=v.Children.only(e),{className:i,style:c,styleTag:l}=Ae(o,{width:"100%",height:t,...r},"cny-chart-responsive",n);return a.jsxs("div",{className:i,style:c,children:[l,v.isValidElement(s)?v.cloneElement(s,{height:t}):s]})}const Ln=864e5,gc={day:36,week:14,month:4.5,quarter:1.6},yc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xl(t){let e;if(typeof t=="string"){const n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t.trim());if(n){const r=new Date(0);return r.setUTCFullYear(+n[1],+n[2]-1,+n[3]),_h(r.getTime()/Ln)}e=new Date(t)}else if(t instanceof Date)e=t;else if(typeof t=="number"&&Number.isFinite(t))e=new Date(t);else return NaN;return Number.isNaN(e.getTime())?NaN:_h(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds())/Ln)}const b2=-354285,w2=2932896;function _h(t){return Number.isFinite(t)&&t>=b2&&t<=w2?t:NaN}const Ho=2e4,ii=.005,Oh=160;function C2(t){return t>=20?"day":t>=7?"week":t>=2.5?"month":"quarter"}function S2(t,e,n,r,o=6){const s=n>0?n:1,i=Math.max(0,Math.floor(r)||0),c=Math.max(0,Math.floor(Number.isFinite(t)?t:0)),l=Math.ceil((Number.isFinite(e)&&e>0?e:0)/s)+1,u=Math.min(i,Math.max(0,c-o)),d=Math.min(i,c+l+o);return{first:Math.min(u,d),last:d}}function Lh(t,e,n,r=24){const o=[];let s=-1/0;for(const i of t){const c=(i.start-e)*n,l=(i.end-i.start)*n;if(!Number.isFinite(c)||!Number.isFinite(l))continue;const u=i.label.length*6.5+14;let d="";c>=s&&(d=i.label,s=c+u),!(!d&&l<r)&&o.push({...i,left:c,width:l,text:d,spill:!!d&&u>l})}return o}function Fh(t){const e=new Date(Math.round(t*Ln));return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}const Ca=t=>new Date(t*Ln),Vh=t=>String(t).padStart(2,"0");function fr(t){const e=Ca(t);return`${e.getUTCFullYear()}-${Vh(e.getUTCMonth()+1)}-${Vh(e.getUTCDate())}`}function M2(t){return t<=31?"day":t<=180?"week":t<=900?"month":"quarter"}function Ci(t,e){const n=Math.floor(e),r=Ca(n);switch(t){case"day":return n;case"week":return n-(r.getUTCDay()+6)%7;case"month":return Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),1)/Ln;case"quarter":return Date.UTC(r.getUTCFullYear(),r.getUTCMonth()-r.getUTCMonth()%3,1)/Ln;case"year":return Date.UTC(r.getUTCFullYear(),0,1)/Ln}}function bl(t,e){const n=Ca(e);switch(t){case"day":return e+1;case"week":return e+7;case"month":return Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+1,1)/Ln;case"quarter":return Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+3,1)/Ln;case"year":return Date.UTC(n.getUTCFullYear()+1,0,1)/Ln}}function vc(t,e){const n=Ca(e);switch(t){case"day":return String(n.getUTCDate());case"week":return`${n.getUTCDate()} ${yc[n.getUTCMonth()]}`;case"month":return yc[n.getUTCMonth()];case"quarter":return`Q${Math.floor(n.getUTCMonth()/3)+1}`;case"monthYear":return`${yc[n.getUTCMonth()]} ${n.getUTCFullYear()}`;case"year":return String(n.getUTCFullYear())}}function Bh(t,e,n){const r=(s,i)=>{const c=[];let l=0;for(let u=Ci(s,e);u<n&&l++<6e4;u=bl(s,u)){const d=bl(s,u);if(!(d>u))break;c.push({start:Math.max(u,e),end:Math.min(d,n),label:i(u)})}return c};return{top:t==="day"||t==="week"?r("month",s=>vc("monthYear",s)):r("year",s=>vc("year",s)),bottom:r(t,s=>vc(t,s))}}function R2(t,e,n,r,o){if(n>=t+14)return`M ${t} ${e} H ${t+7} V ${r} H ${n-1}`;const s=e+(r>=e?o/2:-o/2);return`M ${t} ${e} H ${t+7} V ${s} H ${n-8} V ${r} H ${n-1}`}const Go=44,Uh=6,Hh=16,T2=300,j2=200,zo=64,kx=120,Gh=1.5,P2=()=>{var t;return typeof process<"u"&&((t=process.env)==null?void 0:t.NODE_ENV)!=="production"};function N2(){const[t,e]=v.useState(!1);return v.useEffect(()=>{var o;if(typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia("(pointer: coarse)"),r=()=>e(n.matches);return r(),(o=n.addEventListener)==null||o.call(n,"change",r),()=>{var s;return(s=n.removeEventListener)==null?void 0:s.call(n,"change",r)}},[]),t}function E2(){const[t,e]=v.useState(!1);return v.useEffect(()=>{var o;if(typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>e(n.matches);return r(),(o=n.addEventListener)==null||o.call(n,"change",r),()=>{var s;return(s=n.removeEventListener)==null?void 0:s.call(n,"change",r)}},[]),t}function k2(t){const e=new Map,n=new Set,r=[];let o=0,s=0;const i=Array.isArray(t)?t:[];for(let c=0;c<i.length;c++){const l=i[c];if(!l||typeof l!="object"){o++;continue}let u=xl(l.start),d=l.milestone?u:xl(l.end);if(Number.isNaN(u)||Number.isNaN(d)){o++;continue}d<u&&([u,d]=[d,u],s++);const f=!l.milestone&&Number.isInteger(d);f&&(d+=1),!l.milestone&&d-u<1&&(d=u+1);let h=l.id==null?"":String(l.id);if(!h||n.has(h)){let y=2;const w=h||`task-${c}`;for(h=w;n.has(h);)h=`${w}~${y++}`;s++}n.add(h);const p=l.group==null||l.group===""?void 0:String(l.group);p&&!e.has(p)&&e.set(p,e.size);const g=l.name==null?h:String(l.name),b=Math.round(Math.min(100,Math.max(0,Jn(l.progress,0)))*10)/10;let x=[];if(Array.isArray(l.dependsOn)&&l.dependsOn.length){const y=new Set;for(const w of l.dependsOn){if(y.size>=j2)break;w!=null&&y.add(String(w))}x=[...y]}r.push({raw:l,id:h,name:g,label:en(g,kx),start:u,end:d,inclusive:f,progress:b,color:ln(p?e.get(p)??0:0,typeof l.color=="string"?l.color:void 0),group:p,deps:x,milestone:!!l.milestone})}for(const c of r)c.deps.length&&(c.deps=c.deps.filter(l=>l!==c.id));return{parsed:r,skipped:o,fixed:s}}function A2({tasks:t,scale:e,height:n=360,rowHeight:r=36,nameWidth:o=200,pxPerDay:s,zoomControls:i=!1,label:c="Gantt chart",today:l,showToday:u=!0,editable:d=!1,onTaskChange:f,onTaskClick:h,defaultCollapsed:p,animate:g=!0,loading:b=!1,empty:x,renderTooltip:y,className:w,style:C,sx:S}){const M=v.useRef(null),R=v.useRef(null),P=v.useRef(null),{ref:T,overflowing:j}=cu(),A=W=>{R.current=W,T(W)},_=E2(),L=N2(),[I,k]=v.useState(()=>new Set(p)),[q,U]=v.useState(null),[E,$]=v.useState(null),[X,K]=v.useState(1),[ue,D]=v.useState(null),[Z,F]=v.useState(0),[V,H]=v.useState(0),[Y,G]=v.useState(0),[ee,ce]=v.useState(!0),se=v.useRef(null),te=v.useRef(!1),J=v.useRef(!1),oe=Math.max(L?44:16,Jn(r,36)),ye=Math.max(Go+oe,Jn(n,360)),{parsed:he,skipped:Fe,fixed:Ve}=v.useMemo(()=>k2(t),[t]),ie=v.useMemo(()=>new Map(he.map(W=>[W.id,W])),[he]),Q=g&&!_&&Bn(he.length,300);v.useEffect(()=>{if(!Q)return;const W=setTimeout(()=>ce(!1),1600+Math.min(he.length,40)*40);return()=>clearTimeout(W)},[Q,he.length]);const me=v.useMemo(()=>he.map(W=>[W.name,W.group??"",fr(W.start),fr(W.milestone?W.start:W.inclusive?W.end-1:W.end),W.milestone?"Milestone":`${W.progress}%`,W.deps.map(N=>{var B;return((B=ie.get(N))==null?void 0:B.name)??N}).join(", ")]),[he,ie]),je=v.useCallback(()=>{const W=R.current,N=M.current;W&&H(B=>B===W.clientHeight?B:W.clientHeight),N&&G(B=>B===N.clientWidth?B:N.clientWidth)},[]),Me=!b&&he.length>0;v.useLayoutEffect(()=>{if(je(),typeof ResizeObserver>"u")return;const W=new ResizeObserver(je);return R.current&&W.observe(R.current),M.current&&W.observe(M.current),()=>W.disconnect()},[je,Me]);const be=Y>0?Math.max(zo,Math.floor(Y*.5)):640,ke=Math.round(Math.min(be,Math.max(zo,ue??Jn(o,200)))),re=v.useMemo(()=>{if(!he.length)return{scale:e??"week",from:0,to:0,ppd:gc.week,coarsened:!1};let W=1/0,N=-1/0;for(const cr of he)cr.start<W&&(W=cr.start),cr.end>N&&(N=cr.end);const B=N-W,fe=ot(s),Te=fe&&fe>0?fe:gc[e&&gc[e]?e:M2(B)],$e=Math.min(Oh,Math.max(ii,Te*X));let Ue=Math.min($e,Math.max(ii,Ho/(B+4)));const nt=C2(Ue),gt=nt==="day"?Math.floor(W)-1:Ci(nt,W);let St=nt==="day"?Math.ceil(N)+2:bl(nt,Ci(nt,N));(St-gt)*Ue>Ho&&(Ue=Math.max(ii,Ho/(St-gt)));const Mt=Y-ke;return Mt>0&&(St-gt)*Ue<Mt&&(St=gt+Mt/Ue),{scale:nt,from:gt,to:St,ppd:Ue,coarsened:Ue<$e-1e-9}},[he,e,s,X,Y,ke]),{scale:we,from:Se,to:He,ppd:Oe}=re;v.useEffect(()=>{!re.coarsened||J.current||!P2()||!e&&!s&&X===1||(J.current=!0,console.warn(`[GanttChart] The requested scale/zoom would make the timeline wider than ${Ho}px for this date range; using a coarser scale (${we}, ${Oe.toFixed(3)}px/day).`))},[re.coarsened,e,s,X,we,Oe]);const pe=Math.max(0,Math.round((He-Se)*Oe)),O=W=>(W-Se)*Oe,ae=v.useMemo(()=>{const W=Bh(we,Se,He);return{top:Lh(W.top,Se,Oe),bottom:Lh(W.bottom,Se,Oe)}},[we,Se,He,Oe]),Ce=v.useMemo(()=>{const W=Bh(we,Se,He).bottom;let N="";for(const B of W){const fe=Math.round((B.start-Se)*Oe)+.5;(B.end-B.start)*Oe<6||(N+=`M${fe} 0V1 `)}return N},[we,Se,He,Oe]),Le=v.useMemo(()=>{const W=[],N=new Map;for(const $e of he)$e.group?(N.has($e.group)||(N.set($e.group,[]),W.push({type:"group",name:$e.group})),N.get($e.group).push($e)):W.push({type:"task",p:$e});const B=[];for(const $e of W){if($e.type==="task"){B.push({kind:"task",key:`t:${$e.p.id}`,p:$e.p,indent:!1});continue}const Ue=N.get($e.name),nt=!I.has($e.name);let gt=1/0,St=-1/0;for(const Mt of Ue)Mt.start<gt&&(gt=Mt.start),Mt.end>St&&(St=Mt.end);if(B.push({kind:"group",key:`g:${$e.name}`,name:$e.name,start:gt,end:St,color:Ue[0].color,count:Ue.length,open:nt}),nt)for(const Mt of Ue)B.push({kind:"task",key:`t:${Mt.id}`,p:Mt,indent:!0})}const fe=new Map;B.forEach(($e,Ue)=>$e.kind==="task"&&fe.set($e.p.id,Ue));const Te=new Map;for(const $e of he)for(const Ue of $e.deps){if(!ie.has(Ue))continue;const nt=Te.get(Ue);nt?nt.push($e.id):Te.set(Ue,[$e.id])}return{rows:B,rowIndex:fe,succ:Te}},[he,I,ie]),{rows:le,rowIndex:de,succ:Re}=Le,ve=S2(Z,(V||ye)-Go,oe,le.length),Ie=le.length*oe,qe=ve.first*oe,Ye=Math.max(0,(ve.last-ve.first)*oe),Be=W=>q&&q.id===W.id?{start:q.start,end:q.end}:{start:W.start,end:W.end},ze=W=>{const{start:N,end:B}=Be(W);return W.milestone?{left:O(N)-Hh/2,width:Hh}:{left:O(N),width:Math.max(Uh,(B-N)*Oe)}},We=(W,N,B)=>{N===W.start&&B===W.end||f==null||f({...W.raw,start:Fh(N),end:Fh(W.milestone?N:W.inclusive?B-1:B)},W.raw)},Qe=(W,N,B)=>{let fe=W.start,Te=W.end;return N==="move"||W.milestone?(fe+=B,Te+=B):N==="start"?fe=Math.min(fe+B,Te-1):Te=Math.max(Te+B,fe+1),{s:fe,e:Te}},De=W=>{var fe;const N=(fe=W==null?void 0:W.closest)==null?void 0:fe.call(W,"[data-task]"),B=(N==null?void 0:N.dataset.task)!=null?ie.get(N.dataset.task):void 0;return N&&B?{el:N,p:B}:null},et=W=>{var fe,Te,$e;const N=De(W.target);if(!d||!N||(W.button??0)>0)return;const B=((fe=W.target.dataset)==null?void 0:fe.handle)??"move";se.current={id:N.p.id,mode:B,x0:W.clientX,start:N.p.start,end:N.p.end,moved:!1},($e=(Te=N.el).setPointerCapture)==null||$e.call(Te,W.pointerId),$(null)},At=W=>{const N=se.current,B=N&&ie.get(N.id);if(!N||!B)return;const fe=W.clientX-N.x0;if(Math.abs(fe)>3&&(N.moved=!0),!N.moved)return;const{s:Te,e:$e}=Qe(B,N.mode,Math.round(fe/Oe));U({id:B.id,start:Te,end:$e})},it=W=>{const N=se.current,B=N&&ie.get(N.id);!N||!B||(se.current=null,N.moved&&(te.current=!0,setTimeout(()=>te.current=!1,0),W&&q&&We(B,q.start,q.end)),U(null))},xt=W=>{const N=De(W.target);if(!N)return;const B=N.p;if(W.key==="Enter"||W.key===" "){W.preventDefault(),h==null||h(B.raw);return}if(!d||W.key!=="ArrowLeft"&&W.key!=="ArrowRight")return;W.preventDefault();const fe=W.key==="ArrowRight"?1:-1,{s:Te,e:$e}=Qe(B,W.shiftKey?"end":"move",fe);We(B,Te,$e)},st=W=>{const N=De(W.target);N&&!te.current&&(h==null||h(N.p.raw))},ct=(W,N,B)=>{var Te;const fe=(Te=M.current)==null?void 0:Te.getBoundingClientRect();fe&&$({id:W,x:N-fe.left,y:B-fe.top})},bt=W=>{if(se.current)return;const N=De(W.target);N?ct(N.p.id,W.clientX,W.clientY):$(B=>B&&null)},Rn=W=>{const N=De(W.target);if(!N)return;const B=N.el.getBoundingClientRect();ct(N.p.id,B.left+B.width/2,B.top)},wt=E?ie.get(E.id):void 0;v.useLayoutEffect(()=>{const W=P.current,N=M.current;if(!W||!N||!E)return;const{left:B,top:fe}=jx(E.x,E.y,W.offsetWidth,W.offsetHeight,N.clientWidth,N.clientHeight);W.style.left=`${B}px`,W.style.top=`${fe}px`,W.style.transform="none"},[E,wt]);const Jr=()=>{const W=R.current;if(!W)return;const N=Math.floor(Math.max(0,W.scrollTop-Go)/oe);F(B=>B===N?B:N),$(B=>B&&null)},_o=v.useCallback(W=>{k(N=>{const B=new Set(N);return B.has(W)?B.delete(W):B.add(W),B})},[]),Ct=v.useRef(null),Tn=W=>{var N,B;Ct.current={x0:W.clientX,w0:ke},(B=(N=W.currentTarget).setPointerCapture)==null||B.call(N,W.pointerId),W.preventDefault()},Qr=W=>{const N=Ct.current;N&&D(Math.min(be,Math.max(zo,N.w0+W.clientX-N.x0)))},eo=W=>{W.key!=="ArrowLeft"&&W.key!=="ArrowRight"||(W.preventDefault(),D(Math.min(be,Math.max(zo,ke+(W.key==="ArrowRight"?16:-16)))))},{className:kr,style:ir,styleTag:_t}=Ae(S,{position:"relative","--cny-gantt-row":`${oe}px`,"--cny-gantt-name":`${ke}px`,...C},"cny-chart","cny-gantt",Q&&"is-animated",Q&&ee&&"is-entering",w);if(b)return a.jsxs("div",{className:kr,style:ir,"aria-busy":"true",children:[_t,a.jsx("div",{className:"cny-gantt-skeleton",style:{minHeight:Math.min(ye,6*oe+Go)},children:Array.from({length:6}).map((W,N)=>a.jsxs("div",{className:"cny-gantt-skeleton-row",style:{height:oe},children:[a.jsx(jt,{shape:"text",width:Math.max(24,ke-40)}),a.jsx(jt,{shape:"rect",height:Math.max(4,oe-18),width:`${25+N*17%40}%`,sx:{marginLeft:`${N*9%35}%`}})]},N))})]});const jn=Fe>0?`${Fe} task${Fe===1?"":"s"} skipped: invalid or missing dates.`:"";if(!he.length)return a.jsxs("div",{className:kr,style:{minHeight:Math.min(ye,160),...ir},children:[_t,a.jsx(Ds,{children:x??"No tasks"}),jn&&a.jsx("span",{className:"cny-sr-only",role:"status",children:jn})]});const dn=u?xl(l??new Date):NaN,Gn=!Number.isNaN(dn)&&dn>=Se&&dn<=He,zn=O(dn),Oo=Gn&&ae.bottom.some(W=>{if(!W.text)return!1;const N=W.left+6;return N<zn+22&&N+W.text.length*6.6+4>zn-22}),Lo=we==="day"||we==="week",Ar=(()=>{if(!Lo)return"";let W="";for(let N=Ci("week",Se);N<He;N+=7){const B=Math.round(O(N+5)*100)/100;W+=`M${B} 0h${Math.round(2*Oe*100)/100}v1h-${Math.round(2*Oe*100)/100}z `}return W})(),ar=[],to=new Set,Ir=(W,N)=>{if(ar.length>=T2)return;const B=`${W.id}>${N.id}`,fe=de.get(W.id),Te=de.get(N.id);if(fe===void 0||Te===void 0||to.has(B))return;to.add(B);const $e=ze(W),Ue=ze(N),nt=$e.left+$e.width,gt=(fe-ve.first)*oe+oe/2,St=Ue.left,Mt=(Te-ve.first)*oe+oe/2;ar.push({key:B,d:R2(nt,gt,St,Mt,oe),head:`M ${St} ${Mt} l -5 -3.5 v 7 z`})};for(let W=ve.first;W<ve.last;W++){const N=le[W];if(N.kind!=="task")continue;for(const fe of N.p.deps){const Te=ie.get(fe);Te&&Ir(Te,N.p)}const B=Re.get(N.p.id);if(B)for(const fe of B){const Te=ie.get(fe);Te&&Ir(N.p,Te)}}const Fo=Math.min(ve.last-ve.first,40)*40+320,Dr=[];for(let W=ve.first;W<ve.last;W++){const N=le[W];if(N.kind==="group"){const Te=O(N.start);Dr.push(a.jsx(I2,{name:N.name,open:N.open,count:N.count,color:N.color,top:W*oe,h:oe,timelineW:pe,left:Te,width:Math.max(Uh,O(N.end)-Te),onToggle:_o},N.key));continue}const B=N.p,fe=ze(B);Dr.push(a.jsx(D2,{p:B,i:W,top:W*oe,h:oe,indent:N.indent,timelineW:pe,left:fe.left,width:fe.width,editable:d,dragging:(q==null?void 0:q.id)===B.id},N.key))}return a.jsxs("div",{ref:M,className:kr,style:ir,role:"group","aria-label":c,"data-skipped":Fe||void 0,children:[_t,i&&a.jsx("div",{className:"cny-gantt-toolbar",children:a.jsxs("div",{className:"cny-gantt-zoom",role:"group","aria-label":"Zoom",children:[a.jsx("button",{type:"button",className:"cny-gantt-zoom-btn","aria-label":"Zoom out",onClick:()=>K(W=>Math.max(.02,W/Gh)),disabled:Oe<=ii*1.01,children:"−"}),a.jsx("button",{type:"button",className:"cny-gantt-zoom-btn","aria-label":"Zoom in",onClick:()=>K(W=>Math.min(60,W*Gh)),disabled:Oe>=Oh*.99||pe>=Ho*.98,children:"+"})]})}),a.jsx("div",{ref:A,className:"cny-gantt-scroll cny-scroll",role:"region","aria-label":`${c} scroll area`,tabIndex:j?0:void 0,style:{maxHeight:ye},onScroll:Jr,children:a.jsxs("div",{className:"cny-gantt-inner",style:{width:ke+pe},children:[a.jsxs("div",{className:"cny-gantt-head",style:{height:Go},children:[a.jsxs("div",{className:"cny-gantt-corner",children:["Task",a.jsx("span",{className:"cny-gantt-resize",role:"separator","aria-orientation":"vertical","aria-label":"Resize task name column","aria-valuenow":ke,"aria-valuemin":zo,"aria-valuemax":be,tabIndex:0,onPointerDown:Tn,onPointerMove:Qr,onPointerUp:()=>Ct.current=null,onPointerCancel:()=>Ct.current=null,onKeyDown:eo})]}),a.jsxs("div",{className:"cny-gantt-timeline-head",style:{width:pe},children:[["top","bottom"].map(W=>a.jsx("div",{className:ne("cny-gantt-tier",`is-${W}`),children:ae[W].map(N=>a.jsx("div",{className:ne("cny-gantt-cell",N.spill&&"is-spill"),style:{left:N.left,width:N.width},children:N.text&&a.jsx("span",{className:"cny-gantt-cell-text",children:N.text})},`${we}-${N.start}`))},W)),Gn&&a.jsx("span",{className:ne("cny-gantt-today-flag",Oo&&"is-mark"),style:{left:O(dn)},children:"Today"})]})]}),a.jsxs("div",{className:"cny-gantt-body",style:{height:Ie},onClick:st,onKeyDown:xt,onPointerDown:et,onPointerMove:At,onPointerUp:()=>it(!0),onPointerCancel:()=>it(!1),onMouseOver:bt,onMouseMove:bt,onMouseLeave:()=>$(null),onFocus:Rn,onBlur:()=>$(null),children:[Dr,a.jsxs("svg",{className:"cny-gantt-grid",style:{top:qe,height:Ye},width:pe,height:Ye,"aria-hidden":"true",children:[Ar&&a.jsx("path",{className:"cny-gantt-weekend",d:Ar,transform:`scale(1 ${Ye})`}),a.jsx("path",{className:"cny-gantt-line",d:Ce,transform:`scale(1 ${Ye})`}),Gn&&a.jsx("line",{className:"cny-gantt-today",x1:O(dn),x2:O(dn),y1:0,y2:Ye})]}),ar.length>0&&a.jsx("svg",{className:"cny-gantt-deps",style:{top:qe,width:pe,height:Ye,"--cny-gantt-dep-delay":`${Fo}ms`},width:pe,height:Ye,"aria-hidden":"true",children:ar.map(W=>a.jsxs("g",{className:"cny-gantt-dep",children:[a.jsx("path",{d:W.d,pathLength:1}),a.jsx("path",{className:"cny-gantt-dep-head",d:W.head})]},W.key))})]})]})}),jn&&a.jsx("span",{className:"cny-sr-only",role:"status",children:jn}),Ve>0&&a.jsx("span",{className:"cny-sr-only",role:"status",children:`${Ve} task${Ve===1?" was":"s were"} adjusted (swapped dates or renamed duplicate id).`}),a.jsx("div",{className:"cny-sr-only",children:a.jsx(Un,{caption:c,head:["Task","Group","Start","End","Progress","Depends on"],rows:me,maxRows:100})}),E&&wt&&a.jsx("div",{ref:P,className:"cny-chart-tooltip",style:{left:E.x,top:E.y},children:y?y(wt.raw):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"cny-chart-tooltip-title",children:wt.name}),wt.milestone?a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-tooltip-label",children:"Milestone"}),a.jsx("span",{className:"cny-chart-tooltip-value",children:fr(Be(wt).start)})]}):a.jsxs(a.Fragment,{children:[a.jsx(ai,{k:"Start",v:fr(Be(wt).start)}),a.jsx(ai,{k:"End",v:fr(wt.inclusive?Be(wt).end-1:Be(wt).end)}),a.jsx(ai,{k:"Duration",v:$2(Be(wt).end-Be(wt).start)}),a.jsx(ai,{k:"Progress",v:`${wt.progress}%`})]})]})})]})}const I2=v.memo(function({name:e,open:n,count:r,color:o,top:s,h:i,timelineW:c,left:l,width:u,onToggle:d}){return a.jsxs("div",{className:"cny-gantt-row is-group",style:{top:s,height:i},children:[a.jsx("div",{className:"cny-gantt-name",children:a.jsxs("button",{type:"button",className:"cny-gantt-toggle","aria-expanded":n,title:e,onClick:()=>d(e),children:[a.jsx("svg",{className:"cny-gantt-chevron",viewBox:"0 0 16 16",width:"12",height:"12","aria-hidden":"true",children:a.jsx("path",{d:"M6 3.5 10.5 8 6 12.5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),a.jsx("span",{className:"cny-gantt-label",children:en(e,kx)}),a.jsx("span",{className:"cny-gantt-count",children:r})]})}),a.jsx("div",{className:"cny-gantt-track",style:{width:c},children:a.jsx("span",{className:"cny-gantt-groupbar",style:{left:l,width:u,background:o}})})]})}),D2=v.memo(function({p:e,i:n,top:r,h:o,indent:s,timelineW:i,left:c,width:l,editable:u,dragging:d}){return a.jsxs("div",{className:"cny-gantt-row",style:{top:r,height:o},children:[a.jsx("div",{className:ne("cny-gantt-name",s&&"is-indent"),children:a.jsx("span",{className:"cny-gantt-label",title:e.name,children:e.label})}),a.jsx("div",{className:"cny-gantt-track",style:{width:i},children:a.jsxs("div",{className:ne("cny-gantt-bar",e.milestone&&"is-milestone",u&&"is-editable",d&&"is-dragging"),role:"button",tabIndex:0,"aria-label":_2(e),"data-task":e.id,style:{left:c,width:l,"--cny-gantt-color":e.color,"--cny-gantt-i":Math.min(n,40)},children:[!e.milestone&&e.progress>0&&a.jsx("span",{className:"cny-gantt-progress",style:{width:`${e.progress}%`}}),u&&!e.milestone&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"cny-gantt-handle is-start","data-handle":"start"}),a.jsx("span",{className:"cny-gantt-handle is-end","data-handle":"end"})]})]})})]})});function ai({k:t,v:e}){return a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-tooltip-label",children:t}),a.jsx("span",{className:"cny-chart-tooltip-value",children:e})]})}function $2(t){const e=Math.round(t*10)/10;return`${e} day${e===1?"":"s"}`}function _2(t){if(t.milestone)return`${t.name}: milestone, ${fr(t.start)}`;const e=fr(t.inclusive?t.end-1:t.end);return`${t.name}: ${fr(t.start)} to ${e}, ${t.progress}% complete`}function O2({data:t,innerRadius:e=.62,centerLabel:n,centerCaption:r,valueFormatter:o=g=>Math.abs(g)>=1e9?Nr(g):$s(g),label:s="Donut chart",animate:i=!0,loading:c,empty:l,height:u=260,className:d,style:f,sx:h,...p}){const g=Mn(i)&&Bn(Array.isArray(t)?t.length:0),b=(Array.isArray(t)?t:[]).reduce((w,C)=>{const S=ot(C==null?void 0:C.value);return S!==null&&S>0?w+S:w},0),x=ed(Number.isFinite(b)?b:0,g),y=n??(({diameter:w})=>{const C=o(td(x,b)),S=Math.max(10,Math.min(24,w*.8/(Math.max(C.length,1)*.62)));return a.jsxs("div",{style:{maxWidth:"100%"},children:[a.jsx("div",{className:"cny-chart-center-value",style:{fontSize:S},title:C,children:C}),r!=null&&a.jsx("div",{className:"cny-chart-center-caption",children:r})]})});return a.jsx(Er,{animate:g,loading:c,height:u,className:["cny-chart-donut",d].filter(Boolean).join(" "),style:f,sx:h,children:a.jsx(Ex,{...p,animate:!1,data:t,valueFormatter:o,height:u,label:s,empty:l,innerRadius:e,centerLabel:y})})}function Ax({data:t,valueKey:e="value",variant:n="line",width:r=120,height:o=32,color:s,showLast:i=!0,label:c="Trend",emptyText:l="—",animate:u=!0,loading:d,className:f,style:h,sx:p}){const g=Array.isArray(t)?t:[],b=Math.max(8,Jn(r,120)),x=Math.max(8,Jn(o,32)),y=ln(0,s),w=3,C=b-w*2,S=n==="bar",M=g.map(H=>typeof H=="number"?H:H&&typeof H=="object"?H[e]:null),R=S?Ju(M,Math.max(1,Math.floor(C/3)),"mean"):[],P=S?R.length:M.length,T=Rx(S?R:M),j=T!==null,A=S?Math.min(0,(T==null?void 0:T[0])??0):(T==null?void 0:T[0])??0,_=S?Math.max(0,(T==null?void 0:T[1])??0):(T==null?void 0:T[1])??0,L=_===A,I=L?1:_-A,k=H=>P<=1?b/2:w+H*C/(P-1),q=H=>L&&!S?x/2:w+(x-w*2)*(1-(H-A)/I);let U="",E="",$=null,X=R.length;if(!S&&j){const H=M.map((se,te)=>({x:te,y:ot(se)??NaN})),Y=Tx(H,Math.max(8,Math.ceil(C)));X=Y.length;const G=Y.map(se=>Number.isFinite(se.y)?{x:k(se.x),y:q(se.y)}:{x:NaN,y:NaN});U=Vi(G);let ee=[];const ce=()=>{ee.length>1&&(E+=`${Vi(ee)}L${ee[ee.length-1].x} ${x-w}L${ee[0].x} ${x-w}Z`),ee=[]};for(const se of G)Number.isFinite(se.y)?ee.push(se):ce();ce();for(let se=G.length-1;se>=0;se--)if(Number.isFinite(G[se].y)){$=[G[se].x,G[se].y];break}}const K=P?C/P:0,ue=Math.max(1,K>4?K-2:K-1),D=Mn(u)&&Bn(X),Z=Math.min(g.length,200),F=Array.from({length:Z},(H,Y)=>{const G=Z<=1?0:Math.round(Y*(g.length-1)/(Z-1)),ee=ot(M[G]);return[G+1,ee===null?"–":ee]}),V={display:"inline-block",width:b,maxWidth:"100%",lineHeight:0,...h};return a.jsxs(Er,{animate:D,loading:d,height:x,className:ne("cny-chart-spark",f),style:d?{...V,height:x}:V,sx:p,children:[j?a.jsx("svg",{width:"100%",height:x,viewBox:`0 0 ${b} ${x}`,preserveAspectRatio:"none",role:"img","aria-label":c,children:S?R.map((H,Y)=>{if(!Number.isFinite(H))return null;const G=q(0),ee=q(H);return a.jsx("rect",{className:"cny-chart-bar cny-x-grow-y cny-x-mark",style:un(Y),x:w+Y*K+(K-ue)/2,y:Math.min(ee,G),width:ue,height:Math.max(1,Math.abs(G-ee)),rx:Math.min(1.5,ue/2),fill:y},Y)}):a.jsxs(a.Fragment,{children:[n==="area"&&E&&a.jsx("path",{className:"cny-chart-area cny-x-fade",d:E,fill:y}),U&&a.jsx("path",{className:"cny-chart-line cny-x-draw",d:U,fill:"none",stroke:y,pathLength:1}),i&&$&&a.jsx("circle",{className:"cny-chart-dot cny-x-pop cny-x-late",cx:$[0],cy:$[1],r:3,fill:y})]})}):a.jsx("span",{className:"cny-chart-spark-empty",style:{height:x},children:l}),a.jsx(Un,{caption:c,head:["Index","Value"],rows:F})]})}const ci=Math.PI/180,L2=t=>{if(!Number.isFinite(t))return"–";const e=Math.abs(t);return e>=1e6||e>0&&e<.01?Nr(t):$s(t)};function F2({value:t,min:e=0,max:n=100,thresholds:r,color:o,variant:s="semi",needle:i,height:c=180,caption:l,valueFormatter:u,label:d="Gauge",animate:f=!0,loading:h,className:p,style:g,sx:b}){const x=Mn(f),y=u??L2,w=V=>Number.isFinite(V)?y(V):"–";let C=ot(e)??0,S=ot(n)??100;S<C&&([C,S]=[S,C]),S===C&&(S=C+1);const M=ot(t),R=M??C,P=S-C,T=Math.min(1,Math.max(0,(R-C)/P)),j=s==="semi",A=(j?-90:-135)*ci,_=(j?90:135)*ci,L=(i??j)&&M!==null,I=80,k=100,q=(r??[]).map(V=>({from:ot(V==null?void 0:V.from),color:V==null?void 0:V.color})).filter(V=>V.from!==null&&!!V.color).sort((V,H)=>V.from-H.from),U=M===null?void 0:[...q].reverse().find(V=>R>=V.from),E=(U==null?void 0:U.color)??ln(0,o),$=ed(R,x),X=(A+(_-A)*T)/ci,K=j?L?152:118:190,ue=M===null?"–":w(td($,R)),D=Math.max(11,Math.min(26,112/(Math.max(ue.length,1)*.62))),Z=en(w(C),9),F=en(w(S),9);return a.jsxs(Er,{animate:x,loading:h,height:c,className:ne("cny-chart-gauge",p),style:g,sx:b,children:[a.jsxs("svg",{width:"100%",height:c,viewBox:`0 0 200 ${K}`,role:"img","aria-label":`${d}: ${M===null?"no value":w(R)} of ${w(S)}`,children:[a.jsx("path",{className:"cny-chart-gauge-track",d:pc(k,k,I,A,_),fill:"none",pathLength:100}),q.length>1&&q.map((V,H)=>{var ee;const Y=Math.min(1,Math.max(0,(V.from-C)/P)),G=Math.min(1,Math.max(0,((((ee=q[H+1])==null?void 0:ee.from)??S)-C)/P));return G>Y?a.jsx("path",{className:"cny-chart-gauge-band",d:pc(k,k,I+10,A+(_-A)*Y,A+(_-A)*G),fill:"none",stroke:V.color},H):null}),M!==null&&a.jsx("path",{className:"cny-chart-gauge-arc cny-x-sweep",d:pc(k,k,I,A,A+(_-A)*Math.max(T,1e-4)),fill:"none",stroke:E,pathLength:100}),L&&a.jsx("g",{transform:`translate(${k} ${k})`,children:a.jsxs("g",{className:"cny-chart-gauge-needle cny-x-needle",style:{"--from":`${A/ci}deg`,transform:`rotate(${X}deg)`},children:[a.jsx("line",{x1:0,y1:0,x2:0,y2:-66,stroke:"var(--text-primary)",strokeWidth:3,strokeLinecap:"round"}),a.jsx("circle",{r:6,fill:"var(--text-primary)"})]})}),a.jsx("text",{className:"cny-chart-gauge-value",x:k,y:j?L?k+38:k-10:k+4,textAnchor:"middle",style:{fontSize:D},children:ue}),l&&a.jsx("text",{className:"cny-chart-axis",x:k,y:j?L?k+54:k+6:k+24,textAnchor:"middle",children:en(l,30)}),a.jsx("text",{className:"cny-chart-axis",x:j?k-I:k-I*.7071,y:j?k+16:k+I*.7071+20,textAnchor:"middle",children:Z}),a.jsx("text",{className:"cny-chart-axis",x:j?k+I:k+I*.7071,y:j?k+16:k+I*.7071+20,textAnchor:"middle",children:F})]}),a.jsx(Un,{caption:d,head:["Value","Min","Max"],rows:[[M===null?"–":R,C,S]]})]})}const V2=t=>{if(!Number.isFinite(t))return"–";const e=Math.abs(t);return e>=1e9||e>0&&e<.01?Nr(t):$s(t)};function B2({label:t,value:e,valueFormatter:n=V2,delta:r,deltaLabel:o,deltaInverse:s=!1,trend:i,color:c,icon:l,animate:u=!0,loading:d,className:f,style:h,sx:p}){const g=Mn(u),b=typeof e=="number",x=b?ot(e):null,y=ed(x??0,g&&x!==null),w=typeof r=="number"?r:null,C=w===1/0,S=w!==null?ot(w):null,M=w!==null&&S===null&&!C,R=M||w===null||S===0?"flat":C||S>0?"up":"down",P=R==="flat"?null:R==="up"!==s,T=b?x===null?"–":n(td(y,x)):String(e??""),j=C?"new":M||S===null?"—":`${S>0?"+":""}${Math.abs(S)>=1e5?Nr(S):$s(S)}%`;return a.jsxs(Er,{animate:g,loading:d,height:96,className:ne("cny-stat",f),style:h,sx:p,children:[a.jsxs("div",{className:"cny-stat-head",children:[a.jsx("span",{className:"cny-stat-label",title:t,children:t}),l&&a.jsx("span",{className:"cny-stat-icon",children:l})]}),a.jsxs("div",{className:"cny-stat-body",children:[a.jsx("span",{className:"cny-stat-value",title:T,children:T}),Array.isArray(i)&&i.length>1&&a.jsx(Ax,{data:i,variant:"area",width:96,height:36,color:c,label:`${t} trend`,animate:u})]}),w!==null&&a.jsxs("div",{className:ne("cny-stat-delta",P===!0&&"is-good",P===!1&&"is-bad"),children:[!M&&a.jsx("span",{"aria-hidden":"true",children:R==="up"?"▲":R==="down"?"▼":"–"}),a.jsx("span",{children:j}),o&&a.jsx("span",{className:"cny-stat-delta-label",children:o})]})]})}function U2({data:t,axisKey:e,series:n,height:r=300,max:o,levels:s=4,fill:i=!0,legend:c=!0,legendToggle:l=!0,normalize:u="auto",label:d="Radar chart",animate:f=!0,loading:h,empty:p,className:g,style:b,sx:x}){const[y,w]=qr(360),[C,S]=As(),M=Array.isArray(t)?t:[],R=Array.isArray(n)?n:[],P=R.map((Q,me)=>({...Q,color:ln(me,Q.color)})).filter(Q=>!C.has(Q.key)),T=M.length,j=Mn(f)&&Bn(T*Math.max(1,P.length),400),A=(Q,me)=>ot(Q==null?void 0:Q[me]),_=(Q,me)=>Math.max(0,Jn(Q==null?void 0:Q[me],0)),L=Q=>String((Q==null?void 0:Q[e])??""),I=ot(o),k=M.map(Q=>Math.max(0,...R.map(me=>_(Q,me.key)))),q=Math.max(0,...k),U=I!==null&&I>0?I:q||1,E=k.filter(Q=>Q>0),$=E.length?Math.max(...E)/Math.min(...E):1,X=u===!0||u==="auto"&&I===null&&$>20,K=Q=>X?k[Q]||1:U,ue=(Q,me)=>Math.min(1,_(M[Q],me)/K(Q)),D=T===0||q<=0,Z=Math.min(10,Math.max(1,Math.floor(Jn(s,4)))),F=w/2,V=r/2,H=M.reduce((Q,me)=>Math.max(Q,L(me).length),0),Y=Math.max(40,Math.min(96,H*6.5+8,w/4+20)),G=Math.max(10,Math.min(w/2-Y-8,r/2-28)),ee=G>=34,ce=Math.max(4,Math.floor(Y/6.5)),se=T*Math.max(1,P.length)<=160,te=Q=>Q*Math.PI*2/T,J=new Set;if(ee){const Q=[];for(let me=0;me<T;me++){const[je,Me]=kn(F,V,G+14,te(me)),be=Math.min(ce,L(M[me]).length)*6.2+2,ke=Math.abs(je-F)<4?je-be/2:je>F?je:je-be,re=[ke,Me-7,ke+be,Me+7];Q.every(we=>re[2]<we[0]||re[0]>we[2]||re[3]<we[1]||re[1]>we[3])&&(Q.push(re),J.add(me))}}const oe=Q=>M.map((me,je)=>kn(F,V,G*Q(je),te(je)).join(",")).join(" "),{hover:ye,setHover:he,handlers:Fe}=_s((Q,me)=>{if(T===0)return null;const je=Q-F,Me=me-V;if(Math.hypot(je,Me)>G+24)return null;let be=Math.atan2(je,-Me);return be<0&&(be+=Math.PI*2),Math.round(be/(Math.PI*2)*T)%T}),Ve=ye!=null&&M[ye]?kn(F,V,G,te(ye)):null,ie=Q=>Q===null?"–":Math.abs(Q)>=1e6?Nr(Q):String(Q);return a.jsxs(Er,{rootRef:y,animate:j,loading:h,isEmpty:D,empty:p,height:r,className:g,style:b,sx:x,children:[a.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${w} ${r}`,role:"img","aria-label":d,...Fe,children:[T>=3&&Array.from({length:Z},(Q,me)=>a.jsx("polygon",{className:"cny-chart-radar-ring",points:oe(()=>(me+1)/Z)},me)),M.map((Q,me)=>{const[je,Me]=kn(F,V,G,te(me)),[be,ke]=kn(F,V,G+14,te(me)),re=L(Q);return a.jsxs("g",{children:[a.jsx("line",{className:"cny-chart-grid",x1:F,y1:V,x2:je,y2:Me}),ee&&(J.has(me)||ye===me)&&a.jsxs("text",{className:"cny-chart-axis",x:be,y:ke,dy:"0.32em",textAnchor:Math.abs(be-F)<4?"middle":be>F?"start":"end",children:[a.jsx("title",{children:re}),en(re,ce)]})]},me)}),T>=2&&!D&&P.map((Q,me)=>a.jsx("polygon",{className:"cny-chart-radar-fill cny-x-scale",style:un(me,120),points:oe(je=>ue(je,Q.key)),fill:i?Q.color:"none",stroke:Q.color},Q.key)),!D&&P.map((Q,me)=>M.map((je,Me)=>{if(!se&&ye!==Me)return null;const[be,ke]=kn(F,V,G*ue(Me,Q.key),te(Me));return a.jsx("circle",{className:ne("cny-chart-dot cny-x-pop cny-x-mark",ye===Me&&"is-active"),style:un(Me+me*T,30),cx:be,cy:ke,r:ye===Me?5:3.5,fill:Q.color},`${Q.key}-${Me}`)})),M.map((Q,me)=>{const[je,Me]=kn(F,V,G*.55,te(me));return a.jsx("circle",{className:"cny-chart-hit",cx:je,cy:Me,r:Math.max(18,G*.5),fill:"transparent",style:{pointerEvents:"none"},tabIndex:T<=30?0:-1,"aria-label":`${L(Q)}: ${P.map(be=>`${be.label??be.key} ${ie(A(Q,be.key))}`).join(", ")}`,onMouseEnter:()=>he(me),onFocus:()=>he(me),onBlur:()=>he(null)},`hit-${me}`)})]}),a.jsx(Un,{caption:d,head:[e,...P.map(Q=>Q.label??Q.key)],rows:M.map(Q=>[L(Q),...P.map(me=>ie(A(Q,me.key)))])}),Ve&&ye!=null&&a.jsxs(Zr,{x:Ve[0],y:Ve[1],children:[a.jsx("div",{className:"cny-chart-tooltip-title",title:L(M[ye]),children:en(L(M[ye]),40)}),P.map(Q=>a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-swatch",style:{background:Q.color}}),a.jsx("span",{className:"cny-chart-tooltip-label",children:Q.label??Q.key}),a.jsx("span",{className:"cny-chart-tooltip-value",children:ie(A(M[ye],Q.key))})]},Q.key))]}),X&&!D&&a.jsx("div",{className:"cny-chart-note",children:"Axes scaled to their own maximum"}),c&&a.jsx(Is,{entries:R.map((Q,me)=>({key:Q.key,label:Q.label??Q.key,color:ln(me,Q.color)})),hidden:C,onToggle:S,interactive:l})]})}const Kn={top:12,right:18,bottom:30,left:44};function H2({data:t,xKey:e,yKey:n,sizeKey:r,groupKey:o,nameKey:s,colors:i,sizeRange:c=[4,22],height:l=300,maxPoints:u=1500,grid:d=!0,legend:f=!0,legendToggle:h=!0,xTickFormatter:p=fs,yTickFormatter:g=fs,renderTooltip:b,label:x="Scatter chart",animate:y=!0,loading:w,empty:C,className:S,style:M,sx:R}){var pe;const P=Array.isArray(t)?t:[],[T,j]=qr(),[A,_]=As(),[L,I]=v.useState(null),[k,q]=v.useState(null),U=Array.from(A).join("\0"),E=v.useMemo(()=>{const O=P.length,ae=new Float64Array(O),Ce=new Float64Array(O),Le=new Float64Array(O),le=new Int32Array(O),de=new Uint8Array(O),Re=[],ve=new Map;for(let De=0;De<O;De++){const et=Jt(P[De]),At=ot(et[e]),it=ot(et[n]),xt=o?String(et[o]??""):"all";let st=ve.get(xt);st===void 0&&(st=Re.length,ve.set(xt,st),Re.push(xt)),le[De]=st;const ct=r?ot(et[r]):null;Le[De]=ct===null?NaN:ct,At!==null&&it!==null&&(ae[De]=At,Ce[De]=it,de[De]=1)}const Ie=new Set;Re.forEach((De,et)=>{A.has(De)&&Ie.add(et)});const qe=[];let Ye=1/0,Be=-1/0,ze=1/0,We=-1/0;for(let De=0;De<O;De++)!de[De]||Ie.has(le[De])||(qe.push(De),ae[De]<Ye&&(Ye=ae[De]),ae[De]>Be&&(Be=ae[De]),Ce[De]<ze&&(ze=Ce[De]),Ce[De]>We&&(We=Ce[De]));const Qe=r?Rx(Array.from(Le)):null;return{X:ae,Y:Ce,S:Le,G:le,ok:de,groups:Re,visible:qe,xlo:Ye,xhi:Be,ylo:ze,yhi:We,sMin:(Qe==null?void 0:Qe[0])??0,sMax:(Qe==null?void 0:Qe[1])??0}},[P,e,n,r,o,U]),$=E.visible.length>0,X=$?Bi(E.xlo,E.xhi):{lo:0,hi:1,ticks:[0,1]},K=$?Bi(E.ylo,E.yhi):{lo:0,hi:1,ticks:[0,1]},ue=K.ticks.map(O=>g(O)),D=X.ticks.map(O=>p(O)),Z=nd(ue,j,Kn.left),F=Math.max(Kn.right,Math.ceil((((pe=D[D.length-1])==null?void 0:pe.length)??0)*3.3)+4),V=Math.max(0,j-Z-F),H=Math.max(0,l-Kn.top-Kn.bottom),Y=O=>Z+(O-X.lo)/(X.hi-X.lo)*V,G=O=>Kn.top+H*(1-(O-K.lo)/(K.hi-K.lo)),ee=ds(D,V,6.4,{allowRotate:!1}),ce=O=>i&&i.length?i[O%i.length]:ln(O),[se,te]=[Math.max(0,c[0]),Math.max(0,c[1])],J=E.visible.length>600,oe=O=>r?Number.isFinite(E.S[O])?se+(E.S[O]-E.sMin)/(E.sMax-E.sMin||1)*(te-se):se:J?2.5:E.visible.length>250?3.5:5,ye=v.useMemo(()=>{const O=Math.max(1,Math.floor(u)),ae=E.visible;if(ae.length<=O)return{idx:ae,stamp:{}};const Ce=E.groups.length||1,Le=Math.max(2,Math.sqrt(Math.max(1,V)*Math.max(1,H)*Math.min(Ce,8)/O)),le=Math.ceil(Math.max(1,V)/Le)+1,de=new Set;let Re=[];for(let ve=0;ve<ae.length;ve++){const Ie=ae[ve],qe=Math.floor((Y(E.X[Ie])-Z)/Le),Be=(Math.floor((G(E.Y[Ie])-Kn.top)/Le)*le+qe)*Ce+E.G[Ie];de.has(Be)||(de.add(Be),Re.push(Ie))}if(Re.length>O){const ve=Re;Re=[];for(let Ie=0;Ie<O;Ie++)Re.push(ve[Math.floor(Ie*ve.length/O)])}return{idx:Re,stamp:{}}},[E,u,V,H,Z,X.lo,X.hi,K.lo,K.hi]),he=v.useRef(null),Fe=Math.max(16,te+8),Ve=(O,ae)=>{if(!$)return null;let Ce=he.current;if(!Ce||Ce.stamp!==ye.stamp||Ce.cell!==Fe){const ve=Math.ceil(Math.max(1,j)/Fe)+1,Ie=new Map,qe=E.visible;for(let Ye=0;Ye<qe.length;Ye++){const Be=qe[Ye],ze=Math.floor(G(E.Y[Be])/Fe)*ve+Math.floor(Y(E.X[Be])/Fe),We=Ie.get(ze);We?We.push(Be):Ie.set(ze,[Be])}Ce={stamp:ye.stamp,cell:Fe,map:Ie,cols:ve},he.current=Ce}const Le=Math.floor(O/Fe),le=Math.floor(ae/Fe);let de=null,Re=1/0;for(let ve=-1;ve<=1;ve++)for(let Ie=-1;Ie<=1;Ie++){const qe=Ce.map.get((le+ve)*Ce.cols+Le+Ie);if(qe)for(let Ye=0;Ye<qe.length;Ye++){const Be=qe[Ye],ze=Math.hypot(Y(E.X[Be])-O,G(E.Y[Be])-ae),We=ze-oe(Be);ze<=oe(Be)+8&&We<Re&&(Re=We,de=Be)}}return de},ie=_s((O,ae)=>Ve(O,ae)),Q=v.useRef(null),me=()=>((!Q.current||Q.current.m!==E)&&(Q.current={m:E,order:[...E.visible].sort((O,ae)=>E.X[O]-E.X[ae]||E.Y[O]-E.Y[ae])}),Q.current.order),je=k!=null&&$?me()[Math.min(k,E.visible.length-1)]??null:null,Me=ie.hover??L??je,be=Me!=null&&E.ok[Me]?Me:null,ke=Mn(y)&&Bn(ye.idx.length),re=E.visible.length<=od,we=O=>s?String(Jt(P[O])[s]??""):"",Se=Math.max(1,Math.round(E.visible.length/Math.max(1,Math.min(ye.idx.length,400)))),He=rd(E.visible.length,k,q,Se),Oe=O=>`${we(O)?`${we(O)}: `:""}${e} ${mn(E.X[O])}, ${n} ${mn(E.Y[O])}${r?`, ${r} ${mn(Number.isFinite(E.S[O])?E.S[O]:null)}`:""}`;return a.jsxs(Er,{rootRef:T,animate:ke,loading:w,isEmpty:P.length===0,empty:C,height:l,className:S,style:M,sx:R,children:[a.jsxs("svg",{width:"100%",height:l,viewBox:`0 0 ${j} ${l}`,role:"img","aria-label":be!=null&&!re?`${x}: ${Oe(be)}`:x,tabIndex:re?void 0:0,className:re?void 0:"cny-chart-focusable",onKeyDown:re?void 0:He,onBlur:re?void 0:()=>q(null),...ie.handlers,children:[$&&a.jsxs(a.Fragment,{children:[K.ticks.map((O,ae)=>a.jsxs("g",{children:[d&&a.jsx("line",{className:"cny-chart-grid",x1:Z,x2:j-F,y1:G(O),y2:G(O)}),a.jsx("text",{className:"cny-chart-axis",x:Z-6,y:G(O),dy:"0.32em",textAnchor:"end",children:ue[ae]})]},`y${ae}`)),X.ticks.map((O,ae)=>a.jsxs("g",{children:[d&&a.jsx("line",{className:"cny-chart-grid",y1:Kn.top,y2:l-Kn.bottom,x1:Y(O),x2:Y(O)}),ee.indices.includes(ae)&&a.jsx("text",{className:"cny-chart-axis",x:Y(O),y:l-Kn.bottom+16,textAnchor:"middle",children:D[ae]})]},`x${ae}`))]}),ye.idx.map((O,ae)=>a.jsx("circle",{className:ne("cny-chart-scatter-dot",ke&&"cny-x-pop",!J&&"cny-x-mark",Me===O&&"is-active"),style:ke?un(ae,Math.min(45,700/Math.max(1,ye.idx.length))):void 0,cx:Y(E.X[O]),cy:G(E.Y[O]),r:oe(O),fill:ce(E.G[O]),tabIndex:re?0:void 0,"aria-label":re?Oe(O):void 0,onMouseEnter:re?()=>ie.setHover(O):void 0,onMouseLeave:re?()=>ie.setHover(null):void 0,onFocus:re?()=>I(O):void 0,onBlur:re?()=>I(null):void 0},O)),be!=null&&!re&&a.jsx("circle",{className:"cny-chart-scatter-dot is-active",cx:Y(E.X[be]),cy:G(E.Y[be]),r:oe(be)+1,fill:ce(E.G[be]),pointerEvents:"none"})]}),a.jsx(Un,{caption:x,head:[...s?[s]:[],...o?[o]:[],e,n,...r?[r]:[]],rows:wa(P.length,O=>[...s?[we(O)]:[],...o?[E.groups[E.G[O]]]:[],E.ok[O]?E.X[O]:"no data",E.ok[O]?E.Y[O]:"no data",...r?[Number.isFinite(E.S[O])?E.S[O]:"no data"]:[]])}),be!=null&&a.jsx(Zr,{x:Y(E.X[be]),y:G(E.Y[be])-oe(be),children:b?b({datum:P[be]}):a.jsxs(a.Fragment,{children:[(we(be)||o)&&a.jsx("div",{className:"cny-chart-tooltip-title",children:we(be)||E.groups[E.G[be]]}),a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-tooltip-label",children:e}),a.jsx("span",{className:"cny-chart-tooltip-value",children:mn(E.X[be])})]}),a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-tooltip-label",children:n}),a.jsx("span",{className:"cny-chart-tooltip-value",children:mn(E.Y[be])})]}),r&&a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-tooltip-label",children:r}),a.jsx("span",{className:"cny-chart-tooltip-value",children:mn(Number.isFinite(E.S[be])?E.S[be]:null)})]})]})}),f&&o&&a.jsx(Is,{entries:E.groups.map((O,ae)=>({key:O,label:O,color:ce(ae)})),hidden:A,onToggle:_,interactive:h})]})}const G2=14,z2=t=>Math.abs(t)>=1e9?Nr(t):$s(t);function W2({data:t,height:e=300,showPercent:n=!0,valueFormatter:r=z2,label:o="Funnel chart",animate:s=!0,loading:i,empty:c,className:l,style:u,sx:d}){var E;const[f,h]=qr(420),[p,g]=Qu(),[b,x]=v.useState(0),y=(Array.isArray(t)?t:[]).map($=>({...$,label:String(($==null?void 0:$.label)??""),value:Math.max(0,Jn($==null?void 0:$.value,0))})),w=y.length,C=Mn(s)&&Bn(w),S=Math.max(0,...y.map($=>$.value)),M=((E=y[0])==null?void 0:E.value)??0,R=w>12?2:4,P=w*G2+R*Math.max(0,w-1),T=P>e,j=Math.max(40,h-(T?12:0)),A=T?P:e,_=w?(A-R*(w-1))/w:0,L=$=>S>0?Math.max($>0?2:1,$/S*(j-8)):0,I=$=>M>0?`${Math.round($/M*100)}%`:"–",k=p!=null?y[p]:null,q=Math.max(9,Math.min(13,_-4)),U=q*.58;return a.jsxs(Er,{rootRef:f,animate:C,loading:i,isEmpty:w===0||S<=0,empty:c,height:e,className:l,style:u,sx:d,children:[a.jsx("div",{className:ne(T&&"cny-chart-funnel-scroll cny-scroll"),style:T?{maxHeight:e,overflowY:"auto"}:void 0,onScroll:T?$=>x($.currentTarget.scrollTop):void 0,children:a.jsx("svg",{width:"100%",height:A,viewBox:`0 0 ${j} ${A}`,role:"img","aria-label":o,style:{display:"block"},children:y.map(($,X)=>{const K=X*(_+R),ue=L($.value),D=X<w-1?L(y[X+1].value):ue*.8,Z=j/2,F=ln(X,$.color),V=X>0&&y[X-1].value>0?Math.round($.value/y[X-1].value*100):null,H=`${r($.value)}${n?` · ${I($.value)}`:""}`,Y=($.label.length+H.length+1)*U,G=(ue+D)/2-12;let ee=!1,ce="",se=H,te=!1;if(_>=12)if(Y<=G)ce=$.label,te=!0;else{const J=j-(Z+Math.max(ue,D)/2+10)-6;if(J>=64){ee=!0,te=!0;const oe=Math.floor(J/U);H.length+6>oe&&(se=r($.value));const ye=oe-se.length-1;ye<6&&(se=r($.value)),ce=ye<6&&oe-se.length-1<6?"":en($.label,Math.max(3,oe-se.length-1))}else if(G>=36){te=!0;const oe=Math.floor(G/U);se="",ce=en(`${$.label}`,oe)}}return a.jsxs("g",{children:[a.jsx("polygon",{className:ne("cny-chart-funnel-seg cny-x-grow-x cny-x-mark",p===X&&"is-active"),style:un(X,110),points:`${Z-ue/2},${K} ${Z+ue/2},${K} ${Z+D/2},${K+_} ${Z-D/2},${K+_}`,fill:F,tabIndex:w<=30?0:-1,"aria-label":`${$.label}: ${r($.value)}${n?` (${I($.value)} of first)`:""}${V!=null?`, ${V}% of previous`:""}`,onMouseEnter:()=>g(X),onMouseLeave:()=>g(null),onFocus:()=>g(X),onBlur:()=>g(null)}),te&&a.jsxs("text",{className:ne("cny-chart-funnel-text cny-x-fade",ee&&"is-outside"),style:{...un(X,110),fontSize:q,...ee?null:{fill:Mx(F)}},x:ee?Z+Math.max(ue,D)/2+10:Z,y:K+_/2,textAnchor:ee?"start":"middle",dy:"0.32em",children:[ce,se&&a.jsx("tspan",{className:"cny-chart-funnel-sub",dx:6,children:se})]})]},X)})})}),a.jsx(Un,{caption:o,head:["Stage","Value","Of first"],rows:y.map($=>[$.label,$.value,I($.value)])}),k&&p!=null&&a.jsxs(Zr,{x:j/2,y:Math.max(0,p*(_+R)-b),children:[a.jsx("div",{className:"cny-chart-tooltip-title",title:k.label,children:en(k.label,40)}),a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-tooltip-label",children:"Value"}),a.jsx("span",{className:"cny-chart-tooltip-value",children:r(k.value)})]}),a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-tooltip-label",children:"Of first"}),a.jsx("span",{className:"cny-chart-tooltip-value",children:I(k.value)})]}),p>0&&y[p-1].value>0&&a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-tooltip-label",children:"Of previous"}),a.jsxs("span",{className:"cny-chart-tooltip-value",children:[Math.round(k.value/y[p-1].value*100),"%"]})]})]})]})}const zh=["color-mix(in srgb, var(--color-primary) 18%, var(--bg-surface-lowest))","color-mix(in srgb, var(--color-primary) 36%, var(--bg-surface-lowest))","color-mix(in srgb, var(--color-primary) 54%, var(--bg-surface-lowest))","color-mix(in srgb, var(--color-primary) 72%, var(--bg-surface-lowest))","var(--color-primary)"],K2="var(--bg-surface-low)",li=864e5,Y2=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],X2=/^\d{4}-\d{2}-\d{2}/,xc=t=>{if(!X2.test(t))return NaN;const[e,n,r]=t.slice(0,10).split("-").map(Number),o=Date.UTC(e,(n||1)-1,r||1);return Number.isFinite(o)?o:NaN},Wh=t=>new Date(t).toISOString().slice(0,10),Kh=5,q2=80;function Z2({data:t,variant:e="matrix",xKey:n="x",yKey:r="y",valueKey:o="value",dateKey:s="date",weeks:i=26,endDate:c,xOrder:l,yOrder:u,colorScale:d=zh,cellSize:f,showValues:h=!1,legend:p=!0,valueFormatter:g=P=>mn(P),renderTooltip:b,label:x="Heatmap",animate:y=!0,loading:w,empty:C,className:S,style:M,sx:R}){var Ce,Le;const P=Array.isArray(t)?t:[],T=d.length?d:zh,[j,A]=qr(),_=v.useRef(null),[L,I]=v.useState(null),k=e==="calendar",q=Math.min(530,Math.max(1,Math.floor(Number.isFinite(i)?i:26))),U=v.useMemo(()=>{const le=[];let de=[],Re=[],ve=0,Ie=0;if(k){const ze=new Map;let We=c?xc(c):NaN,Qe=NaN;for(let it=0;it<P.length;it++){const xt=Jt(P[it]),st=String(xt[s]??"").slice(0,10),ct=xc(st);if(Number.isNaN(ct))continue;(Number.isNaN(Qe)||ct>Qe)&&(Qe=ct);const bt=ot(xt[o]);bt!==null&&ze.set(st,(ze.get(st)??0)+bt)}Number.isNaN(We)&&(We=Number.isNaN(Qe)?xc(Wh(Date.now())):Qe);const De=new Date(We).getUTCDay(),et=We-De*li-(q-1)*7*li;ve=q,Ie=7;let At=-1;for(let it=0;it<q;it++){for(let st=0;st<7;st++){const ct=et+(it*7+st)*li;if(ct>We)continue;const bt=Wh(ct);le.push({col:it,row:st,title:bt,value:ze.has(bt)?ze.get(bt):null})}const xt=new Date(et+it*7*li).getUTCMonth();xt!==At&&(de.push({col:it,text:Y2[xt]}),At=xt)}Re=[{row:1,text:"Mon"},{row:3,text:"Wed"},{row:5,text:"Fri"}]}else{const ze=l??Array.from(new Set(P.map(De=>String(Jt(De)[n])))),We=u??Array.from(new Set(P.map(De=>String(Jt(De)[r]))));ve=ze.length,Ie=We.length;const Qe=new Map;for(let De=0;De<P.length;De++){const et=Jt(P[De]);Qe.set(`${et[n]}\0${et[r]}`,ot(et[o]))}We.forEach((De,et)=>ze.forEach((At,it)=>{le.push({col:it,row:et,title:`${At} · ${De}`,value:Qe.get(`${At}\0${De}`)??null})})),de=ze.map((De,et)=>({col:et,text:De})),Re=We.map((De,et)=>({row:et,text:De}))}const qe=new Int32Array(Math.max(1,ve*Ie)).fill(-1);let Ye=1/0,Be=-1/0;return le.forEach((ze,We)=>{qe[ze.col*Ie+ze.row]=We,ze.value!=null&&(ze.value<Ye&&(Ye=ze.value),ze.value>Be&&(Be=ze.value))}),{cells:le,colLabels:de,rowLabels:Re,cols:ve,rows:Ie,cellAt:qe,lo:Ye,hi:Be,has:Ye!==1/0}},[P,k,n,r,o,s,q,c,l,u]),{cells:E,cols:$,rows:X,cellAt:K,lo:ue,hi:D}=U,Z=T.length,F=le=>le==null||k&&le===0?K2:T[D===ue?Z-1:Math.max(0,Math.min(Z-1,Math.round((le-ue)/(D-ue)*(Z-1))))],V=U.rowLabels.map(le=>({...le,text:hs(le.text,12)})),H=f??(k?13:28),Y=Math.max(Kh+1,Math.min(H+3,24)),G=k?null:ds(V.map(le=>le.text),X*Y,0,{allowRotate:!1,gap:13}),ee=G?V.filter((le,de)=>G.indices.includes(de)):V,ce=ee.length?Math.min(Math.max(...ee.map(le=>le.text.length))*6.6+14,Math.max(40,A*.4)):0,se=Math.max(0,A-ce);let te=f??H;if(f==null&&$>0){const le=Math.floor(se/$)-3,de=Math.floor(se/$)-1;te=Math.max(Kh,Math.min(H,le>=10?le:de))}const J=te<10?1:3,oe=te+J,ye=18,he=ce+$*oe,Fe=ye+X*oe,Ve=U.colLabels.map(le=>({...le,text:hs(le.text,10)})),ie=k?null:ds(Ve.map(le=>le.text),$*oe,6.2,{allowRotate:!1}),Q=ie?Ve.filter((le,de)=>ie.indices.includes(de)):Ve,me=V.length&&!k?ee:V,je=Mn(y)&&Bn(E.length),Me=E.length<=q2,[be,ke]=v.useState(null),re=_s((le,de)=>{const Re=Math.floor((le-ce)/oe),ve=Math.floor((de-ye)/oe);if(Re<0||ve<0||Re>=$||ve>=X)return null;const Ie=K[Re*X+ve];return Ie>=0?Ie:null}),we=re.hover??L??be,Se=we!=null?E[we]??null:null,He=k?P.length===0:E.length===0,Oe=le=>{const de=be!=null?E[be]:null;let Re=de?de.col:0,ve=de?de.row:0;if(le.key==="Escape"){ke(null);return}if(le.key==="Home")Re=0,ve=0;else if(le.key==="End")Re=$-1,ve=X-1;else if(de)if(le.key==="ArrowRight")Re++;else if(le.key==="ArrowLeft")Re--;else if(le.key==="ArrowDown")ve++;else if(le.key==="ArrowUp")ve--;else return;if(!["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(le.key)||(le.preventDefault(),Re<0||ve<0||Re>=$||ve>=X))return;let Ie=K[Re*X+ve];Ie<0&&le.key==="End"&&(Ie=E.length-1),Ie>=0&&ke(Ie)},pe=v.useMemo(()=>E.map((le,de)=>a.jsx("rect",{className:ne("cny-chart-cell",je&&"cny-x-scale"),style:je?un(k?le.col:le.col+le.row,Math.min(30,600/Math.max(1,k?$:$+X))):void 0,x:ce+le.col*oe,y:ye+le.row*oe,width:te,height:te,rx:te<8?1:k?2:4,fill:F(le.value)},de)),[E,je,k,$,X,ce,oe,te,ue,D,T]),O=Se?ce+Se.col*oe+te/2-(((Ce=_.current)==null?void 0:Ce.scrollLeft)??0):0,ae=Se?ye+Se.row*oe+(((Le=_.current)==null?void 0:Le.offsetTop)??0):0;return a.jsxs(Er,{rootRef:j,animate:je,loading:w,isEmpty:He,empty:C,height:Fe||120,className:ne("cny-chart-heatmap",S),style:{minHeight:He?120:void 0,...M},sx:R,children:[!He&&a.jsx("div",{ref:_,style:{overflowX:"auto",maxWidth:"100%"},className:"cny-scroll",children:a.jsxs("svg",{width:he,height:Fe,viewBox:`0 0 ${he} ${Fe}`,style:{display:"block"},role:"img","aria-label":Se&&!Me?`${x}: ${Se.title}: ${Se.value==null?"no data":g(Se.value)}`:x,tabIndex:Me?void 0:0,onKeyDown:Me?void 0:Oe,onBlur:Me?void 0:()=>ke(null),...re.handlers,children:[Q.map(le=>a.jsx("text",{className:"cny-chart-axis",x:ce+le.col*oe+(k?0:te/2),y:12,textAnchor:k?"start":"middle",children:le.text},`c${le.col}`)),me.map(le=>a.jsx("text",{className:"cny-chart-axis",x:ce-6,y:ye+le.row*oe+te/2,dy:"0.32em",textAnchor:"end",children:le.text},`r${le.row}`)),Me?E.map((le,de)=>a.jsx("rect",{className:ne("cny-chart-cell",je&&"cny-x-scale",we===de&&"is-active"),style:je?un(k?le.col:le.col+le.row,Math.min(30,600/Math.max(1,k?$:$+X))):void 0,x:ce+le.col*oe,y:ye+le.row*oe,width:te,height:te,rx:te<8?1:k?2:4,fill:F(le.value),stroke:"transparent",strokeWidth:J,tabIndex:0,"aria-label":`${le.title}: ${le.value==null?"no data":g(le.value)}`,onMouseEnter:()=>re.setHover(de),onMouseLeave:()=>re.setHover(null),onFocus:()=>I(de),onBlur:()=>I(null)},de)):pe,!Me&&Se&&a.jsx("rect",{className:"cny-chart-cell is-active",x:ce+Se.col*oe,y:ye+Se.row*oe,width:te,height:te,rx:te<8?1:k?2:4,fill:"none",pointerEvents:"none"}),h&&!k&&te>=16&&E.length<=400&&E.map((le,de)=>le.value!=null?a.jsx("text",{className:"cny-chart-cell-text",style:{fill:Mx(F(le.value))},x:ce+le.col*oe+te/2,y:ye+le.row*oe+te/2,dy:"0.32em",textAnchor:"middle",children:g(le.value)},`t${de}`):null)]})}),a.jsx(Un,{caption:x,head:["Cell","Value"],rows:v.useMemo(()=>{const le=E.filter(de=>de.value!=null);return wa(le.length,de=>[le[de].title,le[de].value])},[E])}),Se&&a.jsx(Zr,{x:O,y:ae,children:b?b({title:Se.title,value:Se.value}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"cny-chart-tooltip-title",children:Se.title}),a.jsxs("div",{className:"cny-chart-tooltip-row",children:[a.jsx("span",{className:"cny-chart-tooltip-label",children:"Value"}),a.jsx("span",{className:"cny-chart-tooltip-value",children:Se.value==null?"—":g(Se.value)})]})]})}),p&&!He&&U.has&&a.jsxs("div",{className:"cny-chart-legend","aria-hidden":"true",children:[a.jsx("span",{children:g(ue)}),T.map((le,de)=>a.jsx("span",{className:"cny-chart-swatch",style:{background:le}},de)),a.jsx("span",{children:g(D)})]})]})}function J2(t){var s;if(!["ArrowDown","ArrowUp","Home","End"].includes(t.key))return;const n=Array.from(t.currentTarget.querySelectorAll(".cny-list-item.is-interactive:not(.is-disabled)")),r=n.indexOf(document.activeElement);if(r<0)return;t.preventDefault();const o=t.key==="Home"?0:t.key==="End"?n.length-1:r+(t.key==="ArrowDown"?1:-1);(s=n[Math.max(0,Math.min(n.length-1,o))])==null||s.focus()}const Q2={sm:55,md:64,lg:74},e$=200,t$=v.forwardRef(function({variant:e="dividers",size:n="md",dense:r,loading:o=!1,virtualize:s="auto",itemHeight:i,loadingRows:c=3,empty:l,className:u,style:d,sx:f,children:h,onKeyDown:p,onFocus:g,...b},x){const y=i??Q2[n],w=v.useMemo(()=>v.Children.toArray(h),[h]),C=!o&&!(l!=null&&w.length===0),S=C&&(s===!0||s==="auto"&&w.length>e$),[M,R]=v.useState(!1),P=S&&!M,T=v.useRef(null),j=v.useCallback(F=>{T.current=F,typeof x=="function"?x(F):x&&(x.current=F)},[x]);v.useLayoutEffect(()=>{if(!S){M&&R(!1);return}const F=T.current;s==="auto"&&!M&&F&&F.clientHeight>=w.length*y-1&&R(!0)},[S,s,M,w.length,y]);const A=Zu({count:w.length,itemSize:y,enabled:P,scrollRef:T}),_=P?A.start:0,L=P?A.end:w.length,I=v.useMemo(()=>{const F=[];return w.forEach((V,H)=>{if(!v.isValidElement(V)||V.type!==Si)return;const Y=V.props;!Y.disabled&&(Y.href!=null||Y.onClick!=null)&&F.push(H)}),F},[w]),[k,q]=v.useState(null),U=F=>F>=_&&F<L,E=k!=null&&I.includes(k)&&U(k)?k:I.find(U),$=v.useRef(null);v.useEffect(()=>{var H;const F=$.current;if(F==null)return;const V=(H=T.current)==null?void 0:H.querySelector(`[data-list-index="${F}"]`);V&&($.current=null,V.focus())});const{className:X,style:K,styleTag:ue}=Ae(f,d,"cny-list",e,`size-${n}`,r&&"is-dense",P&&"is-virtual",u),D=F=>{if(p==null||p(F),F.defaultPrevented)return;const V=F.target.closest("[data-list-index]");if(!V||!F.currentTarget.contains(V)){J2(F);return}if(!["ArrowDown","ArrowUp","Home","End"].includes(F.key))return;const Y=Number(V.dataset.listIndex),G=I.indexOf(Y);if(G<0||I.length===0)return;F.preventDefault();const ee=F.key==="Home"?0:F.key==="End"?I.length-1:Math.max(0,Math.min(I.length-1,G+(F.key==="ArrowDown"?1:-1))),ce=I[ee];q(ce),$.current=ce,P&&A.scrollToIndex(ce)},Z=[];if(C){P&&_>0&&Z.push(a.jsx("li",{role:"none","aria-hidden":"true",className:"cny-list-spacer",style:{height:_*y}},"sp-top"));for(let F=_;F<L;F++){const V=w[F];if(!v.isValidElement(V)){Z.push(V);continue}if(!(V.type===Si||V.type===Ix||V.type===Dx)){Z.push(V);continue}const Y={"data-list-index":F};V.type===Si&&I.includes(F)&&(Y.tabIndex=F===E?0:-1),Z.push(v.cloneElement(V,Y))}P&&L<w.length&&Z.push(a.jsx("li",{role:"none","aria-hidden":"true",className:"cny-list-spacer",style:{height:(w.length-L)*y}},"sp-bot"))}return a.jsxs("ul",{ref:j,className:X,style:P?{...K,"--cny-list-row-h":`${y}px`}:K,"aria-busy":o||void 0,onKeyDown:D,onFocus:F=>{g==null||g(F);const V=F.target.closest("[data-list-index]");V&&q(Number(V.dataset.listIndex))},...b,children:[ue,o?Array.from({length:c}).map((F,V)=>a.jsx("li",{className:"cny-list-item-wrap cny-list-skeleton",children:a.jsxs("span",{className:"cny-list-item",children:[a.jsx(jt,{shape:"avatar"}),a.jsxs("span",{className:"cny-list-item-body",children:[a.jsx(jt,{width:"45%"}),a.jsx(jt,{width:"70%"})]})]})},V)):l!=null&&w.length===0?a.jsx("li",{className:"cny-list-empty",children:l}):Z]})}),Si=v.forwardRef(function({leading:e,trailing:n,primary:r,secondary:o,onClick:s,href:i,disabled:c,active:l,as:u,children:d,className:f,...h},p){const g=u??(i?"a":s?"button":"li"),b=!c&&(i!=null||s!=null),x=d??a.jsxs(a.Fragment,{children:[e&&a.jsx("span",{className:"cny-list-item-leading",children:e}),a.jsxs("span",{className:"cny-list-item-body",children:[r!=null&&a.jsx("span",{className:"cny-list-item-primary",children:r}),o!=null&&a.jsx("span",{className:"cny-list-item-secondary",children:o})]}),n&&a.jsx("span",{className:"cny-list-item-trailing",children:n})]}),y=a.jsx(g,{ref:p,href:i,onClick:c?void 0:s,"aria-disabled":c||void 0,"aria-current":l?"page":void 0,tabIndex:b&&g==="div"?0:void 0,className:ne("cny-list-item",l&&"is-active",c&&"is-disabled",b&&"is-interactive",f),...h,children:x});return g==="li"?y:a.jsx("li",{className:"cny-list-item-wrap",children:y})}),Ix=v.forwardRef(function({className:e,...n},r){return a.jsx("li",{ref:r,role:"separator",className:ne("cny-list-separator",e),...n})}),Dx=v.forwardRef(function({className:e,children:n,...r},o){return a.jsx("li",{ref:o,className:ne("cny-list-subheader",e),...r,children:n})});var n$=Object.defineProperty,$o=(t,e)=>n$(t,"name",{value:e,configurable:!0}),sd="Tabs",[r$,V_]=dt(sd,[Sr]),$x=Sr(),[o$,id]=r$(sd),s$=m.forwardRef($o(function(e,n){const{__scopeTabs:r,value:o,onValueChange:s,defaultValue:i,orientation:c="horizontal",dir:l,activationMode:u="automatic",...d}=e,f=or(l),[h,p]=lt({prop:o,onChange:s,defaultProp:i??"",caller:sd});return a.jsx(o$,{scope:r,baseId:Et(),value:h,onValueChange:p,orientation:c,dir:f,activationMode:u,children:a.jsx(Ne.div,{dir:f,"data-orientation":c,...d,ref:n})})},"Tabs")),i$="TabsList",a$=m.forwardRef($o(function(e,n){const{__scopeTabs:r,loop:o=!0,...s}=e,i=id(i$,r),c=$x(r);return a.jsx(Yi,{asChild:!0,...c,orientation:i.orientation,dir:i.dir,loop:o,children:a.jsx(Ne.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:n})})},"TabsList")),c$="TabsTrigger",l$=m.forwardRef($o(function(e,n){const{__scopeTabs:r,value:o,disabled:s=!1,...i}=e,c=id(c$,r),l=$x(r),u=ad(c.baseId,o),d=cd(c.baseId,o),f=o===c.value;return a.jsx(Xi,{asChild:!0,...l,focusable:!s,active:f,children:a.jsx(Ne.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...i,ref:n,onMouseDown:ge(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?c.onValueChange(o):h.preventDefault()}),onKeyDown:ge(e.onKeyDown,h=>{s||h.target!==h.currentTarget||[" ","Enter"].includes(h.key)&&c.onValueChange(o)}),onFocus:ge(e.onFocus,()=>{const h=c.activationMode!=="manual";!f&&!s&&h&&c.onValueChange(o)})})})},"TabsTrigger")),u$="TabsContent",d$=m.forwardRef($o(function(e,n){const{__scopeTabs:r,value:o,forceMount:s,children:i,...c}=e,l=id(u$,r),u=ad(l.baseId,o),d=cd(l.baseId,o),f=o===l.value,h=m.useRef(f);return m.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),a.jsx($t,{present:s||f,children:({present:p})=>a.jsx(Ne.div,{"data-state":f?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!p,id:d,tabIndex:0,...c,ref:n,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&i})})},"TabsContent"));function ad(t,e){return`${t}-trigger-${e}`}$o(ad,"makeTriggerId");function cd(t,e){return`${t}-content-${e}`}$o(cd,"makeContentId");var f$=s$,h$=a$,p$=l$,m$=d$;const _x=v.createContext({indicator:!1,scroll:!1}),g$=v.forwardRef(function({variant:e="line",size:n="md",indicator:r=!1,overflow:o="wrap",className:s,style:i,sx:c,children:l,...u},d){const{className:f,style:h,styleTag:p}=Ae(c,i,"cny-tabs",`variant-${e}`,`size-${n}`,r&&"has-indicator",s);return a.jsxs(f$,{ref:d,className:f,style:h,...u,children:[p,a.jsx(_x.Provider,{value:{indicator:r,scroll:o==="scroll"&&u.orientation!=="vertical"},children:l})]})}),y$=v.forwardRef(function({className:e,children:n,...r},o){const{indicator:s,scroll:i}=v.useContext(_x),c=v.useRef(null),[l,u]=v.useState({start:!1,end:!1}),[d,f]=v.useState(null),h=v.useCallback(()=>{const x=c.current;if(x){if(i){const y=x.scrollWidth-x.clientWidth;u({start:x.scrollLeft>1,end:x.scrollLeft<y-1})}if(s){const y=x.querySelector('[role="tab"][data-state="active"]');f(y?{x:y.offsetLeft,y:y.offsetTop,w:y.offsetWidth,h:y.offsetHeight}:null)}}},[s,i]);v.useLayoutEffect(()=>{h();const x=c.current;if(!x)return;const y=typeof MutationObserver>"u"?null:new MutationObserver(h);y==null||y.observe(x,{attributes:!0,attributeFilter:["data-state"],subtree:!0,childList:!0});const w=typeof ResizeObserver>"u"?null:new ResizeObserver(h);return w==null||w.observe(x),()=>{y==null||y.disconnect(),w==null||w.disconnect()}},[h]),v.useEffect(()=>{if(!i)return;const x=c.current,y=w=>{var C,S;return(S=(C=w.target)==null?void 0:C.scrollIntoView)==null?void 0:S.call(C,{block:"nearest",inline:"nearest"})};return x==null||x.addEventListener("focusin",y),()=>x==null?void 0:x.removeEventListener("focusin",y)},[i]);const p=x=>{c.current=x,typeof o=="function"?o(x):o&&(o.current=x)},g=x=>{var w;const y=c.current;(w=y==null?void 0:y.scrollBy)==null||w.call(y,{left:x*y.clientWidth*.6,behavior:"smooth"})},b=a.jsxs(h$,{ref:p,className:ne("cny-tabs-list",i&&"is-scroll",e),onScroll:i?h:void 0,...r,children:[n,s&&a.jsx("span",{className:"cny-tabs-indicator","aria-hidden":"true","data-ready":d?"":void 0,style:d?{"--cny-tabs-x":`${d.x}px`,"--cny-tabs-y":`${d.y}px`,"--cny-tabs-w":`${d.w}px`,"--cny-tabs-h":`${d.h}px`}:void 0})]});return i?a.jsxs("div",{className:"cny-tabs-scroller","data-start":l.start||void 0,"data-end":l.end||void 0,children:[a.jsx("button",{type:"button",tabIndex:-1,"aria-hidden":"true",className:"cny-tabs-arrow is-start",onClick:()=>g(-1),children:a.jsx(Jo,{size:14})}),b,a.jsx("button",{type:"button",tabIndex:-1,"aria-hidden":"true",className:"cny-tabs-arrow is-end",onClick:()=>g(1),children:a.jsx(Xn,{size:14})})]}):b}),v$=v.forwardRef(function({icon:e,badge:n,className:r,children:o,...s},i){return a.jsxs(p$,{ref:i,className:ne("cny-tabs-trigger",r),...s,children:[e&&a.jsx("span",{className:"cny-tabs-trigger-icon",children:e}),a.jsx("span",{className:"cny-tabs-trigger-label",children:o}),n&&a.jsx("span",{className:"cny-tabs-trigger-badge",children:n})]})}),x$=v.forwardRef(function({className:e,...n},r){return a.jsx(m$,{ref:r,className:ne("cny-tabs-content",e),...n})});function b$(t,e){const n=e.trim();if(!n)return t;const r=t.toLowerCase().indexOf(n.toLowerCase());return r<0?t:a.jsxs(a.Fragment,{children:[t.slice(0,r),a.jsx("mark",{className:"cny-ac-mark",children:t.slice(r,r+n.length)}),t.slice(r+n.length)]})}function w$(t){return t.multiple===!0}const C$=v.forwardRef(function(e,n){const{options:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No results.",loading:c=!1,loadingText:l="Loading…",size:u,color:d="primary",disabled:f=!1,clearable:h=!0,highlightMatch:p=!0,recentItems:g,recentLabel:b="Recent",id:x,"aria-invalid":y,"aria-describedby":w,"aria-label":C,className:S,style:M,sx:R,open:P,defaultOpen:T=!1,onOpenChange:j}=e,A=v.useId(),_=x??`cny-ac-${A}`,L=P!==void 0,[I,k]=v.useState(T),q=L?P:I,U=v.useCallback(ie=>{L||k(ie),j==null||j(ie)},[L,j]),[E,$]=v.useState(""),[X,K]=v.useState(!1);v.useEffect(()=>{if(!c){K(!1);return}const ie=setTimeout(()=>K(!0),150);return()=>clearTimeout(ie)},[c]);const ue=v.useRef(null),D=w$(e),[Z,F]=v.useState(!D&&e.defaultValue!==void 0?e.defaultValue??null:null),[V,H]=v.useState(D&&e.defaultValue!==void 0?e.defaultValue??[]:[]),Y=D?e.value!==void 0?e.value:V:(()=>{const ie=e.value!==void 0?e.value:Z;return ie==null?[]:[ie]})(),G=v.useCallback(ie=>{var Q,me;if(D)e.value===void 0&&H(ie),(Q=e.onValueChange)==null||Q.call(e,ie);else{const je=ie[0]??null;e.value===void 0&&F(je),(me=e.onValueChange)==null||me.call(e,je)}},[D,e]),ee=v.useCallback(ie=>{if(!ie.disabled)if(D){const Q=e.maxItems,me=Y.includes(ie.value);let je;if(me)je=Y.filter(Me=>Me!==ie.value);else{if(Q!=null&&Y.length>=Q)return;je=[...Y,ie.value]}G(je)}else G([ie.value]),U(!1)},[G,D,Y,e,U]),ce=v.useCallback(ie=>{var Q;ie.stopPropagation(),G([]),(Q=ue.current)==null||Q.focus()},[G]),se=v.useMemo(()=>{const ie=new Map;for(const Q of r){const me=Q.group??"";ie.has(me)||ie.set(me,[]),ie.get(me).push(Q)}return Array.from(ie.entries())},[r]),te=ie=>{var Q;return((Q=r.find(me=>me.value===ie))==null?void 0:Q.label)??ie},J=Y.length===0?o:D?Y.length===1?te(Y[0]):`${te(Y[0])} +${Y.length-1}`:te(Y[0]),oe=(ie,Q,me)=>{const je=Y.includes(ie.value);return a.jsxs(ut.Item,{value:`${me} ${ie.label} ${ie.value}`,disabled:ie.disabled,onSelect:()=>ee(ie),className:ne("cny-ac-item",je&&"is-checked"),children:[D?a.jsx("span",{className:ne("cny-ac-checkbox",je&&"is-checked"),children:je&&a.jsx(yr,{size:12,"aria-hidden":"true"})}):a.jsxs("span",{className:"cny-ac-icon",children:[ie.icon??null,!ie.icon&&je&&a.jsx(yr,{size:14,"aria-hidden":"true"})]}),a.jsx("span",{className:"cny-ac-item-label",children:p?b$(ie.label,E):ie.label}),ie.hint&&a.jsx("span",{className:"cny-ac-item-hint",children:ie.hint})]},`${me}:${ie.value||Q}`)},ye=v.useMemo(()=>E===""&&(g!=null&&g.length)?g.map(ie=>r.find(Q=>Q.value===ie)).filter(ie=>!!ie):[],[E,g,r]),{className:he,style:Fe,styleTag:Ve}=Ae(R,M,"cny-ac-trigger","input",d!=="primary"&&d,u==="sm"||u==="lg"?u:null,Y.length>0&&"has-value",q&&"is-open",S);return a.jsxs(ca,{open:q,onOpenChange:U,children:[a.jsx(Oi,{asChild:!0,children:a.jsxs("button",{ref:ie=>{ue.current=ie,typeof n=="function"?n(ie):n&&(n.current=ie)},type:"button",id:_,className:he,style:Fe,disabled:f,"aria-label":C,"aria-invalid":y,"aria-describedby":w,role:"combobox","aria-haspopup":"listbox","aria-expanded":q,onKeyDown:ie=>{!q&&!f&&ie.key.length===1&&ie.key!==" "&&!ie.ctrlKey&&!ie.metaKey&&!ie.altKey&&($(ie.key),U(!0),ie.preventDefault())},children:[Ve,a.jsx("span",{className:ne("cny-ac-value",Y.length===0&&"is-placeholder"),children:J}),h&&Y.length>0&&!f&&a.jsx("span",{role:"button",tabIndex:0,className:"cny-ac-clear","aria-label":"Clear",onClick:ce,onKeyDown:ie=>{(ie.key==="Enter"||ie.key===" ")&&(ie.preventDefault(),ce(ie))},onPointerDown:ie=>ie.stopPropagation(),children:a.jsx(nn,{size:13,"aria-hidden":"true"})}),a.jsx(Tg,{size:14,className:"cny-ac-chevron","aria-hidden":"true"})]})}),a.jsx(ju,{children:a.jsx(la,{className:"cny-ac-content",align:"start",sideOffset:4,style:{width:"var(--radix-popover-trigger-width)"},children:a.jsxs(ut,{className:"cny-ac-cmdk",shouldFilter:!c,children:[a.jsx("div",{className:"cny-ac-search",children:a.jsx(ut.Input,{value:E,onValueChange:$,placeholder:s})}),a.jsx(ut.List,{className:"cny-ac-list",children:X?a.jsxs("div",{className:"cny-ac-loading",children:[a.jsx(Ag,{size:14,className:"cny-ac-loading-spinner","aria-hidden":"true"}),a.jsx("span",{children:l})]}):a.jsxs(a.Fragment,{children:[!c&&a.jsx(ut.Empty,{className:"cny-ac-empty",children:i},"empty"),ye.length>0&&a.jsx(ut.Group,{heading:b,children:ye.map((ie,Q)=>oe(ie,`recent-${Q}`,`__recent ${b}`))},"__recent"),se.map(([ie,Q],me)=>{const je=Q.map((Me,be)=>oe(Me,`opt-${me}-${be}`,ie));return ie===""?a.jsx(ut.Group,{children:je},`__ungrouped_${me}`):a.jsx(ut.Group,{heading:ie,children:je},ie||`group_${me}`)})]})})]})})})]})}),Yh=Symbol("ellipsis"),S$=v.forwardRef(function({items:e,separator:n,size:r="md",maxItems:o,className:s,style:i,sx:c,...l},u){const d=n??a.jsx(Xn,{size:12,"aria-hidden":"true"}),{className:f,style:h,styleTag:p}=Ae(c,i,"cny-breadcrumb",`cny-breadcrumb-${r}`,s),g=o!==void 0?Math.max(2,o):void 0,b=g!==void 0&&e.length>g,x=b?e.slice(1,e.length-(g-1)):[],y=b?[e[0],Yh,...e.slice(e.length-(g-1))]:e;return a.jsxs("nav",{ref:u,"aria-label":"Breadcrumb",className:f,style:h,...l,children:[p,a.jsx("ol",{className:"cny-breadcrumb-list",children:y.map((w,C)=>{if(w===Yh)return a.jsxs("li",{className:"cny-breadcrumb-item",children:[a.jsxs(ix,{children:[a.jsx(ax,{asChild:!0,children:a.jsx("button",{type:"button",className:"cny-breadcrumb-ellipsis","aria-label":"Show hidden items",children:a.jsx(Ng,{size:14,"aria-hidden":"true"})})}),a.jsx(cx,{children:x.map((P,T)=>a.jsx(lx,{onSelect:()=>{P.href&&typeof window<"u"&&window.location.assign(P.href)},children:P.label},T))})]}),a.jsx("span",{className:"cny-breadcrumb-sep","aria-hidden":"true",children:d})]},"ellipsis");const S=C===y.length-1,M=a.jsx("span",{className:ne("cny-breadcrumb-label",S&&"is-current"),children:w.label}),R=w.render?w.render(M):w.href&&!S?a.jsx("a",{href:w.href,className:"cny-breadcrumb-link",children:M}):M;return a.jsxs("li",{className:"cny-breadcrumb-item",children:[S?a.jsx("span",{"aria-current":"page",children:M}):R,!S&&a.jsx("span",{className:"cny-breadcrumb-sep","aria-hidden":"true",children:d})]},C)})})]})});var M$=Object.defineProperty,Os=(t,e)=>M$(t,"name",{value:e,configurable:!0}),ld="Collapsible",[R$,Ox]=dt(ld),[T$,ud]=R$(ld),j$=m.forwardRef(Os(function(e,n){const{__scopeCollapsible:r,open:o,defaultOpen:s,disabled:i,onOpenChange:c,...l}=e,[u,d]=lt({prop:o,defaultProp:s??!1,onChange:c,caller:ld});return a.jsx(T$,{scope:r,disabled:i,contentId:Et(),open:u,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),children:a.jsx(Ne.div,{"data-state":Sa(u),"data-disabled":i?"":void 0,...l,ref:n})})},"Collapsible")),P$="CollapsibleTrigger",N$=m.forwardRef(Os(function(e,n){const{__scopeCollapsible:r,...o}=e,s=ud(P$,r);return a.jsx(Ne.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":Sa(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...o,ref:n,onClick:ge(e.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),Lx="CollapsibleContent",E$=m.forwardRef(Os(function(e,n){const{forceMount:r,...o}=e,s=ud(Lx,e.__scopeCollapsible);return a.jsx($t,{present:r||s.open,children:({present:i})=>a.jsx(k$,{...o,ref:n,present:i})})},"CollapsibleContent")),k$=m.forwardRef(Os(function(e,n){const{__scopeCollapsible:r,present:o,children:s,...i}=e,c=ud(Lx,r),[l,u]=m.useState(o),d=m.useRef(null),f=_e(n,d),h=m.useRef(0),p=h.current,g=m.useRef(0),b=g.current,x=c.open||l,y=m.useRef(x),w=m.useRef(void 0);return m.useEffect(()=>{const C=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(C)},[]),mt(()=>{const C=d.current;if(C){w.current=w.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const S=C.getBoundingClientRect();h.current=S.height,g.current=S.width,y.current||(C.style.transitionDuration=w.current.transitionDuration,C.style.animationName=w.current.animationName),u(o)}},[c.open,o]),a.jsx(Ne.div,{"data-state":Sa(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!x,...i,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:x&&s})},"CollapsibleContentImpl"));function Sa(t){return t?"open":"closed"}Os(Sa,"getState");var A$=j$,I$=N$,D$=E$,$$=Object.defineProperty,tn=(t,e)=>$$(t,"name",{value:e,configurable:!0}),Hn="Accordion",_$=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[dd,O$,L$]=No(Hn),[Ma,B_]=dt(Hn,[L$,Ox]),fd=Ox(),F$=m.forwardRef(tn(function(e,n){const{type:r,...o}=e,s=o,i=o;return a.jsx(dd.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?a.jsx(H$,{...i,ref:n}):a.jsx(U$,{...s,ref:n})})},"Accordion")),[Fx,V$]=Ma(Hn),[Vx,B$]=Ma(Hn,{collapsible:!1}),U$=m.forwardRef(tn(function(e,n){const{value:r,defaultValue:o,onValueChange:s=tn(()=>{},"onValueChange"),collapsible:i=!1,...c}=e,[l,u]=lt({prop:r,defaultProp:o??"",onChange:s,caller:Hn});return a.jsx(Fx,{scope:e.__scopeAccordion,value:m.useMemo(()=>l?[l]:[],[l]),onItemOpen:u,onItemClose:m.useCallback(()=>i&&u(""),[i,u]),children:a.jsx(Vx,{scope:e.__scopeAccordion,collapsible:i,children:a.jsx(Bx,{...c,ref:n})})})},"AccordionImplSingle")),H$=m.forwardRef(tn(function(e,n){const{value:r,defaultValue:o,onValueChange:s=tn(()=>{},"onValueChange"),...i}=e,[c,l]=lt({prop:r,defaultProp:o??[],onChange:s,caller:Hn}),u=m.useCallback(f=>l((h=[])=>[...h,f]),[l]),d=m.useCallback(f=>l((h=[])=>h.filter(p=>p!==f)),[l]);return a.jsx(Fx,{scope:e.__scopeAccordion,value:c,onItemOpen:u,onItemClose:d,children:a.jsx(Vx,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(Bx,{...i,ref:n})})})},"AccordionImplMultiple")),[G$,Ra]=Ma(Hn),Bx=m.forwardRef(tn(function(e,n){const{__scopeAccordion:r,disabled:o,dir:s,orientation:i="vertical",...c}=e,l=m.useRef(null),u=_e(l,n),d=O$(r),h=or(s)==="ltr",p=ge(e.onKeyDown,g=>{var j;if(!_$.includes(g.key))return;const b=g.target,x=d().filter(A=>{var _;return!((_=A.ref.current)!=null&&_.disabled)}),y=x.findIndex(A=>A.ref.current===b),w=x.length;if(y===-1)return;g.preventDefault();let C=y;const S=0,M=w-1,R=tn(()=>{C=y+1,C>M&&(C=S)},"moveNext"),P=tn(()=>{C=y-1,C<S&&(C=M)},"movePrev");switch(g.key){case"Home":C=S;break;case"End":C=M;break;case"ArrowRight":i==="horizontal"&&(h?R():P());break;case"ArrowDown":i==="vertical"&&R();break;case"ArrowLeft":i==="horizontal"&&(h?P():R());break;case"ArrowUp":i==="vertical"&&P();break}const T=C%w;(j=x[T].ref.current)==null||j.focus()});return a.jsx(G$,{scope:r,disabled:o,direction:s,orientation:i,children:a.jsx(dd.Slot,{scope:r,children:a.jsx(Ne.div,{...c,"data-orientation":i,ref:u,onKeyDown:o?void 0:p})})})},"AccordionImpl")),wl="AccordionItem",[z$,hd]=Ma(wl),W$=m.forwardRef(tn(function(e,n){const{__scopeAccordion:r,value:o,...s}=e,i=Ra(wl,r),c=V$(wl,r),l=fd(r),u=Et(),d=o&&c.value.includes(o)||!1,f=i.disabled||e.disabled;return a.jsx(z$,{scope:r,open:d,disabled:f,triggerId:u,children:a.jsx(A$,{"data-orientation":i.orientation,"data-state":pd(d),...l,...s,ref:n,disabled:f,open:d,onOpenChange:h=>{h?c.onItemOpen(o):c.onItemClose(o)}})})},"AccordionItem")),K$="AccordionHeader",Y$=m.forwardRef(tn(function(e,n){const{__scopeAccordion:r,...o}=e,s=Ra(Hn,r),i=hd(K$,r);return a.jsx(Ne.h3,{"data-orientation":s.orientation,"data-state":pd(i.open),"data-disabled":i.disabled?"":void 0,...o,ref:n})},"AccordionHeader")),Xh="AccordionTrigger",X$=m.forwardRef(tn(function(e,n){const{__scopeAccordion:r,...o}=e,s=Ra(Hn,r),i=hd(Xh,r),c=B$(Xh,r),l=fd(r);return a.jsx(dd.ItemSlot,{scope:r,children:a.jsx(I$,{"aria-disabled":i.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...l,...o,ref:n})})},"AccordionTrigger")),q$="AccordionContent",Z$=m.forwardRef(tn(function(e,n){const{__scopeAccordion:r,...o}=e,s=Ra(Hn,r),i=hd(q$,r),c=fd(r);return a.jsx(D$,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...c,...o,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function pd(t){return t?"open":"closed"}tn(pd,"getState");var J$=F$,Q$=W$,e_=Y$,t_=X$,n_=Z$;const Ux=t=>v.Children.toArray(t).flatMap(e=>v.isValidElement(e)?e.type===v.Fragment?Ux(e.props.children):e.props.value?[e.props.value]:[]:[]),r_=t=>{try{const e=window.localStorage.getItem(t);return e===null?void 0:JSON.parse(e)}catch{return}},o_=v.forwardRef(function({variant:e="plain",persistKey:n,className:r,style:o,sx:s,children:i,...c},l){const{expandAll:u,...d}=c,{className:f,style:h,styleTag:p}=Ae(s,o,"cny-accordion",`cny-accordion-${e}`,r),g=d,b=g.defaultValue??(u&&g.type==="multiple"?Ux(i):void 0),x=!!n&&g.value===void 0,[y,w]=v.useState(b);v.useEffect(()=>{if(!x||!n)return;const S=r_(n);S!==void 0&&w(S)},[x,n]);const C=x?{value:y??(g.type==="multiple"?[]:""),onValueChange:S=>{var M;w(S);try{window.localStorage.setItem(n,JSON.stringify(S))}catch{}(M=g.onValueChange)==null||M.call(g,S)},defaultValue:void 0}:{defaultValue:b};return a.jsxs(J$,{ref:l,className:f,style:h,...d,...C,children:[p,i]})}),s_=v.forwardRef(function({className:e,...n},r){return a.jsx(Q$,{ref:r,className:ne("cny-accordion-item",e),...n})}),i_=v.forwardRef(function({children:e,className:n,icon:r,hideIndicator:o,...s},i){return a.jsx(e_,{className:"cny-accordion-header",children:a.jsxs(t_,{ref:i,className:ne("cny-accordion-trigger",n),...s,children:[r&&a.jsx("span",{className:"cny-accordion-trigger-icon",children:r}),a.jsx("span",{className:"cny-accordion-trigger-label",children:e}),!o&&a.jsx(bs,{size:14,"aria-hidden":"true",className:"cny-accordion-trigger-chevron"})]})})}),a_=v.forwardRef(function({children:e,className:n,...r},o){return a.jsx(n_,{ref:o,className:ne("cny-accordion-content",n),...r,children:a.jsx("div",{className:"cny-accordion-content-inner",children:e})})});var c_=Object.defineProperty,Xe=(t,e)=>c_(t,"name",{value:e,configurable:!0}),Hx=["PageUp","PageDown"],Gx=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],zx={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ls="Slider",[Cl,l_,u_]=No(Ls),[md,U_]=dt(Ls,[u_]),[d_,Fs]=md(Ls),f_=m.forwardRef(Xe(function(e,n){const{name:r,min:o=0,max:s=100,step:i=1,orientation:c="horizontal",disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[o],value:f,onValueChange:h=Xe(()=>{},"onValueChange"),onValueCommit:p=Xe(()=>{},"onValueCommit"),inverted:g=!1,form:b,...x}=e,y=m.useRef(new Set),w=m.useRef(0),C=m.useRef(!1),M=c==="horizontal"?h_:p_,[R,P]=m.useState(null),T=_e(n,P),[j=[],A]=lt({prop:f,defaultProp:d,onChange:Xe(E=>{var X;(X=[...y.current][w.current])==null||X.focus({preventScroll:!0,focusVisible:C.current}),C.current=!1,h(E)},"onChange")}),_=m.useRef(j),L=m.useRef(j);m.useEffect(()=>{const E=b?R==null?void 0:R.ownerDocument.getElementById(b):R==null?void 0:R.closest("form");if(E instanceof HTMLFormElement){const $=Xe(()=>A(L.current),"reset");return E.addEventListener("reset",$),()=>E.removeEventListener("reset",$)}},[R,b,A]);function I(E){const $=Qx(j,E);U(E,$)}Xe(I,"handleSlideStart");function k(E){U(E,w.current)}Xe(k,"handleSlideMove");function q(){String(j)!==String(_.current)&&p(j)}Xe(q,"handleSlideEnd");function U(E,$,{commit:X}={commit:!1}){const K=yd(i),ue=Qo(Math.round((E-o)/i)*i+o,K),D=is(ue,[o,s]);A((Z=[])=>{const F=Zx(Z,D,$);if(nb(F,u*i)){w.current=F.indexOf(D);const V=String(F)!==String(Z);return V&&X&&p(F),V?F:Z}else return Z})}return Xe(U,"updateValues"),a.jsx(d_,{scope:e.__scopeSlider,name:r,disabled:l,min:o,max:s,valueIndexToChangeRef:w,thumbs:y.current,values:j,orientation:c,form:b,children:a.jsx(Cl.Provider,{scope:e.__scopeSlider,children:a.jsx(Cl.Slot,{scope:e.__scopeSlider,children:a.jsx(M,{"aria-disabled":l,"data-disabled":l?"":void 0,...x,ref:T,onPointerDown:ge(x.onPointerDown,()=>{l||(_.current=j,C.current=!1)}),min:o,max:s,inverted:g,onSlideStart:l?void 0:I,onSlideMove:l?void 0:k,onSlideEnd:l?void 0:q,onHomeKeyDown:()=>{l||(C.current=!0,U(o,0,{commit:!0}))},onEndKeyDown:()=>{l||(C.current=!0,U(s,j.length-1,{commit:!0}))},onStepKeyDown:({event:E,direction:$})=>{if(!l){C.current=!0;const ue=Hx.includes(E.key)||E.shiftKey&&Gx.includes(E.key)?10:1,D=w.current,Z=j[D],F=rb(Z,{min:o,step:i,direction:$,multiplier:ue});U(F,D,{commit:!0})}}})})})})},"Slider")),[Wx,Kx]=md(Ls,{startEdge:"left",endEdge:"right",size:"width",direction:1}),h_=m.forwardRef(Xe(function(e,n){const{min:r,max:o,dir:s,inverted:i,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,[h,p]=m.useState(null),g=_e(n,p),b=m.useRef(void 0),x=or(s),y=x==="ltr",w=y&&!i||!y&&i;function C(S){const M=b.current||h.getBoundingClientRect(),R=[0,M.width],T=Ta(R,w?[r,o]:[o,r]);return b.current=M,T(S-M.left)}return Xe(C,"getValueFromPointer"),a.jsx(Wx,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:a.jsx(Yx,{dir:x,"data-orientation":"horizontal",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:S=>{const M=C(S.clientX);c==null||c(M)},onSlideMove:S=>{const M=C(S.clientX);l==null||l(M)},onSlideEnd:()=>{b.current=void 0,u==null||u()},onStepKeyDown:S=>{const R=zx[w?"from-left":"from-right"].includes(S.key);d==null||d({event:S,direction:R?-1:1})}})})},"SliderHorizontal")),p_=m.forwardRef(Xe(function(e,n){const{min:r,max:o,inverted:s,onSlideStart:i,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...d}=e,f=m.useRef(null),h=_e(n,f),p=m.useRef(void 0),g=!s;function b(x){const y=p.current||f.current.getBoundingClientRect(),w=[0,y.height],S=Ta(w,g?[o,r]:[r,o]);return p.current=y,S(x-y.top)}return Xe(b,"getValueFromPointer"),a.jsx(Wx,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:a.jsx(Yx,{"data-orientation":"vertical",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const y=b(x.clientY);i==null||i(y)},onSlideMove:x=>{const y=b(x.clientY);c==null||c(y)},onSlideEnd:()=>{p.current=void 0,l==null||l()},onStepKeyDown:x=>{const w=zx[g?"from-bottom":"from-top"].includes(x.key);u==null||u({event:x,direction:w?-1:1})}})})},"SliderVertical")),Yx=m.forwardRef(Xe(function(e,n){const{__scopeSlider:r,onSlideStart:o,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:c,onEndKeyDown:l,onStepKeyDown:u,...d}=e,f=Fs(Ls,r);return a.jsx(Ne.span,{...d,ref:n,onKeyDown:ge(e.onKeyDown,h=>{h.key==="Home"?(c(h),h.preventDefault()):h.key==="End"?(l(h),h.preventDefault()):Hx.concat(Gx).includes(h.key)&&(u(h),h.preventDefault())}),onPointerDown:ge(e.onPointerDown,h=>{const p=h.target;p.setPointerCapture(h.pointerId),h.preventDefault(),f.thumbs.has(p)?p.focus({preventScroll:!0,focusVisible:!1}):o(h)}),onPointerMove:ge(e.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&s(h)}),onPointerUp:ge(e.onPointerUp,h=>{const p=h.target;p.hasPointerCapture(h.pointerId)&&(p.releasePointerCapture(h.pointerId),i(h))})})},"SliderImpl")),m_="SliderTrack",g_=m.forwardRef(Xe(function(e,n){const{__scopeSlider:r,...o}=e,s=Fs(m_,r);return a.jsx(Ne.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...o,ref:n})},"SliderTrack")),qh="SliderRange",y_=m.forwardRef(Xe(function(e,n){const{__scopeSlider:r,...o}=e,s=Fs(qh,r),i=Kx(qh,r),c=m.useRef(null),l=_e(n,c),u=s.values.length,d=s.values.map(p=>gd(p,s.min,s.max)),f=u>1?Math.min(...d):0,h=100-Math.max(...d);return a.jsx(Ne.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...o,ref:l,style:{...e.style,[i.startEdge]:f+"%",[i.endEdge]:h+"%"}})},"SliderRange")),v_="SliderThumb",[x_,Xx]=md(v_),b_="SliderThumbProvider";function qx(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:o}=t,s=Fs(b_,e),i=l_(e),[c,l]=m.useState(null),u=m.useMemo(()=>c?i().findIndex(x=>x.ref.current===c):-1,[i,c]),d=Io(c),f=c?!!s.form||!!c.closest("form"):!0,h=s.values[u],p=n??(s.name?s.name+(s.values.length>1?"[]":""):void 0),g=h===void 0?0:gd(h,s.min,s.max);m.useEffect(()=>{if(c)return s.thumbs.add(c),()=>{s.thumbs.delete(c)}},[c,s.thumbs]);const b={value:h,name:p,form:s.form,isFormControl:f,index:u,thumb:c,onThumbChange:l,percent:g,size:d};return a.jsx(x_,{scope:e,...b,children:ob(o)?o(b):r})}Xe(qx,"SliderThumbProvider");var bc="SliderThumbTrigger",w_=m.forwardRef(Xe(function(e,n){const{__scopeSlider:r,...o}=e,s=Fs(bc,r),i=Kx(bc,r),{index:c,value:l,percent:u,size:d,onThumbChange:f}=Xx(bc,r),h=_e(n,f),p=Jx(c,s.values.length),g=d==null?void 0:d[i.size],b=g?eb(g,u,i.direction):0;return a.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${u}% + ${b}px)`},children:a.jsx(Cl.ItemSlot,{scope:r,children:a.jsx(Ne.span,{role:"slider","aria-label":e["aria-label"]||p,"aria-valuemin":s.min,"aria-valuenow":l,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...o,ref:h,style:l===void 0?{display:"none"}:e.style,onFocus:ge(e.onFocus,()=>{s.valueIndexToChangeRef.current=c})})})})},"SliderThumbTrigger")),C_=m.forwardRef(Xe(function(e,n){const{__scopeSlider:r,name:o,...s}=e;return a.jsx(qx,{__scopeSlider:r,name:o,internal_do_not_use_render:({index:i,isFormControl:c})=>a.jsxs(a.Fragment,{children:[a.jsx(w_,{...s,ref:n,__scopeSlider:r}),c?a.jsx(M_,{__scopeSlider:r},i):null]})})},"SliderThumb")),S_="SliderBubbleInput",M_=m.forwardRef(Xe(function({__scopeSlider:e,...n},r){const{value:o,name:s,form:i}=Xx(S_,e),c=m.useRef(null),l=_e(c,r),u=bu(o);return m.useEffect(()=>{const d=c.current;if(!d)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(u!==o&&p){const g=new Event("input",{bubbles:!0});p.call(d,o),d.dispatchEvent(g)}},[u,o]),a.jsx(Ne.input,{style:{display:"none"},name:s,form:i,...n,ref:l,defaultValue:o})},"SliderBubbleInput"));function Zx(t=[],e,n){const r=[...t];return r[n]=e,r.sort((o,s)=>o-s)}Xe(Zx,"getNextSortedValues");function gd(t,e,n){const s=100/(n-e)*(t-e);return is(s,[0,100])}Xe(gd,"convertValueToPercentage");function Jx(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}Xe(Jx,"getLabel");function Qx(t,e){if(t.length===1)return 0;const n=t.map(o=>Math.abs(o-e)),r=Math.min(...n);return n.indexOf(r)}Xe(Qx,"getClosestValueIndex");function eb(t,e,n){const r=t/2,s=Ta([0,50],[0,r]);return(r-s(e)*n)*n}Xe(eb,"getThumbInBoundsOffset");function tb(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}Xe(tb,"getStepsBetweenValues");function nb(t,e){if(e>0){const n=tb(t);return Math.min(...n)>=e}return!0}Xe(nb,"hasMinStepsBetweenValues");function Ta(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}Xe(Ta,"linearScale");function yd(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,o]=e.split("e"),s=r.split(".")[1]||"",i=Number(o);return Math.max(0,s.length-i)}const n=e.split(".")[1];return n?n.length:0}Xe(yd,"getDecimalCount");function Qo(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}Xe(Qo,"roundValue");function rb(t,{min:e,step:n,direction:r,multiplier:o}){const s=yd(n),i=(t-e)/n,c=Math.round(i),l=Qo(c*n+e,s)===Qo(t,s);let u;return l?u=c+o*r:r>0?u=Math.ceil(i):u=Math.floor(i),Qo(u*n+e,s)}Xe(rb,"getNextStepValue");function ob(t){return typeof t=="function"}Xe(ob,"isFunction");const R_=v.forwardRef(function({className:e,style:n,sx:r,size:o="md",color:s="primary",showValue:i=!1,showValueTooltip:c=!1,formatValue:l,value:u,defaultValue:d,onValueChange:f,onValueCommit:h,onPointerDown:p,...g},b){const[x,y]=v.useState(d??[0]),w=u??x,[C,S]=v.useState(!1);v.useEffect(()=>{if(!C)return;const j=()=>S(!1);return window.addEventListener("pointerup",j),window.addEventListener("pointercancel",j),()=>{window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j)}},[C]);const M=l??(j=>j),{className:R,style:P,styleTag:T}=Ae(r,n,"cny-slider",`cny-slider-${o}`,`cny-slider-${s}`,C&&"is-dragging",e);return a.jsxs(f_,{ref:b,className:R,style:P,value:u,defaultValue:d,onValueChange:j=>{u===void 0&&y(j),f==null||f(j)},onValueCommit:j=>{S(!1),h==null||h(j)},onPointerDown:j=>{c&&S(!0),p==null||p(j)},...g,children:[T,a.jsx(g_,{className:"cny-slider-track",children:a.jsx(y_,{className:"cny-slider-range"})}),w.map((j,A)=>a.jsxs(C_,{className:"cny-slider-thumb","aria-label":`Value ${A+1}`,children:[i&&a.jsx("span",{className:"cny-slider-bubble",children:M(j)}),c&&!i&&a.jsx("span",{className:"cny-slider-bubble cny-slider-tooltip","aria-hidden":"true",children:M(j)})]},A))]})}),T_=v.forwardRef(function({steps:e,active:n,orientation:r="horizontal",size:o="md",onStepClick:s,clickable:i=!1,className:c,style:l,sx:u,...d},f){const{className:h,style:p,styleTag:g}=Ae(u,l,"cny-stepper",`cny-stepper-${r}`,`cny-stepper-${o}`,c),b=v.useRef(null),x=y=>{b.current=y,typeof f=="function"?f(y):f&&(f.current=y)};return v.useEffect(()=>{var C;const y=(C=b.current)==null?void 0:C.querySelector(".cny-stepper-step.is-active");if(!y||typeof y.scrollIntoView!="function")return;const w=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;y.scrollIntoView({inline:r==="horizontal"?"center":"nearest",block:"nearest",behavior:w?"auto":"smooth"})},[n,r,e.length]),a.jsxs("ol",{ref:x,className:h,style:p,"aria-label":"Progress",...d,children:[g,e.map((y,w)=>{const C=w<n?"complete":w===n?"active":"upcoming",S=(i||C==="complete")&&!!s;return a.jsxs("li",{className:ne("cny-stepper-step",`is-${C}`,y.error&&"is-error"),children:[a.jsxs("button",{type:"button",className:"cny-stepper-step-row",onClick:S?()=>s==null?void 0:s(w):void 0,disabled:!S,"aria-current":C==="active"?"step":void 0,"aria-invalid":y.error||void 0,children:[a.jsx("span",{className:"cny-stepper-marker","aria-hidden":"true",children:y.error?a.jsx(au,{size:14}):C==="complete"?a.jsx(yr,{size:14}):y.icon??w+1}),a.jsxs("span",{className:"cny-stepper-text",children:[a.jsx("span",{className:"cny-stepper-label",children:y.label}),y.description&&a.jsx("span",{className:"cny-stepper-desc",children:y.description})]})]}),w<e.length-1&&a.jsx("span",{className:"cny-stepper-connector","aria-hidden":"true"})]},w)})]})}),j_=v.forwardRef(function({size:e=80,color:n="var(--color-primary, #3A73B3)",className:r,style:o,...s},i){const c=v.useId().replace(/[^a-zA-Z0-9_-]/g,""),l=`cny-loader-fade-reveal-${c}`,u=`cny-loader-${c}`;return a.jsxs("div",{ref:i,className:ne("cny-loader",u,r),style:{width:e,height:e*(24/21.635),color:n,...o},...s,children:[a.jsx(Tl,{css:`
240
+ @keyframes ${l} {
216
241
  0%, 100% { opacity: 0; transform: translateY(8px); }
217
242
  15%, 70% { opacity: 1; transform: translateY(0); }
218
243
  85% { opacity: 0; transform: translateY(-8px); }
219
244
  }
220
245
  .${u} .cny-loader-path {
221
246
  fill: currentColor;
222
- animation: ${c} 4s ease-in-out infinite both;
247
+ animation: ${l} 4s ease-in-out infinite both;
223
248
  }
224
249
  .${u} .cny-loader-path-1 { animation-delay: 0s; }
225
250
  .${u} .cny-loader-path-2 { animation-delay: 0.08s; }
@@ -229,5 +254,5 @@
229
254
  @media (prefers-reduced-motion: reduce) {
230
255
  .${u} .cny-loader-path { animation: none; opacity: 1; transform: none; }
231
256
  }
232
- `}),l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21.635 24",width:"100%",height:"100%","aria-label":"Loading",role:"img",children:l.jsxs("g",{transform:"translate(-1.257)",children:[l.jsx("path",{className:"cny-loader-path cny-loader-path-1",d:"M12.1,0c.164.445.331.89.492,1.336.395,1.1.182.893,1.3,1.1a10.661,10.661,0,0,1,6.248,3.545,10.889,10.889,0,0,1,2.635,5.742,11.121,11.121,0,0,1-1.05,6.511.338.338,0,0,1-.5.2q-2.952-1.155-5.91-2.295c-.974-.376-1.947-.76-2.935-1.1a1.239,1.239,0,0,0-.776.039c-2.143.806-4.276,1.636-6.413,2.457-.779.3-1.56.59-2.336.895-.21.082-.342.07-.45-.159a11.861,11.861,0,0,1-1.136-5.711A10.322,10.322,0,0,1,3.325,6.821,10.552,10.552,0,0,1,8.058,3.065a20.428,20.428,0,0,1,2.754-.7.587.587,0,0,0,.5-.418c.226-.649.475-1.291.714-1.936ZM6.638,14.907l-.087-.079c.11-.279.224-.557.328-.838q1.362-3.7,2.721-7.4c.349-.948.7-1.893,1.052-2.841.142-.386.071-.465-.339-.4-.046.008-.093.015-.138.025A9.679,9.679,0,0,0,3.769,7.9,10.238,10.238,0,0,0,3,17.173a.353.353,0,0,0,.529.229c.5-.193,1.014-.372,1.518-.566,2.225-.856,4.446-1.722,6.676-2.564a1.115,1.115,0,0,1,.706.006c.984.351,1.954.739,2.93,1.114q2.6,1,5.191,2c.272.106.438.057.553-.224a10.579,10.579,0,0,0,.7-5.15,9.587,9.587,0,0,0-1.536-4.234,9.885,9.885,0,0,0-6.433-4.434c-.4-.087-.492.014-.355.4.368,1.027.75,2.049,1.128,3.073l2.272,6.144c.238.645.474,1.29.733,1.995-.154-.045-.241-.064-.323-.1-1.632-.629-3.262-1.266-4.9-1.883a.949.949,0,0,0-.6-.03c-.973.348-1.932.731-2.9,1.1C8.146,14.339,7.392,14.622,6.638,14.907Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-2",d:"M20.8,19.615a.488.488,0,0,1-.668.472c-2.54-.979-5.081-1.953-7.617-2.941a1.3,1.3,0,0,0-1.016.02q-3.751,1.468-7.516,2.9a.6.6,0,0,1-.5-.082c-.266-.217-.214-.414.108-.538,2.737-1.054,5.474-2.11,8.218-3.147a.99.99,0,0,1,.637.044c1.494.561,2.979,1.144,4.468,1.718,1.193.459,2.389.912,3.582,1.373A1.853,1.853,0,0,1,20.8,19.615Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-3",d:"M19.535,21.173c-.368.517-.49.556-1,.357-1.969-.764-3.952-1.5-5.9-2.306a2.146,2.146,0,0,0-1.741.243c-1.8.675-3.589,1.391-5.383,2.087-.418.162-.556.106-.924-.359.239-.109.461-.225.693-.315,2.145-.83,4.288-1.664,6.441-2.473a1.151,1.151,0,0,1,.742.014c2.252.847,4.5,1.718,6.739,2.585C19.311,21.051,19.419,21.115,19.535,21.173Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-4",d:"M6.313,22.58a2.5,2.5,0,0,1,.265-.145c1.686-.65,3.375-1.293,5.058-1.949a1.127,1.127,0,0,1,.881,0c1.649.649,3.3,1.282,4.956,1.923a2.96,2.96,0,0,1,.274.14.807.807,0,0,1-1.033.324c-1.184-.45-2.365-.909-3.548-1.363a5.8,5.8,0,0,0-.826-.3,1.219,1.219,0,0,0-.646.028c-1.407.522-2.812,1.053-4.2,1.613A1.082,1.082,0,0,1,6.313,22.58Z"}),l.jsx("path",{className:"cny-loader-path cny-loader-path-5",d:"M8.657,23.713c.369-.141.659-.254.949-.364.745-.283,1.489-.57,2.238-.843a.633.633,0,0,1,.4-.027c1.012.375,2.017.767,3.024,1.157.03.011.052.043.126.106a1.809,1.809,0,0,1-1.424.168c-.51-.208-1.012-.442-1.535-.612a1.356,1.356,0,0,0-.742,0,6.489,6.489,0,0,0-1.177.461A2.017,2.017,0,0,1,8.657,23.713Z"})]})})]})});exports.Accordion=Vk;exports.AccordionContent=zk;exports.AccordionItem=Bk;exports.AccordionTrigger=Gk;exports.Alert=sP;exports.AreaChart=kI;exports.AspectRatio=kP;exports.Autocomplete=sk;exports.Avatar=iP;exports.AvatarStack=aP;exports.BREAKPOINTS=ef;exports.Badge=lI;exports.BarChart=DI;exports.Box=An;exports.Breadcrumb=ik;exports.Button=Er;exports.ButtonGroup=fC;exports.CHART_COLORS=Ea;exports.CannyLoader=lN;exports.Card=nP;exports.Center=NP;exports.Checkbox=Ca;exports.Chip=cI;exports.CommandPalette=lj;exports.CommandPaletteTrigger=uj;exports.ConfirmDialog=Qm;exports.Container=AP;exports.ContextMenu=SD;exports.ContextMenuCheckboxItem=MD;exports.ContextMenuContent=RD;exports.ContextMenuItem=TD;exports.ContextMenuLabel=AD;exports.ContextMenuRadioGroup=ED;exports.ContextMenuRadioItem=jD;exports.ContextMenuSeparator=DD;exports.ContextMenuSub=ID;exports.ContextMenuSubContent=ND;exports.ContextMenuSubTrigger=kD;exports.ContextMenuTrigger=PD;exports.CspNonceProvider=iv;exports.DataTable=jI;exports.DatePicker=aj;exports.Dialog=Zm;exports.DialogClose=vj;exports.DialogTrigger=yj;exports.Divider=DP;exports.Drawer=bj;exports.DrawerClose=Cj;exports.DrawerTrigger=wj;exports.FAB=hC;exports.Field=LP;exports.FileUploader=CI;exports.Grid=jP;exports.Group=_P;exports.IconButton=pC;exports.Input=tP;exports.LineChart=II;exports.List=OI;exports.ListItem=$I;exports.ListSeparator=LI;exports.ListSubheader=FI;exports.Menu=kA;exports.MenuCheckboxItem=$A;exports.MenuContent=_A;exports.MenuItem=OA;exports.MenuLabel=VA;exports.MenuRadioGroup=LA;exports.MenuRadioItem=FA;exports.MenuSeparator=BA;exports.MenuSub=GA;exports.MenuSubContent=UA;exports.MenuSubTrigger=zA;exports.MenuTrigger=NA;exports.MultiSelect=uE;exports.Navbar=fP;exports.NavbarActions=gP;exports.NavbarBrand=hP;exports.NavbarItem=mP;exports.NavbarNav=pP;exports.NavbarToggle=yP;exports.Pagination=Qg;exports.Panel=Ma;exports.PanelGroup=PI;exports.PanelResizeHandle=Zg;exports.PieChart=NI;exports.Popover=rI;exports.PopoverAnchor=sI;exports.PopoverClose=iI;exports.PopoverContent=aI;exports.PopoverTrigger=oI;exports.Progress=cP;exports.ProgressRing=lP;exports.Radio=FE;exports.RadioGroup=LE;exports.ResponsiveContainer=_I;exports.RichTreeView=xI;exports.Row=EP;exports.Scroll=Ep;exports.ScrollRegion=dP;exports.Select=X1;exports.SelectGroup=Z1;exports.SelectItem=q1;exports.SelectLabel=Q1;exports.SelectSeparator=J1;exports.Sidebar=xP;exports.SidebarFooter=wP;exports.SidebarHeader=bP;exports.SidebarItem=PP;exports.SidebarSection=SP;exports.SidebarToggle=CP;exports.Skeleton=ia;exports.Slider=aN;exports.Spacer=IP;exports.Stack=MP;exports.Stepper=cN;exports.Switch=YE;exports.Tabs=ek;exports.TabsContent=rk;exports.TabsList=tk;exports.TabsTrigger=nk;exports.Text=$P;exports.Textarea=FP;exports.Timeline=uI;exports.TimelineConnector=pI;exports.TimelineContent=mI;exports.TimelineDot=hI;exports.TimelineItem=dI;exports.TimelineOppositeContent=gI;exports.TimelineSeparator=fI;exports.ToastProvider=pj;exports.ToggleButton=jC;exports.ToggleButtonGroup=lS;exports.ToggleButtonGroupItem=uS;exports.Tooltip=JD;exports.TooltipContent=nI;exports.TooltipProvider=QD;exports.TooltipRoot=eI;exports.TooltipTrigger=tI;exports.TreeItem=Xg;exports.TreeView=Yg;exports.disableGlobalCursorStyles=RI;exports.resolveSx=_a;exports.useCommandPalette=cj;exports.useConfirm=xj;exports.useCspNonce=ka;exports.useFileDrop=qg;exports.useToast=gj;
257
+ `}),a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21.635 24",width:"100%",height:"100%","aria-label":"Loading",role:"img",children:a.jsxs("g",{transform:"translate(-1.257)",children:[a.jsx("path",{className:"cny-loader-path cny-loader-path-1",d:"M12.1,0c.164.445.331.89.492,1.336.395,1.1.182.893,1.3,1.1a10.661,10.661,0,0,1,6.248,3.545,10.889,10.889,0,0,1,2.635,5.742,11.121,11.121,0,0,1-1.05,6.511.338.338,0,0,1-.5.2q-2.952-1.155-5.91-2.295c-.974-.376-1.947-.76-2.935-1.1a1.239,1.239,0,0,0-.776.039c-2.143.806-4.276,1.636-6.413,2.457-.779.3-1.56.59-2.336.895-.21.082-.342.07-.45-.159a11.861,11.861,0,0,1-1.136-5.711A10.322,10.322,0,0,1,3.325,6.821,10.552,10.552,0,0,1,8.058,3.065a20.428,20.428,0,0,1,2.754-.7.587.587,0,0,0,.5-.418c.226-.649.475-1.291.714-1.936ZM6.638,14.907l-.087-.079c.11-.279.224-.557.328-.838q1.362-3.7,2.721-7.4c.349-.948.7-1.893,1.052-2.841.142-.386.071-.465-.339-.4-.046.008-.093.015-.138.025A9.679,9.679,0,0,0,3.769,7.9,10.238,10.238,0,0,0,3,17.173a.353.353,0,0,0,.529.229c.5-.193,1.014-.372,1.518-.566,2.225-.856,4.446-1.722,6.676-2.564a1.115,1.115,0,0,1,.706.006c.984.351,1.954.739,2.93,1.114q2.6,1,5.191,2c.272.106.438.057.553-.224a10.579,10.579,0,0,0,.7-5.15,9.587,9.587,0,0,0-1.536-4.234,9.885,9.885,0,0,0-6.433-4.434c-.4-.087-.492.014-.355.4.368,1.027.75,2.049,1.128,3.073l2.272,6.144c.238.645.474,1.29.733,1.995-.154-.045-.241-.064-.323-.1-1.632-.629-3.262-1.266-4.9-1.883a.949.949,0,0,0-.6-.03c-.973.348-1.932.731-2.9,1.1C8.146,14.339,7.392,14.622,6.638,14.907Z"}),a.jsx("path",{className:"cny-loader-path cny-loader-path-2",d:"M20.8,19.615a.488.488,0,0,1-.668.472c-2.54-.979-5.081-1.953-7.617-2.941a1.3,1.3,0,0,0-1.016.02q-3.751,1.468-7.516,2.9a.6.6,0,0,1-.5-.082c-.266-.217-.214-.414.108-.538,2.737-1.054,5.474-2.11,8.218-3.147a.99.99,0,0,1,.637.044c1.494.561,2.979,1.144,4.468,1.718,1.193.459,2.389.912,3.582,1.373A1.853,1.853,0,0,1,20.8,19.615Z"}),a.jsx("path",{className:"cny-loader-path cny-loader-path-3",d:"M19.535,21.173c-.368.517-.49.556-1,.357-1.969-.764-3.952-1.5-5.9-2.306a2.146,2.146,0,0,0-1.741.243c-1.8.675-3.589,1.391-5.383,2.087-.418.162-.556.106-.924-.359.239-.109.461-.225.693-.315,2.145-.83,4.288-1.664,6.441-2.473a1.151,1.151,0,0,1,.742.014c2.252.847,4.5,1.718,6.739,2.585C19.311,21.051,19.419,21.115,19.535,21.173Z"}),a.jsx("path",{className:"cny-loader-path cny-loader-path-4",d:"M6.313,22.58a2.5,2.5,0,0,1,.265-.145c1.686-.65,3.375-1.293,5.058-1.949a1.127,1.127,0,0,1,.881,0c1.649.649,3.3,1.282,4.956,1.923a2.96,2.96,0,0,1,.274.14.807.807,0,0,1-1.033.324c-1.184-.45-2.365-.909-3.548-1.363a5.8,5.8,0,0,0-.826-.3,1.219,1.219,0,0,0-.646.028c-1.407.522-2.812,1.053-4.2,1.613A1.082,1.082,0,0,1,6.313,22.58Z"}),a.jsx("path",{className:"cny-loader-path cny-loader-path-5",d:"M8.657,23.713c.369-.141.659-.254.949-.364.745-.283,1.489-.57,2.238-.843a.633.633,0,0,1,.4-.027c1.012.375,2.017.767,3.024,1.157.03.011.052.043.126.106a1.809,1.809,0,0,1-1.424.168c-.51-.208-1.012-.442-1.535-.612a1.356,1.356,0,0,0-.742,0,6.489,6.489,0,0,0-1.177.461A2.017,2.017,0,0,1,8.657,23.713Z"})]})})]})});exports.Accordion=o_;exports.AccordionContent=a_;exports.AccordionItem=s_;exports.AccordionTrigger=i_;exports.Alert=SR;exports.AreaChart=g2;exports.AspectRatio=nP;exports.Autocomplete=C$;exports.Avatar=Og;exports.AvatarGroup=TR;exports.AvatarStack=RR;exports.BREAKPOINTS=ap;exports.Badge=ND;exports.BarChart=h2;exports.Box=Kr;exports.Breadcrumb=S$;exports.Button=Ur;exports.ButtonGroup=S1;exports.CHART_COLORS=vl;exports.CannyLoader=j_;exports.Card=xR;exports.Center=rP;exports.Checkbox=Li;exports.Chip=PD;exports.CommandPalette=nA;exports.CommandPaletteTrigger=rA;exports.ConfirmDialog=Tv;exports.Container=Qj;exports.ContextMenu=pD;exports.ContextMenuCheckboxItem=vD;exports.ContextMenuContent=gD;exports.ContextMenuItem=yD;exports.ContextMenuLabel=wD;exports.ContextMenuRadioGroup=xD;exports.ContextMenuRadioItem=bD;exports.ContextMenuSeparator=CD;exports.ContextMenuSub=SD;exports.ContextMenuSubContent=RD;exports.ContextMenuSubTrigger=MD;exports.ContextMenuTrigger=mD;exports.CspNonceProvider=yb;exports.DataTable=r2;exports.DatePicker=Zk;exports.Dialog=Rv;exports.DialogClose=hA;exports.DialogTrigger=fA;exports.Divider=eP;exports.DonutChart=O2;exports.Drawer=mA;exports.DrawerClose=yA;exports.DrawerTrigger=gA;exports.FAB=M1;exports.Field=aP;exports.FileUploader=WD;exports.FunnelChart=W2;exports.GanttChart=A2;exports.GaugeChart=F2;exports.Grid=Jj;exports.Group=oP;exports.Heatmap=Z2;exports.IconButton=R1;exports.Input=_g;exports.LineChart=m2;exports.List=t$;exports.ListItem=Si;exports.ListSeparator=Ix;exports.ListSubheader=Dx;exports.Menu=ix;exports.MenuCheckboxItem=PI;exports.MenuContent=cx;exports.MenuItem=lx;exports.MenuLabel=kI;exports.MenuRadioGroup=NI;exports.MenuRadioItem=EI;exports.MenuSeparator=AI;exports.MenuSub=II;exports.MenuSubContent=$I;exports.MenuSubTrigger=DI;exports.MenuTrigger=ax;exports.MultiSelect=tk;exports.Navbar=IR;exports.NavbarActions=OR;exports.NavbarBrand=DR;exports.NavbarItem=_R;exports.NavbarNav=$R;exports.NavbarToggle=LR;exports.Pagination=Sx;exports.Panel=yl;exports.PanelGroup=YD;exports.PanelResizeHandle=Cx;exports.PieChart=Ex;exports.Popover=hx;exports.PopoverAnchor=TD;exports.PopoverClose=jD;exports.PopoverContent=mx;exports.PopoverTrigger=px;exports.Progress=jR;exports.ProgressRing=PR;exports.RadarChart=U2;exports.Radio=Ek;exports.RadioGroup=Nk;exports.ResponsiveContainer=x2;exports.RichTreeView=UD;exports.Row=Zj;exports.ScatterChart=H2;exports.Scroll=Lg;exports.ScrollRegion=ER;exports.Select=VN;exports.SelectGroup=UN;exports.SelectItem=BN;exports.SelectLabel=HN;exports.SelectSeparator=GN;exports.Sidebar=Uj;exports.SidebarFooter=Gj;exports.SidebarHeader=Hj;exports.SidebarItem=Kj;exports.SidebarSection=Wj;exports.SidebarToggle=zj;exports.Skeleton=jt;exports.SkeletonCard=kR;exports.SkeletonListItem=AR;exports.Slider=R_;exports.Spacer=tP;exports.Sparkline=Ax;exports.Stack=qj;exports.StatCard=B2;exports.Stepper=T_;exports.Switch=Fk;exports.Tabs=g$;exports.TabsContent=x$;exports.TabsList=y$;exports.TabsTrigger=v$;exports.Text=iP;exports.Textarea=cP;exports.Timeline=ED;exports.TimelineConnector=DD;exports.TimelineContent=$D;exports.TimelineDot=ID;exports.TimelineItem=kD;exports.TimelineOppositeContent=_D;exports.TimelineSeparator=AD;exports.ToastProvider=lA;exports.ToggleButton=V1;exports.ToggleButtonGroup=bM;exports.ToggleButtonGroupItem=wM;exports.Tooltip=Ry;exports.TooltipContent=Fj;exports.TooltipProvider=My;exports.TooltipRoot=Oj;exports.TooltipTrigger=Lj;exports.TreeItem=ba;exports.TreeView=bx;exports.disableGlobalCursorStyles=XD;exports.resolveSx=jl;exports.useCommandPalette=eA;exports.useConfirm=pA;exports.useCspNonce=Rl;exports.useFileDrop=wx;exports.useToast=dA;
233
258
  //# sourceMappingURL=index.cjs.map