@arronqzy/react-blueprint 1.0.0 → 1.0.3

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 (70) hide show
  1. package/README.md +103 -0
  2. package/package.json +6 -6
  3. package/src/BlueprintNodeConfigSidebar.tsx +3 -0
  4. package/src/blueprint.css +21 -15
  5. package/src/components/BlueprintExecutionLogPanel.tsx +2 -2
  6. package/src/components/FetchNodeConfigPanel.tsx +4 -1
  7. package/src/graph/blueprint-graph.ts +5 -1
  8. package/src/graph/document.ts +46 -8
  9. package/src/graph/sync-nodes.ts +3 -1
  10. package/src/hooks/useBlueprintDebugSession.ts +24 -22
  11. package/src/hooks/useBlueprintFlowColorMode.ts +30 -6
  12. package/src/runtime/document-to-runnable-graph.ts +9 -6
  13. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/aix-ppc64.json +0 -1
  14. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/android-arm.json +0 -1
  15. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/android-arm64.json +0 -1
  16. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/android-x64.json +0 -1
  17. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/darwin-arm64.json +0 -1
  18. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/darwin-x64.json +0 -1
  19. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/freebsd-arm64.json +0 -1
  20. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/freebsd-x64.json +0 -1
  21. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-arm.json +0 -1
  22. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-arm64.json +0 -1
  23. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-ia32.json +0 -1
  24. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-loong64.json +0 -1
  25. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-mips64el.json +0 -1
  26. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-ppc64.json +0 -1
  27. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-riscv64.json +0 -1
  28. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-s390x.json +0 -1
  29. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/linux-x64.json +0 -1
  30. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/netbsd-x64.json +0 -1
  31. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/openbsd-x64.json +0 -1
  32. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/sunos-x64.json +0 -1
  33. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/win32-arm64.json +0 -1
  34. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/win32-ia32.json +0 -1
  35. package/.pnpm-cache/metadata/registry.npmjs.org/@esbuild/win32-x64.json +0 -1
  36. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-android-arm-eabi.json +0 -1
  37. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-android-arm64.json +0 -1
  38. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-darwin-arm64.json +0 -1
  39. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-darwin-x64.json +0 -1
  40. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-freebsd-arm64.json +0 -1
  41. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-freebsd-x64.json +0 -1
  42. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf.json +0 -1
  43. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf.json +0 -1
  44. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-arm64-gnu.json +0 -1
  45. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-arm64-musl.json +0 -1
  46. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu.json +0 -1
  47. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu.json +0 -1
  48. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu.json +0 -1
  49. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-riscv64-musl.json +0 -1
  50. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-s390x-gnu.json +0 -1
  51. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-x64-gnu.json +0 -1
  52. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-linux-x64-musl.json +0 -1
  53. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-win32-arm64-msvc.json +0 -1
  54. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-win32-ia32-msvc.json +0 -1
  55. package/.pnpm-cache/metadata/registry.npmjs.org/@rollup/rollup-win32-x64-msvc.json +0 -1
  56. package/.pnpm-cache/metadata/registry.npmjs.org/eslint.json +0 -1
  57. package/.pnpm-cache/metadata/registry.npmjs.org/fsevents.json +0 -1
  58. package/.pnpm-cache/metadata/registry.npmjs.org/react-dom.json +0 -1
  59. package/.pnpm-cache/metadata/registry.npmjs.org/react-is.json +0 -1
  60. package/.pnpm-cache/metadata/registry.npmjs.org/turbo-darwin-64.json +0 -1
  61. package/.pnpm-cache/metadata/registry.npmjs.org/turbo-darwin-arm64.json +0 -1
  62. package/.pnpm-cache/metadata/registry.npmjs.org/turbo-linux-64.json +0 -1
  63. package/.pnpm-cache/metadata/registry.npmjs.org/turbo-linux-arm64.json +0 -1
  64. package/.pnpm-cache/metadata/registry.npmjs.org/turbo-windows-64.json +0 -1
  65. package/.pnpm-cache/metadata/registry.npmjs.org/turbo-windows-arm64.json +0 -1
  66. package/.pnpm-cache/metadata/registry.npmjs.org/typescript.json +0 -1
  67. package/.turbo/turbo-lint.log +0 -4
  68. package/dist/assets/index-CneNgzWb.css +0 -1
  69. package/dist/assets/index-DsVhHV0-.js +0 -226
  70. package/dist/index.html +0 -14
@@ -1,226 +0,0 @@
1
- var hP=Object.defineProperty;var gP=(e,t,n)=>t in e?hP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Vy=(e,t,n)=>gP(e,typeof t!="symbol"?t+"":t,n);function vP(e,t){for(var n=0;n<t.length;n++){const o=t[n];if(typeof o!="string"&&!Array.isArray(o)){for(const r in o)if(r!=="default"&&!(r in e)){const a=Object.getOwnPropertyDescriptor(o,r);a&&Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>o[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();function gd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rx={exports:{}},vd={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var yP=Symbol.for("react.transitional.element"),bP=Symbol.for("react.fragment");function Tx(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:yP,type:e,key:o,ref:t!==void 0?t:null,props:n}}vd.Fragment=bP;vd.jsx=Tx;vd.jsxs=Tx;Rx.exports=vd;var Vh=Rx.exports;const De=Vh.Fragment,b=Vh.jsx,re=Vh.jsxs;var Ax={exports:{}},pe={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Gh=Symbol.for("react.transitional.element"),wP=Symbol.for("react.portal"),xP=Symbol.for("react.fragment"),SP=Symbol.for("react.strict_mode"),EP=Symbol.for("react.profiler"),CP=Symbol.for("react.consumer"),NP=Symbol.for("react.context"),_P=Symbol.for("react.forward_ref"),RP=Symbol.for("react.suspense"),TP=Symbol.for("react.memo"),Mx=Symbol.for("react.lazy"),AP=Symbol.for("react.activity"),Gy=Symbol.iterator;function MP(e){return e===null||typeof e!="object"?null:(e=Gy&&e[Gy]||e["@@iterator"],typeof e=="function"?e:null)}var Dx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ox=Object.assign,Px={};function Ci(e,t,n){this.props=e,this.context=t,this.refs=Px,this.updater=n||Dx}Ci.prototype.isReactComponent={};Ci.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ci.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function zx(){}zx.prototype=Ci.prototype;function Yh(e,t,n){this.props=e,this.context=t,this.refs=Px,this.updater=n||Dx}var Fh=Yh.prototype=new zx;Fh.constructor=Yh;Ox(Fh,Ci.prototype);Fh.isPureReactComponent=!0;var Yy=Array.isArray;function Zp(){}var ke={H:null,A:null,T:null,S:null},Ix=Object.prototype.hasOwnProperty;function Xh(e,t,n){var o=n.ref;return{$$typeof:Gh,type:e,key:t,ref:o!==void 0?o:null,props:n}}function DP(e,t){return Xh(e.type,t,e.props)}function Kh(e){return typeof e=="object"&&e!==null&&e.$$typeof===Gh}function OP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Fy=/\/+/g;function kf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?OP(""+e.key):t.toString(36)}function PP(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Zp,Zp):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function ba(e,t,n,o,r){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(a){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Gh:case wP:i=!0;break;case Mx:return i=e._init,ba(i(e._payload),t,n,o,r)}}if(i)return r=r(e),i=o===""?"."+kf(e,0):o,Yy(r)?(n="",i!=null&&(n=i.replace(Fy,"$&/")+"/"),ba(r,t,n,"",function(c){return c})):r!=null&&(Kh(r)&&(r=DP(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Fy,"$&/")+"/")+i)),t.push(r)),1;i=0;var l=o===""?".":o+":";if(Yy(e))for(var s=0;s<e.length;s++)o=e[s],a=l+kf(o,s),i+=ba(o,t,n,a,r);else if(s=MP(e),typeof s=="function")for(e=s.call(e),s=0;!(o=e.next()).done;)o=o.value,a=l+kf(o,s++),i+=ba(o,t,n,a,r);else if(a==="object"){if(typeof e.then=="function")return ba(PP(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function tc(e,t,n){if(e==null)return e;var o=[],r=0;return ba(e,o,"","",function(a){return t.call(n,a,r++)}),o}function zP(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Xy=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},IP={map:tc,forEach:function(e,t,n){tc(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return tc(e,function(){t++}),t},toArray:function(e){return tc(e,function(t){return t})||[]},only:function(e){if(!Kh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};pe.Activity=AP;pe.Children=IP;pe.Component=Ci;pe.Fragment=xP;pe.Profiler=EP;pe.PureComponent=Yh;pe.StrictMode=SP;pe.Suspense=RP;pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ke;pe.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ke.H.useMemoCache(e)}};pe.cache=function(e){return function(){return e.apply(null,arguments)}};pe.cacheSignal=function(){return null};pe.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Ox({},e.props),r=e.key;if(t!=null)for(a in t.key!==void 0&&(r=""+t.key),t)!Ix.call(t,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&t.ref===void 0||(o[a]=t[a]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var i=Array(a),l=0;l<a;l++)i[l]=arguments[l+2];o.children=i}return Xh(e.type,r,o)};pe.createContext=function(e){return e={$$typeof:NP,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:CP,_context:e},e};pe.createElement=function(e,t,n){var o,r={},a=null;if(t!=null)for(o in t.key!==void 0&&(a=""+t.key),t)Ix.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var i=arguments.length-2;if(i===1)r.children=n;else if(1<i){for(var l=Array(i),s=0;s<i;s++)l[s]=arguments[s+2];r.children=l}if(e&&e.defaultProps)for(o in i=e.defaultProps,i)r[o]===void 0&&(r[o]=i[o]);return Xh(e,a,r)};pe.createRef=function(){return{current:null}};pe.forwardRef=function(e){return{$$typeof:_P,render:e}};pe.isValidElement=Kh;pe.lazy=function(e){return{$$typeof:Mx,_payload:{_status:-1,_result:e},_init:zP}};pe.memo=function(e,t){return{$$typeof:TP,type:e,compare:t===void 0?null:t}};pe.startTransition=function(e){var t=ke.T,n={};ke.T=n;try{var o=e(),r=ke.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(Zp,Xy)}catch(a){Xy(a)}finally{t!==null&&n.types!==null&&(t.types=n.types),ke.T=t}};pe.unstable_useCacheRefresh=function(){return ke.H.useCacheRefresh()};pe.use=function(e){return ke.H.use(e)};pe.useActionState=function(e,t,n){return ke.H.useActionState(e,t,n)};pe.useCallback=function(e,t){return ke.H.useCallback(e,t)};pe.useContext=function(e){return ke.H.useContext(e)};pe.useDebugValue=function(){};pe.useDeferredValue=function(e,t){return ke.H.useDeferredValue(e,t)};pe.useEffect=function(e,t){return ke.H.useEffect(e,t)};pe.useEffectEvent=function(e){return ke.H.useEffectEvent(e)};pe.useId=function(){return ke.H.useId()};pe.useImperativeHandle=function(e,t,n){return ke.H.useImperativeHandle(e,t,n)};pe.useInsertionEffect=function(e,t){return ke.H.useInsertionEffect(e,t)};pe.useLayoutEffect=function(e,t){return ke.H.useLayoutEffect(e,t)};pe.useMemo=function(e,t){return ke.H.useMemo(e,t)};pe.useOptimistic=function(e,t){return ke.H.useOptimistic(e,t)};pe.useReducer=function(e,t,n){return ke.H.useReducer(e,t,n)};pe.useRef=function(e){return ke.H.useRef(e)};pe.useState=function(e){return ke.H.useState(e)};pe.useSyncExternalStore=function(e,t,n){return ke.H.useSyncExternalStore(e,t,n)};pe.useTransition=function(){return ke.H.useTransition()};pe.version="19.2.0";Ax.exports=pe;var p=Ax.exports;const ie=gd(p),yd=vP({__proto__:null,default:ie},[p]);var Lx={exports:{}},bd={},kx={exports:{}},$x={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(R,I){var D=R.length;R.push(I);e:for(;0<D;){var M=D-1>>>1,U=R[M];if(0<r(U,I))R[M]=I,R[D]=U,D=M;else break e}}function n(R){return R.length===0?null:R[0]}function o(R){if(R.length===0)return null;var I=R[0],D=R.pop();if(D!==I){R[0]=D;e:for(var M=0,U=R.length,F=U>>>1;M<F;){var $=2*(M+1)-1,H=R[$],V=$+1,Y=R[V];if(0>r(H,D))V<U&&0>r(Y,H)?(R[M]=Y,R[V]=D,M=V):(R[M]=H,R[$]=D,M=$);else if(V<U&&0>r(Y,D))R[M]=Y,R[V]=D,M=V;else break e}}return I}function r(R,I){var D=R.sortIndex-I.sortIndex;return D!==0?D:R.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var s=[],c=[],f=1,u=null,d=3,m=!1,v=!1,g=!1,x=!1,h=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function S(R){for(var I=n(c);I!==null;){if(I.callback===null)o(c);else if(I.startTime<=R)o(c),I.sortIndex=I.expirationTime,t(s,I);else break;I=n(c)}}function E(R){if(g=!1,S(R),!v)if(n(s)!==null)v=!0,N||(N=!0,O());else{var I=n(c);I!==null&&L(E,I.startTime-R)}}var N=!1,C=-1,A=5,T=-1;function k(){return x?!0:!(e.unstable_now()-T<A)}function z(){if(x=!1,N){var R=e.unstable_now();T=R;var I=!0;try{e:{v=!1,g&&(g=!1,w(C),C=-1),m=!0;var D=d;try{t:{for(S(R),u=n(s);u!==null&&!(u.expirationTime>R&&k());){var M=u.callback;if(typeof M=="function"){u.callback=null,d=u.priorityLevel;var U=M(u.expirationTime<=R);if(R=e.unstable_now(),typeof U=="function"){u.callback=U,S(R),I=!0;break t}u===n(s)&&o(s),S(R)}else o(s);u=n(s)}if(u!==null)I=!0;else{var F=n(c);F!==null&&L(E,F.startTime-R),I=!1}}break e}finally{u=null,d=D,m=!1}I=void 0}}finally{I?O():N=!1}}}var O;if(typeof y=="function")O=function(){y(z)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,_=P.port2;P.port1.onmessage=z,O=function(){_.postMessage(null)}}else O=function(){h(z,0)};function L(R,I){C=h(function(){R(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_next=function(R){switch(d){case 1:case 2:case 3:var I=3;break;default:I=d}var D=d;d=I;try{return R()}finally{d=D}},e.unstable_requestPaint=function(){x=!0},e.unstable_runWithPriority=function(R,I){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var D=d;d=R;try{return I()}finally{d=D}},e.unstable_scheduleCallback=function(R,I,D){var M=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?M+D:M):D=M,R){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=D+U,R={id:f++,callback:I,priorityLevel:R,startTime:D,expirationTime:U,sortIndex:-1},D>M?(R.sortIndex=D,t(c,R),n(s)===null&&R===n(c)&&(g?(w(C),C=-1):g=!0,L(E,D-M))):(R.sortIndex=U,t(s,R),v||m||(v=!0,N||(N=!0,O()))),R},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(R){var I=d;return function(){var D=d;d=I;try{return R.apply(this,arguments)}finally{d=D}}}})($x);kx.exports=$x;var LP=kx.exports,Hx={exports:{}},xt={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var kP=p;function Bx(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Ro(){}var wt={d:{f:Ro,r:function(){throw Error(Bx(522))},D:Ro,C:Ro,L:Ro,m:Ro,X:Ro,S:Ro,M:Ro},p:0,findDOMNode:null},$P=Symbol.for("react.portal");function HP(e,t,n){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$P,key:o==null?null:""+o,children:e,containerInfo:t,implementation:n}}var ml=kP.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function wd(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}xt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=wt;xt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Bx(299));return HP(e,t,null,n)};xt.flushSync=function(e){var t=ml.T,n=wt.p;try{if(ml.T=null,wt.p=2,e)return e()}finally{ml.T=t,wt.p=n,wt.d.f()}};xt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,wt.d.C(e,t))};xt.prefetchDNS=function(e){typeof e=="string"&&wt.d.D(e)};xt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,o=wd(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,a=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?wt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:o,integrity:r,fetchPriority:a}):n==="script"&&wt.d.X(e,{crossOrigin:o,integrity:r,fetchPriority:a,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};xt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=wd(t.as,t.crossOrigin);wt.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&wt.d.M(e)};xt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,o=wd(n,t.crossOrigin);wt.d.L(e,n,{crossOrigin:o,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};xt.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=wd(t.as,t.crossOrigin);wt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else wt.d.m(e)};xt.requestFormReset=function(e){wt.d.r(e)};xt.unstable_batchedUpdates=function(e,t){return e(t)};xt.useFormState=function(e,t,n){return ml.H.useFormState(e,t,n)};xt.useFormStatus=function(){return ml.H.useHostTransitionStatus()};xt.version="19.2.0";function Ux(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ux)}catch(e){console.error(e)}}Ux(),Hx.exports=xt;var Jr=Hx.exports;const Vx=gd(Jr);/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var rt=LP,Gx=p,BP=Jr;function J(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Yx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function us(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Fx(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Xx(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ky(e){if(us(e)!==e)throw Error(J(188))}function UP(e){var t=e.alternate;if(!t){if(t=us(e),t===null)throw Error(J(188));return t!==e?null:e}for(var n=e,o=t;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(o=r.return,o!==null){n=o;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return Ky(r),e;if(a===o)return Ky(r),t;a=a.sibling}throw Error(J(188))}if(n.return!==o.return)n=r,o=a;else{for(var i=!1,l=r.child;l;){if(l===n){i=!0,n=r,o=a;break}if(l===o){i=!0,o=r,n=a;break}l=l.sibling}if(!i){for(l=a.child;l;){if(l===n){i=!0,n=a,o=r;break}if(l===o){i=!0,o=a,n=r;break}l=l.sibling}if(!i)throw Error(J(189))}}if(n.alternate!==o)throw Error(J(190))}if(n.tag!==3)throw Error(J(188));return n.stateNode.current===n?e:t}function Kx(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Kx(e),t!==null)return t;e=e.sibling}return null}var $e=Object.assign,VP=Symbol.for("react.element"),nc=Symbol.for("react.transitional.element"),tl=Symbol.for("react.portal"),Na=Symbol.for("react.fragment"),jx=Symbol.for("react.strict_mode"),Qp=Symbol.for("react.profiler"),qx=Symbol.for("react.consumer"),ro=Symbol.for("react.context"),jh=Symbol.for("react.forward_ref"),Wp=Symbol.for("react.suspense"),Jp=Symbol.for("react.suspense_list"),qh=Symbol.for("react.memo"),Po=Symbol.for("react.lazy"),em=Symbol.for("react.activity"),GP=Symbol.for("react.memo_cache_sentinel"),jy=Symbol.iterator;function Vi(e){return e===null||typeof e!="object"?null:(e=jy&&e[jy]||e["@@iterator"],typeof e=="function"?e:null)}var YP=Symbol.for("react.client.reference");function tm(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===YP?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Na:return"Fragment";case Qp:return"Profiler";case jx:return"StrictMode";case Wp:return"Suspense";case Jp:return"SuspenseList";case em:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case tl:return"Portal";case ro:return e.displayName||"Context";case qx:return(e._context.displayName||"Context")+".Consumer";case jh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qh:return t=e.displayName||null,t!==null?t:tm(e.type)||"Memo";case Po:t=e._payload,e=e._init;try{return tm(e(t))}catch{}}return null}var nl=Array.isArray,de=Gx.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ee=BP.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Mr={pending:!1,data:null,method:null,action:null},nm=[],_a=-1;function Bn(e){return{current:e}}function lt(e){0>_a||(e.current=nm[_a],nm[_a]=null,_a--)}function Oe(e,t){_a++,nm[_a]=e.current,e.current=t}var Ln=Bn(null),Dl=Bn(null),Fo=Bn(null),au=Bn(null);function iu(e,t){switch(Oe(Fo,t),Oe(Dl,e),Oe(Ln,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?eb(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=eb(t),e=hE(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}lt(Ln),Oe(Ln,e)}function ei(){lt(Ln),lt(Dl),lt(Fo)}function om(e){e.memoizedState!==null&&Oe(au,e);var t=Ln.current,n=hE(t,e.type);t!==n&&(Oe(Dl,e),Oe(Ln,n))}function lu(e){Dl.current===e&&(lt(Ln),lt(Dl)),au.current===e&&(lt(au),Vl._currentValue=Mr)}var $f,qy;function Cr(e){if($f===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);$f=t&&t[1]||"",qy=-1<n.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+$f+e+qy}var Hf=!1;function Bf(e,t){if(!e||Hf)return"";Hf=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(m){var d=m}Reflect.construct(e,[],u)}else{try{u.call()}catch(m){d=m}e.call(u.prototype)}}else{try{throw Error()}catch(m){d=m}(u=e())&&typeof u.catch=="function"&&u.catch(function(){})}}catch(m){if(m&&d&&typeof m.stack=="string")return[m.stack,d.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=o.DetermineComponentFrameRoot(),i=a[0],l=a[1];if(i&&l){var s=i.split(`
44
- `),c=l.split(`
45
- `);for(r=o=0;o<s.length&&!s[o].includes("DetermineComponentFrameRoot");)o++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(o===s.length||r===c.length)for(o=s.length-1,r=c.length-1;1<=o&&0<=r&&s[o]!==c[r];)r--;for(;1<=o&&0<=r;o--,r--)if(s[o]!==c[r]){if(o!==1||r!==1)do if(o--,r--,0>r||s[o]!==c[r]){var f=`
46
- `+s[o].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=o&&0<=r);break}}}finally{Hf=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Cr(n):""}function FP(e,t){switch(e.tag){case 26:case 27:case 5:return Cr(e.type);case 16:return Cr("Lazy");case 13:return e.child!==t&&t!==null?Cr("Suspense Fallback"):Cr("Suspense");case 19:return Cr("SuspenseList");case 0:case 15:return Bf(e.type,!1);case 11:return Bf(e.type.render,!1);case 1:return Bf(e.type,!0);case 31:return Cr("Activity");default:return""}}function Zy(e){try{var t="",n=null;do t+=FP(e,n),n=e,e=e.return;while(e);return t}catch(o){return`
47
- Error generating stack: `+o.message+`
48
- `+o.stack}}var rm=Object.prototype.hasOwnProperty,Zh=rt.unstable_scheduleCallback,Uf=rt.unstable_cancelCallback,XP=rt.unstable_shouldYield,KP=rt.unstable_requestPaint,Yt=rt.unstable_now,jP=rt.unstable_getCurrentPriorityLevel,Zx=rt.unstable_ImmediatePriority,Qx=rt.unstable_UserBlockingPriority,su=rt.unstable_NormalPriority,qP=rt.unstable_LowPriority,Wx=rt.unstable_IdlePriority,ZP=rt.log,QP=rt.unstable_setDisableYieldValue,ds=null,Ft=null;function Bo(e){if(typeof ZP=="function"&&QP(e),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(ds,e)}catch{}}var Xt=Math.clz32?Math.clz32:ez,WP=Math.log,JP=Math.LN2;function ez(e){return e>>>=0,e===0?32:31-(WP(e)/JP|0)|0}var oc=256,rc=262144,ac=4194304;function Nr(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function xd(e,t,n){var o=e.pendingLanes;if(o===0)return 0;var r=0,a=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var l=o&134217727;return l!==0?(o=l&~a,o!==0?r=Nr(o):(i&=l,i!==0?r=Nr(i):n||(n=l&~e,n!==0&&(r=Nr(n))))):(l=o&~a,l!==0?r=Nr(l):i!==0?r=Nr(i):n||(n=o&~e,n!==0&&(r=Nr(n)))),r===0?0:t!==0&&t!==r&&!(t&a)&&(a=r&-r,n=t&-t,a>=n||a===32&&(n&4194048)!==0)?t:r}function fs(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function tz(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jx(){var e=ac;return ac<<=1,!(ac&62914560)&&(ac=4194304),e}function Vf(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ps(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nz(e,t,n,o,r,a){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,s=e.expirationTimes,c=e.hiddenUpdates;for(n=i&~n;0<n;){var f=31-Xt(n),u=1<<f;l[f]=0,s[f]=-1;var d=c[f];if(d!==null)for(c[f]=null,f=0;f<d.length;f++){var m=d[f];m!==null&&(m.lane&=-536870913)}n&=~u}o!==0&&eS(e,o,0),a!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=a&~(i&~t))}function eS(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Xt(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|n&261930}function tS(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var o=31-Xt(n),r=1<<o;r&t|e[o]&t&&(e[o]|=t),n&=~r}}function nS(e,t){var n=t&-t;return n=n&42?1:Qh(n),n&(e.suspendedLanes|t)?0:n}function Qh(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Wh(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function oS(){var e=Ee.p;return e!==0?e:(e=window.event,e===void 0?32:_E(e.type))}function Qy(e,t){var n=Ee.p;try{return Ee.p=e,t()}finally{Ee.p=n}}var cr=Math.random().toString(36).slice(2),ut="__reactFiber$"+cr,Mt="__reactProps$"+cr,Ni="__reactContainer$"+cr,am="__reactEvents$"+cr,oz="__reactListeners$"+cr,rz="__reactHandles$"+cr,Wy="__reactResources$"+cr,ms="__reactMarker$"+cr;function Jh(e){delete e[ut],delete e[Mt],delete e[am],delete e[oz],delete e[rz]}function Ra(e){var t=e[ut];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ni]||n[ut]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ab(e);e!==null;){if(n=e[ut])return n;e=ab(e)}return t}e=n,n=e.parentNode}return null}function _i(e){if(e=e[ut]||e[Ni]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ol(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(J(33))}function Ba(e){var t=e[Wy];return t||(t=e[Wy]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function it(e){e[ms]=!0}var rS=new Set,aS={};function ea(e,t){ti(e,t),ti(e+"Capture",t)}function ti(e,t){for(aS[e]=t,e=0;e<t.length;e++)rS.add(t[e])}var az=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Jy={},e0={};function iz(e){return rm.call(e0,e)?!0:rm.call(Jy,e)?!1:az.test(e)?e0[e]=!0:(Jy[e]=!0,!1)}function Ic(e,t,n){if(iz(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function ic(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function jn(e,t,n,o){if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+o)}}function tn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function iS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lz(e,t,n){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var r=o.get,a=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(i){n=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function im(e){if(!e._valueTracker){var t=iS(e)?"checked":"value";e._valueTracker=lz(e,t,""+e[t])}}function lS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),o="";return e&&(o=iS(e)?e.checked?"true":"false":e.value),e=o,e!==n?(t.setValue(e),!0):!1}function cu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var sz=/[\n"\\]/g;function rn(e){return e.replace(sz,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function lm(e,t,n,o,r,a,i,l){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+tn(t)):e.value!==""+tn(t)&&(e.value=""+tn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?sm(e,i,tn(t)):n!=null?sm(e,i,tn(n)):o!=null&&e.removeAttribute("value"),r==null&&a!=null&&(e.defaultChecked=!!a),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+tn(l):e.removeAttribute("name")}function sS(e,t,n,o,r,a,i,l){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null)){im(e);return}n=n!=null?""+tn(n):"",t=t!=null?""+tn(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}o=o??r,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=l?e.checked:!!o,e.defaultChecked=!!o,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),im(e)}function sm(e,t,n){t==="number"&&cu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ua(e,t,n,o){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&o&&(e[n].defaultSelected=!0)}else{for(n=""+tn(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,o&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function cS(e,t,n){if(t!=null&&(t=""+tn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+tn(n):""}function uS(e,t,n,o){if(t==null){if(o!=null){if(n!=null)throw Error(J(92));if(nl(o)){if(1<o.length)throw Error(J(93));o=o[0]}n=o}n==null&&(n=""),t=n}n=tn(t),e.defaultValue=n,o=e.textContent,o===n&&o!==""&&o!==null&&(e.value=o),im(e)}function ni(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var cz=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function t0(e,t,n){var o=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,n):typeof n!="number"||n===0||cz.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function dS(e,t,n){if(t!=null&&typeof t!="object")throw Error(J(62));if(e=e.style,n!=null){for(var o in n)!n.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var r in t)o=t[r],t.hasOwnProperty(r)&&n[r]!==o&&t0(e,r,o)}else for(var a in t)t.hasOwnProperty(a)&&t0(e,a,t[a])}function eg(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var uz=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),dz=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Lc(e){return dz.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ao(){}var cm=null;function tg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ta=null,Va=null;function n0(e){var t=_i(e);if(t&&(e=t.stateNode)){var n=e[Mt]||null;e:switch(e=t.stateNode,t.type){case"input":if(lm(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+rn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var r=o[Mt]||null;if(!r)throw Error(J(90));lm(o,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)o=n[t],o.form===e.form&&lS(o)}break e;case"textarea":cS(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ua(e,!!n.multiple,t,!1)}}}var Gf=!1;function fS(e,t,n){if(Gf)return e(t,n);Gf=!0;try{var o=e(t);return o}finally{if(Gf=!1,(Ta!==null||Va!==null)&&(Pd(),Ta&&(t=Ta,e=Va,Va=Ta=null,n0(t),e)))for(t=0;t<e.length;t++)n0(e[t])}}function Ol(e,t){var n=e.stateNode;if(n===null)return null;var o=n[Mt]||null;if(o===null)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(J(231,t,typeof n));return n}var fo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),um=!1;if(fo)try{var Gi={};Object.defineProperty(Gi,"passive",{get:function(){um=!0}}),window.addEventListener("test",Gi,Gi),window.removeEventListener("test",Gi,Gi)}catch{um=!1}var Uo=null,ng=null,kc=null;function pS(){if(kc)return kc;var e,t=ng,n=t.length,o,r="value"in Uo?Uo.value:Uo.textContent,a=r.length;for(e=0;e<n&&t[e]===r[e];e++);var i=n-e;for(o=1;o<=i&&t[n-o]===r[a-o];o++);return kc=r.slice(e,1<o?1-o:void 0)}function $c(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function lc(){return!0}function o0(){return!1}function Dt(e){function t(n,o,r,a,i){this._reactName=n,this._targetInst=r,this.type=o,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?lc:o0,this.isPropagationStopped=o0,this}return $e(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=lc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=lc)},persist:function(){},isPersistent:lc}),t}var ta={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sd=Dt(ta),hs=$e({},ta,{view:0,detail:0}),fz=Dt(hs),Yf,Ff,Yi,Ed=$e({},hs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:og,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Yi&&(Yi&&e.type==="mousemove"?(Yf=e.screenX-Yi.screenX,Ff=e.screenY-Yi.screenY):Ff=Yf=0,Yi=e),Yf)},movementY:function(e){return"movementY"in e?e.movementY:Ff}}),r0=Dt(Ed),pz=$e({},Ed,{dataTransfer:0}),mz=Dt(pz),hz=$e({},hs,{relatedTarget:0}),Xf=Dt(hz),gz=$e({},ta,{animationName:0,elapsedTime:0,pseudoElement:0}),vz=Dt(gz),yz=$e({},ta,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bz=Dt(yz),wz=$e({},ta,{data:0}),a0=Dt(wz),xz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sz={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ez={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cz(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ez[e])?!!t[e]:!1}function og(){return Cz}var Nz=$e({},hs,{key:function(e){if(e.key){var t=xz[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$c(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Sz[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:og,charCode:function(e){return e.type==="keypress"?$c(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$c(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_z=Dt(Nz),Rz=$e({},Ed,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),i0=Dt(Rz),Tz=$e({},hs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:og}),Az=Dt(Tz),Mz=$e({},ta,{propertyName:0,elapsedTime:0,pseudoElement:0}),Dz=Dt(Mz),Oz=$e({},Ed,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Pz=Dt(Oz),zz=$e({},ta,{newState:0,oldState:0}),Iz=Dt(zz),Lz=[9,13,27,32],rg=fo&&"CompositionEvent"in window,hl=null;fo&&"documentMode"in document&&(hl=document.documentMode);var kz=fo&&"TextEvent"in window&&!hl,mS=fo&&(!rg||hl&&8<hl&&11>=hl),l0=" ",s0=!1;function hS(e,t){switch(e){case"keyup":return Lz.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Aa=!1;function $z(e,t){switch(e){case"compositionend":return gS(t);case"keypress":return t.which!==32?null:(s0=!0,l0);case"textInput":return e=t.data,e===l0&&s0?null:e;default:return null}}function Hz(e,t){if(Aa)return e==="compositionend"||!rg&&hS(e,t)?(e=pS(),kc=ng=Uo=null,Aa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return mS&&t.locale!=="ko"?null:t.data;default:return null}}var Bz={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function c0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Bz[e.type]:t==="textarea"}function vS(e,t,n,o){Ta?Va?Va.push(o):Va=[o]:Ta=o,t=Ru(t,"onChange"),0<t.length&&(n=new Sd("onChange","change",null,n,o),e.push({event:n,listeners:t}))}var gl=null,Pl=null;function Uz(e){fE(e,0)}function Cd(e){var t=ol(e);if(lS(t))return e}function u0(e,t){if(e==="change")return t}var yS=!1;if(fo){var Kf;if(fo){var jf="oninput"in document;if(!jf){var d0=document.createElement("div");d0.setAttribute("oninput","return;"),jf=typeof d0.oninput=="function"}Kf=jf}else Kf=!1;yS=Kf&&(!document.documentMode||9<document.documentMode)}function f0(){gl&&(gl.detachEvent("onpropertychange",bS),Pl=gl=null)}function bS(e){if(e.propertyName==="value"&&Cd(Pl)){var t=[];vS(t,Pl,e,tg(e)),fS(Uz,t)}}function Vz(e,t,n){e==="focusin"?(f0(),gl=t,Pl=n,gl.attachEvent("onpropertychange",bS)):e==="focusout"&&f0()}function Gz(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cd(Pl)}function Yz(e,t){if(e==="click")return Cd(t)}function Fz(e,t){if(e==="input"||e==="change")return Cd(t)}function Xz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qt=typeof Object.is=="function"?Object.is:Xz;function zl(e,t){if(qt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(o=0;o<n.length;o++){var r=n[o];if(!rm.call(t,r)||!qt(e[r],t[r]))return!1}return!0}function p0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function m0(e,t){var n=p0(e);e=0;for(var o;n;){if(n.nodeType===3){if(o=e+n.textContent.length,e<=t&&o>=t)return{node:n,offset:t-e};e=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=p0(n)}}function wS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xS(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=cu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=cu(e.document)}return t}function ag(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Kz=fo&&"documentMode"in document&&11>=document.documentMode,Ma=null,dm=null,vl=null,fm=!1;function h0(e,t,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;fm||Ma==null||Ma!==cu(o)||(o=Ma,"selectionStart"in o&&ag(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),vl&&zl(vl,o)||(vl=o,o=Ru(dm,"onSelect"),0<o.length&&(t=new Sd("onSelect","select",null,t,n),e.push({event:t,listeners:o}),t.target=Ma)))}function xr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Da={animationend:xr("Animation","AnimationEnd"),animationiteration:xr("Animation","AnimationIteration"),animationstart:xr("Animation","AnimationStart"),transitionrun:xr("Transition","TransitionRun"),transitionstart:xr("Transition","TransitionStart"),transitioncancel:xr("Transition","TransitionCancel"),transitionend:xr("Transition","TransitionEnd")},qf={},SS={};fo&&(SS=document.createElement("div").style,"AnimationEvent"in window||(delete Da.animationend.animation,delete Da.animationiteration.animation,delete Da.animationstart.animation),"TransitionEvent"in window||delete Da.transitionend.transition);function na(e){if(qf[e])return qf[e];if(!Da[e])return e;var t=Da[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in SS)return qf[e]=t[n];return e}var ES=na("animationend"),CS=na("animationiteration"),NS=na("animationstart"),jz=na("transitionrun"),qz=na("transitionstart"),Zz=na("transitioncancel"),_S=na("transitionend"),RS=new Map,pm="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");pm.push("scrollEnd");function Nn(e,t){RS.set(e,t),ea(t,[e])}var uu=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},en=[],Oa=0,ig=0;function Nd(){for(var e=Oa,t=ig=Oa=0;t<e;){var n=en[t];en[t++]=null;var o=en[t];en[t++]=null;var r=en[t];en[t++]=null;var a=en[t];if(en[t++]=null,o!==null&&r!==null){var i=o.pending;i===null?r.next=r:(r.next=i.next,i.next=r),o.pending=r}a!==0&&TS(n,r,a)}}function _d(e,t,n,o){en[Oa++]=e,en[Oa++]=t,en[Oa++]=n,en[Oa++]=o,ig|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function lg(e,t,n,o){return _d(e,t,n,o),du(e)}function oa(e,t){return _d(e,null,null,t),du(e)}function TS(e,t,n){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n);for(var r=!1,a=e.return;a!==null;)a.childLanes|=n,o=a.alternate,o!==null&&(o.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(r=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,r&&t!==null&&(r=31-Xt(n),e=a.hiddenUpdates,o=e[r],o===null?e[r]=[t]:o.push(t),t.lane=n|536870912),a):null}function du(e){if(50<_l)throw _l=0,zm=null,Error(J(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Pa={};function Qz(e,t,n,o){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bt(e,t,n,o){return new Qz(e,t,n,o)}function sg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function so(e,t){var n=e.alternate;return n===null?(n=Bt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function AS(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Hc(e,t,n,o,r,a){var i=0;if(o=e,typeof e=="function")sg(e)&&(i=1);else if(typeof e=="string")i=nI(e,n,Ln.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case em:return e=Bt(31,n,t,r),e.elementType=em,e.lanes=a,e;case Na:return Dr(n.children,r,a,t);case jx:i=8,r|=24;break;case Qp:return e=Bt(12,n,t,r|2),e.elementType=Qp,e.lanes=a,e;case Wp:return e=Bt(13,n,t,r),e.elementType=Wp,e.lanes=a,e;case Jp:return e=Bt(19,n,t,r),e.elementType=Jp,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ro:i=10;break e;case qx:i=9;break e;case jh:i=11;break e;case qh:i=14;break e;case Po:i=16,o=null;break e}i=29,n=Error(J(130,e===null?"null":typeof e,"")),o=null}return t=Bt(i,n,t,r),t.elementType=e,t.type=o,t.lanes=a,t}function Dr(e,t,n,o){return e=Bt(7,e,o,t),e.lanes=n,e}function Zf(e,t,n){return e=Bt(6,e,null,t),e.lanes=n,e}function MS(e){var t=Bt(18,null,null,0);return t.stateNode=e,t}function Qf(e,t,n){return t=Bt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var g0=new WeakMap;function an(e,t){if(typeof e=="object"&&e!==null){var n=g0.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Zy(t)},g0.set(e,t),t)}return{value:e,source:t,stack:Zy(t)}}var za=[],Ia=0,fu=null,Il=0,nn=[],on=0,nr=null,Dn=1,On="";function to(e,t){za[Ia++]=Il,za[Ia++]=fu,fu=e,Il=t}function DS(e,t,n){nn[on++]=Dn,nn[on++]=On,nn[on++]=nr,nr=e;var o=Dn;e=On;var r=32-Xt(o)-1;o&=~(1<<r),n+=1;var a=32-Xt(t)+r;if(30<a){var i=r-r%5;a=(o&(1<<i)-1).toString(32),o>>=i,r-=i,Dn=1<<32-Xt(t)+r|n<<r|o,On=a+e}else Dn=1<<a|n<<r|o,On=e}function cg(e){e.return!==null&&(to(e,1),DS(e,1,0))}function ug(e){for(;e===fu;)fu=za[--Ia],za[Ia]=null,Il=za[--Ia],za[Ia]=null;for(;e===nr;)nr=nn[--on],nn[on]=null,On=nn[--on],nn[on]=null,Dn=nn[--on],nn[on]=null}function OS(e,t){nn[on++]=Dn,nn[on++]=On,nn[on++]=nr,Dn=t.id,On=t.overflow,nr=e}var dt=null,Le=null,be=!1,Xo=null,ln=!1,mm=Error(J(519));function or(e){var t=Error(J(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ll(an(t,e)),mm}function v0(e){var t=e.stateNode,n=e.type,o=e.memoizedProps;switch(t[ut]=e,t[Mt]=o,n){case"dialog":ge("cancel",t),ge("close",t);break;case"iframe":case"object":case"embed":ge("load",t);break;case"video":case"audio":for(n=0;n<Bl.length;n++)ge(Bl[n],t);break;case"source":ge("error",t);break;case"img":case"image":case"link":ge("error",t),ge("load",t);break;case"details":ge("toggle",t);break;case"input":ge("invalid",t),sS(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":ge("invalid",t);break;case"textarea":ge("invalid",t),uS(t,o.value,o.defaultValue,o.children)}n=o.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||o.suppressHydrationWarning===!0||mE(t.textContent,n)?(o.popover!=null&&(ge("beforetoggle",t),ge("toggle",t)),o.onScroll!=null&&ge("scroll",t),o.onScrollEnd!=null&&ge("scrollend",t),o.onClick!=null&&(t.onclick=ao),t=!0):t=!1,t||or(e,!0)}function y0(e){for(dt=e.return;dt;)switch(dt.tag){case 5:case 31:case 13:ln=!1;return;case 27:case 3:ln=!0;return;default:dt=dt.return}}function fa(e){if(e!==dt)return!1;if(!be)return y0(e),be=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Hm(e.type,e.memoizedProps)),n=!n),n&&Le&&or(e),y0(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));Le=rb(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));Le=rb(e)}else t===27?(t=Le,ur(e.type)?(e=Gm,Gm=null,Le=e):Le=t):Le=dt?cn(e.stateNode.nextSibling):null;return!0}function kr(){Le=dt=null,be=!1}function Wf(){var e=Xo;return e!==null&&(Rt===null?Rt=e:Rt.push.apply(Rt,e),Xo=null),e}function Ll(e){Xo===null?Xo=[e]:Xo.push(e)}var hm=Bn(null),ra=null,io=null;function Io(e,t,n){Oe(hm,t._currentValue),t._currentValue=n}function co(e){e._currentValue=hm.current,lt(hm)}function gm(e,t,n){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===n)break;e=e.return}}function vm(e,t,n,o){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var a=r.dependencies;if(a!==null){var i=r.child;a=a.firstContext;e:for(;a!==null;){var l=a;a=r;for(var s=0;s<t.length;s++)if(l.context===t[s]){a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),gm(a.return,n,e),o||(i=null);break e}a=l.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(J(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),gm(i,n,e),i=null}else i=r.child;if(i!==null)i.return=r;else for(i=r;i!==null;){if(i===e){i=null;break}if(r=i.sibling,r!==null){r.return=i.return,i=r;break}i=i.return}r=i}}function Ri(e,t,n,o){e=null;for(var r=t,a=!1;r!==null;){if(!a){if(r.flags&524288)a=!0;else if(r.flags&262144)break}if(r.tag===10){var i=r.alternate;if(i===null)throw Error(J(387));if(i=i.memoizedProps,i!==null){var l=r.type;qt(r.pendingProps.value,i.value)||(e!==null?e.push(l):e=[l])}}else if(r===au.current){if(i=r.alternate,i===null)throw Error(J(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Vl):e=[Vl])}r=r.return}e!==null&&vm(t,e,n,o),t.flags|=262144}function pu(e){for(e=e.firstContext;e!==null;){if(!qt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $r(e){ra=e,io=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ft(e){return PS(ra,e)}function sc(e,t){return ra===null&&$r(e),PS(e,t)}function PS(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},io===null){if(e===null)throw Error(J(308));io=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else io=io.next=t;return n}var Wz=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Jz=rt.unstable_scheduleCallback,e3=rt.unstable_NormalPriority,Je={$$typeof:ro,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function dg(){return{controller:new Wz,data:new Map,refCount:0}}function gs(e){e.refCount--,e.refCount===0&&Jz(e3,function(){e.controller.abort()})}var yl=null,ym=0,oi=0,Ga=null;function t3(e,t){if(yl===null){var n=yl=[];ym=0,oi=Lg(),Ga={status:"pending",value:void 0,then:function(o){n.push(o)}}}return ym++,t.then(b0,b0),t}function b0(){if(--ym===0&&yl!==null){Ga!==null&&(Ga.status="fulfilled");var e=yl;yl=null,oi=0,Ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function n3(e,t){var n=[],o={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(o.status="rejected",o.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),o}var w0=de.S;de.S=function(e,t){K1=Yt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&t3(e,t),w0!==null&&w0(e,t)};var Or=Bn(null);function fg(){var e=Or.current;return e!==null?e:Me.pooledCache}function Bc(e,t){t===null?Oe(Or,Or.current):Oe(Or,t.pool)}function zS(){var e=fg();return e===null?null:{parent:Je._currentValue,pool:e}}var Ti=Error(J(460)),pg=Error(J(474)),Rd=Error(J(542)),mu={then:function(){}};function x0(e){return e=e.status,e==="fulfilled"||e==="rejected"}function IS(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ao,ao),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,E0(e),e;default:if(typeof t.status=="string")t.then(ao,ao);else{if(e=Me,e!==null&&100<e.shellSuspendCounter)throw Error(J(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=o}},function(o){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,E0(e),e}throw Pr=t,Ti}}function _r(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Pr=n,Ti):n}}var Pr=null;function S0(){if(Pr===null)throw Error(J(459));var e=Pr;return Pr=null,e}function E0(e){if(e===Ti||e===Rd)throw Error(J(483))}var Ya=null,kl=0;function cc(e){var t=kl;return kl+=1,Ya===null&&(Ya=[]),IS(Ya,e,t)}function Fi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function uc(e,t){throw t.$$typeof===VP?Error(J(525)):(e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function LS(e){function t(h,w){if(e){var y=h.deletions;y===null?(h.deletions=[w],h.flags|=16):y.push(w)}}function n(h,w){if(!e)return null;for(;w!==null;)t(h,w),w=w.sibling;return null}function o(h){for(var w=new Map;h!==null;)h.key!==null?w.set(h.key,h):w.set(h.index,h),h=h.sibling;return w}function r(h,w){return h=so(h,w),h.index=0,h.sibling=null,h}function a(h,w,y){return h.index=y,e?(y=h.alternate,y!==null?(y=y.index,y<w?(h.flags|=67108866,w):y):(h.flags|=67108866,w)):(h.flags|=1048576,w)}function i(h){return e&&h.alternate===null&&(h.flags|=67108866),h}function l(h,w,y,S){return w===null||w.tag!==6?(w=Zf(y,h.mode,S),w.return=h,w):(w=r(w,y),w.return=h,w)}function s(h,w,y,S){var E=y.type;return E===Na?f(h,w,y.props.children,S,y.key):w!==null&&(w.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Po&&_r(E)===w.type)?(w=r(w,y.props),Fi(w,y),w.return=h,w):(w=Hc(y.type,y.key,y.props,null,h.mode,S),Fi(w,y),w.return=h,w)}function c(h,w,y,S){return w===null||w.tag!==4||w.stateNode.containerInfo!==y.containerInfo||w.stateNode.implementation!==y.implementation?(w=Qf(y,h.mode,S),w.return=h,w):(w=r(w,y.children||[]),w.return=h,w)}function f(h,w,y,S,E){return w===null||w.tag!==7?(w=Dr(y,h.mode,S,E),w.return=h,w):(w=r(w,y),w.return=h,w)}function u(h,w,y){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Zf(""+w,h.mode,y),w.return=h,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case nc:return y=Hc(w.type,w.key,w.props,null,h.mode,y),Fi(y,w),y.return=h,y;case tl:return w=Qf(w,h.mode,y),w.return=h,w;case Po:return w=_r(w),u(h,w,y)}if(nl(w)||Vi(w))return w=Dr(w,h.mode,y,null),w.return=h,w;if(typeof w.then=="function")return u(h,cc(w),y);if(w.$$typeof===ro)return u(h,sc(h,w),y);uc(h,w)}return null}function d(h,w,y,S){var E=w!==null?w.key:null;if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return E!==null?null:l(h,w,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case nc:return y.key===E?s(h,w,y,S):null;case tl:return y.key===E?c(h,w,y,S):null;case Po:return y=_r(y),d(h,w,y,S)}if(nl(y)||Vi(y))return E!==null?null:f(h,w,y,S,null);if(typeof y.then=="function")return d(h,w,cc(y),S);if(y.$$typeof===ro)return d(h,w,sc(h,y),S);uc(h,y)}return null}function m(h,w,y,S,E){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return h=h.get(y)||null,l(w,h,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case nc:return h=h.get(S.key===null?y:S.key)||null,s(w,h,S,E);case tl:return h=h.get(S.key===null?y:S.key)||null,c(w,h,S,E);case Po:return S=_r(S),m(h,w,y,S,E)}if(nl(S)||Vi(S))return h=h.get(y)||null,f(w,h,S,E,null);if(typeof S.then=="function")return m(h,w,y,cc(S),E);if(S.$$typeof===ro)return m(h,w,y,sc(w,S),E);uc(w,S)}return null}function v(h,w,y,S){for(var E=null,N=null,C=w,A=w=0,T=null;C!==null&&A<y.length;A++){C.index>A?(T=C,C=null):T=C.sibling;var k=d(h,C,y[A],S);if(k===null){C===null&&(C=T);break}e&&C&&k.alternate===null&&t(h,C),w=a(k,w,A),N===null?E=k:N.sibling=k,N=k,C=T}if(A===y.length)return n(h,C),be&&to(h,A),E;if(C===null){for(;A<y.length;A++)C=u(h,y[A],S),C!==null&&(w=a(C,w,A),N===null?E=C:N.sibling=C,N=C);return be&&to(h,A),E}for(C=o(C);A<y.length;A++)T=m(C,h,A,y[A],S),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?A:T.key),w=a(T,w,A),N===null?E=T:N.sibling=T,N=T);return e&&C.forEach(function(z){return t(h,z)}),be&&to(h,A),E}function g(h,w,y,S){if(y==null)throw Error(J(151));for(var E=null,N=null,C=w,A=w=0,T=null,k=y.next();C!==null&&!k.done;A++,k=y.next()){C.index>A?(T=C,C=null):T=C.sibling;var z=d(h,C,k.value,S);if(z===null){C===null&&(C=T);break}e&&C&&z.alternate===null&&t(h,C),w=a(z,w,A),N===null?E=z:N.sibling=z,N=z,C=T}if(k.done)return n(h,C),be&&to(h,A),E;if(C===null){for(;!k.done;A++,k=y.next())k=u(h,k.value,S),k!==null&&(w=a(k,w,A),N===null?E=k:N.sibling=k,N=k);return be&&to(h,A),E}for(C=o(C);!k.done;A++,k=y.next())k=m(C,h,A,k.value,S),k!==null&&(e&&k.alternate!==null&&C.delete(k.key===null?A:k.key),w=a(k,w,A),N===null?E=k:N.sibling=k,N=k);return e&&C.forEach(function(O){return t(h,O)}),be&&to(h,A),E}function x(h,w,y,S){if(typeof y=="object"&&y!==null&&y.type===Na&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case nc:e:{for(var E=y.key;w!==null;){if(w.key===E){if(E=y.type,E===Na){if(w.tag===7){n(h,w.sibling),S=r(w,y.props.children),S.return=h,h=S;break e}}else if(w.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Po&&_r(E)===w.type){n(h,w.sibling),S=r(w,y.props),Fi(S,y),S.return=h,h=S;break e}n(h,w);break}else t(h,w);w=w.sibling}y.type===Na?(S=Dr(y.props.children,h.mode,S,y.key),S.return=h,h=S):(S=Hc(y.type,y.key,y.props,null,h.mode,S),Fi(S,y),S.return=h,h=S)}return i(h);case tl:e:{for(E=y.key;w!==null;){if(w.key===E)if(w.tag===4&&w.stateNode.containerInfo===y.containerInfo&&w.stateNode.implementation===y.implementation){n(h,w.sibling),S=r(w,y.children||[]),S.return=h,h=S;break e}else{n(h,w);break}else t(h,w);w=w.sibling}S=Qf(y,h.mode,S),S.return=h,h=S}return i(h);case Po:return y=_r(y),x(h,w,y,S)}if(nl(y))return v(h,w,y,S);if(Vi(y)){if(E=Vi(y),typeof E!="function")throw Error(J(150));return y=E.call(y),g(h,w,y,S)}if(typeof y.then=="function")return x(h,w,cc(y),S);if(y.$$typeof===ro)return x(h,w,sc(h,y),S);uc(h,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,w!==null&&w.tag===6?(n(h,w.sibling),S=r(w,y),S.return=h,h=S):(n(h,w),S=Zf(y,h.mode,S),S.return=h,h=S),i(h)):n(h,w)}return function(h,w,y,S){try{kl=0;var E=x(h,w,y,S);return Ya=null,E}catch(C){if(C===Ti||C===Rd)throw C;var N=Bt(29,C,null,h.mode);return N.lanes=S,N.return=h,N}finally{}}}var Hr=LS(!0),kS=LS(!1),zo=!1;function mg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bm(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ko(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function jo(e,t,n){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,Se&2){var r=o.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),o.pending=t,t=du(e),TS(e,null,n),t}return _d(e,o,t,n),du(e)}function bl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,tS(e,n)}}function Jf(e,t){var n=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,n===o)){var r=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?r=a=i:a=a.next=i,n=n.next}while(n!==null);a===null?r=a=t:a=a.next=t}else r=a=t;n={baseState:o.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:o.shared,callbacks:o.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var wm=!1;function wl(){if(wm){var e=Ga;if(e!==null)throw e}}function xl(e,t,n,o){wm=!1;var r=e.updateQueue;zo=!1;var a=r.firstBaseUpdate,i=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var s=l,c=s.next;s.next=null,i===null?a=c:i.next=c,i=s;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==i&&(l===null?f.firstBaseUpdate=c:l.next=c,f.lastBaseUpdate=s))}if(a!==null){var u=r.baseState;i=0,f=c=s=null,l=a;do{var d=l.lane&-536870913,m=d!==l.lane;if(m?(ye&d)===d:(o&d)===d){d!==0&&d===oi&&(wm=!0),f!==null&&(f=f.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var v=e,g=l;d=t;var x=n;switch(g.tag){case 1:if(v=g.payload,typeof v=="function"){u=v.call(x,u,d);break e}u=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,d=typeof v=="function"?v.call(x,u,d):v,d==null)break e;u=$e({},u,d);break e;case 2:zo=!0}}d=l.callback,d!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[d]:m.push(d))}else m={lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(c=f=m,s=u):f=f.next=m,i|=d;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;m=l,l=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);f===null&&(s=u),r.baseState=s,r.firstBaseUpdate=c,r.lastBaseUpdate=f,a===null&&(r.shared.lanes=0),ar|=i,e.lanes=i,e.memoizedState=u}}function $S(e,t){if(typeof e!="function")throw Error(J(191,e));e.call(t)}function HS(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)$S(n[e],t)}var ri=Bn(null),hu=Bn(0);function C0(e,t){e=go,Oe(hu,e),Oe(ri,t),go=e|t.baseLanes}function xm(){Oe(hu,go),Oe(ri,ri.current)}function hg(){go=hu.current,lt(ri),lt(hu)}var Zt=Bn(null),sn=null;function Lo(e){var t=e.alternate;Oe(qe,qe.current&1),Oe(Zt,e),sn===null&&(t===null||ri.current!==null||t.memoizedState!==null)&&(sn=e)}function Sm(e){Oe(qe,qe.current),Oe(Zt,e),sn===null&&(sn=e)}function BS(e){e.tag===22?(Oe(qe,qe.current),Oe(Zt,e),sn===null&&(sn=e)):ko()}function ko(){Oe(qe,qe.current),Oe(Zt,Zt.current)}function $t(e){lt(Zt),sn===e&&(sn=null),lt(qe)}var qe=Bn(0);function gu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Um(n)||Vm(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var po=0,me=null,Te=null,Qe=null,vu=!1,Fa=!1,Br=!1,yu=0,$l=0,Xa=null,o3=0;function Xe(){throw Error(J(321))}function gg(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qt(e[n],t[n]))return!1;return!0}function vg(e,t,n,o,r,a){return po=a,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,de.H=e===null||e.memoizedState===null?v1:Tg,Br=!1,a=n(o,r),Br=!1,Fa&&(a=VS(t,n,o,r)),US(e),a}function US(e){de.H=Hl;var t=Te!==null&&Te.next!==null;if(po=0,Qe=Te=me=null,vu=!1,$l=0,Xa=null,t)throw Error(J(300));e===null||et||(e=e.dependencies,e!==null&&pu(e)&&(et=!0))}function VS(e,t,n,o){me=e;var r=0;do{if(Fa&&(Xa=null),$l=0,Fa=!1,25<=r)throw Error(J(301));if(r+=1,Qe=Te=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}de.H=y1,a=t(n,o)}while(Fa);return a}function r3(){var e=de.H,t=e.useState()[0];return t=typeof t.then=="function"?vs(t):t,e=e.useState()[0],(Te!==null?Te.memoizedState:null)!==e&&(me.flags|=1024),t}function yg(){var e=yu!==0;return yu=0,e}function bg(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function wg(e){if(vu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vu=!1}po=0,Qe=Te=me=null,Fa=!1,$l=yu=0,Xa=null}function bt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?me.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function Ze(){if(Te===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=Te.next;var t=Qe===null?me.memoizedState:Qe.next;if(t!==null)Qe=t,Te=e;else{if(e===null)throw me.alternate===null?Error(J(467)):Error(J(310));Te=e,e={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},Qe===null?me.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}function Td(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vs(e){var t=$l;return $l+=1,Xa===null&&(Xa=[]),e=IS(Xa,e,t),t=me,(Qe===null?t.memoizedState:Qe.next)===null&&(t=t.alternate,de.H=t===null||t.memoizedState===null?v1:Tg),e}function Ad(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return vs(e);if(e.$$typeof===ro)return ft(e)}throw Error(J(438,String(e)))}function xg(e){var t=null,n=me.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var o=me.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Td(),me.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),o=0;o<e;o++)n[o]=GP;return t.index++,n}function mo(e,t){return typeof t=="function"?t(e):t}function Uc(e){var t=Ze();return Sg(t,Te,e)}function Sg(e,t,n){var o=e.queue;if(o===null)throw Error(J(311));o.lastRenderedReducer=n;var r=e.baseQueue,a=o.pending;if(a!==null){if(r!==null){var i=r.next;r.next=a.next,a.next=i}t.baseQueue=r=a,o.pending=null}if(a=e.baseState,r===null)e.memoizedState=a;else{t=r.next;var l=i=null,s=null,c=t,f=!1;do{var u=c.lane&-536870913;if(u!==c.lane?(ye&u)===u:(po&u)===u){var d=c.revertLane;if(d===0)s!==null&&(s=s.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),u===oi&&(f=!0);else if((po&d)===d){c=c.next,d===oi&&(f=!0);continue}else u={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},s===null?(l=s=u,i=a):s=s.next=u,me.lanes|=d,ar|=d;u=c.action,Br&&n(a,u),a=c.hasEagerState?c.eagerState:n(a,u)}else d={lane:u,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},s===null?(l=s=d,i=a):s=s.next=d,me.lanes|=u,ar|=u;c=c.next}while(c!==null&&c!==t);if(s===null?i=a:s.next=l,!qt(a,e.memoizedState)&&(et=!0,f&&(n=Ga,n!==null)))throw n;e.memoizedState=a,e.baseState=i,e.baseQueue=s,o.lastRenderedState=a}return r===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function ep(e){var t=Ze(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var o=n.dispatch,r=n.pending,a=t.memoizedState;if(r!==null){n.pending=null;var i=r=r.next;do a=e(a,i.action),i=i.next;while(i!==r);qt(a,t.memoizedState)||(et=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,o]}function GS(e,t,n){var o=me,r=Ze(),a=be;if(a){if(n===void 0)throw Error(J(407));n=n()}else n=t();var i=!qt((Te||r).memoizedState,n);if(i&&(r.memoizedState=n,et=!0),r=r.queue,Eg(XS.bind(null,o,r,e),[e]),r.getSnapshot!==t||i||Qe!==null&&Qe.memoizedState.tag&1){if(o.flags|=2048,ai(9,{destroy:void 0},FS.bind(null,o,r,n,t),null),Me===null)throw Error(J(349));a||po&127||YS(o,t,n)}return n}function YS(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=me.updateQueue,t===null?(t=Td(),me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function FS(e,t,n,o){t.value=n,t.getSnapshot=o,KS(t)&&jS(e)}function XS(e,t,n){return n(function(){KS(t)&&jS(e)})}function KS(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qt(e,n)}catch{return!0}}function jS(e){var t=oa(e,2);t!==null&&At(t,e,2)}function Em(e){var t=bt();if(typeof e=="function"){var n=e;if(e=n(),Br){Bo(!0);try{n()}finally{Bo(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mo,lastRenderedState:e},t}function qS(e,t,n,o){return e.baseState=n,Sg(e,Te,typeof o=="function"?o:mo)}function a3(e,t,n,o,r){if(Dd(e))throw Error(J(485));if(e=t.action,e!==null){var a={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){a.listeners.push(i)}};de.T!==null?n(!0):a.isTransition=!1,o(a),n=t.pending,n===null?(a.next=t.pending=a,ZS(t,a)):(a.next=n.next,t.pending=n.next=a)}}function ZS(e,t){var n=t.action,o=t.payload,r=e.state;if(t.isTransition){var a=de.T,i={};de.T=i;try{var l=n(r,o),s=de.S;s!==null&&s(i,l),N0(e,t,l)}catch(c){Cm(e,t,c)}finally{a!==null&&i.types!==null&&(a.types=i.types),de.T=a}}else try{a=n(r,o),N0(e,t,a)}catch(c){Cm(e,t,c)}}function N0(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(o){_0(e,t,o)},function(o){return Cm(e,t,o)}):_0(e,t,n)}function _0(e,t,n){t.status="fulfilled",t.value=n,QS(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ZS(e,n)))}function Cm(e,t,n){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=n,QS(t),t=t.next;while(t!==o)}e.action=null}function QS(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function WS(e,t){return t}function R0(e,t){if(be){var n=Me.formState;if(n!==null){e:{var o=me;if(be){if(Le){t:{for(var r=Le,a=ln;r.nodeType!==8;){if(!a){r=null;break t}if(r=cn(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null}if(r){Le=cn(r.nextSibling),o=r.data==="F!";break e}}or(o)}o=!1}o&&(t=n[0])}}return n=bt(),n.memoizedState=n.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:WS,lastRenderedState:t},n.queue=o,n=m1.bind(null,me,o),o.dispatch=n,o=Em(!1),a=Rg.bind(null,me,!1,o.queue),o=bt(),r={state:t,dispatch:null,action:e,pending:null},o.queue=r,n=a3.bind(null,me,r,a,n),r.dispatch=n,o.memoizedState=e,[t,n,!1]}function T0(e){var t=Ze();return JS(t,Te,e)}function JS(e,t,n){if(t=Sg(e,t,WS)[0],e=Uc(mo)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=vs(t)}catch(i){throw i===Ti?Rd:i}else o=t;t=Ze();var r=t.queue,a=r.dispatch;return n!==t.memoizedState&&(me.flags|=2048,ai(9,{destroy:void 0},i3.bind(null,r,n),null)),[o,a,e]}function i3(e,t){e.action=t}function A0(e){var t=Ze(),n=Te;if(n!==null)return JS(t,n,e);Ze(),t=t.memoizedState,n=Ze();var o=n.queue.dispatch;return n.memoizedState=e,[t,o,!1]}function ai(e,t,n,o){return e={tag:e,create:n,deps:o,inst:t,next:null},t=me.updateQueue,t===null&&(t=Td(),me.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(o=n.next,n.next=e,e.next=o,t.lastEffect=e),e}function e1(){return Ze().memoizedState}function Vc(e,t,n,o){var r=bt();me.flags|=e,r.memoizedState=ai(1|t,{destroy:void 0},n,o===void 0?null:o)}function Md(e,t,n,o){var r=Ze();o=o===void 0?null:o;var a=r.memoizedState.inst;Te!==null&&o!==null&&gg(o,Te.memoizedState.deps)?r.memoizedState=ai(t,a,n,o):(me.flags|=e,r.memoizedState=ai(1|t,a,n,o))}function M0(e,t){Vc(8390656,8,e,t)}function Eg(e,t){Md(2048,8,e,t)}function l3(e){me.flags|=4;var t=me.updateQueue;if(t===null)t=Td(),me.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function t1(e){var t=Ze().memoizedState;return l3({ref:t,nextImpl:e}),function(){if(Se&2)throw Error(J(440));return t.impl.apply(void 0,arguments)}}function n1(e,t){return Md(4,2,e,t)}function o1(e,t){return Md(4,4,e,t)}function r1(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function a1(e,t,n){n=n!=null?n.concat([e]):null,Md(4,4,r1.bind(null,t,e),n)}function Cg(){}function i1(e,t){var n=Ze();t=t===void 0?null:t;var o=n.memoizedState;return t!==null&&gg(t,o[1])?o[0]:(n.memoizedState=[e,t],e)}function l1(e,t){var n=Ze();t=t===void 0?null:t;var o=n.memoizedState;if(t!==null&&gg(t,o[1]))return o[0];if(o=e(),Br){Bo(!0);try{e()}finally{Bo(!1)}}return n.memoizedState=[o,t],o}function Ng(e,t,n){return n===void 0||po&1073741824&&!(ye&261930)?e.memoizedState=t:(e.memoizedState=n,e=q1(),me.lanes|=e,ar|=e,n)}function s1(e,t,n,o){return qt(n,t)?n:ri.current!==null?(e=Ng(e,n,o),qt(e,t)||(et=!0),e):!(po&42)||po&1073741824&&!(ye&261930)?(et=!0,e.memoizedState=n):(e=q1(),me.lanes|=e,ar|=e,t)}function c1(e,t,n,o,r){var a=Ee.p;Ee.p=a!==0&&8>a?a:8;var i=de.T,l={};de.T=l,Rg(e,!1,t,n);try{var s=r(),c=de.S;if(c!==null&&c(l,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var f=n3(s,o);Sl(e,t,f,Kt(e))}else Sl(e,t,o,Kt(e))}catch(u){Sl(e,t,{then:function(){},status:"rejected",reason:u},Kt())}finally{Ee.p=a,i!==null&&l.types!==null&&(i.types=l.types),de.T=i}}function s3(){}function Nm(e,t,n,o){if(e.tag!==5)throw Error(J(476));var r=u1(e).queue;c1(e,r,t,Mr,n===null?s3:function(){return d1(e),n(o)})}function u1(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Mr,baseState:Mr,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mo,lastRenderedState:Mr},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function d1(e){var t=u1(e);t.next===null&&(t=e.alternate.memoizedState),Sl(e,t.next.queue,{},Kt())}function _g(){return ft(Vl)}function f1(){return Ze().memoizedState}function p1(){return Ze().memoizedState}function c3(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Kt();e=Ko(n);var o=jo(t,e,n);o!==null&&(At(o,t,n),bl(o,t,n)),t={cache:dg()},e.payload=t;return}t=t.return}}function u3(e,t,n){var o=Kt();n={lane:o,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Dd(e)?h1(t,n):(n=lg(e,t,n,o),n!==null&&(At(n,e,o),g1(n,t,o)))}function m1(e,t,n){var o=Kt();Sl(e,t,n,o)}function Sl(e,t,n,o){var r={lane:o,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dd(e))h1(t,r);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,l=a(i,n);if(r.hasEagerState=!0,r.eagerState=l,qt(l,i))return _d(e,t,r,0),Me===null&&Nd(),!1}catch{}finally{}if(n=lg(e,t,r,o),n!==null)return At(n,e,o),g1(n,t,o),!0}return!1}function Rg(e,t,n,o){if(o={lane:2,revertLane:Lg(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Dd(e)){if(t)throw Error(J(479))}else t=lg(e,n,o,2),t!==null&&At(t,e,2)}function Dd(e){var t=e.alternate;return e===me||t!==null&&t===me}function h1(e,t){Fa=vu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function g1(e,t,n){if(n&4194048){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,tS(e,n)}}var Hl={readContext:ft,use:Ad,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useInsertionEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useSyncExternalStore:Xe,useId:Xe,useHostTransitionStatus:Xe,useFormState:Xe,useActionState:Xe,useOptimistic:Xe,useMemoCache:Xe,useCacheRefresh:Xe};Hl.useEffectEvent=Xe;var v1={readContext:ft,use:Ad,useCallback:function(e,t){return bt().memoizedState=[e,t===void 0?null:t],e},useContext:ft,useEffect:M0,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Vc(4194308,4,r1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vc(4194308,4,e,t)},useInsertionEffect:function(e,t){Vc(4,2,e,t)},useMemo:function(e,t){var n=bt();t=t===void 0?null:t;var o=e();if(Br){Bo(!0);try{e()}finally{Bo(!1)}}return n.memoizedState=[o,t],o},useReducer:function(e,t,n){var o=bt();if(n!==void 0){var r=n(t);if(Br){Bo(!0);try{n(t)}finally{Bo(!1)}}}else r=t;return o.memoizedState=o.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},o.queue=e,e=e.dispatch=u3.bind(null,me,e),[o.memoizedState,e]},useRef:function(e){var t=bt();return e={current:e},t.memoizedState=e},useState:function(e){e=Em(e);var t=e.queue,n=m1.bind(null,me,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Cg,useDeferredValue:function(e,t){var n=bt();return Ng(n,e,t)},useTransition:function(){var e=Em(!1);return e=c1.bind(null,me,e.queue,!0,!1),bt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var o=me,r=bt();if(be){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),Me===null)throw Error(J(349));ye&127||YS(o,t,n)}r.memoizedState=n;var a={value:n,getSnapshot:t};return r.queue=a,M0(XS.bind(null,o,a,e),[e]),o.flags|=2048,ai(9,{destroy:void 0},FS.bind(null,o,a,n,t),null),n},useId:function(){var e=bt(),t=Me.identifierPrefix;if(be){var n=On,o=Dn;n=(o&~(1<<32-Xt(o)-1)).toString(32)+n,t="_"+t+"R_"+n,n=yu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=o3++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:_g,useFormState:R0,useActionState:R0,useOptimistic:function(e){var t=bt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Rg.bind(null,me,!0,n),n.dispatch=t,[e,t]},useMemoCache:xg,useCacheRefresh:function(){return bt().memoizedState=c3.bind(null,me)},useEffectEvent:function(e){var t=bt(),n={impl:e};return t.memoizedState=n,function(){if(Se&2)throw Error(J(440));return n.impl.apply(void 0,arguments)}}},Tg={readContext:ft,use:Ad,useCallback:i1,useContext:ft,useEffect:Eg,useImperativeHandle:a1,useInsertionEffect:n1,useLayoutEffect:o1,useMemo:l1,useReducer:Uc,useRef:e1,useState:function(){return Uc(mo)},useDebugValue:Cg,useDeferredValue:function(e,t){var n=Ze();return s1(n,Te.memoizedState,e,t)},useTransition:function(){var e=Uc(mo)[0],t=Ze().memoizedState;return[typeof e=="boolean"?e:vs(e),t]},useSyncExternalStore:GS,useId:f1,useHostTransitionStatus:_g,useFormState:T0,useActionState:T0,useOptimistic:function(e,t){var n=Ze();return qS(n,Te,e,t)},useMemoCache:xg,useCacheRefresh:p1};Tg.useEffectEvent=t1;var y1={readContext:ft,use:Ad,useCallback:i1,useContext:ft,useEffect:Eg,useImperativeHandle:a1,useInsertionEffect:n1,useLayoutEffect:o1,useMemo:l1,useReducer:ep,useRef:e1,useState:function(){return ep(mo)},useDebugValue:Cg,useDeferredValue:function(e,t){var n=Ze();return Te===null?Ng(n,e,t):s1(n,Te.memoizedState,e,t)},useTransition:function(){var e=ep(mo)[0],t=Ze().memoizedState;return[typeof e=="boolean"?e:vs(e),t]},useSyncExternalStore:GS,useId:f1,useHostTransitionStatus:_g,useFormState:A0,useActionState:A0,useOptimistic:function(e,t){var n=Ze();return Te!==null?qS(n,Te,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:xg,useCacheRefresh:p1};y1.useEffectEvent=t1;function tp(e,t,n,o){t=e.memoizedState,n=n(o,t),n=n==null?t:$e({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _m={enqueueSetState:function(e,t,n){e=e._reactInternals;var o=Kt(),r=Ko(o);r.payload=t,n!=null&&(r.callback=n),t=jo(e,r,o),t!==null&&(At(t,e,o),bl(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var o=Kt(),r=Ko(o);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=jo(e,r,o),t!==null&&(At(t,e,o),bl(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Kt(),o=Ko(n);o.tag=2,t!=null&&(o.callback=t),t=jo(e,o,n),t!==null&&(At(t,e,n),bl(t,e,n))}};function D0(e,t,n,o,r,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,a,i):t.prototype&&t.prototype.isPureReactComponent?!zl(n,o)||!zl(r,a):!0}function O0(e,t,n,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,o),t.state!==e&&_m.enqueueReplaceState(t,t.state,null)}function Ur(e,t){var n=t;if("ref"in t){n={};for(var o in t)o!=="ref"&&(n[o]=t[o])}if(e=e.defaultProps){n===t&&(n=$e({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function b1(e){uu(e)}function w1(e){console.error(e)}function x1(e){uu(e)}function bu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function P0(e,t,n){try{var o=e.onCaughtError;o(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Rm(e,t,n){return n=Ko(n),n.tag=3,n.payload={element:null},n.callback=function(){bu(e,t)},n}function S1(e){return e=Ko(e),e.tag=3,e}function E1(e,t,n,o){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var a=o.value;e.payload=function(){return r(a)},e.callback=function(){P0(t,n,o)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){P0(t,n,o),typeof r!="function"&&(qo===null?qo=new Set([this]):qo.add(this));var l=o.stack;this.componentDidCatch(o.value,{componentStack:l!==null?l:""})})}function d3(e,t,n,o,r){if(n.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=n.alternate,t!==null&&Ri(t,n,r,!0),n=Zt.current,n!==null){switch(n.tag){case 31:case 13:return sn===null?Cu():n.alternate===null&&Ke===0&&(Ke=3),n.flags&=-257,n.flags|=65536,n.lanes=r,o===mu?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([o]):t.add(o),fp(e,o,r)),!1;case 22:return n.flags|=65536,o===mu?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([o]):n.add(o)),fp(e,o,r)),!1}throw Error(J(435,n.tag))}return fp(e,o,r),Cu(),!1}if(be)return t=Zt.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,o!==mm&&(e=Error(J(422),{cause:o}),Ll(an(e,n)))):(o!==mm&&(t=Error(J(423),{cause:o}),Ll(an(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,o=an(o,n),r=Rm(e.stateNode,o,r),Jf(e,r),Ke!==4&&(Ke=2)),!1;var a=Error(J(520),{cause:o});if(a=an(a,n),Nl===null?Nl=[a]:Nl.push(a),Ke!==4&&(Ke=2),t===null)return!0;o=an(o,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=Rm(n.stateNode,o,e),Jf(n,e),!1;case 1:if(t=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(qo===null||!qo.has(a))))return n.flags|=65536,r&=-r,n.lanes|=r,r=S1(r),E1(r,e,n,o),Jf(n,r),!1}n=n.return}while(n!==null);return!1}var Ag=Error(J(461)),et=!1;function ct(e,t,n,o){t.child=e===null?kS(t,null,n,o):Hr(t,e.child,n,o)}function z0(e,t,n,o,r){n=n.render;var a=t.ref;if("ref"in o){var i={};for(var l in o)l!=="ref"&&(i[l]=o[l])}else i=o;return $r(t),o=vg(e,t,n,i,a,r),l=yg(),e!==null&&!et?(bg(e,t,r),ho(e,t,r)):(be&&l&&cg(t),t.flags|=1,ct(e,t,o,r),t.child)}function I0(e,t,n,o,r){if(e===null){var a=n.type;return typeof a=="function"&&!sg(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,C1(e,t,a,o,r)):(e=Hc(n.type,null,o,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Mg(e,r)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:zl,n(i,o)&&e.ref===t.ref)return ho(e,t,r)}return t.flags|=1,e=so(a,o),e.ref=t.ref,e.return=t,t.child=e}function C1(e,t,n,o,r){if(e!==null){var a=e.memoizedProps;if(zl(a,o)&&e.ref===t.ref)if(et=!1,t.pendingProps=o=a,Mg(e,r))e.flags&131072&&(et=!0);else return t.lanes=e.lanes,ho(e,t,r)}return Tm(e,t,n,o,r)}function N1(e,t,n,o){var r=o.children,a=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if(t.flags&128){if(a=a!==null?a.baseLanes|n:n,e!==null){for(o=t.child=e.child,r=0;o!==null;)r=r|o.lanes|o.childLanes,o=o.sibling;o=r&~a}else o=0,t.child=null;return L0(e,t,a,n,o)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Bc(t,a!==null?a.cachePool:null),a!==null?C0(t,a):xm(),BS(t);else return o=t.lanes=536870912,L0(e,t,a!==null?a.baseLanes|n:n,n,o)}else a!==null?(Bc(t,a.cachePool),C0(t,a),ko(),t.memoizedState=null):(e!==null&&Bc(t,null),xm(),ko());return ct(e,t,r,n),t.child}function rl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function L0(e,t,n,o,r){var a=fg();return a=a===null?null:{parent:Je._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Bc(t,null),xm(),BS(t),e!==null&&Ri(e,t,o,!0),t.childLanes=r,null}function Gc(e,t){return t=wu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function k0(e,t,n){return Hr(t,e.child,null,n),e=Gc(t,t.pendingProps),e.flags|=2,$t(t),t.memoizedState=null,e}function f3(e,t,n){var o=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(be){if(o.mode==="hidden")return e=Gc(t,o),t.lanes=536870912,rl(null,e);if(Sm(t),(e=Le)?(e=vE(e,ln),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:nr!==null?{id:Dn,overflow:On}:null,retryLane:536870912,hydrationErrors:null},n=MS(e),n.return=t,t.child=n,dt=t,Le=null)):e=null,e===null)throw or(t);return t.lanes=536870912,null}return Gc(t,o)}var a=e.memoizedState;if(a!==null){var i=a.dehydrated;if(Sm(t),r)if(t.flags&256)t.flags&=-257,t=k0(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(J(558));else if(et||Ri(e,t,n,!1),r=(n&e.childLanes)!==0,et||r){if(o=Me,o!==null&&(i=nS(o,n),i!==0&&i!==a.retryLane))throw a.retryLane=i,oa(e,i),At(o,e,i),Ag;Cu(),t=k0(e,t,n)}else e=a.treeContext,Le=cn(i.nextSibling),dt=t,be=!0,Xo=null,ln=!1,e!==null&&OS(t,e),t=Gc(t,o),t.flags|=4096;return t}return e=so(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Yc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(J(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Tm(e,t,n,o,r){return $r(t),n=vg(e,t,n,o,void 0,r),o=yg(),e!==null&&!et?(bg(e,t,r),ho(e,t,r)):(be&&o&&cg(t),t.flags|=1,ct(e,t,n,r),t.child)}function $0(e,t,n,o,r,a){return $r(t),t.updateQueue=null,n=VS(t,o,n,r),US(e),o=yg(),e!==null&&!et?(bg(e,t,a),ho(e,t,a)):(be&&o&&cg(t),t.flags|=1,ct(e,t,n,a),t.child)}function H0(e,t,n,o,r){if($r(t),t.stateNode===null){var a=Pa,i=n.contextType;typeof i=="object"&&i!==null&&(a=ft(i)),a=new n(o,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_m,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=o,a.state=t.memoizedState,a.refs={},mg(t),i=n.contextType,a.context=typeof i=="object"&&i!==null?ft(i):Pa,a.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(tp(t,n,i,o),a.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(i=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),i!==a.state&&_m.enqueueReplaceState(a,a.state,null),xl(t,o,a,r),wl(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){a=t.stateNode;var l=t.memoizedProps,s=Ur(n,l);a.props=s;var c=a.context,f=n.contextType;i=Pa,typeof f=="object"&&f!==null&&(i=ft(f));var u=n.getDerivedStateFromProps;f=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l||c!==i)&&O0(t,a,o,i),zo=!1;var d=t.memoizedState;a.state=d,xl(t,o,a,r),wl(),c=t.memoizedState,l||d!==c||zo?(typeof u=="function"&&(tp(t,n,u,o),c=t.memoizedState),(s=zo||D0(t,n,s,o,d,c,i))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=c),a.props=o,a.state=c,a.context=i,o=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{a=t.stateNode,bm(e,t),i=t.memoizedProps,f=Ur(n,i),a.props=f,u=t.pendingProps,d=a.context,c=n.contextType,s=Pa,typeof c=="object"&&c!==null&&(s=ft(c)),l=n.getDerivedStateFromProps,(c=typeof l=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==u||d!==s)&&O0(t,a,o,s),zo=!1,d=t.memoizedState,a.state=d,xl(t,o,a,r),wl();var m=t.memoizedState;i!==u||d!==m||zo||e!==null&&e.dependencies!==null&&pu(e.dependencies)?(typeof l=="function"&&(tp(t,n,l,o),m=t.memoizedState),(f=zo||D0(t,n,f,o,d,m,s)||e!==null&&e.dependencies!==null&&pu(e.dependencies))?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(o,m,s),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(o,m,s)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=m),a.props=o,a.state=m,a.context=s,o=f):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),o=!1)}return a=o,Yc(e,t),o=(t.flags&128)!==0,a||o?(a=t.stateNode,n=o&&typeof n.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&o?(t.child=Hr(t,e.child,null,r),t.child=Hr(t,null,n,r)):ct(e,t,n,r),t.memoizedState=a.state,e=t.child):e=ho(e,t,r),e}function B0(e,t,n,o){return kr(),t.flags|=256,ct(e,t,n,o),t.child}var np={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function op(e){return{baseLanes:e,cachePool:zS()}}function rp(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Gt),e}function _1(e,t,n){var o=t.pendingProps,r=!1,a=(t.flags&128)!==0,i;if((i=a)||(i=e!==null&&e.memoizedState===null?!1:(qe.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(be){if(r?Lo(t):ko(),(e=Le)?(e=vE(e,ln),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:nr!==null?{id:Dn,overflow:On}:null,retryLane:536870912,hydrationErrors:null},n=MS(e),n.return=t,t.child=n,dt=t,Le=null)):e=null,e===null)throw or(t);return Vm(e)?t.lanes=32:t.lanes=536870912,null}var l=o.children;return o=o.fallback,r?(ko(),r=t.mode,l=wu({mode:"hidden",children:l},r),o=Dr(o,r,n,null),l.return=t,o.return=t,l.sibling=o,t.child=l,o=t.child,o.memoizedState=op(n),o.childLanes=rp(e,i,n),t.memoizedState=np,rl(null,o)):(Lo(t),Am(t,l))}var s=e.memoizedState;if(s!==null&&(l=s.dehydrated,l!==null)){if(a)t.flags&256?(Lo(t),t.flags&=-257,t=ap(e,t,n)):t.memoizedState!==null?(ko(),t.child=e.child,t.flags|=128,t=null):(ko(),l=o.fallback,r=t.mode,o=wu({mode:"visible",children:o.children},r),l=Dr(l,r,n,null),l.flags|=2,o.return=t,l.return=t,o.sibling=l,t.child=o,Hr(t,e.child,null,n),o=t.child,o.memoizedState=op(n),o.childLanes=rp(e,i,n),t.memoizedState=np,t=rl(null,o));else if(Lo(t),Vm(l)){if(i=l.nextSibling&&l.nextSibling.dataset,i)var c=i.dgst;i=c,o=Error(J(419)),o.stack="",o.digest=i,Ll({value:o,source:null,stack:null}),t=ap(e,t,n)}else if(et||Ri(e,t,n,!1),i=(n&e.childLanes)!==0,et||i){if(i=Me,i!==null&&(o=nS(i,n),o!==0&&o!==s.retryLane))throw s.retryLane=o,oa(e,o),At(i,e,o),Ag;Um(l)||Cu(),t=ap(e,t,n)}else Um(l)?(t.flags|=192,t.child=e.child,t=null):(e=s.treeContext,Le=cn(l.nextSibling),dt=t,be=!0,Xo=null,ln=!1,e!==null&&OS(t,e),t=Am(t,o.children),t.flags|=4096);return t}return r?(ko(),l=o.fallback,r=t.mode,s=e.child,c=s.sibling,o=so(s,{mode:"hidden",children:o.children}),o.subtreeFlags=s.subtreeFlags&65011712,c!==null?l=so(c,l):(l=Dr(l,r,n,null),l.flags|=2),l.return=t,o.return=t,o.sibling=l,t.child=o,rl(null,o),o=t.child,l=e.child.memoizedState,l===null?l=op(n):(r=l.cachePool,r!==null?(s=Je._currentValue,r=r.parent!==s?{parent:s,pool:s}:r):r=zS(),l={baseLanes:l.baseLanes|n,cachePool:r}),o.memoizedState=l,o.childLanes=rp(e,i,n),t.memoizedState=np,rl(e.child,o)):(Lo(t),n=e.child,e=n.sibling,n=so(n,{mode:"visible",children:o.children}),n.return=t,n.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function Am(e,t){return t=wu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function wu(e,t){return e=Bt(22,e,null,t),e.lanes=0,e}function ap(e,t,n){return Hr(t,e.child,null,n),e=Am(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function U0(e,t,n){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),gm(e.return,t,n)}function ip(e,t,n,o,r,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:n,tailMode:r,treeForkCount:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=o,i.tail=n,i.tailMode=r,i.treeForkCount=a)}function R1(e,t,n){var o=t.pendingProps,r=o.revealOrder,a=o.tail;o=o.children;var i=qe.current,l=(i&2)!==0;if(l?(i=i&1|2,t.flags|=128):i&=1,Oe(qe,i),ct(e,t,o,n),o=be?Il:0,!l&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&U0(e,n,t);else if(e.tag===19)U0(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&gu(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),ip(t,!1,r,n,a,o);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&gu(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}ip(t,!0,n,null,a,o);break;case"together":ip(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function ho(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ar|=t.lanes,!(n&t.childLanes))if(e!==null){if(Ri(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(J(153));if(t.child!==null){for(e=t.child,n=so(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=so(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Mg(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&pu(e)))}function p3(e,t,n){switch(t.tag){case 3:iu(t,t.stateNode.containerInfo),Io(t,Je,e.memoizedState.cache),kr();break;case 27:case 5:om(t);break;case 4:iu(t,t.stateNode.containerInfo);break;case 10:Io(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Sm(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Lo(t),t.flags|=128,null):n&t.child.childLanes?_1(e,t,n):(Lo(t),e=ho(e,t,n),e!==null?e.sibling:null);Lo(t);break;case 19:var r=(e.flags&128)!==0;if(o=(n&t.childLanes)!==0,o||(Ri(e,t,n,!1),o=(n&t.childLanes)!==0),r){if(o)return R1(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Oe(qe,qe.current),o)break;return null;case 22:return t.lanes=0,N1(e,t,n,t.pendingProps);case 24:Io(t,Je,e.memoizedState.cache)}return ho(e,t,n)}function T1(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)et=!0;else{if(!Mg(e,n)&&!(t.flags&128))return et=!1,p3(e,t,n);et=!!(e.flags&131072)}else et=!1,be&&t.flags&1048576&&DS(t,Il,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=_r(t.elementType),t.type=e,typeof e=="function")sg(e)?(o=Ur(e,o),t.tag=1,t=H0(null,t,e,o,n)):(t.tag=0,t=Tm(null,t,e,o,n));else{if(e!=null){var r=e.$$typeof;if(r===jh){t.tag=11,t=z0(null,t,e,o,n);break e}else if(r===qh){t.tag=14,t=I0(null,t,e,o,n);break e}}throw t=tm(e)||e,Error(J(306,t,""))}}return t;case 0:return Tm(e,t,t.type,t.pendingProps,n);case 1:return o=t.type,r=Ur(o,t.pendingProps),H0(e,t,o,r,n);case 3:e:{if(iu(t,t.stateNode.containerInfo),e===null)throw Error(J(387));o=t.pendingProps;var a=t.memoizedState;r=a.element,bm(e,t),xl(t,o,null,n);var i=t.memoizedState;if(o=i.cache,Io(t,Je,o),o!==a.cache&&vm(t,[Je],n,!0),wl(),o=i.element,a.isDehydrated)if(a={element:o,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=B0(e,t,o,n);break e}else if(o!==r){r=an(Error(J(424)),t),Ll(r),t=B0(e,t,o,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Le=cn(e.firstChild),dt=t,be=!0,Xo=null,ln=!0,n=kS(t,null,o,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(kr(),o===r){t=ho(e,t,n);break e}ct(e,t,o,n)}t=t.child}return t;case 26:return Yc(e,t),e===null?(n=lb(t.type,null,t.pendingProps,null))?t.memoizedState=n:be||(n=t.type,e=t.pendingProps,o=Tu(Fo.current).createElement(n),o[ut]=t,o[Mt]=e,pt(o,n,e),it(o),t.stateNode=o):t.memoizedState=lb(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return om(t),e===null&&be&&(o=t.stateNode=yE(t.type,t.pendingProps,Fo.current),dt=t,ln=!0,r=Le,ur(t.type)?(Gm=r,Le=cn(o.firstChild)):Le=r),ct(e,t,t.pendingProps.children,n),Yc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&be&&((r=o=Le)&&(o=G3(o,t.type,t.pendingProps,ln),o!==null?(t.stateNode=o,dt=t,Le=cn(o.firstChild),ln=!1,r=!0):r=!1),r||or(t)),om(t),r=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,Hm(r,a)?o=null:i!==null&&Hm(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=vg(e,t,r3,null,null,n),Vl._currentValue=r),Yc(e,t),ct(e,t,o,n),t.child;case 6:return e===null&&be&&((e=n=Le)&&(n=Y3(n,t.pendingProps,ln),n!==null?(t.stateNode=n,dt=t,Le=null,e=!0):e=!1),e||or(t)),null;case 13:return _1(e,t,n);case 4:return iu(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Hr(t,null,o,n):ct(e,t,o,n),t.child;case 11:return z0(e,t,t.type,t.pendingProps,n);case 7:return ct(e,t,t.pendingProps,n),t.child;case 8:return ct(e,t,t.pendingProps.children,n),t.child;case 12:return ct(e,t,t.pendingProps.children,n),t.child;case 10:return o=t.pendingProps,Io(t,t.type,o.value),ct(e,t,o.children,n),t.child;case 9:return r=t.type._context,o=t.pendingProps.children,$r(t),r=ft(r),o=o(r),t.flags|=1,ct(e,t,o,n),t.child;case 14:return I0(e,t,t.type,t.pendingProps,n);case 15:return C1(e,t,t.type,t.pendingProps,n);case 19:return R1(e,t,n);case 31:return f3(e,t,n);case 22:return N1(e,t,n,t.pendingProps);case 24:return $r(t),o=ft(Je),e===null?(r=fg(),r===null&&(r=Me,a=dg(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=n),r=a),t.memoizedState={parent:o,cache:r},mg(t),Io(t,Je,r)):(e.lanes&n&&(bm(e,t),xl(t,null,null,n),wl()),r=e.memoizedState,a=t.memoizedState,r.parent!==o?(r={parent:o,cache:o},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Io(t,Je,o)):(o=a.cache,Io(t,Je,o),o!==r.cache&&vm(t,[Je],n,!0))),ct(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(J(156,t.tag))}function qn(e){e.flags|=4}function lp(e,t,n,o,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(W1())e.flags|=8192;else throw Pr=mu,pg}else e.flags&=-16777217}function V0(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!xE(t))if(W1())e.flags|=8192;else throw Pr=mu,pg}function dc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Jx():536870912,e.lanes|=t,ii|=t)}function Xi(e,t){if(!be)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,o=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags&65011712,o|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags,o|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=o,e.childLanes=n,t}function m3(e,t,n){var o=t.pendingProps;switch(ug(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ze(t),null;case 1:return ze(t),null;case 3:return n=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),co(Je),ei(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?qn(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Wf())),ze(t),null;case 26:var r=t.type,a=t.memoizedState;return e===null?(qn(t),a!==null?(ze(t),V0(t,a)):(ze(t),lp(t,r,null,o,n))):a?a!==e.memoizedState?(qn(t),ze(t),V0(t,a)):(ze(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&qn(t),ze(t),lp(t,r,e,o,n)),null;case 27:if(lu(t),n=Fo.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&qn(t);else{if(!o){if(t.stateNode===null)throw Error(J(166));return ze(t),null}e=Ln.current,fa(t)?v0(t):(e=yE(r,o,n),t.stateNode=e,qn(t))}return ze(t),null;case 5:if(lu(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&qn(t);else{if(!o){if(t.stateNode===null)throw Error(J(166));return ze(t),null}if(a=Ln.current,fa(t))v0(t);else{var i=Tu(Fo.current);switch(a){case 1:a=i.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:a=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":a=i.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":a=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":a=i.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof o.is=="string"?i.createElement("select",{is:o.is}):i.createElement("select"),o.multiple?a.multiple=!0:o.size&&(a.size=o.size);break;default:a=typeof o.is=="string"?i.createElement(r,{is:o.is}):i.createElement(r)}}a[ut]=t,a[Mt]=o;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)a.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=a;e:switch(pt(a,r,o),r){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&qn(t)}}return ze(t),lp(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&qn(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(J(166));if(e=Fo.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,o=null,r=dt,r!==null)switch(r.tag){case 27:case 5:o=r.memoizedProps}e[ut]=t,e=!!(e.nodeValue===n||o!==null&&o.suppressHydrationWarning===!0||mE(e.nodeValue,n)),e||or(t,!0)}else e=Tu(e).createTextNode(o),e[ut]=t,t.stateNode=e}return ze(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(o=fa(t),n!==null){if(e===null){if(!o)throw Error(J(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(557));e[ut]=t}else kr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ze(t),e=!1}else n=Wf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?($t(t),t):($t(t),null);if(t.flags&128)throw Error(J(558))}return ze(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=fa(t),o!==null&&o.dehydrated!==null){if(e===null){if(!r)throw Error(J(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(J(317));r[ut]=t}else kr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ze(t),r=!1}else r=Wf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?($t(t),t):($t(t),null)}return $t(t),t.flags&128?(t.lanes=n,t):(n=o!==null,e=e!==null&&e.memoizedState!==null,n&&(o=t.child,r=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(r=o.alternate.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==r&&(o.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),dc(t,t.updateQueue),ze(t),null);case 4:return ei(),e===null&&kg(t.stateNode.containerInfo),ze(t),null;case 10:return co(t.type),ze(t),null;case 19:if(lt(qe),o=t.memoizedState,o===null)return ze(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)Xi(o,!1);else{if(Ke!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=gu(e),a!==null){for(t.flags|=128,Xi(o,!1),e=a.updateQueue,t.updateQueue=e,dc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)AS(n,e),n=n.sibling;return Oe(qe,qe.current&1|2),be&&to(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&Yt()>Su&&(t.flags|=128,r=!0,Xi(o,!1),t.lanes=4194304)}else{if(!r)if(e=gu(a),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,dc(t,e),Xi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!be)return ze(t),null}else 2*Yt()-o.renderingStartTime>Su&&n!==536870912&&(t.flags|=128,r=!0,Xi(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(e=o.last,e!==null?e.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Yt(),e.sibling=null,n=qe.current,Oe(qe,r?n&1|2:n&1),be&&to(t,o.treeForkCount),e):(ze(t),null);case 22:case 23:return $t(t),hg(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?n&536870912&&!(t.flags&128)&&(ze(t),t.subtreeFlags&6&&(t.flags|=8192)):ze(t),n=t.updateQueue,n!==null&&dc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==n&&(t.flags|=2048),e!==null&&lt(Or),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),co(Je),ze(t),null;case 25:return null;case 30:return null}throw Error(J(156,t.tag))}function h3(e,t){switch(ug(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return co(Je),ei(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return lu(t),null;case 31:if(t.memoizedState!==null){if($t(t),t.alternate===null)throw Error(J(340));kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($t(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return lt(qe),null;case 4:return ei(),null;case 10:return co(t.type),null;case 22:case 23:return $t(t),hg(),e!==null&&lt(Or),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return co(Je),null;case 25:return null;default:return null}}function A1(e,t){switch(ug(t),t.tag){case 3:co(Je),ei();break;case 26:case 27:case 5:lu(t);break;case 4:ei();break;case 31:t.memoizedState!==null&&$t(t);break;case 13:$t(t);break;case 19:lt(qe);break;case 10:co(t.type);break;case 22:case 23:$t(t),hg(),e!==null&&lt(Or);break;case 24:co(Je)}}function ys(e,t){try{var n=t.updateQueue,o=n!==null?n.lastEffect:null;if(o!==null){var r=o.next;n=r;do{if((n.tag&e)===e){o=void 0;var a=n.create,i=n.inst;o=a(),i.destroy=o}n=n.next}while(n!==r)}}catch(l){Ne(t,t.return,l)}}function rr(e,t,n){try{var o=t.updateQueue,r=o!==null?o.lastEffect:null;if(r!==null){var a=r.next;o=a;do{if((o.tag&e)===e){var i=o.inst,l=i.destroy;if(l!==void 0){i.destroy=void 0,r=t;var s=n,c=l;try{c()}catch(f){Ne(r,s,f)}}}o=o.next}while(o!==a)}}catch(f){Ne(t,t.return,f)}}function M1(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{HS(t,n)}catch(o){Ne(e,e.return,o)}}}function D1(e,t,n){n.props=Ur(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(o){Ne(e,t,o)}}function El(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof n=="function"?e.refCleanup=n(o):n.current=o}}catch(r){Ne(e,t,r)}}function Pn(e,t){var n=e.ref,o=e.refCleanup;if(n!==null)if(typeof o=="function")try{o()}catch(r){Ne(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Ne(e,t,r)}else n.current=null}function O1(e){var t=e.type,n=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&o.focus();break e;case"img":n.src?o.src=n.src:n.srcSet&&(o.srcset=n.srcSet)}}catch(r){Ne(e,e.return,r)}}function sp(e,t,n){try{var o=e.stateNode;k3(o,e.type,n,t),o[Mt]=t}catch(r){Ne(e,e.return,r)}}function P1(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ur(e.type)||e.tag===4}function cp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||P1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ur(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mm(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ao));else if(o!==4&&(o===27&&ur(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Mm(e,t,n),e=e.sibling;e!==null;)Mm(e,t,n),e=e.sibling}function xu(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(o!==4&&(o===27&&ur(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(xu(e,t,n),e=e.sibling;e!==null;)xu(e,t,n),e=e.sibling}function z1(e){var t=e.stateNode,n=e.memoizedProps;try{for(var o=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);pt(t,o,n),t[ut]=e,t[Mt]=n}catch(a){Ne(e,e.return,a)}}var no=!1,We=!1,up=!1,G0=typeof WeakSet=="function"?WeakSet:Set,at=null;function g3(e,t){if(e=e.containerInfo,km=Ou,e=xS(e),ag(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var r=o.anchorOffset,a=o.focusNode;o=o.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var i=0,l=-1,s=-1,c=0,f=0,u=e,d=null;t:for(;;){for(var m;u!==n||r!==0&&u.nodeType!==3||(l=i+r),u!==a||o!==0&&u.nodeType!==3||(s=i+o),u.nodeType===3&&(i+=u.nodeValue.length),(m=u.firstChild)!==null;)d=u,u=m;for(;;){if(u===e)break t;if(d===n&&++c===r&&(l=i),d===a&&++f===o&&(s=i),(m=u.nextSibling)!==null)break;u=d,d=u.parentNode}u=m}n=l===-1||s===-1?null:{start:l,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for($m={focusedElem:e,selectionRange:n},Ou=!1,at=t;at!==null;)if(t=at,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,at=e;else for(;at!==null;){switch(t=at,a=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)r=e[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,r=a.memoizedProps,a=a.memoizedState,o=n.stateNode;try{var v=Ur(n.type,r);e=o.getSnapshotBeforeUpdate(v,a),o.__reactInternalSnapshotBeforeUpdate=e}catch(g){Ne(n,n.return,g)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Bm(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Bm(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(J(163))}if(e=t.sibling,e!==null){e.return=t.return,at=e;break}at=t.return}}function I1(e,t,n){var o=n.flags;switch(n.tag){case 0:case 11:case 15:Qn(e,n),o&4&&ys(5,n);break;case 1:if(Qn(e,n),o&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){Ne(n,n.return,i)}else{var r=Ur(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){Ne(n,n.return,i)}}o&64&&M1(n),o&512&&El(n,n.return);break;case 3:if(Qn(e,n),o&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{HS(e,t)}catch(i){Ne(n,n.return,i)}}break;case 27:t===null&&o&4&&z1(n);case 26:case 5:Qn(e,n),t===null&&o&4&&O1(n),o&512&&El(n,n.return);break;case 12:Qn(e,n);break;case 31:Qn(e,n),o&4&&$1(e,n);break;case 13:Qn(e,n),o&4&&H1(e,n),o&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=N3.bind(null,n),F3(e,n))));break;case 22:if(o=n.memoizedState!==null||no,!o){t=t!==null&&t.memoizedState!==null||We,r=no;var a=We;no=o,(We=t)&&!a?eo(e,n,(n.subtreeFlags&8772)!==0):Qn(e,n),no=r,We=a}break;case 30:break;default:Qn(e,n)}}function L1(e){var t=e.alternate;t!==null&&(e.alternate=null,L1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Jh(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ge=null,_t=!1;function Zn(e,t,n){for(n=n.child;n!==null;)k1(e,t,n),n=n.sibling}function k1(e,t,n){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(ds,n)}catch{}switch(n.tag){case 26:We||Pn(n,t),Zn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:We||Pn(n,t);var o=Ge,r=_t;ur(n.type)&&(Ge=n.stateNode,_t=!1),Zn(e,t,n),Rl(n.stateNode),Ge=o,_t=r;break;case 5:We||Pn(n,t);case 6:if(o=Ge,r=_t,Ge=null,Zn(e,t,n),Ge=o,_t=r,Ge!==null)if(_t)try{(Ge.nodeType===9?Ge.body:Ge.nodeName==="HTML"?Ge.ownerDocument.body:Ge).removeChild(n.stateNode)}catch(a){Ne(n,t,a)}else try{Ge.removeChild(n.stateNode)}catch(a){Ne(n,t,a)}break;case 18:Ge!==null&&(_t?(e=Ge,nb(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ui(e)):nb(Ge,n.stateNode));break;case 4:o=Ge,r=_t,Ge=n.stateNode.containerInfo,_t=!0,Zn(e,t,n),Ge=o,_t=r;break;case 0:case 11:case 14:case 15:rr(2,n,t),We||rr(4,n,t),Zn(e,t,n);break;case 1:We||(Pn(n,t),o=n.stateNode,typeof o.componentWillUnmount=="function"&&D1(n,t,o)),Zn(e,t,n);break;case 21:Zn(e,t,n);break;case 22:We=(o=We)||n.memoizedState!==null,Zn(e,t,n),We=o;break;default:Zn(e,t,n)}}function $1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ui(e)}catch(n){Ne(t,t.return,n)}}}function H1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ui(e)}catch(n){Ne(t,t.return,n)}}function v3(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new G0),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new G0),t;default:throw Error(J(435,e.tag))}}function fc(e,t){var n=v3(e);t.forEach(function(o){if(!n.has(o)){n.add(o);var r=_3.bind(null,e,o);o.then(r,r)}})}function Ct(e,t){var n=t.deletions;if(n!==null)for(var o=0;o<n.length;o++){var r=n[o],a=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 27:if(ur(l.type)){Ge=l.stateNode,_t=!1;break e}break;case 5:Ge=l.stateNode,_t=!1;break e;case 3:case 4:Ge=l.stateNode.containerInfo,_t=!0;break e}l=l.return}if(Ge===null)throw Error(J(160));k1(a,i,r),Ge=null,_t=!1,a=r.alternate,a!==null&&(a.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)B1(t,e),t=t.sibling}var gn=null;function B1(e,t){var n=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ct(t,e),Nt(e),o&4&&(rr(3,e,e.return),ys(3,e),rr(5,e,e.return));break;case 1:Ct(t,e),Nt(e),o&512&&(We||n===null||Pn(n,n.return)),o&64&&no&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?o:n.concat(o))));break;case 26:var r=gn;if(Ct(t,e),Nt(e),o&512&&(We||n===null||Pn(n,n.return)),o&4){var a=n!==null?n.memoizedState:null;if(o=e.memoizedState,n===null)if(o===null)if(e.stateNode===null){e:{o=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(o){case"title":a=r.getElementsByTagName("title")[0],(!a||a[ms]||a[ut]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(o),r.head.insertBefore(a,r.querySelector("head > title"))),pt(a,o,n),a[ut]=e,it(a),o=a;break e;case"link":var i=cb("link","href",r).get(o+(n.href||""));if(i){for(var l=0;l<i.length;l++)if(a=i[l],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(l,1);break t}}a=r.createElement(o),pt(a,o,n),r.head.appendChild(a);break;case"meta":if(i=cb("meta","content",r).get(o+(n.content||""))){for(l=0;l<i.length;l++)if(a=i[l],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(l,1);break t}}a=r.createElement(o),pt(a,o,n),r.head.appendChild(a);break;default:throw Error(J(468,o))}a[ut]=e,it(a),o=a}e.stateNode=o}else ub(r,e.type,e.stateNode);else e.stateNode=sb(r,o,e.memoizedProps);else a!==o?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,o===null?ub(r,e.type,e.stateNode):sb(r,o,e.memoizedProps)):o===null&&e.stateNode!==null&&sp(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ct(t,e),Nt(e),o&512&&(We||n===null||Pn(n,n.return)),n!==null&&o&4&&sp(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ct(t,e),Nt(e),o&512&&(We||n===null||Pn(n,n.return)),e.flags&32){r=e.stateNode;try{ni(r,"")}catch(v){Ne(e,e.return,v)}}o&4&&e.stateNode!=null&&(r=e.memoizedProps,sp(e,r,n!==null?n.memoizedProps:r)),o&1024&&(up=!0);break;case 6:if(Ct(t,e),Nt(e),o&4){if(e.stateNode===null)throw Error(J(162));o=e.memoizedProps,n=e.stateNode;try{n.nodeValue=o}catch(v){Ne(e,e.return,v)}}break;case 3:if(Kc=null,r=gn,gn=Au(t.containerInfo),Ct(t,e),gn=r,Nt(e),o&4&&n!==null&&n.memoizedState.isDehydrated)try{ui(t.containerInfo)}catch(v){Ne(e,e.return,v)}up&&(up=!1,U1(e));break;case 4:o=gn,gn=Au(e.stateNode.containerInfo),Ct(t,e),Nt(e),gn=o;break;case 12:Ct(t,e),Nt(e);break;case 31:Ct(t,e),Nt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,fc(e,o)));break;case 13:Ct(t,e),Nt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Od=Yt()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,fc(e,o)));break;case 22:r=e.memoizedState!==null;var s=n!==null&&n.memoizedState!==null,c=no,f=We;if(no=c||r,We=f||s,Ct(t,e),We=f,no=c,Nt(e),o&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||s||no||We||Rr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){s=n=t;try{if(a=s.stateNode,r)i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{l=s.stateNode;var u=s.memoizedProps.style,d=u!=null&&u.hasOwnProperty("display")?u.display:null;l.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(v){Ne(s,s.return,v)}}}else if(t.tag===6){if(n===null){s=t;try{s.stateNode.nodeValue=r?"":s.memoizedProps}catch(v){Ne(s,s.return,v)}}}else if(t.tag===18){if(n===null){s=t;try{var m=s.stateNode;r?ob(m,!0):ob(s.stateNode,!1)}catch(v){Ne(s,s.return,v)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(n=o.retryQueue,n!==null&&(o.retryQueue=null,fc(e,n))));break;case 19:Ct(t,e),Nt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,fc(e,o)));break;case 30:break;case 21:break;default:Ct(t,e),Nt(e)}}function Nt(e){var t=e.flags;if(t&2){try{for(var n,o=e.return;o!==null;){if(P1(o)){n=o;break}o=o.return}if(n==null)throw Error(J(160));switch(n.tag){case 27:var r=n.stateNode,a=cp(e);xu(e,a,r);break;case 5:var i=n.stateNode;n.flags&32&&(ni(i,""),n.flags&=-33);var l=cp(e);xu(e,l,i);break;case 3:case 4:var s=n.stateNode.containerInfo,c=cp(e);Mm(e,c,s);break;default:throw Error(J(161))}}catch(f){Ne(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function U1(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;U1(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Qn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)I1(e,t.alternate,t),t=t.sibling}function Rr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:rr(4,t,t.return),Rr(t);break;case 1:Pn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&D1(t,t.return,n),Rr(t);break;case 27:Rl(t.stateNode);case 26:case 5:Pn(t,t.return),Rr(t);break;case 22:t.memoizedState===null&&Rr(t);break;case 30:Rr(t);break;default:Rr(t)}e=e.sibling}}function eo(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,r=e,a=t,i=a.flags;switch(a.tag){case 0:case 11:case 15:eo(r,a,n),ys(4,a);break;case 1:if(eo(r,a,n),o=a,r=o.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){Ne(o,o.return,c)}if(o=a,r=o.updateQueue,r!==null){var l=o.stateNode;try{var s=r.shared.hiddenCallbacks;if(s!==null)for(r.shared.hiddenCallbacks=null,r=0;r<s.length;r++)$S(s[r],l)}catch(c){Ne(o,o.return,c)}}n&&i&64&&M1(a),El(a,a.return);break;case 27:z1(a);case 26:case 5:eo(r,a,n),n&&o===null&&i&4&&O1(a),El(a,a.return);break;case 12:eo(r,a,n);break;case 31:eo(r,a,n),n&&i&4&&$1(r,a);break;case 13:eo(r,a,n),n&&i&4&&H1(r,a);break;case 22:a.memoizedState===null&&eo(r,a,n),El(a,a.return);break;case 30:break;default:eo(r,a,n)}t=t.sibling}}function Dg(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&gs(n))}function Og(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&gs(e))}function mn(e,t,n,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)V1(e,t,n,o),t=t.sibling}function V1(e,t,n,o){var r=t.flags;switch(t.tag){case 0:case 11:case 15:mn(e,t,n,o),r&2048&&ys(9,t);break;case 1:mn(e,t,n,o);break;case 3:mn(e,t,n,o),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&gs(e)));break;case 12:if(r&2048){mn(e,t,n,o),e=t.stateNode;try{var a=t.memoizedProps,i=a.id,l=a.onPostCommit;typeof l=="function"&&l(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(s){Ne(t,t.return,s)}}else mn(e,t,n,o);break;case 31:mn(e,t,n,o);break;case 13:mn(e,t,n,o);break;case 23:break;case 22:a=t.stateNode,i=t.alternate,t.memoizedState!==null?a._visibility&2?mn(e,t,n,o):Cl(e,t):a._visibility&2?mn(e,t,n,o):(a._visibility|=2,wa(e,t,n,o,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Dg(i,t);break;case 24:mn(e,t,n,o),r&2048&&Og(t.alternate,t);break;default:mn(e,t,n,o)}}function wa(e,t,n,o,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var a=e,i=t,l=n,s=o,c=i.flags;switch(i.tag){case 0:case 11:case 15:wa(a,i,l,s,r),ys(8,i);break;case 23:break;case 22:var f=i.stateNode;i.memoizedState!==null?f._visibility&2?wa(a,i,l,s,r):Cl(a,i):(f._visibility|=2,wa(a,i,l,s,r)),r&&c&2048&&Dg(i.alternate,i);break;case 24:wa(a,i,l,s,r),r&&c&2048&&Og(i.alternate,i);break;default:wa(a,i,l,s,r)}t=t.sibling}}function Cl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,o=t,r=o.flags;switch(o.tag){case 22:Cl(n,o),r&2048&&Dg(o.alternate,o);break;case 24:Cl(n,o),r&2048&&Og(o.alternate,o);break;default:Cl(n,o)}t=t.sibling}}var al=8192;function pa(e,t,n){if(e.subtreeFlags&al)for(e=e.child;e!==null;)G1(e,t,n),e=e.sibling}function G1(e,t,n){switch(e.tag){case 26:pa(e,t,n),e.flags&al&&e.memoizedState!==null&&oI(n,gn,e.memoizedState,e.memoizedProps);break;case 5:pa(e,t,n);break;case 3:case 4:var o=gn;gn=Au(e.stateNode.containerInfo),pa(e,t,n),gn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=al,al=16777216,pa(e,t,n),al=o):pa(e,t,n));break;default:pa(e,t,n)}}function Y1(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ki(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var o=t[n];at=o,X1(o,e)}Y1(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)F1(e),e=e.sibling}function F1(e){switch(e.tag){case 0:case 11:case 15:Ki(e),e.flags&2048&&rr(9,e,e.return);break;case 3:Ki(e);break;case 12:Ki(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fc(e)):Ki(e);break;default:Ki(e)}}function Fc(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var o=t[n];at=o,X1(o,e)}Y1(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:rr(8,t,t.return),Fc(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fc(t));break;default:Fc(t)}e=e.sibling}}function X1(e,t){for(;at!==null;){var n=at;switch(n.tag){case 0:case 11:case 15:rr(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var o=n.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:gs(n.memoizedState.cache)}if(o=n.child,o!==null)o.return=n,at=o;else e:for(n=e;at!==null;){o=at;var r=o.sibling,a=o.return;if(L1(o),o===n){at=null;break e}if(r!==null){r.return=a,at=r;break e}at=a}}}var y3={getCacheForType:function(e){var t=ft(Je),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ft(Je).controller.signal}},b3=typeof WeakMap=="function"?WeakMap:Map,Se=0,Me=null,ve=null,ye=0,Ce=0,Lt=null,Vo=!1,Ai=!1,Pg=!1,go=0,Ke=0,ar=0,zr=0,zg=0,Gt=0,ii=0,Nl=null,Rt=null,Dm=!1,Od=0,K1=0,Su=1/0,Eu=null,qo=null,ot=0,Zo=null,li=null,uo=0,Om=0,Pm=null,j1=null,_l=0,zm=null;function Kt(){return Se&2&&ye!==0?ye&-ye:de.T!==null?Lg():oS()}function q1(){if(Gt===0)if(!(ye&536870912)||be){var e=rc;rc<<=1,!(rc&3932160)&&(rc=262144),Gt=e}else Gt=536870912;return e=Zt.current,e!==null&&(e.flags|=32),Gt}function At(e,t,n){(e===Me&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)&&(si(e,0),Go(e,ye,Gt,!1)),ps(e,n),(!(Se&2)||e!==Me)&&(e===Me&&(!(Se&2)&&(zr|=n),Ke===4&&Go(e,ye,Gt,!1)),Un(e))}function Z1(e,t,n){if(Se&6)throw Error(J(327));var o=!n&&(t&127)===0&&(t&e.expiredLanes)===0||fs(e,t),r=o?S3(e,t):dp(e,t,!0),a=o;do{if(r===0){Ai&&!o&&Go(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!w3(n)){r=dp(e,t,!1),a=!1;continue}if(r===2){if(a=t,e.errorRecoveryDisabledLanes&a)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var l=e;r=Nl;var s=l.current.memoizedState.isDehydrated;if(s&&(si(l,i).flags|=256),i=dp(l,i,!1),i!==2){if(Pg&&!s){l.errorRecoveryDisabledLanes|=a,zr|=a,r=4;break e}a=Rt,Rt=r,a!==null&&(Rt===null?Rt=a:Rt.push.apply(Rt,a))}r=i}if(a=!1,r!==2)continue}}if(r===1){si(e,0),Go(e,t,0,!0);break}e:{switch(o=e,a=r,a){case 0:case 1:throw Error(J(345));case 4:if((t&4194048)!==t)break;case 6:Go(o,t,Gt,!Vo);break e;case 2:Rt=null;break;case 3:case 5:break;default:throw Error(J(329))}if((t&62914560)===t&&(r=Od+300-Yt(),10<r)){if(Go(o,t,Gt,!Vo),xd(o,0,!0)!==0)break e;uo=t,o.timeoutHandle=gE(Y0.bind(null,o,n,Rt,Eu,Dm,t,Gt,zr,ii,Vo,a,"Throttled",-0,0),r);break e}Y0(o,n,Rt,Eu,Dm,t,Gt,zr,ii,Vo,a,null,-0,0)}}break}while(!0);Un(e)}function Y0(e,t,n,o,r,a,i,l,s,c,f,u,d,m){if(e.timeoutHandle=-1,u=t.subtreeFlags,u&8192||(u&16785408)===16785408){u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ao},G1(t,a,u);var v=(a&62914560)===a?Od-Yt():(a&4194048)===a?K1-Yt():0;if(v=rI(u,v),v!==null){uo=a,e.cancelPendingCommit=v(X0.bind(null,e,t,a,n,o,r,i,l,s,f,u,null,d,m)),Go(e,a,i,!c);return}}X0(e,t,a,n,o,r,i,l,s)}function w3(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var o=0;o<n.length;o++){var r=n[o],a=r.getSnapshot;r=r.value;try{if(!qt(a(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Go(e,t,n,o){t&=~zg,t&=~zr,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var r=t;0<r;){var a=31-Xt(r),i=1<<a;o[a]=-1,r&=~i}n!==0&&eS(e,n,t)}function Pd(){return Se&6?!0:(bs(0),!1)}function Ig(){if(ve!==null){if(Ce===0)var e=ve.return;else e=ve,io=ra=null,wg(e),Ya=null,kl=0,e=ve;for(;e!==null;)A1(e.alternate,e),e=e.return;ve=null}}function si(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,B3(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uo=0,Ig(),Me=e,ve=n=so(e.current,null),ye=t,Ce=0,Lt=null,Vo=!1,Ai=fs(e,t),Pg=!1,ii=Gt=zg=zr=ar=Ke=0,Rt=Nl=null,Dm=!1,t&8&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var r=31-Xt(o),a=1<<r;t|=e[r],o&=~a}return go=t,Nd(),n}function Q1(e,t){me=null,de.H=Hl,t===Ti||t===Rd?(t=S0(),Ce=3):t===pg?(t=S0(),Ce=4):Ce=t===Ag?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Lt=t,ve===null&&(Ke=1,bu(e,an(t,e.current)))}function W1(){var e=Zt.current;return e===null?!0:(ye&4194048)===ye?sn===null:(ye&62914560)===ye||ye&536870912?e===sn:!1}function J1(){var e=de.H;return de.H=Hl,e===null?Hl:e}function eE(){var e=de.A;return de.A=y3,e}function Cu(){Ke=4,Vo||(ye&4194048)!==ye&&Zt.current!==null||(Ai=!0),!(ar&134217727)&&!(zr&134217727)||Me===null||Go(Me,ye,Gt,!1)}function dp(e,t,n){var o=Se;Se|=2;var r=J1(),a=eE();(Me!==e||ye!==t)&&(Eu=null,si(e,t)),t=!1;var i=Ke;e:do try{if(Ce!==0&&ve!==null){var l=ve,s=Lt;switch(Ce){case 8:Ig(),i=6;break e;case 3:case 2:case 9:case 6:Zt.current===null&&(t=!0);var c=Ce;if(Ce=0,Lt=null,La(e,l,s,c),n&&Ai){i=0;break e}break;default:c=Ce,Ce=0,Lt=null,La(e,l,s,c)}}x3(),i=Ke;break}catch(f){Q1(e,f)}while(!0);return t&&e.shellSuspendCounter++,io=ra=null,Se=o,de.H=r,de.A=a,ve===null&&(Me=null,ye=0,Nd()),i}function x3(){for(;ve!==null;)tE(ve)}function S3(e,t){var n=Se;Se|=2;var o=J1(),r=eE();Me!==e||ye!==t?(Eu=null,Su=Yt()+500,si(e,t)):Ai=fs(e,t);e:do try{if(Ce!==0&&ve!==null){t=ve;var a=Lt;t:switch(Ce){case 1:Ce=0,Lt=null,La(e,t,a,1);break;case 2:case 9:if(x0(a)){Ce=0,Lt=null,F0(t);break}t=function(){Ce!==2&&Ce!==9||Me!==e||(Ce=7),Un(e)},a.then(t,t);break e;case 3:Ce=7;break e;case 4:Ce=5;break e;case 7:x0(a)?(Ce=0,Lt=null,F0(t)):(Ce=0,Lt=null,La(e,t,a,7));break;case 5:var i=null;switch(ve.tag){case 26:i=ve.memoizedState;case 5:case 27:var l=ve;if(i?xE(i):l.stateNode.complete){Ce=0,Lt=null;var s=l.sibling;if(s!==null)ve=s;else{var c=l.return;c!==null?(ve=c,zd(c)):ve=null}break t}}Ce=0,Lt=null,La(e,t,a,5);break;case 6:Ce=0,Lt=null,La(e,t,a,6);break;case 8:Ig(),Ke=6;break e;default:throw Error(J(462))}}E3();break}catch(f){Q1(e,f)}while(!0);return io=ra=null,de.H=o,de.A=r,Se=n,ve!==null?0:(Me=null,ye=0,Nd(),Ke)}function E3(){for(;ve!==null&&!XP();)tE(ve)}function tE(e){var t=T1(e.alternate,e,go);e.memoizedProps=e.pendingProps,t===null?zd(e):ve=t}function F0(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=$0(n,t,t.pendingProps,t.type,void 0,ye);break;case 11:t=$0(n,t,t.pendingProps,t.type.render,t.ref,ye);break;case 5:wg(t);default:A1(n,t),t=ve=AS(t,go),t=T1(n,t,go)}e.memoizedProps=e.pendingProps,t===null?zd(e):ve=t}function La(e,t,n,o){io=ra=null,wg(t),Ya=null,kl=0;var r=t.return;try{if(d3(e,r,t,n,ye)){Ke=1,bu(e,an(n,e.current)),ve=null;return}}catch(a){if(r!==null)throw ve=r,a;Ke=1,bu(e,an(n,e.current)),ve=null;return}t.flags&32768?(be||o===1?e=!0:Ai||ye&536870912?e=!1:(Vo=e=!0,(o===2||o===9||o===3||o===6)&&(o=Zt.current,o!==null&&o.tag===13&&(o.flags|=16384))),nE(t,e)):zd(t)}function zd(e){var t=e;do{if(t.flags&32768){nE(t,Vo);return}e=t.return;var n=m3(t.alternate,t,go);if(n!==null){ve=n;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);Ke===0&&(Ke=5)}function nE(e,t){do{var n=h3(e.alternate,e);if(n!==null){n.flags&=32767,ve=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ve=e;return}ve=e=n}while(e!==null);Ke=6,ve=null}function X0(e,t,n,o,r,a,i,l,s){e.cancelPendingCommit=null;do Id();while(ot!==0);if(Se&6)throw Error(J(327));if(t!==null){if(t===e.current)throw Error(J(177));if(a=t.lanes|t.childLanes,a|=ig,nz(e,n,a,i,l,s),e===Me&&(ve=Me=null,ye=0),li=t,Zo=e,uo=n,Om=a,Pm=r,j1=o,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,R3(su,function(){return lE(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,t.subtreeFlags&13878||o){o=de.T,de.T=null,r=Ee.p,Ee.p=2,i=Se,Se|=4;try{g3(e,t,n)}finally{Se=i,Ee.p=r,de.T=o}}ot=1,oE(),rE(),aE()}}function oE(){if(ot===1){ot=0;var e=Zo,t=li,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=de.T,de.T=null;var o=Ee.p;Ee.p=2;var r=Se;Se|=4;try{B1(t,e);var a=$m,i=xS(e.containerInfo),l=a.focusedElem,s=a.selectionRange;if(i!==l&&l&&l.ownerDocument&&wS(l.ownerDocument.documentElement,l)){if(s!==null&&ag(l)){var c=s.start,f=s.end;if(f===void 0&&(f=c),"selectionStart"in l)l.selectionStart=c,l.selectionEnd=Math.min(f,l.value.length);else{var u=l.ownerDocument||document,d=u&&u.defaultView||window;if(d.getSelection){var m=d.getSelection(),v=l.textContent.length,g=Math.min(s.start,v),x=s.end===void 0?g:Math.min(s.end,v);!m.extend&&g>x&&(i=x,x=g,g=i);var h=m0(l,g),w=m0(l,x);if(h&&w&&(m.rangeCount!==1||m.anchorNode!==h.node||m.anchorOffset!==h.offset||m.focusNode!==w.node||m.focusOffset!==w.offset)){var y=u.createRange();y.setStart(h.node,h.offset),m.removeAllRanges(),g>x?(m.addRange(y),m.extend(w.node,w.offset)):(y.setEnd(w.node,w.offset),m.addRange(y))}}}}for(u=[],m=l;m=m.parentNode;)m.nodeType===1&&u.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<u.length;l++){var S=u[l];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}Ou=!!km,$m=km=null}finally{Se=r,Ee.p=o,de.T=n}}e.current=t,ot=2}}function rE(){if(ot===2){ot=0;var e=Zo,t=li,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=de.T,de.T=null;var o=Ee.p;Ee.p=2;var r=Se;Se|=4;try{I1(e,t.alternate,t)}finally{Se=r,Ee.p=o,de.T=n}}ot=3}}function aE(){if(ot===4||ot===3){ot=0,KP();var e=Zo,t=li,n=uo,o=j1;t.subtreeFlags&10256||t.flags&10256?ot=5:(ot=0,li=Zo=null,iE(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(qo=null),Wh(n),t=t.stateNode,Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(ds,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=de.T,r=Ee.p,Ee.p=2,de.T=null;try{for(var a=e.onRecoverableError,i=0;i<o.length;i++){var l=o[i];a(l.value,{componentStack:l.stack})}}finally{de.T=t,Ee.p=r}}uo&3&&Id(),Un(e),r=e.pendingLanes,n&261930&&r&42?e===zm?_l++:(_l=0,zm=e):_l=0,bs(0)}}function iE(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,gs(t)))}function Id(){return oE(),rE(),aE(),lE()}function lE(){if(ot!==5)return!1;var e=Zo,t=Om;Om=0;var n=Wh(uo),o=de.T,r=Ee.p;try{Ee.p=32>n?32:n,de.T=null,n=Pm,Pm=null;var a=Zo,i=uo;if(ot=0,li=Zo=null,uo=0,Se&6)throw Error(J(331));var l=Se;if(Se|=4,F1(a.current),V1(a,a.current,i,n),Se=l,bs(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(ds,a)}catch{}return!0}finally{Ee.p=r,de.T=o,iE(e,t)}}function K0(e,t,n){t=an(n,t),t=Rm(e.stateNode,t,2),e=jo(e,t,2),e!==null&&(ps(e,2),Un(e))}function Ne(e,t,n){if(e.tag===3)K0(e,e,n);else for(;t!==null;){if(t.tag===3){K0(t,e,n);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(qo===null||!qo.has(o))){e=an(n,e),n=S1(2),o=jo(t,n,2),o!==null&&(E1(n,o,t,e),ps(o,2),Un(o));break}}t=t.return}}function fp(e,t,n){var o=e.pingCache;if(o===null){o=e.pingCache=new b3;var r=new Set;o.set(t,r)}else r=o.get(t),r===void 0&&(r=new Set,o.set(t,r));r.has(n)||(Pg=!0,r.add(n),e=C3.bind(null,e,t,n),t.then(e,e))}function C3(e,t,n){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Me===e&&(ye&n)===n&&(Ke===4||Ke===3&&(ye&62914560)===ye&&300>Yt()-Od?!(Se&2)&&si(e,0):zg|=n,ii===ye&&(ii=0)),Un(e)}function sE(e,t){t===0&&(t=Jx()),e=oa(e,t),e!==null&&(ps(e,t),Un(e))}function N3(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sE(e,n)}function _3(e,t){var n=0;switch(e.tag){case 31:case 13:var o=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(J(314))}o!==null&&o.delete(t),sE(e,n)}function R3(e,t){return Zh(e,t)}var Nu=null,xa=null,Im=!1,_u=!1,pp=!1,Yo=0;function Un(e){e!==xa&&e.next===null&&(xa===null?Nu=xa=e:xa=xa.next=e),_u=!0,Im||(Im=!0,A3())}function bs(e,t){if(!pp&&_u){pp=!0;do for(var n=!1,o=Nu;o!==null;){if(e!==0){var r=o.pendingLanes;if(r===0)var a=0;else{var i=o.suspendedLanes,l=o.pingedLanes;a=(1<<31-Xt(42|e)+1)-1,a&=r&~(i&~l),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,j0(o,a))}else a=ye,a=xd(o,o===Me?a:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),!(a&3)||fs(o,a)||(n=!0,j0(o,a));o=o.next}while(n);pp=!1}}function T3(){cE()}function cE(){_u=Im=!1;var e=0;Yo!==0&&H3()&&(e=Yo);for(var t=Yt(),n=null,o=Nu;o!==null;){var r=o.next,a=uE(o,t);a===0?(o.next=null,n===null?Nu=r:n.next=r,r===null&&(xa=n)):(n=o,(e!==0||a&3)&&(_u=!0)),o=r}ot!==0&&ot!==5||bs(e),Yo!==0&&(Yo=0)}function uE(e,t){for(var n=e.suspendedLanes,o=e.pingedLanes,r=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var i=31-Xt(a),l=1<<i,s=r[i];s===-1?(!(l&n)||l&o)&&(r[i]=tz(l,t)):s<=t&&(e.expiredLanes|=l),a&=~l}if(t=Me,n=ye,n=xd(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,n===0||e===t&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Uf(o),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||fs(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(o!==null&&Uf(o),Wh(n)){case 2:case 8:n=Qx;break;case 32:n=su;break;case 268435456:n=Wx;break;default:n=su}return o=dE.bind(null,e),n=Zh(n,o),e.callbackPriority=t,e.callbackNode=n,t}return o!==null&&o!==null&&Uf(o),e.callbackPriority=2,e.callbackNode=null,2}function dE(e,t){if(ot!==0&&ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Id()&&e.callbackNode!==n)return null;var o=ye;return o=xd(e,e===Me?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Z1(e,o,t),uE(e,Yt()),e.callbackNode!=null&&e.callbackNode===n?dE.bind(null,e):null)}function j0(e,t){if(Id())return null;Z1(e,t,!0)}function A3(){U3(function(){Se&6?Zh(Zx,T3):cE()})}function Lg(){if(Yo===0){var e=oi;e===0&&(e=oc,oc<<=1,!(oc&261888)&&(oc=256)),Yo=e}return Yo}function q0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Lc(""+e)}function Z0(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function M3(e,t,n,o,r){if(t==="submit"&&n&&n.stateNode===r){var a=q0((r[Mt]||null).action),i=o.submitter;i&&(t=(t=i[Mt]||null)?q0(t.formAction):i.getAttribute("formAction"),t!==null&&(a=t,i=null));var l=new Sd("action","action",null,o,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Yo!==0){var s=i?Z0(r,i):new FormData(r);Nm(n,{pending:!0,data:s,method:r.method,action:a},null,s)}}else typeof a=="function"&&(l.preventDefault(),s=i?Z0(r,i):new FormData(r),Nm(n,{pending:!0,data:s,method:r.method,action:a},a,s))},currentTarget:r}]})}}for(var mp=0;mp<pm.length;mp++){var hp=pm[mp],D3=hp.toLowerCase(),O3=hp[0].toUpperCase()+hp.slice(1);Nn(D3,"on"+O3)}Nn(ES,"onAnimationEnd");Nn(CS,"onAnimationIteration");Nn(NS,"onAnimationStart");Nn("dblclick","onDoubleClick");Nn("focusin","onFocus");Nn("focusout","onBlur");Nn(jz,"onTransitionRun");Nn(qz,"onTransitionStart");Nn(Zz,"onTransitionCancel");Nn(_S,"onTransitionEnd");ti("onMouseEnter",["mouseout","mouseover"]);ti("onMouseLeave",["mouseout","mouseover"]);ti("onPointerEnter",["pointerout","pointerover"]);ti("onPointerLeave",["pointerout","pointerover"]);ea("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ea("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ea("onBeforeInput",["compositionend","keypress","textInput","paste"]);ea("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ea("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ea("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),P3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bl));function fE(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var o=e[n],r=o.event;o=o.listeners;e:{var a=void 0;if(t)for(var i=o.length-1;0<=i;i--){var l=o[i],s=l.instance,c=l.currentTarget;if(l=l.listener,s!==a&&r.isPropagationStopped())break e;a=l,r.currentTarget=c;try{a(r)}catch(f){uu(f)}r.currentTarget=null,a=s}else for(i=0;i<o.length;i++){if(l=o[i],s=l.instance,c=l.currentTarget,l=l.listener,s!==a&&r.isPropagationStopped())break e;a=l,r.currentTarget=c;try{a(r)}catch(f){uu(f)}r.currentTarget=null,a=s}}}}function ge(e,t){var n=t[am];n===void 0&&(n=t[am]=new Set);var o=e+"__bubble";n.has(o)||(pE(t,e,2,!1),n.add(o))}function gp(e,t,n){var o=0;t&&(o|=4),pE(n,e,o,t)}var pc="_reactListening"+Math.random().toString(36).slice(2);function kg(e){if(!e[pc]){e[pc]=!0,rS.forEach(function(n){n!=="selectionchange"&&(P3.has(n)||gp(n,!1,e),gp(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pc]||(t[pc]=!0,gp("selectionchange",!1,t))}}function pE(e,t,n,o){switch(_E(t)){case 2:var r=lI;break;case 8:r=sI;break;default:r=Ug}n=r.bind(null,t,n,e),r=void 0,!um||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),o?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function vp(e,t,n,o,r){var a=o;if(!(t&1)&&!(t&2)&&o!==null)e:for(;;){if(o===null)return;var i=o.tag;if(i===3||i===4){var l=o.stateNode.containerInfo;if(l===r)break;if(i===4)for(i=o.return;i!==null;){var s=i.tag;if((s===3||s===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;l!==null;){if(i=Ra(l),i===null)return;if(s=i.tag,s===5||s===6||s===26||s===27){o=a=i;continue e}l=l.parentNode}}o=o.return}fS(function(){var c=a,f=tg(n),u=[];e:{var d=RS.get(e);if(d!==void 0){var m=Sd,v=e;switch(e){case"keypress":if($c(n)===0)break e;case"keydown":case"keyup":m=_z;break;case"focusin":v="focus",m=Xf;break;case"focusout":v="blur",m=Xf;break;case"beforeblur":case"afterblur":m=Xf;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=r0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=mz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Az;break;case ES:case CS:case NS:m=vz;break;case _S:m=Dz;break;case"scroll":case"scrollend":m=fz;break;case"wheel":m=Pz;break;case"copy":case"cut":case"paste":m=bz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=i0;break;case"toggle":case"beforetoggle":m=Iz}var g=(t&4)!==0,x=!g&&(e==="scroll"||e==="scrollend"),h=g?d!==null?d+"Capture":null:d;g=[];for(var w=c,y;w!==null;){var S=w;if(y=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||y===null||h===null||(S=Ol(w,h),S!=null&&g.push(Ul(w,S,y))),x)break;w=w.return}0<g.length&&(d=new m(d,v,null,n,f),u.push({event:d,listeners:g}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",d&&n!==cm&&(v=n.relatedTarget||n.fromElement)&&(Ra(v)||v[Ni]))break e;if((m||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,m?(v=n.relatedTarget||n.toElement,m=c,v=v?Ra(v):null,v!==null&&(x=us(v),g=v.tag,v!==x||g!==5&&g!==27&&g!==6)&&(v=null)):(m=null,v=c),m!==v)){if(g=r0,S="onMouseLeave",h="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(g=i0,S="onPointerLeave",h="onPointerEnter",w="pointer"),x=m==null?d:ol(m),y=v==null?d:ol(v),d=new g(S,w+"leave",m,n,f),d.target=x,d.relatedTarget=y,S=null,Ra(f)===c&&(g=new g(h,w+"enter",v,n,f),g.target=y,g.relatedTarget=x,S=g),x=S,m&&v)t:{for(g=z3,h=m,w=v,y=0,S=h;S;S=g(S))y++;S=0;for(var E=w;E;E=g(E))S++;for(;0<y-S;)h=g(h),y--;for(;0<S-y;)w=g(w),S--;for(;y--;){if(h===w||w!==null&&h===w.alternate){g=h;break t}h=g(h),w=g(w)}g=null}else g=null;m!==null&&Q0(u,d,m,g,!1),v!==null&&x!==null&&Q0(u,x,v,g,!0)}}e:{if(d=c?ol(c):window,m=d.nodeName&&d.nodeName.toLowerCase(),m==="select"||m==="input"&&d.type==="file")var N=u0;else if(c0(d))if(yS)N=Fz;else{N=Gz;var C=Vz}else m=d.nodeName,!m||m.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?c&&eg(c.elementType)&&(N=u0):N=Yz;if(N&&(N=N(e,c))){vS(u,N,n,f);break e}C&&C(e,d,c),e==="focusout"&&c&&d.type==="number"&&c.memoizedProps.value!=null&&sm(d,"number",d.value)}switch(C=c?ol(c):window,e){case"focusin":(c0(C)||C.contentEditable==="true")&&(Ma=C,dm=c,vl=null);break;case"focusout":vl=dm=Ma=null;break;case"mousedown":fm=!0;break;case"contextmenu":case"mouseup":case"dragend":fm=!1,h0(u,n,f);break;case"selectionchange":if(Kz)break;case"keydown":case"keyup":h0(u,n,f)}var A;if(rg)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Aa?hS(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(mS&&n.locale!=="ko"&&(Aa||T!=="onCompositionStart"?T==="onCompositionEnd"&&Aa&&(A=pS()):(Uo=f,ng="value"in Uo?Uo.value:Uo.textContent,Aa=!0)),C=Ru(c,T),0<C.length&&(T=new a0(T,e,null,n,f),u.push({event:T,listeners:C}),A?T.data=A:(A=gS(n),A!==null&&(T.data=A)))),(A=kz?$z(e,n):Hz(e,n))&&(T=Ru(c,"onBeforeInput"),0<T.length&&(C=new a0("onBeforeInput","beforeinput",null,n,f),u.push({event:C,listeners:T}),C.data=A)),M3(u,e,c,n,f)}fE(u,t)})}function Ul(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ru(e,t){for(var n=t+"Capture",o=[];e!==null;){var r=e,a=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||a===null||(r=Ol(e,n),r!=null&&o.unshift(Ul(e,r,a)),r=Ol(e,t),r!=null&&o.push(Ul(e,r,a))),e.tag===3)return o;e=e.return}return[]}function z3(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Q0(e,t,n,o,r){for(var a=t._reactName,i=[];n!==null&&n!==o;){var l=n,s=l.alternate,c=l.stateNode;if(l=l.tag,s!==null&&s===o)break;l!==5&&l!==26&&l!==27||c===null||(s=c,r?(c=Ol(n,a),c!=null&&i.unshift(Ul(n,c,s))):r||(c=Ol(n,a),c!=null&&i.push(Ul(n,c,s)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var I3=/\r\n?/g,L3=/\u0000|\uFFFD/g;function W0(e){return(typeof e=="string"?e:""+e).replace(I3,`
49
- `).replace(L3,"")}function mE(e,t){return t=W0(t),W0(e)===t}function Re(e,t,n,o,r,a){switch(n){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||ni(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&ni(e,""+o);break;case"className":ic(e,"class",o);break;case"tabIndex":ic(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":ic(e,n,o);break;case"style":dS(e,o,a);break;case"data":if(t!=="object"){ic(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(n);break}o=Lc(""+o),e.setAttribute(n,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(t!=="input"&&Re(e,t,"name",r.name,r,null),Re(e,t,"formEncType",r.formEncType,r,null),Re(e,t,"formMethod",r.formMethod,r,null),Re(e,t,"formTarget",r.formTarget,r,null)):(Re(e,t,"encType",r.encType,r,null),Re(e,t,"method",r.method,r,null),Re(e,t,"target",r.target,r,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(n);break}o=Lc(""+o),e.setAttribute(n,o);break;case"onClick":o!=null&&(e.onclick=ao);break;case"onScroll":o!=null&&ge("scroll",e);break;case"onScrollEnd":o!=null&&ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(J(61));if(n=o.__html,n!=null){if(r.children!=null)throw Error(J(60));e.innerHTML=n}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}n=Lc(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(n,""+o):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":o===!0?e.setAttribute(n,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(n,o):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(n,o):e.removeAttribute(n);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(n):e.setAttribute(n,o);break;case"popover":ge("beforetoggle",e),ge("toggle",e),Ic(e,"popover",o);break;case"xlinkActuate":jn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":jn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":jn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":jn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":jn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":jn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":jn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":jn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":jn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Ic(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=uz.get(n)||n,Ic(e,n,o))}}function Lm(e,t,n,o,r,a){switch(n){case"style":dS(e,o,a);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(J(61));if(n=o.__html,n!=null){if(r.children!=null)throw Error(J(60));e.innerHTML=n}}break;case"children":typeof o=="string"?ni(e,o):(typeof o=="number"||typeof o=="bigint")&&ni(e,""+o);break;case"onScroll":o!=null&&ge("scroll",e);break;case"onScrollEnd":o!=null&&ge("scrollend",e);break;case"onClick":o!=null&&(e.onclick=ao);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!aS.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),a=e[Mt]||null,a=a!=null?a[n]:null,typeof a=="function"&&e.removeEventListener(t,a,r),typeof o=="function")){typeof a!="function"&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,o,r);break e}n in e?e[n]=o:o===!0?e.setAttribute(n,""):Ic(e,n,o)}}}function pt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ge("error",e),ge("load",e);var o=!1,r=!1,a;for(a in n)if(n.hasOwnProperty(a)){var i=n[a];if(i!=null)switch(a){case"src":o=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(J(137,t));default:Re(e,t,a,i,n,null)}}r&&Re(e,t,"srcSet",n.srcSet,n,null),o&&Re(e,t,"src",n.src,n,null);return;case"input":ge("invalid",e);var l=a=i=r=null,s=null,c=null;for(o in n)if(n.hasOwnProperty(o)){var f=n[o];if(f!=null)switch(o){case"name":r=f;break;case"type":i=f;break;case"checked":s=f;break;case"defaultChecked":c=f;break;case"value":a=f;break;case"defaultValue":l=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(J(137,t));break;default:Re(e,t,o,f,n,null)}}sS(e,a,l,s,c,i,r,!1);return;case"select":ge("invalid",e),o=i=a=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":a=l;break;case"defaultValue":i=l;break;case"multiple":o=l;default:Re(e,t,r,l,n,null)}t=a,n=i,e.multiple=!!o,t!=null?Ua(e,!!o,t,!1):n!=null&&Ua(e,!!o,n,!0);return;case"textarea":ge("invalid",e),a=r=o=null;for(i in n)if(n.hasOwnProperty(i)&&(l=n[i],l!=null))switch(i){case"value":o=l;break;case"defaultValue":r=l;break;case"children":a=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(J(91));break;default:Re(e,t,i,l,n,null)}uS(e,o,r,a);return;case"option":for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Re(e,t,s,o,n,null)}return;case"dialog":ge("beforetoggle",e),ge("toggle",e),ge("cancel",e),ge("close",e);break;case"iframe":case"object":ge("load",e);break;case"video":case"audio":for(o=0;o<Bl.length;o++)ge(Bl[o],e);break;case"image":ge("error",e),ge("load",e);break;case"details":ge("toggle",e);break;case"embed":case"source":case"link":ge("error",e),ge("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(o=n[c],o!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(J(137,t));default:Re(e,t,c,o,n,null)}return;default:if(eg(t)){for(f in n)n.hasOwnProperty(f)&&(o=n[f],o!==void 0&&Lm(e,t,f,o,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(o=n[l],o!=null&&Re(e,t,l,o,n,null))}function k3(e,t,n,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,a=null,i=null,l=null,s=null,c=null,f=null;for(m in n){var u=n[m];if(n.hasOwnProperty(m)&&u!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":s=u;default:o.hasOwnProperty(m)||Re(e,t,m,null,o,u)}}for(var d in o){var m=o[d];if(u=n[d],o.hasOwnProperty(d)&&(m!=null||u!=null))switch(d){case"type":a=m;break;case"name":r=m;break;case"checked":c=m;break;case"defaultChecked":f=m;break;case"value":i=m;break;case"defaultValue":l=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(J(137,t));break;default:m!==u&&Re(e,t,d,m,o,u)}}lm(e,i,l,s,c,f,a,r);return;case"select":m=i=l=d=null;for(a in n)if(s=n[a],n.hasOwnProperty(a)&&s!=null)switch(a){case"value":break;case"multiple":m=s;default:o.hasOwnProperty(a)||Re(e,t,a,null,o,s)}for(r in o)if(a=o[r],s=n[r],o.hasOwnProperty(r)&&(a!=null||s!=null))switch(r){case"value":d=a;break;case"defaultValue":l=a;break;case"multiple":i=a;default:a!==s&&Re(e,t,r,a,o,s)}t=l,n=i,o=m,d!=null?Ua(e,!!n,d,!1):!!o!=!!n&&(t!=null?Ua(e,!!n,t,!0):Ua(e,!!n,n?[]:"",!1));return;case"textarea":m=d=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!o.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Re(e,t,l,null,o,r)}for(i in o)if(r=o[i],a=n[i],o.hasOwnProperty(i)&&(r!=null||a!=null))switch(i){case"value":d=r;break;case"defaultValue":m=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(J(91));break;default:r!==a&&Re(e,t,i,r,o,a)}cS(e,d,m);return;case"option":for(var v in n)if(d=n[v],n.hasOwnProperty(v)&&d!=null&&!o.hasOwnProperty(v))switch(v){case"selected":e.selected=!1;break;default:Re(e,t,v,null,o,d)}for(s in o)if(d=o[s],m=n[s],o.hasOwnProperty(s)&&d!==m&&(d!=null||m!=null))switch(s){case"selected":e.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Re(e,t,s,d,o,m)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)d=n[g],n.hasOwnProperty(g)&&d!=null&&!o.hasOwnProperty(g)&&Re(e,t,g,null,o,d);for(c in o)if(d=o[c],m=n[c],o.hasOwnProperty(c)&&d!==m&&(d!=null||m!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(J(137,t));break;default:Re(e,t,c,d,o,m)}return;default:if(eg(t)){for(var x in n)d=n[x],n.hasOwnProperty(x)&&d!==void 0&&!o.hasOwnProperty(x)&&Lm(e,t,x,void 0,o,d);for(f in o)d=o[f],m=n[f],!o.hasOwnProperty(f)||d===m||d===void 0&&m===void 0||Lm(e,t,f,d,o,m);return}}for(var h in n)d=n[h],n.hasOwnProperty(h)&&d!=null&&!o.hasOwnProperty(h)&&Re(e,t,h,null,o,d);for(u in o)d=o[u],m=n[u],!o.hasOwnProperty(u)||d===m||d==null&&m==null||Re(e,t,u,d,o,m)}function J0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $3(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),o=0;o<n.length;o++){var r=n[o],a=r.transferSize,i=r.initiatorType,l=r.duration;if(a&&l&&J0(i)){for(i=0,l=r.responseEnd,o+=1;o<n.length;o++){var s=n[o],c=s.startTime;if(c>l)break;var f=s.transferSize,u=s.initiatorType;f&&J0(u)&&(s=s.responseEnd,i+=f*(s<l?1:(l-c)/(s-c)))}if(--o,t+=8*(a+i)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var km=null,$m=null;function Tu(e){return e.nodeType===9?e:e.ownerDocument}function eb(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hE(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Hm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var yp=null;function H3(){var e=window.event;return e&&e.type==="popstate"?e===yp?!1:(yp=e,!0):(yp=null,!1)}var gE=typeof setTimeout=="function"?setTimeout:void 0,B3=typeof clearTimeout=="function"?clearTimeout:void 0,tb=typeof Promise=="function"?Promise:void 0,U3=typeof queueMicrotask=="function"?queueMicrotask:typeof tb<"u"?function(e){return tb.resolve(null).then(e).catch(V3)}:gE;function V3(e){setTimeout(function(){throw e})}function ur(e){return e==="head"}function nb(e,t){var n=t,o=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(o===0){e.removeChild(r),ui(t);return}o--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")o++;else if(n==="html")Rl(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Rl(n);for(var a=n.firstChild;a;){var i=a.nextSibling,l=a.nodeName;a[ms]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=i}}else n==="body"&&Rl(e.ownerDocument.body);n=r}while(n);ui(t)}function ob(e,t){var n=e;e=0;do{var o=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=o}while(n)}function Bm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Bm(n),Jh(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function G3(e,t,n,o){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[ms])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(a!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=cn(e.nextSibling),e===null)break}return null}function Y3(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=cn(e.nextSibling),e===null))return null;return e}function vE(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=cn(e.nextSibling),e===null))return null;return e}function Um(e){return e.data==="$?"||e.data==="$~"}function Vm(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function F3(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var o=function(){t(),n.removeEventListener("DOMContentLoaded",o)};n.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function cn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Gm=null;function rb(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return cn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function ab(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function yE(e,t,n){switch(t=Tu(n),e){case"html":if(e=t.documentElement,!e)throw Error(J(452));return e;case"head":if(e=t.head,!e)throw Error(J(453));return e;case"body":if(e=t.body,!e)throw Error(J(454));return e;default:throw Error(J(451))}}function Rl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Jh(e)}var dn=new Map,ib=new Set;function Au(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var wo=Ee.d;Ee.d={f:X3,r:K3,D:j3,C:q3,L:Z3,m:Q3,X:J3,S:W3,M:eI};function X3(){var e=wo.f(),t=Pd();return e||t}function K3(e){var t=_i(e);t!==null&&t.tag===5&&t.type==="form"?d1(t):wo.r(e)}var Mi=typeof document>"u"?null:document;function bE(e,t,n){var o=Mi;if(o&&typeof t=="string"&&t){var r=rn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),ib.has(r)||(ib.add(r),e={rel:e,crossOrigin:n,href:t},o.querySelector(r)===null&&(t=o.createElement("link"),pt(t,"link",e),it(t),o.head.appendChild(t)))}}function j3(e){wo.D(e),bE("dns-prefetch",e,null)}function q3(e,t){wo.C(e,t),bE("preconnect",e,t)}function Z3(e,t,n){wo.L(e,t,n);var o=Mi;if(o&&e&&t){var r='link[rel="preload"][as="'+rn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+rn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+rn(n.imageSizes)+'"]')):r+='[href="'+rn(e)+'"]';var a=r;switch(t){case"style":a=ci(e);break;case"script":a=Di(e)}dn.has(a)||(e=$e({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),dn.set(a,e),o.querySelector(r)!==null||t==="style"&&o.querySelector(ws(a))||t==="script"&&o.querySelector(xs(a))||(t=o.createElement("link"),pt(t,"link",e),it(t),o.head.appendChild(t)))}}function Q3(e,t){wo.m(e,t);var n=Mi;if(n&&e){var o=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+rn(o)+'"][href="'+rn(e)+'"]',a=r;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Di(e)}if(!dn.has(a)&&(e=$e({rel:"modulepreload",href:e},t),dn.set(a,e),n.querySelector(r)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(xs(a)))return}o=n.createElement("link"),pt(o,"link",e),it(o),n.head.appendChild(o)}}}function W3(e,t,n){wo.S(e,t,n);var o=Mi;if(o&&e){var r=Ba(o).hoistableStyles,a=ci(e);t=t||"default";var i=r.get(a);if(!i){var l={loading:0,preload:null};if(i=o.querySelector(ws(a)))l.loading=5;else{e=$e({rel:"stylesheet",href:e,"data-precedence":t},n),(n=dn.get(a))&&$g(e,n);var s=i=o.createElement("link");it(s),pt(s,"link",e),s._p=new Promise(function(c,f){s.onload=c,s.onerror=f}),s.addEventListener("load",function(){l.loading|=1}),s.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Xc(i,t,o)}i={type:"stylesheet",instance:i,count:1,state:l},r.set(a,i)}}}function J3(e,t){wo.X(e,t);var n=Mi;if(n&&e){var o=Ba(n).hoistableScripts,r=Di(e),a=o.get(r);a||(a=n.querySelector(xs(r)),a||(e=$e({src:e,async:!0},t),(t=dn.get(r))&&Hg(e,t),a=n.createElement("script"),it(a),pt(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},o.set(r,a))}}function eI(e,t){wo.M(e,t);var n=Mi;if(n&&e){var o=Ba(n).hoistableScripts,r=Di(e),a=o.get(r);a||(a=n.querySelector(xs(r)),a||(e=$e({src:e,async:!0,type:"module"},t),(t=dn.get(r))&&Hg(e,t),a=n.createElement("script"),it(a),pt(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},o.set(r,a))}}function lb(e,t,n,o){var r=(r=Fo.current)?Au(r):null;if(!r)throw Error(J(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ci(n.href),n=Ba(r).hoistableStyles,o=n.get(t),o||(o={type:"style",instance:null,count:0,state:null},n.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ci(n.href);var a=Ba(r).hoistableStyles,i=a.get(e);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,i),(a=r.querySelector(ws(e)))&&!a._p&&(i.instance=a,i.state.loading=5),dn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},dn.set(e,n),a||tI(r,e,n,i.state))),t&&o===null)throw Error(J(528,""));return i}if(t&&o!==null)throw Error(J(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Di(n),n=Ba(r).hoistableScripts,o=n.get(t),o||(o={type:"script",instance:null,count:0,state:null},n.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(J(444,e))}}function ci(e){return'href="'+rn(e)+'"'}function ws(e){return'link[rel="stylesheet"]['+e+"]"}function wE(e){return $e({},e,{"data-precedence":e.precedence,precedence:null})}function tI(e,t,n,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),pt(t,"link",n),it(t),e.head.appendChild(t))}function Di(e){return'[src="'+rn(e)+'"]'}function xs(e){return"script[async]"+e}function sb(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+rn(n.href)+'"]');if(o)return t.instance=o,it(o),o;var r=$e({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),it(o),pt(o,"style",r),Xc(o,n.precedence,e),t.instance=o;case"stylesheet":r=ci(n.href);var a=e.querySelector(ws(r));if(a)return t.state.loading|=4,t.instance=a,it(a),a;o=wE(n),(r=dn.get(r))&&$g(o,r),a=(e.ownerDocument||e).createElement("link"),it(a);var i=a;return i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),pt(a,"link",o),t.state.loading|=4,Xc(a,n.precedence,e),t.instance=a;case"script":return a=Di(n.src),(r=e.querySelector(xs(a)))?(t.instance=r,it(r),r):(o=n,(r=dn.get(a))&&(o=$e({},n),Hg(o,r)),e=e.ownerDocument||e,r=e.createElement("script"),it(r),pt(r,"link",o),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(J(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(o=t.instance,t.state.loading|=4,Xc(o,n.precedence,e));return t.instance}function Xc(e,t,n){for(var o=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=o.length?o[o.length-1]:null,a=r,i=0;i<o.length;i++){var l=o[i];if(l.dataset.precedence===t)a=l;else if(a!==r)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function $g(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Hg(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Kc=null;function cb(e,t,n){if(Kc===null){var o=new Map,r=Kc=new Map;r.set(n,o)}else r=Kc,o=r.get(n),o||(o=new Map,r.set(n,o));if(o.has(e))return o;for(o.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var a=n[r];if(!(a[ms]||a[ut]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var i=a.getAttribute(t)||"";i=e+i;var l=o.get(i);l?l.push(a):o.set(i,[a])}}return o}function ub(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function nI(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function xE(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function oI(e,t,n,o){if(n.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=ci(o.href),a=t.querySelector(ws(r));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Mu.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,it(a);return}a=t.ownerDocument||t,o=wE(o),(r=dn.get(r))&&$g(o,r),a=a.createElement("link"),it(a);var i=a;i._p=new Promise(function(l,s){i.onload=l,i.onerror=s}),pt(a,"link",o),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Mu.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var bp=0;function rI(e,t){return e.stylesheets&&e.count===0&&jc(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var o=setTimeout(function(){if(e.stylesheets&&jc(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&bp===0&&(bp=62500*$3());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&jc(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>bp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(r)}}:null}function Mu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Du=null;function jc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Du=new Map,t.forEach(aI,e),Du=null,Mu.call(e))}function aI(e,t){if(!(t.state.loading&4)){var n=Du.get(e);if(n)var o=n.get(null);else{n=new Map,Du.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var i=r[a];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),o=i)}o&&n.set(null,o)}r=t.instance,i=r.getAttribute("data-precedence"),a=n.get(i)||o,a===o&&n.set(null,r),n.set(i,r),this.count++,o=Mu.bind(this),r.addEventListener("load",o),r.addEventListener("error",o),a?a.parentNode.insertBefore(r,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Vl={$$typeof:ro,Provider:null,Consumer:null,_currentValue:Mr,_currentValue2:Mr,_threadCount:0};function iI(e,t,n,o,r,a,i,l,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Vf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vf(0),this.hiddenUpdates=Vf(null),this.identifierPrefix=o,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function SE(e,t,n,o,r,a,i,l,s,c,f,u){return e=new iI(e,t,n,i,s,c,f,u,l),t=1,a===!0&&(t|=24),a=Bt(3,null,null,t),e.current=a,a.stateNode=e,t=dg(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:o,isDehydrated:n,cache:t},mg(a),e}function EE(e){return e?(e=Pa,e):Pa}function CE(e,t,n,o,r,a){r=EE(r),o.context===null?o.context=r:o.pendingContext=r,o=Ko(t),o.payload={element:n},a=a===void 0?null:a,a!==null&&(o.callback=a),n=jo(e,o,t),n!==null&&(At(n,e,t),bl(n,e,t))}function db(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Bg(e,t){db(e,t),(e=e.alternate)&&db(e,t)}function NE(e){if(e.tag===13||e.tag===31){var t=oa(e,67108864);t!==null&&At(t,e,67108864),Bg(e,67108864)}}function fb(e){if(e.tag===13||e.tag===31){var t=Kt();t=Qh(t);var n=oa(e,t);n!==null&&At(n,e,t),Bg(e,t)}}var Ou=!0;function lI(e,t,n,o){var r=de.T;de.T=null;var a=Ee.p;try{Ee.p=2,Ug(e,t,n,o)}finally{Ee.p=a,de.T=r}}function sI(e,t,n,o){var r=de.T;de.T=null;var a=Ee.p;try{Ee.p=8,Ug(e,t,n,o)}finally{Ee.p=a,de.T=r}}function Ug(e,t,n,o){if(Ou){var r=Ym(o);if(r===null)vp(e,t,o,Pu,n),pb(e,o);else if(uI(r,e,t,n,o))o.stopPropagation();else if(pb(e,o),t&4&&-1<cI.indexOf(e)){for(;r!==null;){var a=_i(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var i=Nr(a.pendingLanes);if(i!==0){var l=a;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var s=1<<31-Xt(i);l.entanglements[1]|=s,i&=~s}Un(a),!(Se&6)&&(Su=Yt()+500,bs(0))}}break;case 31:case 13:l=oa(a,2),l!==null&&At(l,a,2),Pd(),Bg(a,2)}if(a=Ym(o),a===null&&vp(e,t,o,Pu,n),a===r)break;r=a}r!==null&&o.stopPropagation()}else vp(e,t,o,null,n)}}function Ym(e){return e=tg(e),Vg(e)}var Pu=null;function Vg(e){if(Pu=null,e=Ra(e),e!==null){var t=us(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=Fx(t),e!==null)return e;e=null}else if(n===31){if(e=Xx(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Pu=e,null}function _E(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(jP()){case Zx:return 2;case Qx:return 8;case su:case qP:return 32;case Wx:return 268435456;default:return 32}default:return 32}}var Fm=!1,Qo=null,Wo=null,Jo=null,Gl=new Map,Yl=new Map,$o=[],cI="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function pb(e,t){switch(e){case"focusin":case"focusout":Qo=null;break;case"dragenter":case"dragleave":Wo=null;break;case"mouseover":case"mouseout":Jo=null;break;case"pointerover":case"pointerout":Gl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yl.delete(t.pointerId)}}function ji(e,t,n,o,r,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:o,nativeEvent:a,targetContainers:[r]},t!==null&&(t=_i(t),t!==null&&NE(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function uI(e,t,n,o,r){switch(t){case"focusin":return Qo=ji(Qo,e,t,n,o,r),!0;case"dragenter":return Wo=ji(Wo,e,t,n,o,r),!0;case"mouseover":return Jo=ji(Jo,e,t,n,o,r),!0;case"pointerover":var a=r.pointerId;return Gl.set(a,ji(Gl.get(a)||null,e,t,n,o,r)),!0;case"gotpointercapture":return a=r.pointerId,Yl.set(a,ji(Yl.get(a)||null,e,t,n,o,r)),!0}return!1}function RE(e){var t=Ra(e.target);if(t!==null){var n=us(t);if(n!==null){if(t=n.tag,t===13){if(t=Fx(n),t!==null){e.blockedOn=t,Qy(e.priority,function(){fb(n)});return}}else if(t===31){if(t=Xx(n),t!==null){e.blockedOn=t,Qy(e.priority,function(){fb(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function qc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ym(e.nativeEvent);if(n===null){n=e.nativeEvent;var o=new n.constructor(n.type,n);cm=o,n.target.dispatchEvent(o),cm=null}else return t=_i(n),t!==null&&NE(t),e.blockedOn=n,!1;t.shift()}return!0}function mb(e,t,n){qc(e)&&n.delete(t)}function dI(){Fm=!1,Qo!==null&&qc(Qo)&&(Qo=null),Wo!==null&&qc(Wo)&&(Wo=null),Jo!==null&&qc(Jo)&&(Jo=null),Gl.forEach(mb),Yl.forEach(mb)}function mc(e,t){e.blockedOn===t&&(e.blockedOn=null,Fm||(Fm=!0,rt.unstable_scheduleCallback(rt.unstable_NormalPriority,dI)))}var hc=null;function hb(e){hc!==e&&(hc=e,rt.unstable_scheduleCallback(rt.unstable_NormalPriority,function(){hc===e&&(hc=null);for(var t=0;t<e.length;t+=3){var n=e[t],o=e[t+1],r=e[t+2];if(typeof o!="function"){if(Vg(o||n)===null)continue;break}var a=_i(n);a!==null&&(e.splice(t,3),t-=3,Nm(a,{pending:!0,data:r,method:n.method,action:o},o,r))}}))}function ui(e){function t(s){return mc(s,e)}Qo!==null&&mc(Qo,e),Wo!==null&&mc(Wo,e),Jo!==null&&mc(Jo,e),Gl.forEach(t),Yl.forEach(t);for(var n=0;n<$o.length;n++){var o=$o[n];o.blockedOn===e&&(o.blockedOn=null)}for(;0<$o.length&&(n=$o[0],n.blockedOn===null);)RE(n),n.blockedOn===null&&$o.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(o=0;o<n.length;o+=3){var r=n[o],a=n[o+1],i=r[Mt]||null;if(typeof a=="function")i||hb(n);else if(i){var l=null;if(a&&a.hasAttribute("formAction")){if(r=a,i=a[Mt]||null)l=i.formAction;else if(Vg(r)!==null)continue}else l=i.action;typeof l=="function"?n[o+1]=l:(n.splice(o,3),o-=3),hb(n)}}}function TE(){function e(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(i){return r=i})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),o||setTimeout(n,20)}function n(){if(!o&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Gg(e){this._internalRoot=e}Ld.prototype.render=Gg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));var n=t.current,o=Kt();CE(n,o,e,t,null,null)};Ld.prototype.unmount=Gg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;CE(e.current,2,null,e,null,null),Pd(),t[Ni]=null}};function Ld(e){this._internalRoot=e}Ld.prototype.unstable_scheduleHydration=function(e){if(e){var t=oS();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$o.length&&t!==0&&t<$o[n].priority;n++);$o.splice(n,0,e),n===0&&RE(e)}};var gb=Gx.version;if(gb!=="19.2.0")throw Error(J(527,gb,"19.2.0"));Ee.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(J(188)):(e=Object.keys(e).join(","),Error(J(268,e)));return e=UP(t),e=e!==null?Kx(e):null,e=e===null?null:e.stateNode,e};var fI={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:de,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gc.isDisabled&&gc.supportsFiber)try{ds=gc.inject(fI),Ft=gc}catch{}}bd.createRoot=function(e,t){if(!Yx(e))throw Error(J(299));var n=!1,o="",r=b1,a=w1,i=x1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=SE(e,1,!1,null,null,n,o,null,r,a,i,TE),e[Ni]=t.current,kg(e),new Gg(t)};bd.hydrateRoot=function(e,t,n){if(!Yx(e))throw Error(J(299));var o=!1,r="",a=b1,i=w1,l=x1,s=null;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(s=n.formState)),t=SE(e,1,!0,t,n??null,o,r,s,a,i,l,TE),t.context=EE(null),n=t.current,o=Kt(),o=Qh(o),r=Ko(o),r.callback=null,jo(n,r,o),n=o,t.current.lanes=n,ps(t,n),Un(t),e[Ni]=t.current,kg(e),new Ld(t)};bd.version="19.2.0";function AE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(AE)}catch(e){console.error(e)}}AE(),Lx.exports=bd;var pI=Lx.exports;function tt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=tt(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var mI={value:()=>{}};function kd(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Zc(n)}function Zc(e){this._=e}function hI(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Zc.prototype=kd.prototype={constructor:Zc,on:function(e,t){var n=this._,o=hI(e+"",n),r,a=-1,i=o.length;if(arguments.length<2){for(;++a<i;)if((r=(e=o[a]).type)&&(r=gI(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<i;)if(r=(e=o[a]).type)n[r]=vb(n[r],e.name,t);else if(t==null)for(r in n)n[r]=vb(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Zc(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,a;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],o=0,r=a.length;o<r;++o)a[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,a=o.length;r<a;++r)o[r].value.apply(t,n)}};function gI(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function vb(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=mI,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Xm="http://www.w3.org/1999/xhtml";const yb={svg:"http://www.w3.org/2000/svg",xhtml:Xm,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $d(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),yb.hasOwnProperty(t)?{space:yb[t],local:e}:e}function vI(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Xm&&t.documentElement.namespaceURI===Xm?t.createElement(e):t.createElementNS(n,e)}}function yI(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ME(e){var t=$d(e);return(t.local?yI:vI)(t)}function bI(){}function Yg(e){return e==null?bI:function(){return this.querySelector(e)}}function wI(e){typeof e!="function"&&(e=Yg(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a=t[r],i=a.length,l=o[r]=new Array(i),s,c,f=0;f<i;++f)(s=a[f])&&(c=e.call(s,s.__data__,f,a))&&("__data__"in s&&(c.__data__=s.__data__),l[f]=c);return new Qt(o,this._parents)}function xI(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function SI(){return[]}function DE(e){return e==null?SI:function(){return this.querySelectorAll(e)}}function EI(e){return function(){return xI(e.apply(this,arguments))}}function CI(e){typeof e=="function"?e=EI(e):e=DE(e);for(var t=this._groups,n=t.length,o=[],r=[],a=0;a<n;++a)for(var i=t[a],l=i.length,s,c=0;c<l;++c)(s=i[c])&&(o.push(e.call(s,s.__data__,c,i)),r.push(s));return new Qt(o,r)}function OE(e){return function(){return this.matches(e)}}function PE(e){return function(t){return t.matches(e)}}var NI=Array.prototype.find;function _I(e){return function(){return NI.call(this.children,e)}}function RI(){return this.firstElementChild}function TI(e){return this.select(e==null?RI:_I(typeof e=="function"?e:PE(e)))}var AI=Array.prototype.filter;function MI(){return Array.from(this.children)}function DI(e){return function(){return AI.call(this.children,e)}}function OI(e){return this.selectAll(e==null?MI:DI(typeof e=="function"?e:PE(e)))}function PI(e){typeof e!="function"&&(e=OE(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a=t[r],i=a.length,l=o[r]=[],s,c=0;c<i;++c)(s=a[c])&&e.call(s,s.__data__,c,a)&&l.push(s);return new Qt(o,this._parents)}function zE(e){return new Array(e.length)}function zI(){return new Qt(this._enter||this._groups.map(zE),this._parents)}function zu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}zu.prototype={constructor:zu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function II(e){return function(){return e}}function LI(e,t,n,o,r,a){for(var i=0,l,s=t.length,c=a.length;i<c;++i)(l=t[i])?(l.__data__=a[i],o[i]=l):n[i]=new zu(e,a[i]);for(;i<s;++i)(l=t[i])&&(r[i]=l)}function kI(e,t,n,o,r,a,i){var l,s,c=new Map,f=t.length,u=a.length,d=new Array(f),m;for(l=0;l<f;++l)(s=t[l])&&(d[l]=m=i.call(s,s.__data__,l,t)+"",c.has(m)?r[l]=s:c.set(m,s));for(l=0;l<u;++l)m=i.call(e,a[l],l,a)+"",(s=c.get(m))?(o[l]=s,s.__data__=a[l],c.delete(m)):n[l]=new zu(e,a[l]);for(l=0;l<f;++l)(s=t[l])&&c.get(d[l])===s&&(r[l]=s)}function $I(e){return e.__data__}function HI(e,t){if(!arguments.length)return Array.from(this,$I);var n=t?kI:LI,o=this._parents,r=this._groups;typeof e!="function"&&(e=II(e));for(var a=r.length,i=new Array(a),l=new Array(a),s=new Array(a),c=0;c<a;++c){var f=o[c],u=r[c],d=u.length,m=BI(e.call(f,f&&f.__data__,c,o)),v=m.length,g=l[c]=new Array(v),x=i[c]=new Array(v),h=s[c]=new Array(d);n(f,u,g,x,h,m,t);for(var w=0,y=0,S,E;w<v;++w)if(S=g[w]){for(w>=y&&(y=w+1);!(E=x[y])&&++y<v;);S._next=E||null}}return i=new Qt(i,o),i._enter=l,i._exit=s,i}function BI(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function UI(){return new Qt(this._exit||this._groups.map(zE),this._parents)}function VI(e,t,n){var o=this.enter(),r=this,a=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?a.remove():n(a),o&&r?o.merge(r).order():r}function GI(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,a=o.length,i=Math.min(r,a),l=new Array(r),s=0;s<i;++s)for(var c=n[s],f=o[s],u=c.length,d=l[s]=new Array(u),m,v=0;v<u;++v)(m=c[v]||f[v])&&(d[v]=m);for(;s<r;++s)l[s]=n[s];return new Qt(l,this._parents)}function YI(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,a=o[r],i;--r>=0;)(i=o[r])&&(a&&i.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(i,a),a=i);return this}function FI(e){e||(e=XI);function t(u,d){return u&&d?e(u.__data__,d.__data__):!u-!d}for(var n=this._groups,o=n.length,r=new Array(o),a=0;a<o;++a){for(var i=n[a],l=i.length,s=r[a]=new Array(l),c,f=0;f<l;++f)(c=i[f])&&(s[f]=c);s.sort(t)}return new Qt(r,this._parents).order()}function XI(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function KI(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function jI(){return Array.from(this)}function qI(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,a=o.length;r<a;++r){var i=o[r];if(i)return i}return null}function ZI(){let e=0;for(const t of this)++e;return e}function QI(){return!this.node()}function WI(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],a=0,i=r.length,l;a<i;++a)(l=r[a])&&e.call(l,l.__data__,a,r);return this}function JI(e){return function(){this.removeAttribute(e)}}function eL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tL(e,t){return function(){this.setAttribute(e,t)}}function nL(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function oL(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function rL(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function aL(e,t){var n=$d(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?eL:JI:typeof t=="function"?n.local?rL:oL:n.local?nL:tL)(n,t))}function IE(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function iL(e){return function(){this.style.removeProperty(e)}}function lL(e,t,n){return function(){this.style.setProperty(e,t,n)}}function sL(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function cL(e,t,n){return arguments.length>1?this.each((t==null?iL:typeof t=="function"?sL:lL)(e,t,n??"")):di(this.node(),e)}function di(e,t){return e.style.getPropertyValue(t)||IE(e).getComputedStyle(e,null).getPropertyValue(t)}function uL(e){return function(){delete this[e]}}function dL(e,t){return function(){this[e]=t}}function fL(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function pL(e,t){return arguments.length>1?this.each((t==null?uL:typeof t=="function"?fL:dL)(e,t)):this.node()[e]}function LE(e){return e.trim().split(/^|\s+/)}function Fg(e){return e.classList||new kE(e)}function kE(e){this._node=e,this._names=LE(e.getAttribute("class")||"")}kE.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function $E(e,t){for(var n=Fg(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function HE(e,t){for(var n=Fg(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function mL(e){return function(){$E(this,e)}}function hL(e){return function(){HE(this,e)}}function gL(e,t){return function(){(t.apply(this,arguments)?$E:HE)(this,e)}}function vL(e,t){var n=LE(e+"");if(arguments.length<2){for(var o=Fg(this.node()),r=-1,a=n.length;++r<a;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?gL:t?mL:hL)(n,t))}function yL(){this.textContent=""}function bL(e){return function(){this.textContent=e}}function wL(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function xL(e){return arguments.length?this.each(e==null?yL:(typeof e=="function"?wL:bL)(e)):this.node().textContent}function SL(){this.innerHTML=""}function EL(e){return function(){this.innerHTML=e}}function CL(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function NL(e){return arguments.length?this.each(e==null?SL:(typeof e=="function"?CL:EL)(e)):this.node().innerHTML}function _L(){this.nextSibling&&this.parentNode.appendChild(this)}function RL(){return this.each(_L)}function TL(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function AL(){return this.each(TL)}function ML(e){var t=typeof e=="function"?e:ME(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function DL(){return null}function OL(e,t){var n=typeof e=="function"?e:ME(e),o=t==null?DL:typeof t=="function"?t:Yg(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function PL(){var e=this.parentNode;e&&e.removeChild(this)}function zL(){return this.each(PL)}function IL(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function LL(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kL(e){return this.select(e?LL:IL)}function $L(e){return arguments.length?this.property("__data__",e):this.node().__data__}function HL(e){return function(t){e.call(this,t,this.__data__)}}function BL(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function UL(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,a;n<r;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++o]=a;++o?t.length=o:delete this.__on}}}function VL(e,t,n){return function(){var o=this.__on,r,a=HL(t);if(o){for(var i=0,l=o.length;i<l;++i)if((r=o[i]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),r.value=t;return}}this.addEventListener(e.type,a,n),r={type:e.type,name:e.name,value:t,listener:a,options:n},o?o.push(r):this.__on=[r]}}function GL(e,t,n){var o=BL(e+""),r,a=o.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var s=0,c=l.length,f;s<c;++s)for(r=0,f=l[s];r<a;++r)if((i=o[r]).type===f.type&&i.name===f.name)return f.value}return}for(l=t?VL:UL,r=0;r<a;++r)this.each(l(o[r],t,n));return this}function BE(e,t,n){var o=IE(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function YL(e,t){return function(){return BE(this,e,t)}}function FL(e,t){return function(){return BE(this,e,t.apply(this,arguments))}}function XL(e,t){return this.each((typeof t=="function"?FL:YL)(e,t))}function*KL(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,a=o.length,i;r<a;++r)(i=o[r])&&(yield i)}var UE=[null];function Qt(e,t){this._groups=e,this._parents=t}function Ss(){return new Qt([[document.documentElement]],UE)}function jL(){return this}Qt.prototype=Ss.prototype={constructor:Qt,select:wI,selectAll:CI,selectChild:TI,selectChildren:OI,filter:PI,data:HI,enter:zI,exit:UI,join:VI,merge:GI,selection:jL,order:YI,sort:FI,call:KI,nodes:jI,node:qI,size:ZI,empty:QI,each:WI,attr:aL,style:cL,property:pL,classed:vL,text:xL,html:NL,raise:RL,lower:AL,append:ML,insert:OL,remove:zL,clone:kL,datum:$L,on:GL,dispatch:XL,[Symbol.iterator]:KL};function Ut(e){return typeof e=="string"?new Qt([[document.querySelector(e)]],[document.documentElement]):new Qt([[e]],UE)}function qL(e){let t;for(;t=e.sourceEvent;)e=t;return e}function vn(e,t){if(e=qL(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const ZL={passive:!1},Fl={capture:!0,passive:!1};function wp(e){e.stopImmediatePropagation()}function Ka(e){e.preventDefault(),e.stopImmediatePropagation()}function VE(e){var t=e.document.documentElement,n=Ut(e).on("dragstart.drag",Ka,Fl);"onselectstart"in t?n.on("selectstart.drag",Ka,Fl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function GE(e,t){var n=e.document.documentElement,o=Ut(e).on("dragstart.drag",null);t&&(o.on("click.drag",Ka,Fl),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const vc=e=>()=>e;function Km(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:a,x:i,y:l,dx:s,dy:c,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:f}})}Km.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function QL(e){return!e.ctrlKey&&!e.button}function WL(){return this.parentNode}function JL(e,t){return t??{x:e.x,y:e.y}}function e5(){return navigator.maxTouchPoints||"ontouchstart"in this}function YE(){var e=QL,t=WL,n=JL,o=e5,r={},a=kd("start","drag","end"),i=0,l,s,c,f,u=0;function d(S){S.on("mousedown.drag",m).filter(o).on("touchstart.drag",x).on("touchmove.drag",h,ZL).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(S,E){if(!(f||!e.call(this,S,E))){var N=y(this,t.call(this,S,E),S,E,"mouse");N&&(Ut(S.view).on("mousemove.drag",v,Fl).on("mouseup.drag",g,Fl),VE(S.view),wp(S),c=!1,l=S.clientX,s=S.clientY,N("start",S))}}function v(S){if(Ka(S),!c){var E=S.clientX-l,N=S.clientY-s;c=E*E+N*N>u}r.mouse("drag",S)}function g(S){Ut(S.view).on("mousemove.drag mouseup.drag",null),GE(S.view,c),Ka(S),r.mouse("end",S)}function x(S,E){if(e.call(this,S,E)){var N=S.changedTouches,C=t.call(this,S,E),A=N.length,T,k;for(T=0;T<A;++T)(k=y(this,C,S,E,N[T].identifier,N[T]))&&(wp(S),k("start",S,N[T]))}}function h(S){var E=S.changedTouches,N=E.length,C,A;for(C=0;C<N;++C)(A=r[E[C].identifier])&&(Ka(S),A("drag",S,E[C]))}function w(S){var E=S.changedTouches,N=E.length,C,A;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),C=0;C<N;++C)(A=r[E[C].identifier])&&(wp(S),A("end",S,E[C]))}function y(S,E,N,C,A,T){var k=a.copy(),z=vn(T||N,E),O,P,_;if((_=n.call(S,new Km("beforestart",{sourceEvent:N,target:d,identifier:A,active:i,x:z[0],y:z[1],dx:0,dy:0,dispatch:k}),C))!=null)return O=_.x-z[0]||0,P=_.y-z[1]||0,function L(R,I,D){var M=z,U;switch(R){case"start":r[A]=L,U=i++;break;case"end":delete r[A],--i;case"drag":z=vn(D||I,E),U=i;break}k.call(R,S,new Km(R,{sourceEvent:I,subject:_,target:d,identifier:A,active:U,x:z[0]+O,y:z[1]+P,dx:z[0]-M[0],dy:z[1]-M[1],dispatch:k}),C)}}return d.filter=function(S){return arguments.length?(e=typeof S=="function"?S:vc(!!S),d):e},d.container=function(S){return arguments.length?(t=typeof S=="function"?S:vc(S),d):t},d.subject=function(S){return arguments.length?(n=typeof S=="function"?S:vc(S),d):n},d.touchable=function(S){return arguments.length?(o=typeof S=="function"?S:vc(!!S),d):o},d.on=function(){var S=a.on.apply(a,arguments);return S===a?d:S},d.clickDistance=function(S){return arguments.length?(u=(S=+S)*S,d):Math.sqrt(u)},d}function Xg(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function FE(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Es(){}var Xl=.7,Iu=1/Xl,ja="\\s*([+-]?\\d+)\\s*",Kl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",kn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",t5=/^#([0-9a-f]{3,8})$/,n5=new RegExp(`^rgb\\(${ja},${ja},${ja}\\)$`),o5=new RegExp(`^rgb\\(${kn},${kn},${kn}\\)$`),r5=new RegExp(`^rgba\\(${ja},${ja},${ja},${Kl}\\)$`),a5=new RegExp(`^rgba\\(${kn},${kn},${kn},${Kl}\\)$`),i5=new RegExp(`^hsl\\(${Kl},${kn},${kn}\\)$`),l5=new RegExp(`^hsla\\(${Kl},${kn},${kn},${Kl}\\)$`),bb={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Xg(Es,Vr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wb,formatHex:wb,formatHex8:s5,formatHsl:c5,formatRgb:xb,toString:xb});function wb(){return this.rgb().formatHex()}function s5(){return this.rgb().formatHex8()}function c5(){return XE(this).formatHsl()}function xb(){return this.rgb().formatRgb()}function Vr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=t5.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Sb(t):n===3?new Tt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?yc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?yc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=n5.exec(e))?new Tt(t[1],t[2],t[3],1):(t=o5.exec(e))?new Tt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=r5.exec(e))?yc(t[1],t[2],t[3],t[4]):(t=a5.exec(e))?yc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=i5.exec(e))?Nb(t[1],t[2]/100,t[3]/100,1):(t=l5.exec(e))?Nb(t[1],t[2]/100,t[3]/100,t[4]):bb.hasOwnProperty(e)?Sb(bb[e]):e==="transparent"?new Tt(NaN,NaN,NaN,0):null}function Sb(e){return new Tt(e>>16&255,e>>8&255,e&255,1)}function yc(e,t,n,o){return o<=0&&(e=t=n=NaN),new Tt(e,t,n,o)}function u5(e){return e instanceof Es||(e=Vr(e)),e?(e=e.rgb(),new Tt(e.r,e.g,e.b,e.opacity)):new Tt}function jm(e,t,n,o){return arguments.length===1?u5(e):new Tt(e,t,n,o??1)}function Tt(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Xg(Tt,jm,FE(Es,{brighter(e){return e=e==null?Iu:Math.pow(Iu,e),new Tt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Xl:Math.pow(Xl,e),new Tt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Tt(Ir(this.r),Ir(this.g),Ir(this.b),Lu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Eb,formatHex:Eb,formatHex8:d5,formatRgb:Cb,toString:Cb}));function Eb(){return`#${Ar(this.r)}${Ar(this.g)}${Ar(this.b)}`}function d5(){return`#${Ar(this.r)}${Ar(this.g)}${Ar(this.b)}${Ar((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cb(){const e=Lu(this.opacity);return`${e===1?"rgb(":"rgba("}${Ir(this.r)}, ${Ir(this.g)}, ${Ir(this.b)}${e===1?")":`, ${e})`}`}function Lu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ir(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ar(e){return e=Ir(e),(e<16?"0":"")+e.toString(16)}function Nb(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new yn(e,t,n,o)}function XE(e){if(e instanceof yn)return new yn(e.h,e.s,e.l,e.opacity);if(e instanceof Es||(e=Vr(e)),!e)return new yn;if(e instanceof yn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),a=Math.max(t,n,o),i=NaN,l=a-r,s=(a+r)/2;return l?(t===a?i=(n-o)/l+(n<o)*6:n===a?i=(o-t)/l+2:i=(t-n)/l+4,l/=s<.5?a+r:2-a-r,i*=60):l=s>0&&s<1?0:i,new yn(i,l,s,e.opacity)}function f5(e,t,n,o){return arguments.length===1?XE(e):new yn(e,t,n,o??1)}function yn(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Xg(yn,f5,FE(Es,{brighter(e){return e=e==null?Iu:Math.pow(Iu,e),new yn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Xl:Math.pow(Xl,e),new yn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new Tt(xp(e>=240?e-240:e+120,r,o),xp(e,r,o),xp(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new yn(_b(this.h),bc(this.s),bc(this.l),Lu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Lu(this.opacity);return`${e===1?"hsl(":"hsla("}${_b(this.h)}, ${bc(this.s)*100}%, ${bc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _b(e){return e=(e||0)%360,e<0?e+360:e}function bc(e){return Math.max(0,Math.min(1,e||0))}function xp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Kg=e=>()=>e;function p5(e,t){return function(n){return e+n*t}}function m5(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function h5(e){return(e=+e)==1?KE:function(t,n){return n-t?m5(t,n,e):Kg(isNaN(t)?n:t)}}function KE(e,t){var n=t-e;return n?p5(e,n):Kg(isNaN(e)?t:e)}const ku=function e(t){var n=h5(t);function o(r,a){var i=n((r=jm(r)).r,(a=jm(a)).r),l=n(r.g,a.g),s=n(r.b,a.b),c=KE(r.opacity,a.opacity);return function(f){return r.r=i(f),r.g=l(f),r.b=s(f),r.opacity=c(f),r+""}}return o.gamma=e,o}(1);function g5(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(a){for(r=0;r<n;++r)o[r]=e[r]*(1-a)+t[r]*a;return o}}function v5(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function y5(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),a=new Array(n),i;for(i=0;i<o;++i)r[i]=Tl(e[i],t[i]);for(;i<n;++i)a[i]=t[i];return function(l){for(i=0;i<o;++i)a[i]=r[i](l);return a}}function b5(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function An(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function w5(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Tl(e[r],t[r]):o[r]=t[r];return function(a){for(r in n)o[r]=n[r](a);return o}}var qm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Sp=new RegExp(qm.source,"g");function x5(e){return function(){return e}}function S5(e){return function(t){return e(t)+""}}function jE(e,t){var n=qm.lastIndex=Sp.lastIndex=0,o,r,a,i=-1,l=[],s=[];for(e=e+"",t=t+"";(o=qm.exec(e))&&(r=Sp.exec(t));)(a=r.index)>n&&(a=t.slice(n,a),l[i]?l[i]+=a:l[++i]=a),(o=o[0])===(r=r[0])?l[i]?l[i]+=r:l[++i]=r:(l[++i]=null,s.push({i,x:An(o,r)})),n=Sp.lastIndex;return n<t.length&&(a=t.slice(n),l[i]?l[i]+=a:l[++i]=a),l.length<2?s[0]?S5(s[0].x):x5(t):(t=s.length,function(c){for(var f=0,u;f<t;++f)l[(u=s[f]).i]=u.x(c);return l.join("")})}function Tl(e,t){var n=typeof t,o;return t==null||n==="boolean"?Kg(t):(n==="number"?An:n==="string"?(o=Vr(t))?(t=o,ku):jE:t instanceof Vr?ku:t instanceof Date?b5:v5(t)?g5:Array.isArray(t)?y5:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?w5:An)(e,t)}var Rb=180/Math.PI,Zm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function qE(e,t,n,o,r,a){var i,l,s;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(s=e*n+t*o)&&(n-=e*s,o-=t*s),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,s/=l),e*o<t*n&&(e=-e,t=-t,s=-s,i=-i),{translateX:r,translateY:a,rotate:Math.atan2(t,e)*Rb,skewX:Math.atan(s)*Rb,scaleX:i,scaleY:l}}var wc;function E5(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Zm:qE(t.a,t.b,t.c,t.d,t.e,t.f)}function C5(e){return e==null||(wc||(wc=document.createElementNS("http://www.w3.org/2000/svg","g")),wc.setAttribute("transform",e),!(e=wc.transform.baseVal.consolidate()))?Zm:(e=e.matrix,qE(e.a,e.b,e.c,e.d,e.e,e.f))}function ZE(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function a(c,f,u,d,m,v){if(c!==u||f!==d){var g=m.push("translate(",null,t,null,n);v.push({i:g-4,x:An(c,u)},{i:g-2,x:An(f,d)})}else(u||d)&&m.push("translate("+u+t+d+n)}function i(c,f,u,d){c!==f?(c-f>180?f+=360:f-c>180&&(c+=360),d.push({i:u.push(r(u)+"rotate(",null,o)-2,x:An(c,f)})):f&&u.push(r(u)+"rotate("+f+o)}function l(c,f,u,d){c!==f?d.push({i:u.push(r(u)+"skewX(",null,o)-2,x:An(c,f)}):f&&u.push(r(u)+"skewX("+f+o)}function s(c,f,u,d,m,v){if(c!==u||f!==d){var g=m.push(r(m)+"scale(",null,",",null,")");v.push({i:g-4,x:An(c,u)},{i:g-2,x:An(f,d)})}else(u!==1||d!==1)&&m.push(r(m)+"scale("+u+","+d+")")}return function(c,f){var u=[],d=[];return c=e(c),f=e(f),a(c.translateX,c.translateY,f.translateX,f.translateY,u,d),i(c.rotate,f.rotate,u,d),l(c.skewX,f.skewX,u,d),s(c.scaleX,c.scaleY,f.scaleX,f.scaleY,u,d),c=f=null,function(m){for(var v=-1,g=d.length,x;++v<g;)u[(x=d[v]).i]=x.x(m);return u.join("")}}}var N5=ZE(E5,"px, ","px)","deg)"),_5=ZE(C5,", ",")",")"),R5=1e-12;function Tb(e){return((e=Math.exp(e))+1/e)/2}function T5(e){return((e=Math.exp(e))-1/e)/2}function A5(e){return((e=Math.exp(2*e))-1)/(e+1)}const Qc=function e(t,n,o){function r(a,i){var l=a[0],s=a[1],c=a[2],f=i[0],u=i[1],d=i[2],m=f-l,v=u-s,g=m*m+v*v,x,h;if(g<R5)h=Math.log(d/c)/t,x=function(C){return[l+C*m,s+C*v,c*Math.exp(t*C*h)]};else{var w=Math.sqrt(g),y=(d*d-c*c+o*g)/(2*c*n*w),S=(d*d-c*c-o*g)/(2*d*n*w),E=Math.log(Math.sqrt(y*y+1)-y),N=Math.log(Math.sqrt(S*S+1)-S);h=(N-E)/t,x=function(C){var A=C*h,T=Tb(E),k=c/(n*w)*(T*A5(t*A+E)-T5(E));return[l+k*m,s+k*v,c*T/Tb(t*A+E)]}}return x.duration=h*1e3*t/Math.SQRT2,x}return r.rho=function(a){var i=Math.max(.001,+a),l=i*i,s=l*l;return e(i,l,s)},r}(Math.SQRT2,2,4);var fi=0,il=0,qi=0,QE=1e3,$u,ll,Hu=0,Gr=0,Hd=0,jl=typeof performance=="object"&&performance.now?performance:Date,WE=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function jg(){return Gr||(WE(M5),Gr=jl.now()+Hd)}function M5(){Gr=0}function Bu(){this._call=this._time=this._next=null}Bu.prototype=JE.prototype={constructor:Bu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?jg():+n)+(t==null?0:+t),!this._next&&ll!==this&&(ll?ll._next=this:$u=this,ll=this),this._call=e,this._time=n,Qm()},stop:function(){this._call&&(this._call=null,this._time=1/0,Qm())}};function JE(e,t,n){var o=new Bu;return o.restart(e,t,n),o}function D5(){jg(),++fi;for(var e=$u,t;e;)(t=Gr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fi}function Ab(){Gr=(Hu=jl.now())+Hd,fi=il=0;try{D5()}finally{fi=0,P5(),Gr=0}}function O5(){var e=jl.now(),t=e-Hu;t>QE&&(Hd-=t,Hu=e)}function P5(){for(var e,t=$u,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$u=n);ll=e,Qm(o)}function Qm(e){if(!fi){il&&(il=clearTimeout(il));var t=e-Gr;t>24?(e<1/0&&(il=setTimeout(Ab,e-jl.now()-Hd)),qi&&(qi=clearInterval(qi))):(qi||(Hu=jl.now(),qi=setInterval(O5,QE)),fi=1,WE(Ab))}}function Mb(e,t,n){var o=new Bu;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var z5=kd("start","end","cancel","interrupt"),I5=[],eC=0,Db=1,Wm=2,Wc=3,Ob=4,Jm=5,Jc=6;function Bd(e,t,n,o,r,a){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;L5(e,n,{name:t,index:o,group:r,on:z5,tween:I5,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:eC})}function qg(e,t){var n=_n(e,t);if(n.state>eC)throw new Error("too late; already scheduled");return n}function Vn(e,t){var n=_n(e,t);if(n.state>Wc)throw new Error("too late; already running");return n}function _n(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function L5(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=JE(a,0,n.time);function a(c){n.state=Db,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var f,u,d,m;if(n.state!==Db)return s();for(f in o)if(m=o[f],m.name===n.name){if(m.state===Wc)return Mb(i);m.state===Ob?(m.state=Jc,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete o[f]):+f<t&&(m.state=Jc,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete o[f])}if(Mb(function(){n.state===Wc&&(n.state=Ob,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Wm,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Wm){for(n.state=Wc,r=new Array(d=n.tween.length),f=0,u=-1;f<d;++f)(m=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=m);r.length=u+1}}function l(c){for(var f=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(s),n.state=Jm,1),u=-1,d=r.length;++u<d;)r[u].call(e,f);n.state===Jm&&(n.on.call("end",e,e.__data__,n.index,n.group),s())}function s(){n.state=Jc,n.timer.stop(),delete o[t];for(var c in o)return;delete e.__transition}}function eu(e,t){var n=e.__transition,o,r,a=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((o=n[i]).name!==t){a=!1;continue}r=o.state>Wm&&o.state<Jm,o.state=Jc,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[i]}a&&delete e.__transition}}function k5(e){return this.each(function(){eu(this,e)})}function $5(e,t){var n,o;return function(){var r=Vn(this,e),a=r.tween;if(a!==n){o=n=a;for(var i=0,l=o.length;i<l;++i)if(o[i].name===t){o=o.slice(),o.splice(i,1);break}}r.tween=o}}function H5(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var a=Vn(this,e),i=a.tween;if(i!==o){r=(o=i).slice();for(var l={name:t,value:n},s=0,c=r.length;s<c;++s)if(r[s].name===t){r[s]=l;break}s===c&&r.push(l)}a.tween=r}}function B5(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=_n(this.node(),n).tween,r=0,a=o.length,i;r<a;++r)if((i=o[r]).name===e)return i.value;return null}return this.each((t==null?$5:H5)(n,e,t))}function Zg(e,t,n){var o=e._id;return e.each(function(){var r=Vn(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return _n(r,o).value[t]}}function tC(e,t){var n;return(typeof t=="number"?An:t instanceof Vr?ku:(n=Vr(t))?(t=n,ku):jE)(e,t)}function U5(e){return function(){this.removeAttribute(e)}}function V5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function G5(e,t,n){var o,r=n+"",a;return function(){var i=this.getAttribute(e);return i===r?null:i===o?a:a=t(o=i,n)}}function Y5(e,t,n){var o,r=n+"",a;return function(){var i=this.getAttributeNS(e.space,e.local);return i===r?null:i===o?a:a=t(o=i,n)}}function F5(e,t,n){var o,r,a;return function(){var i,l=n(this),s;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),s=l+"",i===s?null:i===o&&s===r?a:(r=s,a=t(o=i,l)))}}function X5(e,t,n){var o,r,a;return function(){var i,l=n(this),s;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),s=l+"",i===s?null:i===o&&s===r?a:(r=s,a=t(o=i,l)))}}function K5(e,t){var n=$d(e),o=n==="transform"?_5:tC;return this.attrTween(e,typeof t=="function"?(n.local?X5:F5)(n,o,Zg(this,"attr."+e,t)):t==null?(n.local?V5:U5)(n):(n.local?Y5:G5)(n,o,t))}function j5(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function q5(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Z5(e,t){var n,o;function r(){var a=t.apply(this,arguments);return a!==o&&(n=(o=a)&&q5(e,a)),n}return r._value=t,r}function Q5(e,t){var n,o;function r(){var a=t.apply(this,arguments);return a!==o&&(n=(o=a)&&j5(e,a)),n}return r._value=t,r}function W5(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=$d(e);return this.tween(n,(o.local?Z5:Q5)(o,t))}function J5(e,t){return function(){qg(this,e).delay=+t.apply(this,arguments)}}function ek(e,t){return t=+t,function(){qg(this,e).delay=t}}function tk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?J5:ek)(t,e)):_n(this.node(),t).delay}function nk(e,t){return function(){Vn(this,e).duration=+t.apply(this,arguments)}}function ok(e,t){return t=+t,function(){Vn(this,e).duration=t}}function rk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?nk:ok)(t,e)):_n(this.node(),t).duration}function ak(e,t){if(typeof t!="function")throw new Error;return function(){Vn(this,e).ease=t}}function ik(e){var t=this._id;return arguments.length?this.each(ak(t,e)):_n(this.node(),t).ease}function lk(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Vn(this,e).ease=n}}function sk(e){if(typeof e!="function")throw new Error;return this.each(lk(this._id,e))}function ck(e){typeof e!="function"&&(e=OE(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a=t[r],i=a.length,l=o[r]=[],s,c=0;c<i;++c)(s=a[c])&&e.call(s,s.__data__,c,a)&&l.push(s);return new vo(o,this._parents,this._name,this._id)}function uk(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,a=Math.min(o,r),i=new Array(o),l=0;l<a;++l)for(var s=t[l],c=n[l],f=s.length,u=i[l]=new Array(f),d,m=0;m<f;++m)(d=s[m]||c[m])&&(u[m]=d);for(;l<o;++l)i[l]=t[l];return new vo(i,this._parents,this._name,this._id)}function dk(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function fk(e,t,n){var o,r,a=dk(t)?qg:Vn;return function(){var i=a(this,e),l=i.on;l!==o&&(r=(o=l).copy()).on(t,n),i.on=r}}function pk(e,t){var n=this._id;return arguments.length<2?_n(this.node(),n).on.on(e):this.each(fk(n,e,t))}function mk(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function hk(){return this.on("end.remove",mk(this._id))}function gk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Yg(e));for(var o=this._groups,r=o.length,a=new Array(r),i=0;i<r;++i)for(var l=o[i],s=l.length,c=a[i]=new Array(s),f,u,d=0;d<s;++d)(f=l[d])&&(u=e.call(f,f.__data__,d,l))&&("__data__"in f&&(u.__data__=f.__data__),c[d]=u,Bd(c[d],t,n,d,c,_n(f,n)));return new vo(a,this._parents,t,n)}function vk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=DE(e));for(var o=this._groups,r=o.length,a=[],i=[],l=0;l<r;++l)for(var s=o[l],c=s.length,f,u=0;u<c;++u)if(f=s[u]){for(var d=e.call(f,f.__data__,u,s),m,v=_n(f,n),g=0,x=d.length;g<x;++g)(m=d[g])&&Bd(m,t,n,g,d,v);a.push(d),i.push(f)}return new vo(a,i,t,n)}var yk=Ss.prototype.constructor;function bk(){return new yk(this._groups,this._parents)}function wk(e,t){var n,o,r;return function(){var a=di(this,e),i=(this.style.removeProperty(e),di(this,e));return a===i?null:a===n&&i===o?r:r=t(n=a,o=i)}}function nC(e){return function(){this.style.removeProperty(e)}}function xk(e,t,n){var o,r=n+"",a;return function(){var i=di(this,e);return i===r?null:i===o?a:a=t(o=i,n)}}function Sk(e,t,n){var o,r,a;return function(){var i=di(this,e),l=n(this),s=l+"";return l==null&&(s=l=(this.style.removeProperty(e),di(this,e))),i===s?null:i===o&&s===r?a:(r=s,a=t(o=i,l))}}function Ek(e,t){var n,o,r,a="style."+t,i="end."+a,l;return function(){var s=Vn(this,e),c=s.on,f=s.value[a]==null?l||(l=nC(t)):void 0;(c!==n||r!==f)&&(o=(n=c).copy()).on(i,r=f),s.on=o}}function Ck(e,t,n){var o=(e+="")=="transform"?N5:tC;return t==null?this.styleTween(e,wk(e,o)).on("end.style."+e,nC(e)):typeof t=="function"?this.styleTween(e,Sk(e,o,Zg(this,"style."+e,t))).each(Ek(this._id,e)):this.styleTween(e,xk(e,o,t),n).on("end.style."+e,null)}function Nk(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function _k(e,t,n){var o,r;function a(){var i=t.apply(this,arguments);return i!==r&&(o=(r=i)&&Nk(e,i,n)),o}return a._value=t,a}function Rk(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,_k(e,t,n??""))}function Tk(e){return function(){this.textContent=e}}function Ak(e){return function(){var t=e(this);this.textContent=t??""}}function Mk(e){return this.tween("text",typeof e=="function"?Ak(Zg(this,"text",e)):Tk(e==null?"":e+""))}function Dk(e){return function(t){this.textContent=e.call(this,t)}}function Ok(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Dk(r)),t}return o._value=e,o}function Pk(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Ok(e))}function zk(){for(var e=this._name,t=this._id,n=oC(),o=this._groups,r=o.length,a=0;a<r;++a)for(var i=o[a],l=i.length,s,c=0;c<l;++c)if(s=i[c]){var f=_n(s,t);Bd(s,e,n,c,i,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new vo(o,this._parents,e,n)}function Ik(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(a,i){var l={value:i},s={value:function(){--r===0&&a()}};n.each(function(){var c=Vn(this,o),f=c.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(s)),c.on=t}),r===0&&a()})}var Lk=0;function vo(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function oC(){return++Lk}var Wn=Ss.prototype;vo.prototype={constructor:vo,select:gk,selectAll:vk,selectChild:Wn.selectChild,selectChildren:Wn.selectChildren,filter:ck,merge:uk,selection:bk,transition:zk,call:Wn.call,nodes:Wn.nodes,node:Wn.node,size:Wn.size,empty:Wn.empty,each:Wn.each,on:pk,attr:K5,attrTween:W5,style:Ck,styleTween:Rk,text:Mk,textTween:Pk,remove:hk,tween:B5,delay:tk,duration:rk,ease:ik,easeVarying:sk,end:Ik,[Symbol.iterator]:Wn[Symbol.iterator]};function kk(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $k={time:null,delay:0,duration:250,ease:kk};function Hk(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Bk(e){var t,n;e instanceof vo?(t=e._id,e=e._name):(t=oC(),(n=$k).time=jg(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,a=0;a<r;++a)for(var i=o[a],l=i.length,s,c=0;c<l;++c)(s=i[c])&&Bd(s,e,t,c,i,n||Hk(s,t));return new vo(o,this._parents,e,t)}Ss.prototype.interrupt=k5;Ss.prototype.transition=Bk;const xc=e=>()=>e;function Uk(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function lo(e,t,n){this.k=e,this.x=t,this.y=n}lo.prototype={constructor:lo,scale:function(e){return e===1?this:new lo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new lo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ud=new lo(1,0,0);rC.prototype=lo.prototype;function rC(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ud;return e.__zoom}function Ep(e){e.stopImmediatePropagation()}function Zi(e){e.preventDefault(),e.stopImmediatePropagation()}function Vk(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Gk(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Pb(){return this.__zoom||Ud}function Yk(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Fk(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xk(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}function aC(){var e=Vk,t=Gk,n=Xk,o=Yk,r=Fk,a=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,s=Qc,c=kd("start","zoom","end"),f,u,d,m=500,v=150,g=0,x=10;function h(_){_.property("__zoom",Pb).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",k).filter(r).on("touchstart.zoom",z).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",P).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}h.transform=function(_,L,R,I){var D=_.selection?_.selection():_;D.property("__zoom",Pb),_!==D?E(_,L,R,I):D.interrupt().each(function(){N(this,arguments).event(I).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},h.scaleBy=function(_,L,R,I){h.scaleTo(_,function(){var D=this.__zoom.k,M=typeof L=="function"?L.apply(this,arguments):L;return D*M},R,I)},h.scaleTo=function(_,L,R,I){h.transform(_,function(){var D=t.apply(this,arguments),M=this.__zoom,U=R==null?S(D):typeof R=="function"?R.apply(this,arguments):R,F=M.invert(U),$=typeof L=="function"?L.apply(this,arguments):L;return n(y(w(M,$),U,F),D,i)},R,I)},h.translateBy=function(_,L,R,I){h.transform(_,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),i)},null,I)},h.translateTo=function(_,L,R,I,D){h.transform(_,function(){var M=t.apply(this,arguments),U=this.__zoom,F=I==null?S(M):typeof I=="function"?I.apply(this,arguments):I;return n(Ud.translate(F[0],F[1]).scale(U.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof R=="function"?-R.apply(this,arguments):-R),M,i)},I,D)};function w(_,L){return L=Math.max(a[0],Math.min(a[1],L)),L===_.k?_:new lo(L,_.x,_.y)}function y(_,L,R){var I=L[0]-R[0]*_.k,D=L[1]-R[1]*_.k;return I===_.x&&D===_.y?_:new lo(_.k,I,D)}function S(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function E(_,L,R,I){_.on("start.zoom",function(){N(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(I).end()}).tween("zoom",function(){var D=this,M=arguments,U=N(D,M).event(I),F=t.apply(D,M),$=R==null?S(F):typeof R=="function"?R.apply(D,M):R,H=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),V=D.__zoom,Y=typeof L=="function"?L.apply(D,M):L,q=s(V.invert($).concat(H/V.k),Y.invert($).concat(H/Y.k));return function(B){if(B===1)B=Y;else{var G=q(B),Z=H/G[2];B=new lo(Z,$[0]-G[0]*Z,$[1]-G[1]*Z)}U.zoom(null,B)}})}function N(_,L,R){return!R&&_.__zooming||new C(_,L)}function C(_,L){this.that=_,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,L),this.taps=0}C.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,L){return this.mouse&&_!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var L=Ut(this.that).datum();c.call(_,this.that,new Uk(_,{sourceEvent:this.sourceEvent,target:h,transform:this.that.__zoom,dispatch:c}),L)}};function A(_,...L){if(!e.apply(this,arguments))return;var R=N(this,L).event(_),I=this.__zoom,D=Math.max(a[0],Math.min(a[1],I.k*Math.pow(2,o.apply(this,arguments)))),M=vn(_);if(R.wheel)(R.mouse[0][0]!==M[0]||R.mouse[0][1]!==M[1])&&(R.mouse[1]=I.invert(R.mouse[0]=M)),clearTimeout(R.wheel);else{if(I.k===D)return;R.mouse=[M,I.invert(M)],eu(this),R.start()}Zi(_),R.wheel=setTimeout(U,v),R.zoom("mouse",n(y(w(I,D),R.mouse[0],R.mouse[1]),R.extent,i));function U(){R.wheel=null,R.end()}}function T(_,...L){if(d||!e.apply(this,arguments))return;var R=_.currentTarget,I=N(this,L,!0).event(_),D=Ut(_.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",H,!0),M=vn(_,R),U=_.clientX,F=_.clientY;VE(_.view),Ep(_),I.mouse=[M,this.__zoom.invert(M)],eu(this),I.start();function $(V){if(Zi(V),!I.moved){var Y=V.clientX-U,q=V.clientY-F;I.moved=Y*Y+q*q>g}I.event(V).zoom("mouse",n(y(I.that.__zoom,I.mouse[0]=vn(V,R),I.mouse[1]),I.extent,i))}function H(V){D.on("mousemove.zoom mouseup.zoom",null),GE(V.view,I.moved),Zi(V),I.event(V).end()}}function k(_,...L){if(e.apply(this,arguments)){var R=this.__zoom,I=vn(_.changedTouches?_.changedTouches[0]:_,this),D=R.invert(I),M=R.k*(_.shiftKey?.5:2),U=n(y(w(R,M),I,D),t.apply(this,L),i);Zi(_),l>0?Ut(this).transition().duration(l).call(E,U,I,_):Ut(this).call(h.transform,U,I,_)}}function z(_,...L){if(e.apply(this,arguments)){var R=_.touches,I=R.length,D=N(this,L,_.changedTouches.length===I).event(_),M,U,F,$;for(Ep(_),U=0;U<I;++U)F=R[U],$=vn(F,this),$=[$,this.__zoom.invert($),F.identifier],D.touch0?!D.touch1&&D.touch0[2]!==$[2]&&(D.touch1=$,D.taps=0):(D.touch0=$,M=!0,D.taps=1+!!f);f&&(f=clearTimeout(f)),M&&(D.taps<2&&(u=$[0],f=setTimeout(function(){f=null},m)),eu(this),D.start())}}function O(_,...L){if(this.__zooming){var R=N(this,L).event(_),I=_.changedTouches,D=I.length,M,U,F,$;for(Zi(_),M=0;M<D;++M)U=I[M],F=vn(U,this),R.touch0&&R.touch0[2]===U.identifier?R.touch0[0]=F:R.touch1&&R.touch1[2]===U.identifier&&(R.touch1[0]=F);if(U=R.that.__zoom,R.touch1){var H=R.touch0[0],V=R.touch0[1],Y=R.touch1[0],q=R.touch1[1],B=(B=Y[0]-H[0])*B+(B=Y[1]-H[1])*B,G=(G=q[0]-V[0])*G+(G=q[1]-V[1])*G;U=w(U,Math.sqrt(B/G)),F=[(H[0]+Y[0])/2,(H[1]+Y[1])/2],$=[(V[0]+q[0])/2,(V[1]+q[1])/2]}else if(R.touch0)F=R.touch0[0],$=R.touch0[1];else return;R.zoom("touch",n(y(U,F,$),R.extent,i))}}function P(_,...L){if(this.__zooming){var R=N(this,L).event(_),I=_.changedTouches,D=I.length,M,U;for(Ep(_),d&&clearTimeout(d),d=setTimeout(function(){d=null},m),M=0;M<D;++M)U=I[M],R.touch0&&R.touch0[2]===U.identifier?delete R.touch0:R.touch1&&R.touch1[2]===U.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(U=vn(U,this),Math.hypot(u[0]-U[0],u[1]-U[1])<x)){var F=Ut(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return h.wheelDelta=function(_){return arguments.length?(o=typeof _=="function"?_:xc(+_),h):o},h.filter=function(_){return arguments.length?(e=typeof _=="function"?_:xc(!!_),h):e},h.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:xc(!!_),h):r},h.extent=function(_){return arguments.length?(t=typeof _=="function"?_:xc([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),h):t},h.scaleExtent=function(_){return arguments.length?(a[0]=+_[0],a[1]=+_[1],h):[a[0],a[1]]},h.translateExtent=function(_){return arguments.length?(i[0][0]=+_[0][0],i[1][0]=+_[1][0],i[0][1]=+_[0][1],i[1][1]=+_[1][1],h):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},h.constrain=function(_){return arguments.length?(n=_,h):n},h.duration=function(_){return arguments.length?(l=+_,h):l},h.interpolate=function(_){return arguments.length?(s=_,h):s},h.on=function(){var _=c.on.apply(c,arguments);return _===c?h:_},h.clickDistance=function(_){return arguments.length?(g=(_=+_)*_,h):Math.sqrt(g)},h.tapDistance=function(_){return arguments.length?(x=+_,h):x},h}const Hn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ql=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],iC=["Enter"," ","Escape"],lC={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Yr;(function(e){e.Strict="strict",e.Loose="loose"})(Yr||(Yr={}));var Lr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Lr||(Lr={}));var Zl;(function(e){e.Partial="partial",e.Full="full"})(Zl||(Zl={}));const sC={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ho;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ho||(Ho={}));var Uu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Uu||(Uu={}));var se;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(se||(se={}));const zb={[se.Left]:se.Right,[se.Right]:se.Left,[se.Top]:se.Bottom,[se.Bottom]:se.Top};function cC(e){return e===null?null:e?"valid":"invalid"}const uC=e=>"id"in e&&"source"in e&&"target"in e,Kk=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Qg=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Cs=(e,t=[0,0])=>{const{width:n,height:o}=xo(e),r=e.origin??t,a=n*r[0],i=o*r[1];return{x:e.position.x-a,y:e.position.y-i}},jk=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,r)=>{const a=typeof r=="string";let i=!t.nodeLookup&&!a?r:void 0;t.nodeLookup&&(i=a?t.nodeLookup.get(r):Qg(r)?r:t.nodeLookup.get(r.id));const l=i?Vu(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Vd(o,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Gd(n)},Ns=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=Vd(n,Vu(r)),o=!0)}),o?Gd(n):{x:0,y:0,width:0,height:0}},Wg=(e,t,[n,o,r]=[0,0,1],a=!1,i=!1)=>{const l={...Rs(t,[n,o,r]),width:t.width/r,height:t.height/r},s=[];for(const c of e.values()){const{measured:f,selectable:u=!0,hidden:d=!1}=c;if(i&&!u||d)continue;const m=f.width??c.width??c.initialWidth??null,v=f.height??c.height??c.initialHeight??null,g=Ql(l,mi(c)),x=(m??0)*(v??0),h=a&&g>0;(!c.internals.handleBounds||h||g>=x||c.dragging)&&s.push(c)}return s},qk=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function Zk(e,t){const n=new Map,o=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function Qk({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:a},i){if(e.size===0)return Promise.resolve(!0);const l=Zk(e,i),s=Ns(l),c=Jg(s,t,n,(i==null?void 0:i.minZoom)??r,(i==null?void 0:i.maxZoom)??a,(i==null?void 0:i.padding)??.1);return await o.setViewport(c,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)}function dC({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:a}){const i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:s,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},f=i.origin??o;let u=i.extent||r;if(i.extent==="parent"&&!i.expandParent)if(!l)a==null||a("005",Hn.error005());else{const m=l.measured.width,v=l.measured.height;m&&v&&(u=[[s,c],[s+m,c+v]])}else l&&hi(i.extent)&&(u=[[i.extent[0][0]+s,i.extent[0][1]+c],[i.extent[1][0]+s,i.extent[1][1]+c]]);const d=hi(u)?Fr(t,u,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&(a==null||a("015",Hn.error015())),{position:{x:d.x-s+(i.measured.width??0)*f[0],y:d.y-c+(i.measured.height??0)*f[1]},positionAbsolute:d}}async function Wk({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const a=new Set(e.map(d=>d.id)),i=[];for(const d of n){if(d.deletable===!1)continue;const m=a.has(d.id),v=!m&&d.parentId&&i.find(g=>g.id===d.parentId);(m||v)&&i.push(d)}const l=new Set(t.map(d=>d.id)),s=o.filter(d=>d.deletable!==!1),f=qk(i,s);for(const d of s)l.has(d.id)&&!f.find(v=>v.id===d.id)&&f.push(d);if(!r)return{edges:f,nodes:i};const u=await r({nodes:i,edges:f});return typeof u=="boolean"?u?{edges:f,nodes:i}:{edges:[],nodes:[]}:u}const pi=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Fr=(e={x:0,y:0},t,n)=>({x:pi(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:pi(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function fC(e,t,n){const{width:o,height:r}=xo(n),{x:a,y:i}=n.internals.positionAbsolute;return Fr(e,[[a,i],[a+o,i+r]],t)}const Ib=(e,t,n)=>e<t?pi(Math.abs(e-t),1,t)/t:e>n?-pi(Math.abs(e-n),1,t)/t:0,pC=(e,t,n=15,o=40)=>{const r=Ib(e.x,o,t.width-o)*n,a=Ib(e.y,o,t.height-o)*n;return[r,a]},Vd=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),eh=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),Gd=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),mi=(e,t=[0,0])=>{var r,a;const{x:n,y:o}=Qg(e)?e.internals.positionAbsolute:Cs(e,t);return{x:n,y:o,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},Vu=(e,t=[0,0])=>{var r,a;const{x:n,y:o}=Qg(e)?e.internals.positionAbsolute:Cs(e,t);return{x:n,y:o,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:o+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},mC=(e,t)=>Gd(Vd(eh(e),eh(t))),Ql=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Lb=e=>bn(e.width)&&bn(e.height)&&bn(e.x)&&bn(e.y),bn=e=>!isNaN(e)&&isFinite(e),Jk=(e,t)=>{},_s=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Rs=({x:e,y:t},[n,o,r],a=!1,i=[1,1])=>{const l={x:(e-n)/r,y:(t-o)/r};return a?_s(l,i):l},Gu=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function ma(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function e4(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=ma(e,n),r=ma(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=ma(e.top??e.y??0,n),r=ma(e.bottom??e.y??0,n),a=ma(e.left??e.x??0,t),i=ma(e.right??e.x??0,t);return{top:o,right:i,bottom:r,left:a,x:a+i,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function t4(e,t,n,o,r,a){const{x:i,y:l}=Gu(e,[t,n,o]),{x:s,y:c}=Gu({x:e.x+e.width,y:e.y+e.height},[t,n,o]),f=r-s,u=a-c;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(f),bottom:Math.floor(u)}}const Jg=(e,t,n,o,r,a)=>{const i=e4(a,t,n),l=(t-i.x)/e.width,s=(n-i.y)/e.height,c=Math.min(l,s),f=pi(c,o,r),u=e.x+e.width/2,d=e.y+e.height/2,m=t/2-u*f,v=n/2-d*f,g=t4(e,m,v,f,t,n),x={left:Math.min(g.left-i.left,0),top:Math.min(g.top-i.top,0),right:Math.min(g.right-i.right,0),bottom:Math.min(g.bottom-i.bottom,0)};return{x:m-x.left+x.right,y:v-x.top+x.bottom,zoom:f}},Wl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function hi(e){return e!=null&&e!=="parent"}function xo(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function hC(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function gC(e,t={width:0,height:0},n,o,r){const a={...e},i=o.get(n);if(i){const l=i.origin||r;a.x+=i.internals.positionAbsolute.x-(t.width??0)*l[0],a.y+=i.internals.positionAbsolute.y-(t.height??0)*l[1]}return a}function kb(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function n4(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function o4(e){return{...lC,...e||{}}}function Al(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:a,y:i}=wn(e),l=Rs({x:a-((r==null?void 0:r.left)??0),y:i-((r==null?void 0:r.top)??0)},o),{x:s,y:c}=n?_s(l,t):l;return{xSnapped:s,ySnapped:c,...l}}const ev=e=>({width:e.offsetWidth,height:e.offsetHeight}),vC=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},r4=["INPUT","SELECT","TEXTAREA"];function yC(e){var o,r;const t=((r=(o=e.composedPath)==null?void 0:o.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:r4.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const bC=e=>"clientX"in e,wn=(e,t)=>{var a,i;const n=bC(e),o=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,r=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:o-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},$b=(e,t,n,o,r)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(i=>{const l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:r,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...ev(i)}})};function wC({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:a,targetControlX:i,targetControlY:l}){const s=e*.125+r*.375+i*.375+n*.125,c=t*.125+a*.375+l*.375+o*.125,f=Math.abs(s-e),u=Math.abs(c-t);return[s,c,f,u]}function Sc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Hb({pos:e,x1:t,y1:n,x2:o,y2:r,c:a}){switch(e){case se.Left:return[t-Sc(t-o,a),n];case se.Right:return[t+Sc(o-t,a),n];case se.Top:return[t,n-Sc(n-r,a)];case se.Bottom:return[t,n+Sc(r-n,a)]}}function xC({sourceX:e,sourceY:t,sourcePosition:n=se.Bottom,targetX:o,targetY:r,targetPosition:a=se.Top,curvature:i=.25}){const[l,s]=Hb({pos:n,x1:e,y1:t,x2:o,y2:r,c:i}),[c,f]=Hb({pos:a,x1:o,y1:r,x2:e,y2:t,c:i}),[u,d,m,v]=wC({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:l,sourceControlY:s,targetControlX:c,targetControlY:f});return[`M${e},${t} C${l},${s} ${c},${f} ${o},${r}`,u,d,m,v]}function SC({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,a=n<e?n+r:n-r,i=Math.abs(o-t)/2,l=o<t?o+i:o-i;return[a,l,r,i]}function a4({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o,elevateOnSelect:r=!1}){if(o!==void 0)return o;const a=r&&n?1e3:0,i=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return a+i}function i4({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const a=Vd(Vu(e),Vu(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const i={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return Ql(i,Gd(a))>0}const l4=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,s4=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),tv=(e,t)=>{if(!e.source||!e.target)return t;let n;return uC(e)?n={...e}:n={...e,id:l4(e)},s4(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function EC({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,a,i,l]=SC({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,a,i,l]}const Bb={[se.Left]:{x:-1,y:0},[se.Right]:{x:1,y:0},[se.Top]:{x:0,y:-1},[se.Bottom]:{x:0,y:1}},c4=({source:e,sourcePosition:t=se.Bottom,target:n})=>t===se.Left||t===se.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Ub=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function u4({source:e,sourcePosition:t=se.Bottom,target:n,targetPosition:o=se.Top,center:r,offset:a,stepPosition:i}){const l=Bb[t],s=Bb[o],c={x:e.x+l.x*a,y:e.y+l.y*a},f={x:n.x+s.x*a,y:n.y+s.y*a},u=c4({source:c,sourcePosition:t,target:f}),d=u.x!==0?"x":"y",m=u[d];let v=[],g,x;const h={x:0,y:0},w={x:0,y:0},[,,y,S]=SC({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[d]*s[d]===-1){d==="x"?(g=r.x??c.x+(f.x-c.x)*i,x=r.y??(c.y+f.y)/2):(g=r.x??(c.x+f.x)/2,x=r.y??c.y+(f.y-c.y)*i);const N=[{x:g,y:c.y},{x:g,y:f.y}],C=[{x:c.x,y:x},{x:f.x,y:x}];l[d]===m?v=d==="x"?N:C:v=d==="x"?C:N}else{const N=[{x:c.x,y:f.y}],C=[{x:f.x,y:c.y}];if(d==="x"?v=l.x===m?C:N:v=l.y===m?N:C,t===o){const O=Math.abs(e[d]-n[d]);if(O<=a){const P=Math.min(a-1,a-O);l[d]===m?h[d]=(c[d]>e[d]?-1:1)*P:w[d]=(f[d]>n[d]?-1:1)*P}}if(t!==o){const O=d==="x"?"y":"x",P=l[d]===s[O],_=c[O]>f[O],L=c[O]<f[O];(l[d]===1&&(!P&&_||P&&L)||l[d]!==1&&(!P&&L||P&&_))&&(v=d==="x"?N:C)}const A={x:c.x+h.x,y:c.y+h.y},T={x:f.x+w.x,y:f.y+w.y},k=Math.max(Math.abs(A.x-v[0].x),Math.abs(T.x-v[0].x)),z=Math.max(Math.abs(A.y-v[0].y),Math.abs(T.y-v[0].y));k>=z?(g=(A.x+T.x)/2,x=v[0].y):(g=v[0].x,x=(A.y+T.y)/2)}return[[e,{x:c.x+h.x,y:c.y+h.y},...v,{x:f.x+w.x,y:f.y+w.y},n],g,x,y,S]}function d4(e,t,n,o){const r=Math.min(Ub(e,t)/2,Ub(t,n)/2,o),{x:a,y:i}=t;if(e.x===a&&a===n.x||e.y===i&&i===n.y)return`L${a} ${i}`;if(e.y===i){const c=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${a+r*c},${i}Q ${a},${i} ${a},${i+r*f}`}const l=e.x<n.x?1:-1,s=e.y<n.y?-1:1;return`L ${a},${i+r*s}Q ${a},${i} ${a+r*l},${i}`}function Yu({sourceX:e,sourceY:t,sourcePosition:n=se.Bottom,targetX:o,targetY:r,targetPosition:a=se.Top,borderRadius:i=5,centerX:l,centerY:s,offset:c=20,stepPosition:f=.5}){const[u,d,m,v,g]=u4({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:a,center:{x:l,y:s},offset:c,stepPosition:f});return[u.reduce((h,w,y)=>{let S="";return y>0&&y<u.length-1?S=d4(u[y-1],w,u[y+1],i):S=`${y===0?"M":"L"}${w.x} ${w.y}`,h+=S,h},""),d,m,v,g]}function Vb(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function f4(e){var u;const{sourceNode:t,targetNode:n}=e;if(!Vb(t)||!Vb(n))return null;const o=t.internals.handleBounds||Gb(t.handles),r=n.internals.handleBounds||Gb(n.handles),a=Yb((o==null?void 0:o.source)??[],e.sourceHandle),i=Yb(e.connectionMode===Yr.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!a||!i)return(u=e.onError)==null||u.call(e,"008",Hn.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(a==null?void 0:a.position)||se.Bottom,s=(i==null?void 0:i.position)||se.Top,c=Jl(t,a,l),f=Jl(n,i,s);return{sourceX:c.x,sourceY:c.y,targetX:f.x,targetY:f.y,sourcePosition:l,targetPosition:s}}function Gb(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function Jl(e,t,n=se.Left,o=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??xo(e);if(o)return{x:r+i/2,y:a+l/2};switch((t==null?void 0:t.position)??n){case se.Top:return{x:r+i/2,y:a};case se.Right:return{x:r+i,y:a+l/2};case se.Bottom:return{x:r+i/2,y:a+l};case se.Left:return{x:r,y:a+l/2}}}function Yb(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function th(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function p4(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const a=new Set;return e.reduce((i,l)=>([l.markerStart||o,l.markerEnd||r].forEach(s=>{if(s&&typeof s=="object"){const c=th(s,t);a.has(c)||(i.push({id:c,color:s.color||n,...s}),a.add(c))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}const CC=1e3,m4=10,nv={nodeOrigin:[0,0],nodeExtent:ql,elevateNodesOnSelect:!0,defaults:{}},h4={...nv,checkEquality:!0};function ov(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function g4(e,t,n){const o=ov(nv,n);for(const r of e.values())if(r.parentId)rv(r,e,t,o);else{const a=Cs(r,o.nodeOrigin),i=hi(r.extent)?r.extent:o.nodeExtent,l=Fr(a,i,xo(r));r.internals.positionAbsolute=l}}function v4(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],o=[];for(const r of e.handles){const a={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(a):r.type==="target"&&o.push(a)}return{source:n,target:o}}function nh(e,t,n,o){var c,f;const r=ov(h4,o);let a={i:-1},i=e.length>0;const l=new Map(t),s=r!=null&&r.elevateNodesOnSelect?CC:0;t.clear(),n.clear();for(const u of e){let d=l.get(u.id);if(r.checkEquality&&u===(d==null?void 0:d.internals.userNode))t.set(u.id,d);else{const m=Cs(u,r.nodeOrigin),v=hi(u.extent)?u.extent:r.nodeExtent,g=Fr(m,v,xo(u));d={...r.defaults,...u,measured:{width:(c=u.measured)==null?void 0:c.width,height:(f=u.measured)==null?void 0:f.height},internals:{positionAbsolute:g,handleBounds:v4(u,d),z:NC(u,s),userNode:u}},t.set(u.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(i=!1),u.parentId&&rv(d,t,n,o,a)}return i}function y4(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function rv(e,t,n,o,r){const{elevateNodesOnSelect:a,nodeOrigin:i,nodeExtent:l}=ov(nv,o),s=e.parentId,c=t.get(s);if(!c){console.warn(`Parent node ${s} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}y4(e,n),r&&!c.parentId&&c.internals.rootParentIndex===void 0&&(c.internals.rootParentIndex=++r.i,c.internals.z=c.internals.z+r.i*m4),r&&c.internals.rootParentIndex!==void 0&&(r.i=c.internals.rootParentIndex);const f=a?CC:0,{x:u,y:d,z:m}=b4(e,c,i,l,f),{positionAbsolute:v}=e.internals,g=u!==v.x||d!==v.y;(g||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:g?{x:u,y:d}:v,z:m}})}function NC(e,t){return(bn(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function b4(e,t,n,o,r){const{x:a,y:i}=t.internals.positionAbsolute,l=xo(e),s=Cs(e,n),c=hi(e.extent)?Fr(s,e.extent,l):s;let f=Fr({x:a+c.x,y:i+c.y},o,l);e.extent==="parent"&&(f=fC(f,l,t));const u=NC(e,r),d=t.internals.z??0;return{x:f.x,y:f.y,z:d>=u?d+1:u}}function av(e,t,n,o=[0,0]){var i;const r=[],a=new Map;for(const l of e){const s=t.get(l.parentId);if(!s)continue;const c=((i=a.get(l.parentId))==null?void 0:i.expandedRect)??mi(s),f=mC(c,l.rect);a.set(l.parentId,{expandedRect:f,parent:s})}return a.size>0&&a.forEach(({expandedRect:l,parent:s},c)=>{var y;const f=s.internals.positionAbsolute,u=xo(s),d=s.origin??o,m=l.x<f.x?Math.round(Math.abs(f.x-l.x)):0,v=l.y<f.y?Math.round(Math.abs(f.y-l.y)):0,g=Math.max(u.width,Math.round(l.width)),x=Math.max(u.height,Math.round(l.height)),h=(g-u.width)*d[0],w=(x-u.height)*d[1];(m>0||v>0||h||w)&&(r.push({id:c,type:"position",position:{x:s.position.x-m+h,y:s.position.y-v+w}}),(y=n.get(c))==null||y.forEach(S=>{e.some(E=>E.id===S.id)||r.push({id:S.id,type:"position",position:{x:S.position.x+m,y:S.position.y+v}})})),(u.width<l.width||u.height<l.height||m||v)&&r.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:g+(m?d[0]*m-h:0),height:x+(v?d[1]*v-w:0)}})}),r}function w4(e,t,n,o,r,a){const i=o==null?void 0:o.querySelector(".xyflow__viewport");let l=!1;if(!i)return{changes:[],updatedInternals:l};const s=[],c=window.getComputedStyle(i),{m22:f}=new window.DOMMatrixReadOnly(c.transform),u=[];for(const d of e.values()){const m=t.get(d.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),l=!0;continue}const v=ev(d.nodeElement),g=m.measured.width!==v.width||m.measured.height!==v.height;if(!!(v.width&&v.height&&(g||!m.internals.handleBounds||d.force))){const h=d.nodeElement.getBoundingClientRect(),w=hi(m.extent)?m.extent:a;let{positionAbsolute:y}=m.internals;m.parentId&&m.extent==="parent"?y=fC(y,v,t.get(m.parentId)):w&&(y=Fr(y,w,v));const S={...m,measured:v,internals:{...m.internals,positionAbsolute:y,handleBounds:{source:$b("source",d.nodeElement,h,f,m.id),target:$b("target",d.nodeElement,h,f,m.id)}}};t.set(m.id,S),m.parentId&&rv(S,t,n,{nodeOrigin:r}),l=!0,g&&(s.push({id:m.id,type:"dimensions",dimensions:v}),m.expandParent&&m.parentId&&u.push({id:m.id,parentId:m.parentId,rect:mi(S,r)}))}}if(u.length>0){const d=av(u,t,n,r);s.push(...d)}return{changes:s,updatedInternals:l}}async function x4({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,a]],o),l=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(l)}function Fb(e,t,n,o,r,a){let i=r;const l=o.get(i)||new Map;o.set(i,l.set(n,t)),i=`${r}-${e}`;const s=o.get(i)||new Map;if(o.set(i,s.set(n,t)),a){i=`${r}-${e}-${a}`;const c=o.get(i)||new Map;o.set(i,c.set(n,t))}}function _C(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:a,sourceHandle:i=null,targetHandle:l=null}=o,s={edgeId:o.id,source:r,target:a,sourceHandle:i,targetHandle:l},c=`${r}-${i}--${a}-${l}`,f=`${a}-${l}--${r}-${i}`;Fb("source",s,f,e,r,i),Fb("target",s,c,e,a,l),t.set(o.id,o)}}function RC(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:RC(n,t):!1}function Xb(e,t,n){var r;let o=e;do{if((r=o==null?void 0:o.matches)!=null&&r.call(o,t))return!0;if(o===n)return!1;o=o==null?void 0:o.parentElement}while(o);return!1}function S4(e,t,n,o){const r=new Map;for(const[a,i]of e)if((i.selected||i.id===o)&&(!i.parentId||!RC(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){const l=e.get(a);l&&r.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function Cp({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){var i,l,s;const r=[];for(const[c,f]of t){const u=(i=n.get(c))==null?void 0:i.internals.userNode;u&&r.push({...u,position:f.position,dragging:o})}if(!e)return[r[0],r];const a=(l=n.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((s=t.get(e))==null?void 0:s.position)||a.position,dragging:o}:r[0],r]}function E4({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const a={x:n-r.distance.x,y:o-r.distance.y},i=_s(a,t);return{x:i.x-a.x,y:i.y-a.y}}function C4({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let a={x:null,y:null},i=0,l=new Map,s=!1,c={x:0,y:0},f=null,u=!1,d=null,m=!1,v=!1,g=null;function x({noDragClassName:w,handleSelector:y,domNode:S,isSelectable:E,nodeId:N,nodeClickDistance:C=0}){d=Ut(S);function A({x:O,y:P}){const{nodeLookup:_,nodeExtent:L,snapGrid:R,snapToGrid:I,nodeOrigin:D,onNodeDrag:M,onSelectionDrag:U,onError:F,updateNodePositions:$}=t();a={x:O,y:P};let H=!1;const V=l.size>1,Y=V&&L?eh(Ns(l)):null,q=V&&I?E4({dragItems:l,snapGrid:R,x:O,y:P}):null;for(const[B,G]of l){if(!_.has(B))continue;let Z={x:O-G.distance.x,y:P-G.distance.y};I&&(Z=q?{x:Math.round(Z.x+q.x),y:Math.round(Z.y+q.y)}:_s(Z,R));let ee=null;if(V&&L&&!G.extent&&Y){const{positionAbsolute:W}=G.internals,Q=W.x-Y.x+L[0][0],ne=W.x+G.measured.width-Y.x2+L[1][0],ae=W.y-Y.y+L[0][1],ce=W.y+G.measured.height-Y.y2+L[1][1];ee=[[Q,ae],[ne,ce]]}const{position:te,positionAbsolute:K}=dC({nodeId:B,nextPosition:Z,nodeLookup:_,nodeExtent:ee||L,nodeOrigin:D,onError:F});H=H||G.position.x!==te.x||G.position.y!==te.y,G.position=te,G.internals.positionAbsolute=K}if(v=v||H,!!H&&($(l,!0),g&&(o||M||!N&&U))){const[B,G]=Cp({nodeId:N,dragItems:l,nodeLookup:_});o==null||o(g,l,B,G),M==null||M(g,B,G),N||U==null||U(g,G)}}async function T(){if(!f)return;const{transform:O,panBy:P,autoPanSpeed:_,autoPanOnNodeDrag:L}=t();if(!L){s=!1,cancelAnimationFrame(i);return}const[R,I]=pC(c,f,_);(R!==0||I!==0)&&(a.x=(a.x??0)-R/O[2],a.y=(a.y??0)-I/O[2],await P({x:R,y:I})&&A(a)),i=requestAnimationFrame(T)}function k(O){var V;const{nodeLookup:P,multiSelectionActive:_,nodesDraggable:L,transform:R,snapGrid:I,snapToGrid:D,selectNodesOnDrag:M,onNodeDragStart:U,onSelectionDragStart:F,unselectNodesAndEdges:$}=t();u=!0,(!M||!E)&&!_&&N&&((V=P.get(N))!=null&&V.selected||$()),E&&M&&N&&(e==null||e(N));const H=Al(O.sourceEvent,{transform:R,snapGrid:I,snapToGrid:D,containerBounds:f});if(a=H,l=S4(P,L,H,N),l.size>0&&(n||U||!N&&F)){const[Y,q]=Cp({nodeId:N,dragItems:l,nodeLookup:P});n==null||n(O.sourceEvent,l,Y,q),U==null||U(O.sourceEvent,Y,q),N||F==null||F(O.sourceEvent,q)}}const z=YE().clickDistance(C).on("start",O=>{const{domNode:P,nodeDragThreshold:_,transform:L,snapGrid:R,snapToGrid:I}=t();f=(P==null?void 0:P.getBoundingClientRect())||null,m=!1,v=!1,g=O.sourceEvent,_===0&&k(O),a=Al(O.sourceEvent,{transform:L,snapGrid:R,snapToGrid:I,containerBounds:f}),c=wn(O.sourceEvent,f)}).on("drag",O=>{const{autoPanOnNodeDrag:P,transform:_,snapGrid:L,snapToGrid:R,nodeDragThreshold:I,nodeLookup:D}=t(),M=Al(O.sourceEvent,{transform:_,snapGrid:L,snapToGrid:R,containerBounds:f});if(g=O.sourceEvent,(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1||N&&!D.has(N))&&(m=!0),!m){if(!s&&P&&u&&(s=!0,T()),!u){const U=wn(O.sourceEvent,f),F=U.x-c.x,$=U.y-c.y;Math.sqrt(F*F+$*$)>I&&k(O)}(a.x!==M.xSnapped||a.y!==M.ySnapped)&&l&&u&&(c=wn(O.sourceEvent,f),A(M))}}).on("end",O=>{if(!(!u||m)&&(s=!1,u=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:P,updateNodePositions:_,onNodeDragStop:L,onSelectionDragStop:R}=t();if(v&&(_(l,!1),v=!1),r||L||!N&&R){const[I,D]=Cp({nodeId:N,dragItems:l,nodeLookup:P,dragging:!1});r==null||r(O.sourceEvent,l,I,D),L==null||L(O.sourceEvent,I,D),N||R==null||R(O.sourceEvent,D)}}}).filter(O=>{const P=O.target;return!O.button&&(!w||!Xb(P,`.${w}`,S))&&(!y||Xb(P,y,S))});d.call(z)}function h(){d==null||d.on(".drag",null)}return{update:x,destroy:h}}function N4(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())Ql(r,mi(a))>0&&o.push(a);return o}const _4=250;function R4(e,t,n,o){var l,s;let r=[],a=1/0;const i=N4(e,n,t+_4);for(const c of i){const f=[...((l=c.internals.handleBounds)==null?void 0:l.source)??[],...((s=c.internals.handleBounds)==null?void 0:s.target)??[]];for(const u of f){if(o.nodeId===u.nodeId&&o.type===u.type&&o.id===u.id)continue;const{x:d,y:m}=Jl(c,u,u.position,!0),v=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(m-e.y,2));v>t||(v<a?(r=[{...u,x:d,y:m}],a=v):v===a&&r.push({...u,x:d,y:m}))}}if(!r.length)return null;if(r.length>1){const c=o.type==="source"?"target":"source";return r.find(f=>f.type===c)??r[0]}return r[0]}function TC(e,t,n,o,r,a=!1){var c,f,u;const i=o.get(e);if(!i)return null;const l=r==="strict"?(c=i.internals.handleBounds)==null?void 0:c[t]:[...((f=i.internals.handleBounds)==null?void 0:f.source)??[],...((u=i.internals.handleBounds)==null?void 0:u.target)??[]],s=(n?l==null?void 0:l.find(d=>d.id===n):l==null?void 0:l[0])??null;return s&&a?{...s,...Jl(i,s,s.position,!0)}:s}function AC(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function T4(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const MC=()=>!0;function A4(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:a,isTarget:i,domNode:l,nodeLookup:s,lib:c,autoPanOnConnect:f,flowId:u,panBy:d,cancelConnection:m,onConnectStart:v,onConnect:g,onConnectEnd:x,isValidConnection:h=MC,onReconnectEnd:w,updateConnection:y,getTransform:S,getFromHandle:E,autoPanSpeed:N,dragThreshold:C=1,handleDomNode:A}){const T=vC(e.target);let k=0,z;const{x:O,y:P}=wn(e),_=AC(a,A),L=l==null?void 0:l.getBoundingClientRect();let R=!1;if(!L||!_)return;const I=TC(r,_,o,s,t);if(!I)return;let D=wn(e,L),M=!1,U=null,F=!1,$=null;function H(){if(!f||!L)return;const[te,K]=pC(D,L,N);d({x:te,y:K}),k=requestAnimationFrame(H)}const V={...I,nodeId:r,type:_,position:I.position},Y=s.get(r);let B={inProgress:!0,isValid:null,from:Jl(Y,V,se.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:Y,to:D,toHandle:null,toPosition:zb[V.position],toNode:null,pointer:D};function G(){R=!0,y(B),v==null||v(e,{nodeId:r,handleId:o,handleType:_})}C===0&&G();function Z(te){if(!R){const{x:ne,y:ae}=wn(te),ce=ne-O,fe=ae-P;if(!(ce*ce+fe*fe>C*C))return;G()}if(!E()||!V){ee(te);return}const K=S();D=wn(te,L),z=R4(Rs(D,K,!1,[1,1]),n,s,V),M||(H(),M=!0);const W=DC(te,{handle:z,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:i?"target":"source",isValidConnection:h,doc:T,lib:c,flowId:u,nodeLookup:s});$=W.handleDomNode,U=W.connection,F=T4(!!z,W.isValid);const Q={...B,isValid:F,to:W.toHandle&&F?Gu({x:W.toHandle.x,y:W.toHandle.y},K):D,toHandle:W.toHandle,toPosition:F&&W.toHandle?W.toHandle.position:zb[V.position],toNode:W.toHandle?s.get(W.toHandle.nodeId):null,pointer:D};y(Q),B=Q}function ee(te){if(!("touches"in te&&te.touches.length>0)){if(R){(z||$)&&U&&F&&(g==null||g(U));const{inProgress:K,...W}=B,Q={...W,toPosition:B.toHandle?B.toPosition:null};x==null||x(te,Q),a&&(w==null||w(te,Q))}m(),cancelAnimationFrame(k),M=!1,F=!1,U=null,$=null,T.removeEventListener("mousemove",Z),T.removeEventListener("mouseup",ee),T.removeEventListener("touchmove",Z),T.removeEventListener("touchend",ee)}}T.addEventListener("mousemove",Z),T.addEventListener("mouseup",ee),T.addEventListener("touchmove",Z),T.addEventListener("touchend",ee)}function DC(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:a,doc:i,lib:l,flowId:s,isValidConnection:c=MC,nodeLookup:f}){const u=a==="target",d=t?i.querySelector(`.${l}-flow__handle[data-id="${s}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:v}=wn(e),g=i.elementFromPoint(m,v),x=g!=null&&g.classList.contains(`${l}-flow__handle`)?g:d,h={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const w=AC(void 0,x),y=x.getAttribute("data-nodeid"),S=x.getAttribute("data-handleid"),E=x.classList.contains("connectable"),N=x.classList.contains("connectableend");if(!y||!w)return h;const C={source:u?y:o,sourceHandle:u?S:r,target:u?o:y,targetHandle:u?r:S};h.connection=C;const T=E&&N&&(n===Yr.Strict?u&&w==="source"||!u&&w==="target":y!==o||S!==r);h.isValid=T&&c(C),h.toHandle=TC(y,w,S,f,n,!0)}return h}const oh={onPointerDown:A4,isValid:DC};function M4({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=Ut(e);function a({translateExtent:l,width:s,height:c,zoomStep:f=1,pannable:u=!0,zoomable:d=!0,inversePan:m=!1}){const v=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const S=n(),E=y.sourceEvent.ctrlKey&&Wl()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*f,C=S[2]*Math.pow(2,N*E);t.scaleTo(C)};let g=[0,0];const x=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(g=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},h=y=>{const S=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-g[0],E[1]-g[1]];g=E;const C=o()*Math.max(S[2],Math.log(S[2]))*(m?-1:1),A={x:S[0]-N[0]*C,y:S[1]-N[1]*C},T=[[0,0],[s,c]];t.setViewportConstrained({x:A.x,y:A.y,zoom:S[2]},T,l)},w=aC().on("start",x).on("zoom",u?h:null).on("zoom.wheel",d?v:null);r.call(w,{})}function i(){r.on("zoom",null)}return{update:a,destroy:i,pointer:vn}}const Yd=e=>({x:e.x,y:e.y,zoom:e.k}),Np=({x:e,y:t,zoom:n})=>Ud.translate(e,t).scale(n),ka=(e,t)=>e.target.closest(`.${t}`),OC=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),D4=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,_p=(e,t=0,n=D4,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},PC=e=>{const t=e.ctrlKey&&Wl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function O4({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:a,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:c}){return f=>{if(ka(f,t))return f.ctrlKey&&f.preventDefault(),!1;f.preventDefault(),f.stopImmediatePropagation();const u=n.property("__zoom").k||1;if(f.ctrlKey&&i){const x=vn(f),h=PC(f),w=u*Math.pow(2,h);o.scaleTo(n,w,x,f);return}const d=f.deltaMode===1?20:1;let m=r===Lr.Vertical?0:f.deltaX*d,v=r===Lr.Horizontal?0:f.deltaY*d;!Wl()&&f.shiftKey&&r!==Lr.Vertical&&(m=f.deltaY*d,v=0),o.translateBy(n,-(m/u)*a,-(v/u)*a,{internal:!0});const g=Yd(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(s==null||s(f,g),e.panScrollTimeout=setTimeout(()=>{c==null||c(f,g),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(f,g))}}function P4({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const a=o.type==="wheel",i=!t&&a&&!o.ctrlKey,l=ka(o,e);if(o.ctrlKey&&a&&l&&o.preventDefault(),i||l)return null;o.preventDefault(),n.call(this,o,r)}}function z4({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{var a,i,l;if((a=o.sourceEvent)!=null&&a.internal)return;const r=Yd(o.transform);e.mouseButton=((i=o.sourceEvent)==null?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=o.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(o.sourceEvent,r))}}function I4({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return a=>{var i,l;e.usedRightMouseButton=!!(n&&OC(t,e.mouseButton??0)),(i=a.sourceEvent)!=null&&i.sync||o([a.transform.x,a.transform.y,a.transform.k]),r&&!((l=a.sourceEvent)!=null&&l.internal)&&(r==null||r(a.sourceEvent,Yd(a.transform)))}}function L4({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:a}){return i=>{var l;if(!((l=i.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&OC(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&a(i.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const s=Yd(i.transform);e.prevViewport=s,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(i.sourceEvent,s)},n?150:0)}}}function k4({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:a,userSelectionActive:i,noWheelClassName:l,noPanClassName:s,lib:c,connectionInProgress:f}){return u=>{var x;const d=e||t,m=n&&u.ctrlKey,v=u.type==="wheel";if(u.button===1&&u.type==="mousedown"&&(ka(u,`${c}-flow__node`)||ka(u,`${c}-flow__edge`)))return!0;if(!o&&!d&&!r&&!a&&!n||i||f&&!v||ka(u,l)&&v||ka(u,s)&&(!v||r&&v&&!e)||!n&&u.ctrlKey&&v)return!1;if(!n&&u.type==="touchstart"&&((x=u.touches)==null?void 0:x.length)>1)return u.preventDefault(),!1;if(!d&&!r&&!m&&v||!o&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(o)&&!o.includes(u.button)&&u.type==="mousedown")return!1;const g=Array.isArray(o)&&o.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||v)&&g}}function $4({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:a,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:s}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),u=aC().scaleExtent([t,n]).translateExtent(o),d=Ut(e).call(u);w({x:r.x,y:r.y,zoom:pi(r.zoom,t,n)},[[0,0],[f.width,f.height]],o);const m=d.on("wheel.zoom"),v=d.on("dblclick.zoom");u.wheelDelta(PC);function g(z,O){return d?new Promise(P=>{u==null||u.interpolate((O==null?void 0:O.interpolate)==="linear"?Tl:Qc).transform(_p(d,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>P(!0)),z)}):Promise.resolve(!1)}function x({noWheelClassName:z,noPanClassName:O,onPaneContextMenu:P,userSelectionActive:_,panOnScroll:L,panOnDrag:R,panOnScrollMode:I,panOnScrollSpeed:D,preventScrolling:M,zoomOnPinch:U,zoomOnScroll:F,zoomOnDoubleClick:$,zoomActivationKeyPressed:H,lib:V,onTransformChange:Y,connectionInProgress:q,paneClickDistance:B,selectionOnDrag:G}){_&&!c.isZoomingOrPanning&&h();const Z=L&&!H&&!_;u.clickDistance(G?1/0:!bn(B)||B<0?0:B);const ee=Z?O4({zoomPanValues:c,noWheelClassName:z,d3Selection:d,d3Zoom:u,panOnScrollMode:I,panOnScrollSpeed:D,zoomOnPinch:U,onPanZoomStart:i,onPanZoom:a,onPanZoomEnd:l}):P4({noWheelClassName:z,preventScrolling:M,d3ZoomHandler:m});if(d.on("wheel.zoom",ee,{passive:!1}),!_){const K=z4({zoomPanValues:c,onDraggingChange:s,onPanZoomStart:i});u.on("start",K);const W=I4({zoomPanValues:c,panOnDrag:R,onPaneContextMenu:!!P,onPanZoom:a,onTransformChange:Y});u.on("zoom",W);const Q=L4({zoomPanValues:c,panOnDrag:R,panOnScroll:L,onPaneContextMenu:P,onPanZoomEnd:l,onDraggingChange:s});u.on("end",Q)}const te=k4({zoomActivationKeyPressed:H,panOnDrag:R,zoomOnScroll:F,panOnScroll:L,zoomOnDoubleClick:$,zoomOnPinch:U,userSelectionActive:_,noPanClassName:O,noWheelClassName:z,lib:V,connectionInProgress:q});u.filter(te),$?d.on("dblclick.zoom",v):d.on("dblclick.zoom",null)}function h(){u.on("zoom",null)}async function w(z,O,P){const _=Np(z),L=u==null?void 0:u.constrain()(_,O,P);return L&&await g(L),new Promise(R=>R(L))}async function y(z,O){const P=Np(z);return await g(P,O),new Promise(_=>_(P))}function S(z){if(d){const O=Np(z),P=d.property("__zoom");(P.k!==z.zoom||P.x!==z.x||P.y!==z.y)&&(u==null||u.transform(d,O,null,{sync:!0}))}}function E(){const z=d?rC(d.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}function N(z,O){return d?new Promise(P=>{u==null||u.interpolate((O==null?void 0:O.interpolate)==="linear"?Tl:Qc).scaleTo(_p(d,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>P(!0)),z)}):Promise.resolve(!1)}function C(z,O){return d?new Promise(P=>{u==null||u.interpolate((O==null?void 0:O.interpolate)==="linear"?Tl:Qc).scaleBy(_p(d,O==null?void 0:O.duration,O==null?void 0:O.ease,()=>P(!0)),z)}):Promise.resolve(!1)}function A(z){u==null||u.scaleExtent(z)}function T(z){u==null||u.translateExtent(z)}function k(z){const O=!bn(z)||z<0?0:z;u==null||u.clickDistance(O)}return{update:x,destroy:h,setViewport:y,setViewportConstrained:w,getViewport:E,scaleTo:N,scaleBy:C,setScaleExtent:A,setTranslateExtent:T,syncViewport:S,setClickDistance:k}}var gi;(function(e){e.Line="line",e.Handle="handle"})(gi||(gi={}));function H4({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:a}){const i=e-t,l=n-o,s=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&r&&(s[0]=s[0]*-1),l&&a&&(s[1]=s[1]*-1),s}function Kb(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function To(e,t){return Math.max(0,t-e)}function Ao(e,t){return Math.max(0,e-t)}function Ec(e,t,n){return Math.max(0,t-e,e-n)}function jb(e,t){return e?!t:t}function B4(e,t,n,o,r,a,i,l){let{affectsX:s,affectsY:c}=t;const{isHorizontal:f,isVertical:u}=t,d=f&&u,{xSnapped:m,ySnapped:v}=n,{minWidth:g,maxWidth:x,minHeight:h,maxHeight:w}=o,{x:y,y:S,width:E,height:N,aspectRatio:C}=e;let A=Math.floor(f?m-e.pointerX:0),T=Math.floor(u?v-e.pointerY:0);const k=E+(s?-A:A),z=N+(c?-T:T),O=-a[0]*E,P=-a[1]*N;let _=Ec(k,g,x),L=Ec(z,h,w);if(i){let D=0,M=0;s&&A<0?D=To(y+A+O,i[0][0]):!s&&A>0&&(D=Ao(y+k+O,i[1][0])),c&&T<0?M=To(S+T+P,i[0][1]):!c&&T>0&&(M=Ao(S+z+P,i[1][1])),_=Math.max(_,D),L=Math.max(L,M)}if(l){let D=0,M=0;s&&A>0?D=Ao(y+A,l[0][0]):!s&&A<0&&(D=To(y+k,l[1][0])),c&&T>0?M=Ao(S+T,l[0][1]):!c&&T<0&&(M=To(S+z,l[1][1])),_=Math.max(_,D),L=Math.max(L,M)}if(r){if(f){const D=Ec(k/C,h,w)*C;if(_=Math.max(_,D),i){let M=0;!s&&!c||s&&!c&&d?M=Ao(S+P+k/C,i[1][1])*C:M=To(S+P+(s?A:-A)/C,i[0][1])*C,_=Math.max(_,M)}if(l){let M=0;!s&&!c||s&&!c&&d?M=To(S+k/C,l[1][1])*C:M=Ao(S+(s?A:-A)/C,l[0][1])*C,_=Math.max(_,M)}}if(u){const D=Ec(z*C,g,x)/C;if(L=Math.max(L,D),i){let M=0;!s&&!c||c&&!s&&d?M=Ao(y+z*C+O,i[1][0])/C:M=To(y+(c?T:-T)*C+O,i[0][0])/C,L=Math.max(L,M)}if(l){let M=0;!s&&!c||c&&!s&&d?M=To(y+z*C,l[1][0])/C:M=Ao(y+(c?T:-T)*C,l[0][0])/C,L=Math.max(L,M)}}}T=T+(T<0?L:-L),A=A+(A<0?_:-_),r&&(d?k>z*C?T=(jb(s,c)?-A:A)/C:A=(jb(s,c)?-T:T)*C:f?(T=A/C,c=s):(A=T*C,s=c));const R=s?y+A:y,I=c?S+T:S;return{width:E+(s?-A:A),height:N+(c?-T:T),x:a[0]*A*(s?-1:1)+R,y:a[1]*T*(c?-1:1)+I}}const zC={width:0,height:0,x:0,y:0},U4={...zC,pointerX:0,pointerY:0,aspectRatio:1};function V4(e){return[[0,0],[e.measured.width,e.measured.height]]}function G4(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,a=e.measured.width??0,i=e.measured.height??0,l=n[0]*a,s=n[1]*i;return[[o-l,r-s],[o+a-l,r+i-s]]}function Y4({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const a=Ut(e);let i={controlDirection:Kb("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:c,boundaries:f,keepAspectRatio:u,resizeDirection:d,onResizeStart:m,onResize:v,onResizeEnd:g,shouldResize:x}){let h={...zC},w={...U4};i={boundaries:f,resizeDirection:d,keepAspectRatio:u,controlDirection:Kb(c)};let y,S=null,E=[],N,C,A,T=!1;const k=YE().on("start",z=>{const{nodeLookup:O,transform:P,snapGrid:_,snapToGrid:L,nodeOrigin:R,paneDomNode:I}=n();if(y=O.get(t),!y)return;S=(I==null?void 0:I.getBoundingClientRect())??null;const{xSnapped:D,ySnapped:M}=Al(z.sourceEvent,{transform:P,snapGrid:_,snapToGrid:L,containerBounds:S});h={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...h,pointerX:D,pointerY:M,aspectRatio:h.width/h.height},N=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=O.get(y.parentId),C=N&&y.extent==="parent"?V4(N):void 0),E=[],A=void 0;for(const[U,F]of O)if(F.parentId===t&&(E.push({id:U,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const $=G4(F,y,F.origin??R);A?A=[[Math.min($[0][0],A[0][0]),Math.min($[0][1],A[0][1])],[Math.max($[1][0],A[1][0]),Math.max($[1][1],A[1][1])]]:A=$}m==null||m(z,{...h})}).on("drag",z=>{const{transform:O,snapGrid:P,snapToGrid:_,nodeOrigin:L}=n(),R=Al(z.sourceEvent,{transform:O,snapGrid:P,snapToGrid:_,containerBounds:S}),I=[];if(!y)return;const{x:D,y:M,width:U,height:F}=h,$={},H=y.origin??L,{width:V,height:Y,x:q,y:B}=B4(w,i.controlDirection,R,i.boundaries,i.keepAspectRatio,H,C,A),G=V!==U,Z=Y!==F,ee=q!==D&&G,te=B!==M&&Z;if(!ee&&!te&&!G&&!Z)return;if((ee||te||H[0]===1||H[1]===1)&&($.x=ee?q:h.x,$.y=te?B:h.y,h.x=$.x,h.y=$.y,E.length>0)){const ne=q-D,ae=B-M;for(const ce of E)ce.position={x:ce.position.x-ne+H[0]*(V-U),y:ce.position.y-ae+H[1]*(Y-F)},I.push(ce)}if((G||Z)&&($.width=G&&(!i.resizeDirection||i.resizeDirection==="horizontal")?V:h.width,$.height=Z&&(!i.resizeDirection||i.resizeDirection==="vertical")?Y:h.height,h.width=$.width,h.height=$.height),N&&y.expandParent){const ne=H[0]*($.width??0);$.x&&$.x<ne&&(h.x=ne,w.x=w.x-($.x-ne));const ae=H[1]*($.height??0);$.y&&$.y<ae&&(h.y=ae,w.y=w.y-($.y-ae))}const K=H4({width:h.width,prevWidth:U,height:h.height,prevHeight:F,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),W={...h,direction:K};(x==null?void 0:x(z,W))!==!1&&(T=!0,v==null||v(z,W),o($,I))}).on("end",z=>{T&&(g==null||g(z,{...h}),r==null||r({...h}),T=!1)});a.call(k)}function s(){a.on(".drag",null)}return{update:l,destroy:s}}var IC={exports:{}},LC={},kC={exports:{}},$C={};/**
50
- * @license React
51
- * use-sync-external-store-shim.production.js
52
- *
53
- * Copyright (c) Meta Platforms, Inc. and affiliates.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE file in the root directory of this source tree.
57
- */var vi=p;function F4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var X4=typeof Object.is=="function"?Object.is:F4,K4=vi.useState,j4=vi.useEffect,q4=vi.useLayoutEffect,Z4=vi.useDebugValue;function Q4(e,t){var n=t(),o=K4({inst:{value:n,getSnapshot:t}}),r=o[0].inst,a=o[1];return q4(function(){r.value=n,r.getSnapshot=t,Rp(r)&&a({inst:r})},[e,n,t]),j4(function(){return Rp(r)&&a({inst:r}),e(function(){Rp(r)&&a({inst:r})})},[e]),Z4(n),n}function Rp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!X4(e,n)}catch{return!0}}function W4(e,t){return t()}var J4=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?W4:Q4;$C.useSyncExternalStore=vi.useSyncExternalStore!==void 0?vi.useSyncExternalStore:J4;kC.exports=$C;var HC=kC.exports;/**
58
- * @license React
59
- * use-sync-external-store-shim/with-selector.production.js
60
- *
61
- * Copyright (c) Meta Platforms, Inc. and affiliates.
62
- *
63
- * This source code is licensed under the MIT license found in the
64
- * LICENSE file in the root directory of this source tree.
65
- */var Fd=p,e$=HC;function t$(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var n$=typeof Object.is=="function"?Object.is:t$,o$=e$.useSyncExternalStore,r$=Fd.useRef,a$=Fd.useEffect,i$=Fd.useMemo,l$=Fd.useDebugValue;LC.useSyncExternalStoreWithSelector=function(e,t,n,o,r){var a=r$(null);if(a.current===null){var i={hasValue:!1,value:null};a.current=i}else i=a.current;a=i$(function(){function s(m){if(!c){if(c=!0,f=m,m=o(m),r!==void 0&&i.hasValue){var v=i.value;if(r(v,m))return u=v}return u=m}if(v=u,n$(f,m))return v;var g=o(m);return r!==void 0&&r(v,g)?(f=m,v):(f=m,u=g)}var c=!1,f,u,d=n===void 0?null:n;return[function(){return s(t())},d===null?void 0:function(){return s(d())}]},[t,n,o,r]);var l=o$(e,a[0],a[1]);return a$(function(){i.hasValue=!0,i.value=l},[l]),l$(l),l};IC.exports=LC;var s$=IC.exports;const c$=gd(s$),u$={},qb=e=>{let t;const n=new Set,o=(f,u)=>{const d=typeof f=="function"?f(t):f;if(!Object.is(d,t)){const m=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(v=>v(t,m))}},r=()=>t,s={setState:o,getState:r,getInitialState:()=>c,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(u$?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(o,r,s);return s},d$=e=>e?qb(e):qb,{useDebugValue:f$}=ie,{useSyncExternalStoreWithSelector:p$}=c$,m$=e=>e;function BC(e,t=m$,n){const o=p$(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return f$(o),o}const Zb=(e,t)=>{const n=d$(e),o=(r,a=t)=>BC(n,r,a);return Object.assign(o,n),o},h$=(e,t)=>e?Zb(e,t):Zb;function Fe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const Xd=p.createContext(null),g$=Xd.Provider,UC=Hn.error001();function we(e,t){const n=p.useContext(Xd);if(n===null)throw new Error(UC);return BC(n,e,t)}function Be(){const e=p.useContext(Xd);if(e===null)throw new Error(UC);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Qb={display:"none"},v$={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},VC="react-flow__node-desc",GC="react-flow__edge-desc",y$="react-flow__aria-live",b$=e=>e.ariaLiveMessage,w$=e=>e.ariaLabelConfig;function x$({rfId:e}){const t=we(b$);return b("div",{id:`${y$}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:v$,children:t})}function S$({rfId:e,disableKeyboardA11y:t}){const n=we(w$);return re(De,{children:[b("div",{id:`${VC}-${e}`,style:Qb,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),b("div",{id:`${GC}-${e}`,style:Qb,children:n["edge.a11yDescription.default"]}),!t&&b(x$,{rfId:e})]})}const Kd=p.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},a)=>{const i=`${e}`.split("-");return b("div",{className:tt(["react-flow__panel",n,...i]),style:o,ref:a,...r,children:t})});Kd.displayName="Panel";function E$({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:b(Kd,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:b("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const C$=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},Cc=e=>e.id;function N$(e,t){return Fe(e.selectedNodes.map(Cc),t.selectedNodes.map(Cc))&&Fe(e.selectedEdges.map(Cc),t.selectedEdges.map(Cc))}function _$({onSelectionChange:e}){const t=Be(),{selectedNodes:n,selectedEdges:o}=we(C$,N$);return p.useEffect(()=>{const r={nodes:n,edges:o};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(a=>a(r))},[n,o,e]),null}const R$=e=>!!e.onSelectionChangeHandlers;function T$({onSelectionChange:e}){const t=we(R$);return e||t?b(_$,{onSelectionChange:e}):null}const YC=[0,0],A$={x:0,y:0,zoom:1},M$=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig"],Wb=[...M$,"rfId"],D$=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Jb={translateExtent:ql,nodeOrigin:YC,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function O$(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:a,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:s}=we(D$,Fe),c=Be();p.useEffect(()=>(s(e.defaultNodes,e.defaultEdges),()=>{f.current=Jb,l()}),[]);const f=p.useRef(Jb);return p.useEffect(()=>{for(const u of Wb){const d=e[u],m=f.current[u];d!==m&&(typeof e[u]>"u"||(u==="nodes"?t(d):u==="edges"?n(d):u==="minZoom"?o(d):u==="maxZoom"?r(d):u==="translateExtent"?a(d):u==="nodeExtent"?i(d):u==="ariaLabelConfig"?c.setState({ariaLabelConfig:o4(d)}):u==="fitView"?c.setState({fitViewQueued:d}):u==="fitViewOptions"?c.setState({fitViewOptions:d}):c.setState({[u]:d})))}f.current=e},Wb.map(u=>e[u])),null}function ew(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function P$(e){var o;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=ew(),a=()=>n(r!=null&&r.matches?"dark":"light");return a(),r==null||r.addEventListener("change",a),()=>{r==null||r.removeEventListener("change",a)}},[e]),t!==null?t:(o=ew())!=null&&o.matches?"dark":"light"}const tw=typeof document<"u"?document:null;function es(e=null,t={target:tw,actInsideInputWithModifier:!0}){const[n,o]=p.useState(!1),r=p.useRef(!1),a=p.useRef(new Set([])),[i,l]=p.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(u=>typeof u=="string").map(u=>u.replace("+",`
66
- `).replace(`
67
-
68
- `,`
69
- +`).split(`
70
- `)),f=c.reduce((u,d)=>u.concat(...d),[]);return[c,f]}return[[],[]]},[e]);return p.useEffect(()=>{const s=(t==null?void 0:t.target)??tw,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const f=m=>{var x,h;if(r.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!r.current||r.current&&!c)&&yC(m))return!1;const g=ow(m.code,l);if(a.current.add(m[g]),nw(i,a.current,!1)){const w=((h=(x=m.composedPath)==null?void 0:x.call(m))==null?void 0:h[0])||m.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(r.current||!y)&&m.preventDefault(),o(!0)}},u=m=>{const v=ow(m.code,l);nw(i,a.current,!0)?(o(!1),a.current.clear()):a.current.delete(m[v]),m.key==="Meta"&&a.current.clear(),r.current=!1},d=()=>{a.current.clear(),o(!1)};return s==null||s.addEventListener("keydown",f),s==null||s.addEventListener("keyup",u),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{s==null||s.removeEventListener("keydown",f),s==null||s.removeEventListener("keyup",u),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,o]),n}function nw(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function ow(e,t){return t.includes(e)?"code":"key"}const z$=()=>{const e=Be();return p.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,a],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:a,maxZoom:i,panZoom:l}=e.getState(),s=Jg(t,o,r,a,i,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(s,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:a,domNode:i}=e.getState();if(!i)return t;const{x:l,y:s}=i.getBoundingClientRect(),c={x:t.x-l,y:t.y-s},f=n.snapGrid??r,u=n.snapToGrid??a;return Rs(c,o,u,f)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:a}=o.getBoundingClientRect(),i=Gu(t,n);return{x:i.x+r,y:i.y+a}}}),[])};function FC(e,t){const n=[],o=new Map,r=[];for(const a of e)if(a.type==="add"){r.push(a);continue}else if(a.type==="remove"||a.type==="replace")o.set(a.id,[a]);else{const i=o.get(a.id);i?i.push(a):o.set(a.id,[a])}for(const a of t){const i=o.get(a.id);if(!i){n.push(a);continue}if(i[0].type==="remove")continue;if(i[0].type==="replace"){n.push({...i[0].item});continue}const l={...a};for(const s of i)I$(s,l);n.push(l)}return r.length&&r.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function I$(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function XC(e,t){return FC(e,t)}function L$(e,t){return FC(e,t)}function Tr(e,t){return{id:e,type:"select",selected:t}}function $a(e,t=new Set,n=!1){const o=[];for(const[r,a]of e){const i=t.has(r);!(a.selected===void 0&&!i)&&a.selected!==i&&(n&&(a.selected=i),o.push(Tr(a.id,i)))}return o}function rw({items:e=[],lookup:t}){var r;const n=[],o=new Map(e.map(a=>[a.id,a]));for(const[a,i]of e.entries()){const l=t.get(i.id),s=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;s!==void 0&&s!==i&&n.push({id:i.id,item:i,type:"replace"}),s===void 0&&n.push({item:i,type:"add",index:a})}for(const[a]of t)o.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function aw(e){return{id:e.id,type:"remove"}}const iw=e=>Kk(e),k$=e=>uC(e);function KC(e){return p.forwardRef(e)}const $$=typeof window<"u"?p.useLayoutEffect:p.useEffect;function lw(e){const[t,n]=p.useState(BigInt(0)),[o]=p.useState(()=>H$(()=>n(r=>r+BigInt(1))));return $$(()=>{const r=o.get();r.length&&(e(r),o.reset())},[t]),o}function H$(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const jC=p.createContext(null);function B$({children:e}){const t=Be(),n=p.useCallback(l=>{const{nodes:s=[],setNodes:c,hasDefaultNodes:f,onNodesChange:u,nodeLookup:d,fitViewQueued:m}=t.getState();let v=s;for(const x of l)v=typeof x=="function"?x(v):x;const g=rw({items:v,lookup:d});f&&c(v),g.length>0?u==null||u(g):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:x,nodes:h,setNodes:w}=t.getState();x&&w(h)})},[]),o=lw(n),r=p.useCallback(l=>{const{edges:s=[],setEdges:c,hasDefaultEdges:f,onEdgesChange:u,edgeLookup:d}=t.getState();let m=s;for(const v of l)m=typeof v=="function"?v(m):v;f?c(m):u&&u(rw({items:m,lookup:d}))},[]),a=lw(r),i=p.useMemo(()=>({nodeQueue:o,edgeQueue:a}),[]);return b(jC.Provider,{value:i,children:e})}function U$(){const e=p.useContext(jC);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const V$=e=>!!e.panZoom;function Ts(){const e=z$(),t=Be(),n=U$(),o=we(V$),r=p.useMemo(()=>{const a=u=>t.getState().nodeLookup.get(u),i=u=>{n.nodeQueue.push(u)},l=u=>{n.edgeQueue.push(u)},s=u=>{var h,w;const{nodeLookup:d,nodeOrigin:m}=t.getState(),v=iw(u)?u:d.get(u.id),g=v.parentId?gC(v.position,v.measured,v.parentId,d,m):v.position,x={...v,position:g,width:((h=v.measured)==null?void 0:h.width)??v.width,height:((w=v.measured)==null?void 0:w.height)??v.height};return mi(x)},c=(u,d,m={replace:!1})=>{i(v=>v.map(g=>{if(g.id===u){const x=typeof d=="function"?d(g):d;return m.replace&&iw(x)?x:{...g,...x}}return g}))},f=(u,d,m={replace:!1})=>{l(v=>v.map(g=>{if(g.id===u){const x=typeof d=="function"?d(g):d;return m.replace&&k$(x)?x:{...g,...x}}return g}))};return{getNodes:()=>t.getState().nodes.map(u=>({...u})),getNode:u=>{var d;return(d=a(u))==null?void 0:d.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:u=[]}=t.getState();return u.map(d=>({...d}))},getEdge:u=>t.getState().edgeLookup.get(u),setNodes:i,setEdges:l,addNodes:u=>{const d=Array.isArray(u)?u:[u];n.nodeQueue.push(m=>[...m,...d])},addEdges:u=>{const d=Array.isArray(u)?u:[u];n.edgeQueue.push(m=>[...m,...d])},toObject:()=>{const{nodes:u=[],edges:d=[],transform:m}=t.getState(),[v,g,x]=m;return{nodes:u.map(h=>({...h})),edges:d.map(h=>({...h})),viewport:{x:v,y:g,zoom:x}}},deleteElements:async({nodes:u=[],edges:d=[]})=>{const{nodes:m,edges:v,onNodesDelete:g,onEdgesDelete:x,triggerNodeChanges:h,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:S}=t.getState(),{nodes:E,edges:N}=await Wk({nodesToRemove:u,edgesToRemove:d,nodes:m,edges:v,onBeforeDelete:S}),C=N.length>0,A=E.length>0;if(C){const T=N.map(aw);x==null||x(N),w(T)}if(A){const T=E.map(aw);g==null||g(E),h(T)}return(A||C)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(u,d=!0,m)=>{const v=Lb(u),g=v?u:s(u),x=m!==void 0;return g?(m||t.getState().nodes).filter(h=>{const w=t.getState().nodeLookup.get(h.id);if(w&&!v&&(h.id===u.id||!w.internals.positionAbsolute))return!1;const y=mi(x?h:w),S=Ql(y,g);return d&&S>0||S>=y.width*y.height||S>=g.width*g.height}):[]},isNodeIntersecting:(u,d,m=!0)=>{const g=Lb(u)?u:s(u);if(!g)return!1;const x=Ql(g,d);return m&&x>0||x>=d.width*d.height||x>=g.width*g.height},updateNode:c,updateNodeData:(u,d,m={replace:!1})=>{c(u,v=>{const g=typeof d=="function"?d(v):d;return m.replace?{...v,data:g}:{...v,data:{...v.data,...g}}},m)},updateEdge:f,updateEdgeData:(u,d,m={replace:!1})=>{f(u,v=>{const g=typeof d=="function"?d(v):d;return m.replace?{...v,data:g}:{...v,data:{...v.data,...g}}},m)},getNodesBounds:u=>{const{nodeLookup:d,nodeOrigin:m}=t.getState();return jk(u,{nodeLookup:d,nodeOrigin:m})},getHandleConnections:({type:u,id:d,nodeId:m})=>{var v;return Array.from(((v=t.getState().connectionLookup.get(`${m}-${u}${d?`-${d}`:""}`))==null?void 0:v.values())??[])},getNodeConnections:({type:u,handleId:d,nodeId:m})=>{var v;return Array.from(((v=t.getState().connectionLookup.get(`${m}${u?d?`-${u}-${d}`:`-${u}`:""}`))==null?void 0:v.values())??[])},fitView:async u=>{const d=t.getState().fitViewResolver??n4();return t.setState({fitViewQueued:!0,fitViewOptions:u,fitViewResolver:d}),n.nodeQueue.push(m=>[...m]),d.promise}}},[]);return p.useMemo(()=>({...r,...e,viewportInitialized:o}),[o])}const sw=e=>e.selected,G$=typeof window<"u"?window:void 0;function Y$({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Be(),{deleteElements:o}=Ts(),r=es(e,{actInsideInputWithModifier:!1}),a=es(t,{target:G$});p.useEffect(()=>{if(r){const{edges:i,nodes:l}=n.getState();o({nodes:l.filter(sw),edges:i.filter(sw)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function F$(e){const t=Be();p.useEffect(()=>{const n=()=>{var r,a,i,l;if(!e.current||!(((a=(r=e.current).checkVisibility)==null?void 0:a.call(r))??!0))return!1;const o=ev(e.current);(o.height===0||o.width===0)&&((l=(i=t.getState()).onError)==null||l.call(i,"004",Hn.error004())),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const jd={position:"absolute",width:"100%",height:"100%",top:0,left:0},X$=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function K$({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:r=.5,panOnScrollMode:a=Lr.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:s,translateExtent:c,minZoom:f,maxZoom:u,zoomActivationKeyCode:d,preventScrolling:m=!0,children:v,noWheelClassName:g,noPanClassName:x,onViewportChange:h,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:S}){const E=Be(),N=p.useRef(null),{userSelectionActive:C,lib:A,connectionInProgress:T}=we(X$,Fe),k=es(d),z=p.useRef();F$(N);const O=p.useCallback(P=>{h==null||h({x:P[0],y:P[1],zoom:P[2]}),w||E.setState({transform:P})},[h,w]);return p.useEffect(()=>{if(N.current){z.current=$4({domNode:N.current,minZoom:f,maxZoom:u,translateExtent:c,viewport:s,onDraggingChange:R=>E.setState({paneDragging:R}),onPanZoomStart:(R,I)=>{const{onViewportChangeStart:D,onMoveStart:M}=E.getState();M==null||M(R,I),D==null||D(I)},onPanZoom:(R,I)=>{const{onViewportChange:D,onMove:M}=E.getState();M==null||M(R,I),D==null||D(I)},onPanZoomEnd:(R,I)=>{const{onViewportChangeEnd:D,onMoveEnd:M}=E.getState();M==null||M(R,I),D==null||D(I)}});const{x:P,y:_,zoom:L}=z.current.getViewport();return E.setState({panZoom:z.current,transform:[P,_,L],domNode:N.current.closest(".react-flow")}),()=>{var R;(R=z.current)==null||R.destroy()}}},[]),p.useEffect(()=>{var P;(P=z.current)==null||P.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:r,panOnScrollMode:a,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:k,preventScrolling:m,noPanClassName:x,userSelectionActive:C,noWheelClassName:g,lib:A,onTransformChange:O,connectionInProgress:T,selectionOnDrag:S,paneClickDistance:y})},[e,t,n,o,r,a,i,l,k,m,x,C,g,A,O,T,S,y]),b("div",{className:"react-flow__renderer",ref:N,style:jd,children:v})}const j$=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function q$(){const{userSelectionActive:e,userSelectionRect:t}=we(j$,Fe);return e&&t?b("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Tp=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Z$=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function Q$({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Zl.Full,panOnDrag:o,paneClickDistance:r,selectionOnDrag:a,onSelectionStart:i,onSelectionEnd:l,onPaneClick:s,onPaneContextMenu:c,onPaneScroll:f,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:m,children:v}){const g=Be(),{userSelectionActive:x,elementsSelectable:h,dragging:w,connectionInProgress:y}=we(Z$,Fe),S=h&&(e||x),E=p.useRef(null),N=p.useRef(),C=p.useRef(new Set),A=p.useRef(new Set),T=p.useRef(!1),k=D=>{if(T.current||y){T.current=!1;return}s==null||s(D),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},z=D=>{if(Array.isArray(o)&&(o!=null&&o.includes(2))){D.preventDefault();return}c==null||c(D)},O=f?D=>f(D):void 0,P=D=>{T.current&&(D.stopPropagation(),T.current=!1)},_=D=>{var Y,q;const{domNode:M}=g.getState();if(N.current=M==null?void 0:M.getBoundingClientRect(),!N.current)return;const U=D.target===E.current;if(!U&&!!D.target.closest(".nokey")||!e||!(a&&U||t)||D.button!==0||!D.isPrimary)return;(q=(Y=D.target)==null?void 0:Y.setPointerCapture)==null||q.call(Y,D.pointerId),T.current=!1;const{x:H,y:V}=wn(D.nativeEvent,N.current);g.setState({userSelectionRect:{width:0,height:0,startX:H,startY:V,x:H,y:V}}),U||(D.stopPropagation(),D.preventDefault())},L=D=>{const{userSelectionRect:M,transform:U,nodeLookup:F,edgeLookup:$,connectionLookup:H,triggerNodeChanges:V,triggerEdgeChanges:Y,defaultEdgeOptions:q,resetSelectedElements:B}=g.getState();if(!N.current||!M)return;const{x:G,y:Z}=wn(D.nativeEvent,N.current),{startX:ee,startY:te}=M;if(!T.current){const ae=t?0:r;if(Math.hypot(G-ee,Z-te)<=ae)return;B(),i==null||i(D)}T.current=!0;const K={startX:ee,startY:te,x:G<ee?G:ee,y:Z<te?Z:te,width:Math.abs(G-ee),height:Math.abs(Z-te)},W=C.current,Q=A.current;C.current=new Set(Wg(F,K,U,n===Zl.Partial,!0).map(ae=>ae.id)),A.current=new Set;const ne=(q==null?void 0:q.selectable)??!0;for(const ae of C.current){const ce=H.get(ae);if(ce)for(const{edgeId:fe}of ce.values()){const ue=$.get(fe);ue&&(ue.selectable??ne)&&A.current.add(fe)}}if(!kb(W,C.current)){const ae=$a(F,C.current,!0);V(ae)}if(!kb(Q,A.current)){const ae=$a($,A.current);Y(ae)}g.setState({userSelectionRect:K,userSelectionActive:!0,nodesSelectionActive:!1})},R=D=>{var M,U;D.button===0&&((U=(M=D.target)==null?void 0:M.releasePointerCapture)==null||U.call(M,D.pointerId),!x&&D.target===E.current&&g.getState().userSelectionRect&&(k==null||k(D)),g.setState({userSelectionActive:!1,userSelectionRect:null}),T.current&&(l==null||l(D),g.setState({nodesSelectionActive:C.current.size>0})))},I=o===!0||Array.isArray(o)&&o.includes(0);return re("div",{className:tt(["react-flow__pane",{draggable:I,dragging:w,selection:e}]),onClick:S?void 0:Tp(k,E),onContextMenu:Tp(z,E),onWheel:Tp(O,E),onPointerEnter:S?void 0:u,onPointerMove:S?L:d,onPointerUp:S?R:void 0,onPointerDownCapture:S?_:void 0,onClickCapture:S?P:void 0,onPointerLeave:m,ref:E,style:jd,children:[v,b(q$,{})]})}function rh({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:a,multiSelectionActive:i,nodeLookup:l,onError:s}=t.getState(),c=l.get(e);if(!c){s==null||s("012",Hn.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(a({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var f;return(f=o==null?void 0:o.current)==null?void 0:f.blur()})):r([e])}function qC({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:a,nodeClickDistance:i}){const l=Be(),[s,c]=p.useState(!1),f=p.useRef();return p.useEffect(()=>{f.current=C4({getStoreItems:()=>l.getState(),onNodeMouseDown:u=>{rh({id:u,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),p.useEffect(()=>{var u,d;if(t)(u=f.current)==null||u.destroy();else if(e.current)return(d=f.current)==null||d.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:a,nodeId:r,nodeClickDistance:i}),()=>{var m;(m=f.current)==null||m.destroy()}},[n,o,t,a,e,r]),s}const W$=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function ZC(){const e=Be();return p.useCallback(n=>{const{nodeExtent:o,snapToGrid:r,snapGrid:a,nodesDraggable:i,onError:l,updateNodePositions:s,nodeLookup:c,nodeOrigin:f}=e.getState(),u=new Map,d=W$(i),m=r?a[0]:5,v=r?a[1]:5,g=n.direction.x*m*n.factor,x=n.direction.y*v*n.factor;for(const[,h]of c){if(!d(h))continue;let w={x:h.internals.positionAbsolute.x+g,y:h.internals.positionAbsolute.y+x};r&&(w=_s(w,a));const{position:y,positionAbsolute:S}=dC({nodeId:h.id,nextPosition:w,nodeLookup:c,nodeExtent:o,nodeOrigin:f,onError:l});h.position=y,h.internals.positionAbsolute=S,u.set(h.id,h)}s(u)},[])}const iv=p.createContext(null),J$=iv.Provider;iv.Consumer;const QC=()=>p.useContext(iv),eH=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),tH=(e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:a,connection:i}=o,{fromHandle:l,toHandle:s,isValid:c}=i,f=(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:f,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:a===Yr.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:f&&c}};function nH({type:e="source",position:t=se.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:a=!0,id:i,onConnect:l,children:s,className:c,onMouseDown:f,onTouchStart:u,...d},m){var L,R;const v=i||null,g=e==="target",x=Be(),h=QC(),{connectOnClick:w,noPanClassName:y,rfId:S}=we(eH,Fe),{connectingFrom:E,connectingTo:N,clickConnecting:C,isPossibleEndHandle:A,connectionInProcess:T,clickConnectionInProcess:k,valid:z}=we(tH(h,v,e),Fe);h||(R=(L=x.getState()).onError)==null||R.call(L,"010",Hn.error010());const O=I=>{const{defaultEdgeOptions:D,onConnect:M,hasDefaultEdges:U}=x.getState(),F={...D,...I};if(U){const{edges:$,setEdges:H}=x.getState();H(tv(F,$))}M==null||M(F),l==null||l(F)},P=I=>{if(!h)return;const D=bC(I.nativeEvent);if(r&&(D&&I.button===0||!D)){const M=x.getState();oh.onPointerDown(I.nativeEvent,{handleDomNode:I.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:g,handleId:v,nodeId:h,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:M.onConnectEnd,updateConnection:M.updateConnection,onConnect:O,isValidConnection:n||M.isValidConnection,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}D?f==null||f(I):u==null||u(I)},_=I=>{const{onClickConnectStart:D,onClickConnectEnd:M,connectionClickStartHandle:U,connectionMode:F,isValidConnection:$,lib:H,rfId:V,nodeLookup:Y,connection:q}=x.getState();if(!h||!U&&!r)return;if(!U){D==null||D(I.nativeEvent,{nodeId:h,handleId:v,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:h,type:e,id:v}});return}const B=vC(I.target),G=n||$,{connection:Z,isValid:ee}=oh.isValid(I.nativeEvent,{handle:{nodeId:h,id:v,type:e},connectionMode:F,fromNodeId:U.nodeId,fromHandleId:U.id||null,fromType:U.type,isValidConnection:G,flowId:V,doc:B,lib:H,nodeLookup:Y});ee&&Z&&O(Z);const te=structuredClone(q);delete te.inProgress,te.toPosition=te.toHandle?te.toHandle.position:null,M==null||M(I,te),x.setState({connectionClickStartHandle:null})};return b("div",{"data-handleid":v,"data-nodeid":h,"data-handlepos":t,"data-id":`${S}-${h}-${v}-${e}`,className:tt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,c,{source:!g,target:g,connectable:o,connectablestart:r,connectableend:a,clickconnecting:C,connectingfrom:E,connectingto:N,valid:z,connectionindicator:o&&(!T||A)&&(T||k?a:r)}]),onMouseDown:P,onTouchStart:P,onClick:w?_:void 0,ref:m,...d,children:s})}const yi=p.memo(KC(nH));function oH({data:e,isConnectable:t,sourcePosition:n=se.Bottom}){return re(De,{children:[e==null?void 0:e.label,b(yi,{type:"source",position:n,isConnectable:t})]})}function rH({data:e,isConnectable:t,targetPosition:n=se.Top,sourcePosition:o=se.Bottom}){return re(De,{children:[b(yi,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,b(yi,{type:"source",position:o,isConnectable:t})]})}function aH(){return null}function iH({data:e,isConnectable:t,targetPosition:n=se.Top}){return re(De,{children:[b(yi,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Fu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},cw={input:oH,default:rH,output:iH,group:aH};function lH(e){var t,n,o,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((o=e.style)==null?void 0:o.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const sH=e=>{const{width:t,height:n,x:o,y:r}=Ns(e.nodeLookup,{filter:a=>!!a.selected});return{width:bn(t)?t:null,height:bn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function cH({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=Be(),{width:r,height:a,transformString:i,userSelectionActive:l}=we(sH,Fe),s=ZC(),c=p.useRef(null);if(p.useEffect(()=>{var d;n||(d=c.current)==null||d.focus({preventScroll:!0})},[n]),qC({nodeRef:c}),l||!r||!a)return null;const f=e?d=>{const m=o.getState().nodes.filter(v=>v.selected);e(d,m)}:void 0,u=d=>{Object.prototype.hasOwnProperty.call(Fu,d.key)&&(d.preventDefault(),s({direction:Fu[d.key],factor:d.shiftKey?4:1}))};return b("div",{className:tt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:b("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:u,style:{width:r,height:a}})})}const uw=typeof window<"u"?window:void 0,uH=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function WC({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:a,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:s,selectionKeyCode:c,selectionOnDrag:f,selectionMode:u,onSelectionStart:d,onSelectionEnd:m,multiSelectionKeyCode:v,panActivationKeyCode:g,zoomActivationKeyCode:x,elementsSelectable:h,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:S,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:C,panOnDrag:A,defaultViewport:T,translateExtent:k,minZoom:z,maxZoom:O,preventScrolling:P,onSelectionContextMenu:_,noWheelClassName:L,noPanClassName:R,disableKeyboardA11y:I,onViewportChange:D,isControlledViewport:M}){const{nodesSelectionActive:U,userSelectionActive:F}=we(uH),$=es(c,{target:uw}),H=es(g,{target:uw}),V=H||A,Y=H||S,q=f&&V!==!0,B=$||F||q;return Y$({deleteKeyCode:s,multiSelectionKeyCode:v}),b(K$,{onPaneContextMenu:a,elementsSelectable:h,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:Y,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:C,panOnDrag:!$&&V,defaultViewport:T,translateExtent:k,minZoom:z,maxZoom:O,zoomActivationKeyCode:x,preventScrolling:P,noWheelClassName:L,noPanClassName:R,onViewportChange:D,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:q,children:re(Q$,{onSelectionStart:d,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:a,onPaneScroll:i,panOnDrag:V,isSelecting:!!B,selectionMode:u,selectionKeyPressed:$,paneClickDistance:l,selectionOnDrag:q,children:[e,U&&b(cH,{onSelectionContextMenu:_,noPanClassName:R,disableKeyboardA11y:I})]})})}WC.displayName="FlowRenderer";const dH=p.memo(WC),fH=e=>t=>e?Wg(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function pH(e){return we(p.useCallback(fH(e),[e]),Fe)}const mH=e=>e.updateNodeInternals;function hH(){const e=we(mH),[t]=p.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(r=>{const a=r.target.getAttribute("data-id");o.set(a,{id:a,nodeElement:r.target,force:!0})}),e(o)}));return p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function gH({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const r=Be(),a=p.useRef(null),i=p.useRef(null),l=p.useRef(e.sourcePosition),s=p.useRef(e.targetPosition),c=p.useRef(t),f=n&&!!e.internals.handleBounds;return p.useEffect(()=>{a.current&&!e.hidden&&(!f||i.current!==a.current)&&(i.current&&(o==null||o.unobserve(i.current)),o==null||o.observe(a.current),i.current=a.current)},[f,e.hidden]),p.useEffect(()=>()=>{i.current&&(o==null||o.unobserve(i.current),i.current=null)},[]),p.useEffect(()=>{if(a.current){const u=c.current!==t,d=l.current!==e.sourcePosition,m=s.current!==e.targetPosition;(u||d||m)&&(c.current=t,l.current=e.sourcePosition,s.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function vH({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:a,onDoubleClick:i,nodesDraggable:l,elementsSelectable:s,nodesConnectable:c,nodesFocusable:f,resizeObserver:u,noDragClassName:d,noPanClassName:m,disableKeyboardA11y:v,rfId:g,nodeTypes:x,nodeClickDistance:h,onError:w}){const{node:y,internals:S,isParent:E}=we(G=>{const Z=G.nodeLookup.get(e),ee=G.parentLookup.has(e);return{node:Z,internals:Z.internals,isParent:ee}},Fe);let N=y.type||"default",C=(x==null?void 0:x[N])||cw[N];C===void 0&&(w==null||w("003",Hn.error003(N)),N="default",C=(x==null?void 0:x.default)||cw.default);const A=!!(y.draggable||l&&typeof y.draggable>"u"),T=!!(y.selectable||s&&typeof y.selectable>"u"),k=!!(y.connectable||c&&typeof y.connectable>"u"),z=!!(y.focusable||f&&typeof y.focusable>"u"),O=Be(),P=hC(y),_=gH({node:y,nodeType:N,hasDimensions:P,resizeObserver:u}),L=qC({nodeRef:_,disabled:y.hidden||!A,noDragClassName:d,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:h}),R=ZC();if(y.hidden)return null;const I=xo(y),D=lH(y),M=T||A||t||n||o||r,U=n?G=>n(G,{...S.userNode}):void 0,F=o?G=>o(G,{...S.userNode}):void 0,$=r?G=>r(G,{...S.userNode}):void 0,H=a?G=>a(G,{...S.userNode}):void 0,V=i?G=>i(G,{...S.userNode}):void 0,Y=G=>{const{selectNodesOnDrag:Z,nodeDragThreshold:ee}=O.getState();T&&(!Z||!A||ee>0)&&rh({id:e,store:O,nodeRef:_}),t&&t(G,{...S.userNode})},q=G=>{if(!(yC(G.nativeEvent)||v)){if(iC.includes(G.key)&&T){const Z=G.key==="Escape";rh({id:e,store:O,unselect:Z,nodeRef:_})}else if(A&&y.selected&&Object.prototype.hasOwnProperty.call(Fu,G.key)){G.preventDefault();const{ariaLabelConfig:Z}=O.getState();O.setState({ariaLiveMessage:Z["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~S.positionAbsolute.x,y:~~S.positionAbsolute.y})}),R({direction:Fu[G.key],factor:G.shiftKey?4:1})}}},B=()=>{var Q;if(v||!((Q=_.current)!=null&&Q.matches(":focus-visible")))return;const{transform:G,width:Z,height:ee,autoPanOnNodeFocus:te,setCenter:K}=O.getState();if(!te)return;Wg(new Map([[e,y]]),{x:0,y:0,width:Z,height:ee},G,!0).length>0||K(y.position.x+I.width/2,y.position.y+I.height/2,{zoom:G[2]})};return b("div",{className:tt(["react-flow__node",`react-flow__node-${N}`,{[m]:A},y.className,{selected:y.selected,selectable:T,parent:E,draggable:A,dragging:L}]),ref:_,style:{zIndex:S.z,transform:`translate(${S.positionAbsolute.x}px,${S.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:P?"visible":"hidden",...y.style,...D},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:U,onMouseMove:F,onMouseLeave:$,onContextMenu:H,onClick:Y,onDoubleClick:V,onKeyDown:z?q:void 0,tabIndex:z?0:void 0,onFocus:z?B:void 0,role:y.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":v?void 0:`${VC}-${g}`,"aria-label":y.ariaLabel,...y.domAttributes,children:b(J$,{value:e,children:b(C,{id:e,data:y.data,type:N,positionAbsoluteX:S.positionAbsolute.x,positionAbsoluteY:S.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:A,deletable:y.deletable??!0,isConnectable:k,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:L,dragHandle:y.dragHandle,zIndex:S.z,parentId:y.parentId,...I})})})}var yH=p.memo(vH);const bH=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function JC(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,onError:a}=we(bH,Fe),i=pH(e.onlyRenderVisibleElements),l=hH();return b("div",{className:"react-flow__nodes",style:jd,children:i.map(s=>b(yH,{id:s,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:a},s))})}JC.displayName="NodeRenderer";const wH=p.memo(JC);function xH(e){return we(p.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const o=[];if(n.width&&n.height)for(const r of n.edges){const a=n.nodeLookup.get(r.source),i=n.nodeLookup.get(r.target);a&&i&&i4({sourceNode:a,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&o.push(r.id)}return o},[e]),Fe)}const SH=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return b("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},EH=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return b("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},dw={[Uu.Arrow]:SH,[Uu.ArrowClosed]:EH};function CH(e){const t=Be();return p.useMemo(()=>{var r,a;return Object.prototype.hasOwnProperty.call(dw,e)?dw[e]:((a=(r=t.getState()).onError)==null||a.call(r,"009",Hn.error009(e)),null)},[e])}const NH=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:a="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const s=CH(t);return s?b("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:b(s,{color:n,strokeWidth:i})}):null},eN=({defaultColor:e,rfId:t})=>{const n=we(a=>a.edges),o=we(a=>a.defaultEdgeOptions),r=p.useMemo(()=>p4(n,{id:t,defaultColor:e,defaultMarkerStart:o==null?void 0:o.markerStart,defaultMarkerEnd:o==null?void 0:o.markerEnd}),[n,o,t,e]);return r.length?b("svg",{className:"react-flow__marker","aria-hidden":"true",children:b("defs",{children:r.map(a=>b(NH,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};eN.displayName="MarkerDefinitions";var _H=p.memo(eN);function tN({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:a,labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:s,className:c,...f}){const[u,d]=p.useState({x:1,y:0,width:0,height:0}),m=tt(["react-flow__edge-textwrapper",c]),v=p.useRef(null);return p.useEffect(()=>{if(v.current){const g=v.current.getBBox();d({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n?re("g",{transform:`translate(${e-u.width/2} ${t-u.height/2})`,className:m,visibility:u.width?"visible":"hidden",...f,children:[r&&b("rect",{width:u.width+2*i[0],x:-i[0],y:-i[1],height:u.height+2*i[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),b("text",{className:"react-flow__edge-text",y:u.height/2,dy:"0.3em",ref:v,style:o,children:n}),s]}):null}tN.displayName="EdgeText";const RH=p.memo(tN);function qd({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:a,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:s,interactionWidth:c=20,...f}){return re(De,{children:[b("path",{...f,d:e,fill:"none",className:tt(["react-flow__edge-path",f.className])}),c?b("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,o&&bn(t)&&bn(n)?b(RH,{x:t,y:n,label:o,labelStyle:r,labelShowBg:a,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function fw({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===se.Left||e===se.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function nN({sourceX:e,sourceY:t,sourcePosition:n=se.Bottom,targetX:o,targetY:r,targetPosition:a=se.Top}){const[i,l]=fw({pos:n,x1:e,y1:t,x2:o,y2:r}),[s,c]=fw({pos:a,x1:o,y1:r,x2:e,y2:t}),[f,u,d,m]=wC({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:i,sourceControlY:l,targetControlX:s,targetControlY:c});return[`M${e},${t} C${i},${l} ${s},${c} ${o},${r}`,f,u,d,m]}function oN(e){return p.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:a,sourcePosition:i,targetPosition:l,label:s,labelStyle:c,labelShowBg:f,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:m,style:v,markerEnd:g,markerStart:x,interactionWidth:h})=>{const[w,y,S]=nN({sourceX:n,sourceY:o,sourcePosition:i,targetX:r,targetY:a,targetPosition:l}),E=e.isInternal?void 0:t;return b(qd,{id:E,path:w,labelX:y,labelY:S,label:s,labelStyle:c,labelShowBg:f,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:m,style:v,markerEnd:g,markerStart:x,interactionWidth:h})})}const TH=oN({isInternal:!1}),rN=oN({isInternal:!0});TH.displayName="SimpleBezierEdge";rN.displayName="SimpleBezierEdgeInternal";function aN(e){return p.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:a,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:u,style:d,sourcePosition:m=se.Bottom,targetPosition:v=se.Top,markerEnd:g,markerStart:x,pathOptions:h,interactionWidth:w})=>{const[y,S,E]=Yu({sourceX:n,sourceY:o,sourcePosition:m,targetX:r,targetY:a,targetPosition:v,borderRadius:h==null?void 0:h.borderRadius,offset:h==null?void 0:h.offset,stepPosition:h==null?void 0:h.stepPosition}),N=e.isInternal?void 0:t;return b(qd,{id:N,path:y,labelX:S,labelY:E,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:u,style:d,markerEnd:g,markerStart:x,interactionWidth:w})})}const iN=aN({isInternal:!1}),lN=aN({isInternal:!0});iN.displayName="SmoothStepEdge";lN.displayName="SmoothStepEdgeInternal";function sN(e){return p.memo(({id:t,...n})=>{var r;const o=e.isInternal?void 0:t;return b(iN,{...n,id:o,pathOptions:p.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const AH=sN({isInternal:!1}),cN=sN({isInternal:!0});AH.displayName="StepEdge";cN.displayName="StepEdgeInternal";function uN(e){return p.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:a,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:u,style:d,markerEnd:m,markerStart:v,interactionWidth:g})=>{const[x,h,w]=EC({sourceX:n,sourceY:o,targetX:r,targetY:a}),y=e.isInternal?void 0:t;return b(qd,{id:y,path:x,labelX:h,labelY:w,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:u,style:d,markerEnd:m,markerStart:v,interactionWidth:g})})}const MH=uN({isInternal:!1}),dN=uN({isInternal:!0});MH.displayName="StraightEdge";dN.displayName="StraightEdgeInternal";function fN(e){return p.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:a,sourcePosition:i=se.Bottom,targetPosition:l=se.Top,label:s,labelStyle:c,labelShowBg:f,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:m,style:v,markerEnd:g,markerStart:x,pathOptions:h,interactionWidth:w})=>{const[y,S,E]=xC({sourceX:n,sourceY:o,sourcePosition:i,targetX:r,targetY:a,targetPosition:l,curvature:h==null?void 0:h.curvature}),N=e.isInternal?void 0:t;return b(qd,{id:N,path:y,labelX:S,labelY:E,label:s,labelStyle:c,labelShowBg:f,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:m,style:v,markerEnd:g,markerStart:x,interactionWidth:w})})}const DH=fN({isInternal:!1}),pN=fN({isInternal:!0});DH.displayName="BezierEdge";pN.displayName="BezierEdgeInternal";const pw={default:pN,straight:dN,step:cN,smoothstep:lN,simplebezier:rN},mw={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},OH=(e,t,n)=>n===se.Left?e-t:n===se.Right?e+t:e,PH=(e,t,n)=>n===se.Top?e-t:n===se.Bottom?e+t:e,hw="react-flow__edgeupdater";function gw({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:a,onMouseOut:i,type:l}){return b("circle",{onMouseDown:r,onMouseEnter:a,onMouseOut:i,className:tt([hw,`${hw}-${l}`]),cx:OH(t,o,e),cy:PH(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function zH({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:a,targetY:i,sourcePosition:l,targetPosition:s,onReconnect:c,onReconnectStart:f,onReconnectEnd:u,setReconnecting:d,setUpdateHover:m}){const v=Be(),g=(S,E)=>{if(S.button!==0)return;const{autoPanOnConnect:N,domNode:C,isValidConnection:A,connectionMode:T,connectionRadius:k,lib:z,onConnectStart:O,onConnectEnd:P,cancelConnection:_,nodeLookup:L,rfId:R,panBy:I,updateConnection:D}=v.getState(),M=E.type==="target",U=(H,V)=>{d(!1),u==null||u(H,n,E.type,V)},F=H=>c==null?void 0:c(n,H),$=(H,V)=>{d(!0),f==null||f(S,n,E.type),O==null||O(H,V)};oh.onPointerDown(S.nativeEvent,{autoPanOnConnect:N,connectionMode:T,connectionRadius:k,domNode:C,handleId:E.id,nodeId:E.nodeId,nodeLookup:L,isTarget:M,edgeUpdaterType:E.type,lib:z,flowId:R,cancelConnection:_,panBy:I,isValidConnection:A,onConnect:F,onConnectStart:$,onConnectEnd:P,onReconnectEnd:U,updateConnection:D,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,dragThreshold:v.getState().connectionDragThreshold,handleDomNode:S.currentTarget})},x=S=>g(S,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),h=S=>g(S,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>m(!0),y=()=>m(!1);return re(De,{children:[(e===!0||e==="source")&&b(gw,{position:l,centerX:o,centerY:r,radius:t,onMouseDown:x,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&b(gw,{position:s,centerX:a,centerY:i,radius:t,onMouseDown:h,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function IH({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:a,onContextMenu:i,onMouseEnter:l,onMouseMove:s,onMouseLeave:c,reconnectRadius:f,onReconnect:u,onReconnectStart:d,onReconnectEnd:m,rfId:v,edgeTypes:g,noPanClassName:x,onError:h,disableKeyboardA11y:w}){let y=we(K=>K.edgeLookup.get(e));const S=we(K=>K.defaultEdgeOptions);y=S?{...S,...y}:y;let E=y.type||"default",N=(g==null?void 0:g[E])||pw[E];N===void 0&&(h==null||h("011",Hn.error011(E)),E="default",N=(g==null?void 0:g.default)||pw.default);const C=!!(y.focusable||t&&typeof y.focusable>"u"),A=typeof u<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),T=!!(y.selectable||o&&typeof y.selectable>"u"),k=p.useRef(null),[z,O]=p.useState(!1),[P,_]=p.useState(!1),L=Be(),{zIndex:R,sourceX:I,sourceY:D,targetX:M,targetY:U,sourcePosition:F,targetPosition:$}=we(p.useCallback(K=>{const W=K.nodeLookup.get(y.source),Q=K.nodeLookup.get(y.target);if(!W||!Q)return{zIndex:y.zIndex,...mw};const ne=f4({id:e,sourceNode:W,targetNode:Q,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:K.connectionMode,onError:h});return{zIndex:a4({selected:y.selected,zIndex:y.zIndex,sourceNode:W,targetNode:Q,elevateOnSelect:K.elevateEdgesOnSelect}),...ne||mw}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),Fe),H=p.useMemo(()=>y.markerStart?`url('#${th(y.markerStart,v)}')`:void 0,[y.markerStart,v]),V=p.useMemo(()=>y.markerEnd?`url('#${th(y.markerEnd,v)}')`:void 0,[y.markerEnd,v]);if(y.hidden||I===null||D===null||M===null||U===null)return null;const Y=K=>{var ae;const{addSelectedEdges:W,unselectNodesAndEdges:Q,multiSelectionActive:ne}=L.getState();T&&(L.setState({nodesSelectionActive:!1}),y.selected&&ne?(Q({nodes:[],edges:[y]}),(ae=k.current)==null||ae.blur()):W([e])),r&&r(K,y)},q=a?K=>{a(K,{...y})}:void 0,B=i?K=>{i(K,{...y})}:void 0,G=l?K=>{l(K,{...y})}:void 0,Z=s?K=>{s(K,{...y})}:void 0,ee=c?K=>{c(K,{...y})}:void 0,te=K=>{var W;if(!w&&iC.includes(K.key)&&T){const{unselectNodesAndEdges:Q,addSelectedEdges:ne}=L.getState();K.key==="Escape"?((W=k.current)==null||W.blur(),Q({edges:[y]})):ne([e])}};return b("svg",{style:{zIndex:R},children:re("g",{className:tt(["react-flow__edge",`react-flow__edge-${E}`,y.className,x,{selected:y.selected,animated:y.animated,inactive:!T&&!r,updating:z,selectable:T}]),onClick:Y,onDoubleClick:q,onContextMenu:B,onMouseEnter:G,onMouseMove:Z,onMouseLeave:ee,onKeyDown:C?te:void 0,tabIndex:C?0:void 0,role:y.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":C?`${GC}-${v}`:void 0,ref:k,...y.domAttributes,children:[!P&&b(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:T,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:I,sourceY:D,targetX:M,targetY:U,sourcePosition:F,targetPosition:$,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:H,markerEnd:V,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),A&&b(zH,{edge:y,isReconnectable:A,reconnectRadius:f,onReconnect:u,onReconnectStart:d,onReconnectEnd:m,sourceX:I,sourceY:D,targetX:M,targetY:U,sourcePosition:F,targetPosition:$,setUpdateHover:O,setReconnecting:_})]})})}var LH=p.memo(IH);const kH=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function mN({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:a,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:c,onEdgeClick:f,reconnectRadius:u,onEdgeDoubleClick:d,onReconnectStart:m,onReconnectEnd:v,disableKeyboardA11y:g}){const{edgesFocusable:x,edgesReconnectable:h,elementsSelectable:w,onError:y}=we(kH,Fe),S=xH(t);return re("div",{className:"react-flow__edges",children:[b(_H,{defaultColor:e,rfId:n}),S.map(E=>b(LH,{id:E,edgesFocusable:x,edgesReconnectable:h,elementsSelectable:w,noPanClassName:r,onReconnect:a,onContextMenu:i,onMouseEnter:l,onMouseMove:s,onMouseLeave:c,onClick:f,reconnectRadius:u,onDoubleClick:d,onReconnectStart:m,onReconnectEnd:v,rfId:n,onError:y,edgeTypes:o,disableKeyboardA11y:g},E))]})}mN.displayName="EdgeRenderer";const $H=p.memo(mN),HH=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function BH({children:e}){const t=we(HH);return b("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function UH(e){const t=Ts(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const VH=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function GH(e){const t=we(VH),n=Be();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function YH(e){return e.connection.inProgress?{...e.connection,to:Rs(e.connection.to,e.transform)}:{...e.connection}}function FH(e){return YH}function XH(e){const t=FH();return we(t,Fe)}const KH=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function jH({containerStyle:e,style:t,type:n,component:o}){const{nodesConnectable:r,width:a,height:i,isValid:l,inProgress:s}=we(KH,Fe);return!(a&&r&&s)?null:b("svg",{style:e,width:a,height:i,className:"react-flow__connectionline react-flow__container",children:b("g",{className:tt(["react-flow__connection",cC(l)]),children:b(hN,{style:t,type:n,CustomComponent:o,isValid:l})})})}const hN=({style:e,type:t=Ho.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:r,from:a,fromNode:i,fromHandle:l,fromPosition:s,to:c,toNode:f,toHandle:u,toPosition:d,pointer:m}=XH();if(!r)return;if(n)return b(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:a.x,fromY:a.y,toX:c.x,toY:c.y,fromPosition:s,toPosition:d,connectionStatus:cC(o),toNode:f,toHandle:u,pointer:m});let v="";const g={sourceX:a.x,sourceY:a.y,sourcePosition:s,targetX:c.x,targetY:c.y,targetPosition:d};switch(t){case Ho.Bezier:[v]=xC(g);break;case Ho.SimpleBezier:[v]=nN(g);break;case Ho.Step:[v]=Yu({...g,borderRadius:0});break;case Ho.SmoothStep:[v]=Yu(g);break;default:[v]=EC(g)}return b("path",{d:v,fill:"none",className:"react-flow__connection-path",style:e})};hN.displayName="ConnectionLine";const qH={};function vw(e=qH){p.useRef(e),Be(),p.useEffect(()=>{},[e])}function ZH(){Be(),p.useRef(!1),p.useEffect(()=>{},[])}function gN({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:a,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:c,onNodeContextMenu:f,onSelectionContextMenu:u,onSelectionStart:d,onSelectionEnd:m,connectionLineType:v,connectionLineStyle:g,connectionLineComponent:x,connectionLineContainerStyle:h,selectionKeyCode:w,selectionOnDrag:y,selectionMode:S,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:C,deleteKeyCode:A,onlyRenderVisibleElements:T,elementsSelectable:k,defaultViewport:z,translateExtent:O,minZoom:P,maxZoom:_,preventScrolling:L,defaultMarkerColor:R,zoomOnScroll:I,zoomOnPinch:D,panOnScroll:M,panOnScrollSpeed:U,panOnScrollMode:F,zoomOnDoubleClick:$,panOnDrag:H,onPaneClick:V,onPaneMouseEnter:Y,onPaneMouseMove:q,onPaneMouseLeave:B,onPaneScroll:G,onPaneContextMenu:Z,paneClickDistance:ee,nodeClickDistance:te,onEdgeContextMenu:K,onEdgeMouseEnter:W,onEdgeMouseMove:Q,onEdgeMouseLeave:ne,reconnectRadius:ae,onReconnect:ce,onReconnectStart:fe,onReconnectEnd:ue,noDragClassName:_e,noWheelClassName:je,noPanClassName:Ve,disableKeyboardA11y:nt,nodeExtent:gt,rfId:vt,viewport:st,onViewportChange:yt}){return vw(e),vw(t),ZH(),UH(n),GH(st),b(dH,{onPaneClick:V,onPaneMouseEnter:Y,onPaneMouseMove:q,onPaneMouseLeave:B,onPaneContextMenu:Z,onPaneScroll:G,paneClickDistance:ee,deleteKeyCode:A,selectionKeyCode:w,selectionOnDrag:y,selectionMode:S,onSelectionStart:d,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:C,elementsSelectable:k,zoomOnScroll:I,zoomOnPinch:D,zoomOnDoubleClick:$,panOnScroll:M,panOnScrollSpeed:U,panOnScrollMode:F,panOnDrag:H,defaultViewport:z,translateExtent:O,minZoom:P,maxZoom:_,onSelectionContextMenu:u,preventScrolling:L,noDragClassName:_e,noWheelClassName:je,noPanClassName:Ve,disableKeyboardA11y:nt,onViewportChange:yt,isControlledViewport:!!st,children:re(BH,{children:[b($H,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:i,onReconnect:ce,onReconnectStart:fe,onReconnectEnd:ue,onlyRenderVisibleElements:T,onEdgeContextMenu:K,onEdgeMouseEnter:W,onEdgeMouseMove:Q,onEdgeMouseLeave:ne,reconnectRadius:ae,defaultMarkerColor:R,noPanClassName:Ve,disableKeyboardA11y:nt,rfId:vt}),b(jH,{style:g,type:v,component:x,containerStyle:h}),b("div",{className:"react-flow__edgelabel-renderer"}),b(wH,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:c,onNodeContextMenu:f,nodeClickDistance:te,onlyRenderVisibleElements:T,noPanClassName:Ve,noDragClassName:_e,disableKeyboardA11y:nt,nodeExtent:gt,rfId:vt}),b("div",{className:"react-flow__viewport-portal"})]})})}gN.displayName="GraphView";const QH=p.memo(gN),yw=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:a,fitView:i,fitViewOptions:l,minZoom:s=.5,maxZoom:c=2,nodeOrigin:f,nodeExtent:u}={})=>{const d=new Map,m=new Map,v=new Map,g=new Map,x=o??t??[],h=n??e??[],w=f??[0,0],y=u??ql;_C(v,g,x);const S=nh(h,d,m,{nodeOrigin:w,nodeExtent:y,elevateNodesOnSelect:!1});let E=[0,0,1];if(i&&r&&a){const N=Ns(d,{filter:k=>!!((k.width||k.initialWidth)&&(k.height||k.initialHeight))}),{x:C,y:A,zoom:T}=Jg(N,r,a,s,c,(l==null?void 0:l.padding)??.1);E=[C,A,T]}return{rfId:"1",width:r??0,height:a??0,transform:E,nodes:h,nodesInitialized:S,nodeLookup:d,parentLookup:m,edges:x,edgeLookup:g,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:s,maxZoom:c,translateExtent:ql,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Yr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:w,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:i??!1,fitViewOptions:l,fitViewResolver:null,connection:{...sC},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Jk,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:lC}},WH=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:a,fitView:i,fitViewOptions:l,minZoom:s,maxZoom:c,nodeOrigin:f,nodeExtent:u})=>h$((d,m)=>{async function v(){const{nodeLookup:g,panZoom:x,fitViewOptions:h,fitViewResolver:w,width:y,height:S,minZoom:E,maxZoom:N}=m();x&&(await Qk({nodes:g,width:y,height:S,panZoom:x,minZoom:E,maxZoom:N},h),w==null||w.resolve(!0),d({fitViewResolver:null}))}return{...yw({nodes:e,edges:t,width:r,height:a,fitView:i,fitViewOptions:l,minZoom:s,maxZoom:c,nodeOrigin:f,nodeExtent:u,defaultNodes:n,defaultEdges:o}),setNodes:g=>{const{nodeLookup:x,parentLookup:h,nodeOrigin:w,elevateNodesOnSelect:y,fitViewQueued:S}=m(),E=nh(g,x,h,{nodeOrigin:w,nodeExtent:u,elevateNodesOnSelect:y,checkEquality:!0});S&&E?(v(),d({nodes:g,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0})):d({nodes:g,nodesInitialized:E})},setEdges:g=>{const{connectionLookup:x,edgeLookup:h}=m();_C(x,h,g),d({edges:g})},setDefaultNodesAndEdges:(g,x)=>{if(g){const{setNodes:h}=m();h(g),d({hasDefaultNodes:!0})}if(x){const{setEdges:h}=m();h(x),d({hasDefaultEdges:!0})}},updateNodeInternals:g=>{const{triggerNodeChanges:x,nodeLookup:h,parentLookup:w,domNode:y,nodeOrigin:S,nodeExtent:E,debug:N,fitViewQueued:C}=m(),{changes:A,updatedInternals:T}=w4(g,h,w,y,S,E);T&&(g4(h,w,{nodeOrigin:S,nodeExtent:E}),C?(v(),d({fitViewQueued:!1,fitViewOptions:void 0})):d({}),(A==null?void 0:A.length)>0&&(N&&console.log("React Flow: trigger node changes",A),x==null||x(A)))},updateNodePositions:(g,x=!1)=>{const h=[],w=[],{nodeLookup:y,triggerNodeChanges:S}=m();for(const[E,N]of g){const C=y.get(E),A=!!(C!=null&&C.expandParent&&(C!=null&&C.parentId)&&(N!=null&&N.position)),T={id:E,type:"position",position:A?{x:Math.max(0,N.position.x),y:Math.max(0,N.position.y)}:N.position,dragging:x};A&&C.parentId&&h.push({id:E,parentId:C.parentId,rect:{...N.internals.positionAbsolute,width:N.measured.width??0,height:N.measured.height??0}}),w.push(T)}if(h.length>0){const{parentLookup:E,nodeOrigin:N}=m(),C=av(h,y,E,N);w.push(...C)}S(w)},triggerNodeChanges:g=>{const{onNodesChange:x,setNodes:h,nodes:w,hasDefaultNodes:y,debug:S}=m();if(g!=null&&g.length){if(y){const E=XC(g,w);h(E)}S&&console.log("React Flow: trigger node changes",g),x==null||x(g)}},triggerEdgeChanges:g=>{const{onEdgesChange:x,setEdges:h,edges:w,hasDefaultEdges:y,debug:S}=m();if(g!=null&&g.length){if(y){const E=L$(g,w);h(E)}S&&console.log("React Flow: trigger edge changes",g),x==null||x(g)}},addSelectedNodes:g=>{const{multiSelectionActive:x,edgeLookup:h,nodeLookup:w,triggerNodeChanges:y,triggerEdgeChanges:S}=m();if(x){const E=g.map(N=>Tr(N,!0));y(E);return}y($a(w,new Set([...g]),!0)),S($a(h))},addSelectedEdges:g=>{const{multiSelectionActive:x,edgeLookup:h,nodeLookup:w,triggerNodeChanges:y,triggerEdgeChanges:S}=m();if(x){const E=g.map(N=>Tr(N,!0));S(E);return}S($a(h,new Set([...g]))),y($a(w,new Set,!0))},unselectNodesAndEdges:({nodes:g,edges:x}={})=>{const{edges:h,nodes:w,nodeLookup:y,triggerNodeChanges:S,triggerEdgeChanges:E}=m(),N=g||w,C=x||h,A=N.map(k=>{const z=y.get(k.id);return z&&(z.selected=!1),Tr(k.id,!1)}),T=C.map(k=>Tr(k.id,!1));S(A),E(T)},setMinZoom:g=>{const{panZoom:x,maxZoom:h}=m();x==null||x.setScaleExtent([g,h]),d({minZoom:g})},setMaxZoom:g=>{const{panZoom:x,minZoom:h}=m();x==null||x.setScaleExtent([h,g]),d({maxZoom:g})},setTranslateExtent:g=>{var x;(x=m().panZoom)==null||x.setTranslateExtent(g),d({translateExtent:g})},resetSelectedElements:()=>{const{edges:g,nodes:x,triggerNodeChanges:h,triggerEdgeChanges:w,elementsSelectable:y}=m();if(!y)return;const S=x.reduce((N,C)=>C.selected?[...N,Tr(C.id,!1)]:N,[]),E=g.reduce((N,C)=>C.selected?[...N,Tr(C.id,!1)]:N,[]);h(S),w(E)},setNodeExtent:g=>{const{nodes:x,nodeLookup:h,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:S,nodeExtent:E}=m();g[0][0]===E[0][0]&&g[0][1]===E[0][1]&&g[1][0]===E[1][0]&&g[1][1]===E[1][1]||(nh(x,h,w,{nodeOrigin:y,nodeExtent:g,elevateNodesOnSelect:S,checkEquality:!1}),d({nodeExtent:g}))},panBy:g=>{const{transform:x,width:h,height:w,panZoom:y,translateExtent:S}=m();return x4({delta:g,panZoom:y,transform:x,translateExtent:S,width:h,height:w})},setCenter:async(g,x,h)=>{const{width:w,height:y,maxZoom:S,panZoom:E}=m();if(!E)return Promise.resolve(!1);const N=typeof(h==null?void 0:h.zoom)<"u"?h.zoom:S;return await E.setViewport({x:w/2-g*N,y:y/2-x*N,zoom:N},{duration:h==null?void 0:h.duration,ease:h==null?void 0:h.ease,interpolate:h==null?void 0:h.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{d({connection:{...sC}})},updateConnection:g=>{d({connection:g})},reset:()=>d({...yw()})}},Object.is);function vN({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:a,initialMinZoom:i,initialMaxZoom:l,initialFitViewOptions:s,fitView:c,nodeOrigin:f,nodeExtent:u,children:d}){const[m]=p.useState(()=>WH({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:a,fitView:c,minZoom:i,maxZoom:l,fitViewOptions:s,nodeOrigin:f,nodeExtent:u}));return b(g$,{value:m,children:b(B$,{children:d})})}function JH({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:a,height:i,fitView:l,fitViewOptions:s,minZoom:c,maxZoom:f,nodeOrigin:u,nodeExtent:d}){return p.useContext(Xd)?b(De,{children:e}):b(vN,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:a,initialHeight:i,fitView:l,initialFitViewOptions:s,initialMinZoom:c,initialMaxZoom:f,nodeOrigin:u,nodeExtent:d,children:e})}const eB={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function tB({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:a,edgeTypes:i,onNodeClick:l,onEdgeClick:s,onInit:c,onMove:f,onMoveStart:u,onMoveEnd:d,onConnect:m,onConnectStart:v,onConnectEnd:g,onClickConnectStart:x,onClickConnectEnd:h,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:S,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:C,onNodeDrag:A,onNodeDragStop:T,onNodesDelete:k,onEdgesDelete:z,onDelete:O,onSelectionChange:P,onSelectionDragStart:_,onSelectionDrag:L,onSelectionDragStop:R,onSelectionContextMenu:I,onSelectionStart:D,onSelectionEnd:M,onBeforeDelete:U,connectionMode:F,connectionLineType:$=Ho.Bezier,connectionLineStyle:H,connectionLineComponent:V,connectionLineContainerStyle:Y,deleteKeyCode:q="Backspace",selectionKeyCode:B="Shift",selectionOnDrag:G=!1,selectionMode:Z=Zl.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:te=Wl()?"Meta":"Control",zoomActivationKeyCode:K=Wl()?"Meta":"Control",snapToGrid:W,snapGrid:Q,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:ae,nodesDraggable:ce,autoPanOnNodeFocus:fe,nodesConnectable:ue,nodesFocusable:_e,nodeOrigin:je=YC,edgesFocusable:Ve,edgesReconnectable:nt,elementsSelectable:gt=!0,defaultViewport:vt=A$,minZoom:st=.5,maxZoom:yt=2,translateExtent:vr=ql,preventScrolling:_o=!0,nodeExtent:Wt,defaultMarkerColor:yr="#b1b1b7",zoomOnScroll:br=!0,zoomOnPinch:Et=!0,panOnScroll:wr=!1,panOnScrollSpeed:Ui=.5,panOnScrollMode:Mf=Lr.Free,zoomOnDoubleClick:Df=!0,panOnDrag:Of=!0,onPaneClick:js,onPaneMouseEnter:Pf,onPaneMouseMove:qs,onPaneMouseLeave:Zs,onPaneScroll:Qs,onPaneContextMenu:zf,paneClickDistance:Ws=1,nodeClickDistance:Js=0,children:If,onReconnect:MO,onReconnectStart:DO,onReconnectEnd:OO,onEdgeContextMenu:PO,onEdgeDoubleClick:zO,onEdgeMouseEnter:IO,onEdgeMouseMove:LO,onEdgeMouseLeave:kO,reconnectRadius:$O=10,onNodesChange:HO,onEdgesChange:BO,noDragClassName:UO="nodrag",noWheelClassName:VO="nowheel",noPanClassName:Ly="nopan",fitView:ky,fitViewOptions:$y,connectOnClick:GO,attributionPosition:YO,proOptions:FO,defaultEdgeOptions:XO,elevateNodesOnSelect:KO,elevateEdgesOnSelect:jO,disableKeyboardA11y:Hy=!1,autoPanOnConnect:qO,autoPanOnNodeDrag:ZO,autoPanSpeed:QO,connectionRadius:WO,isValidConnection:JO,onError:eP,style:tP,id:By,nodeDragThreshold:nP,connectionDragThreshold:oP,viewport:rP,onViewportChange:aP,width:iP,height:lP,colorMode:sP="light",debug:cP,onScroll:ec,ariaLabelConfig:uP,...dP},fP){const Lf=By||"1",pP=P$(sP),mP=p.useCallback(Uy=>{Uy.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ec==null||ec(Uy)},[ec]);return b("div",{"data-testid":"rf__wrapper",...dP,onScroll:mP,style:{...tP,...eB},ref:fP,className:tt(["react-flow",r,pP]),id:By,role:"application",children:re(JH,{nodes:e,edges:t,width:iP,height:lP,fitView:ky,fitViewOptions:$y,minZoom:st,maxZoom:yt,nodeOrigin:je,nodeExtent:Wt,children:[b(QH,{onInit:c,onNodeClick:l,onEdgeClick:s,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:S,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:a,edgeTypes:i,connectionLineType:$,connectionLineStyle:H,connectionLineComponent:V,connectionLineContainerStyle:Y,selectionKeyCode:B,selectionOnDrag:G,selectionMode:Z,deleteKeyCode:q,multiSelectionKeyCode:te,panActivationKeyCode:ee,zoomActivationKeyCode:K,onlyRenderVisibleElements:ne,defaultViewport:vt,translateExtent:vr,minZoom:st,maxZoom:yt,preventScrolling:_o,zoomOnScroll:br,zoomOnPinch:Et,zoomOnDoubleClick:Df,panOnScroll:wr,panOnScrollSpeed:Ui,panOnScrollMode:Mf,panOnDrag:Of,onPaneClick:js,onPaneMouseEnter:Pf,onPaneMouseMove:qs,onPaneMouseLeave:Zs,onPaneScroll:Qs,onPaneContextMenu:zf,paneClickDistance:Ws,nodeClickDistance:Js,onSelectionContextMenu:I,onSelectionStart:D,onSelectionEnd:M,onReconnect:MO,onReconnectStart:DO,onReconnectEnd:OO,onEdgeContextMenu:PO,onEdgeDoubleClick:zO,onEdgeMouseEnter:IO,onEdgeMouseMove:LO,onEdgeMouseLeave:kO,reconnectRadius:$O,defaultMarkerColor:yr,noDragClassName:UO,noWheelClassName:VO,noPanClassName:Ly,rfId:Lf,disableKeyboardA11y:Hy,nodeExtent:Wt,viewport:rP,onViewportChange:aP}),b(O$,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:m,onConnectStart:v,onConnectEnd:g,onClickConnectStart:x,onClickConnectEnd:h,nodesDraggable:ce,autoPanOnNodeFocus:fe,nodesConnectable:ue,nodesFocusable:_e,edgesFocusable:Ve,edgesReconnectable:nt,elementsSelectable:gt,elevateNodesOnSelect:KO,elevateEdgesOnSelect:jO,minZoom:st,maxZoom:yt,nodeExtent:Wt,onNodesChange:HO,onEdgesChange:BO,snapToGrid:W,snapGrid:Q,connectionMode:F,translateExtent:vr,connectOnClick:GO,defaultEdgeOptions:XO,fitView:ky,fitViewOptions:$y,onNodesDelete:k,onEdgesDelete:z,onDelete:O,onNodeDragStart:C,onNodeDrag:A,onNodeDragStop:T,onSelectionDrag:L,onSelectionDragStart:_,onSelectionDragStop:R,onMove:f,onMoveStart:u,onMoveEnd:d,noPanClassName:Ly,nodeOrigin:je,rfId:Lf,autoPanOnConnect:qO,autoPanOnNodeDrag:ZO,autoPanSpeed:QO,onError:eP,connectionRadius:WO,isValidConnection:JO,selectNodesOnDrag:ae,nodeDragThreshold:nP,connectionDragThreshold:oP,onBeforeDelete:U,debug:cP,ariaLabelConfig:uP}),b(T$,{onSelectionChange:P}),If,b(E$,{proOptions:FO,position:YO}),b(S$,{rfId:Lf,disableKeyboardA11y:Hy})]})})}var nB=KC(tB);function oB(){const e=Be();return p.useCallback(t=>{const{domNode:n,updateNodeInternals:o}=e.getState(),r=Array.isArray(t)?t:[t],a=new Map;r.forEach(i=>{const l=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${i}"]`);l&&a.set(i,{id:i,nodeElement:l,force:!0})}),requestAnimationFrame(()=>o(a,{triggerFitView:!1}))},[])}function rB(e){const[t,n]=p.useState(e),o=p.useCallback(r=>n(a=>XC(r,a)),[]);return[t,n,o]}function aB({dimensions:e,lineWidth:t,variant:n,className:o}){return b("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:tt(["react-flow__background-pattern",n,o])})}function iB({radius:e,className:t}){return b("circle",{cx:e,cy:e,r:e,className:tt(["react-flow__background-pattern","dots",t])})}var er;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(er||(er={}));const lB={[er.Dots]:1,[er.Lines]:1,[er.Cross]:6},sB=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function yN({id:e,variant:t=er.Dots,gap:n=20,size:o,lineWidth:r=1,offset:a=0,color:i,bgColor:l,style:s,className:c,patternClassName:f}){const u=p.useRef(null),{transform:d,patternId:m}=we(sB,Fe),v=o||lB[t],g=t===er.Dots,x=t===er.Cross,h=Array.isArray(n)?n:[n,n],w=[h[0]*d[2]||1,h[1]*d[2]||1],y=v*d[2],S=Array.isArray(a)?a:[a,a],E=x?[y,y]:w,N=[S[0]*d[2]||1+E[0]/2,S[1]*d[2]||1+E[1]/2],C=`${m}${e||""}`;return re("svg",{className:tt(["react-flow__background",c]),style:{...s,...jd,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:u,"data-testid":"rf__background",children:[b("pattern",{id:C,x:d[0]%w[0],y:d[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:g?b(iB,{radius:y/2,className:f}):b(aB,{dimensions:E,lineWidth:r,variant:t,className:f})}),b("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}yN.displayName="Background";p.memo(yN);function cB(){return b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:b("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function uB(){return b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:b("path",{d:"M0 0h32v4.2H0z"})})}function dB(){return b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:b("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function fB(){return b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function pB(){return b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Nc({children:e,className:t,...n}){return b("button",{type:"button",className:tt(["react-flow__controls-button",t]),...n,children:e})}const mB=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function bN({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:a,onZoomOut:i,onFitView:l,onInteractiveChange:s,className:c,children:f,position:u="bottom-left",orientation:d="vertical","aria-label":m}){const v=Be(),{isInteractive:g,minZoomReached:x,maxZoomReached:h,ariaLabelConfig:w}=we(mB,Fe),{zoomIn:y,zoomOut:S,fitView:E}=Ts(),N=()=>{y(),a==null||a()},C=()=>{S(),i==null||i()},A=()=>{E(r),l==null||l()},T=()=>{v.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),s==null||s(!g)};return re(Kd,{className:tt(["react-flow__controls",d==="horizontal"?"horizontal":"vertical",c]),position:u,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[t&&re(De,{children:[b(Nc,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:h,children:b(cB,{})}),b(Nc,{onClick:C,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:x,children:b(uB,{})})]}),n&&b(Nc,{className:"react-flow__controls-fitview",onClick:A,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:b(dB,{})}),o&&b(Nc,{className:"react-flow__controls-interactive",onClick:T,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:g?b(pB,{}):b(fB,{})}),f]})}bN.displayName="Controls";p.memo(bN);function hB({id:e,x:t,y:n,width:o,height:r,style:a,color:i,strokeColor:l,strokeWidth:s,className:c,borderRadius:f,shapeRendering:u,selected:d,onClick:m}){const{background:v,backgroundColor:g}=a||{},x=i||v||g;return b("rect",{className:tt(["react-flow__minimap-node",{selected:d},c]),x:t,y:n,rx:f,ry:f,width:o,height:r,style:{fill:x,stroke:l,strokeWidth:s},shapeRendering:u,onClick:m?h=>m(h,e):void 0})}const gB=p.memo(hB),vB=e=>e.nodes.map(t=>t.id),Ap=e=>e instanceof Function?e:()=>e;function yB({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:a=gB,onClick:i}){const l=we(vB,Fe),s=Ap(t),c=Ap(e),f=Ap(n),u=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b(De,{children:l.map(d=>b(wB,{id:d,nodeColorFunc:s,nodeStrokeColorFunc:c,nodeClassNameFunc:f,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:a,onClick:i,shapeRendering:u},d))})}function bB({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:a,shapeRendering:i,NodeComponent:l,onClick:s}){const{node:c,x:f,y:u,width:d,height:m}=we(v=>{const{internals:g}=v.nodeLookup.get(e),x=g.userNode,{x:h,y:w}=g.positionAbsolute,{width:y,height:S}=xo(x);return{node:x,x:h,y:w,width:y,height:S}},Fe);return!c||c.hidden||!hC(c)?null:b(l,{x:f,y:u,width:d,height:m,style:c.style,selected:!!c.selected,className:o(c),color:t(c),borderRadius:r,strokeColor:n(c),strokeWidth:a,shapeRendering:i,onClick:s,id:c.id})}const wB=p.memo(bB);var xB=p.memo(yB);const SB=200,EB=150,CB=e=>!e.hidden,NB=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?mC(Ns(e.nodeLookup,{filter:CB}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},_B="react-flow__minimap-desc";function wN({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:a=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:s,maskColor:c,maskStrokeColor:f,maskStrokeWidth:u,position:d="bottom-right",onClick:m,onNodeClick:v,pannable:g=!1,zoomable:x=!1,ariaLabel:h,inversePan:w,zoomStep:y=1,offsetScale:S=5}){const E=Be(),N=p.useRef(null),{boundingRect:C,viewBB:A,rfId:T,panZoom:k,translateExtent:z,flowWidth:O,flowHeight:P,ariaLabelConfig:_}=we(NB,Fe),L=(e==null?void 0:e.width)??SB,R=(e==null?void 0:e.height)??EB,I=C.width/L,D=C.height/R,M=Math.max(I,D),U=M*L,F=M*R,$=S*M,H=C.x-(U-C.width)/2-$,V=C.y-(F-C.height)/2-$,Y=U+$*2,q=F+$*2,B=`${_B}-${T}`,G=p.useRef(0),Z=p.useRef();G.current=M,p.useEffect(()=>{if(N.current&&k)return Z.current=M4({domNode:N.current,panZoom:k,getTransform:()=>E.getState().transform,getViewScale:()=>G.current}),()=>{var W;(W=Z.current)==null||W.destroy()}},[k]),p.useEffect(()=>{var W;(W=Z.current)==null||W.update({translateExtent:z,width:O,height:P,inversePan:w,pannable:g,zoomStep:y,zoomable:x})},[g,x,w,y,z,O,P]);const ee=m?W=>{var ae;const[Q,ne]=((ae=Z.current)==null?void 0:ae.pointer(W))||[0,0];m(W,{x:Q,y:ne})}:void 0,te=v?p.useCallback((W,Q)=>{const ne=E.getState().nodeLookup.get(Q).internals.userNode;v(W,ne)},[]):void 0,K=h??_["minimap.ariaLabel"];return b(Kd,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof u=="number"?u*M:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof i=="number"?i:void 0},className:tt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:re("svg",{width:L,height:R,viewBox:`${H} ${V} ${Y} ${q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":B,ref:N,onClick:ee,children:[K&&b("title",{id:B,children:K}),b(xB,{onClick:te,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:r,nodeStrokeWidth:i,nodeComponent:l}),b("path",{className:"react-flow__minimap-mask",d:`M${H-$},${V-$}h${Y+$*2}v${q+$*2}h${-Y-$*2}z
71
- M${A.x},${A.y}h${A.width}v${A.height}h${-A.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}wN.displayName="MiniMap";p.memo(wN);const RB=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,TB={[gi.Line]:"right",[gi.Handle]:"bottom-right"};function AB({nodeId:e,position:t,variant:n=gi.Handle,className:o,style:r=void 0,children:a,color:i,minWidth:l=10,minHeight:s=10,maxWidth:c=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:u=!1,resizeDirection:d,autoScale:m=!0,shouldResize:v,onResizeStart:g,onResize:x,onResizeEnd:h}){const w=QC(),y=typeof e=="string"?e:w,S=Be(),E=p.useRef(null),N=n===gi.Handle,C=we(p.useCallback(RB(N&&m),[N,m]),Fe),A=p.useRef(null),T=t??TB[n];p.useEffect(()=>{if(!(!E.current||!y))return A.current||(A.current=Y4({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:z,transform:O,snapGrid:P,snapToGrid:_,nodeOrigin:L,domNode:R}=S.getState();return{nodeLookup:z,transform:O,snapGrid:P,snapToGrid:_,nodeOrigin:L,paneDomNode:R}},onChange:(z,O)=>{const{triggerNodeChanges:P,nodeLookup:_,parentLookup:L,nodeOrigin:R}=S.getState(),I=[],D={x:z.x,y:z.y},M=_.get(y);if(M&&M.expandParent&&M.parentId){const U=M.origin??R,F=z.width??M.measured.width??0,$=z.height??M.measured.height??0,H={id:M.id,parentId:M.parentId,rect:{width:F,height:$,...gC({x:z.x??M.position.x,y:z.y??M.position.y},{width:F,height:$},M.parentId,_,U)}},V=av([H],_,L,R);I.push(...V),D.x=z.x?Math.max(U[0]*F,z.x):void 0,D.y=z.y?Math.max(U[1]*$,z.y):void 0}if(D.x!==void 0&&D.y!==void 0){const U={id:y,type:"position",position:{...D}};I.push(U)}if(z.width!==void 0&&z.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};I.push(F)}for(const U of O){const F={...U,type:"position"};I.push(F)}P(I)},onEnd:({width:z,height:O})=>{const P={id:y,type:"dimensions",resizing:!1,dimensions:{width:z,height:O}};S.getState().triggerNodeChanges([P])}})),A.current.update({controlPosition:T,boundaries:{minWidth:l,minHeight:s,maxWidth:c,maxHeight:f},keepAspectRatio:u,resizeDirection:d,onResizeStart:g,onResize:x,onResizeEnd:h,shouldResize:v}),()=>{var z;(z=A.current)==null||z.destroy()}},[T,l,s,c,f,u,g,x,h,v]);const k=T.split("-");return b("div",{className:tt(["react-flow__resize-control","nodrag",...k,n,o]),ref:E,style:{...r,scale:C,...i&&{[N?"backgroundColor":"borderColor"]:i}},children:a})}p.memo(AB);function bw(e="default"){return{id:e,nodes:[],edges:[]}}function sl(e="node"){return`${e}_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}const MB="Blueprint",DB="Logic";class Xu{constructor(t=bw()){Vy(this,"document");this.document=t}static empty(t){return new Xu(bw(t))}getNode(t){return this.document.nodes.find(n=>n.id===t)}addBlueprintNode(t,n="蓝图"){const o={id:sl("bp"),role:"blueprint",nodeType:MB,label:n,position:{...t},nestedBlueprintId:sl("nested_bp")};return this.withDocument({...this.document,nodes:[...this.document.nodes,o]})}addLogicNode(t,n,o="逻辑"){const r=this.getNode(t);if(!r||r.role!=="blueprint")throw new Error(`Parent blueprint node not found: ${t}`);const a={id:sl("logic"),role:"logic",nodeType:DB,label:o,position:{...n},parentId:t};return this.withDocument({...this.document,nodes:[...this.document.nodes,a]})}removeNode(t){const n=this.getNode(t);if(!n)return this;const o=new Set([t]);if(n.role==="blueprint")for(const r of this.document.nodes)r.parentId===t&&o.add(r.id);return this.withDocument({...this.document,nodes:this.document.nodes.filter(r=>!o.has(r.id)),edges:this.document.edges.filter(r=>!o.has(r.source)&&!o.has(r.target))})}updateNodePosition(t,n){return this.withDocument({...this.document,nodes:this.document.nodes.map(o=>o.id===t?{...o,position:{...n}}:o)})}applyNodePositions(t){if(t.length===0)return this;const n=new Map(t.map(o=>[o.id,o.position]));return this.withDocument({...this.document,nodes:this.document.nodes.map(o=>{const r=n.get(o.id);return r?{...o,position:{...r}}:o})})}addEdge(t){const n={id:t.id??sl("edge"),source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return this.withDocument({...this.document,edges:[...this.document.edges,n]})}removeEdge(t){return this.withDocument({...this.document,edges:this.document.edges.filter(n=>n.id!==t)})}replaceEdges(t){return this.withDocument({...this.document,edges:t})}updateNode(t,n){return this.getNode(t)?this.withDocument({...this.document,nodes:this.document.nodes.map(r=>r.id===t?{...r,...n}:r)}):this}withDocument(t){return new Xu(t)}}const OB=168,PB=72;function zB(e){return e.nodes.map(t=>({id:t.id,type:t.role==="blueprint"?"blueprint":"logic",position:{...t.position},width:OB,height:PB,zIndex:0,connectable:!0,dragHandle:".bp-flow-drag-handle",data:{label:t.label,role:t.role,nodeType:t.nodeType,configSource:t.configSource,viewElementId:t.viewElementId,parentId:t.parentId,nestedBlueprintId:t.nestedBlueprintId}}))}function IB(e){return e.edges.map(t=>({id:t.id,type:"smoothstep",source:t.source,target:t.target,sourceHandle:t.sourceHandle??"out",targetHandle:t.targetHandle??"in"}))}function LB(e){return e.map(t=>({id:t.id||sl("edge"),source:t.source,target:t.target,sourceHandle:t.sourceHandle??void 0,targetHandle:t.targetHandle??void 0}))}function kB(e){return e.map(t=>({id:t.id,position:{x:t.position.x,y:t.position.y}}))}const Ku={stroke:"#2563eb",strokeWidth:2.5},ts="blueprintSmooth";function xN(e){return LB(e.map(t=>({id:t.id,source:t.source,target:t.target,sourceHandle:t.sourceHandle??"out",targetHandle:t.targetHandle??"in"})))}function ah(e){return IB(e.document).map(t=>({...t,type:ts,zIndex:1e3,style:{...Ku}}))}function $B(e,t){const n=new Map(t.map(o=>[o.id,o]));return e.map(o=>{const r=n.get(o.id);return r?{...o,measured:r.measured??o.measured,width:r.width??o.width,height:r.height??o.height}:o})}function ww(e){return e.map(t=>t.id).sort().join(",")}function xw(e,t){return zB(e.document).map(o=>({...o,selected:!1,data:{...o.data,isSelected:t===o.id}}))}function HB(e,t){const n=new Set(t.map(a=>a.id)),o=e.source??"",r=e.target??"";return!o||!r||o===r||!n.has(o)||!n.has(r)?null:{source:o,target:r,sourceHandle:e.sourceHandle??"out",targetHandle:e.targetHandle??"in"}}function Sw(e,t){return e.applyNodePositions(kB(t))}function BB({menu:e,onClose:t,onAddBlueprintNode:n,onAddLogicNode:o,onDeleteNode:r}){const a=p.useRef(null);return p.useEffect(()=>{if(!e)return;const i=s=>{var f;const c=s.target;c&&((f=a.current)!=null&&f.contains(c))||t()},l=()=>t();return window.addEventListener("pointerdown",i),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{window.removeEventListener("pointerdown",i),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[e,t]),e?re("div",{ref:a,className:"bp-context-menu",style:{left:e.clientX,top:e.clientY},onMouseDown:i=>i.stopPropagation(),onContextMenu:i=>i.preventDefault(),children:[e.kind==="pane"?b("button",{type:"button",className:"bp-context-menu__item",onClick:()=>{n(),t()},children:"新增节点"}):null,e.kind==="node"&&e.role==="blueprint"?b("button",{type:"button",className:"bp-context-menu__item",onClick:()=>{o(e.nodeId),t()},children:"添加逻辑节点"}):null,e.kind==="node"?re(De,{children:[e.role==="blueprint"?b("div",{className:"bp-context-menu__separator"}):null,b("button",{type:"button",className:"bp-context-menu__item bp-context-menu__item--danger",onClick:()=>{r(e.nodeId),t()},children:"删除"})]}):null]}):null}const UB="#2563eb",VB=2.5;function GB({sourceX:e,sourceY:t,targetX:n,targetY:o,sourcePosition:r,targetPosition:a}){const[i]=Yu({sourceX:e,sourceY:t,sourcePosition:r,targetX:n,targetY:o,targetPosition:a});return re(De,{children:[b("path",{d:i,fill:"none",stroke:UB,strokeWidth:VB,className:"react-flow__edge-path bp-edge-visible"}),b("path",{d:i,fill:"none",stroke:"transparent",strokeWidth:20,className:"react-flow__edge-interaction"})]})}function YB(){return{[ts]:GB}}function FB(e,t){const n=p.createContext(t),o=a=>{const{children:i,...l}=a,s=p.useMemo(()=>l,Object.values(l));return b(n.Provider,{value:s,children:i})};o.displayName=e+"Provider";function r(a){const i=p.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[o,r]}function Ue(e,t=[]){let n=[];function o(a,i){const l=p.createContext(i),s=n.length;n=[...n,i];const c=u=>{var h;const{scope:d,children:m,...v}=u,g=((h=d==null?void 0:d[e])==null?void 0:h[s])||l,x=p.useMemo(()=>v,Object.values(v));return b(g.Provider,{value:x,children:m})};c.displayName=a+"Provider";function f(u,d){var g;const m=((g=d==null?void 0:d[e])==null?void 0:g[s])||l,v=p.useContext(m);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${a}\``)}return[c,f]}const r=()=>{const a=n.map(i=>p.createContext(i));return function(l){const s=(l==null?void 0:l[e])||a;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:s}}),[l,s])}};return r.scopeName=e,[o,XB(r,...t)]}function XB(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const i=o.reduce((l,{useScope:s,scopeName:c})=>{const u=s(a)[`__scope${c}`];return{...l,...u}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Ew(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Sn(...e){return t=>{let n=!1;const o=e.map(r=>{const a=Ew(r,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let r=0;r<o.length;r++){const a=o[r];typeof a=="function"?a():Ew(e[r],null)}}}}function le(...e){return p.useCallback(Sn(...e),e)}function Xr(e){const t=KB(e),n=p.forwardRef((o,r)=>{const{children:a,...i}=o,l=p.Children.toArray(a),s=l.find(jB);if(s){const c=s.props.children,f=l.map(u=>u===s?p.Children.count(c)>1?p.Children.only(null):p.isValidElement(c)?c.props.children:null:u);return b(t,{...i,ref:r,children:p.isValidElement(c)?p.cloneElement(c,void 0,f):null})}return b(t,{...i,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}function KB(e){const t=p.forwardRef((n,o)=>{const{children:r,...a}=n;if(p.isValidElement(r)){const i=ZB(r),l=qB(a,r.props);return r.type!==p.Fragment&&(l.ref=o?Sn(o,i):i),p.cloneElement(r,l)}return p.Children.count(r)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SN=Symbol("radix.slottable");function EN(e){const t=({children:n})=>b(De,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=SN,t}function jB(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SN}function qB(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...l)=>{const s=a(...l);return r(...l),s}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function ZB(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function So(e){const t=e+"CollectionProvider",[n,o]=Ue(t),[r,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:x,children:h}=g,w=ie.useRef(null),y=ie.useRef(new Map).current;return b(r,{scope:x,itemMap:y,collectionRef:w,children:h})};i.displayName=t;const l=e+"CollectionSlot",s=Xr(l),c=ie.forwardRef((g,x)=>{const{scope:h,children:w}=g,y=a(l,h),S=le(x,y.collectionRef);return b(s,{ref:S,children:w})});c.displayName=l;const f=e+"CollectionItemSlot",u="data-radix-collection-item",d=Xr(f),m=ie.forwardRef((g,x)=>{const{scope:h,children:w,...y}=g,S=ie.useRef(null),E=le(x,S),N=a(f,h);return ie.useEffect(()=>(N.itemMap.set(S,{ref:S,...y}),()=>void N.itemMap.delete(S))),b(d,{[u]:"",ref:E,children:w})});m.displayName=f;function v(g){const x=a(e+"CollectionConsumer",g);return ie.useCallback(()=>{const w=x.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(x.itemMap.values()).sort((N,C)=>y.indexOf(N.ref.current)-y.indexOf(C.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:c,ItemSlot:m},v,o]}function j(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}var He=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},QB=yd[" useInsertionEffect ".trim().toString()]||He;function ht({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,a,i]=WB({defaultProp:t,onChange:n}),l=e!==void 0,s=l?e:r;{const f=p.useRef(e!==void 0);p.useEffect(()=>{const u=f.current;u!==l&&console.warn(`${o} is changing from ${u?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=l},[l,o])}const c=p.useCallback(f=>{var u;if(l){const d=JB(f)?f(e):f;d!==e&&((u=i.current)==null||u.call(i,d))}else a(f)},[l,e,a,i]);return[s,c]}function WB({defaultProp:e,onChange:t}){const[n,o]=p.useState(e),r=p.useRef(n),a=p.useRef(t);return QB(()=>{a.current=t},[t]),p.useEffect(()=>{var i;r.current!==n&&((i=a.current)==null||i.call(a,n),r.current=n)},[n,r]),[n,o,a]}function JB(e){return typeof e=="function"}var e6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oe=e6.reduce((e,t)=>{const n=Xr(`Primitive.${t}`),o=p.forwardRef((r,a)=>{const{asChild:i,...l}=r,s=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b(s,{...l,ref:a})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function ns(e,t){e&&Jr.flushSync(()=>e.dispatchEvent(t))}function t6(e,t){return p.useReducer((n,o)=>t[n][o]??n,e)}var Pe=e=>{const{present:t,children:n}=e,o=n6(t),r=typeof n=="function"?n({present:o.isPresent}):p.Children.only(n),a=le(o.ref,o6(r));return typeof n=="function"||o.isPresent?p.cloneElement(r,{ref:a}):null};Pe.displayName="Presence";function n6(e){const[t,n]=p.useState(),o=p.useRef(null),r=p.useRef(e),a=p.useRef("none"),i=e?"mounted":"unmounted",[l,s]=t6(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=_c(o.current);a.current=l==="mounted"?c:"none"},[l]),He(()=>{const c=o.current,f=r.current;if(f!==e){const d=a.current,m=_c(c);e?s("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?s("UNMOUNT"):s(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,s]),He(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,u=m=>{const g=_c(o.current).includes(CSS.escape(m.animationName));if(m.target===t&&g&&(s("ANIMATION_END"),!r.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},d=m=>{m.target===t&&(a.current=_c(o.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:p.useCallback(c=>{o.current=c?getComputedStyle(c):null,n(c)},[])}}function _c(e){return(e==null?void 0:e.animationName)||"none"}function o6(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var r6=yd[" useId ".trim().toString()]||(()=>{}),a6=0;function mt(e){const[t,n]=p.useState(r6());return He(()=>{n(o=>o??String(a6++))},[e]),t?`radix-${t}`:""}var Zd="Collapsible",[i6,CN]=Ue(Zd),[l6,lv]=i6(Zd),NN=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:o,defaultOpen:r,disabled:a,onOpenChange:i,...l}=e,[s,c]=ht({prop:o,defaultProp:r??!1,onChange:i,caller:Zd});return b(l6,{scope:n,disabled:a,contentId:mt(),open:s,onOpenToggle:p.useCallback(()=>c(f=>!f),[c]),children:b(oe.div,{"data-state":cv(s),"data-disabled":a?"":void 0,...l,ref:t})})});NN.displayName=Zd;var _N="CollapsibleTrigger",RN=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,r=lv(_N,n);return b(oe.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":cv(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:t,onClick:j(e.onClick,r.onOpenToggle)})});RN.displayName=_N;var sv="CollapsibleContent",TN=p.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=lv(sv,e.__scopeCollapsible);return b(Pe,{present:n||r.open,children:({present:a})=>b(s6,{...o,ref:t,present:a})})});TN.displayName=sv;var s6=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:o,children:r,...a}=e,i=lv(sv,n),[l,s]=p.useState(o),c=p.useRef(null),f=le(t,c),u=p.useRef(0),d=u.current,m=p.useRef(0),v=m.current,g=i.open||l,x=p.useRef(g),h=p.useRef(void 0);return p.useEffect(()=>{const w=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(w)},[]),He(()=>{const w=c.current;if(w){h.current=h.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const y=w.getBoundingClientRect();u.current=y.height,m.current=y.width,x.current||(w.style.transitionDuration=h.current.transitionDuration,w.style.animationName=h.current.animationName),s(o)}},[i.open,o]),b(oe.div,{"data-state":cv(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!g,...a,ref:f,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:g&&r})});function cv(e){return e?"open":"closed"}var c6=NN,u6=RN,d6=TN,f6=p.createContext(void 0);function Eo(e){const t=p.useContext(f6);return e||t||"ltr"}var Rn="Accordion",p6=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[uv,m6,h6]=So(Rn),[Qd,_Q]=Ue(Rn,[h6,CN]),dv=CN(),g6=ie.forwardRef((e,t)=>{const{type:n,...o}=e,r=o,a=o;return b(uv.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?b(w6,{...a,ref:t}):b(b6,{...r,ref:t})})});g6.displayName=Rn;var[AN,v6]=Qd(Rn),[MN,y6]=Qd(Rn,{collapsible:!1}),b6=ie.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},collapsible:a=!1,...i}=e,[l,s]=ht({prop:n,defaultProp:o??"",onChange:r,caller:Rn});return b(AN,{scope:e.__scopeAccordion,value:ie.useMemo(()=>l?[l]:[],[l]),onItemOpen:s,onItemClose:ie.useCallback(()=>a&&s(""),[a,s]),children:b(MN,{scope:e.__scopeAccordion,collapsible:a,children:b(DN,{...i,ref:t})})})}),w6=ie.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},...a}=e,[i,l]=ht({prop:n,defaultProp:o??[],onChange:r,caller:Rn}),s=ie.useCallback(f=>l((u=[])=>[...u,f]),[l]),c=ie.useCallback(f=>l((u=[])=>u.filter(d=>d!==f)),[l]);return b(AN,{scope:e.__scopeAccordion,value:i,onItemOpen:s,onItemClose:c,children:b(MN,{scope:e.__scopeAccordion,collapsible:!0,children:b(DN,{...a,ref:t})})})}),[x6,Wd]=Qd(Rn),DN=ie.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:o,dir:r,orientation:a="vertical",...i}=e,l=ie.useRef(null),s=le(l,t),c=m6(n),u=Eo(r)==="ltr",d=j(e.onKeyDown,m=>{var A;if(!p6.includes(m.key))return;const v=m.target,g=c().filter(T=>{var k;return!((k=T.ref.current)!=null&&k.disabled)}),x=g.findIndex(T=>T.ref.current===v),h=g.length;if(x===-1)return;m.preventDefault();let w=x;const y=0,S=h-1,E=()=>{w=x+1,w>S&&(w=y)},N=()=>{w=x-1,w<y&&(w=S)};switch(m.key){case"Home":w=y;break;case"End":w=S;break;case"ArrowRight":a==="horizontal"&&(u?E():N());break;case"ArrowDown":a==="vertical"&&E();break;case"ArrowLeft":a==="horizontal"&&(u?N():E());break;case"ArrowUp":a==="vertical"&&N();break}const C=w%h;(A=g[C].ref.current)==null||A.focus()});return b(x6,{scope:n,disabled:o,direction:r,orientation:a,children:b(uv.Slot,{scope:n,children:b(oe.div,{...i,"data-orientation":a,ref:s,onKeyDown:o?void 0:d})})})}),ju="AccordionItem",[S6,fv]=Qd(ju),ON=ie.forwardRef((e,t)=>{const{__scopeAccordion:n,value:o,...r}=e,a=Wd(ju,n),i=v6(ju,n),l=dv(n),s=mt(),c=o&&i.value.includes(o)||!1,f=a.disabled||e.disabled;return b(S6,{scope:n,open:c,disabled:f,triggerId:s,children:b(c6,{"data-orientation":a.orientation,"data-state":$N(c),...l,...r,ref:t,disabled:f,open:c,onOpenChange:u=>{u?i.onItemOpen(o):i.onItemClose(o)}})})});ON.displayName=ju;var PN="AccordionHeader",zN=ie.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=Wd(Rn,n),a=fv(PN,n);return b(oe.h3,{"data-orientation":r.orientation,"data-state":$N(a.open),"data-disabled":a.disabled?"":void 0,...o,ref:t})});zN.displayName=PN;var ih="AccordionTrigger",IN=ie.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=Wd(Rn,n),a=fv(ih,n),i=y6(ih,n),l=dv(n);return b(uv.ItemSlot,{scope:n,children:b(u6,{"aria-disabled":a.open&&!i.collapsible||void 0,"data-orientation":r.orientation,id:a.triggerId,...l,...o,ref:t})})});IN.displayName=ih;var LN="AccordionContent",kN=ie.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=Wd(Rn,n),a=fv(LN,n),i=dv(n);return b(d6,{role:"region","aria-labelledby":a.triggerId,"data-orientation":r.orientation,...i,...o,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});kN.displayName=LN;function $N(e){return e?"open":"closed"}var E6=ON,C6=zN,HN=IN,BN=kN;/**
72
- * @license lucide-react v0.545.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const N6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),Cw=e=>{const t=_6(e);return t.charAt(0).toUpperCase()+t.slice(1)},UN=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim(),R6=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
77
- * @license lucide-react v0.545.0 - ISC
78
- *
79
- * This source code is licensed under the ISC license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */var T6={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"};/**
82
- * @license lucide-react v0.545.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */const A6=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:a,iconNode:i,...l},s)=>p.createElement("svg",{ref:s,...T6,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:UN("lucide",r),...!a&&!R6(l)&&{"aria-hidden":"true"},...l},[...i.map(([c,f])=>p.createElement(c,f)),...Array.isArray(a)?a:[a]]));/**
87
- * @license lucide-react v0.545.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const Gn=(e,t)=>{const n=p.forwardRef(({className:o,...r},a)=>p.createElement(A6,{ref:a,iconNode:t,className:UN(`lucide-${N6(Cw(e))}`,`lucide-${e}`,o),...r}));return n.displayName=Cw(e),n};/**
92
- * @license lucide-react v0.545.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const M6=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],D6=Gn("arrow-left",M6);/**
97
- * @license lucide-react v0.545.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const O6=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],P6=Gn("arrow-right",O6);/**
102
- * @license lucide-react v0.545.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const z6=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],As=Gn("check",z6);/**
107
- * @license lucide-react v0.545.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */const I6=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Jd=Gn("chevron-down",I6);/**
112
- * @license lucide-react v0.545.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const L6=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],pv=Gn("chevron-right",L6);/**
117
- * @license lucide-react v0.545.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const k6=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],$6=Gn("chevron-up",k6);/**
122
- * @license lucide-react v0.545.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const H6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ef=Gn("circle",H6);/**
127
- * @license lucide-react v0.545.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const B6=[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]],U6=Gn("dot",B6);/**
132
- * @license lucide-react v0.545.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const V6=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],G6=Gn("search",V6);/**
137
- * @license lucide-react v0.545.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const Y6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],mv=Gn("x",Y6);function VN(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=VN(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function hv(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=VN(e))&&(o&&(o+=" "),o+=t);return o}const gv="-",F6=e=>{const t=K6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{const l=i.split(gv);return l[0]===""&&l.length!==1&&l.shift(),GN(l,t)||X6(i)},getConflictingClassGroupIds:(i,l)=>{const s=n[i]||[];return l&&o[i]?[...s,...o[i]]:s}}},GN=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?GN(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const a=e.join(gv);return(i=t.validators.find(({validator:l})=>l(a)))==null?void 0:i.classGroupId},Nw=/^\[(.+)\]$/,X6=e=>{if(Nw.test(e)){const t=Nw.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},K6=e=>{const{theme:t,prefix:n}=e,o={nextPart:new Map,validators:[]};return q6(Object.entries(e.classGroups),n).forEach(([a,i])=>{lh(i,o,a,t)}),o},lh=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const a=r===""?t:_w(t,r);a.classGroupId=n;return}if(typeof r=="function"){if(j6(r)){lh(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([a,i])=>{lh(i,_w(t,a),n,o)})})},_w=(e,t)=>{let n=e;return t.split(gv).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},j6=e=>e.isThemeGetter,q6=(e,t)=>t?e.map(([n,o])=>{const r=o.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([i,l])=>[t+i,l])):a);return[n,r]}):e,Z6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(a,i)=>{n.set(a,i),t++,t>e&&(t=0,o=n,n=new Map)};return{get(a){let i=n.get(a);if(i!==void 0)return i;if((i=o.get(a))!==void 0)return r(a,i),i},set(a,i){n.has(a)?n.set(a,i):r(a,i)}}},YN="!",Q6=e=>{const{separator:t,experimentalParseClassName:n}=e,o=t.length===1,r=t[0],a=t.length,i=l=>{const s=[];let c=0,f=0,u;for(let x=0;x<l.length;x++){let h=l[x];if(c===0){if(h===r&&(o||l.slice(x,x+a)===t)){s.push(l.slice(f,x)),f=x+a;continue}if(h==="/"){u=x;continue}}h==="["?c++:h==="]"&&c--}const d=s.length===0?l:l.substring(f),m=d.startsWith(YN),v=m?d.substring(1):d,g=u&&u>f?u-f:void 0;return{modifiers:s,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:i}):i},W6=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(o=>{o[0]==="["?(t.push(...n.sort(),o),n=[]):n.push(o)}),t.push(...n.sort()),t},J6=e=>({cache:Z6(e.cacheSize),parseClassName:Q6(e),...F6(e)}),e8=/\s+/,t8=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r}=t,a=[],i=e.trim().split(e8);let l="";for(let s=i.length-1;s>=0;s-=1){const c=i[s],{modifiers:f,hasImportantModifier:u,baseClassName:d,maybePostfixModifierPosition:m}=n(c);let v=!!m,g=o(v?d.substring(0,m):d);if(!g){if(!v){l=c+(l.length>0?" "+l:l);continue}if(g=o(d),!g){l=c+(l.length>0?" "+l:l);continue}v=!1}const x=W6(f).join(":"),h=u?x+YN:x,w=h+g;if(a.includes(w))continue;a.push(w);const y=r(g,v);for(let S=0;S<y.length;++S){const E=y[S];a.push(h+E)}l=c+(l.length>0?" "+l:l)}return l};function n8(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=FN(t))&&(o&&(o+=" "),o+=n);return o}const FN=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=FN(e[o]))&&(n&&(n+=" "),n+=t);return n};function o8(e,...t){let n,o,r,a=i;function i(s){const c=t.reduce((f,u)=>u(f),e());return n=J6(c),o=n.cache.get,r=n.cache.set,a=l,l(s)}function l(s){const c=o(s);if(c)return c;const f=t8(s,n);return r(s,f),f}return function(){return a(n8.apply(null,arguments))}}const Ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},XN=/^\[(?:([a-z-]+):)?(.+)\]$/i,r8=/^\d+\/\d+$/,a8=new Set(["px","full","screen"]),i8=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,l8=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,s8=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,c8=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,u8=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jn=e=>qa(e)||a8.has(e)||r8.test(e),Mo=e=>Oi(e,"length",y8),qa=e=>!!e&&!Number.isNaN(Number(e)),Mp=e=>Oi(e,"number",qa),Qi=e=>!!e&&Number.isInteger(Number(e)),d8=e=>e.endsWith("%")&&qa(e.slice(0,-1)),he=e=>XN.test(e),Do=e=>i8.test(e),f8=new Set(["length","size","percentage"]),p8=e=>Oi(e,f8,KN),m8=e=>Oi(e,"position",KN),h8=new Set(["image","url"]),g8=e=>Oi(e,h8,w8),v8=e=>Oi(e,"",b8),Wi=()=>!0,Oi=(e,t,n)=>{const o=XN.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):n(o[2]):!1},y8=e=>l8.test(e)&&!s8.test(e),KN=()=>!1,b8=e=>c8.test(e),w8=e=>u8.test(e),x8=()=>{const e=Ie("colors"),t=Ie("spacing"),n=Ie("blur"),o=Ie("brightness"),r=Ie("borderColor"),a=Ie("borderRadius"),i=Ie("borderSpacing"),l=Ie("borderWidth"),s=Ie("contrast"),c=Ie("grayscale"),f=Ie("hueRotate"),u=Ie("invert"),d=Ie("gap"),m=Ie("gradientColorStops"),v=Ie("gradientColorStopPositions"),g=Ie("inset"),x=Ie("margin"),h=Ie("opacity"),w=Ie("padding"),y=Ie("saturate"),S=Ie("scale"),E=Ie("sepia"),N=Ie("skew"),C=Ie("space"),A=Ie("translate"),T=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",he,t],O=()=>[he,t],P=()=>["",Jn,Mo],_=()=>["auto",qa,he],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],R=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",he],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[qa,he];return{cacheSize:500,separator:":",theme:{colors:[Wi],spacing:[Jn,Mo],blur:["none","",Do,he],brightness:F(),borderColor:[e],borderRadius:["none","","full",Do,he],borderSpacing:O(),borderWidth:P(),contrast:F(),grayscale:M(),hueRotate:F(),invert:M(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[d8,Mo],inset:z(),margin:z(),opacity:F(),padding:O(),saturate:F(),scale:F(),sepia:M(),skew:F(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",he]}],container:["container"],columns:[{columns:[Do]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),he]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Qi,he]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",he]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",Qi,he]}],"grid-cols":[{"grid-cols":[Wi]}],"col-start-end":[{col:["auto",{span:["full",Qi,he]},he]}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":[Wi]}],"row-start-end":[{row:["auto",{span:[Qi,he]},he]}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",he]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",he]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",he,t]}],"min-w":[{"min-w":[he,t,"min","max","fit"]}],"max-w":[{"max-w":[he,t,"none","full","min","max","fit","prose",{screen:[Do]},Do]}],h:[{h:[he,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[he,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[he,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[he,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Do,Mo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mp]}],"font-family":[{font:[Wi]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",he]}],"line-clamp":[{"line-clamp":["none",qa,Mp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Jn,he]}],"list-image":[{"list-image":["none",he]}],"list-style-type":[{list:["none","disc","decimal",he]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...R(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Jn,Mo]}],"underline-offset":[{"underline-offset":["auto",Jn,he]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),m8]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",p8]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},g8]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...R(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:R()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...R()]}],"outline-offset":[{"outline-offset":[Jn,he]}],"outline-w":[{outline:[Jn,Mo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[Jn,Mo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Do,v8]}],"shadow-color":[{shadow:[Wi]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[s]}],"drop-shadow":[{"drop-shadow":["","none",Do,he]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[u]}],saturate:[{saturate:[y]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[s]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",he]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",he]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",he]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Qi,he]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",he]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Jn,Mo,Mp]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},S8=o8(x8);function X(...e){return S8(hv(e))}const E8=p.forwardRef(({className:e,...t},n)=>b(E6,{ref:n,className:X("border-b",e),...t}));E8.displayName="AccordionItem";const C8=p.forwardRef(({className:e,children:t,...n},o)=>b(C6,{className:"flex",children:re(HN,{ref:o,className:X("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,b(Jd,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));C8.displayName=HN.displayName;const N8=p.forwardRef(({className:e,children:t,...n},o)=>b(BN,{ref:o,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:b("div",{className:X("pb-4 pt-0",e),children:t})}));N8.displayName=BN.displayName;const Rw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Tw=hv,aa=(e,t)=>n=>{var o;if((t==null?void 0:t.variants)==null)return Tw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:a}=t,i=Object.keys(r).map(c=>{const f=n==null?void 0:n[c],u=a==null?void 0:a[c];if(f===null)return null;const d=Rw(f)||Rw(u);return r[c][d]}),l=n&&Object.entries(n).reduce((c,f)=>{let[u,d]=f;return d===void 0||(c[u]=d),c},{}),s=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((c,f)=>{let{class:u,className:d,...m}=f;return Object.entries(m).every(v=>{let[g,x]=v;return Array.isArray(x)?x.includes({...a,...l}[g]):{...a,...l}[g]===x})?[...c,u,d]:c},[]);return Tw(e,i,s,n==null?void 0:n.class,n==null?void 0:n.className)},_8=aa("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),R8=p.forwardRef(({className:e,variant:t,...n},o)=>b("div",{ref:o,role:"alert",className:X(_8({variant:t}),e),...n}));R8.displayName="Alert";const T8=p.forwardRef(({className:e,...t},n)=>b("h5",{ref:n,className:X("mb-1 font-medium leading-none tracking-tight",e),...t}));T8.displayName="AlertTitle";const A8=p.forwardRef(({className:e,...t},n)=>b("div",{ref:n,className:X("text-sm [&_p]:leading-relaxed",e),...t}));A8.displayName="AlertDescription";function Ae(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function M8(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e);p.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var D8="DismissableLayer",sh="dismissableLayer.update",O8="dismissableLayer.pointerDownOutside",P8="dismissableLayer.focusOutside",Aw,jN=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Co=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,onDismiss:l,...s}=e,c=p.useContext(jN),[f,u]=p.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=p.useState({}),v=le(t,C=>u(C)),g=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),h=g.indexOf(x),w=f?g.indexOf(f):-1,y=c.layersWithOutsidePointerEventsDisabled.size>0,S=w>=h,E=I8(C=>{const A=C.target,T=[...c.branches].some(k=>k.contains(A));!S||T||(r==null||r(C),i==null||i(C),C.defaultPrevented||l==null||l())},d),N=L8(C=>{const A=C.target;[...c.branches].some(k=>k.contains(A))||(a==null||a(C),i==null||i(C),C.defaultPrevented||l==null||l())},d);return M8(C=>{w===c.layers.size-1&&(o==null||o(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},d),p.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Aw=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Mw(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=Aw)}},[f,d,n,c]),p.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Mw())},[f,c]),p.useEffect(()=>{const C=()=>m({});return document.addEventListener(sh,C),()=>document.removeEventListener(sh,C)},[]),b(oe.div,{...s,ref:v,style:{pointerEvents:y?S?"auto":"none":void 0,...e.style},onFocusCapture:j(e.onFocusCapture,N.onFocusCapture),onBlurCapture:j(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:j(e.onPointerDownCapture,E.onPointerDownCapture)})});Co.displayName=D8;var z8="DismissableLayerBranch",qN=p.forwardRef((e,t)=>{const n=p.useContext(jN),o=p.useRef(null),r=le(t,o);return p.useEffect(()=>{const a=o.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),b(oe.div,{...e,ref:r})});qN.displayName=z8;function I8(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),o=p.useRef(!1),r=p.useRef(()=>{});return p.useEffect(()=>{const a=l=>{if(l.target&&!o.current){let s=function(){ZN(O8,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=s,t.addEventListener("click",r.current,{once:!0})):s()}else t.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function L8(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),o=p.useRef(!1);return p.useEffect(()=>{const r=a=>{a.target&&!o.current&&ZN(P8,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Mw(){const e=new CustomEvent(sh);document.dispatchEvent(e)}function ZN(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?ns(r,a):r.dispatchEvent(a)}var k8=Co,$8=qN,Dp="focusScope.autoFocusOnMount",Op="focusScope.autoFocusOnUnmount",Dw={bubbles:!1,cancelable:!0},H8="FocusScope",Ms=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:a,...i}=e,[l,s]=p.useState(null),c=Ae(r),f=Ae(a),u=p.useRef(null),d=le(t,g=>s(g)),m=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(o){let g=function(y){if(m.paused||!l)return;const S=y.target;l.contains(S)?u.current=S:Oo(u.current,{select:!0})},x=function(y){if(m.paused||!l)return;const S=y.relatedTarget;S!==null&&(l.contains(S)||Oo(u.current,{select:!0}))},h=function(y){if(document.activeElement===document.body)for(const E of y)E.removedNodes.length>0&&Oo(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const w=new MutationObserver(h);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),w.disconnect()}}},[o,l,m.paused]),p.useEffect(()=>{if(l){Pw.add(m);const g=document.activeElement;if(!l.contains(g)){const h=new CustomEvent(Dp,Dw);l.addEventListener(Dp,c),l.dispatchEvent(h),h.defaultPrevented||(B8(F8(QN(l)),{select:!0}),document.activeElement===g&&Oo(l))}return()=>{l.removeEventListener(Dp,c),setTimeout(()=>{const h=new CustomEvent(Op,Dw);l.addEventListener(Op,f),l.dispatchEvent(h),h.defaultPrevented||Oo(g??document.body,{select:!0}),l.removeEventListener(Op,f),Pw.remove(m)},0)}}},[l,c,f,m]);const v=p.useCallback(g=>{if(!n&&!o||m.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,h=document.activeElement;if(x&&h){const w=g.currentTarget,[y,S]=U8(w);y&&S?!g.shiftKey&&h===S?(g.preventDefault(),n&&Oo(y,{select:!0})):g.shiftKey&&h===y&&(g.preventDefault(),n&&Oo(S,{select:!0})):h===w&&g.preventDefault()}},[n,o,m.paused]);return b(oe.div,{tabIndex:-1,...i,ref:d,onKeyDown:v})});Ms.displayName=H8;function B8(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Oo(o,{select:t}),document.activeElement!==n)return}function U8(e){const t=QN(e),n=Ow(t,e),o=Ow(t.reverse(),e);return[n,o]}function QN(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ow(e,t){for(const n of e)if(!V8(n,{upTo:t}))return n}function V8(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function G8(e){return e instanceof HTMLInputElement&&"select"in e}function Oo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&G8(e)&&t&&e.select()}}var Pw=Y8();function Y8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=zw(e,t),e.unshift(t)},remove(t){var n;e=zw(e,t),(n=e[0])==null||n.resume()}}}function zw(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function F8(e){return e.filter(t=>t.tagName!=="A")}var X8="Portal",ia=p.forwardRef((e,t)=>{var l;const{container:n,...o}=e,[r,a]=p.useState(!1);He(()=>a(!0),[]);const i=n||r&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?Vx.createPortal(b(oe.div,{...o,ref:t}),i):null});ia.displayName=X8;var Pp=0;function tf(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Iw()),document.body.insertAdjacentElement("beforeend",e[1]??Iw()),Pp++,()=>{Pp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Pp--}},[])}function Iw(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Mn=function(){return Mn=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Mn.apply(this,arguments)};function WN(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function K8(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,a;o<r;o++)(a||!(o in t))&&(a||(a=Array.prototype.slice.call(t,0,o)),a[o]=t[o]);return e.concat(a||Array.prototype.slice.call(t))}var tu="right-scroll-bar-position",nu="width-before-scroll-bar",j8="with-scroll-bars-hidden",q8="--removed-body-scroll-bar-size";function zp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Z8(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var Q8=typeof window<"u"?p.useLayoutEffect:p.useEffect,Lw=new WeakMap;function W8(e,t){var n=Z8(null,function(o){return e.forEach(function(r){return zp(r,o)})});return Q8(function(){var o=Lw.get(n);if(o){var r=new Set(o),a=new Set(e),i=n.current;r.forEach(function(l){a.has(l)||zp(l,null)}),a.forEach(function(l){r.has(l)||zp(l,i)})}Lw.set(n,e)},[e]),n}function J8(e){return e}function eU(e,t){t===void 0&&(t=J8);var n=[],o=!1,r={read:function(){if(o)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]:e},useMedium:function(a){var i=t(a,o);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(a){for(o=!0;n.length;){var i=n;n=[],i.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){o=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(a),i=n}var s=function(){var f=i;i=[],f.forEach(a)},c=function(){return Promise.resolve().then(s)};c(),n={push:function(f){i.push(f),c()},filter:function(f){return i=i.filter(f),n}}}};return r}function tU(e){e===void 0&&(e={});var t=eU(null);return t.options=Mn({async:!0,ssr:!1},e),t}var JN=function(e){var t=e.sideCar,n=WN(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return p.createElement(o,Mn({},n))};JN.isSideCarExport=!0;function nU(e,t){return e.useMedium(t),JN}var e_=tU(),Ip=function(){},nf=p.forwardRef(function(e,t){var n=p.useRef(null),o=p.useState({onScrollCapture:Ip,onWheelCapture:Ip,onTouchMoveCapture:Ip}),r=o[0],a=o[1],i=e.forwardProps,l=e.children,s=e.className,c=e.removeScrollBar,f=e.enabled,u=e.shards,d=e.sideCar,m=e.noRelative,v=e.noIsolation,g=e.inert,x=e.allowPinchZoom,h=e.as,w=h===void 0?"div":h,y=e.gapMode,S=WN(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=d,N=W8([n,t]),C=Mn(Mn({},S),r);return p.createElement(p.Fragment,null,f&&p.createElement(E,{sideCar:e_,removeScrollBar:c,shards:u,noRelative:m,noIsolation:v,inert:g,setCallbacks:a,allowPinchZoom:!!x,lockRef:n,gapMode:y}),i?p.cloneElement(p.Children.only(l),Mn(Mn({},C),{ref:N})):p.createElement(w,Mn({},C,{className:s,ref:N}),l))});nf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};nf.classNames={fullWidth:nu,zeroRight:tu};var oU=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=oU();return t&&e.setAttribute("nonce",t),e}function aU(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iU(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var lU=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rU())&&(aU(t,n),iU(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},sU=function(){var e=lU();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},t_=function(){var e=sU(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},cU={left:0,top:0,right:0,gap:0},Lp=function(e){return parseInt(e||"",10)||0},uU=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Lp(n),Lp(o),Lp(r)]},dU=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return cU;var t=uU(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},fU=t_(),Za="data-scroll-locked",pU=function(e,t,n,o){var r=e.left,a=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
142
- .`.concat(j8,` {
143
- overflow: hidden `).concat(o,`;
144
- padding-right: `).concat(l,"px ").concat(o,`;
145
- }
146
- body[`).concat(Za,`] {
147
- overflow: hidden `).concat(o,`;
148
- overscroll-behavior: contain;
149
- `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
150
- padding-left: `.concat(r,`px;
151
- padding-top: `).concat(a,`px;
152
- padding-right: `).concat(i,`px;
153
- margin-left:0;
154
- margin-top:0;
155
- margin-right: `).concat(l,"px ").concat(o,`;
156
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(o,";")].filter(Boolean).join(""),`
157
- }
158
-
159
- .`).concat(tu,` {
160
- right: `).concat(l,"px ").concat(o,`;
161
- }
162
-
163
- .`).concat(nu,` {
164
- margin-right: `).concat(l,"px ").concat(o,`;
165
- }
166
-
167
- .`).concat(tu," .").concat(tu,` {
168
- right: 0 `).concat(o,`;
169
- }
170
-
171
- .`).concat(nu," .").concat(nu,` {
172
- margin-right: 0 `).concat(o,`;
173
- }
174
-
175
- body[`).concat(Za,`] {
176
- `).concat(q8,": ").concat(l,`px;
177
- }
178
- `)},kw=function(){var e=parseInt(document.body.getAttribute(Za)||"0",10);return isFinite(e)?e:0},mU=function(){p.useEffect(function(){return document.body.setAttribute(Za,(kw()+1).toString()),function(){var e=kw()-1;e<=0?document.body.removeAttribute(Za):document.body.setAttribute(Za,e.toString())}},[])},hU=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;mU();var a=p.useMemo(function(){return dU(r)},[r]);return p.createElement(fU,{styles:pU(a,!t,r,n?"":"!important")})},ch=!1;if(typeof window<"u")try{var Rc=Object.defineProperty({},"passive",{get:function(){return ch=!0,!0}});window.addEventListener("test",Rc,Rc),window.removeEventListener("test",Rc,Rc)}catch{ch=!1}var ha=ch?{passive:!1}:!1,gU=function(e){return e.tagName==="TEXTAREA"},n_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!gU(e)&&n[t]==="visible")},vU=function(e){return n_(e,"overflowY")},yU=function(e){return n_(e,"overflowX")},$w=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=o_(e,o);if(r){var a=r_(e,o),i=a[1],l=a[2];if(i>l)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},bU=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},wU=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},o_=function(e,t){return e==="v"?vU(t):yU(t)},r_=function(e,t){return e==="v"?bU(t):wU(t)},xU=function(e,t){return e==="h"&&t==="rtl"?-1:1},SU=function(e,t,n,o,r){var a=xU(e,window.getComputedStyle(t).direction),i=a*o,l=n.target,s=t.contains(l),c=!1,f=i>0,u=0,d=0;do{if(!l)break;var m=r_(e,l),v=m[0],g=m[1],x=m[2],h=g-x-a*v;(v||h)&&o_(e,l)&&(u+=h,d+=v);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!s&&l!==document.body||s&&(t.contains(l)||t===l));return(f&&Math.abs(u)<1||!f&&Math.abs(d)<1)&&(c=!0),c},Tc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Hw=function(e){return[e.deltaX,e.deltaY]},Bw=function(e){return e&&"current"in e?e.current:e},EU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},CU=function(e){return`
179
- .block-interactivity-`.concat(e,` {pointer-events: none;}
180
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
181
- `)},NU=0,ga=[];function _U(e){var t=p.useRef([]),n=p.useRef([0,0]),o=p.useRef(),r=p.useState(NU++)[0],a=p.useState(t_)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var g=K8([e.lockRef.current],(e.shards||[]).map(Bw),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var h=Tc(g),w=n.current,y="deltaX"in g?g.deltaX:w[0]-h[0],S="deltaY"in g?g.deltaY:w[1]-h[1],E,N=g.target,C=Math.abs(y)>Math.abs(S)?"h":"v";if("touches"in g&&C==="h"&&N.type==="range")return!1;var A=window.getSelection(),T=A&&A.anchorNode,k=T?T===N||T.contains(N):!1;if(k)return!1;var z=$w(C,N);if(!z)return!0;if(z?E=C:(E=C==="v"?"h":"v",z=$w(C,N)),!z)return!1;if(!o.current&&"changedTouches"in g&&(y||S)&&(o.current=E),!E)return!0;var O=o.current||E;return SU(O,x,g,O==="h"?y:S)},[]),s=p.useCallback(function(g){var x=g;if(!(!ga.length||ga[ga.length-1]!==a)){var h="deltaY"in x?Hw(x):Tc(x),w=t.current.filter(function(E){return E.name===x.type&&(E.target===x.target||x.target===E.shadowParent)&&EU(E.delta,h)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var y=(i.current.shards||[]).map(Bw).filter(Boolean).filter(function(E){return E.contains(x.target)}),S=y.length>0?l(x,y[0]):!i.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),c=p.useCallback(function(g,x,h,w){var y={name:g,delta:x,target:h,should:w,shadowParent:RU(h)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(S){return S!==y})},1)},[]),f=p.useCallback(function(g){n.current=Tc(g),o.current=void 0},[]),u=p.useCallback(function(g){c(g.type,Hw(g),g.target,l(g,e.lockRef.current))},[]),d=p.useCallback(function(g){c(g.type,Tc(g),g.target,l(g,e.lockRef.current))},[]);p.useEffect(function(){return ga.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:d}),document.addEventListener("wheel",s,ha),document.addEventListener("touchmove",s,ha),document.addEventListener("touchstart",f,ha),function(){ga=ga.filter(function(g){return g!==a}),document.removeEventListener("wheel",s,ha),document.removeEventListener("touchmove",s,ha),document.removeEventListener("touchstart",f,ha)}},[]);var m=e.removeScrollBar,v=e.inert;return p.createElement(p.Fragment,null,v?p.createElement(a,{styles:CU(r)}):null,m?p.createElement(hU,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function RU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const TU=nU(e_,_U);var Ds=p.forwardRef(function(e,t){return p.createElement(nf,Mn({},e,{ref:t,sideCar:TU}))});Ds.classNames=nf.classNames;var AU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},va=new WeakMap,Ac=new WeakMap,Mc={},kp=0,a_=function(e){return e&&(e.host||a_(e.parentNode))},MU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=a_(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},DU=function(e,t,n,o){var r=MU(t,Array.isArray(e)?e:[e]);Mc[n]||(Mc[n]=new WeakMap);var a=Mc[n],i=[],l=new Set,s=new Set(r),c=function(u){!u||l.has(u)||(l.add(u),c(u.parentNode))};r.forEach(c);var f=function(u){!u||s.has(u)||Array.prototype.forEach.call(u.children,function(d){if(l.has(d))f(d);else try{var m=d.getAttribute(o),v=m!==null&&m!=="false",g=(va.get(d)||0)+1,x=(a.get(d)||0)+1;va.set(d,g),a.set(d,x),i.push(d),g===1&&v&&Ac.set(d,!0),x===1&&d.setAttribute(n,"true"),v||d.setAttribute(o,"true")}catch(h){console.error("aria-hidden: cannot operate on ",d,h)}})};return f(t),l.clear(),kp++,function(){i.forEach(function(u){var d=va.get(u)-1,m=a.get(u)-1;va.set(u,d),a.set(u,m),d||(Ac.has(u)||u.removeAttribute(o),Ac.delete(u)),m||u.removeAttribute(n)}),kp--,kp||(va=new WeakMap,va=new WeakMap,Ac=new WeakMap,Mc={})}},of=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=AU(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),DU(o,r,n,"aria-hidden")):function(){return null}},rf="Dialog",[i_,l_]=Ue(rf),[OU,Tn]=i_(rf),s_=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,l=p.useRef(null),s=p.useRef(null),[c,f]=ht({prop:o,defaultProp:r??!1,onChange:a,caller:rf});return b(OU,{scope:t,triggerRef:l,contentRef:s,contentId:mt(),titleId:mt(),descriptionId:mt(),open:c,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(u=>!u),[f]),modal:i,children:n})};s_.displayName=rf;var c_="DialogTrigger",u_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Tn(c_,n),a=le(t,r.triggerRef);return b(oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":bv(r.open),...o,ref:a,onClick:j(e.onClick,r.onOpenToggle)})});u_.displayName=c_;var vv="DialogPortal",[PU,d_]=i_(vv,{forceMount:void 0}),f_=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,a=Tn(vv,t);return b(PU,{scope:t,forceMount:n,children:p.Children.map(o,i=>b(Pe,{present:n||a.open,children:b(ia,{asChild:!0,container:r,children:i})}))})};f_.displayName=vv;var qu="DialogOverlay",p_=p.forwardRef((e,t)=>{const n=d_(qu,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=Tn(qu,e.__scopeDialog);return a.modal?b(Pe,{present:o||a.open,children:b(IU,{...r,ref:t})}):null});p_.displayName=qu;var zU=Xr("DialogOverlay.RemoveScroll"),IU=p.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Tn(qu,n);return b(Ds,{as:zU,allowPinchZoom:!0,shards:[r.contentRef],children:b(oe.div,{"data-state":bv(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Kr="DialogContent",m_=p.forwardRef((e,t)=>{const n=d_(Kr,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=Tn(Kr,e.__scopeDialog);return b(Pe,{present:o||a.open,children:a.modal?b(LU,{...r,ref:t}):b(kU,{...r,ref:t})})});m_.displayName=Kr;var LU=p.forwardRef((e,t)=>{const n=Tn(Kr,e.__scopeDialog),o=p.useRef(null),r=le(t,n.contentRef,o);return p.useEffect(()=>{const a=o.current;if(a)return of(a)},[]),b(h_,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&a.preventDefault()}),onFocusOutside:j(e.onFocusOutside,a=>a.preventDefault())})}),kU=p.forwardRef((e,t)=>{const n=Tn(Kr,e.__scopeDialog),o=p.useRef(!1),r=p.useRef(!1);return b(h_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(o.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:a=>{var s,c;(s=e.onInteractOutside)==null||s.call(e,a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=a.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),h_=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,...i}=e,l=Tn(Kr,n),s=p.useRef(null),c=le(t,s);return tf(),re(De,{children:[b(Ms,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:b(Co,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":bv(l.open),...i,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),re(De,{children:[b(HU,{titleId:l.titleId}),b(UU,{contentRef:s,descriptionId:l.descriptionId})]})]})}),yv="DialogTitle",g_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Tn(yv,n);return b(oe.h2,{id:r.titleId,...o,ref:t})});g_.displayName=yv;var v_="DialogDescription",y_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Tn(v_,n);return b(oe.p,{id:r.descriptionId,...o,ref:t})});y_.displayName=v_;var b_="DialogClose",w_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=Tn(b_,n);return b(oe.button,{type:"button",...o,ref:t,onClick:j(e.onClick,()=>r.onOpenChange(!1))})});w_.displayName=b_;function bv(e){return e?"open":"closed"}var x_="DialogTitleWarning",[$U,S_]=FB(x_,{contentName:Kr,titleName:yv,docsSlug:"dialog"}),HU=({titleId:e})=>{const t=S_(x_),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
182
-
183
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
184
-
185
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},BU="DialogDescriptionWarning",UU=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${S_(BU).contentName}}.`;return p.useEffect(()=>{var a;const r=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},VU=s_,GU=u_,Os=f_,la=p_,sa=m_,Pi=g_,zi=y_,af=w_,YU="AlertDialog",[FU,RQ]=Ue(YU,[l_]),dr=l_(),XU="AlertDialogTrigger",KU=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=dr(n);return b(GU,{...r,...o,ref:t})});KU.displayName=XU;var jU="AlertDialogPortal",E_=e=>{const{__scopeAlertDialog:t,...n}=e,o=dr(t);return b(Os,{...o,...n})};E_.displayName=jU;var qU="AlertDialogOverlay",C_=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=dr(n);return b(la,{...r,...o,ref:t})});C_.displayName=qU;var Qa="AlertDialogContent",[ZU,QU]=FU(Qa),WU=EN("AlertDialogContent"),N_=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:o,...r}=e,a=dr(n),i=p.useRef(null),l=le(t,i),s=p.useRef(null);return b($U,{contentName:Qa,titleName:__,docsSlug:"alert-dialog",children:b(ZU,{scope:n,cancelRef:s,children:re(sa,{role:"alertdialog",...a,...r,ref:l,onOpenAutoFocus:j(r.onOpenAutoFocus,c=>{var f;c.preventDefault(),(f=s.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[b(WU,{children:o}),b(eV,{contentRef:i})]})})})});N_.displayName=Qa;var __="AlertDialogTitle",R_=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=dr(n);return b(Pi,{...r,...o,ref:t})});R_.displayName=__;var T_="AlertDialogDescription",A_=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=dr(n);return b(zi,{...r,...o,ref:t})});A_.displayName=T_;var JU="AlertDialogAction",M_=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=dr(n);return b(af,{...r,...o,ref:t})});M_.displayName=JU;var D_="AlertDialogCancel",O_=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:r}=QU(D_,n),a=dr(n),i=le(t,r);return b(af,{...a,...o,ref:i})});O_.displayName=D_;var eV=({contentRef:e})=>{const t=`\`${Qa}\` requires a description for the component to be accessible for screen reader users.
186
-
187
- You can add a description to the \`${Qa}\` by passing a \`${T_}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
188
-
189
- Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Qa}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
190
-
191
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{var o;document.getElementById((o=e.current)==null?void 0:o.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},tV=E_,P_=C_,z_=N_,I_=M_,L_=O_,k_=R_,$_=A_,nV=Symbol.for("react.lazy"),Zu=yd[" use ".trim().toString()];function oV(e){return typeof e=="object"&&e!==null&&"then"in e}function H_(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===nV&&"_payload"in e&&oV(e._payload)}function B_(e){const t=rV(e),n=p.forwardRef((o,r)=>{let{children:a,...i}=o;H_(a)&&typeof Zu=="function"&&(a=Zu(a._payload));const l=p.Children.toArray(a),s=l.find(iV);if(s){const c=s.props.children,f=l.map(u=>u===s?p.Children.count(c)>1?p.Children.only(null):p.isValidElement(c)?c.props.children:null:u);return b(t,{...i,ref:r,children:p.isValidElement(c)?p.cloneElement(c,void 0,f):null})}return b(t,{...i,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}var wv=B_("Slot");function rV(e){const t=p.forwardRef((n,o)=>{let{children:r,...a}=n;if(H_(r)&&typeof Zu=="function"&&(r=Zu(r._payload)),p.isValidElement(r)){const i=sV(r),l=lV(a,r.props);return r.type!==p.Fragment&&(l.ref=o?Sn(o,i):i),p.cloneElement(r,l)}return p.Children.count(r)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var aV=Symbol("radix.slottable");function iV(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===aV}function lV(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...l)=>{const s=a(...l);return r(...l),s}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function sV(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const xv=aa("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Sv=p.forwardRef(({className:e,variant:t,size:n,asChild:o=!1,...r},a)=>b(o?wv:"button",{className:X(xv({variant:t,size:n,className:e})),ref:a,...r}));Sv.displayName="Button";const cV=tV,U_=p.forwardRef(({className:e,...t},n)=>b(P_,{className:X("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));U_.displayName=P_.displayName;const uV=p.forwardRef(({className:e,overlayClassName:t,...n},o)=>re(cV,{children:[b(U_,{className:t}),b(z_,{ref:o,className:X("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n})]}));uV.displayName=z_.displayName;const dV=p.forwardRef(({className:e,...t},n)=>b(k_,{ref:n,className:X("text-lg font-semibold",e),...t}));dV.displayName=k_.displayName;const fV=p.forwardRef(({className:e,...t},n)=>b($_,{ref:n,className:X("text-sm text-muted-foreground",e),...t}));fV.displayName=$_.displayName;const pV=p.forwardRef(({className:e,...t},n)=>b(I_,{ref:n,className:X(xv(),e),...t}));pV.displayName=I_.displayName;const mV=p.forwardRef(({className:e,...t},n)=>b(L_,{ref:n,className:X(xv({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));mV.displayName=L_.displayName;var hV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],St=hV.reduce((e,t)=>{const n=B_(`Primitive.${t}`),o=p.forwardRef((r,a)=>{const{asChild:i,...l}=r,s=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b(s,{...l,ref:a})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function V_(e,t=[]){let n=[];function o(a,i){const l=p.createContext(i);l.displayName=a+"Context";const s=n.length;n=[...n,i];const c=u=>{var h;const{scope:d,children:m,...v}=u,g=((h=d==null?void 0:d[e])==null?void 0:h[s])||l,x=p.useMemo(()=>v,Object.values(v));return b(g.Provider,{value:x,children:m})};c.displayName=a+"Provider";function f(u,d){var g;const m=((g=d==null?void 0:d[e])==null?void 0:g[s])||l,v=p.useContext(m);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${a}\``)}return[c,f]}const r=()=>{const a=n.map(i=>p.createContext(i));return function(l){const s=(l==null?void 0:l[e])||a;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:s}}),[l,s])}};return r.scopeName=e,[o,gV(r,...t)]}function gV(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const i=o.reduce((l,{useScope:s,scopeName:c})=>{const u=s(a)[`__scope${c}`];return{...l,...u}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function vV(){return HC.useSyncExternalStore(yV,()=>!0,()=>!1)}function yV(){return()=>{}}var Ev="Avatar",[bV,TQ]=V_(Ev),[wV,G_]=bV(Ev),Y_=p.forwardRef((e,t)=>{const{__scopeAvatar:n,...o}=e,[r,a]=p.useState("idle");return b(wV,{scope:n,imageLoadingStatus:r,onImageLoadingStatusChange:a,children:b(St.span,{...o,ref:t})})});Y_.displayName=Ev;var F_="AvatarImage",X_=p.forwardRef((e,t)=>{const{__scopeAvatar:n,src:o,onLoadingStatusChange:r=()=>{},...a}=e,i=G_(F_,n),l=xV(o,a),s=Ae(c=>{r(c),i.onImageLoadingStatusChange(c)});return He(()=>{l!=="idle"&&s(l)},[l,s]),l==="loaded"?b(St.img,{...a,ref:t,src:o}):null});X_.displayName=F_;var K_="AvatarFallback",j_=p.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:o,...r}=e,a=G_(K_,n),[i,l]=p.useState(o===void 0);return p.useEffect(()=>{if(o!==void 0){const s=window.setTimeout(()=>l(!0),o);return()=>window.clearTimeout(s)}},[o]),i&&a.imageLoadingStatus!=="loaded"?b(St.span,{...r,ref:t}):null});j_.displayName=K_;function Uw(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function xV(e,{referrerPolicy:t,crossOrigin:n}){const o=vV(),r=p.useRef(null),a=o?(r.current||(r.current=new window.Image),r.current):null,[i,l]=p.useState(()=>Uw(a,e));return He(()=>{l(Uw(a,e))},[a,e]),He(()=>{const s=u=>()=>{l(u)};if(!a)return;const c=s("loaded"),f=s("error");return a.addEventListener("load",c),a.addEventListener("error",f),t&&(a.referrerPolicy=t),typeof n=="string"&&(a.crossOrigin=n),()=>{a.removeEventListener("load",c),a.removeEventListener("error",f)}},[a,n,t]),i}var q_=Y_,Z_=X_,Q_=j_;const SV=p.forwardRef(({className:e,...t},n)=>b(q_,{ref:n,className:X("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));SV.displayName=q_.displayName;const EV=p.forwardRef(({className:e,...t},n)=>b(Z_,{ref:n,className:X("aspect-square h-full w-full",e),...t}));EV.displayName=Z_.displayName;const CV=p.forwardRef(({className:e,...t},n)=>b(Q_,{ref:n,className:X("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));CV.displayName=Q_.displayName;const NV=p.forwardRef(({...e},t)=>b("nav",{ref:t,"aria-label":"breadcrumb",...e}));NV.displayName="Breadcrumb";const _V=p.forwardRef(({className:e,...t},n)=>b("ol",{ref:n,className:X("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));_V.displayName="BreadcrumbList";const RV=p.forwardRef(({className:e,...t},n)=>b("li",{ref:n,className:X("inline-flex items-center gap-1.5",e),...t}));RV.displayName="BreadcrumbItem";const TV=p.forwardRef(({asChild:e,className:t,...n},o)=>b(e?wv:"a",{ref:o,className:X("transition-colors hover:text-foreground",t),...n}));TV.displayName="BreadcrumbLink";const AV=p.forwardRef(({className:e,...t},n)=>b("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:X("font-normal text-foreground",e),...t}));AV.displayName="BreadcrumbPage";const MV=p.forwardRef(({className:e,...t},n)=>b("div",{ref:n,className:X("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));MV.displayName="Card";const DV=p.forwardRef(({className:e,...t},n)=>b("div",{ref:n,className:X("flex flex-col space-y-1.5 p-6",e),...t}));DV.displayName="CardHeader";const OV=p.forwardRef(({className:e,...t},n)=>b("div",{ref:n,className:X("text-2xl font-semibold leading-none tracking-tight",e),...t}));OV.displayName="CardTitle";const PV=p.forwardRef(({className:e,...t},n)=>b("div",{ref:n,className:X("text-sm text-muted-foreground",e),...t}));PV.displayName="CardDescription";const zV=p.forwardRef(({className:e,...t},n)=>b("div",{ref:n,className:X("p-6 pt-0",e),...t}));zV.displayName="CardContent";const IV=p.forwardRef(({className:e,...t},n)=>b("div",{ref:n,className:X("flex items-center p-6 pt-0",e),...t}));IV.displayName="CardFooter";function LV(e){return Object.prototype.toString.call(e)==="[object Object]"}function Vw(e){return LV(e)||Array.isArray(e)}function kV(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Cv(e,t){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;const r=JSON.stringify(Object.keys(e.breakpoints||{})),a=JSON.stringify(Object.keys(t.breakpoints||{}));return r!==a?!1:n.every(i=>{const l=e[i],s=t[i];return typeof l=="function"?`${l}`==`${s}`:!Vw(l)||!Vw(s)?l===s:Cv(l,s)})}function Gw(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function $V(e,t){if(e.length!==t.length)return!1;const n=Gw(e),o=Gw(t);return n.every((r,a)=>{const i=o[a];return Cv(r,i)})}function Nv(e){return typeof e=="number"}function uh(e){return typeof e=="string"}function lf(e){return typeof e=="boolean"}function Yw(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ye(e){return Math.abs(e)}function _v(e){return Math.sign(e)}function Ml(e,t){return Ye(e-t)}function HV(e,t){if(e===0||t===0||Ye(e)<=Ye(t))return 0;const n=Ml(Ye(e),Ye(t));return Ye(n/e)}function BV(e){return Math.round(e*100)/100}function os(e){return rs(e).map(Number)}function xn(e){return e[Ps(e)]}function Ps(e){return Math.max(0,e.length-1)}function Rv(e,t){return t===Ps(e)}function Fw(e,t=0){return Array.from(Array(e),(n,o)=>t+o)}function rs(e){return Object.keys(e)}function W_(e,t){return[e,t].reduce((n,o)=>(rs(o).forEach(r=>{const a=n[r],i=o[r],l=Yw(a)&&Yw(i);n[r]=l?W_(a,i):i}),n),{})}function dh(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function UV(e,t){const n={start:o,center:r,end:a};function o(){return 0}function r(s){return a(s)/2}function a(s){return t-s}function i(s,c){return uh(e)?n[e](s):e(t,s,c)}return{measure:i}}function as(){let e=[];function t(r,a,i,l={passive:!0}){let s;if("addEventListener"in r)r.addEventListener(a,i,l),s=()=>r.removeEventListener(a,i,l);else{const c=r;c.addListener(i),s=()=>c.removeListener(i)}return e.push(s),o}function n(){e=e.filter(r=>r())}const o={add:t,clear:n};return o}function VV(e,t,n,o){const r=as(),a=1e3/60;let i=null,l=0,s=0;function c(){r.add(e,"visibilitychange",()=>{e.hidden&&v()})}function f(){m(),r.clear()}function u(x){if(!s)return;i||(i=x,n(),n());const h=x-i;for(i=x,l+=h;l>=a;)n(),l-=a;const w=l/a;o(w),s&&(s=t.requestAnimationFrame(u))}function d(){s||(s=t.requestAnimationFrame(u))}function m(){t.cancelAnimationFrame(s),i=null,l=0,s=0}function v(){i=null,l=0}return{init:c,destroy:f,start:d,stop:m,update:n,render:o}}function GV(e,t){const n=t==="rtl",o=e==="y",r=o?"y":"x",a=o?"x":"y",i=!o&&n?-1:1,l=f(),s=u();function c(v){const{height:g,width:x}=v;return o?g:x}function f(){return o?"top":n?"right":"left"}function u(){return o?"bottom":n?"left":"right"}function d(v){return v*i}return{scroll:r,cross:a,startEdge:l,endEdge:s,measureSize:c,direction:d}}function jr(e=0,t=0){const n=Ye(e-t);function o(c){return c<e}function r(c){return c>t}function a(c){return o(c)||r(c)}function i(c){return a(c)?o(c)?e:t:c}function l(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:i,reachedAny:a,reachedMax:r,reachedMin:o,removeOffset:l}}function J_(e,t,n){const{constrain:o}=jr(0,e),r=e+1;let a=i(t);function i(d){return n?Ye((r+d)%r):o(d)}function l(){return a}function s(d){return a=i(d),u}function c(d){return f().set(l()+d)}function f(){return J_(e,l(),n)}const u={get:l,set:s,add:c,clone:f};return u}function YV(e,t,n,o,r,a,i,l,s,c,f,u,d,m,v,g,x,h,w){const{cross:y,direction:S}=e,E=["INPUT","SELECT","TEXTAREA"],N={passive:!1},C=as(),A=as(),T=jr(50,225).constrain(m.measure(20)),k={mouse:300,touch:400},z={mouse:500,touch:600},O=v?43:25;let P=!1,_=0,L=0,R=!1,I=!1,D=!1,M=!1;function U(K){if(!w)return;function W(ne){(lf(w)||w(K,ne))&&q(ne)}const Q=t;C.add(Q,"dragstart",ne=>ne.preventDefault(),N).add(Q,"touchmove",()=>{},N).add(Q,"touchend",()=>{}).add(Q,"touchstart",W).add(Q,"mousedown",W).add(Q,"touchcancel",G).add(Q,"contextmenu",G).add(Q,"click",Z,!0)}function F(){C.clear(),A.clear()}function $(){const K=M?n:t;A.add(K,"touchmove",B,N).add(K,"touchend",G).add(K,"mousemove",B,N).add(K,"mouseup",G)}function H(K){const W=K.nodeName||"";return E.includes(W)}function V(){return(v?z:k)[M?"mouse":"touch"]}function Y(K,W){const Q=u.add(_v(K)*-1),ne=f.byDistance(K,!v).distance;return v||Ye(K)<T?ne:x&&W?ne*.5:f.byIndex(Q.get(),0).distance}function q(K){const W=dh(K,o);M=W,D=v&&W&&!K.buttons&&P,P=Ml(r.get(),i.get())>=2,!(W&&K.button!==0)&&(H(K.target)||(R=!0,a.pointerDown(K),c.useFriction(0).useDuration(0),r.set(i),$(),_=a.readPoint(K),L=a.readPoint(K,y),d.emit("pointerDown")))}function B(K){if(!dh(K,o)&&K.touches.length>=2)return G(K);const Q=a.readPoint(K),ne=a.readPoint(K,y),ae=Ml(Q,_),ce=Ml(ne,L);if(!I&&!M&&(!K.cancelable||(I=ae>ce,!I)))return G(K);const fe=a.pointerMove(K);ae>g&&(D=!0),c.useFriction(.3).useDuration(.75),l.start(),r.add(S(fe)),K.preventDefault()}function G(K){const Q=f.byDistance(0,!1).index!==u.get(),ne=a.pointerUp(K)*V(),ae=Y(S(ne),Q),ce=HV(ne,ae),fe=O-10*ce,ue=h+ce/50;I=!1,R=!1,A.clear(),c.useDuration(fe).useFriction(ue),s.distance(ae,!v),M=!1,d.emit("pointerUp")}function Z(K){D&&(K.stopPropagation(),K.preventDefault(),D=!1)}function ee(){return R}return{init:U,destroy:F,pointerDown:ee}}function FV(e,t){let o,r;function a(u){return u.timeStamp}function i(u,d){const v=`client${(d||e.scroll)==="x"?"X":"Y"}`;return(dh(u,t)?u:u.touches[0])[v]}function l(u){return o=u,r=u,i(u)}function s(u){const d=i(u)-i(r),m=a(u)-a(o)>170;return r=u,m&&(o=u),d}function c(u){if(!o||!r)return 0;const d=i(r)-i(o),m=a(u)-a(o),v=a(u)-a(r)>170,g=d/m;return m&&!v&&Ye(g)>.1?g:0}return{pointerDown:l,pointerMove:s,pointerUp:c,readPoint:i}}function XV(){function e(n){const{offsetTop:o,offsetLeft:r,offsetWidth:a,offsetHeight:i}=n;return{top:o,right:r+a,bottom:o+i,left:r,width:a,height:i}}return{measure:e}}function KV(e){function t(o){return e*(o/100)}return{measure:t}}function jV(e,t,n,o,r,a,i){const l=[e].concat(o);let s,c,f=[],u=!1;function d(x){return r.measureSize(i.measure(x))}function m(x){if(!a)return;c=d(e),f=o.map(d);function h(w){for(const y of w){if(u)return;const S=y.target===e,E=o.indexOf(y.target),N=S?c:f[E],C=d(S?e:o[E]);if(Ye(C-N)>=.5){x.reInit(),t.emit("resize");break}}}s=new ResizeObserver(w=>{(lf(a)||a(x,w))&&h(w)}),n.requestAnimationFrame(()=>{l.forEach(w=>s.observe(w))})}function v(){u=!0,s&&s.disconnect()}return{init:m,destroy:v}}function qV(e,t,n,o,r,a){let i=0,l=0,s=r,c=a,f=e.get(),u=0;function d(){const N=o.get()-e.get(),C=!s;let A=0;return C?(i=0,n.set(o),e.set(o),A=N):(n.set(e),i+=N/s,i*=c,f+=i,e.add(i),A=f-u),l=_v(A),u=f,E}function m(){const N=o.get()-t.get();return Ye(N)<.001}function v(){return s}function g(){return l}function x(){return i}function h(){return y(r)}function w(){return S(a)}function y(N){return s=N,E}function S(N){return c=N,E}const E={direction:g,duration:v,velocity:x,seek:d,settled:m,useBaseFriction:w,useBaseDuration:h,useFriction:S,useDuration:y};return E}function ZV(e,t,n,o,r){const a=r.measure(10),i=r.measure(50),l=jr(.1,.99);let s=!1;function c(){return!(s||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function f(m){if(!c())return;const v=e.reachedMin(t.get())?"min":"max",g=Ye(e[v]-t.get()),x=n.get()-t.get(),h=l.constrain(g/i);n.subtract(x*h),!m&&Ye(x)<a&&(n.set(e.constrain(n.get())),o.useDuration(25).useBaseFriction())}function u(m){s=!m}return{shouldConstrain:c,constrain:f,toggleActive:u}}function QV(e,t,n,o,r){const a=jr(-t+e,0),i=u(),l=f(),s=d();function c(v,g){return Ml(v,g)<=1}function f(){const v=i[0],g=xn(i),x=i.lastIndexOf(v),h=i.indexOf(g)+1;return jr(x,h)}function u(){return n.map((v,g)=>{const{min:x,max:h}=a,w=a.constrain(v),y=!g,S=Rv(n,g);return y?h:S||c(x,w)?x:c(h,w)?h:w}).map(v=>parseFloat(v.toFixed(3)))}function d(){if(t<=e+r)return[a.max];if(o==="keepSnaps")return i;const{min:v,max:g}=l;return i.slice(v,g)}return{snapsContained:s,scrollContainLimit:l}}function WV(e,t,n){const o=t[0],r=n?o-e:xn(t);return{limit:jr(r,o)}}function JV(e,t,n,o){const a=t.min+.1,i=t.max+.1,{reachedMin:l,reachedMax:s}=jr(a,i);function c(d){return d===1?s(n.get()):d===-1?l(n.get()):!1}function f(d){if(!c(d))return;const m=e*(d*-1);o.forEach(v=>v.add(m))}return{loop:f}}function e9(e){const{max:t,length:n}=e;function o(a){const i=a-t;return n?i/-n:0}return{get:o}}function t9(e,t,n,o,r){const{startEdge:a,endEdge:i}=e,{groupSlides:l}=r,s=u().map(t.measure),c=d(),f=m();function u(){return l(o).map(g=>xn(g)[i]-g[0][a]).map(Ye)}function d(){return o.map(g=>n[a]-g[a]).map(g=>-Ye(g))}function m(){return l(c).map(g=>g[0]).map((g,x)=>g+s[x])}return{snaps:c,snapsAligned:f}}function n9(e,t,n,o,r,a){const{groupSlides:i}=r,{min:l,max:s}=o,c=f();function f(){const d=i(a),m=!e||t==="keepSnaps";return n.length===1?[a]:m?d:d.slice(l,s).map((v,g,x)=>{const h=!g,w=Rv(x,g);if(h){const y=xn(x[0])+1;return Fw(y)}if(w){const y=Ps(a)-xn(x)[0]+1;return Fw(y,xn(x)[0])}return v})}return{slideRegistry:c}}function o9(e,t,n,o,r){const{reachedAny:a,removeOffset:i,constrain:l}=o;function s(v){return v.concat().sort((g,x)=>Ye(g)-Ye(x))[0]}function c(v){const g=e?i(v):l(v),x=t.map((w,y)=>({diff:f(w-g,0),index:y})).sort((w,y)=>Ye(w.diff)-Ye(y.diff)),{index:h}=x[0];return{index:h,distance:g}}function f(v,g){const x=[v,v+n,v-n];if(!e)return v;if(!g)return s(x);const h=x.filter(w=>_v(w)===g);return h.length?s(h):xn(x)-n}function u(v,g){const x=t[v]-r.get(),h=f(x,g);return{index:v,distance:h}}function d(v,g){const x=r.get()+v,{index:h,distance:w}=c(x),y=!e&&a(x);if(!g||y)return{index:h,distance:v};const S=t[h]-w,E=v+f(S,0);return{index:h,distance:E}}return{byDistance:d,byIndex:u,shortcut:f}}function r9(e,t,n,o,r,a,i){function l(u){const d=u.distance,m=u.index!==t.get();a.add(d),d&&(o.duration()?e.start():(e.update(),e.render(1),e.update())),m&&(n.set(t.get()),t.set(u.index),i.emit("select"))}function s(u,d){const m=r.byDistance(u,d);l(m)}function c(u,d){const m=t.clone().set(u),v=r.byIndex(m.get(),d);l(v)}return{distance:s,index:c}}function a9(e,t,n,o,r,a,i,l){const s={passive:!0,capture:!0};let c=0;function f(m){if(!l)return;function v(g){if(new Date().getTime()-c>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const w=n.findIndex(y=>y.includes(g));Nv(w)&&(r.useDuration(0),o.index(w,0),i.emit("slideFocus"))}a.add(document,"keydown",u,!1),t.forEach((g,x)=>{a.add(g,"focus",h=>{(lf(l)||l(m,h))&&v(x)},s)})}function u(m){m.code==="Tab"&&(c=new Date().getTime())}return{init:f}}function cl(e){let t=e;function n(){return t}function o(s){t=i(s)}function r(s){t+=i(s)}function a(s){t-=i(s)}function i(s){return Nv(s)?s:s.get()}return{get:n,set:o,add:r,subtract:a}}function eR(e,t){const n=e.scroll==="x"?i:l,o=t.style;let r=null,a=!1;function i(d){return`translate3d(${d}px,0px,0px)`}function l(d){return`translate3d(0px,${d}px,0px)`}function s(d){if(a)return;const m=BV(e.direction(d));m!==r&&(o.transform=n(m),r=m)}function c(d){a=!d}function f(){a||(o.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:f,to:s,toggleActive:c}}function i9(e,t,n,o,r,a,i,l,s){const f=os(r),u=os(r).reverse(),d=h().concat(w());function m(C,A){return C.reduce((T,k)=>T-r[k],A)}function v(C,A){return C.reduce((T,k)=>m(T,A)>0?T.concat([k]):T,[])}function g(C){return a.map((A,T)=>({start:A-o[T]+.5+C,end:A+t-.5+C}))}function x(C,A,T){const k=g(A);return C.map(z=>{const O=T?0:-n,P=T?n:0,_=T?"end":"start",L=k[z][_];return{index:z,loopPoint:L,slideLocation:cl(-1),translate:eR(e,s[z]),target:()=>l.get()>L?O:P}})}function h(){const C=i[0],A=v(u,C);return x(A,n,!1)}function w(){const C=t-i[0]-1,A=v(f,C);return x(A,-n,!0)}function y(){return d.every(({index:C})=>{const A=f.filter(T=>T!==C);return m(A,t)<=.1})}function S(){d.forEach(C=>{const{target:A,translate:T,slideLocation:k}=C,z=A();z!==k.get()&&(T.to(z),k.set(z))})}function E(){d.forEach(C=>C.translate.clear())}return{canLoop:y,clear:E,loop:S,loopPoints:d}}function l9(e,t,n){let o,r=!1;function a(s){if(!n)return;function c(f){for(const u of f)if(u.type==="childList"){s.reInit(),t.emit("slidesChanged");break}}o=new MutationObserver(f=>{r||(lf(n)||n(s,f))&&c(f)}),o.observe(e,{childList:!0})}function i(){o&&o.disconnect(),r=!0}return{init:a,destroy:i}}function s9(e,t,n,o){const r={};let a=null,i=null,l,s=!1;function c(){l=new IntersectionObserver(v=>{s||(v.forEach(g=>{const x=t.indexOf(g.target);r[x]=g}),a=null,i=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:o}),t.forEach(v=>l.observe(v))}function f(){l&&l.disconnect(),s=!0}function u(v){return rs(r).reduce((g,x)=>{const h=parseInt(x),{isIntersecting:w}=r[h];return(v&&w||!v&&!w)&&g.push(h),g},[])}function d(v=!0){if(v&&a)return a;if(!v&&i)return i;const g=u(v);return v&&(a=g),v||(i=g),g}return{init:c,destroy:f,get:d}}function c9(e,t,n,o,r,a){const{measureSize:i,startEdge:l,endEdge:s}=e,c=n[0]&&r,f=v(),u=g(),d=n.map(i),m=x();function v(){if(!c)return 0;const w=n[0];return Ye(t[l]-w[l])}function g(){if(!c)return 0;const w=a.getComputedStyle(xn(o));return parseFloat(w.getPropertyValue(`margin-${s}`))}function x(){return n.map((w,y,S)=>{const E=!y,N=Rv(S,y);return E?d[y]+f:N?d[y]+u:S[y+1][l]-w[l]}).map(Ye)}return{slideSizes:d,slideSizesWithGaps:m,startGap:f,endGap:u}}function u9(e,t,n,o,r,a,i,l,s){const{startEdge:c,endEdge:f,direction:u}=e,d=Nv(n);function m(h,w){return os(h).filter(y=>y%w===0).map(y=>h.slice(y,y+w))}function v(h){return h.length?os(h).reduce((w,y,S)=>{const E=xn(w)||0,N=E===0,C=y===Ps(h),A=r[c]-a[E][c],T=r[c]-a[y][f],k=!o&&N?u(i):0,z=!o&&C?u(l):0,O=Ye(T-z-(A+k));return S&&O>t+s&&w.push(y),C&&w.push(h.length),w},[]).map((w,y,S)=>{const E=Math.max(S[y-1]||0);return h.slice(E,w)}):[]}function g(h){return d?m(h,n):v(h)}return{groupSlides:g}}function d9(e,t,n,o,r,a,i){const{align:l,axis:s,direction:c,startIndex:f,loop:u,duration:d,dragFree:m,dragThreshold:v,inViewThreshold:g,slidesToScroll:x,skipSnaps:h,containScroll:w,watchResize:y,watchSlides:S,watchDrag:E,watchFocus:N}=a,C=2,A=XV(),T=A.measure(t),k=n.map(A.measure),z=GV(s,c),O=z.measureSize(T),P=KV(O),_=UV(l,O),L=!u&&!!w,R=u||!!w,{slideSizes:I,slideSizesWithGaps:D,startGap:M,endGap:U}=c9(z,T,k,n,R,r),F=u9(z,O,x,u,T,k,M,U,C),{snaps:$,snapsAligned:H}=t9(z,_,T,k,F),V=-xn($)+xn(D),{snapsContained:Y,scrollContainLimit:q}=QV(O,V,H,w,C),B=L?Y:H,{limit:G}=WV(V,B,u),Z=J_(Ps(B),f,u),ee=Z.clone(),te=os(n),K=({dragHandler:Wt,scrollBody:yr,scrollBounds:br,options:{loop:Et}})=>{Et||br.constrain(Wt.pointerDown()),yr.seek()},W=({scrollBody:Wt,translate:yr,location:br,offsetLocation:Et,previousLocation:wr,scrollLooper:Ui,slideLooper:Mf,dragHandler:Df,animation:Of,eventHandler:js,scrollBounds:Pf,options:{loop:qs}},Zs)=>{const Qs=Wt.settled(),zf=!Pf.shouldConstrain(),Ws=qs?Qs:Qs&&zf,Js=Ws&&!Df.pointerDown();Js&&Of.stop();const If=br.get()*Zs+wr.get()*(1-Zs);Et.set(If),qs&&(Ui.loop(Wt.direction()),Mf.loop()),yr.to(Et.get()),Js&&js.emit("settle"),Ws||js.emit("scroll")},Q=VV(o,r,()=>K(_o),Wt=>W(_o,Wt)),ne=.68,ae=B[Z.get()],ce=cl(ae),fe=cl(ae),ue=cl(ae),_e=cl(ae),je=qV(ce,ue,fe,_e,d,ne),Ve=o9(u,B,V,G,_e),nt=r9(Q,Z,ee,je,Ve,_e,i),gt=e9(G),vt=as(),st=s9(t,n,i,g),{slideRegistry:yt}=n9(L,w,B,q,F,te),vr=a9(e,n,yt,nt,je,vt,i,N),_o={ownerDocument:o,ownerWindow:r,eventHandler:i,containerRect:T,slideRects:k,animation:Q,axis:z,dragHandler:YV(z,e,o,r,_e,FV(z,r),ce,Q,nt,je,Ve,Z,i,P,m,v,h,ne,E),eventStore:vt,percentOfView:P,index:Z,indexPrevious:ee,limit:G,location:ce,offsetLocation:ue,previousLocation:fe,options:a,resizeHandler:jV(t,i,r,n,z,y,A),scrollBody:je,scrollBounds:ZV(G,ue,_e,je,P),scrollLooper:JV(V,G,ue,[ce,ue,fe,_e]),scrollProgress:gt,scrollSnapList:B.map(gt.get),scrollSnaps:B,scrollTarget:Ve,scrollTo:nt,slideLooper:i9(z,O,V,I,D,$,B,ue,n),slideFocus:vr,slidesHandler:l9(t,i,S),slidesInView:st,slideIndexes:te,slideRegistry:yt,slidesToScroll:F,target:_e,translate:eR(z,t)};return _o}function f9(){let e={},t;function n(c){t=c}function o(c){return e[c]||[]}function r(c){return o(c).forEach(f=>f(t,c)),s}function a(c,f){return e[c]=o(c).concat([f]),s}function i(c,f){return e[c]=o(c).filter(u=>u!==f),s}function l(){e={}}const s={init:n,emit:r,off:i,on:a,clear:l};return s}const p9={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function m9(e){function t(a,i){return W_(a,i||{})}function n(a){const i=a.breakpoints||{},l=rs(i).filter(s=>e.matchMedia(s).matches).map(s=>i[s]).reduce((s,c)=>t(s,c),{});return t(a,l)}function o(a){return a.map(i=>rs(i.breakpoints||{})).reduce((i,l)=>i.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:o}}function h9(e){let t=[];function n(a,i){return t=i.filter(({options:l})=>e.optionsAtMedia(l).active!==!1),t.forEach(l=>l.init(a,e)),i.reduce((l,s)=>Object.assign(l,{[s.name]:s}),{})}function o(){t=t.filter(a=>a.destroy())}return{init:n,destroy:o}}function Qu(e,t,n){const o=e.ownerDocument,r=o.defaultView,a=m9(r),i=h9(a),l=as(),s=f9(),{mergeOptions:c,optionsAtMedia:f,optionsMediaQueries:u}=a,{on:d,off:m,emit:v}=s,g=z;let x=!1,h,w=c(p9,Qu.globalOptions),y=c(w),S=[],E,N,C;function A(){const{container:te,slides:K}=y;N=(uh(te)?e.querySelector(te):te)||e.children[0];const Q=uh(K)?N.querySelectorAll(K):K;C=[].slice.call(Q||N.children)}function T(te){const K=d9(e,N,C,o,r,te,s);if(te.loop&&!K.slideLooper.canLoop()){const W=Object.assign({},te,{loop:!1});return T(W)}return K}function k(te,K){x||(w=c(w,te),y=f(w),S=K||S,A(),h=T(y),u([w,...S.map(({options:W})=>W)]).forEach(W=>l.add(W,"change",z)),y.active&&(h.translate.to(h.location.get()),h.animation.init(),h.slidesInView.init(),h.slideFocus.init(ee),h.eventHandler.init(ee),h.resizeHandler.init(ee),h.slidesHandler.init(ee),h.options.loop&&h.slideLooper.loop(),N.offsetParent&&C.length&&h.dragHandler.init(ee),E=i.init(ee,S)))}function z(te,K){const W=F();O(),k(c({startIndex:W},te),K),s.emit("reInit")}function O(){h.dragHandler.destroy(),h.eventStore.clear(),h.translate.clear(),h.slideLooper.clear(),h.resizeHandler.destroy(),h.slidesHandler.destroy(),h.slidesInView.destroy(),h.animation.destroy(),i.destroy(),l.clear()}function P(){x||(x=!0,l.clear(),O(),s.emit("destroy"),s.clear())}function _(te,K,W){!y.active||x||(h.scrollBody.useBaseFriction().useDuration(K===!0?0:y.duration),h.scrollTo.index(te,W||0))}function L(te){const K=h.index.add(1).get();_(K,te,-1)}function R(te){const K=h.index.add(-1).get();_(K,te,1)}function I(){return h.index.add(1).get()!==F()}function D(){return h.index.add(-1).get()!==F()}function M(){return h.scrollSnapList}function U(){return h.scrollProgress.get(h.offsetLocation.get())}function F(){return h.index.get()}function $(){return h.indexPrevious.get()}function H(){return h.slidesInView.get()}function V(){return h.slidesInView.get(!1)}function Y(){return E}function q(){return h}function B(){return e}function G(){return N}function Z(){return C}const ee={canScrollNext:I,canScrollPrev:D,containerNode:G,internalEngine:q,destroy:P,off:m,on:d,emit:v,plugins:Y,previousScrollSnap:$,reInit:g,rootNode:B,scrollNext:L,scrollPrev:R,scrollProgress:U,scrollSnapList:M,scrollTo:_,selectedScrollSnap:F,slideNodes:Z,slidesInView:H,slidesNotInView:V};return k(t,n),setTimeout(()=>s.emit("init"),0),ee}Qu.globalOptions=void 0;function Tv(e={},t=[]){const n=p.useRef(e),o=p.useRef(t),[r,a]=p.useState(),[i,l]=p.useState(),s=p.useCallback(()=>{r&&r.reInit(n.current,o.current)},[r]);return p.useEffect(()=>{Cv(n.current,e)||(n.current=e,s())},[e,s]),p.useEffect(()=>{$V(o.current,t)||(o.current=t,s())},[t,s]),p.useEffect(()=>{if(kV()&&i){Qu.globalOptions=Tv.globalOptions;const c=Qu(i,n.current,o.current);return a(c),()=>c.destroy()}else a(void 0)},[i,a]),[l,r]}Tv.globalOptions=void 0;const tR=p.createContext(null);function sf(){const e=p.useContext(tR);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const g9=p.forwardRef(({orientation:e="horizontal",opts:t,setApi:n,plugins:o,className:r,children:a,...i},l)=>{const[s,c]=Tv({...t,axis:e==="horizontal"?"x":"y"},o),[f,u]=p.useState(!1),[d,m]=p.useState(!1),v=p.useCallback(w=>{w&&(u(w.canScrollPrev()),m(w.canScrollNext()))},[]),g=p.useCallback(()=>{c==null||c.scrollPrev()},[c]),x=p.useCallback(()=>{c==null||c.scrollNext()},[c]),h=p.useCallback(w=>{w.key==="ArrowLeft"?(w.preventDefault(),g()):w.key==="ArrowRight"&&(w.preventDefault(),x())},[g,x]);return p.useEffect(()=>{!c||!n||n(c)},[c,n]),p.useEffect(()=>{if(c)return v(c),c.on("reInit",v),c.on("select",v),()=>{c==null||c.off("select",v)}},[c,v]),b(tR.Provider,{value:{carouselRef:s,api:c,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:g,scrollNext:x,canScrollPrev:f,canScrollNext:d},children:b("div",{ref:l,onKeyDownCapture:h,className:X("relative",r),role:"region","aria-roledescription":"carousel",...i,children:a})})});g9.displayName="Carousel";const v9=p.forwardRef(({className:e,...t},n)=>{const{carouselRef:o,orientation:r}=sf();return b("div",{ref:o,className:"overflow-hidden",children:b("div",{ref:n,className:X("flex",r==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});v9.displayName="CarouselContent";const y9=p.forwardRef(({className:e,...t},n)=>{const{orientation:o}=sf();return b("div",{ref:n,role:"group","aria-roledescription":"slide",className:X("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",e),...t})});y9.displayName="CarouselItem";const b9=p.forwardRef(({className:e,variant:t="outline",size:n="icon",...o},r)=>{const{orientation:a,scrollPrev:i,canScrollPrev:l}=sf();return re(Sv,{ref:r,variant:t,size:n,className:X("absolute h-8 w-8 rounded-full",a==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:i,...o,children:[b(D6,{className:"h-4 w-4"}),b("span",{className:"sr-only",children:"Previous slide"})]})});b9.displayName="CarouselPrevious";const w9=p.forwardRef(({className:e,variant:t="outline",size:n="icon",...o},r)=>{const{orientation:a,scrollNext:i,canScrollNext:l}=sf();return re(Sv,{ref:r,variant:t,size:n,className:X("absolute h-8 w-8 rounded-full",a==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:i,...o,children:[b(P6,{className:"h-4 w-4"}),b("span",{className:"sr-only",children:"Next slide"})]})});w9.displayName="CarouselNext";var x9=e=>typeof e=="number"&&e!=+e,Wu=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Xw=e=>(typeof e=="number"||e instanceof Number)&&!x9(e);function S9(){}function Ju(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}var nR={},oR={},rR={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,o,{signal:r,edges:a}={}){let i,l=null;const s=a!=null&&a.includes("leading"),c=a==null||a.includes("trailing"),f=()=>{l!==null&&(n.apply(i,l),i=void 0,l=null)},u=()=>{c&&f(),g()};let d=null;const m=()=>{d!=null&&clearTimeout(d),d=setTimeout(()=>{d=null,u()},o)},v=()=>{d!==null&&(clearTimeout(d),d=null)},g=()=>{v(),i=void 0,l=null},x=()=>{f()},h=function(...w){if(r!=null&&r.aborted)return;i=this,l=w;const y=d==null;m(),s&&y&&f()};return h.schedule=m,h.cancel=g,h.flush=x,r==null||r.addEventListener("abort",g,{once:!0}),h}e.debounce=t})(rR);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rR;function n(o,r=0,a={}){typeof a!="object"&&(a={});const{leading:i=!1,trailing:l=!0,maxWait:s}=a,c=Array(2);i&&(c[0]="leading"),l&&(c[1]="trailing");let f,u=null;const d=t.debounce(function(...g){f=o.apply(this,g),u=null},r,{edges:c}),m=function(...g){return s!=null&&(u===null&&(u=Date.now()),Date.now()-u>=s)?(f=o.apply(this,g),u=Date.now(),d.cancel(),d.schedule(),f):(d.apply(this,g),f)},v=()=>(d.flush(),f);return m.cancel=d.cancel,m.flush=v,m}e.debounce=n})(oR);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oR;function n(o,r=0,a={}){const{leading:i=!0,trailing:l=!0}=a;return t.debounce(o,r,{leading:i,maxWait:r,trailing:l})}e.throttle=n})(nR);var E9=nR.throttle;const C9=gd(E9);var Kw=function(t,n){for(var o=arguments.length,r=new Array(o>2?o-2:0),a=2;a<o;a++)r[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;console.warn(n.replace(/%s/g,()=>r[i++]))}},zn={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},aR=(e,t,n)=>{var{width:o=zn.width,height:r=zn.height,aspect:a,maxHeight:i}=n,l=Wu(o)?e:Number(o),s=Wu(r)?t:Number(r);return a&&a>0&&(l?s=l/a:s&&(l=s*a),i&&s!=null&&s>i&&(s=i)),{calculatedWidth:l,calculatedHeight:s}},N9={width:0,height:0,overflow:"visible"},_9={width:0,overflowX:"visible"},R9={height:0,overflowY:"visible"},T9={},A9=e=>{var{width:t,height:n}=e,o=Wu(t),r=Wu(n);return o&&r?N9:o?_9:r?R9:T9};function M9(e){var{width:t,height:n,aspect:o}=e,r=t,a=n;return r===void 0&&a===void 0?(r=zn.width,a=zn.height):r===void 0?r=o&&o>0?void 0:zn.width:a===void 0&&(a=o&&o>0?void 0:zn.height),{width:r,height:a}}function fh(){return fh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},fh.apply(null,arguments)}function jw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function qw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jw(Object(n),!0).forEach(function(o){D9(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jw(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function D9(e,t,n){return(t=O9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O9(e){var t=P9(e,"string");return typeof t=="symbol"?t:t+""}function P9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iR=p.createContext(zn.initialDimension);function z9(e){return Ju(e.width)&&Ju(e.height)}function lR(e){var{children:t,width:n,height:o}=e,r=p.useMemo(()=>({width:n,height:o}),[n,o]);return z9(r)?p.createElement(iR.Provider,{value:r},t):null}var I9=()=>p.useContext(iR),L9=p.forwardRef((e,t)=>{var{aspect:n,initialDimension:o=zn.initialDimension,width:r,height:a,minWidth:i=zn.minWidth,minHeight:l,maxHeight:s,children:c,debounce:f=zn.debounce,id:u,className:d,onResize:m,style:v={}}=e,g=p.useRef(null),x=p.useRef();x.current=m,p.useImperativeHandle(t,()=>g.current);var[h,w]=p.useState({containerWidth:o.width,containerHeight:o.height}),y=p.useCallback((A,T)=>{w(k=>{var z=Math.round(A),O=Math.round(T);return k.containerWidth===z&&k.containerHeight===O?k:{containerWidth:z,containerHeight:O}})},[]);p.useEffect(()=>{if(g.current==null||typeof ResizeObserver>"u")return S9;var A=O=>{var P,_=O[0];if(_!=null){var{width:L,height:R}=_.contentRect;y(L,R),(P=x.current)===null||P===void 0||P.call(x,L,R)}};f>0&&(A=C9(A,f,{trailing:!0,leading:!1}));var T=new ResizeObserver(A),{width:k,height:z}=g.current.getBoundingClientRect();return y(k,z),T.observe(g.current),()=>{T.disconnect()}},[y,f]);var{containerWidth:S,containerHeight:E}=h;Kw(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:N,calculatedHeight:C}=aR(S,E,{width:r,height:a,aspect:n,maxHeight:s});return Kw(N!=null&&N>0||C!=null&&C>0,`The width(%s) and height(%s) of chart should be greater than 0,
192
- please check the style of container, or the props width(%s) and height(%s),
193
- or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
194
- height and width.`,N,C,r,a,i,l,n),p.createElement("div",{id:u?"".concat(u):void 0,className:hv("recharts-responsive-container",d),style:qw(qw({},v),{},{width:r,height:a,minWidth:i,minHeight:l,maxHeight:s}),ref:g},p.createElement("div",{style:A9({width:r,height:a})},p.createElement(lR,{width:N,height:C},c)))}),k9=p.forwardRef((e,t)=>{var n=I9();if(Ju(n.width)&&Ju(n.height))return e.children;var{width:o,height:r}=M9({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:i}=aR(void 0,void 0,{width:o,height:r,aspect:e.aspect,maxHeight:e.maxHeight});return Xw(a)&&Xw(i)?p.createElement(lR,{width:a,height:i},e.children):p.createElement(L9,fh({},e,{width:o,height:r,ref:t}))});const $9={light:"",dark:".dark"},sR=p.createContext(null);function cR(){const e=p.useContext(sR);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const H9=p.forwardRef(({id:e,className:t,children:n,config:o,...r},a)=>{const i=p.useId(),l=`chart-${e||i.replace(/:/g,"")}`;return b(sR.Provider,{value:{config:o},children:re("div",{"data-chart":l,ref:a,className:X("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...r,children:[b(B9,{id:l,config:o}),b(k9,{children:n})]})})});H9.displayName="Chart";const B9=({id:e,config:t})=>{const n=Object.entries(t).filter(([,o])=>o.theme||o.color);return n.length?b("style",{dangerouslySetInnerHTML:{__html:Object.entries($9).map(([o,r])=>`
195
- ${r} [data-chart=${e}] {
196
- ${n.map(([a,i])=>{var s;const l=((s=i.theme)==null?void 0:s[o])||i.color;return l?` --color-${a}: ${l};`:null}).join(`
197
- `)}
198
- }
199
- `).join(`
200
- `)}}):null},U9=p.forwardRef(({active:e,payload:t,className:n,indicator:o="dot",hideLabel:r=!1,hideIndicator:a=!1,label:i,labelFormatter:l,labelClassName:s,formatter:c,color:f,nameKey:u,labelKey:d},m)=>{const{config:v}=cR(),g=p.useMemo(()=>{var E;if(r||!(t!=null&&t.length))return null;const[h]=t,w=`${d||(h==null?void 0:h.dataKey)||(h==null?void 0:h.name)||"value"}`,y=ph(v,h,w),S=!d&&typeof i=="string"?((E=v[i])==null?void 0:E.label)||i:y==null?void 0:y.label;return l?b("div",{className:X("font-medium",s),children:l(S,t)}):S?b("div",{className:X("font-medium",s),children:S}):null},[i,l,t,r,s,v,d]);if(!e||!(t!=null&&t.length))return null;const x=t.length===1&&o!=="dot";return re("div",{ref:m,className:X("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[x?null:g,b("div",{className:"grid gap-1.5",children:t.filter(h=>h.type!=="none").map((h,w)=>{var N;const y=`${u||h.name||h.dataKey||"value"}`,S=ph(v,h,y),E=f||((N=h.payload)==null?void 0:N.fill)||h.color;return b("div",{className:X("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",o==="dot"&&"items-center"),children:c&&(h==null?void 0:h.value)!==void 0&&h.name?c(h.value,h.name,h,w,h.payload):re(De,{children:[S!=null&&S.icon?b(S.icon,{}):!a&&b("div",{className:X("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":o==="dot","w-1":o==="line","w-0 border-[1.5px] border-dashed bg-transparent":o==="dashed","my-0.5":x&&o==="dashed"}),style:{"--color-bg":E,"--color-border":E}}),re("div",{className:X("flex flex-1 justify-between leading-none",x?"items-end":"items-center"),children:[re("div",{className:"grid gap-1.5",children:[x?g:null,b("span",{className:"text-muted-foreground",children:(S==null?void 0:S.label)||h.name})]}),h.value!==void 0&&b("span",{className:"font-mono font-medium tabular-nums text-foreground",children:typeof h.value=="number"?h.value.toLocaleString():h.value})]})]})},String(h.dataKey??h.name??w))})})]})});U9.displayName="ChartTooltip";const V9=p.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:o="bottom",nameKey:r},a)=>{const{config:i}=cR();return n!=null&&n.length?b("div",{ref:a,className:X("flex items-center justify-center gap-4",o==="top"?"pb-3":"pt-3",e),children:n.filter(l=>l.type!=="none").map(l=>{const s=`${r||l.dataKey||"value"}`,c=ph(i,l,s);return re("div",{className:X("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[c!=null&&c.icon&&!t?b(c.icon,{}):b("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:l.color}}),c==null?void 0:c.label]},String(l.value??l.dataKey??l.color??s))})}):null});V9.displayName="ChartLegend";function ph(e,t,n){if(typeof t!="object"||t===null)return;const o="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let r=n;return n in t&&typeof t[n]=="string"?r=t[n]:o&&n in o&&typeof o[n]=="string"&&(r=o[n]),r in e?e[r]:e[n]}function Ii(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function zs(e){const[t,n]=p.useState(void 0);return He(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const a=r[0];let i,l;if("borderBoxSize"in a){const s=a.borderBoxSize,c=Array.isArray(s)?s[0]:s;i=c.inlineSize,l=c.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var cf="Checkbox",[G9,AQ]=Ue(cf),[Y9,Av]=G9(cf);function F9(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:a,form:i,name:l,onCheckedChange:s,required:c,value:f="on",internal_do_not_use_render:u}=e,[d,m]=ht({prop:n,defaultProp:r??!1,onChange:s,caller:cf}),[v,g]=p.useState(null),[x,h]=p.useState(null),w=p.useRef(!1),y=v?!!i||!!v.closest("form"):!0,S={checked:d,disabled:a,setChecked:m,control:v,setControl:g,name:l,form:i,value:f,hasConsumerStoppedPropagationRef:w,required:c,defaultChecked:tr(r)?!1:r,isFormControl:y,bubbleInput:x,setBubbleInput:h};return b(Y9,{scope:t,...S,children:X9(u)?u(S):o})}var uR="CheckboxTrigger",dR=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},r)=>{const{control:a,value:i,disabled:l,checked:s,required:c,setControl:f,setChecked:u,hasConsumerStoppedPropagationRef:d,isFormControl:m,bubbleInput:v}=Av(uR,e),g=le(r,f),x=p.useRef(s);return p.useEffect(()=>{const h=a==null?void 0:a.form;if(h){const w=()=>u(x.current);return h.addEventListener("reset",w),()=>h.removeEventListener("reset",w)}},[a,u]),b(oe.button,{type:"button",role:"checkbox","aria-checked":tr(s)?"mixed":s,"aria-required":c,"data-state":gR(s),"data-disabled":l?"":void 0,disabled:l,value:i,...o,ref:g,onKeyDown:j(t,h=>{h.key==="Enter"&&h.preventDefault()}),onClick:j(n,h=>{u(w=>tr(w)?!0:!w),v&&m&&(d.current=h.isPropagationStopped(),d.current||h.stopPropagation())})})});dR.displayName=uR;var Mv=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:a,required:i,disabled:l,value:s,onCheckedChange:c,form:f,...u}=e;return b(F9,{__scopeCheckbox:n,checked:r,defaultChecked:a,disabled:l,required:i,onCheckedChange:c,name:o,form:f,value:s,internal_do_not_use_render:({isFormControl:d})=>re(De,{children:[b(dR,{...u,ref:t,__scopeCheckbox:n}),d&&b(hR,{__scopeCheckbox:n})]})})});Mv.displayName=cf;var fR="CheckboxIndicator",pR=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,a=Av(fR,n);return b(Pe,{present:o||tr(a.checked)||a.checked===!0,children:b(oe.span,{"data-state":gR(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});pR.displayName=fR;var mR="CheckboxBubbleInput",hR=p.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:a,defaultChecked:i,required:l,disabled:s,name:c,value:f,form:u,bubbleInput:d,setBubbleInput:m}=Av(mR,e),v=le(n,m),g=Ii(a),x=zs(o);p.useEffect(()=>{const w=d;if(!w)return;const y=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(y,"checked").set,N=!r.current;if(g!==a&&E){const C=new Event("click",{bubbles:N});w.indeterminate=tr(a),E.call(w,tr(a)?!1:a),w.dispatchEvent(C)}},[d,g,a,r]);const h=p.useRef(tr(a)?!1:a);return b(oe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??h.current,required:l,disabled:s,name:c,value:f,form:u,...t,tabIndex:-1,ref:v,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});hR.displayName=mR;function X9(e){return typeof e=="function"}function tr(e){return e==="indeterminate"}function gR(e){return tr(e)?"indeterminate":e?"checked":"unchecked"}const K9=p.forwardRef(({className:e,...t},n)=>b(Mv,{ref:n,className:X("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:b(pR,{className:X("grid place-content-center text-current"),children:b(As,{className:"h-4 w-4"})})}));K9.displayName=Mv.displayName;var Zw=1,j9=.9,q9=.8,Z9=.17,$p=.1,Hp=.999,Q9=.9999,W9=.99,J9=/[\\\/_+.#"@\[\(\{&]/,eG=/[\\\/_+.#"@\[\(\{&]/g,tG=/[\s-]/,vR=/[\s-]/g;function mh(e,t,n,o,r,a,i){if(a===t.length)return r===e.length?Zw:W9;var l=`${r},${a}`;if(i[l]!==void 0)return i[l];for(var s=o.charAt(a),c=n.indexOf(s,r),f=0,u,d,m,v;c>=0;)u=mh(e,t,n,o,c+1,a+1,i),u>f&&(c===r?u*=Zw:J9.test(e.charAt(c-1))?(u*=q9,m=e.slice(r,c-1).match(eG),m&&r>0&&(u*=Math.pow(Hp,m.length))):tG.test(e.charAt(c-1))?(u*=j9,v=e.slice(r,c-1).match(vR),v&&r>0&&(u*=Math.pow(Hp,v.length))):(u*=Z9,r>0&&(u*=Math.pow(Hp,c-r))),e.charAt(c)!==t.charAt(a)&&(u*=Q9)),(u<$p&&n.charAt(c-1)===o.charAt(a+1)||o.charAt(a+1)===o.charAt(a)&&n.charAt(c-1)!==o.charAt(a))&&(d=mh(e,t,n,o,c+1,a+2,i),d*$p>u&&(u=d*$p)),u>f&&(f=u),c=n.indexOf(s,c+1);return i[l]=f,f}function Qw(e){return e.toLowerCase().replace(vR," ")}function nG(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,mh(e,t,Qw(e),Qw(t),0,0,{})}var Ji='[cmdk-group=""]',Bp='[cmdk-group-items=""]',oG='[cmdk-group-heading=""]',yR='[cmdk-item=""]',Ww=`${yR}:not([aria-disabled="true"])`,hh="cmdk-item-select",Sa="data-value",rG=(e,t,n)=>nG(e,t,n),bR=p.createContext(void 0),Is=()=>p.useContext(bR),wR=p.createContext(void 0),Dv=()=>p.useContext(wR),xR=p.createContext(void 0),SR=p.forwardRef((e,t)=>{let n=Ea(()=>{var $,H;return{search:"",value:(H=($=e.value)!=null?$:e.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Ea(()=>new Set),r=Ea(()=>new Map),a=Ea(()=>new Map),i=Ea(()=>new Set),l=ER(e),{label:s,children:c,value:f,onValueChange:u,filter:d,shouldFilter:m,loop:v,disablePointerSelection:g=!1,vimBindings:x=!0,...h}=e,w=mt(),y=mt(),S=mt(),E=p.useRef(null),N=hG();qr(()=>{if(f!==void 0){let $=f.trim();n.current.value=$,C.emit()}},[f]),qr(()=>{N(6,P)},[]);let C=p.useMemo(()=>({subscribe:$=>(i.current.add($),()=>i.current.delete($)),snapshot:()=>n.current,setState:($,H,V)=>{var Y,q,B,G;if(!Object.is(n.current[$],H)){if(n.current[$]=H,$==="search")O(),k(),N(1,z);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Z=document.getElementById(S);Z?Z.focus():(Y=document.getElementById(w))==null||Y.focus()}if(N(7,()=>{var Z;n.current.selectedItemId=(Z=_())==null?void 0:Z.id,C.emit()}),V||N(5,P),((q=l.current)==null?void 0:q.value)!==void 0){let Z=H??"";(G=(B=l.current).onValueChange)==null||G.call(B,Z);return}}C.emit()}},emit:()=>{i.current.forEach($=>$())}}),[]),A=p.useMemo(()=>({value:($,H,V)=>{var Y;H!==((Y=a.current.get($))==null?void 0:Y.value)&&(a.current.set($,{value:H,keywords:V}),n.current.filtered.items.set($,T(H,V)),N(2,()=>{k(),C.emit()}))},item:($,H)=>(o.current.add($),H&&(r.current.has(H)?r.current.get(H).add($):r.current.set(H,new Set([$]))),N(3,()=>{O(),k(),n.current.value||z(),C.emit()}),()=>{a.current.delete($),o.current.delete($),n.current.filtered.items.delete($);let V=_();N(4,()=>{O(),(V==null?void 0:V.getAttribute("id"))===$&&z(),C.emit()})}),group:$=>(r.current.has($)||r.current.set($,new Set),()=>{a.current.delete($),r.current.delete($)}),filter:()=>l.current.shouldFilter,label:s||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:w,inputId:S,labelId:y,listInnerRef:E}),[]);function T($,H){var V,Y;let q=(Y=(V=l.current)==null?void 0:V.filter)!=null?Y:rG;return $?q($,n.current.search,H):0}function k(){if(!n.current.search||l.current.shouldFilter===!1)return;let $=n.current.filtered.items,H=[];n.current.filtered.groups.forEach(Y=>{let q=r.current.get(Y),B=0;q.forEach(G=>{let Z=$.get(G);B=Math.max(Z,B)}),H.push([Y,B])});let V=E.current;L().sort((Y,q)=>{var B,G;let Z=Y.getAttribute("id"),ee=q.getAttribute("id");return((B=$.get(ee))!=null?B:0)-((G=$.get(Z))!=null?G:0)}).forEach(Y=>{let q=Y.closest(Bp);q?q.appendChild(Y.parentElement===q?Y:Y.closest(`${Bp} > *`)):V.appendChild(Y.parentElement===V?Y:Y.closest(`${Bp} > *`))}),H.sort((Y,q)=>q[1]-Y[1]).forEach(Y=>{var q;let B=(q=E.current)==null?void 0:q.querySelector(`${Ji}[${Sa}="${encodeURIComponent(Y[0])}"]`);B==null||B.parentElement.appendChild(B)})}function z(){let $=L().find(V=>V.getAttribute("aria-disabled")!=="true"),H=$==null?void 0:$.getAttribute(Sa);C.setState("value",H||void 0)}function O(){var $,H,V,Y;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=o.current.size;return}n.current.filtered.groups=new Set;let q=0;for(let B of o.current){let G=(H=($=a.current.get(B))==null?void 0:$.value)!=null?H:"",Z=(Y=(V=a.current.get(B))==null?void 0:V.keywords)!=null?Y:[],ee=T(G,Z);n.current.filtered.items.set(B,ee),ee>0&&q++}for(let[B,G]of r.current)for(let Z of G)if(n.current.filtered.items.get(Z)>0){n.current.filtered.groups.add(B);break}n.current.filtered.count=q}function P(){var $,H,V;let Y=_();Y&&((($=Y.parentElement)==null?void 0:$.firstChild)===Y&&((V=(H=Y.closest(Ji))==null?void 0:H.querySelector(oG))==null||V.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function _(){var $;return($=E.current)==null?void 0:$.querySelector(`${yR}[aria-selected="true"]`)}function L(){var $;return Array.from((($=E.current)==null?void 0:$.querySelectorAll(Ww))||[])}function R($){let H=L()[$];H&&C.setState("value",H.getAttribute(Sa))}function I($){var H;let V=_(),Y=L(),q=Y.findIndex(G=>G===V),B=Y[q+$];(H=l.current)!=null&&H.loop&&(B=q+$<0?Y[Y.length-1]:q+$===Y.length?Y[0]:Y[q+$]),B&&C.setState("value",B.getAttribute(Sa))}function D($){let H=_(),V=H==null?void 0:H.closest(Ji),Y;for(;V&&!Y;)V=$>0?pG(V,Ji):mG(V,Ji),Y=V==null?void 0:V.querySelector(Ww);Y?C.setState("value",Y.getAttribute(Sa)):I($)}let M=()=>R(L().length-1),U=$=>{$.preventDefault(),$.metaKey?M():$.altKey?D(1):I(1)},F=$=>{$.preventDefault(),$.metaKey?R(0):$.altKey?D(-1):I(-1)};return p.createElement(St.div,{ref:t,tabIndex:-1,...h,"cmdk-root":"",onKeyDown:$=>{var H;(H=h.onKeyDown)==null||H.call(h,$);let V=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||V))switch($.key){case"n":case"j":{x&&$.ctrlKey&&U($);break}case"ArrowDown":{U($);break}case"p":case"k":{x&&$.ctrlKey&&F($);break}case"ArrowUp":{F($);break}case"Home":{$.preventDefault(),R(0);break}case"End":{$.preventDefault(),M();break}case"Enter":{$.preventDefault();let Y=_();if(Y){let q=new Event(hh);Y.dispatchEvent(q)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:vG},s),uf(e,$=>p.createElement(wR.Provider,{value:C},p.createElement(bR.Provider,{value:A},$))))}),aG=p.forwardRef((e,t)=>{var n,o;let r=mt(),a=p.useRef(null),i=p.useContext(xR),l=Is(),s=ER(e),c=(o=(n=s.current)==null?void 0:n.forceMount)!=null?o:i==null?void 0:i.forceMount;qr(()=>{if(!c)return l.item(r,i==null?void 0:i.id)},[c]);let f=CR(r,a,[e.value,e.children,a],e.keywords),u=Dv(),d=ir(N=>N.value&&N.value===f.current),m=ir(N=>c||l.filter()===!1?!0:N.search?N.filtered.items.get(r)>0:!0);p.useEffect(()=>{let N=a.current;if(!(!N||e.disabled))return N.addEventListener(hh,v),()=>N.removeEventListener(hh,v)},[m,e.onSelect,e.disabled]);function v(){var N,C;g(),(C=(N=s.current).onSelect)==null||C.call(N,f.current)}function g(){u.setState("value",f.current,!0)}if(!m)return null;let{disabled:x,value:h,onSelect:w,forceMount:y,keywords:S,...E}=e;return p.createElement(St.div,{ref:Sn(a,t),...E,id:r,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!d,"data-disabled":!!x,"data-selected":!!d,onPointerMove:x||l.getDisablePointerSelection()?void 0:g,onClick:x?void 0:v},e.children)}),iG=p.forwardRef((e,t)=>{let{heading:n,children:o,forceMount:r,...a}=e,i=mt(),l=p.useRef(null),s=p.useRef(null),c=mt(),f=Is(),u=ir(m=>r||f.filter()===!1?!0:m.search?m.filtered.groups.has(i):!0);qr(()=>f.group(i),[]),CR(i,l,[e.value,e.heading,s]);let d=p.useMemo(()=>({id:i,forceMount:r}),[r]);return p.createElement(St.div,{ref:Sn(l,t),...a,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&p.createElement("div",{ref:s,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),uf(e,m=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},p.createElement(xR.Provider,{value:d},m))))}),lG=p.forwardRef((e,t)=>{let{alwaysRender:n,...o}=e,r=p.useRef(null),a=ir(i=>!i.search);return!n&&!a?null:p.createElement(St.div,{ref:Sn(r,t),...o,"cmdk-separator":"",role:"separator"})}),sG=p.forwardRef((e,t)=>{let{onValueChange:n,...o}=e,r=e.value!=null,a=Dv(),i=ir(c=>c.search),l=ir(c=>c.selectedItemId),s=Is();return p.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),p.createElement(St.input,{ref:t,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":s.listId,"aria-labelledby":s.labelId,"aria-activedescendant":l,id:s.inputId,type:"text",value:r?e.value:i,onChange:c=>{r||a.setState("search",c.target.value),n==null||n(c.target.value)}})}),cG=p.forwardRef((e,t)=>{let{children:n,label:o="Suggestions",...r}=e,a=p.useRef(null),i=p.useRef(null),l=ir(c=>c.selectedItemId),s=Is();return p.useEffect(()=>{if(i.current&&a.current){let c=i.current,f=a.current,u,d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let m=c.offsetHeight;f.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return d.observe(c),()=>{cancelAnimationFrame(u),d.unobserve(c)}}},[]),p.createElement(St.div,{ref:Sn(a,t),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":o,id:s.listId},uf(e,c=>p.createElement("div",{ref:Sn(i,s.listInnerRef),"cmdk-list-sizer":""},c)))}),uG=p.forwardRef((e,t)=>{let{open:n,onOpenChange:o,overlayClassName:r,contentClassName:a,container:i,...l}=e;return p.createElement(VU,{open:n,onOpenChange:o},p.createElement(Os,{container:i},p.createElement(la,{"cmdk-overlay":"",className:r}),p.createElement(sa,{"aria-label":e.label,"cmdk-dialog":"",className:a},p.createElement(SR,{ref:t,...l}))))}),dG=p.forwardRef((e,t)=>ir(n=>n.filtered.count===0)?p.createElement(St.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),fG=p.forwardRef((e,t)=>{let{progress:n,children:o,label:r="Loading...",...a}=e;return p.createElement(St.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},uf(e,i=>p.createElement("div",{"aria-hidden":!0},i)))}),Ot=Object.assign(SR,{List:cG,Item:aG,Input:sG,Group:iG,Separator:lG,Dialog:uG,Empty:dG,Loading:fG});function pG(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function mG(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ER(e){let t=p.useRef(e);return qr(()=>{t.current=e}),t}var qr=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Ea(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function ir(e){let t=Dv(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function CR(e,t,n,o=[]){let r=p.useRef(),a=Is();return qr(()=>{var i;let l=(()=>{var c;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(c=f.current.textContent)==null?void 0:c.trim():r.current}})(),s=o.map(c=>c.trim());a.value(e,l,s),(i=t.current)==null||i.setAttribute(Sa,l),r.current=l}),r}var hG=()=>{let[e,t]=p.useState(),n=Ea(()=>new Map);return qr(()=>{n.current.forEach(o=>o()),n.current=new Map},[e]),(o,r)=>{n.current.set(o,r),t({})}};function gG(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function uf({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(gG(t),{ref:t.ref},n(t.props.children)):n(t)}var vG={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const yG=Os,NR=p.forwardRef(({className:e,...t},n)=>b(la,{ref:n,className:X("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));NR.displayName=la.displayName;const bG=p.forwardRef(({className:e,children:t,overlayClassName:n,...o},r)=>re(yG,{children:[b(NR,{className:n}),re(sa,{ref:r,className:X("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,re(af,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[b(mv,{className:"h-4 w-4"}),b("span",{className:"sr-only",children:"Close"})]})]})]}));bG.displayName=sa.displayName;const wG=p.forwardRef(({className:e,...t},n)=>b(Pi,{ref:n,className:X("text-lg font-semibold leading-none tracking-tight",e),...t}));wG.displayName=Pi.displayName;const xG=p.forwardRef(({className:e,...t},n)=>b(zi,{ref:n,className:X("text-sm text-muted-foreground",e),...t}));xG.displayName=zi.displayName;const SG=p.forwardRef(({className:e,...t},n)=>b(Ot,{ref:n,className:X("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));SG.displayName=Ot.displayName;const EG=p.forwardRef(({className:e,...t},n)=>re("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[b(G6,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),b(Ot.Input,{ref:n,className:X("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));EG.displayName=Ot.Input.displayName;const CG=p.forwardRef(({className:e,...t},n)=>b(Ot.List,{ref:n,className:X("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));CG.displayName=Ot.List.displayName;const NG=p.forwardRef((e,t)=>b(Ot.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));NG.displayName=Ot.Empty.displayName;const _G=p.forwardRef(({className:e,...t},n)=>b(Ot.Group,{ref:n,className:X("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));_G.displayName=Ot.Group.displayName;const RG=p.forwardRef(({className:e,...t},n)=>b(Ot.Separator,{ref:n,className:X("-mx-1 h-px bg-border",e),...t}));RG.displayName=Ot.Separator.displayName;const TG=p.forwardRef(({className:e,...t},n)=>b(Ot.Item,{ref:n,className:X("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));TG.displayName=Ot.Item.displayName;const AG=["top","right","bottom","left"],lr=Math.min,Ht=Math.max,ed=Math.round,Dc=Math.floor,$n=e=>({x:e,y:e}),MG={left:"right",right:"left",bottom:"top",top:"bottom"};function gh(e,t,n){return Ht(e,lr(t,n))}function yo(e,t){return typeof e=="function"?e(t):e}function bo(e){return e.split("-")[0]}function Li(e){return e.split("-")[1]}function Ov(e){return e==="x"?"y":"x"}function Pv(e){return e==="y"?"height":"width"}function In(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function zv(e){return Ov(In(e))}function DG(e,t,n){n===void 0&&(n=!1);const o=Li(e),r=zv(e),a=Pv(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=td(i)),[i,td(i)]}function OG(e){const t=td(e);return[vh(e),t,vh(t)]}function vh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Jw=["left","right"],ex=["right","left"],PG=["top","bottom"],zG=["bottom","top"];function IG(e,t,n){switch(e){case"top":case"bottom":return n?t?ex:Jw:t?Jw:ex;case"left":case"right":return t?PG:zG;default:return[]}}function LG(e,t,n,o){const r=Li(e);let a=IG(bo(e),n==="start",o);return r&&(a=a.map(i=>i+"-"+r),t&&(a=a.concat(a.map(vh)))),a}function td(e){const t=bo(e);return MG[t]+e.slice(t.length)}function kG(e){return{top:0,right:0,bottom:0,left:0,...e}}function _R(e){return typeof e!="number"?kG(e):{top:e,right:e,bottom:e,left:e}}function nd(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function tx(e,t,n){let{reference:o,floating:r}=e;const a=In(t),i=zv(t),l=Pv(i),s=bo(t),c=a==="y",f=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,d=o[l]/2-r[l]/2;let m;switch(s){case"top":m={x:f,y:o.y-r.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:u};break;case"left":m={x:o.x-r.width,y:u};break;default:m={x:o.x,y:o.y}}switch(Li(t)){case"start":m[i]-=d*(n&&c?-1:1);break;case"end":m[i]+=d*(n&&c?-1:1);break}return m}async function $G(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:a,rects:i,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:m=0}=yo(t,e),v=_R(m),x=l[d?u==="floating"?"reference":"floating":u],h=nd(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(x)))==null||n?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:s})),w=u==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,y=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),S=await(a.isElement==null?void 0:a.isElement(y))?await(a.getScale==null?void 0:a.getScale(y))||{x:1,y:1}:{x:1,y:1},E=nd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:y,strategy:s}):w);return{top:(h.top-E.top+v.top)/S.y,bottom:(E.bottom-h.bottom+v.bottom)/S.y,left:(h.left-E.left+v.left)/S.x,right:(E.right-h.right+v.right)/S.x}}const HG=50,BG=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:$G},s=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:u}=tx(c,o,s),d=o,m=0;const v={};for(let g=0;g<a.length;g++){const x=a[g];if(!x)continue;const{name:h,fn:w}=x,{x:y,y:S,data:E,reset:N}=await w({x:f,y:u,initialPlacement:o,placement:d,strategy:r,middlewareData:v,rects:c,platform:l,elements:{reference:e,floating:t}});f=y??f,u=S??u,v[h]={...v[h],...E},N&&m<HG&&(m++,typeof N=="object"&&(N.placement&&(d=N.placement),N.rects&&(c=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):N.rects),{x:f,y:u}=tx(c,d,s)),g=-1)}return{x:f,y:u,placement:d,strategy:r,middlewareData:v}},UG=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:a,platform:i,elements:l,middlewareData:s}=t,{element:c,padding:f=0}=yo(e,t)||{};if(c==null)return{};const u=_R(f),d={x:n,y:o},m=zv(r),v=Pv(m),g=await i.getDimensions(c),x=m==="y",h=x?"top":"left",w=x?"bottom":"right",y=x?"clientHeight":"clientWidth",S=a.reference[v]+a.reference[m]-d[m]-a.floating[v],E=d[m]-a.reference[m],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let C=N?N[y]:0;(!C||!await(i.isElement==null?void 0:i.isElement(N)))&&(C=l.floating[y]||a.floating[v]);const A=S/2-E/2,T=C/2-g[v]/2-1,k=lr(u[h],T),z=lr(u[w],T),O=k,P=C-g[v]-z,_=C/2-g[v]/2+A,L=gh(O,_,P),R=!s.arrow&&Li(r)!=null&&_!==L&&a.reference[v]/2-(_<O?k:z)-g[v]/2<0,I=R?_<O?_-O:_-P:0;return{[m]:d[m]+I,data:{[m]:L,centerOffset:_-L-I,...R&&{alignmentOffset:I}},reset:R}}}),VG=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:a,rects:i,initialPlacement:l,platform:s,elements:c}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...x}=yo(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const h=bo(r),w=In(l),y=bo(l)===l,S=await(s.isRTL==null?void 0:s.isRTL(c.floating)),E=d||(y||!g?[td(l)]:OG(l)),N=v!=="none";!d&&N&&E.push(...LG(l,g,v,S));const C=[l,...E],A=await s.detectOverflow(t,x),T=[];let k=((o=a.flip)==null?void 0:o.overflows)||[];if(f&&T.push(A[h]),u){const _=DG(r,i,S);T.push(A[_[0]],A[_[1]])}if(k=[...k,{placement:r,overflows:T}],!T.every(_=>_<=0)){var z,O;const _=(((z=a.flip)==null?void 0:z.index)||0)+1,L=C[_];if(L&&(!(u==="alignment"?w!==In(L):!1)||k.every(D=>In(D.placement)===w?D.overflows[0]>0:!0)))return{data:{index:_,overflows:k},reset:{placement:L}};let R=(O=k.filter(I=>I.overflows[0]<=0).sort((I,D)=>I.overflows[1]-D.overflows[1])[0])==null?void 0:O.placement;if(!R)switch(m){case"bestFit":{var P;const I=(P=k.filter(D=>{if(N){const M=In(D.placement);return M===w||M==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(M=>M>0).reduce((M,U)=>M+U,0)]).sort((D,M)=>D[1]-M[1])[0])==null?void 0:P[0];I&&(R=I);break}case"initialPlacement":R=l;break}if(r!==R)return{reset:{placement:R}}}return{}}}};function nx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ox(e){return AG.some(t=>e[t]>=0)}const GG=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...a}=yo(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...a,elementContext:"reference"}),l=nx(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:ox(l)}}}case"escaped":{const i=await o.detectOverflow(t,{...a,altBoundary:!0}),l=nx(i,n.floating);return{data:{escapedOffsets:l,escaped:ox(l)}}}default:return{}}}}},RR=new Set(["left","top"]);async function YG(e,t){const{placement:n,platform:o,elements:r}=e,a=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=bo(n),l=Li(n),s=In(n)==="y",c=RR.has(i)?-1:1,f=a&&s?-1:1,u=yo(t,e);let{mainAxis:d,crossAxis:m,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof v=="number"&&(m=l==="end"?v*-1:v),s?{x:m*f,y:d*c}:{x:d*c,y:m*f}}const FG=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:a,placement:i,middlewareData:l}=t,s=await YG(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+s.x,y:a+s.y,data:{...s,placement:i}}}}},XG=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:a}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:h=>{let{x:w,y}=h;return{x:w,y}}},...c}=yo(e,t),f={x:n,y:o},u=await a.detectOverflow(t,c),d=In(bo(r)),m=Ov(d);let v=f[m],g=f[d];if(i){const h=m==="y"?"top":"left",w=m==="y"?"bottom":"right",y=v+u[h],S=v-u[w];v=gh(y,v,S)}if(l){const h=d==="y"?"top":"left",w=d==="y"?"bottom":"right",y=g+u[h],S=g-u[w];g=gh(y,g,S)}const x=s.fn({...t,[m]:v,[d]:g});return{...x,data:{x:x.x-n,y:x.y-o,enabled:{[m]:i,[d]:l}}}}}},KG=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:a,middlewareData:i}=t,{offset:l=0,mainAxis:s=!0,crossAxis:c=!0}=yo(e,t),f={x:n,y:o},u=In(r),d=Ov(u);let m=f[d],v=f[u];const g=yo(l,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(s){const y=d==="y"?"height":"width",S=a.reference[d]-a.floating[y]+x.mainAxis,E=a.reference[d]+a.reference[y]-x.mainAxis;m<S?m=S:m>E&&(m=E)}if(c){var h,w;const y=d==="y"?"width":"height",S=RR.has(bo(r)),E=a.reference[u]-a.floating[y]+(S&&((h=i.offset)==null?void 0:h[u])||0)+(S?0:x.crossAxis),N=a.reference[u]+a.reference[y]+(S?0:((w=i.offset)==null?void 0:w[u])||0)-(S?x.crossAxis:0);v<E?v=E:v>N&&(v=N)}return{[d]:m,[u]:v}}}},jG=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:a,platform:i,elements:l}=t,{apply:s=()=>{},...c}=yo(e,t),f=await i.detectOverflow(t,c),u=bo(r),d=Li(r),m=In(r)==="y",{width:v,height:g}=a.floating;let x,h;u==="top"||u==="bottom"?(x=u,h=d===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(h=u,x=d==="end"?"top":"bottom");const w=g-f.top-f.bottom,y=v-f.left-f.right,S=lr(g-f[x],w),E=lr(v-f[h],y),N=!t.middlewareData.shift;let C=S,A=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=y),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(C=w),N&&!d){const k=Ht(f.left,0),z=Ht(f.right,0),O=Ht(f.top,0),P=Ht(f.bottom,0);m?A=v-2*(k!==0||z!==0?k+z:Ht(f.left,f.right)):C=g-2*(O!==0||P!==0?O+P:Ht(f.top,f.bottom))}await s({...t,availableWidth:A,availableHeight:C});const T=await i.getDimensions(l.floating);return v!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}};function df(){return typeof window<"u"}function ki(e){return TR(e)?(e.nodeName||"").toLowerCase():"#document"}function jt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yn(e){var t;return(t=(TR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function TR(e){return df()?e instanceof Node||e instanceof jt(e).Node:!1}function En(e){return df()?e instanceof Element||e instanceof jt(e).Element:!1}function No(e){return df()?e instanceof HTMLElement||e instanceof jt(e).HTMLElement:!1}function rx(e){return!df()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jt(e).ShadowRoot}function Ls(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Cn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function qG(e){return/^(table|td|th)$/.test(ki(e))}function ff(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ZG=/transform|translate|scale|rotate|perspective|filter/,QG=/paint|layout|strict|content/,Sr=e=>!!e&&e!=="none";let Up;function Iv(e){const t=En(e)?Cn(e):e;return Sr(t.transform)||Sr(t.translate)||Sr(t.scale)||Sr(t.rotate)||Sr(t.perspective)||!Lv()&&(Sr(t.backdropFilter)||Sr(t.filter))||ZG.test(t.willChange||"")||QG.test(t.contain||"")}function WG(e){let t=sr(e);for(;No(t)&&!bi(t);){if(Iv(t))return t;if(ff(t))return null;t=sr(t)}return null}function Lv(){return Up==null&&(Up=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Up}function bi(e){return/^(html|body|#document)$/.test(ki(e))}function Cn(e){return jt(e).getComputedStyle(e)}function pf(e){return En(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sr(e){if(ki(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rx(e)&&e.host||Yn(e);return rx(t)?t.host:t}function AR(e){const t=sr(e);return bi(t)?e.ownerDocument?e.ownerDocument.body:e.body:No(t)&&Ls(t)?t:AR(t)}function is(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=AR(e),a=r===((o=e.ownerDocument)==null?void 0:o.body),i=jt(r);if(a){const l=yh(i);return t.concat(i,i.visualViewport||[],Ls(r)?r:[],l&&n?is(l):[])}else return t.concat(r,is(r,[],n))}function yh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function MR(e){const t=Cn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=No(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,l=ed(n)!==a||ed(o)!==i;return l&&(n=a,o=i),{width:n,height:o,$:l}}function kv(e){return En(e)?e:e.contextElement}function Wa(e){const t=kv(e);if(!No(t))return $n(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=MR(t);let i=(a?ed(n.width):n.width)/o,l=(a?ed(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const JG=$n(0);function DR(e){const t=jt(e);return!Lv()||!t.visualViewport?JG:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function e7(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jt(e)?!1:t}function Zr(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=kv(e);let i=$n(1);t&&(o?En(o)&&(i=Wa(o)):i=Wa(e));const l=e7(a,n,o)?DR(a):$n(0);let s=(r.left+l.x)/i.x,c=(r.top+l.y)/i.y,f=r.width/i.x,u=r.height/i.y;if(a){const d=jt(a),m=o&&En(o)?jt(o):o;let v=d,g=yh(v);for(;g&&o&&m!==v;){const x=Wa(g),h=g.getBoundingClientRect(),w=Cn(g),y=h.left+(g.clientLeft+parseFloat(w.paddingLeft))*x.x,S=h.top+(g.clientTop+parseFloat(w.paddingTop))*x.y;s*=x.x,c*=x.y,f*=x.x,u*=x.y,s+=y,c+=S,v=jt(g),g=yh(v)}}return nd({width:f,height:u,x:s,y:c})}function mf(e,t){const n=pf(e).scrollLeft;return t?t.left+n:Zr(Yn(e)).left+n}function OR(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-mf(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function t7(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a=r==="fixed",i=Yn(o),l=t?ff(t.floating):!1;if(o===i||l&&a)return n;let s={scrollLeft:0,scrollTop:0},c=$n(1);const f=$n(0),u=No(o);if((u||!u&&!a)&&((ki(o)!=="body"||Ls(i))&&(s=pf(o)),u)){const m=Zr(o);c=Wa(o),f.x=m.x+o.clientLeft,f.y=m.y+o.clientTop}const d=i&&!u&&!a?OR(i,s):$n(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-s.scrollTop*c.y+f.y+d.y}}function n7(e){return Array.from(e.getClientRects())}function o7(e){const t=Yn(e),n=pf(e),o=e.ownerDocument.body,r=Ht(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Ht(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+mf(e);const l=-n.scrollTop;return Cn(o).direction==="rtl"&&(i+=Ht(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:i,y:l}}const ax=25;function r7(e,t){const n=jt(e),o=Yn(e),r=n.visualViewport;let a=o.clientWidth,i=o.clientHeight,l=0,s=0;if(r){a=r.width,i=r.height;const f=Lv();(!f||f&&t==="fixed")&&(l=r.offsetLeft,s=r.offsetTop)}const c=mf(o);if(c<=0){const f=o.ownerDocument,u=f.body,d=getComputedStyle(u),m=f.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,v=Math.abs(o.clientWidth-u.clientWidth-m);v<=ax&&(a-=v)}else c<=ax&&(a+=c);return{width:a,height:i,x:l,y:s}}function a7(e,t){const n=Zr(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=No(e)?Wa(e):$n(1),i=e.clientWidth*a.x,l=e.clientHeight*a.y,s=r*a.x,c=o*a.y;return{width:i,height:l,x:s,y:c}}function ix(e,t,n){let o;if(t==="viewport")o=r7(e,n);else if(t==="document")o=o7(Yn(e));else if(En(t))o=a7(t,n);else{const r=DR(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return nd(o)}function PR(e,t){const n=sr(e);return n===t||!En(n)||bi(n)?!1:Cn(n).position==="fixed"||PR(n,t)}function i7(e,t){const n=t.get(e);if(n)return n;let o=is(e,[],!1).filter(l=>En(l)&&ki(l)!=="body"),r=null;const a=Cn(e).position==="fixed";let i=a?sr(e):e;for(;En(i)&&!bi(i);){const l=Cn(i),s=Iv(i);!s&&l.position==="fixed"&&(r=null),(a?!s&&!r:!s&&l.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Ls(i)&&!s&&PR(e,i))?o=o.filter(f=>f!==i):r=l,i=sr(i)}return t.set(e,o),o}function l7(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?ff(t)?[]:i7(t,this._c):[].concat(n),o],l=ix(t,i[0],r);let s=l.top,c=l.right,f=l.bottom,u=l.left;for(let d=1;d<i.length;d++){const m=ix(t,i[d],r);s=Ht(m.top,s),c=lr(m.right,c),f=lr(m.bottom,f),u=Ht(m.left,u)}return{width:c-u,height:f-s,x:u,y:s}}function s7(e){const{width:t,height:n}=MR(e);return{width:t,height:n}}function c7(e,t,n){const o=No(t),r=Yn(t),a=n==="fixed",i=Zr(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const s=$n(0);function c(){s.x=mf(r)}if(o||!o&&!a)if((ki(t)!=="body"||Ls(r))&&(l=pf(t)),o){const m=Zr(t,!0,a,t);s.x=m.x+t.clientLeft,s.y=m.y+t.clientTop}else r&&c();a&&!o&&r&&c();const f=r&&!o&&!a?OR(r,l):$n(0),u=i.left+l.scrollLeft-s.x-f.x,d=i.top+l.scrollTop-s.y-f.y;return{x:u,y:d,width:i.width,height:i.height}}function Vp(e){return Cn(e).position==="static"}function lx(e,t){if(!No(e)||Cn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Yn(e)===n&&(n=n.ownerDocument.body),n}function zR(e,t){const n=jt(e);if(ff(e))return n;if(!No(e)){let r=sr(e);for(;r&&!bi(r);){if(En(r)&&!Vp(r))return r;r=sr(r)}return n}let o=lx(e,t);for(;o&&qG(o)&&Vp(o);)o=lx(o,t);return o&&bi(o)&&Vp(o)&&!Iv(o)?n:o||WG(e)||n}const u7=async function(e){const t=this.getOffsetParent||zR,n=this.getDimensions,o=await n(e.floating);return{reference:c7(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function d7(e){return Cn(e).direction==="rtl"}const f7={convertOffsetParentRelativeRectToViewportRelativeRect:t7,getDocumentElement:Yn,getClippingRect:l7,getOffsetParent:zR,getElementRects:u7,getClientRects:n7,getDimensions:s7,getScale:Wa,isElement:En,isRTL:d7};function IR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function p7(e,t){let n=null,o;const r=Yn(e);function a(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function i(l,s){l===void 0&&(l=!1),s===void 0&&(s=1),a();const c=e.getBoundingClientRect(),{left:f,top:u,width:d,height:m}=c;if(l||t(),!d||!m)return;const v=Dc(u),g=Dc(r.clientWidth-(f+d)),x=Dc(r.clientHeight-(u+m)),h=Dc(f),y={rootMargin:-v+"px "+-g+"px "+-x+"px "+-h+"px",threshold:Ht(0,lr(1,s))||1};let S=!0;function E(N){const C=N[0].intersectionRatio;if(C!==s){if(!S)return i();C?i(!1,C):o=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!IR(c,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(E,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(E,y)}n.observe(e)}return i(!0),a}function m7(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:s=!1}=o,c=kv(e),f=r||a?[...c?is(c):[],...t?is(t):[]]:[];f.forEach(h=>{r&&h.addEventListener("scroll",n,{passive:!0}),a&&h.addEventListener("resize",n)});const u=c&&l?p7(c,n):null;let d=-1,m=null;i&&(m=new ResizeObserver(h=>{let[w]=h;w&&w.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var y;(y=m)==null||y.observe(t)})),n()}),c&&!s&&m.observe(c),t&&m.observe(t));let v,g=s?Zr(e):null;s&&x();function x(){const h=Zr(e);g&&!IR(g,h)&&n(),g=h,v=requestAnimationFrame(x)}return n(),()=>{var h;f.forEach(w=>{r&&w.removeEventListener("scroll",n),a&&w.removeEventListener("resize",n)}),u==null||u(),(h=m)==null||h.disconnect(),m=null,s&&cancelAnimationFrame(v)}}const h7=FG,g7=XG,v7=VG,y7=jG,b7=GG,sx=UG,w7=KG,x7=(e,t,n)=>{const o=new Map,r={platform:f7,...n},a={...r.platform,_c:o};return BG(e,t,{...r,platform:a})};var S7=typeof document<"u",E7=function(){},ou=S7?p.useLayoutEffect:E7;function od(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!od(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const a=r[o];if(!(a==="_owner"&&e.$$typeof)&&!od(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function LR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cx(e,t){const n=LR(e);return Math.round(t*n)/n}function Gp(e){const t=p.useRef(e);return ou(()=>{t.current=e}),t}function C7(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:s,open:c}=e,[f,u]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,m]=p.useState(o);od(d,o)||m(o);const[v,g]=p.useState(null),[x,h]=p.useState(null),w=p.useCallback(D=>{D!==N.current&&(N.current=D,g(D))},[]),y=p.useCallback(D=>{D!==C.current&&(C.current=D,h(D))},[]),S=a||v,E=i||x,N=p.useRef(null),C=p.useRef(null),A=p.useRef(f),T=s!=null,k=Gp(s),z=Gp(r),O=Gp(c),P=p.useCallback(()=>{if(!N.current||!C.current)return;const D={placement:t,strategy:n,middleware:d};z.current&&(D.platform=z.current),x7(N.current,C.current,D).then(M=>{const U={...M,isPositioned:O.current!==!1};_.current&&!od(A.current,U)&&(A.current=U,Jr.flushSync(()=>{u(U)}))})},[d,t,n,z,O]);ou(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,u(D=>({...D,isPositioned:!1})))},[c]);const _=p.useRef(!1);ou(()=>(_.current=!0,()=>{_.current=!1}),[]),ou(()=>{if(S&&(N.current=S),E&&(C.current=E),S&&E){if(k.current)return k.current(S,E,P);P()}},[S,E,P,k,T]);const L=p.useMemo(()=>({reference:N,floating:C,setReference:w,setFloating:y}),[w,y]),R=p.useMemo(()=>({reference:S,floating:E}),[S,E]),I=p.useMemo(()=>{const D={position:n,left:0,top:0};if(!R.floating)return D;const M=cx(R.floating,f.x),U=cx(R.floating,f.y);return l?{...D,transform:"translate("+M+"px, "+U+"px)",...LR(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:U}},[n,l,R.floating,f.x,f.y]);return p.useMemo(()=>({...f,update:P,refs:L,elements:R,floatingStyles:I}),[f,P,L,R,I])}const N7=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?sx({element:o.current,padding:r}).fn(n):{}:o?sx({element:o,padding:r}).fn(n):{}}}},_7=(e,t)=>{const n=h7(e);return{name:n.name,fn:n.fn,options:[e,t]}},R7=(e,t)=>{const n=g7(e);return{name:n.name,fn:n.fn,options:[e,t]}},T7=(e,t)=>({fn:w7(e).fn,options:[e,t]}),A7=(e,t)=>{const n=v7(e);return{name:n.name,fn:n.fn,options:[e,t]}},M7=(e,t)=>{const n=y7(e);return{name:n.name,fn:n.fn,options:[e,t]}},D7=(e,t)=>{const n=b7(e);return{name:n.name,fn:n.fn,options:[e,t]}},O7=(e,t)=>{const n=N7(e);return{name:n.name,fn:n.fn,options:[e,t]}};var P7="Arrow",kR=p.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...a}=e;return b(oe.svg,{...a,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:b("polygon",{points:"0,0 30,0 15,10"})})});kR.displayName=P7;var z7=kR,$R="Popper",[HR,Fn]=Ue($R),[MQ,BR]=HR($R),UR="PopperAnchor",VR=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,a=BR(UR,n),i=p.useRef(null),l=le(t,i),s=p.useRef(null);return p.useEffect(()=>{const c=s.current;s.current=(o==null?void 0:o.current)||i.current,c!==s.current&&a.onAnchorChange(s.current)}),o?null:b(oe.div,{...r,ref:l})});VR.displayName=UR;var $v="PopperContent",[I7,L7]=HR($v),GR=p.forwardRef((e,t)=>{var B,G,Z,ee,te,K;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:a="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:s=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:d=!1,updatePositionStrategy:m="optimized",onPlaced:v,...g}=e,x=BR($v,n),[h,w]=p.useState(null),y=le(t,W=>w(W)),[S,E]=p.useState(null),N=zs(S),C=(N==null?void 0:N.width)??0,A=(N==null?void 0:N.height)??0,T=o+(a!=="center"?"-"+a:""),k=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},z=Array.isArray(c)?c:[c],O=z.length>0,P={padding:k,boundary:z.filter($7),altBoundary:O},{refs:_,floatingStyles:L,placement:R,isPositioned:I,middlewareData:D}=C7({strategy:"fixed",placement:T,whileElementsMounted:(...W)=>m7(...W,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[_7({mainAxis:r+A,alignmentAxis:i}),s&&R7({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?T7():void 0,...P}),s&&A7({...P}),M7({...P,apply:({elements:W,rects:Q,availableWidth:ne,availableHeight:ae})=>{const{width:ce,height:fe}=Q.reference,ue=W.floating.style;ue.setProperty("--radix-popper-available-width",`${ne}px`),ue.setProperty("--radix-popper-available-height",`${ae}px`),ue.setProperty("--radix-popper-anchor-width",`${ce}px`),ue.setProperty("--radix-popper-anchor-height",`${fe}px`)}}),S&&O7({element:S,padding:l}),H7({arrowWidth:C,arrowHeight:A}),d&&D7({strategy:"referenceHidden",...P})]}),[M,U]=XR(R),F=Ae(v);He(()=>{I&&(F==null||F())},[I,F]);const $=(B=D.arrow)==null?void 0:B.x,H=(G=D.arrow)==null?void 0:G.y,V=((Z=D.arrow)==null?void 0:Z.centerOffset)!==0,[Y,q]=p.useState();return He(()=>{h&&q(window.getComputedStyle(h).zIndex)},[h]),b("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:I?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(ee=D.transformOrigin)==null?void 0:ee.x,(te=D.transformOrigin)==null?void 0:te.y].join(" "),...((K=D.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b(I7,{scope:n,placedSide:M,onArrowChange:E,arrowX:$,arrowY:H,shouldHideArrow:V,children:b(oe.div,{"data-side":M,"data-align":U,...g,ref:y,style:{...g.style,animation:I?void 0:"none"}})})})});GR.displayName=$v;var YR="PopperArrow",k7={top:"bottom",right:"left",bottom:"top",left:"right"},FR=p.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,a=L7(YR,o),i=k7[a.placedSide];return b("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:b(z7,{...r,ref:n,style:{...r.style,display:"block"}})})});FR.displayName=YR;function $7(e){return e!==null}var H7=e=>({name:"transformOrigin",options:e,fn(t){var x,h,w;const{placement:n,rects:o,middlewareData:r}=t,i=((x=r.arrow)==null?void 0:x.centerOffset)!==0,l=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[c,f]=XR(n),u={start:"0%",center:"50%",end:"100%"}[f],d=(((h=r.arrow)==null?void 0:h.x)??0)+l/2,m=(((w=r.arrow)==null?void 0:w.y)??0)+s/2;let v="",g="";return c==="bottom"?(v=i?u:`${d}px`,g=`${-s}px`):c==="top"?(v=i?u:`${d}px`,g=`${o.floating.height+s}px`):c==="right"?(v=`${-s}px`,g=i?u:`${m}px`):c==="left"&&(v=`${o.floating.width+s}px`,g=i?u:`${m}px`),{data:{x:v,y:g}}}});function XR(e){const[t,n="center"]=e.split("-");return[t,n]}var $i=VR,ks=GR,$s=FR,Yp="rovingFocusGroup.onEntryFocus",B7={bubbles:!1,cancelable:!0},Hs="RovingFocusGroup",[bh,KR,U7]=So(Hs),[V7,Xn]=Ue(Hs,[U7]),[G7,Y7]=V7(Hs),jR=p.forwardRef((e,t)=>b(bh.Provider,{scope:e.__scopeRovingFocusGroup,children:b(bh.Slot,{scope:e.__scopeRovingFocusGroup,children:b(F7,{...e,ref:t})})}));jR.displayName=Hs;var F7=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:s,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...u}=e,d=p.useRef(null),m=le(t,d),v=Eo(a),[g,x]=ht({prop:i,defaultProp:l??null,onChange:s,caller:Hs}),[h,w]=p.useState(!1),y=Ae(c),S=KR(n),E=p.useRef(!1),[N,C]=p.useState(0);return p.useEffect(()=>{const A=d.current;if(A)return A.addEventListener(Yp,y),()=>A.removeEventListener(Yp,y)},[y]),b(G7,{scope:n,orientation:o,dir:v,loop:r,currentTabStopId:g,onItemFocus:p.useCallback(A=>x(A),[x]),onItemShiftTab:p.useCallback(()=>w(!0),[]),onFocusableItemAdd:p.useCallback(()=>C(A=>A+1),[]),onFocusableItemRemove:p.useCallback(()=>C(A=>A-1),[]),children:b(oe.div,{tabIndex:h||N===0?-1:0,"data-orientation":o,...u,ref:m,style:{outline:"none",...e.style},onMouseDown:j(e.onMouseDown,()=>{E.current=!0}),onFocus:j(e.onFocus,A=>{const T=!E.current;if(A.target===A.currentTarget&&T&&!h){const k=new CustomEvent(Yp,B7);if(A.currentTarget.dispatchEvent(k),!k.defaultPrevented){const z=S().filter(R=>R.focusable),O=z.find(R=>R.active),P=z.find(R=>R.id===g),L=[O,P,...z].filter(Boolean).map(R=>R.ref.current);QR(L,f)}}E.current=!1}),onBlur:j(e.onBlur,()=>w(!1))})})}),qR="RovingFocusGroupItem",ZR=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:a,children:i,...l}=e,s=mt(),c=a||s,f=Y7(qR,n),u=f.currentTabStopId===c,d=KR(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:g}=f;return p.useEffect(()=>{if(o)return m(),()=>v()},[o,m,v]),b(bh.ItemSlot,{scope:n,id:c,focusable:o,active:r,children:b(oe.span,{tabIndex:u?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:j(e.onMouseDown,x=>{o?f.onItemFocus(c):x.preventDefault()}),onFocus:j(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:j(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const h=j7(x,f.orientation,f.dir);if(h!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let y=d().filter(S=>S.focusable).map(S=>S.ref.current);if(h==="last")y.reverse();else if(h==="prev"||h==="next"){h==="prev"&&y.reverse();const S=y.indexOf(x.currentTarget);y=f.loop?q7(y,S+1):y.slice(S+1)}setTimeout(()=>QR(y))}}),children:typeof i=="function"?i({isCurrentTabStop:u,hasTabStop:g!=null}):i})})});ZR.displayName=qR;var X7={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function K7(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function j7(e,t,n){const o=K7(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return X7[o]}function QR(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function q7(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Bs=jR,Us=ZR,wh=["Enter"," "],Z7=["ArrowDown","PageUp","Home"],WR=["ArrowUp","PageDown","End"],Q7=[...Z7,...WR],W7={ltr:[...wh,"ArrowRight"],rtl:[...wh,"ArrowLeft"]},J7={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hf="Menu",[ls,eY,tY]=So(hf),[ca,Vs]=Ue(hf,[tY,Fn,Xn]),Hv=Fn(),JR=Xn(),[DQ,ua]=ca(hf),[OQ,Gs]=ca(hf),nY="MenuAnchor",Bv=p.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=Hv(n);return b($i,{...r,...o,ref:t})});Bv.displayName=nY;var Uv="MenuPortal",[oY,eT]=ca(Uv,{forceMount:void 0}),tT=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,a=ua(Uv,t);return b(oY,{scope:t,forceMount:n,children:b(Pe,{present:n||a.open,children:b(ia,{asChild:!0,container:r,children:o})})})};tT.displayName=Uv;var un="MenuContent",[rY,Vv]=ca(un),nT=p.forwardRef((e,t)=>{const n=eT(un,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,a=ua(un,e.__scopeMenu),i=Gs(un,e.__scopeMenu);return b(ls.Provider,{scope:e.__scopeMenu,children:b(Pe,{present:o||a.open,children:b(ls.Slot,{scope:e.__scopeMenu,children:i.modal?b(aY,{...r,ref:t}):b(iY,{...r,ref:t})})})})}),aY=p.forwardRef((e,t)=>{const n=ua(un,e.__scopeMenu),o=p.useRef(null),r=le(t,o);return p.useEffect(()=>{const a=o.current;if(a)return of(a)},[]),b(Gv,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:j(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),iY=p.forwardRef((e,t)=>{const n=ua(un,e.__scopeMenu);return b(Gv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),lY=Xr("MenuContent.ScrollLock"),Gv=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:s,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:d,onDismiss:m,disableOutsideScroll:v,...g}=e,x=ua(un,n),h=Gs(un,n),w=Hv(n),y=JR(n),S=eY(n),[E,N]=p.useState(null),C=p.useRef(null),A=le(t,C,x.onContentChange),T=p.useRef(0),k=p.useRef(""),z=p.useRef(0),O=p.useRef(null),P=p.useRef("right"),_=p.useRef(0),L=v?Ds:p.Fragment,R=v?{as:lY,allowPinchZoom:!0}:void 0,I=M=>{var B,G;const U=k.current+M,F=S().filter(Z=>!Z.disabled),$=document.activeElement,H=(B=F.find(Z=>Z.ref.current===$))==null?void 0:B.textValue,V=F.map(Z=>Z.textValue),Y=bY(V,U,H),q=(G=F.find(Z=>Z.textValue===Y))==null?void 0:G.ref.current;(function Z(ee){k.current=ee,window.clearTimeout(T.current),ee!==""&&(T.current=window.setTimeout(()=>Z(""),1e3))})(U),q&&setTimeout(()=>q.focus())};p.useEffect(()=>()=>window.clearTimeout(T.current),[]),tf();const D=p.useCallback(M=>{var F,$;return P.current===((F=O.current)==null?void 0:F.side)&&xY(M,($=O.current)==null?void 0:$.area)},[]);return b(rY,{scope:n,searchRef:k,onItemEnter:p.useCallback(M=>{D(M)&&M.preventDefault()},[D]),onItemLeave:p.useCallback(M=>{var U;D(M)||((U=C.current)==null||U.focus(),N(null))},[D]),onTriggerLeave:p.useCallback(M=>{D(M)&&M.preventDefault()},[D]),pointerGraceTimerRef:z,onPointerGraceIntentChange:p.useCallback(M=>{O.current=M},[]),children:b(L,{...R,children:b(Ms,{asChild:!0,trapped:r,onMountAutoFocus:j(a,M=>{var U;M.preventDefault(),(U=C.current)==null||U.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:b(Co,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:d,onDismiss:m,children:b(Bs,{asChild:!0,...y,dir:h.dir,orientation:"vertical",loop:o,currentTabStopId:E,onCurrentTabStopIdChange:N,onEntryFocus:j(s,M=>{h.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:b(ks,{role:"menu","aria-orientation":"vertical","data-state":yT(x.open),"data-radix-menu-content":"",dir:h.dir,...w,...g,ref:A,style:{outline:"none",...g.style},onKeyDown:j(g.onKeyDown,M=>{const F=M.target.closest("[data-radix-menu-content]")===M.currentTarget,$=M.ctrlKey||M.altKey||M.metaKey,H=M.key.length===1;F&&(M.key==="Tab"&&M.preventDefault(),!$&&H&&I(M.key));const V=C.current;if(M.target!==V||!Q7.includes(M.key))return;M.preventDefault();const q=S().filter(B=>!B.disabled).map(B=>B.ref.current);WR.includes(M.key)&&q.reverse(),vY(q)}),onBlur:j(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(T.current),k.current="")}),onPointerMove:j(e.onPointerMove,ss(M=>{const U=M.target,F=_.current!==M.clientX;if(M.currentTarget.contains(U)&&F){const $=M.clientX>_.current?"right":"left";P.current=$,_.current=M.clientX}}))})})})})})})});nT.displayName=un;var sY="MenuGroup",Yv=p.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return b(oe.div,{role:"group",...o,ref:t})});Yv.displayName=sY;var cY="MenuLabel",oT=p.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return b(oe.div,{...o,ref:t})});oT.displayName=cY;var rd="MenuItem",ux="menu.itemSelect",gf=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,a=p.useRef(null),i=Gs(rd,e.__scopeMenu),l=Vv(rd,e.__scopeMenu),s=le(t,a),c=p.useRef(!1),f=()=>{const u=a.current;if(!n&&u){const d=new CustomEvent(ux,{bubbles:!0,cancelable:!0});u.addEventListener(ux,m=>o==null?void 0:o(m),{once:!0}),ns(u,d),d.defaultPrevented?c.current=!1:i.onClose()}};return b(rT,{...r,ref:s,disabled:n,onClick:j(e.onClick,f),onPointerDown:u=>{var d;(d=e.onPointerDown)==null||d.call(e,u),c.current=!0},onPointerUp:j(e.onPointerUp,u=>{var d;c.current||(d=u.currentTarget)==null||d.click()}),onKeyDown:j(e.onKeyDown,u=>{const d=l.searchRef.current!=="";n||d&&u.key===" "||wh.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});gf.displayName=rd;var rT=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...a}=e,i=Vv(rd,n),l=JR(n),s=p.useRef(null),c=le(t,s),[f,u]=p.useState(!1),[d,m]=p.useState("");return p.useEffect(()=>{const v=s.current;v&&m((v.textContent??"").trim())},[a.children]),b(ls.ItemSlot,{scope:n,disabled:o,textValue:r??d,children:b(Us,{asChild:!0,...l,focusable:!o,children:b(oe.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:c,onPointerMove:j(e.onPointerMove,ss(v=>{o?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:j(e.onPointerLeave,ss(v=>i.onItemLeave(v))),onFocus:j(e.onFocus,()=>u(!0)),onBlur:j(e.onBlur,()=>u(!1))})})})}),uY="MenuCheckboxItem",aT=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return b(uT,{scope:e.__scopeMenu,checked:n,children:b(gf,{role:"menuitemcheckbox","aria-checked":ad(n)?"mixed":n,...r,ref:t,"data-state":Xv(n),onSelect:j(r.onSelect,()=>o==null?void 0:o(ad(n)?!0:!n),{checkForDefaultPrevented:!1})})})});aT.displayName=uY;var iT="MenuRadioGroup",[dY,fY]=ca(iT,{value:void 0,onValueChange:()=>{}}),lT=p.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,a=Ae(o);return b(dY,{scope:e.__scopeMenu,value:n,onValueChange:a,children:b(Yv,{...r,ref:t})})});lT.displayName=iT;var sT="MenuRadioItem",cT=p.forwardRef((e,t)=>{const{value:n,...o}=e,r=fY(sT,e.__scopeMenu),a=n===r.value;return b(uT,{scope:e.__scopeMenu,checked:a,children:b(gf,{role:"menuitemradio","aria-checked":a,...o,ref:t,"data-state":Xv(a),onSelect:j(o.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,n)},{checkForDefaultPrevented:!1})})})});cT.displayName=sT;var Fv="MenuItemIndicator",[uT,pY]=ca(Fv,{checked:!1}),dT=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,a=pY(Fv,n);return b(Pe,{present:o||ad(a.checked)||a.checked===!0,children:b(oe.span,{...r,ref:t,"data-state":Xv(a.checked)})})});dT.displayName=Fv;var mY="MenuSeparator",fT=p.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return b(oe.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});fT.displayName=mY;var hY="MenuArrow",pT=p.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=Hv(n);return b($s,{...r,...o,ref:t})});pT.displayName=hY;var gY="MenuSub",[PQ,mT]=ca(gY),ul="MenuSubTrigger",hT=p.forwardRef((e,t)=>{const n=ua(ul,e.__scopeMenu),o=Gs(ul,e.__scopeMenu),r=mT(ul,e.__scopeMenu),a=Vv(ul,e.__scopeMenu),i=p.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:s}=a,c={__scopeMenu:e.__scopeMenu},f=p.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return p.useEffect(()=>f,[f]),p.useEffect(()=>{const u=l.current;return()=>{window.clearTimeout(u),s(null)}},[l,s]),b(Bv,{asChild:!0,...c,children:b(rT,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":yT(n.open),...e,ref:Sn(t,r.onTriggerChange),onClick:u=>{var d;(d=e.onClick)==null||d.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:j(e.onPointerMove,ss(u=>{a.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:j(e.onPointerLeave,ss(u=>{var m,v;f();const d=(m=n.content)==null?void 0:m.getBoundingClientRect();if(d){const g=(v=n.content)==null?void 0:v.dataset.side,x=g==="right",h=x?-5:5,w=d[x?"left":"right"],y=d[x?"right":"left"];a.onPointerGraceIntentChange({area:[{x:u.clientX+h,y:u.clientY},{x:w,y:d.top},{x:y,y:d.top},{x:y,y:d.bottom},{x:w,y:d.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(u),u.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:j(e.onKeyDown,u=>{var m;const d=a.searchRef.current!=="";e.disabled||d&&u.key===" "||W7[o.dir].includes(u.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),u.preventDefault())})})})});hT.displayName=ul;var gT="MenuSubContent",vT=p.forwardRef((e,t)=>{const n=eT(un,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,a=ua(un,e.__scopeMenu),i=Gs(un,e.__scopeMenu),l=mT(gT,e.__scopeMenu),s=p.useRef(null),c=le(t,s);return b(ls.Provider,{scope:e.__scopeMenu,children:b(Pe,{present:o||a.open,children:b(ls.Slot,{scope:e.__scopeMenu,children:b(Gv,{id:l.contentId,"aria-labelledby":l.triggerId,...r,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var u;i.isUsingKeyboardRef.current&&((u=s.current)==null||u.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:j(e.onFocusOutside,f=>{f.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:j(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:j(e.onKeyDown,f=>{var m;const u=f.currentTarget.contains(f.target),d=J7[i.dir].includes(f.key);u&&d&&(a.onOpenChange(!1),(m=l.trigger)==null||m.focus(),f.preventDefault())})})})})})});vT.displayName=gT;function yT(e){return e?"open":"closed"}function ad(e){return e==="indeterminate"}function Xv(e){return ad(e)?"indeterminate":e?"checked":"unchecked"}function vY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function yY(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function bY(e,t,n){const r=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=yY(e,Math.max(a,0));r.length===1&&(i=i.filter(c=>c!==n));const s=i.find(c=>c.toLowerCase().startsWith(r.toLowerCase()));return s!==n?s:void 0}function wY(e,t){const{x:n,y:o}=e;let r=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const l=t[a],s=t[i],c=l.x,f=l.y,u=s.x,d=s.y;f>o!=d>o&&n<(u-c)*(o-f)/(d-f)+c&&(r=!r)}return r}function xY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return wY(n,t)}function ss(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Kv=Bv,jv=tT,qv=nT,Zv=Yv,Qv=oT,Wv=gf,Jv=aT,ey=lT,ty=cT,ny=dT,oy=fT,ry=pT,ay=hT,iy=vT,bT="ContextMenu",[SY,zQ]=Ue(bT,[Vs]),Pt=Vs(),[IQ,wT]=SY(bT),xT="ContextMenuTrigger",EY=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:o=!1,...r}=e,a=wT(xT,n),i=Pt(n),l=p.useRef({x:0,y:0}),s=p.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),c=p.useRef(0),f=p.useCallback(()=>window.clearTimeout(c.current),[]),u=d=>{l.current={x:d.clientX,y:d.clientY},a.onOpenChange(!0)};return p.useEffect(()=>f,[f]),p.useEffect(()=>void(o&&f()),[o,f]),re(De,{children:[b(Kv,{...i,virtualRef:s}),b(oe.span,{"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,...r,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:o?e.onContextMenu:j(e.onContextMenu,d=>{f(),u(d),d.preventDefault()}),onPointerDown:o?e.onPointerDown:j(e.onPointerDown,Oc(d=>{f(),c.current=window.setTimeout(()=>u(d),700)})),onPointerMove:o?e.onPointerMove:j(e.onPointerMove,Oc(f)),onPointerCancel:o?e.onPointerCancel:j(e.onPointerCancel,Oc(f)),onPointerUp:o?e.onPointerUp:j(e.onPointerUp,Oc(f))})]})});EY.displayName=xT;var CY="ContextMenuPortal",ST=e=>{const{__scopeContextMenu:t,...n}=e,o=Pt(t);return b(jv,{...o,...n})};ST.displayName=CY;var ET="ContextMenuContent",CT=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=wT(ET,n),a=Pt(n),i=p.useRef(!1);return b(qv,{...a,...o,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{var s;(s=e.onCloseAutoFocus)==null||s.call(e,l),!l.defaultPrevented&&i.current&&l.preventDefault(),i.current=!1},onInteractOutside:l=>{var s;(s=e.onInteractOutside)==null||s.call(e,l),!l.defaultPrevented&&!r.modal&&(i.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)"}})});CT.displayName=ET;var NY="ContextMenuGroup",_Y=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Pt(n);return b(Zv,{...r,...o,ref:t})});_Y.displayName=NY;var RY="ContextMenuLabel",NT=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Pt(n);return b(Qv,{...r,...o,ref:t})});NT.displayName=RY;var TY="ContextMenuItem",_T=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Pt(n);return b(Wv,{...r,...o,ref:t})});_T.displayName=TY;var AY="ContextMenuCheckboxItem",RT=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Pt(n);return b(Jv,{...r,...o,ref:t})});RT.displayName=AY;var MY="ContextMenuRadioGroup",DY=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Pt(n);return b(ey,{...r,...o,ref:t})});DY.displayName=MY;var OY="ContextMenuRadioItem",TT=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Pt(n);return b(ty,{...r,...o,ref:t})});TT.displayName=OY;var PY="ContextMenuItemIndicator",AT=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Pt(n);return b(ny,{...r,...o,ref:t})});AT.displayName=PY;var zY="ContextMenuSeparator",MT=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Pt(n);return b(oy,{...r,...o,ref:t})});MT.displayName=zY;var IY="ContextMenuArrow",LY=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Pt(n);return b(ry,{...r,...o,ref:t})});LY.displayName=IY;var kY="ContextMenuSubTrigger",DT=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Pt(n);return b(ay,{...r,...o,ref:t})});DT.displayName=kY;var $Y="ContextMenuSubContent",OT=p.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Pt(n);return b(iy,{...r,...o,ref:t,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)"}})});OT.displayName=$Y;function Oc(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var HY=ST,PT=CT,zT=NT,IT=_T,LT=RT,kT=TT,$T=AT,HT=MT,BT=DT,UT=OT;const BY=p.forwardRef(({className:e,inset:t,children:n,...o},r)=>re(BT,{ref:r,className:X("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[n,b(pv,{className:"ml-auto h-4 w-4"})]}));BY.displayName=BT.displayName;const UY=p.forwardRef(({className:e,...t},n)=>b(UT,{ref:n,className:X("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t}));UY.displayName=UT.displayName;const VY=p.forwardRef(({className:e,...t},n)=>b(HY,{children:b(PT,{ref:n,className:X("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t})}));VY.displayName=PT.displayName;const GY=p.forwardRef(({className:e,inset:t,...n},o)=>b(IT,{ref:o,className:X("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));GY.displayName=IT.displayName;const YY=p.forwardRef(({className:e,children:t,checked:n,...o},r)=>re(LT,{ref:r,className:X("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[b("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b($T,{children:b(As,{className:"h-4 w-4"})})}),t]}));YY.displayName=LT.displayName;const FY=p.forwardRef(({className:e,children:t,...n},o)=>re(kT,{ref:o,className:X("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[b("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b($T,{children:b(ef,{className:"h-2 w-2 fill-current"})})}),t]}));FY.displayName=kT.displayName;const XY=p.forwardRef(({className:e,inset:t,...n},o)=>b(zT,{ref:o,className:X("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));XY.displayName=zT.displayName;const KY=p.forwardRef(({className:e,...t},n)=>b(HT,{ref:n,className:X("-mx-1 my-1 h-px bg-border",e),...t}));KY.displayName=HT.displayName;function jY(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const qY=ie.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Ys=()=>{const e=ie.useContext(qY);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};jY(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
201
- [data-state=closed]
202
- ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function ZY(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function QY(...e){return t=>e.forEach(n=>ZY(n,t))}function VT(...e){return p.useCallback(QY(...e),e)}const dx=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Fp(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function WY(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Xp={DURATION:.5,EASE:[.32,.72,0,1]},JY=8,eF=26,tF=()=>()=>{};function nF(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:o,noBodyStyles:r}=Ys(),a=ie.useRef(null),i=p.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-eF)/window.innerWidth}ie.useEffect(()=>{if(t&&n){a.current&&clearTimeout(a.current);const s=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!s)return;WY(o&&!r?Fp(document.body,{background:"black"}):tF,Fp(s,{transformOrigin:dx(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Xp.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Xp.EASE.join(",")})`}));const c=Fp(s,{borderRadius:`${JY}px`,overflow:"hidden",...dx(e)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),a.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},Xp.DURATION*1e3)}}},[t,n,i])}const GT=ie.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:o,onRelease:r,shouldFade:a,isOpen:i,modal:l,shouldAnimate:s}=Ys(),c=VT(t,n),f=o&&o.length>0;if(!l)return null;const u=ie.useCallback(d=>r(d),[r]);return ie.createElement(la,{onMouseUp:u,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":i&&f?"true":"false","data-vaul-snap-points-overlay":i&&a?"true":"false","data-vaul-animate":s!=null&&s.current?"true":"false",...e})});GT.displayName="Drawer.Overlay";const YT=ie.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...o},r){const{drawerRef:a,onPress:i,onRelease:l,onDrag:s,keyboardIsOpen:c,snapPointsOffset:f,activeSnapPointIndex:u,modal:d,isOpen:m,direction:v,snapPoints:g,container:x,handleOnly:h,shouldAnimate:w,autoFocus:y}=Ys(),[S,E]=ie.useState(!1),N=VT(r,a),C=ie.useRef(null),A=ie.useRef(null),T=ie.useRef(!1),k=g&&g.length>0;nF();const z=(P,_,L=0)=>{if(T.current)return!0;const R=Math.abs(P.y),I=Math.abs(P.x),D=I>R,M=["bottom","right"].includes(_)?1:-1;if(_==="left"||_==="right"){if(!(P.x*M<0)&&I>=0&&I<=L)return D}else if(!(P.y*M<0)&&R>=0&&R<=L)return!D;return T.current=!0,!0};ie.useEffect(()=>{k&&window.requestAnimationFrame(()=>{E(!0)})},[]);function O(P){C.current=null,T.current=!1,l(P)}return ie.createElement(sa,{"data-vaul-drawer-direction":v,"data-vaul-drawer":"","data-vaul-delayed-snap-points":S?"true":"false","data-vaul-snap-points":m&&k?"true":"false","data-vaul-custom-container":x?"true":"false","data-vaul-animate":w!=null&&w.current?"true":"false",...o,ref:N,style:f&&f.length>0?{"--snap-point-height":`${f[u??0]}px`,...t}:t,onPointerDown:P=>{h||(o.onPointerDown==null||o.onPointerDown.call(o,P),C.current={x:P.pageX,y:P.pageY},i(P))},onOpenAutoFocus:P=>{n==null||n(P),y||P.preventDefault()},onPointerDownOutside:P=>{if(e==null||e(P),!d||P.defaultPrevented){P.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:P=>{if(!d){P.preventDefault();return}},onPointerMove:P=>{if(A.current=P,h||(o.onPointerMove==null||o.onPointerMove.call(o,P),!C.current))return;const _=P.pageY-C.current.y,L=P.pageX-C.current.x,R=P.pointerType==="touch"?10:2;z({x:L,y:_},v,R)?s(P):(Math.abs(L)>R||Math.abs(_)>R)&&(C.current=null)},onPointerUp:P=>{o.onPointerUp==null||o.onPointerUp.call(o,P),C.current=null,T.current=!1,l(P)},onPointerOut:P=>{o.onPointerOut==null||o.onPointerOut.call(o,P),O(A.current)},onContextMenu:P=>{o.onContextMenu==null||o.onContextMenu.call(o,P),A.current&&O(A.current)}})});YT.displayName="Drawer.Content";const oF=250,rF=120,aF=ie.forwardRef(function({preventCycle:e=!1,children:t,...n},o){const{closeDrawer:r,isDragging:a,snapPoints:i,activeSnapPoint:l,setActiveSnapPoint:s,dismissible:c,handleOnly:f,isOpen:u,onPress:d,onDrag:m}=Ys(),v=ie.useRef(null),g=ie.useRef(!1);function x(){if(g.current){y();return}window.setTimeout(()=>{h()},rF)}function h(){if(a||e||g.current){y();return}if(y(),!i||i.length===0){c||r();return}if(l===i[i.length-1]&&c){r();return}const E=i.findIndex(C=>C===l);if(E===-1)return;const N=i[E+1];s(N)}function w(){v.current=window.setTimeout(()=>{g.current=!0},oF)}function y(){v.current&&window.clearTimeout(v.current),g.current=!1}return ie.createElement("div",{onClick:x,onPointerCancel:y,onPointerDown:S=>{f&&d(S),w()},onPointerMove:S=>{f&&m(S)},ref:o,"data-vaul-drawer-visible":u?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},ie.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});aF.displayName="Drawer.Handle";function iF(e){const t=Ys(),{container:n=t.container,...o}=e;return ie.createElement(Os,{container:n,...o})}const fr={Content:YT,Overlay:GT,Portal:iF,Title:Pi,Description:zi},lF=fr.Portal,FT=p.forwardRef(({className:e,...t},n)=>b(fr.Overlay,{ref:n,className:X("fixed inset-0 z-50 bg-black/80",e),...t}));FT.displayName=fr.Overlay.displayName;const sF=p.forwardRef(({className:e,children:t,...n},o)=>re(lF,{children:[b(FT,{}),re(fr.Content,{ref:o,className:X("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[b("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));sF.displayName="DrawerContent";const cF=p.forwardRef(({className:e,...t},n)=>b(fr.Title,{ref:n,className:X("text-lg font-semibold leading-none tracking-tight",e),...t}));cF.displayName=fr.Title.displayName;const uF=p.forwardRef(({className:e,...t},n)=>b(fr.Description,{ref:n,className:X("text-sm text-muted-foreground",e),...t}));uF.displayName=fr.Description.displayName;var XT="DropdownMenu",[dF,LQ]=Ue(XT,[Vs]),zt=Vs(),[kQ,KT]=dF(XT),jT="DropdownMenuTrigger",fF=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,a=KT(jT,n),i=zt(n);return b(Kv,{asChild:!0,...i,children:b(oe.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:Sn(t,a.triggerRef),onPointerDown:j(e.onPointerDown,l=>{!o&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:j(e.onKeyDown,l=>{o||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});fF.displayName=jT;var pF="DropdownMenuPortal",qT=e=>{const{__scopeDropdownMenu:t,...n}=e,o=zt(t);return b(jv,{...o,...n})};qT.displayName=pF;var ZT="DropdownMenuContent",QT=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=KT(ZT,n),a=zt(n),i=p.useRef(!1);return b(qv,{id:r.contentId,"aria-labelledby":r.triggerId,...a,...o,ref:t,onCloseAutoFocus:j(e.onCloseAutoFocus,l=>{var s;i.current||(s=r.triggerRef.current)==null||s.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:j(e.onInteractOutside,l=>{const s=l.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0,f=s.button===2||c;(!r.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});QT.displayName=ZT;var mF="DropdownMenuGroup",hF=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=zt(n);return b(Zv,{...r,...o,ref:t})});hF.displayName=mF;var gF="DropdownMenuLabel",WT=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=zt(n);return b(Qv,{...r,...o,ref:t})});WT.displayName=gF;var vF="DropdownMenuItem",JT=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=zt(n);return b(Wv,{...r,...o,ref:t})});JT.displayName=vF;var yF="DropdownMenuCheckboxItem",eA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=zt(n);return b(Jv,{...r,...o,ref:t})});eA.displayName=yF;var bF="DropdownMenuRadioGroup",wF=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=zt(n);return b(ey,{...r,...o,ref:t})});wF.displayName=bF;var xF="DropdownMenuRadioItem",tA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=zt(n);return b(ty,{...r,...o,ref:t})});tA.displayName=xF;var SF="DropdownMenuItemIndicator",nA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=zt(n);return b(ny,{...r,...o,ref:t})});nA.displayName=SF;var EF="DropdownMenuSeparator",oA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=zt(n);return b(oy,{...r,...o,ref:t})});oA.displayName=EF;var CF="DropdownMenuArrow",NF=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=zt(n);return b(ry,{...r,...o,ref:t})});NF.displayName=CF;var _F="DropdownMenuSubTrigger",rA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=zt(n);return b(ay,{...r,...o,ref:t})});rA.displayName=_F;var RF="DropdownMenuSubContent",aA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=zt(n);return b(iy,{...r,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});aA.displayName=RF;var TF=qT,iA=QT,lA=WT,sA=JT,cA=eA,uA=tA,dA=nA,fA=oA,pA=rA,mA=aA;const AF=p.forwardRef(({className:e,inset:t,children:n,...o},r)=>re(pA,{ref:r,className:X("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[n,b(pv,{className:"ml-auto"})]}));AF.displayName=pA.displayName;const MF=p.forwardRef(({className:e,...t},n)=>b(mA,{ref:n,className:X("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));MF.displayName=mA.displayName;const DF=p.forwardRef(({className:e,sideOffset:t=4,...n},o)=>b(TF,{children:b(iA,{ref:o,sideOffset:t,className:X("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...n})}));DF.displayName=iA.displayName;const OF=p.forwardRef(({className:e,inset:t,...n},o)=>b(sA,{ref:o,className:X("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n}));OF.displayName=sA.displayName;const PF=p.forwardRef(({className:e,children:t,checked:n,...o},r)=>re(cA,{ref:r,className:X("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[b("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b(dA,{children:b(As,{className:"h-4 w-4"})})}),t]}));PF.displayName=cA.displayName;const zF=p.forwardRef(({className:e,children:t,...n},o)=>re(uA,{ref:o,className:X("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[b("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b(dA,{children:b(ef,{className:"h-2 w-2 fill-current"})})}),t]}));zF.displayName=uA.displayName;const IF=p.forwardRef(({className:e,inset:t,...n},o)=>b(lA,{ref:o,className:X("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));IF.displayName=lA.displayName;const LF=p.forwardRef(({className:e,...t},n)=>b(fA,{ref:n,className:X("-mx-1 my-1 h-px bg-muted",e),...t}));LF.displayName=fA.displayName;const kF=ie.createContext(null);kF.displayName="HookFormControlContext";typeof window<"u"?ie.useLayoutEffect:ie.useEffect;const hA=ie.createContext(null);hA.displayName="HookFormContext";const $F=()=>ie.useContext(hA);var HF="Label",gA=p.forwardRef((e,t)=>b(St.label,{...e,ref:t,onMouseDown:n=>{var r;n.target.closest("button, input, select, textarea")||((r=e.onMouseDown)==null||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));gA.displayName=HF;var vA=gA;const BF=aa("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),yA=p.forwardRef(({className:e,...t},n)=>b(vA,{ref:n,className:X(BF(),e),...t}));yA.displayName=vA.displayName;const UF=p.createContext(null),vf=()=>{const e=p.useContext(UF),t=p.useContext(bA),{getFieldState:n,formState:o}=$F();if(!e)throw new Error("useFormField should be used within <FormField>");if(!t)throw new Error("useFormField should be used within <FormItem>");const r=n(e.name,o),{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...r}},bA=p.createContext(null),VF=p.forwardRef(({className:e,...t},n)=>{const o=p.useId();return b(bA.Provider,{value:{id:o},children:b("div",{ref:n,className:X("space-y-2",e),...t})})});VF.displayName="FormItem";const GF=p.forwardRef(({className:e,...t},n)=>{const{error:o,formItemId:r}=vf();return b(yA,{ref:n,className:X(o&&"text-destructive",e),htmlFor:r,...t})});GF.displayName="FormLabel";const YF=p.forwardRef(({...e},t)=>{const{error:n,formItemId:o,formDescriptionId:r,formMessageId:a}=vf();return b(wv,{ref:t,id:o,"aria-describedby":n?`${r} ${a}`:`${r}`,"aria-invalid":!!n,...e})});YF.displayName="FormControl";const FF=p.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:o}=vf();return b("p",{ref:n,id:o,className:X("text-sm text-muted-foreground",e),...t})});FF.displayName="FormDescription";const XF=p.forwardRef(({className:e,children:t,...n},o)=>{const{error:r,formMessageId:a}=vf(),i=r?String((r==null?void 0:r.message)??""):t;return i?b("p",{ref:o,id:a,className:X("text-sm font-medium text-destructive",e),...n,children:i}):null});XF.displayName="FormMessage";var Kp,wA="HoverCard",[xA,$Q]=Ue(wA,[Fn]),ly=Fn(),[HQ,sy]=xA(wA),SA="HoverCardTrigger",KF=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,...o}=e,r=sy(SA,n),a=ly(n);return b($i,{asChild:!0,...a,children:b(oe.a,{"data-state":r.open?"open":"closed",...o,ref:t,onPointerEnter:j(e.onPointerEnter,ld(r.onOpen)),onPointerLeave:j(e.onPointerLeave,ld(r.onClose)),onFocus:j(e.onFocus,r.onOpen),onBlur:j(e.onBlur,r.onClose),onTouchStart:j(e.onTouchStart,i=>i.preventDefault())})})});KF.displayName=SA;var jF="HoverCardPortal",[BQ,qF]=xA(jF,{forceMount:void 0}),id="HoverCardContent",EA=p.forwardRef((e,t)=>{const n=qF(id,e.__scopeHoverCard),{forceMount:o=n.forceMount,...r}=e,a=sy(id,e.__scopeHoverCard);return b(Pe,{present:o||a.open,children:b(ZF,{"data-state":a.open?"open":"closed",...r,onPointerEnter:j(e.onPointerEnter,ld(a.onOpen)),onPointerLeave:j(e.onPointerLeave,ld(a.onClose)),ref:t})})});EA.displayName=id;var ZF=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,...l}=e,s=sy(id,n),c=ly(n),f=p.useRef(null),u=le(t,f),[d,m]=p.useState(!1);return p.useEffect(()=>{if(d){const v=document.body;return Kp=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=Kp,v.style.webkitUserSelect=Kp}}},[d]),p.useEffect(()=>{if(f.current){const v=()=>{m(!1),s.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var x;((x=document.getSelection())==null?void 0:x.toString())!==""&&(s.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),s.hasSelectionRef.current=!1,s.isPointerDownOnContentRef.current=!1}}},[s.isPointerDownOnContentRef,s.hasSelectionRef]),p.useEffect(()=>{f.current&&JF(f.current).forEach(g=>g.setAttribute("tabindex","-1"))}),b(Co,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:j(a,v=>{v.preventDefault()}),onDismiss:s.onDismiss,children:b(ks,{...c,...l,onPointerDown:j(l.onPointerDown,v=>{v.currentTarget.contains(v.target)&&m(!0),s.hasSelectionRef.current=!1,s.isPointerDownOnContentRef.current=!0}),ref:u,style:{...l.style,userSelect:d?"text":void 0,WebkitUserSelect:d?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),QF="HoverCardArrow",WF=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,...o}=e,r=ly(n);return b($s,{...r,...o,ref:t})});WF.displayName=QF;function ld(e){return t=>t.pointerType==="touch"?void 0:e()}function JF(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var CA=EA;const eX=p.forwardRef(({className:e,align:t="center",sideOffset:n=4,...o},r)=>b(CA,{ref:r,align:t,sideOffset:n,className:X("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]",e),...o}));eX.displayName=CA.displayName;const tX=p.forwardRef(({className:e,type:t,...n},o)=>b("input",{type:t,className:X("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...n}));tX.displayName="Input";var nX=Object.defineProperty,oX=Object.defineProperties,rX=Object.getOwnPropertyDescriptors,sd=Object.getOwnPropertySymbols,NA=Object.prototype.hasOwnProperty,_A=Object.prototype.propertyIsEnumerable,fx=(e,t,n)=>t in e?nX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aX=(e,t)=>{for(var n in t||(t={}))NA.call(t,n)&&fx(e,n,t[n]);if(sd)for(var n of sd(t))_A.call(t,n)&&fx(e,n,t[n]);return e},iX=(e,t)=>oX(e,rX(t)),lX=(e,t)=>{var n={};for(var o in e)NA.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&sd)for(var o of sd(e))t.indexOf(o)<0&&_A.call(e,o)&&(n[o]=e[o]);return n};function sX(e){let t=setTimeout(e,0),n=setTimeout(e,10),o=setTimeout(e,50);return[t,n,o]}function cX(e){let t=p.useRef();return p.useEffect(()=>{t.current=e}),t.current}var uX=18,RA=40,dX=`${RA}px`,fX=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function pX({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:o}){let[r,a]=p.useState(!1),[i,l]=p.useState(!1),[s,c]=p.useState(!1),f=p.useMemo(()=>n==="none"?!1:(n==="increase-width"||n==="experimental-no-flickering")&&r&&i,[r,i,n]),u=p.useCallback(()=>{let d=e.current,m=t.current;if(!d||!m||s||n==="none")return;let v=d,g=v.getBoundingClientRect().left+v.offsetWidth,x=v.getBoundingClientRect().top+v.offsetHeight/2,h=g-uX,w=x;document.querySelectorAll(fX).length===0&&document.elementFromPoint(h,w)===d||(a(!0),c(!0))},[e,t,s,n]);return p.useEffect(()=>{let d=e.current;if(!d||n==="none")return;function m(){let g=window.innerWidth-d.getBoundingClientRect().right;l(g>=RA)}m();let v=setInterval(m,1e3);return()=>{clearInterval(v)}},[e,n]),p.useEffect(()=>{let d=o||document.activeElement===t.current;if(n==="none"||!d)return;let m=setTimeout(u,0),v=setTimeout(u,2e3),g=setTimeout(u,5e3),x=setTimeout(()=>{c(!0)},6e3);return()=>{clearTimeout(m),clearTimeout(v),clearTimeout(g),clearTimeout(x)}},[t,o,n,u]),{hasPWMBadge:r,willPushPWMBadge:f,PWM_BADGE_SPACE_WIDTH:dX}}var TA=p.createContext({}),AA=p.forwardRef((e,t)=>{var n=e,{value:o,onChange:r,maxLength:a,textAlign:i="left",pattern:l,placeholder:s,inputMode:c="numeric",onComplete:f,pushPasswordManagerStrategy:u="increase-width",pasteTransformer:d,containerClassName:m,noScriptCSSFallback:v=mX,render:g,children:x}=n,h=lX(n,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),w,y,S,E,N;let[C,A]=p.useState(typeof h.defaultValue=="string"?h.defaultValue:""),T=o??C,k=cX(T),z=p.useCallback(Q=>{r==null||r(Q),A(Q)},[r]),O=p.useMemo(()=>l?typeof l=="string"?new RegExp(l):l:null,[l]),P=p.useRef(null),_=p.useRef(null),L=p.useRef({value:T,onChange:z,isIOS:typeof window<"u"&&((y=(w=window==null?void 0:window.CSS)==null?void 0:w.supports)==null?void 0:y.call(w,"-webkit-touch-callout","none"))}),R=p.useRef({prev:[(S=P.current)==null?void 0:S.selectionStart,(E=P.current)==null?void 0:E.selectionEnd,(N=P.current)==null?void 0:N.selectionDirection]});p.useImperativeHandle(t,()=>P.current,[]),p.useEffect(()=>{let Q=P.current,ne=_.current;if(!Q||!ne)return;L.current.value!==Q.value&&L.current.onChange(Q.value),R.current.prev=[Q.selectionStart,Q.selectionEnd,Q.selectionDirection];function ae(){if(document.activeElement!==Q){$(null),V(null);return}let ue=Q.selectionStart,_e=Q.selectionEnd,je=Q.selectionDirection,Ve=Q.maxLength,nt=Q.value,gt=R.current.prev,vt=-1,st=-1,yt;if(nt.length!==0&&ue!==null&&_e!==null){let yr=ue===_e,br=ue===nt.length&&nt.length<Ve;if(yr&&!br){let Et=ue;if(Et===0)vt=0,st=1,yt="forward";else if(Et===Ve)vt=Et-1,st=Et,yt="backward";else if(Ve>1&&nt.length>1){let wr=0;if(gt[0]!==null&&gt[1]!==null){yt=Et<gt[1]?"backward":"forward";let Ui=gt[0]===gt[1]&&gt[0]<Ve;yt==="backward"&&!Ui&&(wr=-1)}vt=wr+Et,st=wr+Et+1}}vt!==-1&&st!==-1&&vt!==st&&P.current.setSelectionRange(vt,st,yt)}let vr=vt!==-1?vt:ue,_o=st!==-1?st:_e,Wt=yt??je;$(vr),V(_o),R.current.prev=[vr,_o,Wt]}if(document.addEventListener("selectionchange",ae,{capture:!0}),ae(),document.activeElement===Q&&U(!0),!document.getElementById("input-otp-style")){let ue=document.createElement("style");if(ue.id="input-otp-style",document.head.appendChild(ue),ue.sheet){let _e="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";el(ue.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),el(ue.sheet,`[data-input-otp]:autofill { ${_e} }`),el(ue.sheet,`[data-input-otp]:-webkit-autofill { ${_e} }`),el(ue.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),el(ue.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let ce=()=>{ne&&ne.style.setProperty("--root-height",`${Q.clientHeight}px`)};ce();let fe=new ResizeObserver(ce);return fe.observe(Q),()=>{document.removeEventListener("selectionchange",ae,{capture:!0}),fe.disconnect()}},[]);let[I,D]=p.useState(!1),[M,U]=p.useState(!1),[F,$]=p.useState(null),[H,V]=p.useState(null);p.useEffect(()=>{sX(()=>{var Q,ne,ae,ce;(Q=P.current)==null||Q.dispatchEvent(new Event("input"));let fe=(ne=P.current)==null?void 0:ne.selectionStart,ue=(ae=P.current)==null?void 0:ae.selectionEnd,_e=(ce=P.current)==null?void 0:ce.selectionDirection;fe!==null&&ue!==null&&($(fe),V(ue),R.current.prev=[fe,ue,_e])})},[T,M]),p.useEffect(()=>{k!==void 0&&T!==k&&k.length<a&&T.length===a&&(f==null||f(T))},[a,f,k,T]);let Y=pX({containerRef:_,inputRef:P,pushPasswordManagerStrategy:u,isFocused:M}),q=p.useCallback(Q=>{let ne=Q.currentTarget.value.slice(0,a);if(ne.length>0&&O&&!O.test(ne)){Q.preventDefault();return}typeof k=="string"&&ne.length<k.length&&document.dispatchEvent(new Event("selectionchange")),z(ne)},[a,z,k,O]),B=p.useCallback(()=>{var Q;if(P.current){let ne=Math.min(P.current.value.length,a-1),ae=P.current.value.length;(Q=P.current)==null||Q.setSelectionRange(ne,ae),$(ne),V(ae)}U(!0)},[a]),G=p.useCallback(Q=>{var ne,ae;let ce=P.current;if(!d&&(!L.current.isIOS||!Q.clipboardData||!ce))return;let fe=Q.clipboardData.getData("text/plain"),ue=d?d(fe):fe;Q.preventDefault();let _e=(ne=P.current)==null?void 0:ne.selectionStart,je=(ae=P.current)==null?void 0:ae.selectionEnd,Ve=(_e!==je?T.slice(0,_e)+ue+T.slice(je):T.slice(0,_e)+ue+T.slice(_e)).slice(0,a);if(Ve.length>0&&O&&!O.test(Ve))return;ce.value=Ve,z(Ve);let nt=Math.min(Ve.length,a-1),gt=Ve.length;ce.setSelectionRange(nt,gt),$(nt),V(gt)},[a,z,O,T]),Z=p.useMemo(()=>({position:"relative",cursor:h.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[h.disabled]),ee=p.useMemo(()=>({position:"absolute",inset:0,width:Y.willPushPWMBadge?`calc(100% + ${Y.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:Y.willPushPWMBadge?`inset(0 ${Y.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:i,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[Y.PWM_BADGE_SPACE_WIDTH,Y.willPushPWMBadge,i]),te=p.useMemo(()=>p.createElement("input",iX(aX({autoComplete:h.autoComplete||"one-time-code"},h),{"data-input-otp":!0,"data-input-otp-placeholder-shown":T.length===0||void 0,"data-input-otp-mss":F,"data-input-otp-mse":H,inputMode:c,pattern:O==null?void 0:O.source,"aria-placeholder":s,style:ee,maxLength:a,value:T,ref:P,onPaste:Q=>{var ne;G(Q),(ne=h.onPaste)==null||ne.call(h,Q)},onChange:q,onMouseOver:Q=>{var ne;D(!0),(ne=h.onMouseOver)==null||ne.call(h,Q)},onMouseLeave:Q=>{var ne;D(!1),(ne=h.onMouseLeave)==null||ne.call(h,Q)},onFocus:Q=>{var ne;B(),(ne=h.onFocus)==null||ne.call(h,Q)},onBlur:Q=>{var ne;U(!1),(ne=h.onBlur)==null||ne.call(h,Q)}})),[q,B,G,c,ee,a,H,F,h,O==null?void 0:O.source,T]),K=p.useMemo(()=>({slots:Array.from({length:a}).map((Q,ne)=>{var ae;let ce=M&&F!==null&&H!==null&&(F===H&&ne===F||ne>=F&&ne<H),fe=T[ne]!==void 0?T[ne]:null,ue=T[0]!==void 0?null:(ae=s==null?void 0:s[ne])!=null?ae:null;return{char:fe,placeholderChar:ue,isActive:ce,hasFakeCaret:ce&&fe===null}}),isFocused:M,isHovering:!h.disabled&&I}),[M,I,a,H,F,h.disabled,T]),W=p.useMemo(()=>g?g(K):p.createElement(TA.Provider,{value:K},x),[x,K,g]);return p.createElement(p.Fragment,null,v!==null&&p.createElement("noscript",null,p.createElement("style",null,v)),p.createElement("div",{ref:_,"data-input-otp-container":!0,style:Z,className:m},W,p.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},te)))});AA.displayName="Input";function el(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var mX=`
203
- [data-input-otp] {
204
- --nojs-bg: white !important;
205
- --nojs-fg: black !important;
206
-
207
- background-color: var(--nojs-bg) !important;
208
- color: var(--nojs-fg) !important;
209
- caret-color: var(--nojs-fg) !important;
210
- letter-spacing: .25em !important;
211
- text-align: center !important;
212
- border: 1px solid var(--nojs-fg) !important;
213
- border-radius: 4px !important;
214
- width: 100% !important;
215
- }
216
- @media (prefers-color-scheme: dark) {
217
- [data-input-otp] {
218
- --nojs-bg: black !important;
219
- --nojs-fg: white !important;
220
- }
221
- }`;const hX=p.forwardRef(({className:e,containerClassName:t,...n},o)=>b(AA,{ref:o,containerClassName:X("flex items-center gap-2 has-[:disabled]:opacity-50",t),className:X("disabled:cursor-not-allowed",e),...n}));hX.displayName="InputOTP";const gX=p.forwardRef(({className:e,...t},n)=>b("div",{ref:n,className:X("flex items-center",e),...t}));gX.displayName="InputOTPGroup";const vX=p.forwardRef(({index:e,className:t,...n},o)=>{const r=p.useContext(TA),{char:a,hasFakeCaret:i,isActive:l}=r.slots[e];return re("div",{ref:o,className:X("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",l&&"z-10 ring-2 ring-ring ring-offset-background",t),...n,children:[a,i&&b("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:b("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});vX.displayName="InputOTPSlot";const yX=p.forwardRef(({...e},t)=>b("div",{ref:t,role:"separator",...e,children:b(U6,{})}));yX.displayName="InputOTPSeparator";var Fs="Menubar",[xh,bX,wX]=So(Fs),[MA,UQ]=Ue(Fs,[wX,Xn]),It=Vs(),DA=Xn(),[xX,OA]=MA(Fs),PA=p.forwardRef((e,t)=>{const{__scopeMenubar:n,value:o,onValueChange:r,defaultValue:a,loop:i=!0,dir:l,...s}=e,c=Eo(l),f=DA(n),[u,d]=ht({prop:o,onChange:r,defaultProp:a??"",caller:Fs}),[m,v]=p.useState(null);return b(xX,{scope:n,value:u,onMenuOpen:p.useCallback(g=>{d(g),v(g)},[d]),onMenuClose:p.useCallback(()=>d(""),[d]),onMenuToggle:p.useCallback(g=>{d(x=>x?"":g),v(g)},[d]),dir:c,loop:i,children:b(xh.Provider,{scope:n,children:b(xh.Slot,{scope:n,children:b(Bs,{asChild:!0,...f,orientation:"horizontal",loop:i,dir:c,currentTabStopId:m,onCurrentTabStopIdChange:v,children:b(oe.div,{role:"menubar",...s,ref:t})})})})})});PA.displayName=Fs;var SX="MenubarMenu",[VQ,zA]=MA(SX),Sh="MenubarTrigger",IA=p.forwardRef((e,t)=>{const{__scopeMenubar:n,disabled:o=!1,...r}=e,a=DA(n),i=It(n),l=OA(Sh,n),s=zA(Sh,n),c=p.useRef(null),f=le(t,c,s.triggerRef),[u,d]=p.useState(!1),m=l.value===s.value;return b(xh.ItemSlot,{scope:n,value:s.value,disabled:o,children:b(Us,{asChild:!0,...a,focusable:!o,tabStopId:s.value,children:b(Kv,{asChild:!0,...i,children:b(oe.button,{type:"button",role:"menuitem",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?s.contentId:void 0,"data-highlighted":u?"":void 0,"data-state":m?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:f,onPointerDown:j(e.onPointerDown,v=>{!o&&v.button===0&&v.ctrlKey===!1&&(l.onMenuOpen(s.value),m||v.preventDefault())}),onPointerEnter:j(e.onPointerEnter,()=>{var g;!!l.value&&!m&&(l.onMenuOpen(s.value),(g=c.current)==null||g.focus())}),onKeyDown:j(e.onKeyDown,v=>{o||(["Enter"," "].includes(v.key)&&l.onMenuToggle(s.value),v.key==="ArrowDown"&&l.onMenuOpen(s.value),["Enter"," ","ArrowDown"].includes(v.key)&&(s.wasKeyboardTriggerOpenRef.current=!0,v.preventDefault()))}),onFocus:j(e.onFocus,()=>d(!0)),onBlur:j(e.onBlur,()=>d(!1))})})})})});IA.displayName=Sh;var EX="MenubarPortal",LA=e=>{const{__scopeMenubar:t,...n}=e,o=It(t);return b(jv,{...o,...n})};LA.displayName=EX;var Eh="MenubarContent",kA=p.forwardRef((e,t)=>{const{__scopeMenubar:n,align:o="start",...r}=e,a=It(n),i=OA(Eh,n),l=zA(Eh,n),s=bX(n),c=p.useRef(!1);return b(qv,{id:l.contentId,"aria-labelledby":l.triggerId,"data-radix-menubar-content":"",...a,...r,ref:t,align:o,onCloseAutoFocus:j(e.onCloseAutoFocus,f=>{var d;!!!i.value&&!c.current&&((d=l.triggerRef.current)==null||d.focus()),c.current=!1,f.preventDefault()}),onFocusOutside:j(e.onFocusOutside,f=>{const u=f.target;s().some(m=>{var v;return(v=m.ref.current)==null?void 0:v.contains(u)})&&f.preventDefault()}),onInteractOutside:j(e.onInteractOutside,()=>{c.current=!0}),onEntryFocus:f=>{l.wasKeyboardTriggerOpenRef.current||f.preventDefault()},onKeyDown:j(e.onKeyDown,f=>{if(["ArrowRight","ArrowLeft"].includes(f.key)){const u=f.target,d=u.hasAttribute("data-radix-menubar-subtrigger"),m=u.closest("[data-radix-menubar-content]")!==f.currentTarget,g=(i.dir==="rtl"?"ArrowRight":"ArrowLeft")===f.key;if(!g&&d||m&&g)return;let w=s().filter(E=>!E.disabled).map(E=>E.value);g&&w.reverse();const y=w.indexOf(l.value);w=i.loop?$X(w,y+1):w.slice(y+1);const[S]=w;S&&i.onMenuOpen(S)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});kA.displayName=Eh;var CX="MenubarGroup",NX=p.forwardRef((e,t)=>{const{__scopeMenubar:n,...o}=e,r=It(n);return b(Zv,{...r,...o,ref:t})});NX.displayName=CX;var _X="MenubarLabel",$A=p.forwardRef((e,t)=>{const{__scopeMenubar:n,...o}=e,r=It(n);return b(Qv,{...r,...o,ref:t})});$A.displayName=_X;var RX="MenubarItem",HA=p.forwardRef((e,t)=>{const{__scopeMenubar:n,...o}=e,r=It(n);return b(Wv,{...r,...o,ref:t})});HA.displayName=RX;var TX="MenubarCheckboxItem",BA=p.forwardRef((e,t)=>{const{__scopeMenubar:n,...o}=e,r=It(n);return b(Jv,{...r,...o,ref:t})});BA.displayName=TX;var AX="MenubarRadioGroup",MX=p.forwardRef((e,t)=>{const{__scopeMenubar:n,...o}=e,r=It(n);return b(ey,{...r,...o,ref:t})});MX.displayName=AX;var DX="MenubarRadioItem",UA=p.forwardRef((e,t)=>{const{__scopeMenubar:n,...o}=e,r=It(n);return b(ty,{...r,...o,ref:t})});UA.displayName=DX;var OX="MenubarItemIndicator",VA=p.forwardRef((e,t)=>{const{__scopeMenubar:n,...o}=e,r=It(n);return b(ny,{...r,...o,ref:t})});VA.displayName=OX;var PX="MenubarSeparator",GA=p.forwardRef((e,t)=>{const{__scopeMenubar:n,...o}=e,r=It(n);return b(oy,{...r,...o,ref:t})});GA.displayName=PX;var zX="MenubarArrow",IX=p.forwardRef((e,t)=>{const{__scopeMenubar:n,...o}=e,r=It(n);return b(ry,{...r,...o,ref:t})});IX.displayName=zX;var LX="MenubarSubTrigger",YA=p.forwardRef((e,t)=>{const{__scopeMenubar:n,...o}=e,r=It(n);return b(ay,{"data-radix-menubar-subtrigger":"",...r,...o,ref:t})});YA.displayName=LX;var kX="MenubarSubContent",FA=p.forwardRef((e,t)=>{const{__scopeMenubar:n,...o}=e,r=It(n);return b(iy,{...r,"data-radix-menubar-content":"",...o,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});FA.displayName=kX;function $X(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var XA=PA,KA=IA,HX=LA,jA=kA,qA=$A,ZA=HA,QA=BA,WA=UA,JA=VA,eM=GA,tM=YA,nM=FA;const BX=p.forwardRef(({className:e,...t},n)=>b(XA,{ref:n,className:X("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",e),...t}));BX.displayName=XA.displayName;const UX=p.forwardRef(({className:e,...t},n)=>b(KA,{ref:n,className:X("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e),...t}));UX.displayName=KA.displayName;const VX=p.forwardRef(({className:e,inset:t,children:n,...o},r)=>re(tM,{ref:r,className:X("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[n,b(pv,{className:"ml-auto h-4 w-4"})]}));VX.displayName=tM.displayName;const GX=p.forwardRef(({className:e,...t},n)=>b(nM,{ref:n,className:X("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",e),...t}));GX.displayName=nM.displayName;const YX=p.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:o=8,...r},a)=>b(HX,{children:b(jA,{ref:a,align:t,alignOffset:n,sideOffset:o,className:X("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",e),...r})}));YX.displayName=jA.displayName;const FX=p.forwardRef(({className:e,inset:t,...n},o)=>b(ZA,{ref:o,className:X("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));FX.displayName=ZA.displayName;const XX=p.forwardRef(({className:e,children:t,checked:n,...o},r)=>re(QA,{ref:r,className:X("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[b("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b(JA,{children:b(As,{className:"h-4 w-4"})})}),t]}));XX.displayName=QA.displayName;const KX=p.forwardRef(({className:e,children:t,...n},o)=>re(WA,{ref:o,className:X("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[b("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b(JA,{children:b(ef,{className:"h-2 w-2 fill-current"})})}),t]}));KX.displayName=WA.displayName;const jX=p.forwardRef(({className:e,inset:t,...n},o)=>b(qA,{ref:o,className:X("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));jX.displayName=qA.displayName;const qX=p.forwardRef(({className:e,...t},n)=>b(eM,{ref:n,className:X("-mx-1 my-1 h-px bg-muted",e),...t}));qX.displayName=eM.displayName;var oM=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"}),ZX="VisuallyHidden",yf=p.forwardRef((e,t)=>b(oe.span,{...e,ref:t,style:{...oM,...e.style}}));yf.displayName=ZX;var rM=yf,da="NavigationMenu",[cy,aM,QX]=So(da),[Ch,WX,JX]=So(da),[uy,GQ]=Ue(da,[QX,JX]),[eK,fn]=uy(da),[tK,nK]=uy(da),iM=p.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:a,delayDuration:i=200,skipDelayDuration:l=300,orientation:s="horizontal",dir:c,...f}=e,[u,d]=p.useState(null),m=le(t,T=>d(T)),v=Eo(c),g=p.useRef(0),x=p.useRef(0),h=p.useRef(0),[w,y]=p.useState(!0),[S,E]=ht({prop:o,onChange:T=>{const k=T!=="",z=l>0;k?(window.clearTimeout(h.current),z&&y(!1)):(window.clearTimeout(h.current),h.current=window.setTimeout(()=>y(!0),l)),r==null||r(T)},defaultProp:a??"",caller:da}),N=p.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>E(""),150)},[E]),C=p.useCallback(T=>{window.clearTimeout(x.current),E(T)},[E]),A=p.useCallback(T=>{S===T?window.clearTimeout(x.current):g.current=window.setTimeout(()=>{window.clearTimeout(x.current),E(T)},i)},[S,E,i]);return p.useEffect(()=>()=>{window.clearTimeout(g.current),window.clearTimeout(x.current),window.clearTimeout(h.current)},[]),b(lM,{scope:n,isRootMenu:!0,value:S,dir:v,orientation:s,rootNavigationMenu:u,onTriggerEnter:T=>{window.clearTimeout(g.current),w?A(T):C(T)},onTriggerLeave:()=>{window.clearTimeout(g.current),N()},onContentEnter:()=>window.clearTimeout(x.current),onContentLeave:N,onItemSelect:T=>{E(k=>k===T?"":T)},onItemDismiss:()=>E(""),children:b(oe.nav,{"aria-label":"Main","data-orientation":s,dir:v,...f,ref:m})})});iM.displayName=da;var Nh="NavigationMenuSub",oK=p.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:a,orientation:i="horizontal",...l}=e,s=fn(Nh,n),[c,f]=ht({prop:o,onChange:r,defaultProp:a??"",caller:Nh});return b(lM,{scope:n,isRootMenu:!1,value:c,dir:s.dir,orientation:i,rootNavigationMenu:s.rootNavigationMenu,onTriggerEnter:u=>f(u),onItemSelect:u=>f(u),onItemDismiss:()=>f(""),children:b(oe.div,{"data-orientation":i,...l,ref:t})})});oK.displayName=Nh;var lM=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:o,dir:r,orientation:a,children:i,value:l,onItemSelect:s,onItemDismiss:c,onTriggerEnter:f,onTriggerLeave:u,onContentEnter:d,onContentLeave:m}=e,[v,g]=p.useState(null),[x,h]=p.useState(new Map),[w,y]=p.useState(null);return b(eK,{scope:t,isRootMenu:n,rootNavigationMenu:o,value:l,previousValue:Ii(l),baseId:mt(),dir:r,orientation:a,viewport:v,onViewportChange:g,indicatorTrack:w,onIndicatorTrackChange:y,onTriggerEnter:Ae(f),onTriggerLeave:Ae(u),onContentEnter:Ae(d),onContentLeave:Ae(m),onItemSelect:Ae(s),onItemDismiss:Ae(c),onViewportContentChange:p.useCallback((S,E)=>{h(N=>(N.set(S,E),new Map(N)))},[]),onViewportContentRemove:p.useCallback(S=>{h(E=>E.has(S)?(E.delete(S),new Map(E)):E)},[]),children:b(cy.Provider,{scope:t,children:b(tK,{scope:t,items:x,children:i})})})},sM="NavigationMenuList",cM=p.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=fn(sM,n),a=b(oe.ul,{"data-orientation":r.orientation,...o,ref:t});return b(oe.div,{style:{position:"relative"},ref:r.onIndicatorTrackChange,children:b(cy.Slot,{scope:n,children:r.isRootMenu?b(vM,{asChild:!0,children:a}):a})})});cM.displayName=sM;var uM="NavigationMenuItem",[rK,dM]=uy(uM),aK=p.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,...r}=e,a=mt(),i=o||a||"LEGACY_REACT_AUTO_VALUE",l=p.useRef(null),s=p.useRef(null),c=p.useRef(null),f=p.useRef(()=>{}),u=p.useRef(!1),d=p.useCallback((v="start")=>{if(l.current){f.current();const g=Rh(l.current);g.length&&py(v==="start"?g:g.reverse())}},[]),m=p.useCallback(()=>{if(l.current){const v=Rh(l.current);v.length&&(f.current=pK(v))}},[]);return b(rK,{scope:n,value:i,triggerRef:s,contentRef:l,focusProxyRef:c,wasEscapeCloseRef:u,onEntryKeyDown:d,onFocusProxyEnter:d,onRootContentClose:m,onContentFocusOutside:m,children:b(oe.li,{...r,ref:t})})});aK.displayName=uM;var _h="NavigationMenuTrigger",fM=p.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:o,...r}=e,a=fn(_h,e.__scopeNavigationMenu),i=dM(_h,e.__scopeNavigationMenu),l=p.useRef(null),s=le(l,i.triggerRef,t),c=bM(a.baseId,i.value),f=wM(a.baseId,i.value),u=p.useRef(!1),d=p.useRef(!1),m=i.value===a.value;return re(De,{children:[b(cy.ItemSlot,{scope:n,value:i.value,children:b(yM,{asChild:!0,children:b(oe.button,{id:c,disabled:o,"data-disabled":o?"":void 0,"data-state":my(m),"aria-expanded":m,"aria-controls":f,...r,ref:s,onPointerEnter:j(e.onPointerEnter,()=>{d.current=!1,i.wasEscapeCloseRef.current=!1}),onPointerMove:j(e.onPointerMove,cd(()=>{o||d.current||i.wasEscapeCloseRef.current||u.current||(a.onTriggerEnter(i.value),u.current=!0)})),onPointerLeave:j(e.onPointerLeave,cd(()=>{o||(a.onTriggerLeave(),u.current=!1)})),onClick:j(e.onClick,()=>{a.onItemSelect(i.value),d.current=m}),onKeyDown:j(e.onKeyDown,v=>{const x={horizontal:"ArrowDown",vertical:a.dir==="rtl"?"ArrowLeft":"ArrowRight"}[a.orientation];m&&v.key===x&&(i.onEntryKeyDown(),v.preventDefault())})})})}),m&&re(De,{children:[b(rM,{"aria-hidden":!0,tabIndex:0,ref:i.focusProxyRef,onFocus:v=>{const g=i.contentRef.current,x=v.relatedTarget,h=x===l.current,w=g==null?void 0:g.contains(x);(h||!w)&&i.onFocusProxyEnter(h?"start":"end")}}),a.viewport&&b("span",{"aria-owns":f})]})]})});fM.displayName=_h;var iK="NavigationMenuLink",px="navigationMenu.linkSelect",lK=p.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:o,onSelect:r,...a}=e;return b(yM,{asChild:!0,children:b(oe.a,{"data-active":o?"":void 0,"aria-current":o?"page":void 0,...a,ref:t,onClick:j(e.onClick,i=>{const l=i.target,s=new CustomEvent(px,{bubbles:!0,cancelable:!0});if(l.addEventListener(px,c=>r==null?void 0:r(c),{once:!0}),ns(l,s),!s.defaultPrevented&&!i.metaKey){const c=new CustomEvent(ru,{bubbles:!0,cancelable:!0});ns(l,c)}},{checkForDefaultPrevented:!1})})})});lK.displayName=iK;var dy="NavigationMenuIndicator",pM=p.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=fn(dy,e.__scopeNavigationMenu),a=!!r.value;return r.indicatorTrack?Vx.createPortal(b(Pe,{present:n||a,children:b(sK,{...o,ref:t})}),r.indicatorTrack):null});pM.displayName=dy;var sK=p.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=fn(dy,n),a=aM(n),[i,l]=p.useState(null),[s,c]=p.useState(null),f=r.orientation==="horizontal",u=!!r.value;p.useEffect(()=>{var g;const v=(g=a().find(x=>x.value===r.value))==null?void 0:g.ref.current;v&&l(v)},[a,r.value]);const d=()=>{i&&c({size:f?i.offsetWidth:i.offsetHeight,offset:f?i.offsetLeft:i.offsetTop})};return Th(i,d),Th(r.indicatorTrack,d),s?b(oe.div,{"aria-hidden":!0,"data-state":u?"visible":"hidden","data-orientation":r.orientation,...o,ref:t,style:{position:"absolute",...f?{left:0,width:s.size+"px",transform:`translateX(${s.offset}px)`}:{top:0,height:s.size+"px",transform:`translateY(${s.offset}px)`},...o.style}}):null}),wi="NavigationMenuContent",mM=p.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=fn(wi,e.__scopeNavigationMenu),a=dM(wi,e.__scopeNavigationMenu),i=le(a.contentRef,t),l=a.value===r.value,s={value:a.value,triggerRef:a.triggerRef,focusProxyRef:a.focusProxyRef,wasEscapeCloseRef:a.wasEscapeCloseRef,onContentFocusOutside:a.onContentFocusOutside,onRootContentClose:a.onRootContentClose,...o};return r.viewport?b(cK,{forceMount:n,...s,ref:i}):b(Pe,{present:n||l,children:b(hM,{"data-state":my(l),...s,ref:i,onPointerEnter:j(e.onPointerEnter,r.onContentEnter),onPointerLeave:j(e.onPointerLeave,cd(r.onContentLeave)),style:{pointerEvents:!l&&r.isRootMenu?"none":void 0,...s.style}})})});mM.displayName=wi;var cK=p.forwardRef((e,t)=>{const n=fn(wi,e.__scopeNavigationMenu),{onViewportContentChange:o,onViewportContentRemove:r}=n;return He(()=>{o(e.value,{ref:t,...e})},[e,t,o]),He(()=>()=>r(e.value),[e.value,r]),null}),ru="navigationMenu.rootContentDismiss",hM=p.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,triggerRef:r,focusProxyRef:a,wasEscapeCloseRef:i,onRootContentClose:l,onContentFocusOutside:s,...c}=e,f=fn(wi,n),u=p.useRef(null),d=le(u,t),m=bM(f.baseId,o),v=wM(f.baseId,o),g=aM(n),x=p.useRef(null),{onItemDismiss:h}=f;p.useEffect(()=>{const y=u.current;if(f.isRootMenu&&y){const S=()=>{var E;h(),l(),y.contains(document.activeElement)&&((E=r.current)==null||E.focus())};return y.addEventListener(ru,S),()=>y.removeEventListener(ru,S)}},[f.isRootMenu,e.value,r,h,l]);const w=p.useMemo(()=>{const S=g().map(k=>k.value);f.dir==="rtl"&&S.reverse();const E=S.indexOf(f.value),N=S.indexOf(f.previousValue),C=o===f.value,A=N===S.indexOf(o);if(!C&&!A)return x.current;const T=(()=>{if(E!==N){if(C&&N!==-1)return E>N?"from-end":"from-start";if(A&&E!==-1)return E>N?"to-start":"to-end"}return null})();return x.current=T,T},[f.previousValue,f.value,f.dir,g,o]);return b(vM,{asChild:!0,children:b(Co,{id:v,"aria-labelledby":m,"data-motion":w,"data-orientation":f.orientation,...c,ref:d,disableOutsidePointerEvents:!1,onDismiss:()=>{var S;const y=new Event(ru,{bubbles:!0,cancelable:!0});(S=u.current)==null||S.dispatchEvent(y)},onFocusOutside:j(e.onFocusOutside,y=>{var E;s();const S=y.target;(E=f.rootNavigationMenu)!=null&&E.contains(S)&&y.preventDefault()}),onPointerDownOutside:j(e.onPointerDownOutside,y=>{var C;const S=y.target,E=g().some(A=>{var T;return(T=A.ref.current)==null?void 0:T.contains(S)}),N=f.isRootMenu&&((C=f.viewport)==null?void 0:C.contains(S));(E||N||!f.isRootMenu)&&y.preventDefault()}),onKeyDown:j(e.onKeyDown,y=>{var N;const S=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!S){const C=Rh(y.currentTarget),A=document.activeElement,T=C.findIndex(O=>O===A),z=y.shiftKey?C.slice(0,T).reverse():C.slice(T+1,C.length);py(z)?y.preventDefault():(N=a.current)==null||N.focus()}}),onEscapeKeyDown:j(e.onEscapeKeyDown,y=>{i.current=!0})})})}),fy="NavigationMenuViewport",gM=p.forwardRef((e,t)=>{const{forceMount:n,...o}=e,a=!!fn(fy,e.__scopeNavigationMenu).value;return b(Pe,{present:n||a,children:b(uK,{...o,ref:t})})});gM.displayName=fy;var uK=p.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:o,...r}=e,a=fn(fy,n),i=le(t,a.onViewportChange),l=nK(wi,e.__scopeNavigationMenu),[s,c]=p.useState(null),[f,u]=p.useState(null),d=s?(s==null?void 0:s.width)+"px":void 0,m=s?(s==null?void 0:s.height)+"px":void 0,v=!!a.value,g=v?a.value:a.previousValue;return Th(f,()=>{f&&c({width:f.offsetWidth,height:f.offsetHeight})}),b(oe.div,{"data-state":my(v),"data-orientation":a.orientation,...r,ref:i,style:{pointerEvents:!v&&a.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":d,"--radix-navigation-menu-viewport-height":m,...r.style},onPointerEnter:j(e.onPointerEnter,a.onContentEnter),onPointerLeave:j(e.onPointerLeave,cd(a.onContentLeave)),children:Array.from(l.items).map(([h,{ref:w,forceMount:y,...S}])=>{const E=g===h;return b(Pe,{present:y||E,children:b(hM,{...S,ref:Sn(w,N=>{E&&N&&u(N)})})},h)})})}),dK="FocusGroup",vM=p.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=fn(dK,n);return b(Ch.Provider,{scope:n,children:b(Ch.Slot,{scope:n,children:b(oe.div,{dir:r.dir,...o,ref:t})})})}),mx=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],fK="FocusGroupItem",yM=p.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=WX(n),a=fn(fK,n);return b(Ch.ItemSlot,{scope:n,children:b(oe.button,{...o,ref:t,onKeyDown:j(e.onKeyDown,i=>{if(["Home","End",...mx].includes(i.key)){let s=r().map(u=>u.ref.current);if([a.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(i.key)&&s.reverse(),mx.includes(i.key)){const u=s.indexOf(i.currentTarget);s=s.slice(u+1)}setTimeout(()=>py(s)),i.preventDefault()}})})})});function Rh(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function py(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function pK(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function Th(e,t){const n=Ae(t);He(()=>{let o=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}},[e,n])}function my(e){return e?"open":"closed"}function bM(e,t){return`${e}-trigger-${t}`}function wM(e,t){return`${e}-content-${t}`}function cd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var xM=iM,SM=cM,EM=fM,CM=pM,NM=mM,_M=gM;const mK=p.forwardRef(({className:e,children:t,...n},o)=>re(xM,{ref:o,className:X("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,b(RM,{})]}));mK.displayName=xM.displayName;const hK=p.forwardRef(({className:e,...t},n)=>b(SM,{ref:n,className:X("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));hK.displayName=SM.displayName;const gK=aa("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"),vK=p.forwardRef(({className:e,children:t,...n},o)=>re(EM,{ref:o,className:X(gK(),"group",e),...n,children:[t," ",b(Jd,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));vK.displayName=EM.displayName;const yK=p.forwardRef(({className:e,...t},n)=>b(NM,{ref:n,className:X("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",e),...t}));yK.displayName=NM.displayName;const RM=p.forwardRef(({className:e,...t},n)=>b("div",{className:X("absolute left-0 top-full flex justify-center"),children:b(_M,{className:X("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:n,...t})}));RM.displayName=_M.displayName;const bK=p.forwardRef(({className:e,...t},n)=>b(CM,{ref:n,className:X("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:b("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));bK.displayName=CM.displayName;const wK=p.forwardRef(({className:e,...t},n)=>b("ul",{ref:n,className:X("flex flex-row items-center gap-1",e),...t}));wK.displayName="PaginationContent";const xK=p.forwardRef(({className:e,...t},n)=>b("li",{ref:n,className:X("",e),...t}));xK.displayName="PaginationItem";var TM="Popover",[AM,YQ]=Ue(TM,[Fn]),bf=Fn(),[FQ,pr]=AM(TM),MM="PopoverAnchor",SK=p.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=pr(MM,n),a=bf(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=r;return p.useEffect(()=>(i(),()=>l()),[i,l]),b($i,{...a,...o,ref:t})});SK.displayName=MM;var DM="PopoverTrigger",EK=p.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=pr(DM,n),a=bf(n),i=le(t,r.triggerRef),l=b(oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":LM(r.open),...o,ref:i,onClick:j(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?l:b($i,{asChild:!0,...a,children:l})});EK.displayName=DM;var hy="PopoverPortal",[CK,NK]=AM(hy,{forceMount:void 0}),OM=e=>{const{__scopePopover:t,forceMount:n,children:o,container:r}=e,a=pr(hy,t);return b(CK,{scope:t,forceMount:n,children:b(Pe,{present:n||a.open,children:b(ia,{asChild:!0,container:r,children:o})})})};OM.displayName=hy;var xi="PopoverContent",PM=p.forwardRef((e,t)=>{const n=NK(xi,e.__scopePopover),{forceMount:o=n.forceMount,...r}=e,a=pr(xi,e.__scopePopover);return b(Pe,{present:o||a.open,children:a.modal?b(RK,{...r,ref:t}):b(TK,{...r,ref:t})})});PM.displayName=xi;var _K=Xr("PopoverContent.RemoveScroll"),RK=p.forwardRef((e,t)=>{const n=pr(xi,e.__scopePopover),o=p.useRef(null),r=le(t,o),a=p.useRef(!1);return p.useEffect(()=>{const i=o.current;if(i)return of(i)},[]),b(Ds,{as:_K,allowPinchZoom:!0,children:b(zM,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),a.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0,c=l.button===2||s;a.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:j(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),TK=p.forwardRef((e,t)=>{const n=pr(xi,e.__scopePopover),o=p.useRef(!1),r=p.useRef(!1);return b(zM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(o.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:a=>{var s,c;(s=e.onInteractOutside)==null||s.call(e,a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=a.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),zM=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:f,...u}=e,d=pr(xi,n),m=bf(n);return tf(),b(Ms,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:b(Co,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onDismiss:()=>d.onOpenChange(!1),children:b(ks,{"data-state":LM(d.open),role:"dialog",id:d.contentId,...m,...u,ref:t,style:{...u.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)"}})})})}),IM="PopoverClose",AK=p.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=pr(IM,n);return b(oe.button,{type:"button",...o,ref:t,onClick:j(e.onClick,()=>r.onOpenChange(!1))})});AK.displayName=IM;var MK="PopoverArrow",DK=p.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=bf(n);return b($s,{...r,...o,ref:t})});DK.displayName=MK;function LM(e){return e?"open":"closed"}var OK=OM,kM=PM;const PK=p.forwardRef(({className:e,align:t="center",sideOffset:n=4,...o},r)=>b(OK,{children:b(kM,{ref:r,align:t,sideOffset:n,className:X("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...o})}));PK.displayName=kM.displayName;var gy="Progress",vy=100,[zK,XQ]=V_(gy),[IK,LK]=zK(gy),$M=p.forwardRef((e,t)=>{const{__scopeProgress:n,value:o=null,max:r,getValueLabel:a=kK,...i}=e;(r||r===0)&&!hx(r)&&console.error($K(`${r}`,"Progress"));const l=hx(r)?r:vy;o!==null&&!gx(o,l)&&console.error(HK(`${o}`,"Progress"));const s=gx(o,l)?o:null,c=ud(s)?a(s,l):void 0;return b(IK,{scope:n,value:s,max:l,children:b(St.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":ud(s)?s:void 0,"aria-valuetext":c,role:"progressbar","data-state":UM(s,l),"data-value":s??void 0,"data-max":l,...i,ref:t})})});$M.displayName=gy;var HM="ProgressIndicator",BM=p.forwardRef((e,t)=>{const{__scopeProgress:n,...o}=e,r=LK(HM,n);return b(St.div,{"data-state":UM(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...o,ref:t})});BM.displayName=HM;function kK(e,t){return`${Math.round(e/t*100)}%`}function UM(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function ud(e){return typeof e=="number"}function hx(e){return ud(e)&&!isNaN(e)&&e>0}function gx(e,t){return ud(e)&&!isNaN(e)&&e<=t&&e>=0}function $K(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${vy}\`.`}function HK(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
222
- - a positive number
223
- - less than the value passed to \`max\` (or ${vy} if no \`max\` prop is set)
224
- - \`null\` or \`undefined\` if the progress is indeterminate.
225
-
226
- Defaulting to \`null\`.`}var VM=$M,BK=BM;const UK=p.forwardRef(({className:e,value:t,...n},o)=>b(VM,{ref:o,className:X("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:b(BK,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));UK.displayName=VM.displayName;var yy="Radio",[VK,GM]=Ue(yy),[GK,YK]=VK(yy),YM=p.forwardRef((e,t)=>{const{__scopeRadio:n,name:o,checked:r=!1,required:a,disabled:i,value:l="on",onCheck:s,form:c,...f}=e,[u,d]=p.useState(null),m=le(t,x=>d(x)),v=p.useRef(!1),g=u?c||!!u.closest("form"):!0;return re(GK,{scope:n,checked:r,disabled:i,children:[b(oe.button,{type:"button",role:"radio","aria-checked":r,"data-state":jM(r),"data-disabled":i?"":void 0,disabled:i,value:l,...f,ref:m,onClick:j(e.onClick,x=>{r||s==null||s(),g&&(v.current=x.isPropagationStopped(),v.current||x.stopPropagation())})}),g&&b(KM,{control:u,bubbles:!v.current,name:o,value:l,checked:r,required:a,disabled:i,form:c,style:{transform:"translateX(-100%)"}})]})});YM.displayName=yy;var FM="RadioIndicator",XM=p.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:o,...r}=e,a=YK(FM,n);return b(Pe,{present:o||a.checked,children:b(oe.span,{"data-state":jM(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})})});XM.displayName=FM;var FK="RadioBubbleInput",KM=p.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:o=!0,...r},a)=>{const i=p.useRef(null),l=le(i,a),s=Ii(n),c=zs(t);return p.useEffect(()=>{const f=i.current;if(!f)return;const u=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&m){const v=new Event("click",{bubbles:o});m.call(f,n),f.dispatchEvent(v)}},[s,n,o]),b(oe.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:l,style:{...r.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});KM.displayName=FK;function jM(e){return e?"checked":"unchecked"}var XK=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],wf="RadioGroup",[KK,KQ]=Ue(wf,[Xn,GM]),qM=Xn(),ZM=GM(),[jK,qK]=KK(wf),QM=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:o,defaultValue:r,value:a,required:i=!1,disabled:l=!1,orientation:s,dir:c,loop:f=!0,onValueChange:u,...d}=e,m=qM(n),v=Eo(c),[g,x]=ht({prop:a,defaultProp:r??null,onChange:u,caller:wf});return b(jK,{scope:n,name:o,required:i,disabled:l,value:g,onValueChange:x,children:b(Bs,{asChild:!0,...m,orientation:s,dir:v,loop:f,children:b(oe.div,{role:"radiogroup","aria-required":i,"aria-orientation":s,"data-disabled":l?"":void 0,dir:v,...d,ref:t})})})});QM.displayName=wf;var WM="RadioGroupItem",JM=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:o,...r}=e,a=qK(WM,n),i=a.disabled||o,l=qM(n),s=ZM(n),c=p.useRef(null),f=le(t,c),u=a.value===r.value,d=p.useRef(!1);return p.useEffect(()=>{const m=g=>{XK.includes(g.key)&&(d.current=!0)},v=()=>d.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",v)}},[]),b(Us,{asChild:!0,...l,focusable:!i,active:u,children:b(YM,{disabled:i,required:a.required,checked:u,...s,...r,name:a.name,ref:f,onCheck:()=>a.onValueChange(r.value),onKeyDown:j(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:j(r.onFocus,()=>{var m;d.current&&((m=c.current)==null||m.click())})})})});JM.displayName=WM;var ZK="RadioGroupIndicator",e2=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...o}=e,r=ZM(n);return b(XM,{...r,...o,ref:t})});e2.displayName=ZK;var t2=QM,n2=JM,QK=e2;const WK=p.forwardRef(({className:e,...t},n)=>b(t2,{className:X("grid gap-2",e),...t,ref:n}));WK.displayName=t2.displayName;const JK=p.forwardRef(({className:e,...t},n)=>b(n2,{ref:n,className:X("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:b(QK,{className:"flex items-center justify-center",children:b(ef,{className:"h-2.5 w-2.5 fill-current text-current"})})}));JK.displayName=n2.displayName;const by=p.createContext(null);by.displayName="PanelGroupContext";const Vt={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandleId:"data-panel-resize-handle-id"},wy=10,Ja=p.useLayoutEffect,vx=yd.useId,ej=typeof vx=="function"?vx:()=>null;let tj=0;function o2(e=null){const t=ej(),n=p.useRef(e||t||null);return n.current===null&&(n.current=""+tj++),e??n.current}function r2({children:e,className:t="",collapsedSize:n,collapsible:o,defaultSize:r,forwardedRef:a,id:i,maxSize:l,minSize:s,onCollapse:c,onExpand:f,onResize:u,order:d,style:m,tagName:v="div",...g}){const x=p.useContext(by);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:h,expandPanel:w,getPanelSize:y,getPanelStyle:S,groupId:E,isPanelCollapsed:N,reevaluatePanelConstraints:C,registerPanel:A,resizePanel:T,unregisterPanel:k}=x,z=o2(i),O=p.useRef({callbacks:{onCollapse:c,onExpand:f,onResize:u},constraints:{collapsedSize:n,collapsible:o,defaultSize:r,maxSize:l,minSize:s},id:z,idIsFromProps:i!==void 0,order:d});p.useRef({didLogMissingDefaultSizeWarning:!1}),Ja(()=>{const{callbacks:_,constraints:L}=O.current,R={...L};O.current.id=z,O.current.idIsFromProps=i!==void 0,O.current.order=d,_.onCollapse=c,_.onExpand=f,_.onResize=u,L.collapsedSize=n,L.collapsible=o,L.defaultSize=r,L.maxSize=l,L.minSize=s,(R.collapsedSize!==L.collapsedSize||R.collapsible!==L.collapsible||R.maxSize!==L.maxSize||R.minSize!==L.minSize)&&C(O.current,R)}),Ja(()=>{const _=O.current;return A(_),()=>{k(_)}},[d,z,A,k]),p.useImperativeHandle(a,()=>({collapse:()=>{h(O.current)},expand:_=>{w(O.current,_)},getId(){return z},getSize(){return y(O.current)},isCollapsed(){return N(O.current)},isExpanded(){return!N(O.current)},resize:_=>{T(O.current,_)}}),[h,w,y,N,z,T]);const P=S(O.current,r);return p.createElement(v,{...g,children:e,className:t,id:z,style:{...P,...m},[Vt.groupId]:E,[Vt.panel]:"",[Vt.panelCollapsible]:o||void 0,[Vt.panelId]:z,[Vt.panelSize]:parseFloat(""+P.flexGrow).toFixed(1)})}const nj=p.forwardRef((e,t)=>p.createElement(r2,{...e,forwardedRef:t}));r2.displayName="Panel";nj.displayName="forwardRef(Panel)";function a2(e){return e.type==="keydown"}function i2(e){return e.type.startsWith("pointer")}function l2(e){return e.type.startsWith("mouse")}function oj(e){if(i2(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(l2(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function rj(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}const aj=1,ij=2,lj=4,sj=8;rj();let cj=new Map;function jp(e,t){cj.set(e,t)}function uj(){const[e,t]=p.useState(0);return p.useCallback(()=>t(n=>n+1),[])}function xe(e,t){if(!e)throw console.error(t),Error(t)}function Qr(e,t,n=wy){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function oo(e,t,n=wy){return Qr(e,t,n)===0}function kt(e,t,n){return Qr(e,t,n)===0}function dj(e,t,n){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++){const r=e[o],a=t[o];if(!kt(r,a,n))return!1}return!0}function Ha({panelConstraints:e,panelIndex:t,size:n}){const o=e[t];xe(o!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:r=0,collapsible:a,maxSize:i=100,minSize:l=0}=o;if(Qr(n,l)<0)if(a){const s=(r+l)/2;Qr(n,s)<0?n=r:n=l}else n=l;return n=Math.min(i,n),n=parseFloat(n.toFixed(wy)),n}function dl({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:o,prevLayout:r,trigger:a}){if(kt(e,0))return t;const i=[...t],[l,s]=o;xe(l!=null,"Invalid first pivot index"),xe(s!=null,"Invalid second pivot index");let c=0;if(a==="keyboard"){{const u=e<0?s:l,d=n[u];xe(d,`Panel constraints not found for index ${u}`);const{collapsedSize:m=0,collapsible:v,minSize:g=0}=d;if(v){const x=t[u];if(xe(x!=null,`Previous layout not found for panel index ${u}`),kt(x,m)){const h=g-x;Qr(h,Math.abs(e))>0&&(e=e<0?0-h:h)}}}{const u=e<0?l:s,d=n[u];xe(d,`No panel constraints found for index ${u}`);const{collapsedSize:m=0,collapsible:v,minSize:g=0}=d;if(v){const x=t[u];if(xe(x!=null,`Previous layout not found for panel index ${u}`),kt(x,g)){const h=x-m;Qr(h,Math.abs(e))>0&&(e=e<0?0-h:h)}}}}{const u=e<0?1:-1;let d=e<0?s:l,m=0;for(;;){const g=t[d];xe(g!=null,`Previous layout not found for panel index ${d}`);const h=Ha({panelConstraints:n,panelIndex:d,size:100})-g;if(m+=h,d+=u,d<0||d>=n.length)break}const v=Math.min(Math.abs(e),Math.abs(m));e=e<0?0-v:v}{let d=e<0?l:s;for(;d>=0&&d<n.length;){const m=Math.abs(e)-Math.abs(c),v=t[d];xe(v!=null,`Previous layout not found for panel index ${d}`);const g=v-m,x=Ha({panelConstraints:n,panelIndex:d,size:g});if(!kt(v,x)&&(c+=v-x,i[d]=x,c.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?d--:d++}}if(dj(r,i))return r;{const u=e<0?s:l,d=t[u];xe(d!=null,`Previous layout not found for panel index ${u}`);const m=d+c,v=Ha({panelConstraints:n,panelIndex:u,size:m});if(i[u]=v,!kt(v,m)){let g=m-v,h=e<0?s:l;for(;h>=0&&h<n.length;){const w=i[h];xe(w!=null,`Previous layout not found for panel index ${h}`);const y=w+g,S=Ha({panelConstraints:n,panelIndex:h,size:y});if(kt(w,S)||(g-=S-w,i[h]=S),kt(g,0))break;e>0?h--:h++}}}const f=i.reduce((u,d)=>d+u,0);return kt(f,100)?i:r}function fj({layout:e,panelsArray:t,pivotIndices:n}){let o=0,r=100,a=0,i=0;const l=n[0];xe(l!=null,"No pivot index found"),t.forEach((u,d)=>{const{constraints:m}=u,{maxSize:v=100,minSize:g=0}=m;d===l?(o=g,r=v):(a+=g,i+=v)});const s=Math.min(r,100-a),c=Math.max(o,100-i),f=e[l];return{valueMax:s,valueMin:c,valueNow:f}}function dd(e,t=document){return Array.from(t.querySelectorAll(`[${Vt.resizeHandleId}][data-panel-group-id="${e}"]`))}function pj(e,t,n=document){const r=dd(e,n).findIndex(a=>a.getAttribute(Vt.resizeHandleId)===t);return r??null}function s2(e,t,n){const o=pj(e,t,n);return o!=null?[o,o+1]:[-1,-1]}function mj(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function c2(e,t=document){if(mj(t)&&t.dataset.panelGroupId==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function xy(e,t=document){const n=t.querySelector(`[${Vt.resizeHandleId}="${e}"]`);return n||null}function hj(e,t,n,o=document){var r,a,i,l;const s=xy(t,o),c=dd(e,o),f=s?c.indexOf(s):-1,u=(r=(a=n[f])===null||a===void 0?void 0:a.id)!==null&&r!==void 0?r:null,d=(i=(l=n[f+1])===null||l===void 0?void 0:l.id)!==null&&i!==void 0?i:null;return[u,d]}function gj({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:o,panelDataArray:r,panelGroupElement:a,setLayout:i}){p.useRef({didWarnAboutMissingResizeHandle:!1}),Ja(()=>{if(!a)return;const l=dd(n,a);for(let s=0;s<r.length-1;s++){const{valueMax:c,valueMin:f,valueNow:u}=fj({layout:o,panelsArray:r,pivotIndices:[s,s+1]}),d=l[s];if(d!=null){const m=r[s];xe(m,`No panel data found for index "${s}"`),d.setAttribute("aria-controls",m.id),d.setAttribute("aria-valuemax",""+Math.round(c)),d.setAttribute("aria-valuemin",""+Math.round(f)),d.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{l.forEach((s,c)=>{s.removeAttribute("aria-controls"),s.removeAttribute("aria-valuemax"),s.removeAttribute("aria-valuemin"),s.removeAttribute("aria-valuenow")})}},[n,o,r,a]),p.useEffect(()=>{if(!a)return;const l=t.current;xe(l,"Eager values not found");const{panelDataArray:s}=l,c=c2(n,a);xe(c!=null,`No group found for id "${n}"`);const f=dd(n,a);xe(f,`No resize handles found for group id "${n}"`);const u=f.map(d=>{const m=d.getAttribute(Vt.resizeHandleId);xe(m,"Resize handle element has no handle id attribute");const[v,g]=hj(n,m,s,a);if(v==null||g==null)return()=>{};const x=h=>{if(!h.defaultPrevented)switch(h.key){case"Enter":{h.preventDefault();const w=s.findIndex(y=>y.id===v);if(w>=0){const y=s[w];xe(y,`No panel data found for index ${w}`);const S=o[w],{collapsedSize:E=0,collapsible:N,minSize:C=0}=y.constraints;if(S!=null&&N){const A=dl({delta:kt(S,E)?C-E:E-S,initialLayout:o,panelConstraints:s.map(T=>T.constraints),pivotIndices:s2(n,m,a),prevLayout:o,trigger:"keyboard"});o!==A&&i(A)}}break}}};return d.addEventListener("keydown",x),()=>{d.removeEventListener("keydown",x)}});return()=>{u.forEach(d=>d())}},[a,e,t,n,o,r,i])}function yx(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function u2(e,t){const n=e==="horizontal",{x:o,y:r}=oj(t);return n?o:r}function vj(e,t,n,o,r){const a=n==="horizontal",i=xy(t,r);xe(i,`No resize handle element found for id "${t}"`);const l=i.getAttribute(Vt.groupId);xe(l,"Resize handle element has no group id attribute");let{initialCursorPosition:s}=o;const c=u2(n,e),f=c2(l,r);xe(f,`No group element found for id "${l}"`);const u=f.getBoundingClientRect(),d=a?u.width:u.height;return(c-s)/d*100}function yj(e,t,n,o,r,a){if(a2(e)){const i=n==="horizontal";let l=0;e.shiftKey?l=100:r!=null?l=r:l=10;let s=0;switch(e.key){case"ArrowDown":s=i?0:l;break;case"ArrowLeft":s=i?-l:0;break;case"ArrowRight":s=i?l:0;break;case"ArrowUp":s=i?0:-l;break;case"End":s=100;break;case"Home":s=-100;break}return s}else return o==null?0:vj(e,t,n,o,a)}function bj({panelDataArray:e}){const t=Array(e.length),n=e.map(a=>a.constraints);let o=0,r=100;for(let a=0;a<e.length;a++){const i=n[a];xe(i,`Panel constraints not found for index ${a}`);const{defaultSize:l}=i;l!=null&&(o++,t[a]=l,r-=l)}for(let a=0;a<e.length;a++){const i=n[a];xe(i,`Panel constraints not found for index ${a}`);const{defaultSize:l}=i;if(l!=null)continue;const s=e.length-o,c=r/s;o++,t[a]=c,r-=c}return t}function ya(e,t,n){t.forEach((o,r)=>{const a=e[r];xe(a,`Panel data not found for index ${r}`);const{callbacks:i,constraints:l,id:s}=a,{collapsedSize:c=0,collapsible:f}=l,u=n[s];if(u==null||o!==u){n[s]=o;const{onCollapse:d,onExpand:m,onResize:v}=i;v&&v(o,u),f&&(d||m)&&(m&&(u==null||oo(u,c))&&!oo(o,c)&&m(),d&&(u==null||!oo(u,c))&&oo(o,c)&&d())}})}function Pc(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function wj({defaultSize:e,dragState:t,layout:n,panelData:o,panelIndex:r,precision:a=3}){const i=n[r];let l;return i==null?l=e!=null?e.toFixed(a):"1":o.length===1?l="1":l=i.toFixed(a),{flexBasis:0,flexGrow:l,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function xj(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function bx(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function d2(e){return`react-resizable-panels:${e}`}function f2(e){return e.map(t=>{const{constraints:n,id:o,idIsFromProps:r,order:a}=t;return r?o:a?`${a}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function p2(e,t){try{const n=d2(e),o=t.getItem(n);if(o){const r=JSON.parse(o);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function Sj(e,t,n){var o,r;const a=(o=p2(e,n))!==null&&o!==void 0?o:{},i=f2(t);return(r=a[i])!==null&&r!==void 0?r:null}function Ej(e,t,n,o,r){var a;const i=d2(e),l=f2(t),s=(a=p2(e,r))!==null&&a!==void 0?a:{};s[l]={expandToSizes:Object.fromEntries(n.entries()),layout:o};try{r.setItem(i,JSON.stringify(s))}catch(c){console.error(c)}}function wx({layout:e,panelConstraints:t}){const n=[...e],o=n.reduce((a,i)=>a+i,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(a=>`${a}%`).join(", ")}`);if(!kt(o,100)&&n.length>0)for(let a=0;a<t.length;a++){const i=n[a];xe(i!=null,`No layout data found for index ${a}`);const l=100/o*i;n[a]=l}let r=0;for(let a=0;a<t.length;a++){const i=n[a];xe(i!=null,`No layout data found for index ${a}`);const l=Ha({panelConstraints:t,panelIndex:a,size:i});i!=l&&(r+=i-l,n[a]=l)}if(!kt(r,0))for(let a=0;a<t.length;a++){const i=n[a];xe(i!=null,`No layout data found for index ${a}`);const l=i+r,s=Ha({panelConstraints:t,panelIndex:a,size:l});if(i!==s&&(r-=s-i,n[a]=s,kt(r,0)))break}return n}const Cj=100,fl={getItem:e=>(bx(fl),fl.getItem(e)),setItem:(e,t)=>{bx(fl),fl.setItem(e,t)}},xx={};function m2({autoSaveId:e=null,children:t,className:n="",direction:o,forwardedRef:r,id:a=null,onLayout:i=null,keyboardResizeBy:l=null,storage:s=fl,style:c,tagName:f="div",...u}){const d=o2(a),m=p.useRef(null),[v,g]=p.useState(null),[x,h]=p.useState([]),w=uj(),y=p.useRef({}),S=p.useRef(new Map),E=p.useRef(0),N=p.useRef({autoSaveId:e,direction:o,dragState:v,id:d,keyboardResizeBy:l,onLayout:i,storage:s}),C=p.useRef({layout:x,panelDataArray:[],panelDataArrayChanged:!1});p.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),p.useImperativeHandle(r,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:H}=C.current;return H},setLayout:H=>{const{onLayout:V}=N.current,{layout:Y,panelDataArray:q}=C.current,B=wx({layout:H,panelConstraints:q.map(G=>G.constraints)});yx(Y,B)||(h(B),C.current.layout=B,V&&V(B),ya(q,B,y.current))}}),[]),Ja(()=>{N.current.autoSaveId=e,N.current.direction=o,N.current.dragState=v,N.current.id=d,N.current.onLayout=i,N.current.storage=s}),gj({committedValuesRef:N,eagerValuesRef:C,groupId:d,layout:x,panelDataArray:C.current.panelDataArray,setLayout:h,panelGroupElement:m.current}),p.useEffect(()=>{const{panelDataArray:H}=C.current;if(e){if(x.length===0||x.length!==H.length)return;let V=xx[e];V==null&&(V=xj(Ej,Cj),xx[e]=V);const Y=[...H],q=new Map(S.current);V(e,Y,q,x,s)}},[e,x,s]),p.useEffect(()=>{});const A=p.useCallback(H=>{const{onLayout:V}=N.current,{layout:Y,panelDataArray:q}=C.current;if(H.constraints.collapsible){const B=q.map(te=>te.constraints),{collapsedSize:G=0,panelSize:Z,pivotIndices:ee}=Er(q,H,Y);if(xe(Z!=null,`Panel size not found for panel "${H.id}"`),!oo(Z,G)){S.current.set(H.id,Z);const K=Ca(q,H)===q.length-1?Z-G:G-Z,W=dl({delta:K,initialLayout:Y,panelConstraints:B,pivotIndices:ee,prevLayout:Y,trigger:"imperative-api"});Pc(Y,W)||(h(W),C.current.layout=W,V&&V(W),ya(q,W,y.current))}}},[]),T=p.useCallback((H,V)=>{const{onLayout:Y}=N.current,{layout:q,panelDataArray:B}=C.current;if(H.constraints.collapsible){const G=B.map(Q=>Q.constraints),{collapsedSize:Z=0,panelSize:ee=0,minSize:te=0,pivotIndices:K}=Er(B,H,q),W=V??te;if(oo(ee,Z)){const Q=S.current.get(H.id),ne=Q!=null&&Q>=W?Q:W,ce=Ca(B,H)===B.length-1?ee-ne:ne-ee,fe=dl({delta:ce,initialLayout:q,panelConstraints:G,pivotIndices:K,prevLayout:q,trigger:"imperative-api"});Pc(q,fe)||(h(fe),C.current.layout=fe,Y&&Y(fe),ya(B,fe,y.current))}}},[]),k=p.useCallback(H=>{const{layout:V,panelDataArray:Y}=C.current,{panelSize:q}=Er(Y,H,V);return xe(q!=null,`Panel size not found for panel "${H.id}"`),q},[]),z=p.useCallback((H,V)=>{const{panelDataArray:Y}=C.current,q=Ca(Y,H);return wj({defaultSize:V,dragState:v,layout:x,panelData:Y,panelIndex:q})},[v,x]),O=p.useCallback(H=>{const{layout:V,panelDataArray:Y}=C.current,{collapsedSize:q=0,collapsible:B,panelSize:G}=Er(Y,H,V);return xe(G!=null,`Panel size not found for panel "${H.id}"`),B===!0&&oo(G,q)},[]),P=p.useCallback(H=>{const{layout:V,panelDataArray:Y}=C.current,{collapsedSize:q=0,collapsible:B,panelSize:G}=Er(Y,H,V);return xe(G!=null,`Panel size not found for panel "${H.id}"`),!B||Qr(G,q)>0},[]),_=p.useCallback(H=>{const{panelDataArray:V}=C.current;V.push(H),V.sort((Y,q)=>{const B=Y.order,G=q.order;return B==null&&G==null?0:B==null?-1:G==null?1:B-G}),C.current.panelDataArrayChanged=!0,w()},[w]);Ja(()=>{if(C.current.panelDataArrayChanged){C.current.panelDataArrayChanged=!1;const{autoSaveId:H,onLayout:V,storage:Y}=N.current,{layout:q,panelDataArray:B}=C.current;let G=null;if(H){const ee=Sj(H,B,Y);ee&&(S.current=new Map(Object.entries(ee.expandToSizes)),G=ee.layout)}G==null&&(G=bj({panelDataArray:B}));const Z=wx({layout:G,panelConstraints:B.map(ee=>ee.constraints)});yx(q,Z)||(h(Z),C.current.layout=Z,V&&V(Z),ya(B,Z,y.current))}}),Ja(()=>{const H=C.current;return()=>{H.layout=[]}},[]);const L=p.useCallback(H=>{let V=!1;const Y=m.current;return Y&&window.getComputedStyle(Y,null).getPropertyValue("direction")==="rtl"&&(V=!0),function(B){B.preventDefault();const G=m.current;if(!G)return()=>null;const{direction:Z,dragState:ee,id:te,keyboardResizeBy:K,onLayout:W}=N.current,{layout:Q,panelDataArray:ne}=C.current,{initialLayout:ae}=ee??{},ce=s2(te,H,G);let fe=yj(B,H,Z,ee,K,G);const ue=Z==="horizontal";ue&&V&&(fe=-fe);const _e=ne.map(nt=>nt.constraints),je=dl({delta:fe,initialLayout:ae??Q,panelConstraints:_e,pivotIndices:ce,prevLayout:Q,trigger:a2(B)?"keyboard":"mouse-or-touch"}),Ve=!Pc(Q,je);(i2(B)||l2(B))&&E.current!=fe&&(E.current=fe,!Ve&&fe!==0?ue?jp(H,fe<0?aj:ij):jp(H,fe<0?lj:sj):jp(H,0)),Ve&&(h(je),C.current.layout=je,W&&W(je),ya(ne,je,y.current))}},[]),R=p.useCallback((H,V)=>{const{onLayout:Y}=N.current,{layout:q,panelDataArray:B}=C.current,G=B.map(Q=>Q.constraints),{panelSize:Z,pivotIndices:ee}=Er(B,H,q);xe(Z!=null,`Panel size not found for panel "${H.id}"`);const K=Ca(B,H)===B.length-1?Z-V:V-Z,W=dl({delta:K,initialLayout:q,panelConstraints:G,pivotIndices:ee,prevLayout:q,trigger:"imperative-api"});Pc(q,W)||(h(W),C.current.layout=W,Y&&Y(W),ya(B,W,y.current))},[]),I=p.useCallback((H,V)=>{const{layout:Y,panelDataArray:q}=C.current,{collapsedSize:B=0,collapsible:G}=V,{collapsedSize:Z=0,collapsible:ee,maxSize:te=100,minSize:K=0}=H.constraints,{panelSize:W}=Er(q,H,Y);W!=null&&(G&&ee&&oo(W,B)?oo(B,Z)||R(H,Z):W<K?R(H,K):W>te&&R(H,te))},[R]),D=p.useCallback((H,V)=>{const{direction:Y}=N.current,{layout:q}=C.current;if(!m.current)return;const B=xy(H,m.current);xe(B,`Drag handle element not found for id "${H}"`);const G=u2(Y,V);g({dragHandleId:H,dragHandleRect:B.getBoundingClientRect(),initialCursorPosition:G,initialLayout:q})},[]),M=p.useCallback(()=>{g(null)},[]),U=p.useCallback(H=>{const{panelDataArray:V}=C.current,Y=Ca(V,H);Y>=0&&(V.splice(Y,1),delete y.current[H.id],C.current.panelDataArrayChanged=!0,w())},[w]),F=p.useMemo(()=>({collapsePanel:A,direction:o,dragState:v,expandPanel:T,getPanelSize:k,getPanelStyle:z,groupId:d,isPanelCollapsed:O,isPanelExpanded:P,reevaluatePanelConstraints:I,registerPanel:_,registerResizeHandle:L,resizePanel:R,startDragging:D,stopDragging:M,unregisterPanel:U,panelGroupElement:m.current}),[A,v,o,T,k,z,d,O,P,I,_,L,R,D,M,U]),$={display:"flex",flexDirection:o==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return p.createElement(by.Provider,{value:F},p.createElement(f,{...u,children:t,className:n,id:a,ref:m,style:{...$,...c},[Vt.group]:"",[Vt.groupDirection]:o,[Vt.groupId]:d}))}const Nj=p.forwardRef((e,t)=>p.createElement(m2,{...e,forwardedRef:t}));m2.displayName="PanelGroup";Nj.displayName="forwardRef(PanelGroup)";function Ca(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Er(e,t,n){const o=Ca(e,t),a=o===e.length-1?[o-1,o]:[o,o+1],i=n[o];return{...t.constraints,panelSize:i,pivotIndices:a}}function cs(e,[t,n]){return Math.min(n,Math.max(t,e))}function _j(e,t){return p.useReducer((n,o)=>t[n][o]??n,e)}var Sy="ScrollArea",[h2,jQ]=Ue(Sy),[Rj,pn]=h2(Sy),g2=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:o="hover",dir:r,scrollHideDelay:a=600,...i}=e,[l,s]=p.useState(null),[c,f]=p.useState(null),[u,d]=p.useState(null),[m,v]=p.useState(null),[g,x]=p.useState(null),[h,w]=p.useState(0),[y,S]=p.useState(0),[E,N]=p.useState(!1),[C,A]=p.useState(!1),T=le(t,z=>s(z)),k=Eo(r);return b(Rj,{scope:n,type:o,dir:k,scrollHideDelay:a,scrollArea:l,viewport:c,onViewportChange:f,content:u,onContentChange:d,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:E,onScrollbarXEnabledChange:N,scrollbarY:g,onScrollbarYChange:x,scrollbarYEnabled:C,onScrollbarYEnabledChange:A,onCornerWidthChange:w,onCornerHeightChange:S,children:b(oe.div,{dir:k,...i,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":h+"px","--radix-scroll-area-corner-height":y+"px",...e.style}})})});g2.displayName=Sy;var v2="ScrollAreaViewport",y2=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:o,nonce:r,...a}=e,i=pn(v2,n),l=p.useRef(null),s=le(t,l,i.onViewportChange);return re(De,{children:[b("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),b(oe.div,{"data-radix-scroll-area-viewport":"",...a,ref:s,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:b("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});y2.displayName=v2;var Kn="ScrollAreaScrollbar",Ey=p.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=pn(Kn,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:i}=r,l=e.orientation==="horizontal";return p.useEffect(()=>(l?a(!0):i(!0),()=>{l?a(!1):i(!1)}),[l,a,i]),r.type==="hover"?b(Tj,{...o,ref:t,forceMount:n}):r.type==="scroll"?b(Aj,{...o,ref:t,forceMount:n}):r.type==="auto"?b(b2,{...o,ref:t,forceMount:n}):r.type==="always"?b(Cy,{...o,ref:t}):null});Ey.displayName=Kn;var Tj=p.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=pn(Kn,e.__scopeScrollArea),[a,i]=p.useState(!1);return p.useEffect(()=>{const l=r.scrollArea;let s=0;if(l){const c=()=>{window.clearTimeout(s),i(!0)},f=()=>{s=window.setTimeout(()=>i(!1),r.scrollHideDelay)};return l.addEventListener("pointerenter",c),l.addEventListener("pointerleave",f),()=>{window.clearTimeout(s),l.removeEventListener("pointerenter",c),l.removeEventListener("pointerleave",f)}}},[r.scrollArea,r.scrollHideDelay]),b(Pe,{present:n||a,children:b(b2,{"data-state":a?"visible":"hidden",...o,ref:t})})}),Aj=p.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=pn(Kn,e.__scopeScrollArea),a=e.orientation==="horizontal",i=Sf(()=>s("SCROLL_END"),100),[l,s]=_j("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return p.useEffect(()=>{if(l==="idle"){const c=window.setTimeout(()=>s("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(c)}},[l,r.scrollHideDelay,s]),p.useEffect(()=>{const c=r.viewport,f=a?"scrollLeft":"scrollTop";if(c){let u=c[f];const d=()=>{const m=c[f];u!==m&&(s("SCROLL"),i()),u=m};return c.addEventListener("scroll",d),()=>c.removeEventListener("scroll",d)}},[r.viewport,a,s,i]),b(Pe,{present:n||l!=="hidden",children:b(Cy,{"data-state":l==="hidden"?"hidden":"visible",...o,ref:t,onPointerEnter:j(e.onPointerEnter,()=>s("POINTER_ENTER")),onPointerLeave:j(e.onPointerLeave,()=>s("POINTER_LEAVE"))})})}),b2=p.forwardRef((e,t)=>{const n=pn(Kn,e.__scopeScrollArea),{forceMount:o,...r}=e,[a,i]=p.useState(!1),l=e.orientation==="horizontal",s=Sf(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;i(l?c:f)}},10);return Si(n.viewport,s),Si(n.content,s),b(Pe,{present:o||a,children:b(Cy,{"data-state":a?"visible":"hidden",...r,ref:t})})}),Cy=p.forwardRef((e,t)=>{const{orientation:n="vertical",...o}=e,r=pn(Kn,e.__scopeScrollArea),a=p.useRef(null),i=p.useRef(0),[l,s]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=C2(l.viewport,l.content),f={...o,sizes:l,onSizesChange:s,hasThumb:c>0&&c<1,onThumbChange:d=>a.current=d,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:d=>i.current=d};function u(d,m){return Ij(d,i.current,l,m)}return n==="horizontal"?b(Mj,{...f,ref:t,onThumbPositionChange:()=>{if(r.viewport&&a.current){const d=r.viewport.scrollLeft,m=Sx(d,l,r.dir);a.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:d=>{r.viewport&&(r.viewport.scrollLeft=d)},onDragScroll:d=>{r.viewport&&(r.viewport.scrollLeft=u(d,r.dir))}}):n==="vertical"?b(Dj,{...f,ref:t,onThumbPositionChange:()=>{if(r.viewport&&a.current){const d=r.viewport.scrollTop,m=Sx(d,l);a.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:d=>{r.viewport&&(r.viewport.scrollTop=d)},onDragScroll:d=>{r.viewport&&(r.viewport.scrollTop=u(d))}}):null}),Mj=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:o,...r}=e,a=pn(Kn,e.__scopeScrollArea),[i,l]=p.useState(),s=p.useRef(null),c=le(t,s,a.onScrollbarXChange);return p.useEffect(()=>{s.current&&l(getComputedStyle(s.current))},[s]),b(x2,{"data-orientation":"horizontal",...r,ref:c,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":xf(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,u)=>{if(a.viewport){const d=a.viewport.scrollLeft+f.deltaX;e.onWheelScroll(d),_2(d,u)&&f.preventDefault()}},onResize:()=>{s.current&&a.viewport&&i&&o({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:s.current.clientWidth,paddingStart:pd(i.paddingLeft),paddingEnd:pd(i.paddingRight)}})}})}),Dj=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:o,...r}=e,a=pn(Kn,e.__scopeScrollArea),[i,l]=p.useState(),s=p.useRef(null),c=le(t,s,a.onScrollbarYChange);return p.useEffect(()=>{s.current&&l(getComputedStyle(s.current))},[s]),b(x2,{"data-orientation":"vertical",...r,ref:c,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":xf(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,u)=>{if(a.viewport){const d=a.viewport.scrollTop+f.deltaY;e.onWheelScroll(d),_2(d,u)&&f.preventDefault()}},onResize:()=>{s.current&&a.viewport&&i&&o({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:s.current.clientHeight,paddingStart:pd(i.paddingTop),paddingEnd:pd(i.paddingBottom)}})}})}),[Oj,w2]=h2(Kn),x2=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:r,onThumbChange:a,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:s,onDragScroll:c,onWheelScroll:f,onResize:u,...d}=e,m=pn(Kn,n),[v,g]=p.useState(null),x=le(t,T=>g(T)),h=p.useRef(null),w=p.useRef(""),y=m.viewport,S=o.content-o.viewport,E=Ae(f),N=Ae(s),C=Sf(u,10);function A(T){if(h.current){const k=T.clientX-h.current.left,z=T.clientY-h.current.top;c({x:k,y:z})}}return p.useEffect(()=>{const T=k=>{const z=k.target;(v==null?void 0:v.contains(z))&&E(k,S)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[y,v,S,E]),p.useEffect(N,[o,N]),Si(v,C),Si(m.content,C),b(Oj,{scope:n,scrollbar:v,hasThumb:r,onThumbChange:Ae(a),onThumbPointerUp:Ae(i),onThumbPositionChange:N,onThumbPointerDown:Ae(l),children:b(oe.div,{...d,ref:x,style:{position:"absolute",...d.style},onPointerDown:j(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),h.current=v.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),A(T))}),onPointerMove:j(e.onPointerMove,A),onPointerUp:j(e.onPointerUp,T=>{const k=T.target;k.hasPointerCapture(T.pointerId)&&k.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=w.current,m.viewport&&(m.viewport.style.scrollBehavior=""),h.current=null})})})}),fd="ScrollAreaThumb",S2=p.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=w2(fd,e.__scopeScrollArea);return b(Pe,{present:n||r.hasThumb,children:b(Pj,{ref:t,...o})})}),Pj=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:o,...r}=e,a=pn(fd,n),i=w2(fd,n),{onThumbPositionChange:l}=i,s=le(t,u=>i.onThumbChange(u)),c=p.useRef(void 0),f=Sf(()=>{c.current&&(c.current(),c.current=void 0)},100);return p.useEffect(()=>{const u=a.viewport;if(u){const d=()=>{if(f(),!c.current){const m=Lj(u,l);c.current=m,l()}};return l(),u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[a.viewport,f,l]),b(oe.div,{"data-state":i.hasThumb?"visible":"hidden",...r,ref:s,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:j(e.onPointerDownCapture,u=>{const m=u.target.getBoundingClientRect(),v=u.clientX-m.left,g=u.clientY-m.top;i.onThumbPointerDown({x:v,y:g})}),onPointerUp:j(e.onPointerUp,i.onThumbPointerUp)})});S2.displayName=fd;var Ny="ScrollAreaCorner",E2=p.forwardRef((e,t)=>{const n=pn(Ny,e.__scopeScrollArea),o=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&o?b(zj,{...e,ref:t}):null});E2.displayName=Ny;var zj=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,...o}=e,r=pn(Ny,n),[a,i]=p.useState(0),[l,s]=p.useState(0),c=!!(a&&l);return Si(r.scrollbarX,()=>{var u;const f=((u=r.scrollbarX)==null?void 0:u.offsetHeight)||0;r.onCornerHeightChange(f),s(f)}),Si(r.scrollbarY,()=>{var u;const f=((u=r.scrollbarY)==null?void 0:u.offsetWidth)||0;r.onCornerWidthChange(f),i(f)}),c?b(oe.div,{...o,ref:t,style:{width:a,height:l,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function pd(e){return e?parseInt(e,10):0}function C2(e,t){const n=e/t;return isNaN(n)?0:n}function xf(e){const t=C2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-n)*t;return Math.max(o,18)}function Ij(e,t,n,o="ltr"){const r=xf(n),a=r/2,i=t||a,l=r-i,s=n.scrollbar.paddingStart+i,c=n.scrollbar.size-n.scrollbar.paddingEnd-l,f=n.content-n.viewport,u=o==="ltr"?[0,f]:[f*-1,0];return N2([s,c],u)(e)}function Sx(e,t,n="ltr"){const o=xf(t),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-r,i=t.content-t.viewport,l=a-o,s=n==="ltr"?[0,i]:[i*-1,0],c=cs(e,s);return N2([0,i],[0,l])(c)}function N2(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function _2(e,t){return e>0&&e<t}var Lj=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},o=0;return function r(){const a={left:e.scrollLeft,top:e.scrollTop},i=n.left!==a.left,l=n.top!==a.top;(i||l)&&t(),n=a,o=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(o)};function Sf(e,t){const n=Ae(e),o=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(o.current),[]),p.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(n,t)},[n,t])}function Si(e,t){const n=Ae(t);He(()=>{let o=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}},[e,n])}var R2=g2,kj=y2,$j=E2;const Hj=p.forwardRef(({className:e,children:t,...n},o)=>re(R2,{ref:o,className:X("relative overflow-hidden",e),...n,children:[b(kj,{className:"h-full w-full rounded-[inherit]",children:t}),b(T2,{}),b($j,{})]}));Hj.displayName=R2.displayName;const T2=p.forwardRef(({className:e,orientation:t="vertical",...n},o)=>b(Ey,{ref:o,orientation:t,className:X("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:b(S2,{className:"relative flex-1 rounded-full bg-border"})}));T2.displayName=Ey.displayName;var Bj=[" ","Enter","ArrowUp","ArrowDown"],Uj=[" ","Enter"],Ef="Select",[_y,Cf,Vj]=So(Ef),[Hi,qQ]=Ue(Ef,[Vj,Fn]),Ry=Fn(),[ZQ,mr]=Hi(Ef),[QQ,Gj]=Hi(Ef),A2="SelectTrigger",M2=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,a=Ry(n),i=mr(A2,n),l=i.disabled||o,s=le(t,i.onTriggerChange),c=Cf(n),f=p.useRef("touch"),[u,d,m]=W2(g=>{const x=c().filter(y=>!y.disabled),h=x.find(y=>y.value===i.value),w=J2(x,g,h);w!==void 0&&i.onValueChange(w.value)}),v=g=>{l||(i.onOpenChange(!0),m()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return b($i,{asChild:!0,...a,children:b(oe.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Q2(i.value)?"":void 0,...r,ref:s,onClick:j(r.onClick,g=>{g.currentTarget.focus(),f.current!=="mouse"&&v(g)}),onPointerDown:j(r.onPointerDown,g=>{f.current=g.pointerType;const x=g.target;x.hasPointerCapture(g.pointerId)&&x.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(v(g),g.preventDefault())}),onKeyDown:j(r.onKeyDown,g=>{const x=u.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&d(g.key),!(x&&g.key===" ")&&Bj.includes(g.key)&&(v(),g.preventDefault())})})})});M2.displayName=A2;var D2="SelectValue",Yj=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:a,placeholder:i="",...l}=e,s=mr(D2,n),{onValueNodeHasChildrenChange:c}=s,f=a!==void 0,u=le(t,s.onValueNodeChange);return He(()=>{c(f)},[c,f]),b(oe.span,{...l,ref:u,style:{pointerEvents:"none"},children:Q2(s.value)?b(De,{children:i}):a})});Yj.displayName=D2;var Fj="SelectIcon",O2=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return b(oe.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});O2.displayName=Fj;var Xj="SelectPortal",P2=e=>b(ia,{asChild:!0,...e});P2.displayName=Xj;var Wr="SelectContent",z2=p.forwardRef((e,t)=>{const n=mr(Wr,e.__scopeSelect),[o,r]=p.useState();if(He(()=>{r(new DocumentFragment)},[]),!n.open){const a=o;return a?Jr.createPortal(b(I2,{scope:e.__scopeSelect,children:b(_y.Slot,{scope:e.__scopeSelect,children:b("div",{children:e.children})})}),a):null}return b(L2,{...e,ref:t})});z2.displayName=Wr;var hn=10,[I2,hr]=Hi(Wr),Kj="SelectContentImpl",jj=Xr("SelectContent.RemoveScroll"),L2=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:a,onPointerDownOutside:i,side:l,sideOffset:s,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:d,collisionPadding:m,sticky:v,hideWhenDetached:g,avoidCollisions:x,...h}=e,w=mr(Wr,n),[y,S]=p.useState(null),[E,N]=p.useState(null),C=le(t,B=>S(B)),[A,T]=p.useState(null),[k,z]=p.useState(null),O=Cf(n),[P,_]=p.useState(!1),L=p.useRef(!1);p.useEffect(()=>{if(y)return of(y)},[y]),tf();const R=p.useCallback(B=>{const[G,...Z]=O().map(K=>K.ref.current),[ee]=Z.slice(-1),te=document.activeElement;for(const K of B)if(K===te||(K==null||K.scrollIntoView({block:"nearest"}),K===G&&E&&(E.scrollTop=0),K===ee&&E&&(E.scrollTop=E.scrollHeight),K==null||K.focus(),document.activeElement!==te))return},[O,E]),I=p.useCallback(()=>R([A,y]),[R,A,y]);p.useEffect(()=>{P&&I()},[P,I]);const{onOpenChange:D,triggerPointerDownPosRef:M}=w;p.useEffect(()=>{if(y){let B={x:0,y:0};const G=ee=>{var te,K;B={x:Math.abs(Math.round(ee.pageX)-(((te=M.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(ee.pageY)-(((K=M.current)==null?void 0:K.y)??0))}},Z=ee=>{B.x<=10&&B.y<=10?ee.preventDefault():y.contains(ee.target)||D(!1),document.removeEventListener("pointermove",G),M.current=null};return M.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",Z,{capture:!0})}}},[y,D,M]),p.useEffect(()=>{const B=()=>D(!1);return window.addEventListener("blur",B),window.addEventListener("resize",B),()=>{window.removeEventListener("blur",B),window.removeEventListener("resize",B)}},[D]);const[U,F]=W2(B=>{const G=O().filter(te=>!te.disabled),Z=G.find(te=>te.ref.current===document.activeElement),ee=J2(G,B,Z);ee&&setTimeout(()=>ee.ref.current.focus())}),$=p.useCallback((B,G,Z)=>{const ee=!L.current&&!Z;(w.value!==void 0&&w.value===G||ee)&&(T(B),ee&&(L.current=!0))},[w.value]),H=p.useCallback(()=>y==null?void 0:y.focus(),[y]),V=p.useCallback((B,G,Z)=>{const ee=!L.current&&!Z;(w.value!==void 0&&w.value===G||ee)&&z(B)},[w.value]),Y=o==="popper"?Ah:k2,q=Y===Ah?{side:l,sideOffset:s,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:d,collisionPadding:m,sticky:v,hideWhenDetached:g,avoidCollisions:x}:{};return b(I2,{scope:n,content:y,viewport:E,onViewportChange:N,itemRefCallback:$,selectedItem:A,onItemLeave:H,itemTextRefCallback:V,focusSelectedItem:I,selectedItemText:k,position:o,isPositioned:P,searchRef:U,children:b(Ds,{as:jj,allowPinchZoom:!0,children:b(Ms,{asChild:!0,trapped:w.open,onMountAutoFocus:B=>{B.preventDefault()},onUnmountAutoFocus:j(r,B=>{var G;(G=w.trigger)==null||G.focus({preventScroll:!0}),B.preventDefault()}),children:b(Co,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:B=>B.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:b(Y,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:B=>B.preventDefault(),...h,...q,onPlaced:()=>_(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...h.style},onKeyDown:j(h.onKeyDown,B=>{const G=B.ctrlKey||B.altKey||B.metaKey;if(B.key==="Tab"&&B.preventDefault(),!G&&B.key.length===1&&F(B.key),["ArrowUp","ArrowDown","Home","End"].includes(B.key)){let ee=O().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(B.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(B.key)){const te=B.target,K=ee.indexOf(te);ee=ee.slice(K+1)}setTimeout(()=>R(ee)),B.preventDefault()}})})})})})})});L2.displayName=Kj;var qj="SelectItemAlignedPosition",k2=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,a=mr(Wr,n),i=hr(Wr,n),[l,s]=p.useState(null),[c,f]=p.useState(null),u=le(t,C=>f(C)),d=Cf(n),m=p.useRef(!1),v=p.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:h,focusSelectedItem:w}=i,y=p.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&c&&g&&x&&h){const C=a.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),T=a.valueNode.getBoundingClientRect(),k=h.getBoundingClientRect();if(a.dir!=="rtl"){const te=k.left-A.left,K=T.left-te,W=C.left-K,Q=C.width+W,ne=Math.max(Q,A.width),ae=window.innerWidth-hn,ce=cs(K,[hn,Math.max(hn,ae-ne)]);l.style.minWidth=Q+"px",l.style.left=ce+"px"}else{const te=A.right-k.right,K=window.innerWidth-T.right-te,W=window.innerWidth-C.right-K,Q=C.width+W,ne=Math.max(Q,A.width),ae=window.innerWidth-hn,ce=cs(K,[hn,Math.max(hn,ae-ne)]);l.style.minWidth=Q+"px",l.style.right=ce+"px"}const z=d(),O=window.innerHeight-hn*2,P=g.scrollHeight,_=window.getComputedStyle(c),L=parseInt(_.borderTopWidth,10),R=parseInt(_.paddingTop,10),I=parseInt(_.borderBottomWidth,10),D=parseInt(_.paddingBottom,10),M=L+R+P+D+I,U=Math.min(x.offsetHeight*5,M),F=window.getComputedStyle(g),$=parseInt(F.paddingTop,10),H=parseInt(F.paddingBottom,10),V=C.top+C.height/2-hn,Y=O-V,q=x.offsetHeight/2,B=x.offsetTop+q,G=L+R+B,Z=M-G;if(G<=V){const te=z.length>0&&x===z[z.length-1].ref.current;l.style.bottom="0px";const K=c.clientHeight-g.offsetTop-g.offsetHeight,W=Math.max(Y,q+(te?H:0)+K+I),Q=G+W;l.style.height=Q+"px"}else{const te=z.length>0&&x===z[0].ref.current;l.style.top="0px";const W=Math.max(V,L+g.offsetTop+(te?$:0)+q)+Z;l.style.height=W+"px",g.scrollTop=G-V+g.offsetTop}l.style.margin=`${hn}px 0`,l.style.minHeight=U+"px",l.style.maxHeight=O+"px",o==null||o(),requestAnimationFrame(()=>m.current=!0)}},[d,a.trigger,a.valueNode,l,c,g,x,h,a.dir,o]);He(()=>y(),[y]);const[S,E]=p.useState();He(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const N=p.useCallback(C=>{C&&v.current===!0&&(y(),w==null||w(),v.current=!1)},[y,w]);return b(Qj,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:N,children:b("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:b(oe.div,{...r,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});k2.displayName=qj;var Zj="SelectPopperPosition",Ah=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=hn,...a}=e,i=Ry(n);return b(ks,{...i,...a,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...a.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)"}})});Ah.displayName=Zj;var[Qj,Ty]=Hi(Wr,{}),Mh="SelectViewport",$2=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,a=hr(Mh,n),i=Ty(Mh,n),l=le(t,a.onViewportChange),s=p.useRef(0);return re(De,{children:[b("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}),b(_y.Slot,{scope:n,children:b(oe.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:j(r.onScroll,c=>{const f=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:d}=i;if(d!=null&&d.current&&u){const m=Math.abs(s.current-f.scrollTop);if(m>0){const v=window.innerHeight-hn*2,g=parseFloat(u.style.minHeight),x=parseFloat(u.style.height),h=Math.max(g,x);if(h<v){const w=h+m,y=Math.min(v,w),S=w-y;u.style.height=y+"px",u.style.bottom==="0px"&&(f.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}s.current=f.scrollTop})})})]})});$2.displayName=Mh;var H2="SelectGroup",[Wj,Jj]=Hi(H2),eq=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=mt();return b(Wj,{scope:n,id:r,children:b(oe.div,{role:"group","aria-labelledby":r,...o,ref:t})})});eq.displayName=H2;var B2="SelectLabel",U2=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Jj(B2,n);return b(oe.div,{id:r.id,...o,ref:t})});U2.displayName=B2;var md="SelectItem",[tq,V2]=Hi(md),G2=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:a,...i}=e,l=mr(md,n),s=hr(md,n),c=l.value===o,[f,u]=p.useState(a??""),[d,m]=p.useState(!1),v=le(t,w=>{var y;return(y=s.itemRefCallback)==null?void 0:y.call(s,w,o,r)}),g=mt(),x=p.useRef("touch"),h=()=>{r||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return b(tq,{scope:n,value:o,disabled:r,textId:g,isSelected:c,onItemTextChange:p.useCallback(w=>{u(y=>y||((w==null?void 0:w.textContent)??"").trim())},[]),children:b(_y.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:b(oe.div,{role:"option","aria-labelledby":g,"data-highlighted":d?"":void 0,"aria-selected":c&&d,"data-state":c?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:v,onFocus:j(i.onFocus,()=>m(!0)),onBlur:j(i.onBlur,()=>m(!1)),onClick:j(i.onClick,()=>{x.current!=="mouse"&&h()}),onPointerUp:j(i.onPointerUp,()=>{x.current==="mouse"&&h()}),onPointerDown:j(i.onPointerDown,w=>{x.current=w.pointerType}),onPointerMove:j(i.onPointerMove,w=>{var y;x.current=w.pointerType,r?(y=s.onItemLeave)==null||y.call(s):x.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:j(i.onPointerLeave,w=>{var y;w.currentTarget===document.activeElement&&((y=s.onItemLeave)==null||y.call(s))}),onKeyDown:j(i.onKeyDown,w=>{var S;((S=s.searchRef)==null?void 0:S.current)!==""&&w.key===" "||(Uj.includes(w.key)&&h(),w.key===" "&&w.preventDefault())})})})})});G2.displayName=md;var pl="SelectItemText",Y2=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...a}=e,i=mr(pl,n),l=hr(pl,n),s=V2(pl,n),c=Gj(pl,n),[f,u]=p.useState(null),d=le(t,h=>u(h),s.onItemTextChange,h=>{var w;return(w=l.itemTextRefCallback)==null?void 0:w.call(l,h,s.value,s.disabled)}),m=f==null?void 0:f.textContent,v=p.useMemo(()=>b("option",{value:s.value,disabled:s.disabled,children:m},s.value),[s.disabled,s.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=c;return He(()=>(g(v),()=>x(v)),[g,x,v]),re(De,{children:[b(oe.span,{id:s.textId,...a,ref:d}),s.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Jr.createPortal(a.children,i.valueNode):null]})});Y2.displayName=pl;var F2="SelectItemIndicator",X2=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return V2(F2,n).isSelected?b(oe.span,{"aria-hidden":!0,...o,ref:t}):null});X2.displayName=F2;var Dh="SelectScrollUpButton",K2=p.forwardRef((e,t)=>{const n=hr(Dh,e.__scopeSelect),o=Ty(Dh,e.__scopeSelect),[r,a]=p.useState(!1),i=le(t,o.onScrollButtonChange);return He(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=s.scrollTop>0;a(c)};const s=n.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),r?b(q2,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:s}=n;l&&s&&(l.scrollTop=l.scrollTop-s.offsetHeight)}}):null});K2.displayName=Dh;var Oh="SelectScrollDownButton",j2=p.forwardRef((e,t)=>{const n=hr(Oh,e.__scopeSelect),o=Ty(Oh,e.__scopeSelect),[r,a]=p.useState(!1),i=le(t,o.onScrollButtonChange);return He(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=s.scrollHeight-s.clientHeight,f=Math.ceil(s.scrollTop)<c;a(f)};const s=n.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),r?b(q2,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:s}=n;l&&s&&(l.scrollTop=l.scrollTop+s.offsetHeight)}}):null});j2.displayName=Oh;var q2=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,a=hr("SelectScrollButton",n),i=p.useRef(null),l=Cf(n),s=p.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return p.useEffect(()=>()=>s(),[s]),He(()=>{var f;const c=l().find(u=>u.ref.current===document.activeElement);(f=c==null?void 0:c.ref.current)==null||f.scrollIntoView({block:"nearest"})},[l]),b(oe.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:j(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:j(r.onPointerMove,()=>{var c;(c=a.onItemLeave)==null||c.call(a),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:j(r.onPointerLeave,()=>{s()})})}),nq="SelectSeparator",Z2=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return b(oe.div,{"aria-hidden":!0,...o,ref:t})});Z2.displayName=nq;var Ph="SelectArrow",oq=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Ry(n),a=mr(Ph,n),i=hr(Ph,n);return a.open&&i.position==="popper"?b($s,{...r,...o,ref:t}):null});oq.displayName=Ph;var rq="SelectBubbleInput",aq=p.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=p.useRef(null),a=le(o,r),i=Ii(t);return p.useEffect(()=>{const l=r.current;if(!l)return;const s=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(s,"value").set;if(i!==t&&f){const u=new Event("change",{bubbles:!0});f.call(l,t),l.dispatchEvent(u)}},[i,t]),b(oe.select,{...n,style:{...oM,...n.style},ref:a,defaultValue:t})});aq.displayName=rq;function Q2(e){return e===""||e===void 0}function W2(e){const t=Ae(e),n=p.useRef(""),o=p.useRef(0),r=p.useCallback(i=>{const l=n.current+i;t(l),function s(c){n.current=c,window.clearTimeout(o.current),c!==""&&(o.current=window.setTimeout(()=>s(""),1e3))}(l)},[t]),a=p.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,a]}function J2(e,t,n){const r=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=iq(e,Math.max(a,0));r.length===1&&(i=i.filter(c=>c!==n));const s=i.find(c=>c.textValue.toLowerCase().startsWith(r.toLowerCase()));return s!==n?s:void 0}function iq(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var eD=M2,lq=O2,sq=P2,tD=z2,cq=$2,nD=U2,oD=G2,uq=Y2,dq=X2,rD=K2,aD=j2,iD=Z2;const fq=p.forwardRef(({className:e,children:t,...n},o)=>re(eD,{ref:o,className:X("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,b(lq,{asChild:!0,children:b(Jd,{className:"h-4 w-4 opacity-50"})})]}));fq.displayName=eD.displayName;const lD=p.forwardRef(({className:e,...t},n)=>b(rD,{ref:n,className:X("flex cursor-default items-center justify-center py-1",e),...t,children:b($6,{className:"h-4 w-4"})}));lD.displayName=rD.displayName;const sD=p.forwardRef(({className:e,...t},n)=>b(aD,{ref:n,className:X("flex cursor-default items-center justify-center py-1",e),...t,children:b(Jd,{className:"h-4 w-4"})}));sD.displayName=aD.displayName;const pq=p.forwardRef(({className:e,children:t,position:n="popper",...o},r)=>b(sq,{children:re(tD,{ref:r,className:X("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:[b(lD,{}),b(cq,{className:X("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),b(sD,{})]})}));pq.displayName=tD.displayName;const mq=p.forwardRef(({className:e,...t},n)=>b(nD,{ref:n,className:X("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));mq.displayName=nD.displayName;const hq=p.forwardRef(({className:e,children:t,...n},o)=>re(oD,{ref:o,className:X("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[b("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b(dq,{children:b(As,{className:"h-4 w-4"})})}),b(uq,{children:t})]}));hq.displayName=oD.displayName;const gq=p.forwardRef(({className:e,...t},n)=>b(iD,{ref:n,className:X("-mx-1 my-1 h-px bg-muted",e),...t}));gq.displayName=iD.displayName;var vq="Separator",Ex="horizontal",yq=["horizontal","vertical"],cD=p.forwardRef((e,t)=>{const{decorative:n,orientation:o=Ex,...r}=e,a=bq(o)?o:Ex,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return b(St.div,{"data-orientation":a,...l,...r,ref:t})});cD.displayName=vq;function bq(e){return yq.includes(e)}var uD=cD;const wq=p.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...o},r)=>b(uD,{ref:r,decorative:n,orientation:t,className:X("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));wq.displayName=uD.displayName;const xq=Os,dD=p.forwardRef(({className:e,...t},n)=>b(la,{className:X("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));dD.displayName=la.displayName;const Sq=aa("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Eq=p.forwardRef(({side:e="right",className:t,children:n,...o},r)=>re(xq,{children:[b(dD,{}),re(sa,{ref:r,className:X(Sq({side:e}),t),...o,children:[n,re(af,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[b(mv,{className:"h-4 w-4"}),b("span",{className:"sr-only",children:"Close"})]})]})]}));Eq.displayName=sa.displayName;const Cq=p.forwardRef(({className:e,...t},n)=>b(Pi,{ref:n,className:X("text-lg font-semibold text-foreground",e),...t}));Cq.displayName=Pi.displayName;const Nq=p.forwardRef(({className:e,...t},n)=>b(zi,{ref:n,className:X("text-sm text-muted-foreground",e),...t}));Nq.displayName=zi.displayName;var fD=["PageUp","PageDown"],pD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],mD={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Bi="Slider",[zh,_q,Rq]=So(Bi),[hD,WQ]=Ue(Bi,[Rq]),[Tq,Nf]=hD(Bi),gD=p.forwardRef((e,t)=>{const{name:n,min:o=0,max:r=100,step:a=1,orientation:i="horizontal",disabled:l=!1,minStepsBetweenThumbs:s=0,defaultValue:c=[o],value:f,onValueChange:u=()=>{},onValueCommit:d=()=>{},inverted:m=!1,form:v,...g}=e,x=p.useRef(new Set),h=p.useRef(0),y=i==="horizontal"?Aq:Mq,[S=[],E]=ht({prop:f,defaultProp:c,onChange:z=>{var P;(P=[...x.current][h.current])==null||P.focus(),u(z)}}),N=p.useRef(S);function C(z){const O=Iq(S,z);k(z,O)}function A(z){k(z,h.current)}function T(){const z=N.current[h.current];S[h.current]!==z&&d(S)}function k(z,O,{commit:P}={commit:!1}){const _=Hq(a),L=Bq(Math.round((z-o)/a)*a+o,_),R=cs(L,[o,r]);E((I=[])=>{const D=Pq(I,R,O);if($q(D,s*a)){h.current=D.indexOf(R);const M=String(D)!==String(I);return M&&P&&d(D),M?D:I}else return I})}return b(Tq,{scope:e.__scopeSlider,name:n,disabled:l,min:o,max:r,valueIndexToChangeRef:h,thumbs:x.current,values:S,orientation:i,form:v,children:b(zh.Provider,{scope:e.__scopeSlider,children:b(zh.Slot,{scope:e.__scopeSlider,children:b(y,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:j(g.onPointerDown,()=>{l||(N.current=S)}),min:o,max:r,inverted:m,onSlideStart:l?void 0:C,onSlideMove:l?void 0:A,onSlideEnd:l?void 0:T,onHomeKeyDown:()=>!l&&k(o,0,{commit:!0}),onEndKeyDown:()=>!l&&k(r,S.length-1,{commit:!0}),onStepKeyDown:({event:z,direction:O})=>{if(!l){const L=fD.includes(z.key)||z.shiftKey&&pD.includes(z.key)?10:1,R=h.current,I=S[R],D=a*L*O;k(I+D,R,{commit:!0})}}})})})})});gD.displayName=Bi;var[vD,yD]=hD(Bi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Aq=p.forwardRef((e,t)=>{const{min:n,max:o,dir:r,inverted:a,onSlideStart:i,onSlideMove:l,onSlideEnd:s,onStepKeyDown:c,...f}=e,[u,d]=p.useState(null),m=le(t,y=>d(y)),v=p.useRef(void 0),g=Eo(r),x=g==="ltr",h=x&&!a||!x&&a;function w(y){const S=v.current||u.getBoundingClientRect(),E=[0,S.width],C=Ay(E,h?[n,o]:[o,n]);return v.current=S,C(y-S.left)}return b(vD,{scope:e.__scopeSlider,startEdge:h?"left":"right",endEdge:h?"right":"left",direction:h?1:-1,size:"width",children:b(bD,{dir:g,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:y=>{const S=w(y.clientX);i==null||i(S)},onSlideMove:y=>{const S=w(y.clientX);l==null||l(S)},onSlideEnd:()=>{v.current=void 0,s==null||s()},onStepKeyDown:y=>{const E=mD[h?"from-left":"from-right"].includes(y.key);c==null||c({event:y,direction:E?-1:1})}})})}),Mq=p.forwardRef((e,t)=>{const{min:n,max:o,inverted:r,onSlideStart:a,onSlideMove:i,onSlideEnd:l,onStepKeyDown:s,...c}=e,f=p.useRef(null),u=le(t,f),d=p.useRef(void 0),m=!r;function v(g){const x=d.current||f.current.getBoundingClientRect(),h=[0,x.height],y=Ay(h,m?[o,n]:[n,o]);return d.current=x,y(g-x.top)}return b(vD,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:b(bD,{"data-orientation":"vertical",...c,ref:u,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const x=v(g.clientY);a==null||a(x)},onSlideMove:g=>{const x=v(g.clientY);i==null||i(x)},onSlideEnd:()=>{d.current=void 0,l==null||l()},onStepKeyDown:g=>{const h=mD[m?"from-bottom":"from-top"].includes(g.key);s==null||s({event:g,direction:h?-1:1})}})})}),bD=p.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:r,onSlideEnd:a,onHomeKeyDown:i,onEndKeyDown:l,onStepKeyDown:s,...c}=e,f=Nf(Bi,n);return b(oe.span,{...c,ref:t,onKeyDown:j(e.onKeyDown,u=>{u.key==="Home"?(i(u),u.preventDefault()):u.key==="End"?(l(u),u.preventDefault()):fD.concat(pD).includes(u.key)&&(s(u),u.preventDefault())}),onPointerDown:j(e.onPointerDown,u=>{const d=u.target;d.setPointerCapture(u.pointerId),u.preventDefault(),f.thumbs.has(d)?d.focus():o(u)}),onPointerMove:j(e.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&r(u)}),onPointerUp:j(e.onPointerUp,u=>{const d=u.target;d.hasPointerCapture(u.pointerId)&&(d.releasePointerCapture(u.pointerId),a(u))})})}),wD="SliderTrack",xD=p.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=Nf(wD,n);return b(oe.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...o,ref:t})});xD.displayName=wD;var Ih="SliderRange",SD=p.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=Nf(Ih,n),a=yD(Ih,n),i=p.useRef(null),l=le(t,i),s=r.values.length,c=r.values.map(d=>ND(d,r.min,r.max)),f=s>1?Math.min(...c):0,u=100-Math.max(...c);return b(oe.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...o,ref:l,style:{...e.style,[a.startEdge]:f+"%",[a.endEdge]:u+"%"}})});SD.displayName=Ih;var Lh="SliderThumb",ED=p.forwardRef((e,t)=>{const n=_q(e.__scopeSlider),[o,r]=p.useState(null),a=le(t,l=>r(l)),i=p.useMemo(()=>o?n().findIndex(l=>l.ref.current===o):-1,[n,o]);return b(Dq,{...e,ref:a,index:i})}),Dq=p.forwardRef((e,t)=>{const{__scopeSlider:n,index:o,name:r,...a}=e,i=Nf(Lh,n),l=yD(Lh,n),[s,c]=p.useState(null),f=le(t,w=>c(w)),u=s?i.form||!!s.closest("form"):!0,d=zs(s),m=i.values[o],v=m===void 0?0:ND(m,i.min,i.max),g=zq(o,i.values.length),x=d==null?void 0:d[l.size],h=x?Lq(x,v,l.direction):0;return p.useEffect(()=>{if(s)return i.thumbs.add(s),()=>{i.thumbs.delete(s)}},[s,i.thumbs]),re("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${v}% + ${h}px)`},children:[b(zh.ItemSlot,{scope:e.__scopeSlider,children:b(oe.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":i.min,"aria-valuenow":m,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...a,ref:f,style:m===void 0?{display:"none"}:e.style,onFocus:j(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})}),u&&b(CD,{name:r??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:m},o)]})});ED.displayName=Lh;var Oq="RadioBubbleInput",CD=p.forwardRef(({__scopeSlider:e,value:t,...n},o)=>{const r=p.useRef(null),a=le(r,o),i=Ii(t);return p.useEffect(()=>{const l=r.current;if(!l)return;const s=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(s,"value").set;if(i!==t&&f){const u=new Event("input",{bubbles:!0});f.call(l,t),l.dispatchEvent(u)}},[i,t]),b(oe.input,{style:{display:"none"},...n,ref:a,defaultValue:t})});CD.displayName=Oq;function Pq(e=[],t,n){const o=[...e];return o[n]=t,o.sort((r,a)=>r-a)}function ND(e,t,n){const a=100/(n-t)*(e-t);return cs(a,[0,100])}function zq(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Iq(e,t){if(e.length===1)return 0;const n=e.map(r=>Math.abs(r-t)),o=Math.min(...n);return n.indexOf(o)}function Lq(e,t,n){const o=e/2,a=Ay([0,50],[0,o]);return(o-a(t)*n)*n}function kq(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function $q(e,t){if(t>0){const n=kq(e);return Math.min(...n)>=t}return!0}function Ay(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function Hq(e){return(String(e).split(".")[1]||"").length}function Bq(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var _D=gD,Uq=xD,Vq=SD,Gq=ED;const Yq=p.forwardRef(({className:e,...t},n)=>re(_D,{ref:n,className:X("relative flex w-full touch-none select-none items-center",e),...t,children:[b(Uq,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:b(Vq,{className:"absolute h-full bg-primary"})}),b(Gq,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Yq.displayName=_D.displayName;var _f="Switch",[Fq,JQ]=Ue(_f),[Xq,Kq]=Fq(_f),RD=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:a,required:i,disabled:l,value:s="on",onCheckedChange:c,form:f,...u}=e,[d,m]=p.useState(null),v=le(t,y=>m(y)),g=p.useRef(!1),x=d?f||!!d.closest("form"):!0,[h,w]=ht({prop:r,defaultProp:a??!1,onChange:c,caller:_f});return re(Xq,{scope:n,checked:h,disabled:l,children:[b(oe.button,{type:"button",role:"switch","aria-checked":h,"aria-required":i,"data-state":DD(h),"data-disabled":l?"":void 0,disabled:l,value:s,...u,ref:v,onClick:j(e.onClick,y=>{w(S=>!S),x&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})}),x&&b(MD,{control:d,bubbles:!g.current,name:o,value:s,checked:h,required:i,disabled:l,form:f,style:{transform:"translateX(-100%)"}})]})});RD.displayName=_f;var TD="SwitchThumb",AD=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=Kq(TD,n);return b(oe.span,{"data-state":DD(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});AD.displayName=TD;var jq="SwitchBubbleInput",MD=p.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},a)=>{const i=p.useRef(null),l=le(i,a),s=Ii(n),c=zs(t);return p.useEffect(()=>{const f=i.current;if(!f)return;const u=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&m){const v=new Event("click",{bubbles:o});m.call(f,n),f.dispatchEvent(v)}},[s,n,o]),b("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:l,style:{...r.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});MD.displayName=jq;function DD(e){return e?"checked":"unchecked"}var OD=RD,qq=AD;const Zq=p.forwardRef(({className:e,...t},n)=>b(OD,{className:X("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:b(qq,{className:X("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Zq.displayName=OD.displayName;const Qq=p.forwardRef(({className:e,...t},n)=>b("div",{className:"relative w-full overflow-auto",children:b("table",{ref:n,className:X("w-full caption-bottom text-sm",e),...t})}));Qq.displayName="Table";const Wq=p.forwardRef(({className:e,...t},n)=>b("thead",{ref:n,className:X("[&_tr]:border-b",e),...t}));Wq.displayName="TableHeader";const Jq=p.forwardRef(({className:e,...t},n)=>b("tbody",{ref:n,className:X("[&_tr:last-child]:border-0",e),...t}));Jq.displayName="TableBody";const eZ=p.forwardRef(({className:e,...t},n)=>b("tfoot",{ref:n,className:X("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));eZ.displayName="TableFooter";const tZ=p.forwardRef(({className:e,...t},n)=>b("tr",{ref:n,className:X("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));tZ.displayName="TableRow";const nZ=p.forwardRef(({className:e,...t},n)=>b("th",{ref:n,className:X("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));nZ.displayName="TableHead";const oZ=p.forwardRef(({className:e,...t},n)=>b("td",{ref:n,className:X("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));oZ.displayName="TableCell";const rZ=p.forwardRef(({className:e,...t},n)=>b("caption",{ref:n,className:X("mt-4 text-sm text-muted-foreground",e),...t}));rZ.displayName="TableCaption";var Rf="Tabs",[aZ,eW]=Ue(Rf,[Xn]),PD=Xn(),[iZ,My]=aZ(Rf),lZ=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:a,orientation:i="horizontal",dir:l,activationMode:s="automatic",...c}=e,f=Eo(l),[u,d]=ht({prop:o,onChange:r,defaultProp:a??"",caller:Rf});return b(iZ,{scope:n,baseId:mt(),value:u,onValueChange:d,orientation:i,dir:f,activationMode:s,children:b(oe.div,{dir:f,"data-orientation":i,...c,ref:t})})});lZ.displayName=Rf;var zD="TabsList",ID=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,a=My(zD,n),i=PD(n);return b(Bs,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:o,children:b(oe.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:t})})});ID.displayName=zD;var LD="TabsTrigger",kD=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...a}=e,i=My(LD,n),l=PD(n),s=BD(i.baseId,o),c=UD(i.baseId,o),f=o===i.value;return b(Us,{asChild:!0,...l,focusable:!r,active:f,children:b(oe.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:s,...a,ref:t,onMouseDown:j(e.onMouseDown,u=>{!r&&u.button===0&&u.ctrlKey===!1?i.onValueChange(o):u.preventDefault()}),onKeyDown:j(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&i.onValueChange(o)}),onFocus:j(e.onFocus,()=>{const u=i.activationMode!=="manual";!f&&!r&&u&&i.onValueChange(o)})})})});kD.displayName=LD;var $D="TabsContent",HD=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:a,...i}=e,l=My($D,n),s=BD(l.baseId,o),c=UD(l.baseId,o),f=o===l.value,u=p.useRef(f);return p.useEffect(()=>{const d=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(d)},[]),b(Pe,{present:r||f,children:({present:d})=>b(oe.div,{"data-state":f?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":s,hidden:!d,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:d&&a})})});HD.displayName=$D;function BD(e,t){return`${e}-trigger-${t}`}function UD(e,t){return`${e}-content-${t}`}var VD=ID,GD=kD,YD=HD;const sZ=p.forwardRef(({className:e,...t},n)=>b(VD,{ref:n,className:X("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));sZ.displayName=VD.displayName;const cZ=p.forwardRef(({className:e,...t},n)=>b(GD,{ref:n,className:X("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));cZ.displayName=GD.displayName;const uZ=p.forwardRef(({className:e,...t},n)=>b(YD,{ref:n,className:X("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));uZ.displayName=YD.displayName;const dZ=p.forwardRef(({className:e,...t},n)=>b("textarea",{className:X("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));dZ.displayName="Textarea";var fZ="ToastProvider",[FD,pZ,mZ]=So("Toast"),[XD,tW]=Ue("Toast",[mZ]),[nW,Tf]=XD(fZ),KD="ToastViewport",hZ=["F8"],kh="toast.viewportPause",$h="toast.viewportResume",jD=p.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:o=hZ,label:r="Notifications ({hotkey})",...a}=e,i=Tf(KD,n),l=pZ(n),s=p.useRef(null),c=p.useRef(null),f=p.useRef(null),u=p.useRef(null),d=le(t,u,i.onViewportChange),m=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;p.useEffect(()=>{const x=h=>{var y;o.length!==0&&o.every(S=>h[S]||h.code===S)&&((y=u.current)==null||y.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[o]),p.useEffect(()=>{const x=s.current,h=u.current;if(v&&x&&h){const w=()=>{if(!i.isClosePausedRef.current){const N=new CustomEvent(kh);h.dispatchEvent(N),i.isClosePausedRef.current=!0}},y=()=>{if(i.isClosePausedRef.current){const N=new CustomEvent($h);h.dispatchEvent(N),i.isClosePausedRef.current=!1}},S=N=>{!x.contains(N.relatedTarget)&&y()},E=()=>{x.contains(document.activeElement)||y()};return x.addEventListener("focusin",w),x.addEventListener("focusout",S),x.addEventListener("pointermove",w),x.addEventListener("pointerleave",E),window.addEventListener("blur",w),window.addEventListener("focus",y),()=>{x.removeEventListener("focusin",w),x.removeEventListener("focusout",S),x.removeEventListener("pointermove",w),x.removeEventListener("pointerleave",E),window.removeEventListener("blur",w),window.removeEventListener("focus",y)}}},[v,i.isClosePausedRef]);const g=p.useCallback(({tabbingDirection:x})=>{const w=l().map(y=>{const S=y.ref.current,E=[S,...TZ(S)];return x==="forwards"?E:E.reverse()});return(x==="forwards"?w.reverse():w).flat()},[l]);return p.useEffect(()=>{const x=u.current;if(x){const h=w=>{var E,N,C;const y=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!y){const A=document.activeElement,T=w.shiftKey;if(w.target===x&&T){(E=c.current)==null||E.focus();return}const O=g({tabbingDirection:T?"backwards":"forwards"}),P=O.findIndex(_=>_===A);qp(O.slice(P+1))?w.preventDefault():T?(N=c.current)==null||N.focus():(C=f.current)==null||C.focus()}};return x.addEventListener("keydown",h),()=>x.removeEventListener("keydown",h)}},[l,g]),re($8,{ref:s,role:"region","aria-label":r.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&b(Hh,{ref:c,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"forwards"});qp(x)}}),b(FD.Slot,{scope:n,children:b(oe.ol,{tabIndex:-1,...a,ref:d})}),v&&b(Hh,{ref:f,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"backwards"});qp(x)}})]})});jD.displayName=KD;var qD="ToastFocusProxy",Hh=p.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:o,...r}=e,a=Tf(qD,n);return b(yf,{tabIndex:0,...r,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const l=i.relatedTarget;!((c=a.viewport)!=null&&c.contains(l))&&o()}})});Hh.displayName=qD;var Xs="Toast",gZ="toast.swipeStart",vZ="toast.swipeMove",yZ="toast.swipeCancel",bZ="toast.swipeEnd",ZD=p.forwardRef((e,t)=>{const{forceMount:n,open:o,defaultOpen:r,onOpenChange:a,...i}=e,[l,s]=ht({prop:o,defaultProp:r??!0,onChange:a,caller:Xs});return b(Pe,{present:n||l,children:b(SZ,{open:l,...i,ref:t,onClose:()=>s(!1),onPause:Ae(e.onPause),onResume:Ae(e.onResume),onSwipeStart:j(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:j(e.onSwipeMove,c=>{const{x:f,y:u}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${u}px`)}),onSwipeCancel:j(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:j(e.onSwipeEnd,c=>{const{x:f,y:u}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${u}px`),s(!1)})})})});ZD.displayName=Xs;var[wZ,xZ]=XD(Xs,{onClose(){}}),SZ=p.forwardRef((e,t)=>{const{__scopeToast:n,type:o="foreground",duration:r,open:a,onClose:i,onEscapeKeyDown:l,onPause:s,onResume:c,onSwipeStart:f,onSwipeMove:u,onSwipeCancel:d,onSwipeEnd:m,...v}=e,g=Tf(Xs,n),[x,h]=p.useState(null),w=le(t,_=>h(_)),y=p.useRef(null),S=p.useRef(null),E=r||g.duration,N=p.useRef(0),C=p.useRef(E),A=p.useRef(0),{onToastAdd:T,onToastRemove:k}=g,z=Ae(()=>{var L;(x==null?void 0:x.contains(document.activeElement))&&((L=g.viewport)==null||L.focus()),i()}),O=p.useCallback(_=>{!_||_===1/0||(window.clearTimeout(A.current),N.current=new Date().getTime(),A.current=window.setTimeout(z,_))},[z]);p.useEffect(()=>{const _=g.viewport;if(_){const L=()=>{O(C.current),c==null||c()},R=()=>{const I=new Date().getTime()-N.current;C.current=C.current-I,window.clearTimeout(A.current),s==null||s()};return _.addEventListener(kh,R),_.addEventListener($h,L),()=>{_.removeEventListener(kh,R),_.removeEventListener($h,L)}}},[g.viewport,E,s,c,O]),p.useEffect(()=>{a&&!g.isClosePausedRef.current&&O(E)},[a,E,g.isClosePausedRef,O]),p.useEffect(()=>(T(),()=>k()),[T,k]);const P=p.useMemo(()=>x?oO(x):null,[x]);return g.viewport?re(De,{children:[P&&b(EZ,{__scopeToast:n,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:P}),b(wZ,{scope:n,onClose:z,children:Jr.createPortal(b(FD.ItemSlot,{scope:n,children:b(k8,{asChild:!0,onEscapeKeyDown:j(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||z(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:b(oe.li,{tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":g.swipeDirection,...v,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:j(e.onKeyDown,_=>{_.key==="Escape"&&(l==null||l(_.nativeEvent),_.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,z()))}),onPointerDown:j(e.onPointerDown,_=>{_.button===0&&(y.current={x:_.clientX,y:_.clientY})}),onPointerMove:j(e.onPointerMove,_=>{if(!y.current)return;const L=_.clientX-y.current.x,R=_.clientY-y.current.y,I=!!S.current,D=["left","right"].includes(g.swipeDirection),M=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,U=D?M(0,L):0,F=D?0:M(0,R),$=_.pointerType==="touch"?10:2,H={x:U,y:F},V={originalEvent:_,delta:H};I?(S.current=H,zc(vZ,u,V,{discrete:!1})):Cx(H,g.swipeDirection,$)?(S.current=H,zc(gZ,f,V,{discrete:!1}),_.target.setPointerCapture(_.pointerId)):(Math.abs(L)>$||Math.abs(R)>$)&&(y.current=null)}),onPointerUp:j(e.onPointerUp,_=>{const L=S.current,R=_.target;if(R.hasPointerCapture(_.pointerId)&&R.releasePointerCapture(_.pointerId),S.current=null,y.current=null,L){const I=_.currentTarget,D={originalEvent:_,delta:L};Cx(L,g.swipeDirection,g.swipeThreshold)?zc(bZ,m,D,{discrete:!0}):zc(yZ,d,D,{discrete:!0}),I.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),EZ=e=>{const{__scopeToast:t,children:n,...o}=e,r=Tf(Xs,t),[a,i]=p.useState(!1),[l,s]=p.useState(!1);return _Z(()=>i(!0)),p.useEffect(()=>{const c=window.setTimeout(()=>s(!0),1e3);return()=>window.clearTimeout(c)},[]),l?null:b(ia,{asChild:!0,children:b(yf,{...o,children:a&&re(De,{children:[r.label," ",n]})})})},CZ="ToastTitle",QD=p.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return b(oe.div,{...o,ref:t})});QD.displayName=CZ;var NZ="ToastDescription",WD=p.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return b(oe.div,{...o,ref:t})});WD.displayName=NZ;var JD="ToastAction",eO=p.forwardRef((e,t)=>{const{altText:n,...o}=e;return n.trim()?b(nO,{altText:n,asChild:!0,children:b(Dy,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${JD}\`. Expected non-empty \`string\`.`),null)});eO.displayName=JD;var tO="ToastClose",Dy=p.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e,r=xZ(tO,n);return b(nO,{asChild:!0,children:b(oe.button,{type:"button",...o,ref:t,onClick:j(e.onClick,r.onClose)})})});Dy.displayName=tO;var nO=p.forwardRef((e,t)=>{const{__scopeToast:n,altText:o,...r}=e;return b(oe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...r,ref:t})});function oO(e){const t=[];return Array.from(e.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),RZ(o)){const r=o.ariaHidden||o.hidden||o.style.display==="none",a=o.dataset.radixToastAnnounceExclude==="";if(!r)if(a){const i=o.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...oO(o))}}),t}function zc(e,t,n,{discrete:o}){const r=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?ns(r,a):r.dispatchEvent(a)}var Cx=(e,t,n=0)=>{const o=Math.abs(e.x),r=Math.abs(e.y),a=o>r;return t==="left"||t==="right"?a&&o>n:!a&&r>n};function _Z(e=()=>{}){const t=Ae(e);He(()=>{let n=0,o=0;return n=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(o)}},[t])}function RZ(e){return e.nodeType===e.ELEMENT_NODE}function TZ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qp(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var rO=jD,aO=ZD,iO=QD,lO=WD,sO=eO,cO=Dy;const AZ=p.forwardRef(({className:e,...t},n)=>b(rO,{ref:n,className:X("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));AZ.displayName=rO.displayName;const MZ=aa("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),DZ=p.forwardRef(({className:e,variant:t,...n},o)=>b(aO,{ref:o,className:X(MZ({variant:t}),e),...n}));DZ.displayName=aO.displayName;const OZ=p.forwardRef(({className:e,...t},n)=>b(sO,{ref:n,className:X("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));OZ.displayName=sO.displayName;const PZ=p.forwardRef(({className:e,...t},n)=>b(cO,{ref:n,className:X("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:b(mv,{className:"h-4 w-4"})}));PZ.displayName=cO.displayName;const zZ=p.forwardRef(({className:e,...t},n)=>b(iO,{ref:n,className:X("text-sm font-semibold",e),...t}));zZ.displayName=iO.displayName;const IZ=p.forwardRef(({className:e,...t},n)=>b(lO,{ref:n,className:X("text-sm opacity-90",e),...t}));IZ.displayName=lO.displayName;var LZ=(e,t,n,o,r,a,i,l)=>{let s=document.documentElement,c=["light","dark"];function f(m){(Array.isArray(e)?e:[e]).forEach(v=>{let g=v==="class",x=g&&a?r.map(h=>a[h]||h):r;g?(s.classList.remove(...x),s.classList.add(a&&a[m]?a[m]:m)):s.setAttribute(v,m)}),u(m)}function u(m){l&&c.includes(m)&&(s.style.colorScheme=m)}function d(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)f(o);else try{let m=localStorage.getItem(t)||n,v=i&&m==="system"?d():m;f(v)}catch{}};p.createContext(void 0);p.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:o,enableColorScheme:r,defaultTheme:a,value:i,themes:l,nonce:s,scriptProps:c})=>{let f=JSON.stringify([n,t,a,e,l,i,o,r]).slice(1,-1);return p.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?s:"",dangerouslySetInnerHTML:{__html:`(${LZ.toString()})(${f})`}})});function kZ(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);let Bh=1;class $Z{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:o,...r}=t,a=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Bh++,i=this.toasts.find(s=>s.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(s=>s.id===a?(this.publish({...s,...t,id:a,title:o}),{...s,...t,id:a,dismissible:l,title:o}):s):this.addToast({title:o,...r,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let o;n.loading!==void 0&&(o=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let a=o!==void 0,i;const l=r.then(async c=>{if(i=["resolve",c],ie.isValidElement(c))a=!1,this.create({id:o,type:"default",message:c});else if(BZ(c)&&!c.ok){a=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,d=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,v=typeof u=="object"&&!ie.isValidElement(u)?u:{message:u};this.create({id:o,type:"error",description:d,...v})}else if(c instanceof Error){a=!1;const u=typeof n.error=="function"?await n.error(c):n.error,d=typeof n.description=="function"?await n.description(c):n.description,v=typeof u=="object"&&!ie.isValidElement(u)?u:{message:u};this.create({id:o,type:"error",description:d,...v})}else if(n.success!==void 0){a=!1;const u=typeof n.success=="function"?await n.success(c):n.success,d=typeof n.description=="function"?await n.description(c):n.description,v=typeof u=="object"&&!ie.isValidElement(u)?u:{message:u};this.create({id:o,type:"success",description:d,...v})}}).catch(async c=>{if(i=["reject",c],n.error!==void 0){a=!1;const f=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,m=typeof f=="object"&&!ie.isValidElement(f)?f:{message:f};this.create({id:o,type:"error",description:u,...m})}}).finally(()=>{a&&(this.dismiss(o),o=void 0),n.finally==null||n.finally.call(n)}),s=()=>new Promise((c,f)=>l.then(()=>i[0]==="reject"?f(i[1]):c(i[1])).catch(f));return typeof o!="string"&&typeof o!="number"?{unwrap:s}:Object.assign(o,{unwrap:s})},this.custom=(t,n)=>{const o=(n==null?void 0:n.id)||Bh++;return this.create({jsx:t(o),id:o,...n}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Jt=new $Z,HZ=(e,t)=>{const n=(t==null?void 0:t.id)||Bh++;return Jt.addToast({title:e,...t,id:n}),n},BZ=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",UZ=HZ,VZ=()=>Jt.toasts,GZ=()=>Jt.getActiveToasts();Object.assign(UZ,{success:Jt.success,info:Jt.info,warning:Jt.warning,error:Jt.error,custom:Jt.custom,message:Jt.message,promise:Jt.promise,dismiss:Jt.dismiss,loading:Jt.loading},{getHistory:VZ,getToasts:GZ});kZ("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");var uO="Toggle",Oy=p.forwardRef((e,t)=>{const{pressed:n,defaultPressed:o,onPressedChange:r,...a}=e,[i,l]=ht({prop:n,onChange:r,defaultProp:o??!1,caller:uO});return b(oe.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:j(e.onClick,()=>{e.disabled||l(!i)})})});Oy.displayName=uO;var dO=Oy;const fO=aa("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3 min-w-10",sm:"h-9 px-2.5 min-w-9",lg:"h-11 px-5 min-w-11"}},defaultVariants:{variant:"default",size:"default"}}),YZ=p.forwardRef(({className:e,variant:t,size:n,...o},r)=>b(dO,{ref:r,className:X(fO({variant:t,size:n,className:e})),...o}));YZ.displayName=dO.displayName;var gr="ToggleGroup",[pO,oW]=Ue(gr,[Xn]),mO=Xn(),Py=ie.forwardRef((e,t)=>{const{type:n,...o}=e;if(n==="single")return b(FZ,{...o,ref:t});if(n==="multiple")return b(XZ,{...o,ref:t});throw new Error(`Missing prop \`type\` expected on \`${gr}\``)});Py.displayName=gr;var[hO,gO]=pO(gr),FZ=ie.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},...a}=e,[i,l]=ht({prop:n,defaultProp:o??"",onChange:r,caller:gr});return b(hO,{scope:e.__scopeToggleGroup,type:"single",value:ie.useMemo(()=>i?[i]:[],[i]),onItemActivate:l,onItemDeactivate:ie.useCallback(()=>l(""),[l]),children:b(vO,{...a,ref:t})})}),XZ=ie.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},...a}=e,[i,l]=ht({prop:n,defaultProp:o??[],onChange:r,caller:gr}),s=ie.useCallback(f=>l((u=[])=>[...u,f]),[l]),c=ie.useCallback(f=>l((u=[])=>u.filter(d=>d!==f)),[l]);return b(hO,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:s,onItemDeactivate:c,children:b(vO,{...a,ref:t})})});Py.displayName=gr;var[KZ,jZ]=pO(gr),vO=ie.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:o=!1,rovingFocus:r=!0,orientation:a,dir:i,loop:l=!0,...s}=e,c=mO(n),f=Eo(i),u={role:"group",dir:f,...s};return b(KZ,{scope:n,rovingFocus:r,disabled:o,children:r?b(Bs,{asChild:!0,...c,orientation:a,dir:f,loop:l,children:b(oe.div,{...u,ref:t})}):b(oe.div,{...u,ref:t})})}),hd="ToggleGroupItem",yO=ie.forwardRef((e,t)=>{const n=gO(hd,e.__scopeToggleGroup),o=jZ(hd,e.__scopeToggleGroup),r=mO(e.__scopeToggleGroup),a=n.value.includes(e.value),i=o.disabled||e.disabled,l={...e,pressed:a,disabled:i},s=ie.useRef(null);return o.rovingFocus?b(Us,{asChild:!0,...r,focusable:!i,active:a,ref:s,children:b(Nx,{...l,ref:t})}):b(Nx,{...l,ref:t})});yO.displayName=hd;var Nx=ie.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:o,...r}=e,a=gO(hd,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=a.type==="single"?i:void 0;return b(Oy,{...l,...r,ref:t,onPressedChange:s=>{s?a.onItemActivate(o):a.onItemDeactivate(o)}})}),bO=Py,wO=yO;const xO=p.createContext({size:"default",variant:"default"}),qZ=p.forwardRef(({className:e,variant:t,size:n,children:o,...r},a)=>b(bO,{ref:a,className:X("flex items-center justify-center gap-1",e),...r,children:b(xO.Provider,{value:{variant:t,size:n},children:o})}));qZ.displayName=bO.displayName;const ZZ=p.forwardRef(({className:e,children:t,variant:n,size:o,...r},a)=>{const i=p.useContext(xO);return b(wO,{ref:a,className:X(fO({variant:i.variant||n,size:i.size||o}),e),...r,children:t})});ZZ.displayName=wO.displayName;var[Af,rW]=Ue("Tooltip",[Fn]),zy=Fn(),QZ="TooltipProvider",_x="tooltip.open",[aW,SO]=Af(QZ),EO="Tooltip",[iW,Ks]=Af(EO),Uh="TooltipTrigger",WZ=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ks(Uh,n),a=SO(Uh,n),i=zy(n),l=p.useRef(null),s=le(t,l,r.onTriggerChange),c=p.useRef(!1),f=p.useRef(!1),u=p.useCallback(()=>c.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),b($i,{asChild:!0,...i,children:b(oe.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:s,onPointerMove:j(e.onPointerMove,d=>{d.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:j(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:j(e.onPointerDown,()=>{r.open&&r.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:j(e.onFocus,()=>{c.current||r.onOpen()}),onBlur:j(e.onBlur,r.onClose),onClick:j(e.onClick,r.onClose)})})});WZ.displayName=Uh;var Iy="TooltipPortal",[JZ,eQ]=Af(Iy,{forceMount:void 0}),CO=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,a=Ks(Iy,t);return b(JZ,{scope:t,forceMount:n,children:b(Pe,{present:n||a.open,children:b(ia,{asChild:!0,container:r,children:o})})})};CO.displayName=Iy;var Ei="TooltipContent",NO=p.forwardRef((e,t)=>{const n=eQ(Ei,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...a}=e,i=Ks(Ei,e.__scopeTooltip);return b(Pe,{present:o||i.open,children:i.disableHoverableContent?b(_O,{side:r,...a,ref:t}):b(tQ,{side:r,...a,ref:t})})}),tQ=p.forwardRef((e,t)=>{const n=Ks(Ei,e.__scopeTooltip),o=SO(Ei,e.__scopeTooltip),r=p.useRef(null),a=le(t,r),[i,l]=p.useState(null),{trigger:s,onClose:c}=n,f=r.current,{onPointerInTransitChange:u}=o,d=p.useCallback(()=>{l(null),u(!1)},[u]),m=p.useCallback((v,g)=>{const x=v.currentTarget,h={x:v.clientX,y:v.clientY},w=iQ(h,x.getBoundingClientRect()),y=lQ(h,w),S=sQ(g.getBoundingClientRect()),E=uQ([...y,...S]);l(E),u(!0)},[u]);return p.useEffect(()=>()=>d(),[d]),p.useEffect(()=>{if(s&&f){const v=x=>m(x,f),g=x=>m(x,s);return s.addEventListener("pointerleave",v),f.addEventListener("pointerleave",g),()=>{s.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",g)}}},[s,f,m,d]),p.useEffect(()=>{if(i){const v=g=>{const x=g.target,h={x:g.clientX,y:g.clientY},w=(s==null?void 0:s.contains(x))||(f==null?void 0:f.contains(x)),y=!cQ(h,i);w?d():y&&(d(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[s,f,i,c,d]),b(_O,{...e,ref:a})}),[nQ,oQ]=Af(EO,{isInside:!1}),rQ=EN("TooltipContent"),_O=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:a,onPointerDownOutside:i,...l}=e,s=Ks(Ei,n),c=zy(n),{onClose:f}=s;return p.useEffect(()=>(document.addEventListener(_x,f),()=>document.removeEventListener(_x,f)),[f]),p.useEffect(()=>{if(s.trigger){const u=d=>{const m=d.target;m!=null&&m.contains(s.trigger)&&f()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[s.trigger,f]),b(Co,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:u=>u.preventDefault(),onDismiss:f,children:re(ks,{"data-state":s.stateAttribute,...c,...l,ref:t,style:{...l.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:[b(rQ,{children:o}),b(nQ,{scope:n,isInside:!0,children:b(rM,{id:s.contentId,role:"tooltip",children:r||o})})]})})});NO.displayName=Ei;var RO="TooltipArrow",aQ=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=zy(n);return oQ(RO,n).isInside?null:b($s,{...r,...o,ref:t})});aQ.displayName=RO;function iQ(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,o,r,a)){case a:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function lQ(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function sQ(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function cQ(e,t){const{x:n,y:o}=e;let r=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const l=t[a],s=t[i],c=l.x,f=l.y,u=s.x,d=s.y;f>o!=d>o&&n<(u-c)*(o-f)/(d-f)+c&&(r=!r)}return r}function uQ(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),dQ(t)}function dQ(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var fQ=CO,TO=NO;const pQ=p.forwardRef(({className:e,sideOffset:t=4,...n},o)=>b(fQ,{children:b(TO,{ref:o,sideOffset:t,className:X("z-[10000] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n})}));pQ.displayName=TO.displayName;const mQ={blueprint:{accent:"border-l-primary",badge:"bg-primary/10 text-primary",dot:"bg-primary"},logic:{accent:"border-l-sky-500 dark:border-l-sky-400",badge:"bg-sky-500/10 text-sky-700 dark:text-sky-300",dot:"bg-sky-500"}};function hQ(){return re("div",{className:"flex shrink-0 flex-col gap-[3px] opacity-35","aria-hidden":"true",children:[re("span",{className:"flex gap-[3px]",children:[b("span",{className:"h-[3px] w-[3px] rounded-full bg-current"}),b("span",{className:"h-[3px] w-[3px] rounded-full bg-current"})]}),re("span",{className:"flex gap-[3px]",children:[b("span",{className:"h-[3px] w-[3px] rounded-full bg-current"}),b("span",{className:"h-[3px] w-[3px] rounded-full bg-current"})]})]})}function gQ({nodeId:e,label:t,variant:n="blueprint",selected:o=!1,onSelect:r}){const a=mQ[n];return re("div",{"data-blueprint-node-card":!0,className:X("bp-node-card w-[168px] overflow-hidden rounded-lg border border-border bg-card text-card-foreground shadow-sm","border-l-[3px] transition-[box-shadow,border-color] duration-150",a.accent,o&&"border-primary/50 shadow-[0_0_0_1px_hsl(var(--primary)/0.35),0_4px_12px_hsl(var(--primary)/0.12)]"),children:[b("div",{className:X("bp-flow-drag-handle flex cursor-grab items-center gap-2 border-b border-border/50 px-2 py-1.5","bg-muted/25 text-muted-foreground active:cursor-grabbing"),title:"拖拽移动",children:b(hQ,{})}),re("button",{type:"button",className:X("nodrag flex w-full items-start gap-2 px-2.5 py-2 text-left","outline-none transition-colors hover:bg-accent/30","focus-visible:ring-1 focus-visible:ring-primary focus-visible:ring-inset"),onClick:i=>{i.stopPropagation(),r==null||r(e)},children:[b("span",{className:X("mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full",a.dot),"aria-hidden":"true"}),b("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium leading-snug text-foreground",children:t})]})]})}function AO({selected:e=!1,...t}){return re("div",{className:X("bp-node",e&&"bp-node--selected"),children:[b(yi,{type:"target",position:se.Left,id:"in",className:"bp-flow-handle bp-flow-handle--target"}),b(gQ,{...t,selected:e}),b(yi,{type:"source",position:se.Right,id:"out",className:"bp-flow-handle bp-flow-handle--source"})]})}function vQ({id:e,data:t,onSelect:n}){const o=t,r=!!o.isSelected;return b(AO,{nodeId:e,label:o.label,meta:"蓝图",variant:"blueprint",selected:r,onSelect:n})}function yQ({id:e,data:t,onSelect:n}){const o=t,r=!!o.isSelected;return b(AO,{nodeId:e,label:o.label,meta:o.nodeType,variant:"logic",selected:r,onSelect:n})}function bQ(e){const t=n=>{e==null||e(n)};return{blueprint:n=>b(vQ,{...n,onSelect:t}),logic:n=>b(yQ,{...n,onSelect:t})}}function wQ(e,t){const{fitView:n}=Ts(),o=oB(),r=p.useRef({w:0,h:0});p.useEffect(()=>{const a=e.current;if(!a)return;const i=()=>{const{clientWidth:s,clientHeight:c}=a;if(s<8||c<8)return;const f=Math.abs(s-r.current.w)>2||Math.abs(c-r.current.h)>2;r.current={w:s,h:c};for(const u of t)o(u);t.length>0&&f&&requestAnimationFrame(()=>{n({padding:.2,duration:0,includeHiddenNodes:!0})})};i();const l=new ResizeObserver(i);return l.observe(a),()=>l.disconnect()},[e,t,n,o])}function xQ({graph:e,onGraphChange:t,selectedNodeId:n=null,onSelectNode:o,containerRef:r}){const{screenToFlowPosition:a,getNodes:i}=Ts(),[l,s]=p.useState(null),c=p.useRef({x:0,y:0}),f=p.useRef(ww(e.document.nodes)),[u,d,m]=rB(xw(e,n)),v=p.useMemo(()=>ah(e),[e]),g=p.useMemo(()=>u.map(P=>P.id),[u]);wQ(r,g);const x=p.useCallback(P=>{t(_=>P(_))},[t]);p.useEffect(()=>{const P=ww(e.document.nodes);P!==f.current&&(f.current=P,d(_=>$B(xw(e,n),_)))},[e.document.nodes,n,d,e]),p.useEffect(()=>{d(P=>P.map(_=>({..._,data:{..._.data,isSelected:n===_.id}})))},[n,d]);const h=p.useMemo(()=>bQ(o),[o]),w=p.useMemo(()=>YB(),[]),y=p.useCallback(P=>{m(P);const _=P.filter(I=>I.type!=="select"&&I.type!=="dimensions");if(_.length===0)return;const L=_.filter(I=>I.type==="remove");(L.length>0||_.some(I=>I.type==="position"&&"dragging"in I&&I.dragging===!1))&&d(I=>(t(D=>{let M=D;for(const U of L)U.type==="remove"&&(U.id===n&&(o==null||o(null)),M=M.removeNode(U.id));return Sw(M,I)}),I))},[m,o,n,t,d]),S=p.useCallback(()=>{const P=i();t(_=>Sw(_,P))},[i,t]),E=p.useCallback(P=>{const _=P.filter(L=>L.type==="remove").map(L=>L.id);_.length!==0&&t(L=>{let R=L;for(const I of _)R=R.removeEdge(I);return R})},[t]),N=p.useCallback(P=>{const _=HB(P,u);_&&t(L=>{if(L.document.edges.some(D=>D.source===_.source&&D.target===_.target&&(D.sourceHandle??"out")===(_.sourceHandle??"out")&&(D.targetHandle??"in")===(_.targetHandle??"in")))return L;const I=tv({..._,type:ts,zIndex:1e3,style:{...Ku}},ah(L));return L.replaceEdges(xN(I))})},[u,t]),C=p.useCallback(P=>{if(!P.source||!P.target||P.source===P.target)return!1;const _=new Set(u.map(L=>L.id));return _.has(P.source)&&_.has(P.target)},[u]),A=p.useCallback(P=>{P.preventDefault(),c.current=a({x:P.clientX,y:P.clientY}),s({kind:"pane",clientX:P.clientX,clientY:P.clientY})},[a]),T=p.useCallback((P,_)=>{P.preventDefault(),o==null||o(_.id),c.current=a({x:P.clientX,y:P.clientY}),s({kind:"node",clientX:P.clientX,clientY:P.clientY,nodeId:_.id,role:_.data.role})},[o,a]),k=p.useCallback(()=>{x(P=>P.addBlueprintNode(c.current))},[x]),z=p.useCallback(P=>{x(_=>{const L=_.getNode(P),R=(L==null?void 0:L.position)??c.current;return _.addLogicNode(P,{x:R.x+40,y:R.y+80})})},[x]),O=p.useCallback(P=>{P===n&&(o==null||o(null)),x(_=>_.removeNode(P))},[o,n,x]);return re(De,{children:[b(nB,{className:"bp-flow h-full w-full",colorMode:"system",nodes:u,edges:v,nodeTypes:h,edgeTypes:w,onNodesChange:y,onEdgesChange:E,onConnect:N,isValidConnection:C,onPaneContextMenu:A,onNodeContextMenu:T,onNodeDragStop:S,onPaneClick:()=>{s(null),o==null||o(null)},nodesConnectable:!0,elementsSelectable:!0,connectionMode:Yr.Strict,defaultEdgeOptions:{type:ts,zIndex:1e3,style:{...Ku}},selectNodesOnDrag:!1,elevateNodesOnSelect:!1,nodeClickDistance:8,proOptions:{hideAttribution:!0}}),b(BB,{menu:l,onClose:()=>s(null),onAddBlueprintNode:k,onAddLogicNode:z,onDeleteNode:O})]})}const SQ=({style:e,graph:t,onGraphChange:n,selectedNodeId:o,onSelectNode:r})=>{const a=p.useRef(null);return b("div",{ref:a,"data-workspace-region":"blueprint",className:"bp-canvas h-full w-full",style:{width:"100%",height:"100%",minHeight:0,...e},children:b(vN,{children:b(xQ,{containerRef:a,graph:t,onGraphChange:n,selectedNodeId:o,onSelectNode:r})})})};function EQ(){let e=Xu.empty();e=e.addBlueprintNode({x:40,y:80},"节点 A");const t=e.document.nodes[0];e=e.addBlueprintNode({x:300,y:80},"节点 B");const n=e.document.nodes[1],o=tv({id:"dev-edge-1",source:t.id,target:n.id,sourceHandle:"out",targetHandle:"in",type:ts,zIndex:1e3,style:{...Ku}},ah(e));return e.replaceEdges(xN(o))}function CQ(){const[e,t]=p.useState(()=>EQ()),[n,o]=p.useState(null);return re(De,{children:[re("header",{className:"bp-dev-toolbar",children:[b("strong",{children:"Blueprint Dev"}),b("span",{className:"text-muted-foreground",children:"右键画布添加节点 · 从右侧圆点拖到左侧圆点连线 · 初始应看到 A→B 蓝线"}),re("span",{className:"text-muted-foreground",children:["节点 ",e.document.nodes.length," · 边 ",e.document.edges.length]})]}),b("div",{className:"bp-dev-canvas",children:b(SQ,{graph:e,onGraphChange:t,selectedNodeId:n,onSelectNode:o})})]})}pI.createRoot(document.getElementById("app")).render(b(CQ,{}));